Skip to content

Commit 4784b34

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
document v2 stable mcnulty-web-py3 endpoints (#3891)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0a1ca95 commit 4784b34

65 files changed

Lines changed: 9955 additions & 0 deletions

File tree

Some content is hidden

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

.generator/schemas/v2/openapi.yaml

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

api/datadogV2/api_synthetics.go

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

api/datadogV2/api_widgets.go

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

api/datadogV2/doc.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,17 @@
840840
// - [SyntheticsApi.DeleteSyntheticsSuites]
841841
// - [SyntheticsApi.DeleteSyntheticsTests]
842842
// - [SyntheticsApi.EditSyntheticsSuite]
843+
// - [SyntheticsApi.GetApiMultistepSubtestParents]
844+
// - [SyntheticsApi.GetApiMultistepSubtests]
843845
// - [SyntheticsApi.GetOnDemandConcurrencyCap]
844846
// - [SyntheticsApi.GetSyntheticsFastTestResult]
845847
// - [SyntheticsApi.GetSyntheticsNetworkTest]
846848
// - [SyntheticsApi.GetSyntheticsSuite]
849+
// - [SyntheticsApi.GetSyntheticsTestVersion]
850+
// - [SyntheticsApi.GetTestParentSuites]
851+
// - [SyntheticsApi.ListSyntheticsTestVersions]
847852
// - [SyntheticsApi.PatchGlobalVariable]
853+
// - [SyntheticsApi.PatchTestSuite]
848854
// - [SyntheticsApi.SearchSuites]
849855
// - [SyntheticsApi.SetOnDemandConcurrencyCap]
850856
// - [SyntheticsApi.UpdateSyntheticsNetworkTest]
@@ -908,6 +914,11 @@
908914
// - [UsersApi.ListUsers]
909915
// - [UsersApi.SendInvitations]
910916
// - [UsersApi.UpdateUser]
917+
// - [WidgetsApi.CreateWidget]
918+
// - [WidgetsApi.DeleteWidget]
919+
// - [WidgetsApi.GetWidget]
920+
// - [WidgetsApi.SearchWidgets]
921+
// - [WidgetsApi.UpdateWidget]
911922
// - [WorkflowAutomationApi.CancelWorkflowInstance]
912923
// - [WorkflowAutomationApi.CreateWorkflow]
913924
// - [WorkflowAutomationApi.CreateWorkflowInstance]
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+
// CreateOrUpdateWidgetRequest Request body for creating or updating a widget.
14+
type CreateOrUpdateWidgetRequest struct {
15+
// Data for creating or updating a widget.
16+
Data CreateOrUpdateWidgetRequestData `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+
// NewCreateOrUpdateWidgetRequest instantiates a new CreateOrUpdateWidgetRequest 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 NewCreateOrUpdateWidgetRequest(data CreateOrUpdateWidgetRequestData) *CreateOrUpdateWidgetRequest {
27+
this := CreateOrUpdateWidgetRequest{}
28+
this.Data = data
29+
return &this
30+
}
31+
32+
// NewCreateOrUpdateWidgetRequestWithDefaults instantiates a new CreateOrUpdateWidgetRequest 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 NewCreateOrUpdateWidgetRequestWithDefaults() *CreateOrUpdateWidgetRequest {
36+
this := CreateOrUpdateWidgetRequest{}
37+
return &this
38+
}
39+
40+
// GetData returns the Data field value.
41+
func (o *CreateOrUpdateWidgetRequest) GetData() CreateOrUpdateWidgetRequestData {
42+
if o == nil {
43+
var ret CreateOrUpdateWidgetRequestData
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 *CreateOrUpdateWidgetRequest) GetDataOk() (*CreateOrUpdateWidgetRequestData, 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 *CreateOrUpdateWidgetRequest) SetData(v CreateOrUpdateWidgetRequestData) {
60+
o.Data = v
61+
}
62+
63+
// MarshalJSON serializes the struct using spec logic.
64+
func (o CreateOrUpdateWidgetRequest) 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 *CreateOrUpdateWidgetRequest) UnmarshalJSON(bytes []byte) (err error) {
79+
all := struct {
80+
Data *CreateOrUpdateWidgetRequestData `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: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
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+
// CreateOrUpdateWidgetRequestAttributes Attributes for creating or updating a widget.
14+
type CreateOrUpdateWidgetRequestAttributes struct {
15+
// The definition of a widget, including its type and configuration.
16+
Definition WidgetDefinition `json:"definition"`
17+
// User-defined tags for organizing the widget.
18+
Tags datadog.NullableList[string] `json:"tags,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+
// NewCreateOrUpdateWidgetRequestAttributes instantiates a new CreateOrUpdateWidgetRequestAttributes 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 NewCreateOrUpdateWidgetRequestAttributes(definition WidgetDefinition) *CreateOrUpdateWidgetRequestAttributes {
29+
this := CreateOrUpdateWidgetRequestAttributes{}
30+
this.Definition = definition
31+
return &this
32+
}
33+
34+
// NewCreateOrUpdateWidgetRequestAttributesWithDefaults instantiates a new CreateOrUpdateWidgetRequestAttributes object.
35+
// This constructor will only assign default values to properties that have it defined,
36+
// but it doesn't guarantee that properties required by API are set.
37+
func NewCreateOrUpdateWidgetRequestAttributesWithDefaults() *CreateOrUpdateWidgetRequestAttributes {
38+
this := CreateOrUpdateWidgetRequestAttributes{}
39+
return &this
40+
}
41+
42+
// GetDefinition returns the Definition field value.
43+
func (o *CreateOrUpdateWidgetRequestAttributes) GetDefinition() WidgetDefinition {
44+
if o == nil {
45+
var ret WidgetDefinition
46+
return ret
47+
}
48+
return o.Definition
49+
}
50+
51+
// GetDefinitionOk returns a tuple with the Definition field value
52+
// and a boolean to check if the value has been set.
53+
func (o *CreateOrUpdateWidgetRequestAttributes) GetDefinitionOk() (*WidgetDefinition, bool) {
54+
if o == nil {
55+
return nil, false
56+
}
57+
return &o.Definition, true
58+
}
59+
60+
// SetDefinition sets field value.
61+
func (o *CreateOrUpdateWidgetRequestAttributes) SetDefinition(v WidgetDefinition) {
62+
o.Definition = v
63+
}
64+
65+
// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null).
66+
func (o *CreateOrUpdateWidgetRequestAttributes) GetTags() []string {
67+
if o == nil || o.Tags.Get() == nil {
68+
var ret []string
69+
return ret
70+
}
71+
return *o.Tags.Get()
72+
}
73+
74+
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
75+
// and a boolean to check if the value has been set.
76+
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
77+
func (o *CreateOrUpdateWidgetRequestAttributes) GetTagsOk() (*[]string, bool) {
78+
if o == nil {
79+
return nil, false
80+
}
81+
return o.Tags.Get(), o.Tags.IsSet()
82+
}
83+
84+
// HasTags returns a boolean if a field has been set.
85+
func (o *CreateOrUpdateWidgetRequestAttributes) HasTags() bool {
86+
return o != nil && o.Tags.IsSet()
87+
}
88+
89+
// SetTags gets a reference to the given datadog.NullableList[string] and assigns it to the Tags field.
90+
func (o *CreateOrUpdateWidgetRequestAttributes) SetTags(v []string) {
91+
o.Tags.Set(&v)
92+
}
93+
94+
// SetTagsNil sets the value for Tags to be an explicit nil.
95+
func (o *CreateOrUpdateWidgetRequestAttributes) SetTagsNil() {
96+
o.Tags.Set(nil)
97+
}
98+
99+
// UnsetTags ensures that no value is present for Tags, not even an explicit nil.
100+
func (o *CreateOrUpdateWidgetRequestAttributes) UnsetTags() {
101+
o.Tags.Unset()
102+
}
103+
104+
// MarshalJSON serializes the struct using spec logic.
105+
func (o CreateOrUpdateWidgetRequestAttributes) MarshalJSON() ([]byte, error) {
106+
toSerialize := map[string]interface{}{}
107+
if o.UnparsedObject != nil {
108+
return datadog.Marshal(o.UnparsedObject)
109+
}
110+
toSerialize["definition"] = o.Definition
111+
if o.Tags.IsSet() {
112+
toSerialize["tags"] = o.Tags.Get()
113+
}
114+
115+
for key, value := range o.AdditionalProperties {
116+
toSerialize[key] = value
117+
}
118+
return datadog.Marshal(toSerialize)
119+
}
120+
121+
// UnmarshalJSON deserializes the given payload.
122+
func (o *CreateOrUpdateWidgetRequestAttributes) UnmarshalJSON(bytes []byte) (err error) {
123+
all := struct {
124+
Definition *WidgetDefinition `json:"definition"`
125+
Tags datadog.NullableList[string] `json:"tags,omitempty"`
126+
}{}
127+
if err = datadog.Unmarshal(bytes, &all); err != nil {
128+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
129+
}
130+
if all.Definition == nil {
131+
return fmt.Errorf("required field definition missing")
132+
}
133+
additionalProperties := make(map[string]interface{})
134+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
135+
datadog.DeleteKeys(additionalProperties, &[]string{"definition", "tags"})
136+
} else {
137+
return err
138+
}
139+
140+
hasInvalidField := false
141+
if all.Definition.UnparsedObject != nil && o.UnparsedObject == nil {
142+
hasInvalidField = true
143+
}
144+
o.Definition = *all.Definition
145+
o.Tags = all.Tags
146+
147+
if len(additionalProperties) > 0 {
148+
o.AdditionalProperties = additionalProperties
149+
}
150+
151+
if hasInvalidField {
152+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
153+
}
154+
155+
return nil
156+
}

0 commit comments

Comments
 (0)