Skip to content

Commit a7e342b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Product Scales support to RUM v2 Applications API (#3285)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 4457a1c commit a7e342b

26 files changed

Lines changed: 1185 additions & 56 deletions

.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:34:24.067"
2+
"spec_repo_commit": "4413e63",
3+
"generated": "2025-08-19 20:30:08.992"
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:

api/datadogV2/model_rum_application_attributes.go

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ type RUMApplicationAttributes struct {
2828
Name string `json:"name"`
2929
// Org ID of the RUM application.
3030
OrgId int32 `json:"org_id"`
31+
// Product Scales configuration for the RUM application.
32+
ProductScales *RUMProductScales `json:"product_scales,omitempty"`
3133
// Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
3234
Type string `json:"type"`
3335
// Timestamp in ms of the last update date.
@@ -259,6 +261,34 @@ func (o *RUMApplicationAttributes) SetOrgId(v int32) {
259261
o.OrgId = v
260262
}
261263

264+
// GetProductScales returns the ProductScales field value if set, zero value otherwise.
265+
func (o *RUMApplicationAttributes) GetProductScales() RUMProductScales {
266+
if o == nil || o.ProductScales == nil {
267+
var ret RUMProductScales
268+
return ret
269+
}
270+
return *o.ProductScales
271+
}
272+
273+
// GetProductScalesOk returns a tuple with the ProductScales field value if set, nil otherwise
274+
// and a boolean to check if the value has been set.
275+
func (o *RUMApplicationAttributes) GetProductScalesOk() (*RUMProductScales, bool) {
276+
if o == nil || o.ProductScales == nil {
277+
return nil, false
278+
}
279+
return o.ProductScales, true
280+
}
281+
282+
// HasProductScales returns a boolean if a field has been set.
283+
func (o *RUMApplicationAttributes) HasProductScales() bool {
284+
return o != nil && o.ProductScales != nil
285+
}
286+
287+
// SetProductScales gets a reference to the given RUMProductScales and assigns it to the ProductScales field.
288+
func (o *RUMApplicationAttributes) SetProductScales(v RUMProductScales) {
289+
o.ProductScales = &v
290+
}
291+
262292
// GetType returns the Type field value.
263293
func (o *RUMApplicationAttributes) GetType() string {
264294
if o == nil {
@@ -346,6 +376,9 @@ func (o RUMApplicationAttributes) MarshalJSON() ([]byte, error) {
346376
}
347377
toSerialize["name"] = o.Name
348378
toSerialize["org_id"] = o.OrgId
379+
if o.ProductScales != nil {
380+
toSerialize["product_scales"] = o.ProductScales
381+
}
349382
toSerialize["type"] = o.Type
350383
toSerialize["updated_at"] = o.UpdatedAt
351384
toSerialize["updated_by_handle"] = o.UpdatedByHandle
@@ -359,17 +392,18 @@ func (o RUMApplicationAttributes) MarshalJSON() ([]byte, error) {
359392
// UnmarshalJSON deserializes the given payload.
360393
func (o *RUMApplicationAttributes) UnmarshalJSON(bytes []byte) (err error) {
361394
all := struct {
362-
ApplicationId *string `json:"application_id"`
363-
ClientToken *string `json:"client_token"`
364-
CreatedAt *int64 `json:"created_at"`
365-
CreatedByHandle *string `json:"created_by_handle"`
366-
Hash *string `json:"hash,omitempty"`
367-
IsActive *bool `json:"is_active,omitempty"`
368-
Name *string `json:"name"`
369-
OrgId *int32 `json:"org_id"`
370-
Type *string `json:"type"`
371-
UpdatedAt *int64 `json:"updated_at"`
372-
UpdatedByHandle *string `json:"updated_by_handle"`
395+
ApplicationId *string `json:"application_id"`
396+
ClientToken *string `json:"client_token"`
397+
CreatedAt *int64 `json:"created_at"`
398+
CreatedByHandle *string `json:"created_by_handle"`
399+
Hash *string `json:"hash,omitempty"`
400+
IsActive *bool `json:"is_active,omitempty"`
401+
Name *string `json:"name"`
402+
OrgId *int32 `json:"org_id"`
403+
ProductScales *RUMProductScales `json:"product_scales,omitempty"`
404+
Type *string `json:"type"`
405+
UpdatedAt *int64 `json:"updated_at"`
406+
UpdatedByHandle *string `json:"updated_by_handle"`
373407
}{}
374408
if err = datadog.Unmarshal(bytes, &all); err != nil {
375409
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -403,10 +437,12 @@ func (o *RUMApplicationAttributes) UnmarshalJSON(bytes []byte) (err error) {
403437
}
404438
additionalProperties := make(map[string]interface{})
405439
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
406-
datadog.DeleteKeys(additionalProperties, &[]string{"application_id", "client_token", "created_at", "created_by_handle", "hash", "is_active", "name", "org_id", "type", "updated_at", "updated_by_handle"})
440+
datadog.DeleteKeys(additionalProperties, &[]string{"application_id", "client_token", "created_at", "created_by_handle", "hash", "is_active", "name", "org_id", "product_scales", "type", "updated_at", "updated_by_handle"})
407441
} else {
408442
return err
409443
}
444+
445+
hasInvalidField := false
410446
o.ApplicationId = *all.ApplicationId
411447
o.ClientToken = *all.ClientToken
412448
o.CreatedAt = *all.CreatedAt
@@ -415,6 +451,10 @@ func (o *RUMApplicationAttributes) UnmarshalJSON(bytes []byte) (err error) {
415451
o.IsActive = all.IsActive
416452
o.Name = *all.Name
417453
o.OrgId = *all.OrgId
454+
if all.ProductScales != nil && all.ProductScales.UnparsedObject != nil && o.UnparsedObject == nil {
455+
hasInvalidField = true
456+
}
457+
o.ProductScales = all.ProductScales
418458
o.Type = *all.Type
419459
o.UpdatedAt = *all.UpdatedAt
420460
o.UpdatedByHandle = *all.UpdatedByHandle
@@ -423,5 +463,9 @@ func (o *RUMApplicationAttributes) UnmarshalJSON(bytes []byte) (err error) {
423463
o.AdditionalProperties = additionalProperties
424464
}
425465

466+
if hasInvalidField {
467+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
468+
}
469+
426470
return nil
427471
}

api/datadogV2/model_rum_application_create_attributes.go

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import (
1414
type RUMApplicationCreateAttributes struct {
1515
// Name of the RUM application.
1616
Name string `json:"name"`
17+
// Controls the retention policy for Product Analytics data derived from RUM events.
18+
ProductAnalyticsRetentionState *RUMProductAnalyticsRetentionState `json:"product_analytics_retention_state,omitempty"`
19+
// Configures which RUM events are processed and stored for the application.
20+
RumEventProcessingState *RUMEventProcessingState `json:"rum_event_processing_state,omitempty"`
1721
// Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`.
1822
Type *string `json:"type,omitempty"`
1923
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -62,6 +66,62 @@ func (o *RUMApplicationCreateAttributes) SetName(v string) {
6266
o.Name = v
6367
}
6468

69+
// GetProductAnalyticsRetentionState returns the ProductAnalyticsRetentionState field value if set, zero value otherwise.
70+
func (o *RUMApplicationCreateAttributes) GetProductAnalyticsRetentionState() RUMProductAnalyticsRetentionState {
71+
if o == nil || o.ProductAnalyticsRetentionState == nil {
72+
var ret RUMProductAnalyticsRetentionState
73+
return ret
74+
}
75+
return *o.ProductAnalyticsRetentionState
76+
}
77+
78+
// GetProductAnalyticsRetentionStateOk returns a tuple with the ProductAnalyticsRetentionState field value if set, nil otherwise
79+
// and a boolean to check if the value has been set.
80+
func (o *RUMApplicationCreateAttributes) GetProductAnalyticsRetentionStateOk() (*RUMProductAnalyticsRetentionState, bool) {
81+
if o == nil || o.ProductAnalyticsRetentionState == nil {
82+
return nil, false
83+
}
84+
return o.ProductAnalyticsRetentionState, true
85+
}
86+
87+
// HasProductAnalyticsRetentionState returns a boolean if a field has been set.
88+
func (o *RUMApplicationCreateAttributes) HasProductAnalyticsRetentionState() bool {
89+
return o != nil && o.ProductAnalyticsRetentionState != nil
90+
}
91+
92+
// SetProductAnalyticsRetentionState gets a reference to the given RUMProductAnalyticsRetentionState and assigns it to the ProductAnalyticsRetentionState field.
93+
func (o *RUMApplicationCreateAttributes) SetProductAnalyticsRetentionState(v RUMProductAnalyticsRetentionState) {
94+
o.ProductAnalyticsRetentionState = &v
95+
}
96+
97+
// GetRumEventProcessingState returns the RumEventProcessingState field value if set, zero value otherwise.
98+
func (o *RUMApplicationCreateAttributes) GetRumEventProcessingState() RUMEventProcessingState {
99+
if o == nil || o.RumEventProcessingState == nil {
100+
var ret RUMEventProcessingState
101+
return ret
102+
}
103+
return *o.RumEventProcessingState
104+
}
105+
106+
// GetRumEventProcessingStateOk returns a tuple with the RumEventProcessingState field value if set, nil otherwise
107+
// and a boolean to check if the value has been set.
108+
func (o *RUMApplicationCreateAttributes) GetRumEventProcessingStateOk() (*RUMEventProcessingState, bool) {
109+
if o == nil || o.RumEventProcessingState == nil {
110+
return nil, false
111+
}
112+
return o.RumEventProcessingState, true
113+
}
114+
115+
// HasRumEventProcessingState returns a boolean if a field has been set.
116+
func (o *RUMApplicationCreateAttributes) HasRumEventProcessingState() bool {
117+
return o != nil && o.RumEventProcessingState != nil
118+
}
119+
120+
// SetRumEventProcessingState gets a reference to the given RUMEventProcessingState and assigns it to the RumEventProcessingState field.
121+
func (o *RUMApplicationCreateAttributes) SetRumEventProcessingState(v RUMEventProcessingState) {
122+
o.RumEventProcessingState = &v
123+
}
124+
65125
// GetType returns the Type field value if set, zero value otherwise.
66126
func (o *RUMApplicationCreateAttributes) GetType() string {
67127
if o == nil || o.Type == nil {
@@ -97,6 +157,12 @@ func (o RUMApplicationCreateAttributes) MarshalJSON() ([]byte, error) {
97157
return datadog.Marshal(o.UnparsedObject)
98158
}
99159
toSerialize["name"] = o.Name
160+
if o.ProductAnalyticsRetentionState != nil {
161+
toSerialize["product_analytics_retention_state"] = o.ProductAnalyticsRetentionState
162+
}
163+
if o.RumEventProcessingState != nil {
164+
toSerialize["rum_event_processing_state"] = o.RumEventProcessingState
165+
}
100166
if o.Type != nil {
101167
toSerialize["type"] = o.Type
102168
}
@@ -110,8 +176,10 @@ func (o RUMApplicationCreateAttributes) MarshalJSON() ([]byte, error) {
110176
// UnmarshalJSON deserializes the given payload.
111177
func (o *RUMApplicationCreateAttributes) UnmarshalJSON(bytes []byte) (err error) {
112178
all := struct {
113-
Name *string `json:"name"`
114-
Type *string `json:"type,omitempty"`
179+
Name *string `json:"name"`
180+
ProductAnalyticsRetentionState *RUMProductAnalyticsRetentionState `json:"product_analytics_retention_state,omitempty"`
181+
RumEventProcessingState *RUMEventProcessingState `json:"rum_event_processing_state,omitempty"`
182+
Type *string `json:"type,omitempty"`
115183
}{}
116184
if err = datadog.Unmarshal(bytes, &all); err != nil {
117185
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -121,16 +189,32 @@ func (o *RUMApplicationCreateAttributes) UnmarshalJSON(bytes []byte) (err error)
121189
}
122190
additionalProperties := make(map[string]interface{})
123191
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
124-
datadog.DeleteKeys(additionalProperties, &[]string{"name", "type"})
192+
datadog.DeleteKeys(additionalProperties, &[]string{"name", "product_analytics_retention_state", "rum_event_processing_state", "type"})
125193
} else {
126194
return err
127195
}
196+
197+
hasInvalidField := false
128198
o.Name = *all.Name
199+
if all.ProductAnalyticsRetentionState != nil && !all.ProductAnalyticsRetentionState.IsValid() {
200+
hasInvalidField = true
201+
} else {
202+
o.ProductAnalyticsRetentionState = all.ProductAnalyticsRetentionState
203+
}
204+
if all.RumEventProcessingState != nil && !all.RumEventProcessingState.IsValid() {
205+
hasInvalidField = true
206+
} else {
207+
o.RumEventProcessingState = all.RumEventProcessingState
208+
}
129209
o.Type = all.Type
130210

131211
if len(additionalProperties) > 0 {
132212
o.AdditionalProperties = additionalProperties
133213
}
134214

215+
if hasInvalidField {
216+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
217+
}
218+
135219
return nil
136220
}

0 commit comments

Comments
 (0)