Skip to content

Commit 8206898

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9dd9914 of spec repo
1 parent 71da684 commit 8206898

File tree

107 files changed

+9994
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+9994
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

api/datadogV2/api_actions_datastores.go

Lines changed: 958 additions & 0 deletions
Large diffs are not rendered by default.

api/datadogV2/doc.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
// - [ActionConnectionApi.RegisterAppKey]
3232
// - [ActionConnectionApi.UnregisterAppKey]
3333
// - [ActionConnectionApi.UpdateActionConnection]
34+
// - [ActionsDatastoresApi.BulkWriteDatastoreItems]
35+
// - [ActionsDatastoresApi.CreateDatastore]
36+
// - [ActionsDatastoresApi.CreateDatastoreFromImport]
37+
// - [ActionsDatastoresApi.DeleteDatastore]
38+
// - [ActionsDatastoresApi.DeleteDatastoreItem]
39+
// - [ActionsDatastoresApi.GetDatastore]
40+
// - [ActionsDatastoresApi.ListDatastoreItems]
41+
// - [ActionsDatastoresApi.ListDatastores]
42+
// - [ActionsDatastoresApi.UpdateDatastore]
43+
// - [ActionsDatastoresApi.WriteDatastoreItem]
3444
// - [AgentlessScanningApi.CreateAwsOnDemandTask]
3545
// - [AgentlessScanningApi.CreateAwsScanOptions]
3646
// - [AgentlessScanningApi.DeleteAwsScanOptions]
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
9+
)
10+
11+
// BulkPutAppsDatastoreItemsRequest The definition of `BulkPutAppsDatastoreItemsRequest` object.
12+
type BulkPutAppsDatastoreItemsRequest struct {
13+
// The definition of `BulkPutAppsDatastoreItemsRequestData` object.
14+
Data *BulkPutAppsDatastoreItemsRequestData `json:"data,omitempty"`
15+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
16+
UnparsedObject map[string]interface{} `json:"-"`
17+
AdditionalProperties map[string]interface{} `json:"-"`
18+
}
19+
20+
// NewBulkPutAppsDatastoreItemsRequest instantiates a new BulkPutAppsDatastoreItemsRequest object.
21+
// This constructor will assign default values to properties that have it defined,
22+
// and makes sure properties required by API are set, but the set of arguments
23+
// will change when the set of required properties is changed.
24+
func NewBulkPutAppsDatastoreItemsRequest() *BulkPutAppsDatastoreItemsRequest {
25+
this := BulkPutAppsDatastoreItemsRequest{}
26+
return &this
27+
}
28+
29+
// NewBulkPutAppsDatastoreItemsRequestWithDefaults instantiates a new BulkPutAppsDatastoreItemsRequest object.
30+
// This constructor will only assign default values to properties that have it defined,
31+
// but it doesn't guarantee that properties required by API are set.
32+
func NewBulkPutAppsDatastoreItemsRequestWithDefaults() *BulkPutAppsDatastoreItemsRequest {
33+
this := BulkPutAppsDatastoreItemsRequest{}
34+
return &this
35+
}
36+
37+
// GetData returns the Data field value if set, zero value otherwise.
38+
func (o *BulkPutAppsDatastoreItemsRequest) GetData() BulkPutAppsDatastoreItemsRequestData {
39+
if o == nil || o.Data == nil {
40+
var ret BulkPutAppsDatastoreItemsRequestData
41+
return ret
42+
}
43+
return *o.Data
44+
}
45+
46+
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
47+
// and a boolean to check if the value has been set.
48+
func (o *BulkPutAppsDatastoreItemsRequest) GetDataOk() (*BulkPutAppsDatastoreItemsRequestData, bool) {
49+
if o == nil || o.Data == nil {
50+
return nil, false
51+
}
52+
return o.Data, true
53+
}
54+
55+
// HasData returns a boolean if a field has been set.
56+
func (o *BulkPutAppsDatastoreItemsRequest) HasData() bool {
57+
return o != nil && o.Data != nil
58+
}
59+
60+
// SetData gets a reference to the given BulkPutAppsDatastoreItemsRequestData and assigns it to the Data field.
61+
func (o *BulkPutAppsDatastoreItemsRequest) SetData(v BulkPutAppsDatastoreItemsRequestData) {
62+
o.Data = &v
63+
}
64+
65+
// MarshalJSON serializes the struct using spec logic.
66+
func (o BulkPutAppsDatastoreItemsRequest) MarshalJSON() ([]byte, error) {
67+
toSerialize := map[string]interface{}{}
68+
if o.UnparsedObject != nil {
69+
return datadog.Marshal(o.UnparsedObject)
70+
}
71+
if o.Data != nil {
72+
toSerialize["data"] = o.Data
73+
}
74+
75+
for key, value := range o.AdditionalProperties {
76+
toSerialize[key] = value
77+
}
78+
return datadog.Marshal(toSerialize)
79+
}
80+
81+
// UnmarshalJSON deserializes the given payload.
82+
func (o *BulkPutAppsDatastoreItemsRequest) UnmarshalJSON(bytes []byte) (err error) {
83+
all := struct {
84+
Data *BulkPutAppsDatastoreItemsRequestData `json:"data,omitempty"`
85+
}{}
86+
if err = datadog.Unmarshal(bytes, &all); err != nil {
87+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
88+
}
89+
additionalProperties := make(map[string]interface{})
90+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
91+
datadog.DeleteKeys(additionalProperties, &[]string{"data"})
92+
} else {
93+
return err
94+
}
95+
96+
hasInvalidField := false
97+
if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil {
98+
hasInvalidField = true
99+
}
100+
o.Data = all.Data
101+
102+
if len(additionalProperties) > 0 {
103+
o.AdditionalProperties = additionalProperties
104+
}
105+
106+
if hasInvalidField {
107+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
108+
}
109+
110+
return nil
111+
}
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/google/uuid"
11+
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
13+
)
14+
15+
// BulkPutAppsDatastoreItemsRequestData The definition of `BulkPutAppsDatastoreItemsRequestData` object.
16+
type BulkPutAppsDatastoreItemsRequestData struct {
17+
// The definition of `BulkPutAppsDatastoreItemsRequestDataAttributes` object.
18+
Attributes *BulkPutAppsDatastoreItemsRequestDataAttributes `json:"attributes,omitempty"`
19+
// The `BulkPutAppsDatastoreItemsRequestData` `id`.
20+
Id *uuid.UUID `json:"id,omitempty"`
21+
// Items resource type.
22+
Type DatastoreItemsDataType `json:"type"`
23+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
24+
UnparsedObject map[string]interface{} `json:"-"`
25+
AdditionalProperties map[string]interface{} `json:"-"`
26+
}
27+
28+
// NewBulkPutAppsDatastoreItemsRequestData instantiates a new BulkPutAppsDatastoreItemsRequestData object.
29+
// This constructor will assign default values to properties that have it defined,
30+
// and makes sure properties required by API are set, but the set of arguments
31+
// will change when the set of required properties is changed.
32+
func NewBulkPutAppsDatastoreItemsRequestData(typeVar DatastoreItemsDataType) *BulkPutAppsDatastoreItemsRequestData {
33+
this := BulkPutAppsDatastoreItemsRequestData{}
34+
this.Type = typeVar
35+
return &this
36+
}
37+
38+
// NewBulkPutAppsDatastoreItemsRequestDataWithDefaults instantiates a new BulkPutAppsDatastoreItemsRequestData object.
39+
// This constructor will only assign default values to properties that have it defined,
40+
// but it doesn't guarantee that properties required by API are set.
41+
func NewBulkPutAppsDatastoreItemsRequestDataWithDefaults() *BulkPutAppsDatastoreItemsRequestData {
42+
this := BulkPutAppsDatastoreItemsRequestData{}
43+
var typeVar DatastoreItemsDataType = DATASTOREITEMSDATATYPE_ITEMS
44+
this.Type = typeVar
45+
return &this
46+
}
47+
48+
// GetAttributes returns the Attributes field value if set, zero value otherwise.
49+
func (o *BulkPutAppsDatastoreItemsRequestData) GetAttributes() BulkPutAppsDatastoreItemsRequestDataAttributes {
50+
if o == nil || o.Attributes == nil {
51+
var ret BulkPutAppsDatastoreItemsRequestDataAttributes
52+
return ret
53+
}
54+
return *o.Attributes
55+
}
56+
57+
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
58+
// and a boolean to check if the value has been set.
59+
func (o *BulkPutAppsDatastoreItemsRequestData) GetAttributesOk() (*BulkPutAppsDatastoreItemsRequestDataAttributes, bool) {
60+
if o == nil || o.Attributes == nil {
61+
return nil, false
62+
}
63+
return o.Attributes, true
64+
}
65+
66+
// HasAttributes returns a boolean if a field has been set.
67+
func (o *BulkPutAppsDatastoreItemsRequestData) HasAttributes() bool {
68+
return o != nil && o.Attributes != nil
69+
}
70+
71+
// SetAttributes gets a reference to the given BulkPutAppsDatastoreItemsRequestDataAttributes and assigns it to the Attributes field.
72+
func (o *BulkPutAppsDatastoreItemsRequestData) SetAttributes(v BulkPutAppsDatastoreItemsRequestDataAttributes) {
73+
o.Attributes = &v
74+
}
75+
76+
// GetId returns the Id field value if set, zero value otherwise.
77+
func (o *BulkPutAppsDatastoreItemsRequestData) GetId() uuid.UUID {
78+
if o == nil || o.Id == nil {
79+
var ret uuid.UUID
80+
return ret
81+
}
82+
return *o.Id
83+
}
84+
85+
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
86+
// and a boolean to check if the value has been set.
87+
func (o *BulkPutAppsDatastoreItemsRequestData) GetIdOk() (*uuid.UUID, bool) {
88+
if o == nil || o.Id == nil {
89+
return nil, false
90+
}
91+
return o.Id, true
92+
}
93+
94+
// HasId returns a boolean if a field has been set.
95+
func (o *BulkPutAppsDatastoreItemsRequestData) HasId() bool {
96+
return o != nil && o.Id != nil
97+
}
98+
99+
// SetId gets a reference to the given uuid.UUID and assigns it to the Id field.
100+
func (o *BulkPutAppsDatastoreItemsRequestData) SetId(v uuid.UUID) {
101+
o.Id = &v
102+
}
103+
104+
// GetType returns the Type field value.
105+
func (o *BulkPutAppsDatastoreItemsRequestData) GetType() DatastoreItemsDataType {
106+
if o == nil {
107+
var ret DatastoreItemsDataType
108+
return ret
109+
}
110+
return o.Type
111+
}
112+
113+
// GetTypeOk returns a tuple with the Type field value
114+
// and a boolean to check if the value has been set.
115+
func (o *BulkPutAppsDatastoreItemsRequestData) GetTypeOk() (*DatastoreItemsDataType, bool) {
116+
if o == nil {
117+
return nil, false
118+
}
119+
return &o.Type, true
120+
}
121+
122+
// SetType sets field value.
123+
func (o *BulkPutAppsDatastoreItemsRequestData) SetType(v DatastoreItemsDataType) {
124+
o.Type = v
125+
}
126+
127+
// MarshalJSON serializes the struct using spec logic.
128+
func (o BulkPutAppsDatastoreItemsRequestData) MarshalJSON() ([]byte, error) {
129+
toSerialize := map[string]interface{}{}
130+
if o.UnparsedObject != nil {
131+
return datadog.Marshal(o.UnparsedObject)
132+
}
133+
if o.Attributes != nil {
134+
toSerialize["attributes"] = o.Attributes
135+
}
136+
if o.Id != nil {
137+
toSerialize["id"] = o.Id
138+
}
139+
toSerialize["type"] = o.Type
140+
141+
for key, value := range o.AdditionalProperties {
142+
toSerialize[key] = value
143+
}
144+
return datadog.Marshal(toSerialize)
145+
}
146+
147+
// UnmarshalJSON deserializes the given payload.
148+
func (o *BulkPutAppsDatastoreItemsRequestData) UnmarshalJSON(bytes []byte) (err error) {
149+
all := struct {
150+
Attributes *BulkPutAppsDatastoreItemsRequestDataAttributes `json:"attributes,omitempty"`
151+
Id *uuid.UUID `json:"id,omitempty"`
152+
Type *DatastoreItemsDataType `json:"type"`
153+
}{}
154+
if err = datadog.Unmarshal(bytes, &all); err != nil {
155+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
156+
}
157+
if all.Type == nil {
158+
return fmt.Errorf("required field type missing")
159+
}
160+
additionalProperties := make(map[string]interface{})
161+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
162+
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"})
163+
} else {
164+
return err
165+
}
166+
167+
hasInvalidField := false
168+
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
169+
hasInvalidField = true
170+
}
171+
o.Attributes = all.Attributes
172+
o.Id = all.Id
173+
if !all.Type.IsValid() {
174+
hasInvalidField = true
175+
} else {
176+
o.Type = *all.Type
177+
}
178+
179+
if len(additionalProperties) > 0 {
180+
o.AdditionalProperties = additionalProperties
181+
}
182+
183+
if hasInvalidField {
184+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
185+
}
186+
187+
return nil
188+
}

0 commit comments

Comments
 (0)