Skip to content

Commit ef3cdf5

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Added storage class information to the S3 archive destination (#550)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent e59672d commit ef3cdf5

File tree

6 files changed

+116
-6
lines changed

6 files changed

+116
-6
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-03-06 21:28:37.526759",
8-
"spec_repo_commit": "d6a6faf6"
7+
"regenerated": "2025-03-10 19:36:00.648450",
8+
"spec_repo_commit": "7d0b49f6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-06 21:28:37.542319",
13-
"spec_repo_commit": "d6a6faf6"
12+
"regenerated": "2025-03-10 19:36:00.663966",
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:

LICENSE-3rdparty.csv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,"Alice Ma
1111
base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,Marshall Pierce <[email protected]>
1212
bitflags,https://github.com/bitflags/bitflags,MIT OR Apache-2.0,The Rust Project Developers
1313
bumpalo,https://github.com/fitzgen/bumpalo,MIT OR Apache-2.0,Nick Fitzgerald <[email protected]>
14-
byteorder,https://github.com/BurntSushi/byteorder,Unlicense OR MIT,Andrew Gallant <[email protected]>
1514
bytes,https://github.com/tokio-rs/bytes,MIT,"Carl Lerche <[email protected]>, Sean McArthur <[email protected]>"
1615
cfg-if,https://github.com/alexcrichton/cfg-if,MIT OR Apache-2.0,Alex Crichton <[email protected]>
1716
chrono,https://github.com/chronotope/chrono,MIT OR Apache-2.0,The chrono Authors
@@ -172,7 +171,6 @@ write16,https://github.com/hsivonen/write16,Apache-2.0 OR MIT,The write16 Author
172171
writeable,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers
173172
yoke,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <[email protected]>
174173
yoke-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <[email protected]>
175-
zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,Joshua Liebow-Feeser <[email protected]>
176174
zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,"Joshua Liebow-Feeser <[email protected]>, Jack Wrenn <[email protected]>"
177175
zerofrom,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <[email protected]>
178176
zerofrom-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <[email protected]>

src/datadogV2/model/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,8 @@ pub mod model_logs_archive_encryption_s3_type;
20742074
pub use self::model_logs_archive_encryption_s3_type::LogsArchiveEncryptionS3Type;
20752075
pub mod model_logs_archive_integration_s3;
20762076
pub use self::model_logs_archive_integration_s3::LogsArchiveIntegrationS3;
2077+
pub mod model_logs_archive_storage_class_s3_type;
2078+
pub use self::model_logs_archive_storage_class_s3_type::LogsArchiveStorageClassS3Type;
20772079
pub mod model_logs_archive_destination_s3_type;
20782080
pub use self::model_logs_archive_destination_s3_type::LogsArchiveDestinationS3Type;
20792081
pub mod model_logs_archive_destination;

src/datadogV2/model/model_logs_archive_destination_s3.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ pub struct LogsArchiveDestinationS3 {
2323
/// The archive path.
2424
#[serde(rename = "path")]
2525
pub path: Option<String>,
26+
/// The storage class where the archive will be stored.
27+
#[serde(rename = "storage_class")]
28+
pub storage_class: Option<crate::datadogV2::model::LogsArchiveStorageClassS3Type>,
2629
/// Type of the S3 archive destination.
2730
#[serde(rename = "type")]
2831
pub type_: crate::datadogV2::model::LogsArchiveDestinationS3Type,
@@ -44,6 +47,7 @@ impl LogsArchiveDestinationS3 {
4447
encryption: None,
4548
integration,
4649
path: None,
50+
storage_class: None,
4751
type_,
4852
additional_properties: std::collections::BTreeMap::new(),
4953
_unparsed: false,
@@ -60,6 +64,14 @@ impl LogsArchiveDestinationS3 {
6064
self
6165
}
6266

67+
pub fn storage_class(
68+
mut self,
69+
value: crate::datadogV2::model::LogsArchiveStorageClassS3Type,
70+
) -> Self {
71+
self.storage_class = Some(value);
72+
self
73+
}
74+
6375
pub fn additional_properties(
6476
mut self,
6577
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -91,6 +103,9 @@ impl<'de> Deserialize<'de> for LogsArchiveDestinationS3 {
91103
let mut integration: Option<crate::datadogV2::model::LogsArchiveIntegrationS3> =
92104
None;
93105
let mut path: Option<String> = None;
106+
let mut storage_class: Option<
107+
crate::datadogV2::model::LogsArchiveStorageClassS3Type,
108+
> = None;
94109
let mut type_: Option<crate::datadogV2::model::LogsArchiveDestinationS3Type> = None;
95110
let mut additional_properties: std::collections::BTreeMap<
96111
String,
@@ -119,6 +134,21 @@ impl<'de> Deserialize<'de> for LogsArchiveDestinationS3 {
119134
}
120135
path = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
121136
}
137+
"storage_class" => {
138+
if v.is_null() {
139+
continue;
140+
}
141+
storage_class =
142+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
143+
if let Some(ref _storage_class) = storage_class {
144+
match _storage_class {
145+
crate::datadogV2::model::LogsArchiveStorageClassS3Type::UnparsedObject(_storage_class) => {
146+
_unparsed = true;
147+
},
148+
_ => {}
149+
}
150+
}
151+
}
122152
"type" => {
123153
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
124154
if let Some(ref _type_) = type_ {
@@ -147,6 +177,7 @@ impl<'de> Deserialize<'de> for LogsArchiveDestinationS3 {
147177
encryption,
148178
integration,
149179
path,
180+
storage_class,
150181
type_,
151182
additional_properties,
152183
_unparsed,
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
use serde::{Deserialize, Deserializer, Serialize, Serializer};
6+
7+
#[non_exhaustive]
8+
#[derive(Clone, Debug, Eq, PartialEq)]
9+
pub enum LogsArchiveStorageClassS3Type {
10+
STANDARD,
11+
STANDARD_IA,
12+
ONEZONE_IA,
13+
INTELLIGENT_TIERING,
14+
GLACIER_IR,
15+
UnparsedObject(crate::datadog::UnparsedObject),
16+
}
17+
18+
impl ToString for LogsArchiveStorageClassS3Type {
19+
fn to_string(&self) -> String {
20+
match self {
21+
Self::STANDARD => String::from("STANDARD"),
22+
Self::STANDARD_IA => String::from("STANDARD_IA"),
23+
Self::ONEZONE_IA => String::from("ONEZONE_IA"),
24+
Self::INTELLIGENT_TIERING => String::from("INTELLIGENT_TIERING"),
25+
Self::GLACIER_IR => String::from("GLACIER_IR"),
26+
Self::UnparsedObject(v) => v.value.to_string(),
27+
}
28+
}
29+
}
30+
31+
impl Serialize for LogsArchiveStorageClassS3Type {
32+
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
33+
where
34+
S: Serializer,
35+
{
36+
match self {
37+
Self::UnparsedObject(v) => v.serialize(serializer),
38+
_ => serializer.serialize_str(self.to_string().as_str()),
39+
}
40+
}
41+
}
42+
43+
impl<'de> Deserialize<'de> for LogsArchiveStorageClassS3Type {
44+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
45+
where
46+
D: Deserializer<'de>,
47+
{
48+
let s: String = String::deserialize(deserializer)?;
49+
Ok(match s.as_str() {
50+
"STANDARD" => Self::STANDARD,
51+
"STANDARD_IA" => Self::STANDARD_IA,
52+
"ONEZONE_IA" => Self::ONEZONE_IA,
53+
"INTELLIGENT_TIERING" => Self::INTELLIGENT_TIERING,
54+
"GLACIER_IR" => Self::GLACIER_IR,
55+
_ => Self::UnparsedObject(crate::datadog::UnparsedObject {
56+
value: serde_json::Value::String(s.into()),
57+
}),
58+
})
59+
}
60+
}

0 commit comments

Comments
 (0)