Skip to content

Added storage class information to the S3 archive destination #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-03-06 21:28:37.526759",
"spec_repo_commit": "d6a6faf6"
"regenerated": "2025-03-10 19:36:00.648450",
"spec_repo_commit": "7d0b49f6"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-03-06 21:28:37.542319",
"spec_repo_commit": "d6a6faf6"
"regenerated": "2025-03-10 19:36:00.663966",
"spec_repo_commit": "7d0b49f6"
}
}
}
19 changes: 19 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18459,6 +18459,8 @@ components:
path:
description: The archive path.
type: string
storage_class:
$ref: '#/components/schemas/LogsArchiveStorageClassS3Type'
type:
$ref: '#/components/schemas/LogsArchiveDestinationS3Type'
required:
Expand Down Expand Up @@ -18602,6 +18604,23 @@ components:
- WORKING
- FAILING
- WORKING_AUTH_LEGACY
LogsArchiveStorageClassS3Type:
default: STANDARD
description: The storage class where the archive will be stored.
enum:
- STANDARD
- STANDARD_IA
- ONEZONE_IA
- INTELLIGENT_TIERING
- GLACIER_IR
example: STANDARD
type: string
x-enum-varnames:
- STANDARD
- STANDARD_IA
- ONEZONE_IA
- INTELLIGENT_TIERING
- GLACIER_IR
LogsArchives:
description: The available archives.
properties:
Expand Down
2 changes: 0 additions & 2 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,"Alice Ma
base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,Marshall Pierce <marshall@mpierce.org>
bitflags,https://github.com/bitflags/bitflags,MIT OR Apache-2.0,The Rust Project Developers
bumpalo,https://github.com/fitzgen/bumpalo,MIT OR Apache-2.0,Nick Fitzgerald <fitzgen@gmail.com>
byteorder,https://github.com/BurntSushi/byteorder,Unlicense OR MIT,Andrew Gallant <jamslam@gmail.com>
bytes,https://github.com/tokio-rs/bytes,MIT,"Carl Lerche <me@carllerche.com>, Sean McArthur <sean@seanmonstar.com>"
cfg-if,https://github.com/alexcrichton/cfg-if,MIT OR Apache-2.0,Alex Crichton <alex@alexcrichton.com>
chrono,https://github.com/chronotope/chrono,MIT OR Apache-2.0,The chrono Authors
Expand Down Expand Up @@ -172,7 +171,6 @@ write16,https://github.com/hsivonen/write16,Apache-2.0 OR MIT,The write16 Author
writeable,https://github.com/unicode-org/icu4x,Unicode-3.0,The ICU4X Project Developers
yoke,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <manishsmail@gmail.com>
yoke-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <manishsmail@gmail.com>
zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,Joshua Liebow-Feeser <joshlf@google.com>
zerocopy,https://github.com/google/zerocopy,BSD-2-Clause OR Apache-2.0 OR MIT,"Joshua Liebow-Feeser <joshlf@google.com>, Jack Wrenn <jswrenn@amazon.com>"
zerofrom,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <manishsmail@gmail.com>
zerofrom-derive,https://github.com/unicode-org/icu4x,Unicode-3.0,Manish Goregaokar <manishsmail@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,8 @@ pub mod model_logs_archive_encryption_s3_type;
pub use self::model_logs_archive_encryption_s3_type::LogsArchiveEncryptionS3Type;
pub mod model_logs_archive_integration_s3;
pub use self::model_logs_archive_integration_s3::LogsArchiveIntegrationS3;
pub mod model_logs_archive_storage_class_s3_type;
pub use self::model_logs_archive_storage_class_s3_type::LogsArchiveStorageClassS3Type;
pub mod model_logs_archive_destination_s3_type;
pub use self::model_logs_archive_destination_s3_type::LogsArchiveDestinationS3Type;
pub mod model_logs_archive_destination;
Expand Down
31 changes: 31 additions & 0 deletions src/datadogV2/model/model_logs_archive_destination_s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ pub struct LogsArchiveDestinationS3 {
/// The archive path.
#[serde(rename = "path")]
pub path: Option<String>,
/// The storage class where the archive will be stored.
#[serde(rename = "storage_class")]
pub storage_class: Option<crate::datadogV2::model::LogsArchiveStorageClassS3Type>,
/// Type of the S3 archive destination.
#[serde(rename = "type")]
pub type_: crate::datadogV2::model::LogsArchiveDestinationS3Type,
Expand All @@ -44,6 +47,7 @@ impl LogsArchiveDestinationS3 {
encryption: None,
integration,
path: None,
storage_class: None,
type_,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
Expand All @@ -60,6 +64,14 @@ impl LogsArchiveDestinationS3 {
self
}

pub fn storage_class(
mut self,
value: crate::datadogV2::model::LogsArchiveStorageClassS3Type,
) -> Self {
self.storage_class = Some(value);
self
}

pub fn additional_properties(
mut self,
value: std::collections::BTreeMap<String, serde_json::Value>,
Expand Down Expand Up @@ -91,6 +103,9 @@ impl<'de> Deserialize<'de> for LogsArchiveDestinationS3 {
let mut integration: Option<crate::datadogV2::model::LogsArchiveIntegrationS3> =
None;
let mut path: Option<String> = None;
let mut storage_class: Option<
crate::datadogV2::model::LogsArchiveStorageClassS3Type,
> = None;
let mut type_: Option<crate::datadogV2::model::LogsArchiveDestinationS3Type> = None;
let mut additional_properties: std::collections::BTreeMap<
String,
Expand Down Expand Up @@ -119,6 +134,21 @@ impl<'de> Deserialize<'de> for LogsArchiveDestinationS3 {
}
path = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"storage_class" => {
if v.is_null() {
continue;
}
storage_class =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
if let Some(ref _storage_class) = storage_class {
match _storage_class {
crate::datadogV2::model::LogsArchiveStorageClassS3Type::UnparsedObject(_storage_class) => {
_unparsed = true;
},
_ => {}
}
}
}
"type" => {
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
if let Some(ref _type_) = type_ {
Expand Down Expand Up @@ -147,6 +177,7 @@ impl<'de> Deserialize<'de> for LogsArchiveDestinationS3 {
encryption,
integration,
path,
storage_class,
type_,
additional_properties,
_unparsed,
Expand Down
60 changes: 60 additions & 0 deletions src/datadogV2/model/model_logs_archive_storage_class_s3_type.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[non_exhaustive]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum LogsArchiveStorageClassS3Type {
STANDARD,
STANDARD_IA,
ONEZONE_IA,
INTELLIGENT_TIERING,
GLACIER_IR,
UnparsedObject(crate::datadog::UnparsedObject),
}

impl ToString for LogsArchiveStorageClassS3Type {
fn to_string(&self) -> String {
match self {
Self::STANDARD => String::from("STANDARD"),
Self::STANDARD_IA => String::from("STANDARD_IA"),
Self::ONEZONE_IA => String::from("ONEZONE_IA"),
Self::INTELLIGENT_TIERING => String::from("INTELLIGENT_TIERING"),
Self::GLACIER_IR => String::from("GLACIER_IR"),
Self::UnparsedObject(v) => v.value.to_string(),
}
}
}

impl Serialize for LogsArchiveStorageClassS3Type {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
match self {
Self::UnparsedObject(v) => v.serialize(serializer),
_ => serializer.serialize_str(self.to_string().as_str()),
}
}
}

impl<'de> Deserialize<'de> for LogsArchiveStorageClassS3Type {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
let s: String = String::deserialize(deserializer)?;
Ok(match s.as_str() {
"STANDARD" => Self::STANDARD,
"STANDARD_IA" => Self::STANDARD_IA,
"ONEZONE_IA" => Self::ONEZONE_IA,
"INTELLIGENT_TIERING" => Self::INTELLIGENT_TIERING,
"GLACIER_IR" => Self::GLACIER_IR,
_ => Self::UnparsedObject(crate::datadog::UnparsedObject {
value: serde_json::Value::String(s.into()),
}),
})
}
}
Loading