Skip to content

Commit edef1fa

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 140fa9d of spec repo (DataDog#3571)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0f3ca10 commit edef1fa

12 files changed

Lines changed: 1564 additions & 260 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 257 additions & 176 deletions
Large diffs are not rendered by default.

api/datadogV2/api_dora_metrics.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,11 @@ func (a *DORAMetricsApi) DeleteDORAFailure(ctx _context.Context, failureId strin
434434

435435
// GetDORADeployment Get a deployment event.
436436
// Use this API endpoint to get a deployment event.
437-
func (a *DORAMetricsApi) GetDORADeployment(ctx _context.Context, deploymentId string) (DORAFetchResponse, *_nethttp.Response, error) {
437+
func (a *DORAMetricsApi) GetDORADeployment(ctx _context.Context, deploymentId string) (DORADeploymentFetchResponse, *_nethttp.Response, error) {
438438
var (
439439
localVarHTTPMethod = _nethttp.MethodGet
440440
localVarPostBody interface{}
441-
localVarReturnValue DORAFetchResponse
441+
localVarReturnValue DORADeploymentFetchResponse
442442
)
443443

444444
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DORAMetricsApi.GetDORADeployment")
@@ -521,11 +521,11 @@ func (a *DORAMetricsApi) GetDORADeployment(ctx _context.Context, deploymentId st
521521

522522
// GetDORAFailure Get a failure event.
523523
// Use this API endpoint to get a failure event.
524-
func (a *DORAMetricsApi) GetDORAFailure(ctx _context.Context, failureId string) (DORAFetchResponse, *_nethttp.Response, error) {
524+
func (a *DORAMetricsApi) GetDORAFailure(ctx _context.Context, failureId string) (DORAFailureFetchResponse, *_nethttp.Response, error) {
525525
var (
526526
localVarHTTPMethod = _nethttp.MethodGet
527527
localVarPostBody interface{}
528-
localVarReturnValue DORAFetchResponse
528+
localVarReturnValue DORAFailureFetchResponse
529529
)
530530

531531
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DORAMetricsApi.GetDORAFailure")
@@ -608,11 +608,11 @@ func (a *DORAMetricsApi) GetDORAFailure(ctx _context.Context, failureId string)
608608

609609
// ListDORADeployments Get a list of deployment events.
610610
// Use this API endpoint to get a list of deployment events.
611-
func (a *DORAMetricsApi) ListDORADeployments(ctx _context.Context, body DORAListDeploymentsRequest) (DORAListResponse, *_nethttp.Response, error) {
611+
func (a *DORAMetricsApi) ListDORADeployments(ctx _context.Context, body DORAListDeploymentsRequest) (DORADeploymentsListResponse, *_nethttp.Response, error) {
612612
var (
613613
localVarHTTPMethod = _nethttp.MethodPost
614614
localVarPostBody interface{}
615-
localVarReturnValue DORAListResponse
615+
localVarReturnValue DORADeploymentsListResponse
616616
)
617617

618618
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DORAMetricsApi.ListDORADeployments")
@@ -697,11 +697,11 @@ func (a *DORAMetricsApi) ListDORADeployments(ctx _context.Context, body DORAList
697697

698698
// ListDORAFailures Get a list of failure events.
699699
// Use this API endpoint to get a list of failure events.
700-
func (a *DORAMetricsApi) ListDORAFailures(ctx _context.Context, body DORAListFailuresRequest) (DORAListResponse, *_nethttp.Response, error) {
700+
func (a *DORAMetricsApi) ListDORAFailures(ctx _context.Context, body DORAListFailuresRequest) (DORAFailuresListResponse, *_nethttp.Response, error) {
701701
var (
702702
localVarHTTPMethod = _nethttp.MethodPost
703703
localVarPostBody interface{}
704-
localVarReturnValue DORAListResponse
704+
localVarReturnValue DORAFailuresListResponse
705705
)
706706

707707
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DORAMetricsApi.ListDORAFailures")
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+
// DORADeploymentFetchResponse Response for fetching a single deployment event.
12+
type DORADeploymentFetchResponse struct {
13+
// A DORA deployment event.
14+
Data *DORADeploymentObject `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+
// NewDORADeploymentFetchResponse instantiates a new DORADeploymentFetchResponse 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 NewDORADeploymentFetchResponse() *DORADeploymentFetchResponse {
25+
this := DORADeploymentFetchResponse{}
26+
return &this
27+
}
28+
29+
// NewDORADeploymentFetchResponseWithDefaults instantiates a new DORADeploymentFetchResponse 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 NewDORADeploymentFetchResponseWithDefaults() *DORADeploymentFetchResponse {
33+
this := DORADeploymentFetchResponse{}
34+
return &this
35+
}
36+
37+
// GetData returns the Data field value if set, zero value otherwise.
38+
func (o *DORADeploymentFetchResponse) GetData() DORADeploymentObject {
39+
if o == nil || o.Data == nil {
40+
var ret DORADeploymentObject
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 *DORADeploymentFetchResponse) GetDataOk() (*DORADeploymentObject, 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 *DORADeploymentFetchResponse) HasData() bool {
57+
return o != nil && o.Data != nil
58+
}
59+
60+
// SetData gets a reference to the given DORADeploymentObject and assigns it to the Data field.
61+
func (o *DORADeploymentFetchResponse) SetData(v DORADeploymentObject) {
62+
o.Data = &v
63+
}
64+
65+
// MarshalJSON serializes the struct using spec logic.
66+
func (o DORADeploymentFetchResponse) 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 *DORADeploymentFetchResponse) UnmarshalJSON(bytes []byte) (err error) {
83+
all := struct {
84+
Data *DORADeploymentObject `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: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
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+
// DORADeploymentObject A DORA deployment event.
12+
type DORADeploymentObject struct {
13+
// The attributes of the deployment event.
14+
Attributes *DORADeploymentObjectAttributes `json:"attributes,omitempty"`
15+
// The ID of the deployment event.
16+
Id *string `json:"id,omitempty"`
17+
// JSON:API type for DORA deployment events.
18+
Type *DORADeploymentType `json:"type,omitempty"`
19+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
20+
UnparsedObject map[string]interface{} `json:"-"`
21+
AdditionalProperties map[string]interface{} `json:"-"`
22+
}
23+
24+
// NewDORADeploymentObject instantiates a new DORADeploymentObject object.
25+
// This constructor will assign default values to properties that have it defined,
26+
// and makes sure properties required by API are set, but the set of arguments
27+
// will change when the set of required properties is changed.
28+
func NewDORADeploymentObject() *DORADeploymentObject {
29+
this := DORADeploymentObject{}
30+
var typeVar DORADeploymentType = DORADEPLOYMENTTYPE_DORA_DEPLOYMENT
31+
this.Type = &typeVar
32+
return &this
33+
}
34+
35+
// NewDORADeploymentObjectWithDefaults instantiates a new DORADeploymentObject object.
36+
// This constructor will only assign default values to properties that have it defined,
37+
// but it doesn't guarantee that properties required by API are set.
38+
func NewDORADeploymentObjectWithDefaults() *DORADeploymentObject {
39+
this := DORADeploymentObject{}
40+
var typeVar DORADeploymentType = DORADEPLOYMENTTYPE_DORA_DEPLOYMENT
41+
this.Type = &typeVar
42+
return &this
43+
}
44+
45+
// GetAttributes returns the Attributes field value if set, zero value otherwise.
46+
func (o *DORADeploymentObject) GetAttributes() DORADeploymentObjectAttributes {
47+
if o == nil || o.Attributes == nil {
48+
var ret DORADeploymentObjectAttributes
49+
return ret
50+
}
51+
return *o.Attributes
52+
}
53+
54+
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
55+
// and a boolean to check if the value has been set.
56+
func (o *DORADeploymentObject) GetAttributesOk() (*DORADeploymentObjectAttributes, bool) {
57+
if o == nil || o.Attributes == nil {
58+
return nil, false
59+
}
60+
return o.Attributes, true
61+
}
62+
63+
// HasAttributes returns a boolean if a field has been set.
64+
func (o *DORADeploymentObject) HasAttributes() bool {
65+
return o != nil && o.Attributes != nil
66+
}
67+
68+
// SetAttributes gets a reference to the given DORADeploymentObjectAttributes and assigns it to the Attributes field.
69+
func (o *DORADeploymentObject) SetAttributes(v DORADeploymentObjectAttributes) {
70+
o.Attributes = &v
71+
}
72+
73+
// GetId returns the Id field value if set, zero value otherwise.
74+
func (o *DORADeploymentObject) GetId() string {
75+
if o == nil || o.Id == nil {
76+
var ret string
77+
return ret
78+
}
79+
return *o.Id
80+
}
81+
82+
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
83+
// and a boolean to check if the value has been set.
84+
func (o *DORADeploymentObject) GetIdOk() (*string, bool) {
85+
if o == nil || o.Id == nil {
86+
return nil, false
87+
}
88+
return o.Id, true
89+
}
90+
91+
// HasId returns a boolean if a field has been set.
92+
func (o *DORADeploymentObject) HasId() bool {
93+
return o != nil && o.Id != nil
94+
}
95+
96+
// SetId gets a reference to the given string and assigns it to the Id field.
97+
func (o *DORADeploymentObject) SetId(v string) {
98+
o.Id = &v
99+
}
100+
101+
// GetType returns the Type field value if set, zero value otherwise.
102+
func (o *DORADeploymentObject) GetType() DORADeploymentType {
103+
if o == nil || o.Type == nil {
104+
var ret DORADeploymentType
105+
return ret
106+
}
107+
return *o.Type
108+
}
109+
110+
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
111+
// and a boolean to check if the value has been set.
112+
func (o *DORADeploymentObject) GetTypeOk() (*DORADeploymentType, bool) {
113+
if o == nil || o.Type == nil {
114+
return nil, false
115+
}
116+
return o.Type, true
117+
}
118+
119+
// HasType returns a boolean if a field has been set.
120+
func (o *DORADeploymentObject) HasType() bool {
121+
return o != nil && o.Type != nil
122+
}
123+
124+
// SetType gets a reference to the given DORADeploymentType and assigns it to the Type field.
125+
func (o *DORADeploymentObject) SetType(v DORADeploymentType) {
126+
o.Type = &v
127+
}
128+
129+
// MarshalJSON serializes the struct using spec logic.
130+
func (o DORADeploymentObject) MarshalJSON() ([]byte, error) {
131+
toSerialize := map[string]interface{}{}
132+
if o.UnparsedObject != nil {
133+
return datadog.Marshal(o.UnparsedObject)
134+
}
135+
if o.Attributes != nil {
136+
toSerialize["attributes"] = o.Attributes
137+
}
138+
if o.Id != nil {
139+
toSerialize["id"] = o.Id
140+
}
141+
if o.Type != nil {
142+
toSerialize["type"] = o.Type
143+
}
144+
145+
for key, value := range o.AdditionalProperties {
146+
toSerialize[key] = value
147+
}
148+
return datadog.Marshal(toSerialize)
149+
}
150+
151+
// UnmarshalJSON deserializes the given payload.
152+
func (o *DORADeploymentObject) UnmarshalJSON(bytes []byte) (err error) {
153+
all := struct {
154+
Attributes *DORADeploymentObjectAttributes `json:"attributes,omitempty"`
155+
Id *string `json:"id,omitempty"`
156+
Type *DORADeploymentType `json:"type,omitempty"`
157+
}{}
158+
if err = datadog.Unmarshal(bytes, &all); err != nil {
159+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
160+
}
161+
additionalProperties := make(map[string]interface{})
162+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
163+
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"})
164+
} else {
165+
return err
166+
}
167+
168+
hasInvalidField := false
169+
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
170+
hasInvalidField = true
171+
}
172+
o.Attributes = all.Attributes
173+
o.Id = all.Id
174+
if all.Type != nil && !all.Type.IsValid() {
175+
hasInvalidField = true
176+
} else {
177+
o.Type = all.Type
178+
}
179+
180+
if len(additionalProperties) > 0 {
181+
o.AdditionalProperties = additionalProperties
182+
}
183+
184+
if hasInvalidField {
185+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
186+
}
187+
188+
return nil
189+
}

0 commit comments

Comments
 (0)