Skip to content

Commit bad838c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 769e3a3 of spec repo
1 parent 91bc610 commit bad838c

23 files changed

Lines changed: 2649 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

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

api/datadogV2/api_web_integrations.go

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

api/datadogV2/doc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,11 @@
10221022
// - [UsersApi.ListUsers]
10231023
// - [UsersApi.SendInvitations]
10241024
// - [UsersApi.UpdateUser]
1025+
// - [WebIntegrationsApi.CreateWebIntegrationAccount]
1026+
// - [WebIntegrationsApi.DeleteWebIntegrationAccount]
1027+
// - [WebIntegrationsApi.GetWebIntegrationAccount]
1028+
// - [WebIntegrationsApi.ListWebIntegrationAccounts]
1029+
// - [WebIntegrationsApi.UpdateWebIntegrationAccount]
10251030
// - [WidgetsApi.CreateWidget]
10261031
// - [WidgetsApi.DeleteWidget]
10271032
// - [WidgetsApi.GetWidget]
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// WebIntegrationAccountCreateRequest Payload schema when adding a web integration account.
14+
type WebIntegrationAccountCreateRequest struct {
15+
// Data object for creating a web integration account.
16+
Data WebIntegrationAccountCreateRequestData `json:"data"`
17+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
18+
UnparsedObject map[string]interface{} `json:"-"`
19+
AdditionalProperties map[string]interface{} `json:"-"`
20+
}
21+
22+
// NewWebIntegrationAccountCreateRequest instantiates a new WebIntegrationAccountCreateRequest object.
23+
// This constructor will assign default values to properties that have it defined,
24+
// and makes sure properties required by API are set, but the set of arguments
25+
// will change when the set of required properties is changed.
26+
func NewWebIntegrationAccountCreateRequest(data WebIntegrationAccountCreateRequestData) *WebIntegrationAccountCreateRequest {
27+
this := WebIntegrationAccountCreateRequest{}
28+
this.Data = data
29+
return &this
30+
}
31+
32+
// NewWebIntegrationAccountCreateRequestWithDefaults instantiates a new WebIntegrationAccountCreateRequest object.
33+
// This constructor will only assign default values to properties that have it defined,
34+
// but it doesn't guarantee that properties required by API are set.
35+
func NewWebIntegrationAccountCreateRequestWithDefaults() *WebIntegrationAccountCreateRequest {
36+
this := WebIntegrationAccountCreateRequest{}
37+
return &this
38+
}
39+
40+
// GetData returns the Data field value.
41+
func (o *WebIntegrationAccountCreateRequest) GetData() WebIntegrationAccountCreateRequestData {
42+
if o == nil {
43+
var ret WebIntegrationAccountCreateRequestData
44+
return ret
45+
}
46+
return o.Data
47+
}
48+
49+
// GetDataOk returns a tuple with the Data field value
50+
// and a boolean to check if the value has been set.
51+
func (o *WebIntegrationAccountCreateRequest) GetDataOk() (*WebIntegrationAccountCreateRequestData, bool) {
52+
if o == nil {
53+
return nil, false
54+
}
55+
return &o.Data, true
56+
}
57+
58+
// SetData sets field value.
59+
func (o *WebIntegrationAccountCreateRequest) SetData(v WebIntegrationAccountCreateRequestData) {
60+
o.Data = v
61+
}
62+
63+
// MarshalJSON serializes the struct using spec logic.
64+
func (o WebIntegrationAccountCreateRequest) MarshalJSON() ([]byte, error) {
65+
toSerialize := map[string]interface{}{}
66+
if o.UnparsedObject != nil {
67+
return datadog.Marshal(o.UnparsedObject)
68+
}
69+
toSerialize["data"] = o.Data
70+
71+
for key, value := range o.AdditionalProperties {
72+
toSerialize[key] = value
73+
}
74+
return datadog.Marshal(toSerialize)
75+
}
76+
77+
// UnmarshalJSON deserializes the given payload.
78+
func (o *WebIntegrationAccountCreateRequest) UnmarshalJSON(bytes []byte) (err error) {
79+
all := struct {
80+
Data *WebIntegrationAccountCreateRequestData `json:"data"`
81+
}{}
82+
if err = datadog.Unmarshal(bytes, &all); err != nil {
83+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
84+
}
85+
if all.Data == nil {
86+
return fmt.Errorf("required field data missing")
87+
}
88+
additionalProperties := make(map[string]interface{})
89+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
90+
datadog.DeleteKeys(additionalProperties, &[]string{"data"})
91+
} else {
92+
return err
93+
}
94+
95+
hasInvalidField := false
96+
if all.Data.UnparsedObject != nil && o.UnparsedObject == nil {
97+
hasInvalidField = true
98+
}
99+
o.Data = *all.Data
100+
101+
if len(additionalProperties) > 0 {
102+
o.AdditionalProperties = additionalProperties
103+
}
104+
105+
if hasInvalidField {
106+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
107+
}
108+
109+
return nil
110+
}
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// WebIntegrationAccountCreateRequestAttributes Attributes object for creating a web integration account.
14+
type WebIntegrationAccountCreateRequestAttributes struct {
15+
// A human-readable name for the account. Must be unique among accounts of the same integration.
16+
Name string `json:"name"`
17+
// Integration-specific secrets. The shape of this object varies by integration. Secrets
18+
// are write-only and never returned by the API.
19+
Secrets map[string]interface{} `json:"secrets"`
20+
// Integration-specific settings. The shape of this object varies by integration.
21+
Settings map[string]interface{} `json:"settings"`
22+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
23+
UnparsedObject map[string]interface{} `json:"-"`
24+
AdditionalProperties map[string]interface{} `json:"-"`
25+
}
26+
27+
// NewWebIntegrationAccountCreateRequestAttributes instantiates a new WebIntegrationAccountCreateRequestAttributes object.
28+
// This constructor will assign default values to properties that have it defined,
29+
// and makes sure properties required by API are set, but the set of arguments
30+
// will change when the set of required properties is changed.
31+
func NewWebIntegrationAccountCreateRequestAttributes(name string, secrets map[string]interface{}, settings map[string]interface{}) *WebIntegrationAccountCreateRequestAttributes {
32+
this := WebIntegrationAccountCreateRequestAttributes{}
33+
this.Name = name
34+
this.Secrets = secrets
35+
this.Settings = settings
36+
return &this
37+
}
38+
39+
// NewWebIntegrationAccountCreateRequestAttributesWithDefaults instantiates a new WebIntegrationAccountCreateRequestAttributes object.
40+
// This constructor will only assign default values to properties that have it defined,
41+
// but it doesn't guarantee that properties required by API are set.
42+
func NewWebIntegrationAccountCreateRequestAttributesWithDefaults() *WebIntegrationAccountCreateRequestAttributes {
43+
this := WebIntegrationAccountCreateRequestAttributes{}
44+
return &this
45+
}
46+
47+
// GetName returns the Name field value.
48+
func (o *WebIntegrationAccountCreateRequestAttributes) GetName() string {
49+
if o == nil {
50+
var ret string
51+
return ret
52+
}
53+
return o.Name
54+
}
55+
56+
// GetNameOk returns a tuple with the Name field value
57+
// and a boolean to check if the value has been set.
58+
func (o *WebIntegrationAccountCreateRequestAttributes) GetNameOk() (*string, bool) {
59+
if o == nil {
60+
return nil, false
61+
}
62+
return &o.Name, true
63+
}
64+
65+
// SetName sets field value.
66+
func (o *WebIntegrationAccountCreateRequestAttributes) SetName(v string) {
67+
o.Name = v
68+
}
69+
70+
// GetSecrets returns the Secrets field value.
71+
func (o *WebIntegrationAccountCreateRequestAttributes) GetSecrets() map[string]interface{} {
72+
if o == nil {
73+
var ret map[string]interface{}
74+
return ret
75+
}
76+
return o.Secrets
77+
}
78+
79+
// GetSecretsOk returns a tuple with the Secrets field value
80+
// and a boolean to check if the value has been set.
81+
func (o *WebIntegrationAccountCreateRequestAttributes) GetSecretsOk() (*map[string]interface{}, bool) {
82+
if o == nil {
83+
return nil, false
84+
}
85+
return &o.Secrets, true
86+
}
87+
88+
// SetSecrets sets field value.
89+
func (o *WebIntegrationAccountCreateRequestAttributes) SetSecrets(v map[string]interface{}) {
90+
o.Secrets = v
91+
}
92+
93+
// GetSettings returns the Settings field value.
94+
func (o *WebIntegrationAccountCreateRequestAttributes) GetSettings() map[string]interface{} {
95+
if o == nil {
96+
var ret map[string]interface{}
97+
return ret
98+
}
99+
return o.Settings
100+
}
101+
102+
// GetSettingsOk returns a tuple with the Settings field value
103+
// and a boolean to check if the value has been set.
104+
func (o *WebIntegrationAccountCreateRequestAttributes) GetSettingsOk() (*map[string]interface{}, bool) {
105+
if o == nil {
106+
return nil, false
107+
}
108+
return &o.Settings, true
109+
}
110+
111+
// SetSettings sets field value.
112+
func (o *WebIntegrationAccountCreateRequestAttributes) SetSettings(v map[string]interface{}) {
113+
o.Settings = v
114+
}
115+
116+
// MarshalJSON serializes the struct using spec logic.
117+
func (o WebIntegrationAccountCreateRequestAttributes) MarshalJSON() ([]byte, error) {
118+
toSerialize := map[string]interface{}{}
119+
if o.UnparsedObject != nil {
120+
return datadog.Marshal(o.UnparsedObject)
121+
}
122+
toSerialize["name"] = o.Name
123+
toSerialize["secrets"] = o.Secrets
124+
toSerialize["settings"] = o.Settings
125+
126+
for key, value := range o.AdditionalProperties {
127+
toSerialize[key] = value
128+
}
129+
return datadog.Marshal(toSerialize)
130+
}
131+
132+
// UnmarshalJSON deserializes the given payload.
133+
func (o *WebIntegrationAccountCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err error) {
134+
all := struct {
135+
Name *string `json:"name"`
136+
Secrets *map[string]interface{} `json:"secrets"`
137+
Settings *map[string]interface{} `json:"settings"`
138+
}{}
139+
if err = datadog.Unmarshal(bytes, &all); err != nil {
140+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
141+
}
142+
if all.Name == nil {
143+
return fmt.Errorf("required field name missing")
144+
}
145+
if all.Secrets == nil {
146+
return fmt.Errorf("required field secrets missing")
147+
}
148+
if all.Settings == nil {
149+
return fmt.Errorf("required field settings missing")
150+
}
151+
additionalProperties := make(map[string]interface{})
152+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
153+
datadog.DeleteKeys(additionalProperties, &[]string{"name", "secrets", "settings"})
154+
} else {
155+
return err
156+
}
157+
o.Name = *all.Name
158+
o.Secrets = *all.Secrets
159+
o.Settings = *all.Settings
160+
161+
if len(additionalProperties) > 0 {
162+
o.AdditionalProperties = additionalProperties
163+
}
164+
165+
return nil
166+
}

0 commit comments

Comments
 (0)