-
Notifications
You must be signed in to change notification settings - Fork 53
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 a3c20084 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Jul 29, 2024
1 parent
f4af254
commit 403a81f
Showing
20 changed files
with
842 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,111 @@ | ||
// 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 datadogV2 | ||
|
||
import ( | ||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
) | ||
|
||
// ListTagsResponse List tags response. | ||
type ListTagsResponse struct { | ||
// The list tags response data. | ||
Data *ListTagsResponseData `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{} | ||
} | ||
|
||
// NewListTagsResponse instantiates a new ListTagsResponse 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 NewListTagsResponse() *ListTagsResponse { | ||
this := ListTagsResponse{} | ||
return &this | ||
} | ||
|
||
// NewListTagsResponseWithDefaults instantiates a new ListTagsResponse 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 NewListTagsResponseWithDefaults() *ListTagsResponse { | ||
this := ListTagsResponse{} | ||
return &this | ||
} | ||
|
||
// GetData returns the Data field value if set, zero value otherwise. | ||
func (o *ListTagsResponse) GetData() ListTagsResponseData { | ||
if o == nil || o.Data == nil { | ||
var ret ListTagsResponseData | ||
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 *ListTagsResponse) GetDataOk() (*ListTagsResponseData, 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 *ListTagsResponse) HasData() bool { | ||
return o != nil && o.Data != nil | ||
} | ||
|
||
// SetData gets a reference to the given ListTagsResponseData and assigns it to the Data field. | ||
func (o *ListTagsResponse) SetData(v ListTagsResponseData) { | ||
o.Data = &v | ||
} | ||
|
||
// MarshalJSON serializes the struct using spec logic. | ||
func (o ListTagsResponse) 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 *ListTagsResponse) UnmarshalJSON(bytes []byte) (err error) { | ||
all := struct { | ||
Data *ListTagsResponseData `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 | ||
} | ||
|
||
hasInvalidField := false | ||
if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { | ||
hasInvalidField = true | ||
} | ||
o.Data = all.Data | ||
|
||
if len(additionalProperties) > 0 { | ||
o.AdditionalProperties = additionalProperties | ||
} | ||
|
||
if hasInvalidField { | ||
return datadog.Unmarshal(bytes, &o.UnparsedObject) | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.