Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix synthetics vitals type #1534

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-06-09 09:37:32.523376",
"spec_repo_commit": "32abf518"
"regenerated": "2022-06-09 11:12:46.854122",
"spec_repo_commit": "b9e36dc8"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-06-09 09:37:32.540447",
"spec_repo_commit": "32abf518"
"regenerated": "2022-06-09 11:12:46.864763",
"spec_repo_commit": "b9e36dc8"
}
}
}
8 changes: 4 additions & 4 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11227,12 +11227,12 @@ components:
properties:
cls:
description: Cumulative Layout Shift.
format: int64
type: integer
format: double
type: number
lcp:
description: Largest Contentful Paint in milliseconds.
format: int64
type: integer
format: double
type: number
url:
description: URL attached to the metrics.
type: string
Expand Down
30 changes: 15 additions & 15 deletions api/v1/datadog/model_synthetics_core_web_vitals.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
// SyntheticsCoreWebVitals Core Web Vitals attached to a browser test step.
type SyntheticsCoreWebVitals struct {
// Cumulative Layout Shift.
Cls *int64 `json:"cls,omitempty"`
Cls *float64 `json:"cls,omitempty"`
// Largest Contentful Paint in milliseconds.
Lcp *int64 `json:"lcp,omitempty"`
Lcp *float64 `json:"lcp,omitempty"`
// URL attached to the metrics.
Url *string `json:"url,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand All @@ -39,17 +39,17 @@ func NewSyntheticsCoreWebVitalsWithDefaults() *SyntheticsCoreWebVitals {
}

// GetCls returns the Cls field value if set, zero value otherwise.
func (o *SyntheticsCoreWebVitals) GetCls() int64 {
func (o *SyntheticsCoreWebVitals) GetCls() float64 {
if o == nil || o.Cls == nil {
var ret int64
var ret float64
return ret
}
return *o.Cls
}

// GetClsOk returns a tuple with the Cls field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsCoreWebVitals) GetClsOk() (*int64, bool) {
func (o *SyntheticsCoreWebVitals) GetClsOk() (*float64, bool) {
if o == nil || o.Cls == nil {
return nil, false
}
Expand All @@ -65,23 +65,23 @@ func (o *SyntheticsCoreWebVitals) HasCls() bool {
return false
}

// SetCls gets a reference to the given int64 and assigns it to the Cls field.
func (o *SyntheticsCoreWebVitals) SetCls(v int64) {
// SetCls gets a reference to the given float64 and assigns it to the Cls field.
func (o *SyntheticsCoreWebVitals) SetCls(v float64) {
o.Cls = &v
}

// GetLcp returns the Lcp field value if set, zero value otherwise.
func (o *SyntheticsCoreWebVitals) GetLcp() int64 {
func (o *SyntheticsCoreWebVitals) GetLcp() float64 {
if o == nil || o.Lcp == nil {
var ret int64
var ret float64
return ret
}
return *o.Lcp
}

// GetLcpOk returns a tuple with the Lcp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsCoreWebVitals) GetLcpOk() (*int64, bool) {
func (o *SyntheticsCoreWebVitals) GetLcpOk() (*float64, bool) {
if o == nil || o.Lcp == nil {
return nil, false
}
Expand All @@ -97,8 +97,8 @@ func (o *SyntheticsCoreWebVitals) HasLcp() bool {
return false
}

// SetLcp gets a reference to the given int64 and assigns it to the Lcp field.
func (o *SyntheticsCoreWebVitals) SetLcp(v int64) {
// SetLcp gets a reference to the given float64 and assigns it to the Lcp field.
func (o *SyntheticsCoreWebVitals) SetLcp(v float64) {
o.Lcp = &v
}

Expand Down Expand Up @@ -160,9 +160,9 @@ func (o SyntheticsCoreWebVitals) MarshalJSON() ([]byte, error) {
func (o *SyntheticsCoreWebVitals) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
Cls *int64 `json:"cls,omitempty"`
Lcp *int64 `json:"lcp,omitempty"`
Url *string `json:"url,omitempty"`
Cls *float64 `json:"cls,omitempty"`
Lcp *float64 `json:"lcp,omitempty"`
Url *string `json:"url,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
Expand Down