Skip to content

Commit 25bb68d

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Added storage class information to the S3 archive destination (#2968)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 896e057 commit 25bb68d

4 files changed

Lines changed: 144 additions & 10 deletions

File tree

.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-03-06 21:28:31.247708",
8-
"spec_repo_commit": "d6a6faf6"
7+
"regenerated": "2025-03-10 19:35:56.516980",
8+
"spec_repo_commit": "7d0b49f6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-06 21:28:31.263946",
13-
"spec_repo_commit": "d6a6faf6"
12+
"regenerated": "2025-03-10 19:35:56.533454",
13+
"spec_repo_commit": "7d0b49f6"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18459,6 +18459,8 @@ components:
1845918459
path:
1846018460
description: The archive path.
1846118461
type: string
18462+
storage_class:
18463+
$ref: '#/components/schemas/LogsArchiveStorageClassS3Type'
1846218464
type:
1846318465
$ref: '#/components/schemas/LogsArchiveDestinationS3Type'
1846418466
required:
@@ -18602,6 +18604,23 @@ components:
1860218604
- WORKING
1860318605
- FAILING
1860418606
- WORKING_AUTH_LEGACY
18607+
LogsArchiveStorageClassS3Type:
18608+
default: STANDARD
18609+
description: The storage class where the archive will be stored.
18610+
enum:
18611+
- STANDARD
18612+
- STANDARD_IA
18613+
- ONEZONE_IA
18614+
- INTELLIGENT_TIERING
18615+
- GLACIER_IR
18616+
example: STANDARD
18617+
type: string
18618+
x-enum-varnames:
18619+
- STANDARD
18620+
- STANDARD_IA
18621+
- ONEZONE_IA
18622+
- INTELLIGENT_TIERING
18623+
- GLACIER_IR
1860518624
LogsArchives:
1860618625
description: The available archives.
1860718626
properties:

api/datadogV2/model_logs_archive_destination_s3.go

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ type LogsArchiveDestinationS3 struct {
2020
Integration LogsArchiveIntegrationS3 `json:"integration"`
2121
// The archive path.
2222
Path *string `json:"path,omitempty"`
23+
// The storage class where the archive will be stored.
24+
StorageClass *LogsArchiveStorageClassS3Type `json:"storage_class,omitempty"`
2325
// Type of the S3 archive destination.
2426
Type LogsArchiveDestinationS3Type `json:"type"`
2527
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -35,6 +37,8 @@ func NewLogsArchiveDestinationS3(bucket string, integration LogsArchiveIntegrati
3537
this := LogsArchiveDestinationS3{}
3638
this.Bucket = bucket
3739
this.Integration = integration
40+
var storageClass LogsArchiveStorageClassS3Type = LOGSARCHIVESTORAGECLASSS3TYPE_STANDARD
41+
this.StorageClass = &storageClass
3842
this.Type = typeVar
3943
return &this
4044
}
@@ -44,6 +48,8 @@ func NewLogsArchiveDestinationS3(bucket string, integration LogsArchiveIntegrati
4448
// but it doesn't guarantee that properties required by API are set.
4549
func NewLogsArchiveDestinationS3WithDefaults() *LogsArchiveDestinationS3 {
4650
this := LogsArchiveDestinationS3{}
51+
var storageClass LogsArchiveStorageClassS3Type = LOGSARCHIVESTORAGECLASSS3TYPE_STANDARD
52+
this.StorageClass = &storageClass
4753
var typeVar LogsArchiveDestinationS3Type = LOGSARCHIVEDESTINATIONS3TYPE_S3
4854
this.Type = typeVar
4955
return &this
@@ -151,6 +157,34 @@ func (o *LogsArchiveDestinationS3) SetPath(v string) {
151157
o.Path = &v
152158
}
153159

160+
// GetStorageClass returns the StorageClass field value if set, zero value otherwise.
161+
func (o *LogsArchiveDestinationS3) GetStorageClass() LogsArchiveStorageClassS3Type {
162+
if o == nil || o.StorageClass == nil {
163+
var ret LogsArchiveStorageClassS3Type
164+
return ret
165+
}
166+
return *o.StorageClass
167+
}
168+
169+
// GetStorageClassOk returns a tuple with the StorageClass field value if set, nil otherwise
170+
// and a boolean to check if the value has been set.
171+
func (o *LogsArchiveDestinationS3) GetStorageClassOk() (*LogsArchiveStorageClassS3Type, bool) {
172+
if o == nil || o.StorageClass == nil {
173+
return nil, false
174+
}
175+
return o.StorageClass, true
176+
}
177+
178+
// HasStorageClass returns a boolean if a field has been set.
179+
func (o *LogsArchiveDestinationS3) HasStorageClass() bool {
180+
return o != nil && o.StorageClass != nil
181+
}
182+
183+
// SetStorageClass gets a reference to the given LogsArchiveStorageClassS3Type and assigns it to the StorageClass field.
184+
func (o *LogsArchiveDestinationS3) SetStorageClass(v LogsArchiveStorageClassS3Type) {
185+
o.StorageClass = &v
186+
}
187+
154188
// GetType returns the Type field value.
155189
func (o *LogsArchiveDestinationS3) GetType() LogsArchiveDestinationS3Type {
156190
if o == nil {
@@ -188,6 +222,9 @@ func (o LogsArchiveDestinationS3) MarshalJSON() ([]byte, error) {
188222
if o.Path != nil {
189223
toSerialize["path"] = o.Path
190224
}
225+
if o.StorageClass != nil {
226+
toSerialize["storage_class"] = o.StorageClass
227+
}
191228
toSerialize["type"] = o.Type
192229

193230
for key, value := range o.AdditionalProperties {
@@ -199,11 +236,12 @@ func (o LogsArchiveDestinationS3) MarshalJSON() ([]byte, error) {
199236
// UnmarshalJSON deserializes the given payload.
200237
func (o *LogsArchiveDestinationS3) UnmarshalJSON(bytes []byte) (err error) {
201238
all := struct {
202-
Bucket *string `json:"bucket"`
203-
Encryption *LogsArchiveEncryptionS3 `json:"encryption,omitempty"`
204-
Integration *LogsArchiveIntegrationS3 `json:"integration"`
205-
Path *string `json:"path,omitempty"`
206-
Type *LogsArchiveDestinationS3Type `json:"type"`
239+
Bucket *string `json:"bucket"`
240+
Encryption *LogsArchiveEncryptionS3 `json:"encryption,omitempty"`
241+
Integration *LogsArchiveIntegrationS3 `json:"integration"`
242+
Path *string `json:"path,omitempty"`
243+
StorageClass *LogsArchiveStorageClassS3Type `json:"storage_class,omitempty"`
244+
Type *LogsArchiveDestinationS3Type `json:"type"`
207245
}{}
208246
if err = datadog.Unmarshal(bytes, &all); err != nil {
209247
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -219,7 +257,7 @@ func (o *LogsArchiveDestinationS3) UnmarshalJSON(bytes []byte) (err error) {
219257
}
220258
additionalProperties := make(map[string]interface{})
221259
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
222-
datadog.DeleteKeys(additionalProperties, &[]string{"bucket", "encryption", "integration", "path", "type"})
260+
datadog.DeleteKeys(additionalProperties, &[]string{"bucket", "encryption", "integration", "path", "storage_class", "type"})
223261
} else {
224262
return err
225263
}
@@ -235,6 +273,11 @@ func (o *LogsArchiveDestinationS3) UnmarshalJSON(bytes []byte) (err error) {
235273
}
236274
o.Integration = *all.Integration
237275
o.Path = all.Path
276+
if all.StorageClass != nil && !all.StorageClass.IsValid() {
277+
hasInvalidField = true
278+
} else {
279+
o.StorageClass = all.StorageClass
280+
}
238281
if !all.Type.IsValid() {
239282
hasInvalidField = true
240283
} else {
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
// LogsArchiveStorageClassS3Type The storage class where the archive will be stored.
14+
type LogsArchiveStorageClassS3Type string
15+
16+
// List of LogsArchiveStorageClassS3Type.
17+
const (
18+
LOGSARCHIVESTORAGECLASSS3TYPE_STANDARD LogsArchiveStorageClassS3Type = "STANDARD"
19+
LOGSARCHIVESTORAGECLASSS3TYPE_STANDARD_IA LogsArchiveStorageClassS3Type = "STANDARD_IA"
20+
LOGSARCHIVESTORAGECLASSS3TYPE_ONEZONE_IA LogsArchiveStorageClassS3Type = "ONEZONE_IA"
21+
LOGSARCHIVESTORAGECLASSS3TYPE_INTELLIGENT_TIERING LogsArchiveStorageClassS3Type = "INTELLIGENT_TIERING"
22+
LOGSARCHIVESTORAGECLASSS3TYPE_GLACIER_IR LogsArchiveStorageClassS3Type = "GLACIER_IR"
23+
)
24+
25+
var allowedLogsArchiveStorageClassS3TypeEnumValues = []LogsArchiveStorageClassS3Type{
26+
LOGSARCHIVESTORAGECLASSS3TYPE_STANDARD,
27+
LOGSARCHIVESTORAGECLASSS3TYPE_STANDARD_IA,
28+
LOGSARCHIVESTORAGECLASSS3TYPE_ONEZONE_IA,
29+
LOGSARCHIVESTORAGECLASSS3TYPE_INTELLIGENT_TIERING,
30+
LOGSARCHIVESTORAGECLASSS3TYPE_GLACIER_IR,
31+
}
32+
33+
// GetAllowedValues reeturns the list of possible values.
34+
func (v *LogsArchiveStorageClassS3Type) GetAllowedValues() []LogsArchiveStorageClassS3Type {
35+
return allowedLogsArchiveStorageClassS3TypeEnumValues
36+
}
37+
38+
// UnmarshalJSON deserializes the given payload.
39+
func (v *LogsArchiveStorageClassS3Type) UnmarshalJSON(src []byte) error {
40+
var value string
41+
err := datadog.Unmarshal(src, &value)
42+
if err != nil {
43+
return err
44+
}
45+
*v = LogsArchiveStorageClassS3Type(value)
46+
return nil
47+
}
48+
49+
// NewLogsArchiveStorageClassS3TypeFromValue returns a pointer to a valid LogsArchiveStorageClassS3Type
50+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
51+
func NewLogsArchiveStorageClassS3TypeFromValue(v string) (*LogsArchiveStorageClassS3Type, error) {
52+
ev := LogsArchiveStorageClassS3Type(v)
53+
if ev.IsValid() {
54+
return &ev, nil
55+
}
56+
return nil, fmt.Errorf("invalid value '%v' for LogsArchiveStorageClassS3Type: valid values are %v", v, allowedLogsArchiveStorageClassS3TypeEnumValues)
57+
}
58+
59+
// IsValid return true if the value is valid for the enum, false otherwise.
60+
func (v LogsArchiveStorageClassS3Type) IsValid() bool {
61+
for _, existing := range allowedLogsArchiveStorageClassS3TypeEnumValues {
62+
if existing == v {
63+
return true
64+
}
65+
}
66+
return false
67+
}
68+
69+
// Ptr returns reference to LogsArchiveStorageClassS3Type value.
70+
func (v LogsArchiveStorageClassS3Type) Ptr() *LogsArchiveStorageClassS3Type {
71+
return &v
72+
}

0 commit comments

Comments
 (0)