-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 0686849c of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Nov 17, 2023
1 parent
1c7b7cb
commit fabed32
Showing
12 changed files
with
682 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// 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" | ||
) | ||
|
||
// SyntheticsPatchTestBody Wrapper around an array of [JSON Patch](https://jsonpatch.com) operations to perform on the test | ||
type SyntheticsPatchTestBody struct { | ||
// Array of [JSON Patch](https://jsonpatch.com) operations to perform on the test | ||
Data []SyntheticsPatchTestOperation `json:"data,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{} | ||
} | ||
|
||
// NewSyntheticsPatchTestBody instantiates a new SyntheticsPatchTestBody object. | ||
// This constructor will assign default values to properties that have it defined, | ||
// and makes sure properties required by API are set, but the set of arguments | ||
// will change when the set of required properties is changed. | ||
func NewSyntheticsPatchTestBody() *SyntheticsPatchTestBody { | ||
this := SyntheticsPatchTestBody{} | ||
return &this | ||
} | ||
|
||
// NewSyntheticsPatchTestBodyWithDefaults instantiates a new SyntheticsPatchTestBody object. | ||
// This constructor will only assign default values to properties that have it defined, | ||
// but it doesn't guarantee that properties required by API are set. | ||
func NewSyntheticsPatchTestBodyWithDefaults() *SyntheticsPatchTestBody { | ||
this := SyntheticsPatchTestBody{} | ||
return &this | ||
} | ||
|
||
// GetData returns the Data field value if set, zero value otherwise. | ||
func (o *SyntheticsPatchTestBody) GetData() []SyntheticsPatchTestOperation { | ||
if o == nil || o.Data == nil { | ||
var ret []SyntheticsPatchTestOperation | ||
return ret | ||
} | ||
return o.Data | ||
} | ||
|
||
// GetDataOk returns a tuple with the Data field value if set, nil otherwise | ||
// and a boolean to check if the value has been set. | ||
func (o *SyntheticsPatchTestBody) GetDataOk() (*[]SyntheticsPatchTestOperation, bool) { | ||
if o == nil || o.Data == nil { | ||
return nil, false | ||
} | ||
return &o.Data, true | ||
} | ||
|
||
// HasData returns a boolean if a field has been set. | ||
func (o *SyntheticsPatchTestBody) HasData() bool { | ||
return o != nil && o.Data != nil | ||
} | ||
|
||
// SetData gets a reference to the given []SyntheticsPatchTestOperation and assigns it to the Data field. | ||
func (o *SyntheticsPatchTestBody) SetData(v []SyntheticsPatchTestOperation) { | ||
o.Data = v | ||
} | ||
|
||
// MarshalJSON serializes the struct using spec logic. | ||
func (o SyntheticsPatchTestBody) MarshalJSON() ([]byte, error) { | ||
toSerialize := map[string]interface{}{} | ||
if o.UnparsedObject != nil { | ||
return datadog.Marshal(o.UnparsedObject) | ||
} | ||
if o.Data != nil { | ||
toSerialize["data"] = o.Data | ||
} | ||
|
||
for key, value := range o.AdditionalProperties { | ||
toSerialize[key] = value | ||
} | ||
return datadog.Marshal(toSerialize) | ||
} | ||
|
||
// UnmarshalJSON deserializes the given payload. | ||
func (o *SyntheticsPatchTestBody) UnmarshalJSON(bytes []byte) (err error) { | ||
all := struct { | ||
Data []SyntheticsPatchTestOperation `json:"data,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{"data"}) | ||
} else { | ||
return err | ||
} | ||
o.Data = all.Data | ||
|
||
if len(additionalProperties) > 0 { | ||
o.AdditionalProperties = additionalProperties | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.