Skip to content

Commit 92708ee

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Support decimal sample_rate for RUM retention filters (#3518)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent bd2a2ec commit 92708ee

5 files changed

Lines changed: 30 additions & 30 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47336,12 +47336,12 @@ components:
4733647336
$ref: '#/components/schemas/RumRetentionFilterData'
4733747337
type: object
4733847338
RumRetentionFilterSampleRate:
47339-
description: The sample rate for a RUM retention filter, between 0 and 100.
47340-
example: 25
47341-
format: int64
47339+
description: The sample rate for a RUM retention filter, between 0.1 and 100.
47340+
example: 50.5
47341+
format: double
4734247342
maximum: 100
47343-
minimum: 0
47344-
type: integer
47343+
minimum: 0.1
47344+
type: number
4734547345
RumRetentionFilterType:
4734647346
default: retention_filters
4734747347
description: The type of the resource. The value should always be retention_filters.

api/datadogV2/model_rum_retention_filter_attributes.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ type RumRetentionFilterAttributes struct {
1818
Name *string `json:"name,omitempty"`
1919
// The query string for a RUM retention filter.
2020
Query *string `json:"query,omitempty"`
21-
// The sample rate for a RUM retention filter, between 0 and 100.
22-
SampleRate *int64 `json:"sample_rate,omitempty"`
21+
// The sample rate for a RUM retention filter, between 0.1 and 100.
22+
SampleRate *float64 `json:"sample_rate,omitempty"`
2323
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2424
UnparsedObject map[string]interface{} `json:"-"`
2525
AdditionalProperties map[string]interface{} `json:"-"`
@@ -155,17 +155,17 @@ func (o *RumRetentionFilterAttributes) SetQuery(v string) {
155155
}
156156

157157
// GetSampleRate returns the SampleRate field value if set, zero value otherwise.
158-
func (o *RumRetentionFilterAttributes) GetSampleRate() int64 {
158+
func (o *RumRetentionFilterAttributes) GetSampleRate() float64 {
159159
if o == nil || o.SampleRate == nil {
160-
var ret int64
160+
var ret float64
161161
return ret
162162
}
163163
return *o.SampleRate
164164
}
165165

166166
// GetSampleRateOk returns a tuple with the SampleRate field value if set, nil otherwise
167167
// and a boolean to check if the value has been set.
168-
func (o *RumRetentionFilterAttributes) GetSampleRateOk() (*int64, bool) {
168+
func (o *RumRetentionFilterAttributes) GetSampleRateOk() (*float64, bool) {
169169
if o == nil || o.SampleRate == nil {
170170
return nil, false
171171
}
@@ -177,8 +177,8 @@ func (o *RumRetentionFilterAttributes) HasSampleRate() bool {
177177
return o != nil && o.SampleRate != nil
178178
}
179179

180-
// SetSampleRate gets a reference to the given int64 and assigns it to the SampleRate field.
181-
func (o *RumRetentionFilterAttributes) SetSampleRate(v int64) {
180+
// SetSampleRate gets a reference to the given float64 and assigns it to the SampleRate field.
181+
func (o *RumRetentionFilterAttributes) SetSampleRate(v float64) {
182182
o.SampleRate = &v
183183
}
184184

@@ -217,7 +217,7 @@ func (o *RumRetentionFilterAttributes) UnmarshalJSON(bytes []byte) (err error) {
217217
EventType *RumRetentionFilterEventType `json:"event_type,omitempty"`
218218
Name *string `json:"name,omitempty"`
219219
Query *string `json:"query,omitempty"`
220-
SampleRate *int64 `json:"sample_rate,omitempty"`
220+
SampleRate *float64 `json:"sample_rate,omitempty"`
221221
}{}
222222
if err = datadog.Unmarshal(bytes, &all); err != nil {
223223
return datadog.Unmarshal(bytes, &o.UnparsedObject)

api/datadogV2/model_rum_retention_filter_create_attributes.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ type RumRetentionFilterCreateAttributes struct {
2020
Name string `json:"name"`
2121
// The query string for a RUM retention filter.
2222
Query *string `json:"query,omitempty"`
23-
// The sample rate for a RUM retention filter, between 0 and 100.
24-
SampleRate int64 `json:"sample_rate"`
23+
// The sample rate for a RUM retention filter, between 0.1 and 100.
24+
SampleRate float64 `json:"sample_rate"`
2525
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2626
UnparsedObject map[string]interface{} `json:"-"`
2727
AdditionalProperties map[string]interface{} `json:"-"`
@@ -31,7 +31,7 @@ type RumRetentionFilterCreateAttributes struct {
3131
// This constructor will assign default values to properties that have it defined,
3232
// and makes sure properties required by API are set, but the set of arguments
3333
// will change when the set of required properties is changed.
34-
func NewRumRetentionFilterCreateAttributes(eventType RumRetentionFilterEventType, name string, sampleRate int64) *RumRetentionFilterCreateAttributes {
34+
func NewRumRetentionFilterCreateAttributes(eventType RumRetentionFilterEventType, name string, sampleRate float64) *RumRetentionFilterCreateAttributes {
3535
this := RumRetentionFilterCreateAttributes{}
3636
this.EventType = eventType
3737
this.Name = name
@@ -150,25 +150,25 @@ func (o *RumRetentionFilterCreateAttributes) SetQuery(v string) {
150150
}
151151

152152
// GetSampleRate returns the SampleRate field value.
153-
func (o *RumRetentionFilterCreateAttributes) GetSampleRate() int64 {
153+
func (o *RumRetentionFilterCreateAttributes) GetSampleRate() float64 {
154154
if o == nil {
155-
var ret int64
155+
var ret float64
156156
return ret
157157
}
158158
return o.SampleRate
159159
}
160160

161161
// GetSampleRateOk returns a tuple with the SampleRate field value
162162
// and a boolean to check if the value has been set.
163-
func (o *RumRetentionFilterCreateAttributes) GetSampleRateOk() (*int64, bool) {
163+
func (o *RumRetentionFilterCreateAttributes) GetSampleRateOk() (*float64, bool) {
164164
if o == nil {
165165
return nil, false
166166
}
167167
return &o.SampleRate, true
168168
}
169169

170170
// SetSampleRate sets field value.
171-
func (o *RumRetentionFilterCreateAttributes) SetSampleRate(v int64) {
171+
func (o *RumRetentionFilterCreateAttributes) SetSampleRate(v float64) {
172172
o.SampleRate = v
173173
}
174174

@@ -201,7 +201,7 @@ func (o *RumRetentionFilterCreateAttributes) UnmarshalJSON(bytes []byte) (err er
201201
EventType *RumRetentionFilterEventType `json:"event_type"`
202202
Name *string `json:"name"`
203203
Query *string `json:"query,omitempty"`
204-
SampleRate *int64 `json:"sample_rate"`
204+
SampleRate *float64 `json:"sample_rate"`
205205
}{}
206206
if err = datadog.Unmarshal(bytes, &all); err != nil {
207207
return datadog.Unmarshal(bytes, &o.UnparsedObject)

api/datadogV2/model_rum_retention_filter_update_attributes.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ type RumRetentionFilterUpdateAttributes struct {
1818
Name *string `json:"name,omitempty"`
1919
// The query string for a RUM retention filter.
2020
Query *string `json:"query,omitempty"`
21-
// The sample rate for a RUM retention filter, between 0 and 100.
22-
SampleRate *int64 `json:"sample_rate,omitempty"`
21+
// The sample rate for a RUM retention filter, between 0.1 and 100.
22+
SampleRate *float64 `json:"sample_rate,omitempty"`
2323
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2424
UnparsedObject map[string]interface{} `json:"-"`
2525
AdditionalProperties map[string]interface{} `json:"-"`
@@ -155,17 +155,17 @@ func (o *RumRetentionFilterUpdateAttributes) SetQuery(v string) {
155155
}
156156

157157
// GetSampleRate returns the SampleRate field value if set, zero value otherwise.
158-
func (o *RumRetentionFilterUpdateAttributes) GetSampleRate() int64 {
158+
func (o *RumRetentionFilterUpdateAttributes) GetSampleRate() float64 {
159159
if o == nil || o.SampleRate == nil {
160-
var ret int64
160+
var ret float64
161161
return ret
162162
}
163163
return *o.SampleRate
164164
}
165165

166166
// GetSampleRateOk returns a tuple with the SampleRate field value if set, nil otherwise
167167
// and a boolean to check if the value has been set.
168-
func (o *RumRetentionFilterUpdateAttributes) GetSampleRateOk() (*int64, bool) {
168+
func (o *RumRetentionFilterUpdateAttributes) GetSampleRateOk() (*float64, bool) {
169169
if o == nil || o.SampleRate == nil {
170170
return nil, false
171171
}
@@ -177,8 +177,8 @@ func (o *RumRetentionFilterUpdateAttributes) HasSampleRate() bool {
177177
return o != nil && o.SampleRate != nil
178178
}
179179

180-
// SetSampleRate gets a reference to the given int64 and assigns it to the SampleRate field.
181-
func (o *RumRetentionFilterUpdateAttributes) SetSampleRate(v int64) {
180+
// SetSampleRate gets a reference to the given float64 and assigns it to the SampleRate field.
181+
func (o *RumRetentionFilterUpdateAttributes) SetSampleRate(v float64) {
182182
o.SampleRate = &v
183183
}
184184

@@ -217,7 +217,7 @@ func (o *RumRetentionFilterUpdateAttributes) UnmarshalJSON(bytes []byte) (err er
217217
EventType *RumRetentionFilterEventType `json:"event_type,omitempty"`
218218
Name *string `json:"name,omitempty"`
219219
Query *string `json:"query,omitempty"`
220-
SampleRate *int64 `json:"sample_rate,omitempty"`
220+
SampleRate *float64 `json:"sample_rate,omitempty"`
221221
}{}
222222
if err = datadog.Unmarshal(bytes, &all); err != nil {
223223
return datadog.Unmarshal(bytes, &o.UnparsedObject)

examples/v2/rum-retention-filters/UpdateRetentionFilter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func main() {
2121
Name: datadog.PtrString("Test updating retention filter"),
2222
EventType: datadogV2.RUMRETENTIONFILTEREVENTTYPE_VIEW.Ptr(),
2323
Query: datadog.PtrString("view_query"),
24-
SampleRate: datadog.PtrInt64(100),
24+
SampleRate: datadog.PtrFloat64(100),
2525
Enabled: datadog.PtrBool(true),
2626
},
2727
},

0 commit comments

Comments
 (0)