Skip to content

Commit c2a5dd9

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

28 files changed

+678
-33
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:32:42.259"
2+
"spec_repo_commit": "4413e63",
3+
"generated": "2025-08-19 20:28:38.330"
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:

docs/datadog_api_client.v2.model.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15243,6 +15243,20 @@ datadog\_api\_client.v2.model.rum\_event\_attributes module
1524315243
:members:
1524415244
:show-inheritance:
1524515245

15246+
datadog\_api\_client.v2.model.rum\_event\_processing\_scale module
15247+
------------------------------------------------------------------
15248+
15249+
.. automodule:: datadog_api_client.v2.model.rum_event_processing_scale
15250+
:members:
15251+
:show-inheritance:
15252+
15253+
datadog\_api\_client.v2.model.rum\_event\_processing\_state module
15254+
------------------------------------------------------------------
15255+
15256+
.. automodule:: datadog_api_client.v2.model.rum_event_processing_state
15257+
:members:
15258+
:show-inheritance:
15259+
1524615260
datadog\_api\_client.v2.model.rum\_event\_type module
1524715261
-----------------------------------------------------
1524815262

@@ -15446,6 +15460,27 @@ datadog\_api\_client.v2.model.rum\_metrics\_response module
1544615460
:members:
1544715461
:show-inheritance:
1544815462

15463+
datadog\_api\_client.v2.model.rum\_product\_analytics\_retention\_scale module
15464+
------------------------------------------------------------------------------
15465+
15466+
.. automodule:: datadog_api_client.v2.model.rum_product_analytics_retention_scale
15467+
:members:
15468+
:show-inheritance:
15469+
15470+
datadog\_api\_client.v2.model.rum\_product\_analytics\_retention\_state module
15471+
------------------------------------------------------------------------------
15472+
15473+
.. automodule:: datadog_api_client.v2.model.rum_product_analytics_retention_state
15474+
:members:
15475+
:show-inheritance:
15476+
15477+
datadog\_api\_client.v2.model.rum\_product\_scales module
15478+
---------------------------------------------------------
15479+
15480+
.. automodule:: datadog_api_client.v2.model.rum_product_scales
15481+
:members:
15482+
:show-inheritance:
15483+
1544915484
datadog\_api\_client.v2.model.rum\_query\_filter module
1545015485
-------------------------------------------------------
1545115486

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""
2+
Create a new RUM application with Product Scales returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.rum_api import RUMApi
7+
from datadog_api_client.v2.model.rum_application_create import RUMApplicationCreate
8+
from datadog_api_client.v2.model.rum_application_create_attributes import RUMApplicationCreateAttributes
9+
from datadog_api_client.v2.model.rum_application_create_request import RUMApplicationCreateRequest
10+
from datadog_api_client.v2.model.rum_application_create_type import RUMApplicationCreateType
11+
from datadog_api_client.v2.model.rum_event_processing_state import RUMEventProcessingState
12+
from datadog_api_client.v2.model.rum_product_analytics_retention_state import RUMProductAnalyticsRetentionState
13+
14+
body = RUMApplicationCreateRequest(
15+
data=RUMApplicationCreate(
16+
attributes=RUMApplicationCreateAttributes(
17+
name="test-rum-with-product-scales-5c67ebb32077e1d9",
18+
type="browser",
19+
rum_event_processing_state=RUMEventProcessingState.ERROR_FOCUSED_MODE,
20+
product_analytics_retention_state=RUMProductAnalyticsRetentionState.NONE,
21+
),
22+
type=RUMApplicationCreateType.RUM_APPLICATION_CREATE,
23+
),
24+
)
25+
26+
configuration = Configuration()
27+
with ApiClient(configuration) as api_client:
28+
api_instance = RUMApi(api_client)
29+
response = api_instance.create_rum_application(body=body)
30+
31+
print(response)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""
2+
Update a RUM application with Product Scales returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.rum_api import RUMApi
8+
from datadog_api_client.v2.model.rum_application_update import RUMApplicationUpdate
9+
from datadog_api_client.v2.model.rum_application_update_attributes import RUMApplicationUpdateAttributes
10+
from datadog_api_client.v2.model.rum_application_update_request import RUMApplicationUpdateRequest
11+
from datadog_api_client.v2.model.rum_application_update_type import RUMApplicationUpdateType
12+
from datadog_api_client.v2.model.rum_event_processing_state import RUMEventProcessingState
13+
from datadog_api_client.v2.model.rum_product_analytics_retention_state import RUMProductAnalyticsRetentionState
14+
15+
# there is a valid "rum_application" in the system
16+
RUM_APPLICATION_DATA_ID = environ["RUM_APPLICATION_DATA_ID"]
17+
18+
body = RUMApplicationUpdateRequest(
19+
data=RUMApplicationUpdate(
20+
attributes=RUMApplicationUpdateAttributes(
21+
name="updated_rum_with_product_scales",
22+
rum_event_processing_state=RUMEventProcessingState.ALL,
23+
product_analytics_retention_state=RUMProductAnalyticsRetentionState.MAX,
24+
),
25+
id=RUM_APPLICATION_DATA_ID,
26+
type=RUMApplicationUpdateType.RUM_APPLICATION_UPDATE,
27+
),
28+
)
29+
30+
configuration = Configuration()
31+
with ApiClient(configuration) as api_client:
32+
api_instance = RUMApi(api_client)
33+
response = api_instance.update_rum_application(id=RUM_APPLICATION_DATA_ID, body=body)
34+
35+
print(response)

src/datadog_api_client/v2/model/rum_application_attributes.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -13,6 +13,10 @@
1313
)
1414

1515

16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.rum_product_scales import RUMProductScales
18+
19+
1620
class RUMApplicationAttributes(ModelNormal):
1721
validations = {
1822
"org_id": {
@@ -22,6 +26,8 @@ class RUMApplicationAttributes(ModelNormal):
2226

2327
@cached_property
2428
def openapi_types(_):
29+
from datadog_api_client.v2.model.rum_product_scales import RUMProductScales
30+
2531
return {
2632
"application_id": (str,),
2733
"client_token": (str,),
@@ -31,6 +37,7 @@ def openapi_types(_):
3137
"is_active": (bool,),
3238
"name": (str,),
3339
"org_id": (int,),
40+
"product_scales": (RUMProductScales,),
3441
"type": (str,),
3542
"updated_at": (int,),
3643
"updated_by_handle": (str,),
@@ -45,6 +52,7 @@ def openapi_types(_):
4552
"is_active": "is_active",
4653
"name": "name",
4754
"org_id": "org_id",
55+
"product_scales": "product_scales",
4856
"type": "type",
4957
"updated_at": "updated_at",
5058
"updated_by_handle": "updated_by_handle",
@@ -63,6 +71,7 @@ def __init__(
6371
updated_by_handle: str,
6472
hash: Union[str, UnsetType] = unset,
6573
is_active: Union[bool, UnsetType] = unset,
74+
product_scales: Union[RUMProductScales, UnsetType] = unset,
6675
**kwargs,
6776
):
6877
"""
@@ -92,6 +101,9 @@ def __init__(
92101
:param org_id: Org ID of the RUM application.
93102
:type org_id: int
94103
104+
:param product_scales: Product Scales configuration for the RUM application.
105+
:type product_scales: RUMProductScales, optional
106+
95107
:param type: Type of the RUM application. Supported values are ``browser`` , ``ios`` , ``android`` , ``react-native`` , ``flutter`` , ``roku`` , ``electron`` , ``unity`` , ``kotlin-multiplatform``.
96108
:type type: str
97109
@@ -105,6 +117,8 @@ def __init__(
105117
kwargs["hash"] = hash
106118
if is_active is not unset:
107119
kwargs["is_active"] = is_active
120+
if product_scales is not unset:
121+
kwargs["product_scales"] = product_scales
108122
super().__init__(kwargs)
109123

110124
self_.application_id = application_id

src/datadog_api_client/v2/model/rum_application_create_attributes.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -13,29 +13,58 @@
1313
)
1414

1515

16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.rum_product_analytics_retention_state import RUMProductAnalyticsRetentionState
18+
from datadog_api_client.v2.model.rum_event_processing_state import RUMEventProcessingState
19+
20+
1621
class RUMApplicationCreateAttributes(ModelNormal):
1722
@cached_property
1823
def openapi_types(_):
24+
from datadog_api_client.v2.model.rum_product_analytics_retention_state import RUMProductAnalyticsRetentionState
25+
from datadog_api_client.v2.model.rum_event_processing_state import RUMEventProcessingState
26+
1927
return {
2028
"name": (str,),
29+
"product_analytics_retention_state": (RUMProductAnalyticsRetentionState,),
30+
"rum_event_processing_state": (RUMEventProcessingState,),
2131
"type": (str,),
2232
}
2333

2434
attribute_map = {
2535
"name": "name",
36+
"product_analytics_retention_state": "product_analytics_retention_state",
37+
"rum_event_processing_state": "rum_event_processing_state",
2638
"type": "type",
2739
}
2840

29-
def __init__(self_, name: str, type: Union[str, UnsetType] = unset, **kwargs):
41+
def __init__(
42+
self_,
43+
name: str,
44+
product_analytics_retention_state: Union[RUMProductAnalyticsRetentionState, UnsetType] = unset,
45+
rum_event_processing_state: Union[RUMEventProcessingState, UnsetType] = unset,
46+
type: Union[str, UnsetType] = unset,
47+
**kwargs,
48+
):
3049
"""
3150
RUM application creation attributes.
3251
3352
:param name: Name of the RUM application.
3453
:type name: str
3554
55+
:param product_analytics_retention_state: Controls the retention policy for Product Analytics data derived from RUM events.
56+
:type product_analytics_retention_state: RUMProductAnalyticsRetentionState, optional
57+
58+
:param rum_event_processing_state: Configures which RUM events are processed and stored for the application.
59+
:type rum_event_processing_state: RUMEventProcessingState, optional
60+
3661
:param type: Type of the RUM application. Supported values are ``browser`` , ``ios`` , ``android`` , ``react-native`` , ``flutter`` , ``roku`` , ``electron`` , ``unity`` , ``kotlin-multiplatform``.
3762
:type type: str, optional
3863
"""
64+
if product_analytics_retention_state is not unset:
65+
kwargs["product_analytics_retention_state"] = product_analytics_retention_state
66+
if rum_event_processing_state is not unset:
67+
kwargs["rum_event_processing_state"] = rum_event_processing_state
3968
if type is not unset:
4069
kwargs["type"] = type
4170
super().__init__(kwargs)

0 commit comments

Comments
 (0)