Skip to content

Commit 4357939

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 851b688f of spec repo
1 parent 0af7262 commit 4357939

File tree

5 files changed

+283
-5
lines changed

5 files changed

+283
-5
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-01-22 15:54:14.899066",
8-
"spec_repo_commit": "7a8ea4b1"
7+
"regenerated": "2025-01-22 18:51:54.758389",
8+
"spec_repo_commit": "851b688f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-22 15:54:14.915479",
13-
"spec_repo_commit": "7a8ea4b1"
12+
"regenerated": "2025-01-22 18:51:54.775160",
13+
"spec_repo_commit": "851b688f"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16762,6 +16762,8 @@ components:
1676216762
description: The bucket where the archive will be stored.
1676316763
example: bucket-name
1676416764
type: string
16765+
encryption:
16766+
$ref: '#/components/schemas/LogsArchiveEncryptionS3'
1676516767
integration:
1676616768
$ref: '#/components/schemas/LogsArchiveIntegrationS3'
1676716769
path:
@@ -16783,6 +16785,30 @@ components:
1678316785
type: string
1678416786
x-enum-varnames:
1678516787
- S3
16788+
LogsArchiveEncryptionS3:
16789+
description: The S3 encryption settings.
16790+
properties:
16791+
key:
16792+
description: An Amazon Resource Name (ARN) used to identify an AWS KMS key.
16793+
example: arn:aws:kms:us-east-1:012345678901:key/DatadogIntegrationRoleKms
16794+
type: string
16795+
type:
16796+
$ref: '#/components/schemas/LogsArchiveEncryptionS3Type'
16797+
required:
16798+
- type
16799+
type: object
16800+
LogsArchiveEncryptionS3Type:
16801+
description: Type of S3 encryption for a destination.
16802+
enum:
16803+
- NO_OVERRIDE
16804+
- SSE_S3
16805+
- SSE_KMS
16806+
example: SSE_S3
16807+
type: string
16808+
x-enum-varnames:
16809+
- NO_OVERRIDE
16810+
- SSE_S3
16811+
- SSE_KMS
1678616812
LogsArchiveIntegrationAzure:
1678716813
description: The Azure archive's integration destination.
1678816814
properties:

api/datadogV2/model_logs_archive_destination_s3.go

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
type LogsArchiveDestinationS3 struct {
1515
// The bucket where the archive will be stored.
1616
Bucket string `json:"bucket"`
17+
// The S3 encryption settings.
18+
Encryption *LogsArchiveEncryptionS3 `json:"encryption,omitempty"`
1719
// The S3 Archive's integration destination.
1820
Integration LogsArchiveIntegrationS3 `json:"integration"`
1921
// The archive path.
@@ -70,6 +72,34 @@ func (o *LogsArchiveDestinationS3) SetBucket(v string) {
7072
o.Bucket = v
7173
}
7274

75+
// GetEncryption returns the Encryption field value if set, zero value otherwise.
76+
func (o *LogsArchiveDestinationS3) GetEncryption() LogsArchiveEncryptionS3 {
77+
if o == nil || o.Encryption == nil {
78+
var ret LogsArchiveEncryptionS3
79+
return ret
80+
}
81+
return *o.Encryption
82+
}
83+
84+
// GetEncryptionOk returns a tuple with the Encryption field value if set, nil otherwise
85+
// and a boolean to check if the value has been set.
86+
func (o *LogsArchiveDestinationS3) GetEncryptionOk() (*LogsArchiveEncryptionS3, bool) {
87+
if o == nil || o.Encryption == nil {
88+
return nil, false
89+
}
90+
return o.Encryption, true
91+
}
92+
93+
// HasEncryption returns a boolean if a field has been set.
94+
func (o *LogsArchiveDestinationS3) HasEncryption() bool {
95+
return o != nil && o.Encryption != nil
96+
}
97+
98+
// SetEncryption gets a reference to the given LogsArchiveEncryptionS3 and assigns it to the Encryption field.
99+
func (o *LogsArchiveDestinationS3) SetEncryption(v LogsArchiveEncryptionS3) {
100+
o.Encryption = &v
101+
}
102+
73103
// GetIntegration returns the Integration field value.
74104
func (o *LogsArchiveDestinationS3) GetIntegration() LogsArchiveIntegrationS3 {
75105
if o == nil {
@@ -151,6 +181,9 @@ func (o LogsArchiveDestinationS3) MarshalJSON() ([]byte, error) {
151181
return datadog.Marshal(o.UnparsedObject)
152182
}
153183
toSerialize["bucket"] = o.Bucket
184+
if o.Encryption != nil {
185+
toSerialize["encryption"] = o.Encryption
186+
}
154187
toSerialize["integration"] = o.Integration
155188
if o.Path != nil {
156189
toSerialize["path"] = o.Path
@@ -167,6 +200,7 @@ func (o LogsArchiveDestinationS3) MarshalJSON() ([]byte, error) {
167200
func (o *LogsArchiveDestinationS3) UnmarshalJSON(bytes []byte) (err error) {
168201
all := struct {
169202
Bucket *string `json:"bucket"`
203+
Encryption *LogsArchiveEncryptionS3 `json:"encryption,omitempty"`
170204
Integration *LogsArchiveIntegrationS3 `json:"integration"`
171205
Path *string `json:"path,omitempty"`
172206
Type *LogsArchiveDestinationS3Type `json:"type"`
@@ -185,13 +219,17 @@ func (o *LogsArchiveDestinationS3) UnmarshalJSON(bytes []byte) (err error) {
185219
}
186220
additionalProperties := make(map[string]interface{})
187221
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
188-
datadog.DeleteKeys(additionalProperties, &[]string{"bucket", "integration", "path", "type"})
222+
datadog.DeleteKeys(additionalProperties, &[]string{"bucket", "encryption", "integration", "path", "type"})
189223
} else {
190224
return err
191225
}
192226

193227
hasInvalidField := false
194228
o.Bucket = *all.Bucket
229+
if all.Encryption != nil && all.Encryption.UnparsedObject != nil && o.UnparsedObject == nil {
230+
hasInvalidField = true
231+
}
232+
o.Encryption = all.Encryption
195233
if all.Integration.UnparsedObject != nil && o.UnparsedObject == nil {
196234
hasInvalidField = true
197235
}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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+
// LogsArchiveEncryptionS3 The S3 encryption settings.
14+
type LogsArchiveEncryptionS3 struct {
15+
// An Amazon Resource Name (ARN) used to identify an AWS KMS key.
16+
Key *string `json:"key,omitempty"`
17+
// Type of S3 encryption for a destination.
18+
Type LogsArchiveEncryptionS3Type `json:"type"`
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+
// NewLogsArchiveEncryptionS3 instantiates a new LogsArchiveEncryptionS3 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 NewLogsArchiveEncryptionS3(typeVar LogsArchiveEncryptionS3Type) *LogsArchiveEncryptionS3 {
29+
this := LogsArchiveEncryptionS3{}
30+
this.Type = typeVar
31+
return &this
32+
}
33+
34+
// NewLogsArchiveEncryptionS3WithDefaults instantiates a new LogsArchiveEncryptionS3 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 NewLogsArchiveEncryptionS3WithDefaults() *LogsArchiveEncryptionS3 {
38+
this := LogsArchiveEncryptionS3{}
39+
return &this
40+
}
41+
42+
// GetKey returns the Key field value if set, zero value otherwise.
43+
func (o *LogsArchiveEncryptionS3) GetKey() string {
44+
if o == nil || o.Key == nil {
45+
var ret string
46+
return ret
47+
}
48+
return *o.Key
49+
}
50+
51+
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
52+
// and a boolean to check if the value has been set.
53+
func (o *LogsArchiveEncryptionS3) GetKeyOk() (*string, bool) {
54+
if o == nil || o.Key == nil {
55+
return nil, false
56+
}
57+
return o.Key, true
58+
}
59+
60+
// HasKey returns a boolean if a field has been set.
61+
func (o *LogsArchiveEncryptionS3) HasKey() bool {
62+
return o != nil && o.Key != nil
63+
}
64+
65+
// SetKey gets a reference to the given string and assigns it to the Key field.
66+
func (o *LogsArchiveEncryptionS3) SetKey(v string) {
67+
o.Key = &v
68+
}
69+
70+
// GetType returns the Type field value.
71+
func (o *LogsArchiveEncryptionS3) GetType() LogsArchiveEncryptionS3Type {
72+
if o == nil {
73+
var ret LogsArchiveEncryptionS3Type
74+
return ret
75+
}
76+
return o.Type
77+
}
78+
79+
// GetTypeOk returns a tuple with the Type field value
80+
// and a boolean to check if the value has been set.
81+
func (o *LogsArchiveEncryptionS3) GetTypeOk() (*LogsArchiveEncryptionS3Type, bool) {
82+
if o == nil {
83+
return nil, false
84+
}
85+
return &o.Type, true
86+
}
87+
88+
// SetType sets field value.
89+
func (o *LogsArchiveEncryptionS3) SetType(v LogsArchiveEncryptionS3Type) {
90+
o.Type = v
91+
}
92+
93+
// MarshalJSON serializes the struct using spec logic.
94+
func (o LogsArchiveEncryptionS3) MarshalJSON() ([]byte, error) {
95+
toSerialize := map[string]interface{}{}
96+
if o.UnparsedObject != nil {
97+
return datadog.Marshal(o.UnparsedObject)
98+
}
99+
if o.Key != nil {
100+
toSerialize["key"] = o.Key
101+
}
102+
toSerialize["type"] = o.Type
103+
104+
for key, value := range o.AdditionalProperties {
105+
toSerialize[key] = value
106+
}
107+
return datadog.Marshal(toSerialize)
108+
}
109+
110+
// UnmarshalJSON deserializes the given payload.
111+
func (o *LogsArchiveEncryptionS3) UnmarshalJSON(bytes []byte) (err error) {
112+
all := struct {
113+
Key *string `json:"key,omitempty"`
114+
Type *LogsArchiveEncryptionS3Type `json:"type"`
115+
}{}
116+
if err = datadog.Unmarshal(bytes, &all); err != nil {
117+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
118+
}
119+
if all.Type == nil {
120+
return fmt.Errorf("required field type missing")
121+
}
122+
additionalProperties := make(map[string]interface{})
123+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
124+
datadog.DeleteKeys(additionalProperties, &[]string{"key", "type"})
125+
} else {
126+
return err
127+
}
128+
129+
hasInvalidField := false
130+
o.Key = all.Key
131+
if !all.Type.IsValid() {
132+
hasInvalidField = true
133+
} else {
134+
o.Type = *all.Type
135+
}
136+
137+
if len(additionalProperties) > 0 {
138+
o.AdditionalProperties = additionalProperties
139+
}
140+
141+
if hasInvalidField {
142+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
143+
}
144+
145+
return nil
146+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
// LogsArchiveEncryptionS3Type Type of S3 encryption for a destination.
14+
type LogsArchiveEncryptionS3Type string
15+
16+
// List of LogsArchiveEncryptionS3Type.
17+
const (
18+
LOGSARCHIVEENCRYPTIONS3TYPE_NO_OVERRIDE LogsArchiveEncryptionS3Type = "NO_OVERRIDE"
19+
LOGSARCHIVEENCRYPTIONS3TYPE_SSE_S3 LogsArchiveEncryptionS3Type = "SSE_S3"
20+
LOGSARCHIVEENCRYPTIONS3TYPE_SSE_KMS LogsArchiveEncryptionS3Type = "SSE_KMS"
21+
)
22+
23+
var allowedLogsArchiveEncryptionS3TypeEnumValues = []LogsArchiveEncryptionS3Type{
24+
LOGSARCHIVEENCRYPTIONS3TYPE_NO_OVERRIDE,
25+
LOGSARCHIVEENCRYPTIONS3TYPE_SSE_S3,
26+
LOGSARCHIVEENCRYPTIONS3TYPE_SSE_KMS,
27+
}
28+
29+
// GetAllowedValues reeturns the list of possible values.
30+
func (v *LogsArchiveEncryptionS3Type) GetAllowedValues() []LogsArchiveEncryptionS3Type {
31+
return allowedLogsArchiveEncryptionS3TypeEnumValues
32+
}
33+
34+
// UnmarshalJSON deserializes the given payload.
35+
func (v *LogsArchiveEncryptionS3Type) UnmarshalJSON(src []byte) error {
36+
var value string
37+
err := datadog.Unmarshal(src, &value)
38+
if err != nil {
39+
return err
40+
}
41+
*v = LogsArchiveEncryptionS3Type(value)
42+
return nil
43+
}
44+
45+
// NewLogsArchiveEncryptionS3TypeFromValue returns a pointer to a valid LogsArchiveEncryptionS3Type
46+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
47+
func NewLogsArchiveEncryptionS3TypeFromValue(v string) (*LogsArchiveEncryptionS3Type, error) {
48+
ev := LogsArchiveEncryptionS3Type(v)
49+
if ev.IsValid() {
50+
return &ev, nil
51+
}
52+
return nil, fmt.Errorf("invalid value '%v' for LogsArchiveEncryptionS3Type: valid values are %v", v, allowedLogsArchiveEncryptionS3TypeEnumValues)
53+
}
54+
55+
// IsValid return true if the value is valid for the enum, false otherwise.
56+
func (v LogsArchiveEncryptionS3Type) IsValid() bool {
57+
for _, existing := range allowedLogsArchiveEncryptionS3TypeEnumValues {
58+
if existing == v {
59+
return true
60+
}
61+
}
62+
return false
63+
}
64+
65+
// Ptr returns reference to LogsArchiveEncryptionS3Type value.
66+
func (v LogsArchiveEncryptionS3Type) Ptr() *LogsArchiveEncryptionS3Type {
67+
return &v
68+
}

0 commit comments

Comments
 (0)