-
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 b4de72c1 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Aug 6, 2024
1 parent
f079aa9
commit 991d04b
Showing
21 changed files
with
281 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
// 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 ( | ||
"fmt" | ||
|
||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
) | ||
|
||
// SyntheticsAssertionJavascript A JavaScript assertion. | ||
type SyntheticsAssertionJavascript struct { | ||
// The JavaScript code that performs the assertions. | ||
Code string `json:"code"` | ||
// Type of the assertion. | ||
Type SyntheticsAssertionType `json:"type"` | ||
// 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:"-"` | ||
} | ||
|
||
// NewSyntheticsAssertionJavascript instantiates a new SyntheticsAssertionJavascript 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 NewSyntheticsAssertionJavascript(code string, typeVar SyntheticsAssertionType) *SyntheticsAssertionJavascript { | ||
this := SyntheticsAssertionJavascript{} | ||
this.Code = code | ||
this.Type = typeVar | ||
return &this | ||
} | ||
|
||
// NewSyntheticsAssertionJavascriptWithDefaults instantiates a new SyntheticsAssertionJavascript 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 NewSyntheticsAssertionJavascriptWithDefaults() *SyntheticsAssertionJavascript { | ||
this := SyntheticsAssertionJavascript{} | ||
return &this | ||
} | ||
|
||
// GetCode returns the Code field value. | ||
func (o *SyntheticsAssertionJavascript) GetCode() string { | ||
if o == nil { | ||
var ret string | ||
return ret | ||
} | ||
return o.Code | ||
} | ||
|
||
// GetCodeOk returns a tuple with the Code field value | ||
// and a boolean to check if the value has been set. | ||
func (o *SyntheticsAssertionJavascript) GetCodeOk() (*string, bool) { | ||
if o == nil { | ||
return nil, false | ||
} | ||
return &o.Code, true | ||
} | ||
|
||
// SetCode sets field value. | ||
func (o *SyntheticsAssertionJavascript) SetCode(v string) { | ||
o.Code = v | ||
} | ||
|
||
// GetType returns the Type field value. | ||
func (o *SyntheticsAssertionJavascript) GetType() SyntheticsAssertionType { | ||
if o == nil { | ||
var ret SyntheticsAssertionType | ||
return ret | ||
} | ||
return o.Type | ||
} | ||
|
||
// GetTypeOk returns a tuple with the Type field value | ||
// and a boolean to check if the value has been set. | ||
func (o *SyntheticsAssertionJavascript) GetTypeOk() (*SyntheticsAssertionType, bool) { | ||
if o == nil { | ||
return nil, false | ||
} | ||
return &o.Type, true | ||
} | ||
|
||
// SetType sets field value. | ||
func (o *SyntheticsAssertionJavascript) SetType(v SyntheticsAssertionType) { | ||
o.Type = v | ||
} | ||
|
||
// MarshalJSON serializes the struct using spec logic. | ||
func (o SyntheticsAssertionJavascript) MarshalJSON() ([]byte, error) { | ||
toSerialize := map[string]interface{}{} | ||
if o.UnparsedObject != nil { | ||
return datadog.Marshal(o.UnparsedObject) | ||
} | ||
toSerialize["code"] = o.Code | ||
toSerialize["type"] = o.Type | ||
|
||
for key, value := range o.AdditionalProperties { | ||
toSerialize[key] = value | ||
} | ||
return datadog.Marshal(toSerialize) | ||
} | ||
|
||
// UnmarshalJSON deserializes the given payload. | ||
func (o *SyntheticsAssertionJavascript) UnmarshalJSON(bytes []byte) (err error) { | ||
all := struct { | ||
Code *string `json:"code"` | ||
Type *SyntheticsAssertionType `json:"type"` | ||
}{} | ||
if err = datadog.Unmarshal(bytes, &all); err != nil { | ||
return datadog.Unmarshal(bytes, &o.UnparsedObject) | ||
} | ||
if all.Code == nil { | ||
return fmt.Errorf("required field code missing") | ||
} | ||
if all.Type == nil { | ||
return fmt.Errorf("required field type missing") | ||
} | ||
additionalProperties := make(map[string]interface{}) | ||
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { | ||
datadog.DeleteKeys(additionalProperties, &[]string{"code", "type"}) | ||
} else { | ||
return err | ||
} | ||
|
||
hasInvalidField := false | ||
o.Code = *all.Code | ||
if !all.Type.IsValid() { | ||
hasInvalidField = true | ||
} else { | ||
o.Type = *all.Type | ||
} | ||
|
||
if len(additionalProperties) > 0 { | ||
o.AdditionalProperties = additionalProperties | ||
} | ||
|
||
if hasInvalidField { | ||
return datadog.Unmarshal(bytes, &o.UnparsedObject) | ||
} | ||
|
||
return nil | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...ettes/TestScenarios/v1/Feature_Monitors/Scenario_Get_a_synthetics_monitors_details.freeze
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 |
---|---|---|
@@ -1 +1 @@ | ||
2024-06-14T15:19:35.860Z | ||
2024-08-06T12:03:16.833Z |
Oops, something went wrong.