Skip to content

Commit 0b28a4d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a33fce8 of spec repo
1 parent 6be4c93 commit 0b28a4d

File tree

96 files changed

+8564
-2
lines changed

Some content is hidden

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

96 files changed

+8564
-2
lines changed

.generator/schemas/v2/openapi.yaml

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

api/datadogV2/api_security_monitoring.go

Lines changed: 391 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
@@ -508,11 +508,15 @@
508508
// - [RumRetentionFiltersApi.ListRetentionFilters]
509509
// - [RumRetentionFiltersApi.OrderRetentionFilters]
510510
// - [RumRetentionFiltersApi.UpdateRetentionFilter]
511+
// - [SecurityMonitoringApi.AttachCase]
512+
// - [SecurityMonitoringApi.AttachJiraIssue]
511513
// - [SecurityMonitoringApi.CancelThreatHuntingJob]
512514
// - [SecurityMonitoringApi.ConvertExistingSecurityMonitoringRule]
513515
// - [SecurityMonitoringApi.ConvertJobResultToSignal]
514516
// - [SecurityMonitoringApi.ConvertSecurityMonitoringRuleFromJSONToTerraform]
517+
// - [SecurityMonitoringApi.CreateCases]
515518
// - [SecurityMonitoringApi.CreateCustomFramework]
519+
// - [SecurityMonitoringApi.CreateJiraIssues]
516520
// - [SecurityMonitoringApi.CreateSecurityFilter]
517521
// - [SecurityMonitoringApi.CreateSecurityMonitoringRule]
518522
// - [SecurityMonitoringApi.CreateSecurityMonitoringSuppression]
@@ -525,6 +529,7 @@
525529
// - [SecurityMonitoringApi.DeleteSignalNotificationRule]
526530
// - [SecurityMonitoringApi.DeleteThreatHuntingJob]
527531
// - [SecurityMonitoringApi.DeleteVulnerabilityNotificationRule]
532+
// - [SecurityMonitoringApi.DetachCase]
528533
// - [SecurityMonitoringApi.EditSecurityMonitoringSignalAssignee]
529534
// - [SecurityMonitoringApi.EditSecurityMonitoringSignalIncidents]
530535
// - [SecurityMonitoringApi.EditSecurityMonitoringSignalState]
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+
// AttachCaseRequest Request for attaching security findings to a case.
12+
type AttachCaseRequest struct {
13+
// Data of the case to attach security findings to.
14+
Data *AttachCaseRequestData `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+
// NewAttachCaseRequest instantiates a new AttachCaseRequest 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 NewAttachCaseRequest() *AttachCaseRequest {
25+
this := AttachCaseRequest{}
26+
return &this
27+
}
28+
29+
// NewAttachCaseRequestWithDefaults instantiates a new AttachCaseRequest 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 NewAttachCaseRequestWithDefaults() *AttachCaseRequest {
33+
this := AttachCaseRequest{}
34+
return &this
35+
}
36+
37+
// GetData returns the Data field value if set, zero value otherwise.
38+
func (o *AttachCaseRequest) GetData() AttachCaseRequestData {
39+
if o == nil || o.Data == nil {
40+
var ret AttachCaseRequestData
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 *AttachCaseRequest) GetDataOk() (*AttachCaseRequestData, 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 *AttachCaseRequest) HasData() bool {
57+
return o != nil && o.Data != nil
58+
}
59+
60+
// SetData gets a reference to the given AttachCaseRequestData and assigns it to the Data field.
61+
func (o *AttachCaseRequest) SetData(v AttachCaseRequestData) {
62+
o.Data = &v
63+
}
64+
65+
// MarshalJSON serializes the struct using spec logic.
66+
func (o AttachCaseRequest) 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 *AttachCaseRequest) UnmarshalJSON(bytes []byte) (err error) {
83+
all := struct {
84+
Data *AttachCaseRequestData `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: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
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+
// AttachCaseRequestData Data of the case to attach security findings to.
14+
type AttachCaseRequestData struct {
15+
// The unique identifier of the case.
16+
Id string `json:"id"`
17+
// Relationships of the case to attach security findings to.
18+
Relationships *AttachCaseRequestDataRelationships `json:"relationships,omitempty"`
19+
// Cases resource type.
20+
Type CaseDataType `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+
// NewAttachCaseRequestData instantiates a new AttachCaseRequestData 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 NewAttachCaseRequestData(id string, typeVar CaseDataType) *AttachCaseRequestData {
31+
this := AttachCaseRequestData{}
32+
this.Id = id
33+
this.Type = typeVar
34+
return &this
35+
}
36+
37+
// NewAttachCaseRequestDataWithDefaults instantiates a new AttachCaseRequestData object.
38+
// This constructor will only assign default values to properties that have it defined,
39+
// but it doesn't guarantee that properties required by API are set.
40+
func NewAttachCaseRequestDataWithDefaults() *AttachCaseRequestData {
41+
this := AttachCaseRequestData{}
42+
var typeVar CaseDataType = CASEDATATYPE_CASES
43+
this.Type = typeVar
44+
return &this
45+
}
46+
47+
// GetId returns the Id field value.
48+
func (o *AttachCaseRequestData) GetId() string {
49+
if o == nil {
50+
var ret string
51+
return ret
52+
}
53+
return o.Id
54+
}
55+
56+
// GetIdOk returns a tuple with the Id field value
57+
// and a boolean to check if the value has been set.
58+
func (o *AttachCaseRequestData) GetIdOk() (*string, bool) {
59+
if o == nil {
60+
return nil, false
61+
}
62+
return &o.Id, true
63+
}
64+
65+
// SetId sets field value.
66+
func (o *AttachCaseRequestData) SetId(v string) {
67+
o.Id = v
68+
}
69+
70+
// GetRelationships returns the Relationships field value if set, zero value otherwise.
71+
func (o *AttachCaseRequestData) GetRelationships() AttachCaseRequestDataRelationships {
72+
if o == nil || o.Relationships == nil {
73+
var ret AttachCaseRequestDataRelationships
74+
return ret
75+
}
76+
return *o.Relationships
77+
}
78+
79+
// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise
80+
// and a boolean to check if the value has been set.
81+
func (o *AttachCaseRequestData) GetRelationshipsOk() (*AttachCaseRequestDataRelationships, bool) {
82+
if o == nil || o.Relationships == nil {
83+
return nil, false
84+
}
85+
return o.Relationships, true
86+
}
87+
88+
// HasRelationships returns a boolean if a field has been set.
89+
func (o *AttachCaseRequestData) HasRelationships() bool {
90+
return o != nil && o.Relationships != nil
91+
}
92+
93+
// SetRelationships gets a reference to the given AttachCaseRequestDataRelationships and assigns it to the Relationships field.
94+
func (o *AttachCaseRequestData) SetRelationships(v AttachCaseRequestDataRelationships) {
95+
o.Relationships = &v
96+
}
97+
98+
// GetType returns the Type field value.
99+
func (o *AttachCaseRequestData) GetType() CaseDataType {
100+
if o == nil {
101+
var ret CaseDataType
102+
return ret
103+
}
104+
return o.Type
105+
}
106+
107+
// GetTypeOk returns a tuple with the Type field value
108+
// and a boolean to check if the value has been set.
109+
func (o *AttachCaseRequestData) GetTypeOk() (*CaseDataType, bool) {
110+
if o == nil {
111+
return nil, false
112+
}
113+
return &o.Type, true
114+
}
115+
116+
// SetType sets field value.
117+
func (o *AttachCaseRequestData) SetType(v CaseDataType) {
118+
o.Type = v
119+
}
120+
121+
// MarshalJSON serializes the struct using spec logic.
122+
func (o AttachCaseRequestData) MarshalJSON() ([]byte, error) {
123+
toSerialize := map[string]interface{}{}
124+
if o.UnparsedObject != nil {
125+
return datadog.Marshal(o.UnparsedObject)
126+
}
127+
toSerialize["id"] = o.Id
128+
if o.Relationships != nil {
129+
toSerialize["relationships"] = o.Relationships
130+
}
131+
toSerialize["type"] = o.Type
132+
133+
for key, value := range o.AdditionalProperties {
134+
toSerialize[key] = value
135+
}
136+
return datadog.Marshal(toSerialize)
137+
}
138+
139+
// UnmarshalJSON deserializes the given payload.
140+
func (o *AttachCaseRequestData) UnmarshalJSON(bytes []byte) (err error) {
141+
all := struct {
142+
Id *string `json:"id"`
143+
Relationships *AttachCaseRequestDataRelationships `json:"relationships,omitempty"`
144+
Type *CaseDataType `json:"type"`
145+
}{}
146+
if err = datadog.Unmarshal(bytes, &all); err != nil {
147+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
148+
}
149+
if all.Id == nil {
150+
return fmt.Errorf("required field id missing")
151+
}
152+
if all.Type == nil {
153+
return fmt.Errorf("required field type missing")
154+
}
155+
additionalProperties := make(map[string]interface{})
156+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
157+
datadog.DeleteKeys(additionalProperties, &[]string{"id", "relationships", "type"})
158+
} else {
159+
return err
160+
}
161+
162+
hasInvalidField := false
163+
o.Id = *all.Id
164+
if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil {
165+
hasInvalidField = true
166+
}
167+
o.Relationships = all.Relationships
168+
if !all.Type.IsValid() {
169+
hasInvalidField = true
170+
} else {
171+
o.Type = *all.Type
172+
}
173+
174+
if len(additionalProperties) > 0 {
175+
o.AdditionalProperties = additionalProperties
176+
}
177+
178+
if hasInvalidField {
179+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
180+
}
181+
182+
return nil
183+
}

0 commit comments

Comments
 (0)