From 24c5770e6cd11b308760d43cd71ab0932e56e1b4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 31 Oct 2024 14:52:44 +0000 Subject: [PATCH] Regenerate client from commit e9cc5e6a of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 41 ++++--- .../model_synthetics_mobile_step_params.go | 84 +++++++------- ...e_step_params_element_relative_position.go | 28 ++--- ...tics_mobile_step_params_positions_items.go | 28 ++--- ...del_synthetics_mobile_step_params_value.go | 105 ++++++++++++++++++ 6 files changed, 205 insertions(+), 89 deletions(-) create mode 100644 api/datadogV1/model_synthetics_mobile_step_params_value.go diff --git a/.apigentools-info b/.apigentools-info index bc25f64c5dd..43a1ddfb019 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 14:19:53.909043", - "spec_repo_commit": "47da2e01" + "regenerated": "2024-10-31 14:51:18.802907", + "spec_repo_commit": "e9cc5e6a" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 14:19:53.928568", - "spec_repo_commit": "47da2e01" + "regenerated": "2024-10-31 14:51:18.821531", + "spec_repo_commit": "e9cc5e6a" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index f12bb5661a0..7bd4ab4a943 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -15530,7 +15530,7 @@ components: $ref: '#/components/schemas/SyntheticsMobileStepParamsDirection' element: $ref: '#/components/schemas/SyntheticsMobileStepParamsElement' - enable: + enabled: description: Boolean to change the state of the wifi for a `toggleWiFi` step type. type: boolean @@ -15546,8 +15546,7 @@ components: step type. type: string value: - description: Values used in the step. Used in multiple step types. - type: string + $ref: '#/components/schemas/SyntheticsMobileStepParamsValue' variable: $ref: '#/components/schemas/SyntheticsMobileStepParamsVariable' withEnter: @@ -15556,12 +15555,12 @@ components: type: boolean x: description: Amount to scroll by on the `x` axis for a `scroll` step type. - format: int64 - type: integer + format: double + type: number y: description: Amount to scroll by on the `y` axis for a `scroll` step type. - format: int64 - type: integer + format: double + type: number type: object SyntheticsMobileStepParamsDirection: description: The direction of the scroll for a `scrollToElement` step type. @@ -15615,12 +15614,12 @@ components: properties: x: description: The `relativePosition` on the `x` axis for the element. - format: int64 - type: integer + format: double + type: number y: description: The `relativePosition` on the `y` axis for the element. - format: int64 - type: integer + format: double + type: number type: object SyntheticsMobileStepParamsElementUserLocator: description: User locator to find the element. @@ -15670,13 +15669,25 @@ components: properties: x: description: The `x` position for the flick. - format: int64 - type: integer + format: double + type: number y: description: The `y` position for the flick. - format: int64 - type: integer + format: double + type: number type: object + SyntheticsMobileStepParamsValue: + description: Values used in the step for in multiple step types. + oneOf: + - $ref: '#/components/schemas/SyntheticsMobileStepParamsValueString' + - $ref: '#/components/schemas/SyntheticsMobileStepParamsValueNumber' + SyntheticsMobileStepParamsValueNumber: + description: Value used in the step for in multiple step types. + format: int64 + type: integer + SyntheticsMobileStepParamsValueString: + description: Value used in the step for in multiple step types. + type: string SyntheticsMobileStepParamsVariable: description: Variable object for `extractVariable` step type. properties: diff --git a/api/datadogV1/model_synthetics_mobile_step_params.go b/api/datadogV1/model_synthetics_mobile_step_params.go index 98673776d7a..195d2a13bed 100644 --- a/api/datadogV1/model_synthetics_mobile_step_params.go +++ b/api/datadogV1/model_synthetics_mobile_step_params.go @@ -19,23 +19,23 @@ type SyntheticsMobileStepParams struct { // Information about the element used for a step. Element *SyntheticsMobileStepParamsElement `json:"element,omitempty"` // Boolean to change the state of the wifi for a `toggleWiFi` step type. - Enable *bool `json:"enable,omitempty"` + Enabled *bool `json:"enabled,omitempty"` // Maximum number of scrolls to do for a `scrollToElement` step type. MaxScrolls *int64 `json:"maxScrolls,omitempty"` // List of positions for the `flick` step type. The maximum is 10 flicks per step Positions []SyntheticsMobileStepParamsPositionsItems `json:"positions,omitempty"` // Public ID of the test to be played as part of a `playSubTest` step type. SubtestPublicId *string `json:"subtestPublicId,omitempty"` - // Values used in the step. Used in multiple step types. - Value *string `json:"value,omitempty"` + // Values used in the step for in multiple step types. + Value *SyntheticsMobileStepParamsValue `json:"value,omitempty"` // Variable object for `extractVariable` step type. Variable *SyntheticsMobileStepParamsVariable `json:"variable,omitempty"` // Boolean to indicate if `Enter` should be pressed at the end of the `typeText` step type. WithEnter *bool `json:"withEnter,omitempty"` // Amount to scroll by on the `x` axis for a `scroll` step type. - X *int64 `json:"x,omitempty"` + X *float64 `json:"x,omitempty"` // Amount to scroll by on the `y` axis for a `scroll` step type. - Y *int64 `json:"y,omitempty"` + Y *float64 `json:"y,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -170,32 +170,32 @@ func (o *SyntheticsMobileStepParams) SetElement(v SyntheticsMobileStepParamsElem o.Element = &v } -// GetEnable returns the Enable field value if set, zero value otherwise. -func (o *SyntheticsMobileStepParams) GetEnable() bool { - if o == nil || o.Enable == nil { +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SyntheticsMobileStepParams) GetEnabled() bool { + if o == nil || o.Enabled == nil { var ret bool return ret } - return *o.Enable + return *o.Enabled } -// GetEnableOk returns a tuple with the Enable field value if set, nil otherwise +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsMobileStepParams) GetEnableOk() (*bool, bool) { - if o == nil || o.Enable == nil { +func (o *SyntheticsMobileStepParams) GetEnabledOk() (*bool, bool) { + if o == nil || o.Enabled == nil { return nil, false } - return o.Enable, true + return o.Enabled, true } -// HasEnable returns a boolean if a field has been set. -func (o *SyntheticsMobileStepParams) HasEnable() bool { - return o != nil && o.Enable != nil +// HasEnabled returns a boolean if a field has been set. +func (o *SyntheticsMobileStepParams) HasEnabled() bool { + return o != nil && o.Enabled != nil } -// SetEnable gets a reference to the given bool and assigns it to the Enable field. -func (o *SyntheticsMobileStepParams) SetEnable(v bool) { - o.Enable = &v +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SyntheticsMobileStepParams) SetEnabled(v bool) { + o.Enabled = &v } // GetMaxScrolls returns the MaxScrolls field value if set, zero value otherwise. @@ -283,9 +283,9 @@ func (o *SyntheticsMobileStepParams) SetSubtestPublicId(v string) { } // GetValue returns the Value field value if set, zero value otherwise. -func (o *SyntheticsMobileStepParams) GetValue() string { +func (o *SyntheticsMobileStepParams) GetValue() SyntheticsMobileStepParamsValue { if o == nil || o.Value == nil { - var ret string + var ret SyntheticsMobileStepParamsValue return ret } return *o.Value @@ -293,7 +293,7 @@ func (o *SyntheticsMobileStepParams) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsMobileStepParams) GetValueOk() (*string, bool) { +func (o *SyntheticsMobileStepParams) GetValueOk() (*SyntheticsMobileStepParamsValue, bool) { if o == nil || o.Value == nil { return nil, false } @@ -305,8 +305,8 @@ func (o *SyntheticsMobileStepParams) HasValue() bool { return o != nil && o.Value != nil } -// SetValue gets a reference to the given string and assigns it to the Value field. -func (o *SyntheticsMobileStepParams) SetValue(v string) { +// SetValue gets a reference to the given SyntheticsMobileStepParamsValue and assigns it to the Value field. +func (o *SyntheticsMobileStepParams) SetValue(v SyntheticsMobileStepParamsValue) { o.Value = &v } @@ -367,9 +367,9 @@ func (o *SyntheticsMobileStepParams) SetWithEnter(v bool) { } // GetX returns the X field value if set, zero value otherwise. -func (o *SyntheticsMobileStepParams) GetX() int64 { +func (o *SyntheticsMobileStepParams) GetX() float64 { if o == nil || o.X == nil { - var ret int64 + var ret float64 return ret } return *o.X @@ -377,7 +377,7 @@ func (o *SyntheticsMobileStepParams) GetX() int64 { // GetXOk returns a tuple with the X field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsMobileStepParams) GetXOk() (*int64, bool) { +func (o *SyntheticsMobileStepParams) GetXOk() (*float64, bool) { if o == nil || o.X == nil { return nil, false } @@ -389,15 +389,15 @@ func (o *SyntheticsMobileStepParams) HasX() bool { return o != nil && o.X != nil } -// SetX gets a reference to the given int64 and assigns it to the X field. -func (o *SyntheticsMobileStepParams) SetX(v int64) { +// SetX gets a reference to the given float64 and assigns it to the X field. +func (o *SyntheticsMobileStepParams) SetX(v float64) { o.X = &v } // GetY returns the Y field value if set, zero value otherwise. -func (o *SyntheticsMobileStepParams) GetY() int64 { +func (o *SyntheticsMobileStepParams) GetY() float64 { if o == nil || o.Y == nil { - var ret int64 + var ret float64 return ret } return *o.Y @@ -405,7 +405,7 @@ func (o *SyntheticsMobileStepParams) GetY() int64 { // GetYOk returns a tuple with the Y field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsMobileStepParams) GetYOk() (*int64, bool) { +func (o *SyntheticsMobileStepParams) GetYOk() (*float64, bool) { if o == nil || o.Y == nil { return nil, false } @@ -417,8 +417,8 @@ func (o *SyntheticsMobileStepParams) HasY() bool { return o != nil && o.Y != nil } -// SetY gets a reference to the given int64 and assigns it to the Y field. -func (o *SyntheticsMobileStepParams) SetY(v int64) { +// SetY gets a reference to the given float64 and assigns it to the Y field. +func (o *SyntheticsMobileStepParams) SetY(v float64) { o.Y = &v } @@ -440,8 +440,8 @@ func (o SyntheticsMobileStepParams) MarshalJSON() ([]byte, error) { if o.Element != nil { toSerialize["element"] = o.Element } - if o.Enable != nil { - toSerialize["enable"] = o.Enable + if o.Enabled != nil { + toSerialize["enabled"] = o.Enabled } if o.MaxScrolls != nil { toSerialize["maxScrolls"] = o.MaxScrolls @@ -481,22 +481,22 @@ func (o *SyntheticsMobileStepParams) UnmarshalJSON(bytes []byte) (err error) { Delay *int64 `json:"delay,omitempty"` Direction *SyntheticsMobileStepParamsDirection `json:"direction,omitempty"` Element *SyntheticsMobileStepParamsElement `json:"element,omitempty"` - Enable *bool `json:"enable,omitempty"` + Enabled *bool `json:"enabled,omitempty"` MaxScrolls *int64 `json:"maxScrolls,omitempty"` Positions []SyntheticsMobileStepParamsPositionsItems `json:"positions,omitempty"` SubtestPublicId *string `json:"subtestPublicId,omitempty"` - Value *string `json:"value,omitempty"` + Value *SyntheticsMobileStepParamsValue `json:"value,omitempty"` Variable *SyntheticsMobileStepParamsVariable `json:"variable,omitempty"` WithEnter *bool `json:"withEnter,omitempty"` - X *int64 `json:"x,omitempty"` - Y *int64 `json:"y,omitempty"` + X *float64 `json:"x,omitempty"` + Y *float64 `json:"y,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"check", "delay", "direction", "element", "enable", "maxScrolls", "positions", "subtestPublicId", "value", "variable", "withEnter", "x", "y"}) + datadog.DeleteKeys(additionalProperties, &[]string{"check", "delay", "direction", "element", "enabled", "maxScrolls", "positions", "subtestPublicId", "value", "variable", "withEnter", "x", "y"}) } else { return err } @@ -517,7 +517,7 @@ func (o *SyntheticsMobileStepParams) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField = true } o.Element = all.Element - o.Enable = all.Enable + o.Enabled = all.Enabled o.MaxScrolls = all.MaxScrolls o.Positions = all.Positions o.SubtestPublicId = all.SubtestPublicId diff --git a/api/datadogV1/model_synthetics_mobile_step_params_element_relative_position.go b/api/datadogV1/model_synthetics_mobile_step_params_element_relative_position.go index 66a96a73d52..402381eb7fb 100644 --- a/api/datadogV1/model_synthetics_mobile_step_params_element_relative_position.go +++ b/api/datadogV1/model_synthetics_mobile_step_params_element_relative_position.go @@ -11,9 +11,9 @@ import ( // SyntheticsMobileStepParamsElementRelativePosition Position of the action relative to the element. type SyntheticsMobileStepParamsElementRelativePosition struct { // The `relativePosition` on the `x` axis for the element. - X *int64 `json:"x,omitempty"` + X *float64 `json:"x,omitempty"` // The `relativePosition` on the `y` axis for the element. - Y *int64 `json:"y,omitempty"` + Y *float64 `json:"y,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -37,9 +37,9 @@ func NewSyntheticsMobileStepParamsElementRelativePositionWithDefaults() *Synthet } // GetX returns the X field value if set, zero value otherwise. -func (o *SyntheticsMobileStepParamsElementRelativePosition) GetX() int64 { +func (o *SyntheticsMobileStepParamsElementRelativePosition) GetX() float64 { if o == nil || o.X == nil { - var ret int64 + var ret float64 return ret } return *o.X @@ -47,7 +47,7 @@ func (o *SyntheticsMobileStepParamsElementRelativePosition) GetX() int64 { // GetXOk returns a tuple with the X field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsMobileStepParamsElementRelativePosition) GetXOk() (*int64, bool) { +func (o *SyntheticsMobileStepParamsElementRelativePosition) GetXOk() (*float64, bool) { if o == nil || o.X == nil { return nil, false } @@ -59,15 +59,15 @@ func (o *SyntheticsMobileStepParamsElementRelativePosition) HasX() bool { return o != nil && o.X != nil } -// SetX gets a reference to the given int64 and assigns it to the X field. -func (o *SyntheticsMobileStepParamsElementRelativePosition) SetX(v int64) { +// SetX gets a reference to the given float64 and assigns it to the X field. +func (o *SyntheticsMobileStepParamsElementRelativePosition) SetX(v float64) { o.X = &v } // GetY returns the Y field value if set, zero value otherwise. -func (o *SyntheticsMobileStepParamsElementRelativePosition) GetY() int64 { +func (o *SyntheticsMobileStepParamsElementRelativePosition) GetY() float64 { if o == nil || o.Y == nil { - var ret int64 + var ret float64 return ret } return *o.Y @@ -75,7 +75,7 @@ func (o *SyntheticsMobileStepParamsElementRelativePosition) GetY() int64 { // GetYOk returns a tuple with the Y field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsMobileStepParamsElementRelativePosition) GetYOk() (*int64, bool) { +func (o *SyntheticsMobileStepParamsElementRelativePosition) GetYOk() (*float64, bool) { if o == nil || o.Y == nil { return nil, false } @@ -87,8 +87,8 @@ func (o *SyntheticsMobileStepParamsElementRelativePosition) HasY() bool { return o != nil && o.Y != nil } -// SetY gets a reference to the given int64 and assigns it to the Y field. -func (o *SyntheticsMobileStepParamsElementRelativePosition) SetY(v int64) { +// SetY gets a reference to the given float64 and assigns it to the Y field. +func (o *SyntheticsMobileStepParamsElementRelativePosition) SetY(v float64) { o.Y = &v } @@ -114,8 +114,8 @@ func (o SyntheticsMobileStepParamsElementRelativePosition) MarshalJSON() ([]byte // UnmarshalJSON deserializes the given payload. func (o *SyntheticsMobileStepParamsElementRelativePosition) UnmarshalJSON(bytes []byte) (err error) { all := struct { - X *int64 `json:"x,omitempty"` - Y *int64 `json:"y,omitempty"` + X *float64 `json:"x,omitempty"` + Y *float64 `json:"y,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV1/model_synthetics_mobile_step_params_positions_items.go b/api/datadogV1/model_synthetics_mobile_step_params_positions_items.go index 374e9d44526..ef4eb131b6e 100644 --- a/api/datadogV1/model_synthetics_mobile_step_params_positions_items.go +++ b/api/datadogV1/model_synthetics_mobile_step_params_positions_items.go @@ -11,9 +11,9 @@ import ( // SyntheticsMobileStepParamsPositionsItems A description of a single position for a `flick` step type. type SyntheticsMobileStepParamsPositionsItems struct { // The `x` position for the flick. - X *int64 `json:"x,omitempty"` + X *float64 `json:"x,omitempty"` // The `y` position for the flick. - Y *int64 `json:"y,omitempty"` + Y *float64 `json:"y,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -37,9 +37,9 @@ func NewSyntheticsMobileStepParamsPositionsItemsWithDefaults() *SyntheticsMobile } // GetX returns the X field value if set, zero value otherwise. -func (o *SyntheticsMobileStepParamsPositionsItems) GetX() int64 { +func (o *SyntheticsMobileStepParamsPositionsItems) GetX() float64 { if o == nil || o.X == nil { - var ret int64 + var ret float64 return ret } return *o.X @@ -47,7 +47,7 @@ func (o *SyntheticsMobileStepParamsPositionsItems) GetX() int64 { // GetXOk returns a tuple with the X field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsMobileStepParamsPositionsItems) GetXOk() (*int64, bool) { +func (o *SyntheticsMobileStepParamsPositionsItems) GetXOk() (*float64, bool) { if o == nil || o.X == nil { return nil, false } @@ -59,15 +59,15 @@ func (o *SyntheticsMobileStepParamsPositionsItems) HasX() bool { return o != nil && o.X != nil } -// SetX gets a reference to the given int64 and assigns it to the X field. -func (o *SyntheticsMobileStepParamsPositionsItems) SetX(v int64) { +// SetX gets a reference to the given float64 and assigns it to the X field. +func (o *SyntheticsMobileStepParamsPositionsItems) SetX(v float64) { o.X = &v } // GetY returns the Y field value if set, zero value otherwise. -func (o *SyntheticsMobileStepParamsPositionsItems) GetY() int64 { +func (o *SyntheticsMobileStepParamsPositionsItems) GetY() float64 { if o == nil || o.Y == nil { - var ret int64 + var ret float64 return ret } return *o.Y @@ -75,7 +75,7 @@ func (o *SyntheticsMobileStepParamsPositionsItems) GetY() int64 { // GetYOk returns a tuple with the Y field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsMobileStepParamsPositionsItems) GetYOk() (*int64, bool) { +func (o *SyntheticsMobileStepParamsPositionsItems) GetYOk() (*float64, bool) { if o == nil || o.Y == nil { return nil, false } @@ -87,8 +87,8 @@ func (o *SyntheticsMobileStepParamsPositionsItems) HasY() bool { return o != nil && o.Y != nil } -// SetY gets a reference to the given int64 and assigns it to the Y field. -func (o *SyntheticsMobileStepParamsPositionsItems) SetY(v int64) { +// SetY gets a reference to the given float64 and assigns it to the Y field. +func (o *SyntheticsMobileStepParamsPositionsItems) SetY(v float64) { o.Y = &v } @@ -114,8 +114,8 @@ func (o SyntheticsMobileStepParamsPositionsItems) MarshalJSON() ([]byte, error) // UnmarshalJSON deserializes the given payload. func (o *SyntheticsMobileStepParamsPositionsItems) UnmarshalJSON(bytes []byte) (err error) { all := struct { - X *int64 `json:"x,omitempty"` - Y *int64 `json:"y,omitempty"` + X *float64 `json:"x,omitempty"` + Y *float64 `json:"y,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/api/datadogV1/model_synthetics_mobile_step_params_value.go b/api/datadogV1/model_synthetics_mobile_step_params_value.go new file mode 100644 index 00000000000..35506a59635 --- /dev/null +++ b/api/datadogV1/model_synthetics_mobile_step_params_value.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsMobileStepParamsValue - Values used in the step for in multiple step types. +type SyntheticsMobileStepParamsValue struct { + SyntheticsMobileStepParamsValueString *string + SyntheticsMobileStepParamsValueNumber *int64 + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// SyntheticsMobileStepParamsValueStringAsSyntheticsMobileStepParamsValue is a convenience function that returns string wrapped in SyntheticsMobileStepParamsValue. +func SyntheticsMobileStepParamsValueStringAsSyntheticsMobileStepParamsValue(v *string) SyntheticsMobileStepParamsValue { + return SyntheticsMobileStepParamsValue{SyntheticsMobileStepParamsValueString: v} +} + +// SyntheticsMobileStepParamsValueNumberAsSyntheticsMobileStepParamsValue is a convenience function that returns int64 wrapped in SyntheticsMobileStepParamsValue. +func SyntheticsMobileStepParamsValueNumberAsSyntheticsMobileStepParamsValue(v *int64) SyntheticsMobileStepParamsValue { + return SyntheticsMobileStepParamsValue{SyntheticsMobileStepParamsValueNumber: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *SyntheticsMobileStepParamsValue) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into SyntheticsMobileStepParamsValueString + err = datadog.Unmarshal(data, &obj.SyntheticsMobileStepParamsValueString) + if err == nil { + if obj.SyntheticsMobileStepParamsValueString != nil { + jsonSyntheticsMobileStepParamsValueString, _ := datadog.Marshal(obj.SyntheticsMobileStepParamsValueString) + if string(jsonSyntheticsMobileStepParamsValueString) == "{}" { // empty struct + obj.SyntheticsMobileStepParamsValueString = nil + } else { + match++ + } + } else { + obj.SyntheticsMobileStepParamsValueString = nil + } + } else { + obj.SyntheticsMobileStepParamsValueString = nil + } + + // try to unmarshal data into SyntheticsMobileStepParamsValueNumber + err = datadog.Unmarshal(data, &obj.SyntheticsMobileStepParamsValueNumber) + if err == nil { + if obj.SyntheticsMobileStepParamsValueNumber != nil { + jsonSyntheticsMobileStepParamsValueNumber, _ := datadog.Marshal(obj.SyntheticsMobileStepParamsValueNumber) + if string(jsonSyntheticsMobileStepParamsValueNumber) == "{}" { // empty struct + obj.SyntheticsMobileStepParamsValueNumber = nil + } else { + match++ + } + } else { + obj.SyntheticsMobileStepParamsValueNumber = nil + } + } else { + obj.SyntheticsMobileStepParamsValueNumber = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.SyntheticsMobileStepParamsValueString = nil + obj.SyntheticsMobileStepParamsValueNumber = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj SyntheticsMobileStepParamsValue) MarshalJSON() ([]byte, error) { + if obj.SyntheticsMobileStepParamsValueString != nil { + return datadog.Marshal(&obj.SyntheticsMobileStepParamsValueString) + } + + if obj.SyntheticsMobileStepParamsValueNumber != nil { + return datadog.Marshal(&obj.SyntheticsMobileStepParamsValueNumber) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *SyntheticsMobileStepParamsValue) GetActualInstance() interface{} { + if obj.SyntheticsMobileStepParamsValueString != nil { + return obj.SyntheticsMobileStepParamsValueString + } + + if obj.SyntheticsMobileStepParamsValueNumber != nil { + return obj.SyntheticsMobileStepParamsValueNumber + } + + // all schemas are nil + return nil +}