From 2890e1aac8495e77b2cc9272b3a4db33e63945f5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 23 Jul 2026 16:32:03 +0000 Subject: [PATCH] Regenerate client from commit 4147674 of spec repo --- .generator/schemas/v2/openapi.yaml | 224 ++++++++++++++++-- src/datadogV2/model/mod.rs | 32 ++- ...monitoring_content_pack_app_sec_details.rs | 104 ++++++++ ...oring_content_pack_app_sec_details_type.rs | 48 ++++ ...y_monitoring_content_pack_audit_details.rs | 104 ++++++++ ...itoring_content_pack_audit_details_type.rs | 48 ++++ ..._monitoring_content_pack_entity_details.rs | 127 ++++++++++ ...toring_content_pack_entity_details_type.rs | 48 ++++ ...ty_monitoring_content_pack_logs_details.rs | 215 +++++++++++++++++ ...itoring_content_pack_onboarding_details.rs | 151 ++++++++++++ ...ng_content_pack_onboarding_details_type.rs | 48 ++++ ...onitoring_content_pack_state_attributes.rs | 154 +++--------- ...rity_monitoring_content_pack_state_data.rs | 2 +- ...y_monitoring_content_pack_state_details.rs | 103 ++++++++ ...rity_monitoring_content_pack_state_meta.rs | 22 +- ...monitoring_content_pack_states_response.rs | 2 +- ...security_monitoring_content_pack_status.rs | 3 + ...oring_content_pack_threat_intel_details.rs | 176 ++++++++++++++ ..._content_pack_threat_intel_details_type.rs | 48 ++++ ...ring_content_pack_vulnerability_details.rs | 176 ++++++++++++++ ...content_pack_vulnerability_details_type.rs | 48 ++++ .../model/model_security_monitoring_sku.rs | 6 + 22 files changed, 1733 insertions(+), 156 deletions(-) create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_app_sec_details.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_app_sec_details_type.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_audit_details.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_audit_details_type.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_entity_details.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_entity_details_type.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_logs_details.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_onboarding_details.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_onboarding_details_type.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_state_details.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_threat_intel_details.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_threat_intel_details_type.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_vulnerability_details.rs create mode 100644 src/datadogV2/model/model_security_monitoring_content_pack_vulnerability_details_type.rs diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 53a4ea6a1a..6c05c225a8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -89587,6 +89587,57 @@ components: - NEVER_ACTIVATED - ACTIVATED - DEACTIVATED + SecurityMonitoringContentPackAppSecDetails: + description: Details for an Application Security content pack. + properties: + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackAppSecDetailsType" + required: + - type + type: object + SecurityMonitoringContentPackAppSecDetailsType: + description: Type for Application Security content pack details. + enum: + - appsec + example: appsec + type: string + x-enum-varnames: + - APPSEC + SecurityMonitoringContentPackAuditDetails: + description: Details for an audit trail content pack. + properties: + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackAuditDetailsType" + required: + - type + type: object + SecurityMonitoringContentPackAuditDetailsType: + description: Type for audit trail content pack details. + enum: + - audit + example: audit + type: string + x-enum-varnames: + - AUDIT + SecurityMonitoringContentPackEntityDetails: + description: Details for an entity or identity content pack. + properties: + cp_activation: + $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackEntityDetailsType" + required: + - type + - cp_activation + type: object + SecurityMonitoringContentPackEntityDetailsType: + description: Type for entity content pack details. + enum: + - entity + example: entity + type: string + x-enum-varnames: + - ENTITY SecurityMonitoringContentPackIntegrationStatus: description: The installation status of the related integration. enum: @@ -89609,16 +89660,14 @@ components: - PARTIALLY_INSTALLED - DETECTED - ERROR - SecurityMonitoringContentPackStateAttributes: - description: Attributes of a content pack state + SecurityMonitoringContentPackLogsDetails: + description: Details for a logs-based content pack. properties: - cloud_siem_index_incorrect: - description: Whether the cloud SIEM index configuration is incorrect (only applies to certain pricing models) - example: false - type: boolean cp_activation: $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" - filters_configured_for_logs: + data_last_seen: + $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" + filters_configured: description: |- Whether filters (Security Filters or Index Query depending on the pricing model) are present and correctly configured to route logs into Cloud SIEM. @@ -89626,21 +89675,59 @@ components: type: boolean integration_installed_status: $ref: "#/components/schemas/SecurityMonitoringContentPackIntegrationStatus" - logs_last_collected: - $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" logs_seen_from_any_index: - description: Whether logs for this content pack have been seen in any Datadog index within the last 72 hours. + description: Whether logs for this content pack have been seen in any Datadog index in the last 72 hours. example: true type: boolean - state: - $ref: "#/components/schemas/SecurityMonitoringContentPackStatus" + siem_index_incorrect: + description: Whether the Cloud SIEM index configuration is incorrect (only applies to certain pricing models). + example: false + type: boolean + type: + $ref: "#/components/schemas/SecurityFilterFilteredDataType" required: - - state + - type - cp_activation + - data_last_seen + - integration_installed_status + - filters_configured - logs_seen_from_any_index - - logs_last_collected - - cloud_siem_index_incorrect - - filters_configured_for_logs + - siem_index_incorrect + type: object + SecurityMonitoringContentPackOnboardingDetails: + description: |- + Content pack details returned when Cloud SIEM is inactive for the requesting organization. + properties: + integration_installed_status: + $ref: "#/components/schemas/SecurityMonitoringContentPackIntegrationStatus" + logs_seen_from_any_index: + description: Whether logs for this content pack have been seen in any Datadog index in the last 72 hours. + example: true + type: boolean + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackOnboardingDetailsType" + required: + - type + - logs_seen_from_any_index + type: object + SecurityMonitoringContentPackOnboardingDetailsType: + description: Type for onboarding content pack details. + enum: + - onboarding + example: onboarding + type: string + x-enum-varnames: + - ONBOARDING + SecurityMonitoringContentPackStateAttributes: + description: Attributes of a content pack state. + properties: + details: + $ref: "#/components/schemas/SecurityMonitoringContentPackStateDetails" + status: + $ref: "#/components/schemas/SecurityMonitoringContentPackStatus" + required: + - status + - details type: object SecurityMonitoringContentPackStateData: description: Content pack state data. @@ -89658,13 +89745,42 @@ components: - type - attributes type: object + SecurityMonitoringContentPackStateDetails: + description: |- + Type-specific details for a content pack state. The set of fields present depends + on the content pack's `type`. When Cloud SIEM is inactive for the requesting organization, `onboarding` is returned instead of the content pack's usual type, such as `logs` or `vulnerability`.` + discriminator: + mapping: + appsec: "#/components/schemas/SecurityMonitoringContentPackAppSecDetails" + audit: "#/components/schemas/SecurityMonitoringContentPackAuditDetails" + entity: "#/components/schemas/SecurityMonitoringContentPackEntityDetails" + logs: "#/components/schemas/SecurityMonitoringContentPackLogsDetails" + onboarding: "#/components/schemas/SecurityMonitoringContentPackOnboardingDetails" + threat_intel: "#/components/schemas/SecurityMonitoringContentPackThreatIntelDetails" + vulnerability: "#/components/schemas/SecurityMonitoringContentPackVulnerabilityDetails" + propertyName: type + oneOf: + - $ref: "#/components/schemas/SecurityMonitoringContentPackLogsDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackThreatIntelDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackEntityDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackAuditDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackAppSecDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackVulnerabilityDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackOnboardingDetails" SecurityMonitoringContentPackStateMeta: - description: Metadata for content pack states + description: Metadata for content pack states. properties: cloud_siem_index_incorrect: - description: Whether the cloud SIEM index configuration is incorrect at the organization level + description: Whether the Cloud SIEM index configuration is incorrect for the organization. example: false type: boolean + retention_months: + description: |- + The number of months that standard logs are retained for organizations on the standalone_indexed` pricing model. This field is omitted for other pricing models. + example: 15 + format: int32 + maximum: 60 + type: integer sku: $ref: "#/components/schemas/SecurityMonitoringSKU" required: @@ -89702,6 +89818,7 @@ components: - active - warning - broken + - not_configured example: active type: string x-enum-descriptions: @@ -89711,6 +89828,7 @@ components: - Activated; logs received within the last 24 hours. - Activated; integration not installed or logs last seen 24 to 72 hours ago. - Activated; no logs for over 72 hours, filter missing, or Cloud SIEM index incorrectly ordered. + - Activated, but no credentials are configured (entity content packs only). x-enum-varnames: - INSTALL - ACTIVATE @@ -89718,6 +89836,32 @@ components: - ACTIVE - WARNING - BROKEN + - NOT_CONFIGURED + SecurityMonitoringContentPackThreatIntelDetails: + description: Details for a threat intelligence content pack. + properties: + cp_activation: + $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" + data_last_seen: + $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" + integration_installed_status: + $ref: "#/components/schemas/SecurityMonitoringContentPackIntegrationStatus" + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackThreatIntelDetailsType" + required: + - type + - cp_activation + - data_last_seen + - integration_installed_status + type: object + SecurityMonitoringContentPackThreatIntelDetailsType: + description: Type for threat intelligence content pack details. + enum: + - threat_intel + example: threat_intel + type: string + x-enum-varnames: + - THREAT_INTEL SecurityMonitoringContentPackTimestampBucket: description: Timestamp bucket indicating when logs were last collected. enum: @@ -89740,6 +89884,31 @@ components: - WITHIN_24_TO_72_HOURS - OVER_72H_TO_30D - OVER_30D + SecurityMonitoringContentPackVulnerabilityDetails: + description: Details for a vulnerability content pack. + properties: + cp_activation: + $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" + data_last_seen: + $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" + integration_installed_status: + $ref: "#/components/schemas/SecurityMonitoringContentPackIntegrationStatus" + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackVulnerabilityDetailsType" + required: + - type + - cp_activation + - data_last_seen + - integration_installed_status + type: object + SecurityMonitoringContentPackVulnerabilityDetailsType: + description: Type for vulnerability content pack details. + enum: + - vulnerability + example: vulnerability + type: string + x-enum-varnames: + - VULNERABILITY SecurityMonitoringCriticalAsset: description: The critical asset's properties. properties: @@ -92111,12 +92280,16 @@ components: - per_gb_analyzed - per_event_in_siem_index_2023 - add_on_2024 + - standalone_indexed + - unknown example: add_on_2024 type: string x-enum-varnames: - PER_GB_ANALYZED - PER_EVENT_IN_SIEM_INDEX_2023 - ADD_ON_2024 + - STANDALONE_INDEXED + - UNKNOWN SecurityMonitoringSchedulingOptions: description: Options for scheduled rules. When this field is present, the rule runs based on the schedule. When absent, it runs real-time on ingested logs. nullable: true @@ -184078,12 +184251,15 @@ paths: value: data: - attributes: - cloud_siem_index_incorrect: false - cp_activation: activated - filters_configured_for_logs: true - logs_last_collected: within_24_hours - logs_seen_from_any_index: true - state: active + details: + cp_activation: activated + data_last_seen: within_24_hours + filters_configured: true + integration_installed_status: installed + logs_seen_from_any_index: true + siem_index_incorrect: false + type: logs + status: active id: aws-cloudtrail type: content_pack_state meta: diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index af41cedad5..98e6f72fb0 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -11136,12 +11136,40 @@ pub mod model_security_monitoring_content_pack_state_data; pub use self::model_security_monitoring_content_pack_state_data::SecurityMonitoringContentPackStateData; pub mod model_security_monitoring_content_pack_state_attributes; pub use self::model_security_monitoring_content_pack_state_attributes::SecurityMonitoringContentPackStateAttributes; +pub mod model_security_monitoring_content_pack_logs_details; +pub use self::model_security_monitoring_content_pack_logs_details::SecurityMonitoringContentPackLogsDetails; pub mod model_security_monitoring_content_pack_activation; pub use self::model_security_monitoring_content_pack_activation::SecurityMonitoringContentPackActivation; -pub mod model_security_monitoring_content_pack_integration_status; -pub use self::model_security_monitoring_content_pack_integration_status::SecurityMonitoringContentPackIntegrationStatus; pub mod model_security_monitoring_content_pack_timestamp_bucket; pub use self::model_security_monitoring_content_pack_timestamp_bucket::SecurityMonitoringContentPackTimestampBucket; +pub mod model_security_monitoring_content_pack_integration_status; +pub use self::model_security_monitoring_content_pack_integration_status::SecurityMonitoringContentPackIntegrationStatus; +pub mod model_security_monitoring_content_pack_threat_intel_details; +pub use self::model_security_monitoring_content_pack_threat_intel_details::SecurityMonitoringContentPackThreatIntelDetails; +pub mod model_security_monitoring_content_pack_threat_intel_details_type; +pub use self::model_security_monitoring_content_pack_threat_intel_details_type::SecurityMonitoringContentPackThreatIntelDetailsType; +pub mod model_security_monitoring_content_pack_entity_details; +pub use self::model_security_monitoring_content_pack_entity_details::SecurityMonitoringContentPackEntityDetails; +pub mod model_security_monitoring_content_pack_entity_details_type; +pub use self::model_security_monitoring_content_pack_entity_details_type::SecurityMonitoringContentPackEntityDetailsType; +pub mod model_security_monitoring_content_pack_audit_details; +pub use self::model_security_monitoring_content_pack_audit_details::SecurityMonitoringContentPackAuditDetails; +pub mod model_security_monitoring_content_pack_audit_details_type; +pub use self::model_security_monitoring_content_pack_audit_details_type::SecurityMonitoringContentPackAuditDetailsType; +pub mod model_security_monitoring_content_pack_app_sec_details; +pub use self::model_security_monitoring_content_pack_app_sec_details::SecurityMonitoringContentPackAppSecDetails; +pub mod model_security_monitoring_content_pack_app_sec_details_type; +pub use self::model_security_monitoring_content_pack_app_sec_details_type::SecurityMonitoringContentPackAppSecDetailsType; +pub mod model_security_monitoring_content_pack_vulnerability_details; +pub use self::model_security_monitoring_content_pack_vulnerability_details::SecurityMonitoringContentPackVulnerabilityDetails; +pub mod model_security_monitoring_content_pack_vulnerability_details_type; +pub use self::model_security_monitoring_content_pack_vulnerability_details_type::SecurityMonitoringContentPackVulnerabilityDetailsType; +pub mod model_security_monitoring_content_pack_onboarding_details; +pub use self::model_security_monitoring_content_pack_onboarding_details::SecurityMonitoringContentPackOnboardingDetails; +pub mod model_security_monitoring_content_pack_onboarding_details_type; +pub use self::model_security_monitoring_content_pack_onboarding_details_type::SecurityMonitoringContentPackOnboardingDetailsType; +pub mod model_security_monitoring_content_pack_state_details; +pub use self::model_security_monitoring_content_pack_state_details::SecurityMonitoringContentPackStateDetails; pub mod model_security_monitoring_content_pack_status; pub use self::model_security_monitoring_content_pack_status::SecurityMonitoringContentPackStatus; pub mod model_security_monitoring_content_pack_state_type; diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_app_sec_details.rs b/src/datadogV2/model/model_security_monitoring_content_pack_app_sec_details.rs new file mode 100644 index 0000000000..130b7ddd7e --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_app_sec_details.rs @@ -0,0 +1,104 @@ +// 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::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Details for an Application Security content pack. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SecurityMonitoringContentPackAppSecDetails { + /// Type for Application Security content pack details. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::SecurityMonitoringContentPackAppSecDetailsType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SecurityMonitoringContentPackAppSecDetails { + pub fn new( + type_: crate::datadogV2::model::SecurityMonitoringContentPackAppSecDetailsType, + ) -> SecurityMonitoringContentPackAppSecDetails { + SecurityMonitoringContentPackAppSecDetails { + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackAppSecDetails { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SecurityMonitoringContentPackAppSecDetailsVisitor; + impl<'a> Visitor<'a> for SecurityMonitoringContentPackAppSecDetailsVisitor { + type Value = SecurityMonitoringContentPackAppSecDetails; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut type_: Option< + crate::datadogV2::model::SecurityMonitoringContentPackAppSecDetailsType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::SecurityMonitoringContentPackAppSecDetailsType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = SecurityMonitoringContentPackAppSecDetails { + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SecurityMonitoringContentPackAppSecDetailsVisitor) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_app_sec_details_type.rs b/src/datadogV2/model/model_security_monitoring_content_pack_app_sec_details_type.rs new file mode 100644 index 0000000000..6480b09e83 --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_app_sec_details_type.rs @@ -0,0 +1,48 @@ +// 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 SecurityMonitoringContentPackAppSecDetailsType { + APPSEC, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for SecurityMonitoringContentPackAppSecDetailsType { + fn to_string(&self) -> String { + match self { + Self::APPSEC => String::from("appsec"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for SecurityMonitoringContentPackAppSecDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackAppSecDetailsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "appsec" => Self::APPSEC, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_audit_details.rs b/src/datadogV2/model/model_security_monitoring_content_pack_audit_details.rs new file mode 100644 index 0000000000..16947251be --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_audit_details.rs @@ -0,0 +1,104 @@ +// 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::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Details for an audit trail content pack. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SecurityMonitoringContentPackAuditDetails { + /// Type for audit trail content pack details. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::SecurityMonitoringContentPackAuditDetailsType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SecurityMonitoringContentPackAuditDetails { + pub fn new( + type_: crate::datadogV2::model::SecurityMonitoringContentPackAuditDetailsType, + ) -> SecurityMonitoringContentPackAuditDetails { + SecurityMonitoringContentPackAuditDetails { + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackAuditDetails { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SecurityMonitoringContentPackAuditDetailsVisitor; + impl<'a> Visitor<'a> for SecurityMonitoringContentPackAuditDetailsVisitor { + type Value = SecurityMonitoringContentPackAuditDetails; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut type_: Option< + crate::datadogV2::model::SecurityMonitoringContentPackAuditDetailsType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::SecurityMonitoringContentPackAuditDetailsType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = SecurityMonitoringContentPackAuditDetails { + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SecurityMonitoringContentPackAuditDetailsVisitor) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_audit_details_type.rs b/src/datadogV2/model/model_security_monitoring_content_pack_audit_details_type.rs new file mode 100644 index 0000000000..2684b7938f --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_audit_details_type.rs @@ -0,0 +1,48 @@ +// 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 SecurityMonitoringContentPackAuditDetailsType { + AUDIT, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for SecurityMonitoringContentPackAuditDetailsType { + fn to_string(&self) -> String { + match self { + Self::AUDIT => String::from("audit"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for SecurityMonitoringContentPackAuditDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackAuditDetailsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "audit" => Self::AUDIT, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_entity_details.rs b/src/datadogV2/model/model_security_monitoring_content_pack_entity_details.rs new file mode 100644 index 0000000000..d676ab1ac7 --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_entity_details.rs @@ -0,0 +1,127 @@ +// 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::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Details for an entity or identity content pack. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SecurityMonitoringContentPackEntityDetails { + /// The activation status of a content pack. + #[serde(rename = "cp_activation")] + pub cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, + /// Type for entity content pack details. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::SecurityMonitoringContentPackEntityDetailsType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SecurityMonitoringContentPackEntityDetails { + pub fn new( + cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, + type_: crate::datadogV2::model::SecurityMonitoringContentPackEntityDetailsType, + ) -> SecurityMonitoringContentPackEntityDetails { + SecurityMonitoringContentPackEntityDetails { + cp_activation, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackEntityDetails { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SecurityMonitoringContentPackEntityDetailsVisitor; + impl<'a> Visitor<'a> for SecurityMonitoringContentPackEntityDetailsVisitor { + type Value = SecurityMonitoringContentPackEntityDetails; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut cp_activation: Option< + crate::datadogV2::model::SecurityMonitoringContentPackActivation, + > = None; + let mut type_: Option< + crate::datadogV2::model::SecurityMonitoringContentPackEntityDetailsType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "cp_activation" => { + cp_activation = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _cp_activation) = cp_activation { + match _cp_activation { + crate::datadogV2::model::SecurityMonitoringContentPackActivation::UnparsedObject(_cp_activation) => { + _unparsed = true; + }, + _ => {} + } + } + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::SecurityMonitoringContentPackEntityDetailsType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let cp_activation = + cp_activation.ok_or_else(|| M::Error::missing_field("cp_activation"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = SecurityMonitoringContentPackEntityDetails { + cp_activation, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SecurityMonitoringContentPackEntityDetailsVisitor) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_entity_details_type.rs b/src/datadogV2/model/model_security_monitoring_content_pack_entity_details_type.rs new file mode 100644 index 0000000000..06af671557 --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_entity_details_type.rs @@ -0,0 +1,48 @@ +// 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 SecurityMonitoringContentPackEntityDetailsType { + ENTITY, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for SecurityMonitoringContentPackEntityDetailsType { + fn to_string(&self) -> String { + match self { + Self::ENTITY => String::from("entity"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for SecurityMonitoringContentPackEntityDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackEntityDetailsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "entity" => Self::ENTITY, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_logs_details.rs b/src/datadogV2/model/model_security_monitoring_content_pack_logs_details.rs new file mode 100644 index 0000000000..7daa14ef3a --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_logs_details.rs @@ -0,0 +1,215 @@ +// 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::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Details for a logs-based content pack. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SecurityMonitoringContentPackLogsDetails { + /// The activation status of a content pack. + #[serde(rename = "cp_activation")] + pub cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, + /// Timestamp bucket indicating when logs were last collected. + #[serde(rename = "data_last_seen")] + pub data_last_seen: crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + /// Whether filters (Security Filters or Index Query depending on the pricing model) are + /// present and correctly configured to route logs into Cloud SIEM. + #[serde(rename = "filters_configured")] + pub filters_configured: bool, + /// The installation status of the related integration. + #[serde(rename = "integration_installed_status")] + pub integration_installed_status: + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + /// Whether logs for this content pack have been seen in any Datadog index in the last 72 hours. + #[serde(rename = "logs_seen_from_any_index")] + pub logs_seen_from_any_index: bool, + /// Whether the Cloud SIEM index configuration is incorrect (only applies to certain pricing models). + #[serde(rename = "siem_index_incorrect")] + pub siem_index_incorrect: bool, + /// The filtered data type. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::SecurityFilterFilteredDataType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SecurityMonitoringContentPackLogsDetails { + pub fn new( + cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, + data_last_seen: crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + filters_configured: bool, + integration_installed_status: crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + logs_seen_from_any_index: bool, + siem_index_incorrect: bool, + type_: crate::datadogV2::model::SecurityFilterFilteredDataType, + ) -> SecurityMonitoringContentPackLogsDetails { + SecurityMonitoringContentPackLogsDetails { + cp_activation, + data_last_seen, + filters_configured, + integration_installed_status, + logs_seen_from_any_index, + siem_index_incorrect, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackLogsDetails { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SecurityMonitoringContentPackLogsDetailsVisitor; + impl<'a> Visitor<'a> for SecurityMonitoringContentPackLogsDetailsVisitor { + type Value = SecurityMonitoringContentPackLogsDetails; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut cp_activation: Option< + crate::datadogV2::model::SecurityMonitoringContentPackActivation, + > = None; + let mut data_last_seen: Option< + crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + > = None; + let mut filters_configured: Option = None; + let mut integration_installed_status: Option< + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + > = None; + let mut logs_seen_from_any_index: Option = None; + let mut siem_index_incorrect: Option = None; + let mut type_: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "cp_activation" => { + cp_activation = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _cp_activation) = cp_activation { + match _cp_activation { + crate::datadogV2::model::SecurityMonitoringContentPackActivation::UnparsedObject(_cp_activation) => { + _unparsed = true; + }, + _ => {} + } + } + } + "data_last_seen" => { + data_last_seen = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _data_last_seen) = data_last_seen { + match _data_last_seen { + crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket::UnparsedObject(_data_last_seen) => { + _unparsed = true; + }, + _ => {} + } + } + } + "filters_configured" => { + filters_configured = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "integration_installed_status" => { + integration_installed_status = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _integration_installed_status) = + integration_installed_status + { + match _integration_installed_status { + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus::UnparsedObject(_integration_installed_status) => { + _unparsed = true; + }, + _ => {} + } + } + } + "logs_seen_from_any_index" => { + logs_seen_from_any_index = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "siem_index_incorrect" => { + siem_index_incorrect = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::SecurityFilterFilteredDataType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let cp_activation = + cp_activation.ok_or_else(|| M::Error::missing_field("cp_activation"))?; + let data_last_seen = + data_last_seen.ok_or_else(|| M::Error::missing_field("data_last_seen"))?; + let filters_configured = filters_configured + .ok_or_else(|| M::Error::missing_field("filters_configured"))?; + let integration_installed_status = integration_installed_status + .ok_or_else(|| M::Error::missing_field("integration_installed_status"))?; + let logs_seen_from_any_index = logs_seen_from_any_index + .ok_or_else(|| M::Error::missing_field("logs_seen_from_any_index"))?; + let siem_index_incorrect = siem_index_incorrect + .ok_or_else(|| M::Error::missing_field("siem_index_incorrect"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = SecurityMonitoringContentPackLogsDetails { + cp_activation, + data_last_seen, + filters_configured, + integration_installed_status, + logs_seen_from_any_index, + siem_index_incorrect, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SecurityMonitoringContentPackLogsDetailsVisitor) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_onboarding_details.rs b/src/datadogV2/model/model_security_monitoring_content_pack_onboarding_details.rs new file mode 100644 index 0000000000..90dc888cd7 --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_onboarding_details.rs @@ -0,0 +1,151 @@ +// 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::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Content pack details returned when Cloud SIEM is inactive for the requesting organization. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SecurityMonitoringContentPackOnboardingDetails { + /// The installation status of the related integration. + #[serde(rename = "integration_installed_status")] + pub integration_installed_status: + Option, + /// Whether logs for this content pack have been seen in any Datadog index in the last 72 hours. + #[serde(rename = "logs_seen_from_any_index")] + pub logs_seen_from_any_index: bool, + /// Type for onboarding content pack details. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::SecurityMonitoringContentPackOnboardingDetailsType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SecurityMonitoringContentPackOnboardingDetails { + pub fn new( + logs_seen_from_any_index: bool, + type_: crate::datadogV2::model::SecurityMonitoringContentPackOnboardingDetailsType, + ) -> SecurityMonitoringContentPackOnboardingDetails { + SecurityMonitoringContentPackOnboardingDetails { + integration_installed_status: None, + logs_seen_from_any_index, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn integration_installed_status( + mut self, + value: crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + ) -> Self { + self.integration_installed_status = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackOnboardingDetails { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SecurityMonitoringContentPackOnboardingDetailsVisitor; + impl<'a> Visitor<'a> for SecurityMonitoringContentPackOnboardingDetailsVisitor { + type Value = SecurityMonitoringContentPackOnboardingDetails; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut integration_installed_status: Option< + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + > = None; + let mut logs_seen_from_any_index: Option = None; + let mut type_: Option< + crate::datadogV2::model::SecurityMonitoringContentPackOnboardingDetailsType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "integration_installed_status" => { + if v.is_null() { + continue; + } + integration_installed_status = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _integration_installed_status) = + integration_installed_status + { + match _integration_installed_status { + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus::UnparsedObject(_integration_installed_status) => { + _unparsed = true; + }, + _ => {} + } + } + } + "logs_seen_from_any_index" => { + logs_seen_from_any_index = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::SecurityMonitoringContentPackOnboardingDetailsType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let logs_seen_from_any_index = logs_seen_from_any_index + .ok_or_else(|| M::Error::missing_field("logs_seen_from_any_index"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = SecurityMonitoringContentPackOnboardingDetails { + integration_installed_status, + logs_seen_from_any_index, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SecurityMonitoringContentPackOnboardingDetailsVisitor) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_onboarding_details_type.rs b/src/datadogV2/model/model_security_monitoring_content_pack_onboarding_details_type.rs new file mode 100644 index 0000000000..2b29d76d2c --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_onboarding_details_type.rs @@ -0,0 +1,48 @@ +// 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 SecurityMonitoringContentPackOnboardingDetailsType { + ONBOARDING, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for SecurityMonitoringContentPackOnboardingDetailsType { + fn to_string(&self) -> String { + match self { + Self::ONBOARDING => String::from("onboarding"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for SecurityMonitoringContentPackOnboardingDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackOnboardingDetailsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "onboarding" => Self::ONBOARDING, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_state_attributes.rs b/src/datadogV2/model/model_security_monitoring_content_pack_state_attributes.rs index 519ef7fda5..057cf7d59c 100644 --- a/src/datadogV2/model/model_security_monitoring_content_pack_state_attributes.rs +++ b/src/datadogV2/model/model_security_monitoring_content_pack_state_attributes.rs @@ -6,34 +6,18 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Attributes of a content pack state +/// Attributes of a content pack state. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct SecurityMonitoringContentPackStateAttributes { - /// Whether the cloud SIEM index configuration is incorrect (only applies to certain pricing models) - #[serde(rename = "cloud_siem_index_incorrect")] - pub cloud_siem_index_incorrect: bool, - /// The activation status of a content pack. - #[serde(rename = "cp_activation")] - pub cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, - /// Whether filters (Security Filters or Index Query depending on the pricing model) are - /// present and correctly configured to route logs into Cloud SIEM. - #[serde(rename = "filters_configured_for_logs")] - pub filters_configured_for_logs: bool, - /// The installation status of the related integration. - #[serde(rename = "integration_installed_status")] - pub integration_installed_status: - Option, - /// Timestamp bucket indicating when logs were last collected. - #[serde(rename = "logs_last_collected")] - pub logs_last_collected: crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, - /// Whether logs for this content pack have been seen in any Datadog index within the last 72 hours. - #[serde(rename = "logs_seen_from_any_index")] - pub logs_seen_from_any_index: bool, + /// Type-specific details for a content pack state. The set of fields present depends + /// on the content pack's `type`. When Cloud SIEM is inactive for the requesting organization, `onboarding` is returned instead of the content pack's usual type, such as `logs` or `vulnerability`.` + #[serde(rename = "details")] + pub details: crate::datadogV2::model::SecurityMonitoringContentPackStateDetails, /// The current operational status of a content pack. - #[serde(rename = "state")] - pub state: crate::datadogV2::model::SecurityMonitoringContentPackStatus, + #[serde(rename = "status")] + pub status: crate::datadogV2::model::SecurityMonitoringContentPackStatus, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -43,34 +27,17 @@ pub struct SecurityMonitoringContentPackStateAttributes { impl SecurityMonitoringContentPackStateAttributes { pub fn new( - cloud_siem_index_incorrect: bool, - cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, - filters_configured_for_logs: bool, - logs_last_collected: crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, - logs_seen_from_any_index: bool, - state: crate::datadogV2::model::SecurityMonitoringContentPackStatus, + details: crate::datadogV2::model::SecurityMonitoringContentPackStateDetails, + status: crate::datadogV2::model::SecurityMonitoringContentPackStatus, ) -> SecurityMonitoringContentPackStateAttributes { SecurityMonitoringContentPackStateAttributes { - cloud_siem_index_incorrect, - cp_activation, - filters_configured_for_logs, - integration_installed_status: None, - logs_last_collected, - logs_seen_from_any_index, - state, + details, + status, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } - pub fn integration_installed_status( - mut self, - value: crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, - ) -> Self { - self.integration_installed_status = Some(value); - self - } - pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -97,19 +64,10 @@ impl<'de> Deserialize<'de> for SecurityMonitoringContentPackStateAttributes { where M: MapAccess<'a>, { - let mut cloud_siem_index_incorrect: Option = None; - let mut cp_activation: Option< - crate::datadogV2::model::SecurityMonitoringContentPackActivation, - > = None; - let mut filters_configured_for_logs: Option = None; - let mut integration_installed_status: Option< - crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + let mut details: Option< + crate::datadogV2::model::SecurityMonitoringContentPackStateDetails, > = None; - let mut logs_last_collected: Option< - crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, - > = None; - let mut logs_seen_from_any_index: Option = None; - let mut state: Option< + let mut status: Option< crate::datadogV2::model::SecurityMonitoringContentPackStatus, > = None; let mut additional_properties: std::collections::BTreeMap< @@ -120,64 +78,22 @@ impl<'de> Deserialize<'de> for SecurityMonitoringContentPackStateAttributes { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { - "cloud_siem_index_incorrect" => { - cloud_siem_index_incorrect = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cp_activation" => { - cp_activation = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _cp_activation) = cp_activation { - match _cp_activation { - crate::datadogV2::model::SecurityMonitoringContentPackActivation::UnparsedObject(_cp_activation) => { + "details" => { + details = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _details) = details { + match _details { + crate::datadogV2::model::SecurityMonitoringContentPackStateDetails::UnparsedObject(_details) => { _unparsed = true; }, _ => {} } } } - "filters_configured_for_logs" => { - filters_configured_for_logs = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "integration_installed_status" => { - if v.is_null() { - continue; - } - integration_installed_status = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _integration_installed_status) = - integration_installed_status - { - match _integration_installed_status { - crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus::UnparsedObject(_integration_installed_status) => { - _unparsed = true; - }, - _ => {} - } - } - } - "logs_last_collected" => { - logs_last_collected = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _logs_last_collected) = logs_last_collected { - match _logs_last_collected { - crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket::UnparsedObject(_logs_last_collected) => { - _unparsed = true; - }, - _ => {} - } - } - } - "logs_seen_from_any_index" => { - logs_seen_from_any_index = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "state" => { - state = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _state) = state { - match _state { - crate::datadogV2::model::SecurityMonitoringContentPackStatus::UnparsedObject(_state) => { + "status" => { + status = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _status) = status { + match _status { + crate::datadogV2::model::SecurityMonitoringContentPackStatus::UnparsedObject(_status) => { _unparsed = true; }, _ => {} @@ -191,26 +107,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringContentPackStateAttributes { } } } - let cloud_siem_index_incorrect = cloud_siem_index_incorrect - .ok_or_else(|| M::Error::missing_field("cloud_siem_index_incorrect"))?; - let cp_activation = - cp_activation.ok_or_else(|| M::Error::missing_field("cp_activation"))?; - let filters_configured_for_logs = filters_configured_for_logs - .ok_or_else(|| M::Error::missing_field("filters_configured_for_logs"))?; - let logs_last_collected = logs_last_collected - .ok_or_else(|| M::Error::missing_field("logs_last_collected"))?; - let logs_seen_from_any_index = logs_seen_from_any_index - .ok_or_else(|| M::Error::missing_field("logs_seen_from_any_index"))?; - let state = state.ok_or_else(|| M::Error::missing_field("state"))?; + let details = details.ok_or_else(|| M::Error::missing_field("details"))?; + let status = status.ok_or_else(|| M::Error::missing_field("status"))?; let content = SecurityMonitoringContentPackStateAttributes { - cloud_siem_index_incorrect, - cp_activation, - filters_configured_for_logs, - integration_installed_status, - logs_last_collected, - logs_seen_from_any_index, - state, + details, + status, additional_properties, _unparsed, }; diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_state_data.rs b/src/datadogV2/model/model_security_monitoring_content_pack_state_data.rs index fd0ec5f46a..a96eb8fb6a 100644 --- a/src/datadogV2/model/model_security_monitoring_content_pack_state_data.rs +++ b/src/datadogV2/model/model_security_monitoring_content_pack_state_data.rs @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct SecurityMonitoringContentPackStateData { - /// Attributes of a content pack state + /// Attributes of a content pack state. #[serde(rename = "attributes")] pub attributes: crate::datadogV2::model::SecurityMonitoringContentPackStateAttributes, /// The content pack identifier. diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_state_details.rs b/src/datadogV2/model/model_security_monitoring_content_pack_state_details.rs new file mode 100644 index 0000000000..d1a6a47ee7 --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_state_details.rs @@ -0,0 +1,103 @@ +// 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}; + +/// Type-specific details for a content pack state. The set of fields present depends +/// on the content pack's `type`. When Cloud SIEM is inactive for the requesting organization, `onboarding` is returned instead of the content pack's usual type, such as `logs` or `vulnerability`.` +#[non_exhaustive] +#[derive(Clone, Debug, PartialEq, Serialize)] +#[serde(untagged)] +pub enum SecurityMonitoringContentPackStateDetails { + SecurityMonitoringContentPackLogsDetails( + Box, + ), + SecurityMonitoringContentPackThreatIntelDetails( + Box, + ), + SecurityMonitoringContentPackEntityDetails( + Box, + ), + SecurityMonitoringContentPackAuditDetails( + Box, + ), + SecurityMonitoringContentPackAppSecDetails( + Box, + ), + SecurityMonitoringContentPackVulnerabilityDetails( + Box, + ), + SecurityMonitoringContentPackOnboardingDetails( + Box, + ), + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackStateDetails { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let value: serde_json::Value = Deserialize::deserialize(deserializer)?; + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(SecurityMonitoringContentPackStateDetails::SecurityMonitoringContentPackLogsDetails(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(SecurityMonitoringContentPackStateDetails::SecurityMonitoringContentPackThreatIntelDetails(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(SecurityMonitoringContentPackStateDetails::SecurityMonitoringContentPackEntityDetails(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(SecurityMonitoringContentPackStateDetails::SecurityMonitoringContentPackAuditDetails(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(SecurityMonitoringContentPackStateDetails::SecurityMonitoringContentPackAppSecDetails(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(SecurityMonitoringContentPackStateDetails::SecurityMonitoringContentPackVulnerabilityDetails(_v)); + } + } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(SecurityMonitoringContentPackStateDetails::SecurityMonitoringContentPackOnboardingDetails(_v)); + } + } + + return Ok(SecurityMonitoringContentPackStateDetails::UnparsedObject( + crate::datadog::UnparsedObject { value }, + )); + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_state_meta.rs b/src/datadogV2/model/model_security_monitoring_content_pack_state_meta.rs index 085a0b0c96..28bae24e37 100644 --- a/src/datadogV2/model/model_security_monitoring_content_pack_state_meta.rs +++ b/src/datadogV2/model/model_security_monitoring_content_pack_state_meta.rs @@ -6,14 +6,17 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Metadata for content pack states +/// Metadata for content pack states. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct SecurityMonitoringContentPackStateMeta { - /// Whether the cloud SIEM index configuration is incorrect at the organization level + /// Whether the Cloud SIEM index configuration is incorrect for the organization. #[serde(rename = "cloud_siem_index_incorrect")] pub cloud_siem_index_incorrect: bool, + /// The number of months that standard logs are retained for organizations on the standalone_indexed` pricing model. This field is omitted for other pricing models. + #[serde(rename = "retention_months")] + pub retention_months: Option, /// The Cloud SIEM pricing model (SKU) for the organization. #[serde(rename = "sku")] pub sku: crate::datadogV2::model::SecurityMonitoringSKU, @@ -31,12 +34,18 @@ impl SecurityMonitoringContentPackStateMeta { ) -> SecurityMonitoringContentPackStateMeta { SecurityMonitoringContentPackStateMeta { cloud_siem_index_incorrect, + retention_months: None, sku, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } + pub fn retention_months(mut self, value: i32) -> Self { + self.retention_months = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -64,6 +73,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringContentPackStateMeta { M: MapAccess<'a>, { let mut cloud_siem_index_incorrect: Option = None; + let mut retention_months: Option = None; let mut sku: Option = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -77,6 +87,13 @@ impl<'de> Deserialize<'de> for SecurityMonitoringContentPackStateMeta { cloud_siem_index_incorrect = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "retention_months" => { + if v.is_null() { + continue; + } + retention_months = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "sku" => { sku = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _sku) = sku { @@ -101,6 +118,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringContentPackStateMeta { let content = SecurityMonitoringContentPackStateMeta { cloud_siem_index_incorrect, + retention_months, sku, additional_properties, _unparsed, diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_states_response.rs b/src/datadogV2/model/model_security_monitoring_content_pack_states_response.rs index 927a02045d..9b64173a3b 100644 --- a/src/datadogV2/model/model_security_monitoring_content_pack_states_response.rs +++ b/src/datadogV2/model/model_security_monitoring_content_pack_states_response.rs @@ -14,7 +14,7 @@ pub struct SecurityMonitoringContentPackStatesResponse { /// Array of content pack states. #[serde(rename = "data")] pub data: Vec, - /// Metadata for content pack states + /// Metadata for content pack states. #[serde(rename = "meta")] pub meta: crate::datadogV2::model::SecurityMonitoringContentPackStateMeta, #[serde(flatten)] diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_status.rs b/src/datadogV2/model/model_security_monitoring_content_pack_status.rs index 3f02d95c49..1214f9c8c7 100644 --- a/src/datadogV2/model/model_security_monitoring_content_pack_status.rs +++ b/src/datadogV2/model/model_security_monitoring_content_pack_status.rs @@ -13,6 +13,7 @@ pub enum SecurityMonitoringContentPackStatus { ACTIVE, WARNING, BROKEN, + NOT_CONFIGURED, UnparsedObject(crate::datadog::UnparsedObject), } @@ -25,6 +26,7 @@ impl ToString for SecurityMonitoringContentPackStatus { Self::ACTIVE => String::from("active"), Self::WARNING => String::from("warning"), Self::BROKEN => String::from("broken"), + Self::NOT_CONFIGURED => String::from("not_configured"), Self::UnparsedObject(v) => v.value.to_string(), } } @@ -55,6 +57,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringContentPackStatus { "active" => Self::ACTIVE, "warning" => Self::WARNING, "broken" => Self::BROKEN, + "not_configured" => Self::NOT_CONFIGURED, _ => Self::UnparsedObject(crate::datadog::UnparsedObject { value: serde_json::Value::String(s.into()), }), diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_threat_intel_details.rs b/src/datadogV2/model/model_security_monitoring_content_pack_threat_intel_details.rs new file mode 100644 index 0000000000..2d545849b8 --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_threat_intel_details.rs @@ -0,0 +1,176 @@ +// 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::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Details for a threat intelligence content pack. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SecurityMonitoringContentPackThreatIntelDetails { + /// The activation status of a content pack. + #[serde(rename = "cp_activation")] + pub cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, + /// Timestamp bucket indicating when logs were last collected. + #[serde(rename = "data_last_seen")] + pub data_last_seen: crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + /// The installation status of the related integration. + #[serde(rename = "integration_installed_status")] + pub integration_installed_status: + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + /// Type for threat intelligence content pack details. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::SecurityMonitoringContentPackThreatIntelDetailsType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SecurityMonitoringContentPackThreatIntelDetails { + pub fn new( + cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, + data_last_seen: crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + integration_installed_status: crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + type_: crate::datadogV2::model::SecurityMonitoringContentPackThreatIntelDetailsType, + ) -> SecurityMonitoringContentPackThreatIntelDetails { + SecurityMonitoringContentPackThreatIntelDetails { + cp_activation, + data_last_seen, + integration_installed_status, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackThreatIntelDetails { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SecurityMonitoringContentPackThreatIntelDetailsVisitor; + impl<'a> Visitor<'a> for SecurityMonitoringContentPackThreatIntelDetailsVisitor { + type Value = SecurityMonitoringContentPackThreatIntelDetails; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut cp_activation: Option< + crate::datadogV2::model::SecurityMonitoringContentPackActivation, + > = None; + let mut data_last_seen: Option< + crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + > = None; + let mut integration_installed_status: Option< + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + > = None; + let mut type_: Option< + crate::datadogV2::model::SecurityMonitoringContentPackThreatIntelDetailsType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "cp_activation" => { + cp_activation = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _cp_activation) = cp_activation { + match _cp_activation { + crate::datadogV2::model::SecurityMonitoringContentPackActivation::UnparsedObject(_cp_activation) => { + _unparsed = true; + }, + _ => {} + } + } + } + "data_last_seen" => { + data_last_seen = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _data_last_seen) = data_last_seen { + match _data_last_seen { + crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket::UnparsedObject(_data_last_seen) => { + _unparsed = true; + }, + _ => {} + } + } + } + "integration_installed_status" => { + integration_installed_status = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _integration_installed_status) = + integration_installed_status + { + match _integration_installed_status { + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus::UnparsedObject(_integration_installed_status) => { + _unparsed = true; + }, + _ => {} + } + } + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::SecurityMonitoringContentPackThreatIntelDetailsType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let cp_activation = + cp_activation.ok_or_else(|| M::Error::missing_field("cp_activation"))?; + let data_last_seen = + data_last_seen.ok_or_else(|| M::Error::missing_field("data_last_seen"))?; + let integration_installed_status = integration_installed_status + .ok_or_else(|| M::Error::missing_field("integration_installed_status"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = SecurityMonitoringContentPackThreatIntelDetails { + cp_activation, + data_last_seen, + integration_installed_status, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SecurityMonitoringContentPackThreatIntelDetailsVisitor) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_threat_intel_details_type.rs b/src/datadogV2/model/model_security_monitoring_content_pack_threat_intel_details_type.rs new file mode 100644 index 0000000000..79a99bf0c8 --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_threat_intel_details_type.rs @@ -0,0 +1,48 @@ +// 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 SecurityMonitoringContentPackThreatIntelDetailsType { + THREAT_INTEL, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for SecurityMonitoringContentPackThreatIntelDetailsType { + fn to_string(&self) -> String { + match self { + Self::THREAT_INTEL => String::from("threat_intel"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for SecurityMonitoringContentPackThreatIntelDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackThreatIntelDetailsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "threat_intel" => Self::THREAT_INTEL, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_vulnerability_details.rs b/src/datadogV2/model/model_security_monitoring_content_pack_vulnerability_details.rs new file mode 100644 index 0000000000..b0ff89936b --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_vulnerability_details.rs @@ -0,0 +1,176 @@ +// 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::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Details for a vulnerability content pack. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SecurityMonitoringContentPackVulnerabilityDetails { + /// The activation status of a content pack. + #[serde(rename = "cp_activation")] + pub cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, + /// Timestamp bucket indicating when logs were last collected. + #[serde(rename = "data_last_seen")] + pub data_last_seen: crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + /// The installation status of the related integration. + #[serde(rename = "integration_installed_status")] + pub integration_installed_status: + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + /// Type for vulnerability content pack details. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::SecurityMonitoringContentPackVulnerabilityDetailsType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SecurityMonitoringContentPackVulnerabilityDetails { + pub fn new( + cp_activation: crate::datadogV2::model::SecurityMonitoringContentPackActivation, + data_last_seen: crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + integration_installed_status: crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + type_: crate::datadogV2::model::SecurityMonitoringContentPackVulnerabilityDetailsType, + ) -> SecurityMonitoringContentPackVulnerabilityDetails { + SecurityMonitoringContentPackVulnerabilityDetails { + cp_activation, + data_last_seen, + integration_installed_status, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackVulnerabilityDetails { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SecurityMonitoringContentPackVulnerabilityDetailsVisitor; + impl<'a> Visitor<'a> for SecurityMonitoringContentPackVulnerabilityDetailsVisitor { + type Value = SecurityMonitoringContentPackVulnerabilityDetails; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut cp_activation: Option< + crate::datadogV2::model::SecurityMonitoringContentPackActivation, + > = None; + let mut data_last_seen: Option< + crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket, + > = None; + let mut integration_installed_status: Option< + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus, + > = None; + let mut type_: Option< + crate::datadogV2::model::SecurityMonitoringContentPackVulnerabilityDetailsType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "cp_activation" => { + cp_activation = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _cp_activation) = cp_activation { + match _cp_activation { + crate::datadogV2::model::SecurityMonitoringContentPackActivation::UnparsedObject(_cp_activation) => { + _unparsed = true; + }, + _ => {} + } + } + } + "data_last_seen" => { + data_last_seen = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _data_last_seen) = data_last_seen { + match _data_last_seen { + crate::datadogV2::model::SecurityMonitoringContentPackTimestampBucket::UnparsedObject(_data_last_seen) => { + _unparsed = true; + }, + _ => {} + } + } + } + "integration_installed_status" => { + integration_installed_status = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _integration_installed_status) = + integration_installed_status + { + match _integration_installed_status { + crate::datadogV2::model::SecurityMonitoringContentPackIntegrationStatus::UnparsedObject(_integration_installed_status) => { + _unparsed = true; + }, + _ => {} + } + } + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::SecurityMonitoringContentPackVulnerabilityDetailsType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let cp_activation = + cp_activation.ok_or_else(|| M::Error::missing_field("cp_activation"))?; + let data_last_seen = + data_last_seen.ok_or_else(|| M::Error::missing_field("data_last_seen"))?; + let integration_installed_status = integration_installed_status + .ok_or_else(|| M::Error::missing_field("integration_installed_status"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = SecurityMonitoringContentPackVulnerabilityDetails { + cp_activation, + data_last_seen, + integration_installed_status, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SecurityMonitoringContentPackVulnerabilityDetailsVisitor) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_content_pack_vulnerability_details_type.rs b/src/datadogV2/model/model_security_monitoring_content_pack_vulnerability_details_type.rs new file mode 100644 index 0000000000..9c04e66d10 --- /dev/null +++ b/src/datadogV2/model/model_security_monitoring_content_pack_vulnerability_details_type.rs @@ -0,0 +1,48 @@ +// 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 SecurityMonitoringContentPackVulnerabilityDetailsType { + VULNERABILITY, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for SecurityMonitoringContentPackVulnerabilityDetailsType { + fn to_string(&self) -> String { + match self { + Self::VULNERABILITY => String::from("vulnerability"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for SecurityMonitoringContentPackVulnerabilityDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for SecurityMonitoringContentPackVulnerabilityDetailsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "vulnerability" => Self::VULNERABILITY, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_security_monitoring_sku.rs b/src/datadogV2/model/model_security_monitoring_sku.rs index f721d89261..76632f7adf 100644 --- a/src/datadogV2/model/model_security_monitoring_sku.rs +++ b/src/datadogV2/model/model_security_monitoring_sku.rs @@ -10,6 +10,8 @@ pub enum SecurityMonitoringSKU { PER_GB_ANALYZED, PER_EVENT_IN_SIEM_INDEX_2023, ADD_ON_2024, + STANDALONE_INDEXED, + UNKNOWN, UnparsedObject(crate::datadog::UnparsedObject), } @@ -19,6 +21,8 @@ impl ToString for SecurityMonitoringSKU { Self::PER_GB_ANALYZED => String::from("per_gb_analyzed"), Self::PER_EVENT_IN_SIEM_INDEX_2023 => String::from("per_event_in_siem_index_2023"), Self::ADD_ON_2024 => String::from("add_on_2024"), + Self::STANDALONE_INDEXED => String::from("standalone_indexed"), + Self::UNKNOWN => String::from("unknown"), Self::UnparsedObject(v) => v.value.to_string(), } } @@ -46,6 +50,8 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSKU { "per_gb_analyzed" => Self::PER_GB_ANALYZED, "per_event_in_siem_index_2023" => Self::PER_EVENT_IN_SIEM_INDEX_2023, "add_on_2024" => Self::ADD_ON_2024, + "standalone_indexed" => Self::STANDALONE_INDEXED, + "unknown" => Self::UNKNOWN, _ => Self::UnparsedObject(crate::datadog::UnparsedObject { value: serde_json::Value::String(s.into()), }),