Skip to content

Commit 5ffdbd8

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Status Pages API specs (#3591)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 72f75cb commit 5ffdbd8

File tree

158 files changed

+24246
-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.

158 files changed

+24246
-0
lines changed

.generator/schemas/v2/openapi.yaml

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

api/datadogV2/api_status_pages.go

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

api/datadogV2/doc.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,21 @@
678678
// - [SpansMetricsApi.UpdateSpansMetric]
679679
// - [StaticAnalysisApi.CreateSCAResolveVulnerableSymbols]
680680
// - [StaticAnalysisApi.CreateSCAResult]
681+
// - [StatusPagesApi.CreateComponent]
682+
// - [StatusPagesApi.CreateDegradation]
683+
// - [StatusPagesApi.CreateStatusPage]
684+
// - [StatusPagesApi.DeleteComponent]
685+
// - [StatusPagesApi.DeleteDegradation]
686+
// - [StatusPagesApi.DeleteStatusPage]
687+
// - [StatusPagesApi.GetComponent]
688+
// - [StatusPagesApi.GetDegradation]
689+
// - [StatusPagesApi.GetStatusPage]
690+
// - [StatusPagesApi.ListComponents]
691+
// - [StatusPagesApi.ListDegradations]
692+
// - [StatusPagesApi.ListStatusPages]
693+
// - [StatusPagesApi.UpdateComponent]
694+
// - [StatusPagesApi.UpdateDegradation]
695+
// - [StatusPagesApi.UpdateStatusPage]
681696
// - [SyntheticsApi.CreateSyntheticsSuite]
682697
// - [SyntheticsApi.DeleteSyntheticsSuites]
683698
// - [SyntheticsApi.EditSyntheticsSuite]
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+
// CreateComponentRequest
12+
type CreateComponentRequest struct {
13+
//
14+
Data *CreateComponentRequestData `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+
// NewCreateComponentRequest instantiates a new CreateComponentRequest 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 NewCreateComponentRequest() *CreateComponentRequest {
25+
this := CreateComponentRequest{}
26+
return &this
27+
}
28+
29+
// NewCreateComponentRequestWithDefaults instantiates a new CreateComponentRequest 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 NewCreateComponentRequestWithDefaults() *CreateComponentRequest {
33+
this := CreateComponentRequest{}
34+
return &this
35+
}
36+
37+
// GetData returns the Data field value if set, zero value otherwise.
38+
func (o *CreateComponentRequest) GetData() CreateComponentRequestData {
39+
if o == nil || o.Data == nil {
40+
var ret CreateComponentRequestData
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 *CreateComponentRequest) GetDataOk() (*CreateComponentRequestData, 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 *CreateComponentRequest) HasData() bool {
57+
return o != nil && o.Data != nil
58+
}
59+
60+
// SetData gets a reference to the given CreateComponentRequestData and assigns it to the Data field.
61+
func (o *CreateComponentRequest) SetData(v CreateComponentRequestData) {
62+
o.Data = &v
63+
}
64+
65+
// MarshalJSON serializes the struct using spec logic.
66+
func (o CreateComponentRequest) 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 *CreateComponentRequest) UnmarshalJSON(bytes []byte) (err error) {
83+
all := struct {
84+
Data *CreateComponentRequestData `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+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// CreateComponentRequestData
14+
type CreateComponentRequestData struct {
15+
// The supported attributes for creating a component.
16+
Attributes *CreateComponentRequestDataAttributes `json:"attributes,omitempty"`
17+
// The supported relationships for creating a component.
18+
Relationships *CreateComponentRequestDataRelationships `json:"relationships,omitempty"`
19+
// Components resource type.
20+
Type StatusPagesComponentGroupType `json:"type"`
21+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
22+
UnparsedObject map[string]interface{} `json:"-"`
23+
AdditionalProperties map[string]interface{} `json:"-"`
24+
}
25+
26+
// NewCreateComponentRequestData instantiates a new CreateComponentRequestData object.
27+
// This constructor will assign default values to properties that have it defined,
28+
// and makes sure properties required by API are set, but the set of arguments
29+
// will change when the set of required properties is changed.
30+
func NewCreateComponentRequestData(typeVar StatusPagesComponentGroupType) *CreateComponentRequestData {
31+
this := CreateComponentRequestData{}
32+
this.Type = typeVar
33+
return &this
34+
}
35+
36+
// NewCreateComponentRequestDataWithDefaults instantiates a new CreateComponentRequestData object.
37+
// This constructor will only assign default values to properties that have it defined,
38+
// but it doesn't guarantee that properties required by API are set.
39+
func NewCreateComponentRequestDataWithDefaults() *CreateComponentRequestData {
40+
this := CreateComponentRequestData{}
41+
var typeVar StatusPagesComponentGroupType = STATUSPAGESCOMPONENTGROUPTYPE_COMPONENTS
42+
this.Type = typeVar
43+
return &this
44+
}
45+
46+
// GetAttributes returns the Attributes field value if set, zero value otherwise.
47+
func (o *CreateComponentRequestData) GetAttributes() CreateComponentRequestDataAttributes {
48+
if o == nil || o.Attributes == nil {
49+
var ret CreateComponentRequestDataAttributes
50+
return ret
51+
}
52+
return *o.Attributes
53+
}
54+
55+
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
56+
// and a boolean to check if the value has been set.
57+
func (o *CreateComponentRequestData) GetAttributesOk() (*CreateComponentRequestDataAttributes, bool) {
58+
if o == nil || o.Attributes == nil {
59+
return nil, false
60+
}
61+
return o.Attributes, true
62+
}
63+
64+
// HasAttributes returns a boolean if a field has been set.
65+
func (o *CreateComponentRequestData) HasAttributes() bool {
66+
return o != nil && o.Attributes != nil
67+
}
68+
69+
// SetAttributes gets a reference to the given CreateComponentRequestDataAttributes and assigns it to the Attributes field.
70+
func (o *CreateComponentRequestData) SetAttributes(v CreateComponentRequestDataAttributes) {
71+
o.Attributes = &v
72+
}
73+
74+
// GetRelationships returns the Relationships field value if set, zero value otherwise.
75+
func (o *CreateComponentRequestData) GetRelationships() CreateComponentRequestDataRelationships {
76+
if o == nil || o.Relationships == nil {
77+
var ret CreateComponentRequestDataRelationships
78+
return ret
79+
}
80+
return *o.Relationships
81+
}
82+
83+
// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise
84+
// and a boolean to check if the value has been set.
85+
func (o *CreateComponentRequestData) GetRelationshipsOk() (*CreateComponentRequestDataRelationships, bool) {
86+
if o == nil || o.Relationships == nil {
87+
return nil, false
88+
}
89+
return o.Relationships, true
90+
}
91+
92+
// HasRelationships returns a boolean if a field has been set.
93+
func (o *CreateComponentRequestData) HasRelationships() bool {
94+
return o != nil && o.Relationships != nil
95+
}
96+
97+
// SetRelationships gets a reference to the given CreateComponentRequestDataRelationships and assigns it to the Relationships field.
98+
func (o *CreateComponentRequestData) SetRelationships(v CreateComponentRequestDataRelationships) {
99+
o.Relationships = &v
100+
}
101+
102+
// GetType returns the Type field value.
103+
func (o *CreateComponentRequestData) GetType() StatusPagesComponentGroupType {
104+
if o == nil {
105+
var ret StatusPagesComponentGroupType
106+
return ret
107+
}
108+
return o.Type
109+
}
110+
111+
// GetTypeOk returns a tuple with the Type field value
112+
// and a boolean to check if the value has been set.
113+
func (o *CreateComponentRequestData) GetTypeOk() (*StatusPagesComponentGroupType, bool) {
114+
if o == nil {
115+
return nil, false
116+
}
117+
return &o.Type, true
118+
}
119+
120+
// SetType sets field value.
121+
func (o *CreateComponentRequestData) SetType(v StatusPagesComponentGroupType) {
122+
o.Type = v
123+
}
124+
125+
// MarshalJSON serializes the struct using spec logic.
126+
func (o CreateComponentRequestData) MarshalJSON() ([]byte, error) {
127+
toSerialize := map[string]interface{}{}
128+
if o.UnparsedObject != nil {
129+
return datadog.Marshal(o.UnparsedObject)
130+
}
131+
if o.Attributes != nil {
132+
toSerialize["attributes"] = o.Attributes
133+
}
134+
if o.Relationships != nil {
135+
toSerialize["relationships"] = o.Relationships
136+
}
137+
toSerialize["type"] = o.Type
138+
139+
for key, value := range o.AdditionalProperties {
140+
toSerialize[key] = value
141+
}
142+
return datadog.Marshal(toSerialize)
143+
}
144+
145+
// UnmarshalJSON deserializes the given payload.
146+
func (o *CreateComponentRequestData) UnmarshalJSON(bytes []byte) (err error) {
147+
all := struct {
148+
Attributes *CreateComponentRequestDataAttributes `json:"attributes,omitempty"`
149+
Relationships *CreateComponentRequestDataRelationships `json:"relationships,omitempty"`
150+
Type *StatusPagesComponentGroupType `json:"type"`
151+
}{}
152+
if err = datadog.Unmarshal(bytes, &all); err != nil {
153+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
154+
}
155+
if all.Type == nil {
156+
return fmt.Errorf("required field type missing")
157+
}
158+
additionalProperties := make(map[string]interface{})
159+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
160+
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "relationships", "type"})
161+
} else {
162+
return err
163+
}
164+
165+
hasInvalidField := false
166+
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
167+
hasInvalidField = true
168+
}
169+
o.Attributes = all.Attributes
170+
if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil {
171+
hasInvalidField = true
172+
}
173+
o.Relationships = all.Relationships
174+
if !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)