Skip to content

Commit ef02fe8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit af216d4e of spec repo
1 parent 20dae90 commit ef02fe8

10 files changed

+608
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-07-08 19:08:05.438773",
8-
"spec_repo_commit": "7b042e12"
7+
"regenerated": "2025-07-09 07:40:20.345499",
8+
"spec_repo_commit": "af216d4e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-07-08 19:08:05.457615",
13-
"spec_repo_commit": "7b042e12"
12+
"regenerated": "2025-07-09 07:40:20.361618",
13+
"spec_repo_commit": "af216d4e"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10668,6 +10668,7 @@ components:
1066810668
- $ref: '#/components/schemas/CustomDestinationForwardDestinationSplunk'
1066910669
- $ref: '#/components/schemas/CustomDestinationForwardDestinationElasticsearch'
1067010670
- $ref: '#/components/schemas/CustomDestinationForwardDestinationMicrosoftSentinel'
10671+
- $ref: '#/components/schemas/CustomDestinationForwardDestinationGoogleSecurityOperations'
1067110672
CustomDestinationForwardDestinationElasticsearch:
1067210673
description: The Elasticsearch destination.
1067310674
properties:
@@ -10725,6 +10726,42 @@ components:
1072510726
type: string
1072610727
x-enum-varnames:
1072710728
- ELASTICSEARCH
10729+
CustomDestinationForwardDestinationGoogleSecurityOperations:
10730+
description: The Google Security Operations destination.
10731+
properties:
10732+
auth:
10733+
$ref: '#/components/schemas/CustomDestinationGoogleSecurityOperationsDestinationAuth'
10734+
customer_id:
10735+
description: The customer ID of the Google Security Operations account.
10736+
example: 123-456-7890
10737+
type: string
10738+
namespace:
10739+
description: The namespace of the Google Security Operations account.
10740+
example: google-security-operations-namespace
10741+
type: string
10742+
regional_endpoint:
10743+
description: The `CustomDestinationForwardDestinationGoogleSecurityOperations`
10744+
`regional_endpoint`.
10745+
example: https://malachiteingestion-pa.googleapis.com
10746+
type: string
10747+
type:
10748+
$ref: '#/components/schemas/CustomDestinationForwardDestinationGoogleSecurityOperationsType'
10749+
required:
10750+
- type
10751+
- customer_id
10752+
- regional_endpoint
10753+
- namespace
10754+
- auth
10755+
type: object
10756+
CustomDestinationForwardDestinationGoogleSecurityOperationsType:
10757+
default: google_security_operations
10758+
description: Type of the Google Security Operations destination.
10759+
enum:
10760+
- google_security_operations
10761+
example: google_security_operations
10762+
type: string
10763+
x-enum-varnames:
10764+
- GOOGLE_SECURITY_OPERATIONS
1072810765
CustomDestinationForwardDestinationHttp:
1072910766
description: The HTTP destination.
1073010767
properties:
@@ -10826,6 +10863,55 @@ components:
1082610863
type: string
1082710864
x-enum-varnames:
1082810865
- SPLUNK_HEC
10866+
CustomDestinationGoogleSecurityOperationsDestinationAuth:
10867+
description: Google Security Operations destination authentication.
10868+
properties:
10869+
client_email:
10870+
description: The Google Security Operations client email address.
10871+
10872+
type: string
10873+
client_id:
10874+
description: The Google Security Operations client ID. This field is not
10875+
returned by the API.
10876+
example: def123456
10877+
type: string
10878+
writeOnly: true
10879+
private_key:
10880+
description: The Google Security Operations private key. This field is not
10881+
returned by the API.
10882+
example: '-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBK...\n-----END
10883+
PRIVATE KEY-----\n'
10884+
type: string
10885+
writeOnly: true
10886+
private_key_id:
10887+
description: The Google Security Operations private key ID. This field is
10888+
not returned by the API.
10889+
example: abc12345678
10890+
type: string
10891+
writeOnly: true
10892+
project_id:
10893+
description: The Google Security Operations project ID.
10894+
example: gcp-project
10895+
type: string
10896+
type:
10897+
$ref: '#/components/schemas/CustomDestinationGoogleSecurityOperationsDestinationAuthType'
10898+
required:
10899+
- type
10900+
- project_id
10901+
- private_key_id
10902+
- client_email
10903+
- client_id
10904+
- private_key
10905+
type: object
10906+
CustomDestinationGoogleSecurityOperationsDestinationAuthType:
10907+
default: gcp_private_key
10908+
description: Type of the Google Security Operations destination authentication.
10909+
enum:
10910+
- gcp_private_key
10911+
example: gcp_private_key
10912+
type: string
10913+
x-enum-varnames:
10914+
- GCP_PRIVATE_KEY
1082910915
CustomDestinationHttpDestinationAuth:
1083010916
description: Authentication method of the HTTP requests.
1083110917
oneOf:
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Create a Google Security Operations custom destination returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;
4+
use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType;
5+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequest;
6+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestAttributes;
7+
use datadog_api_client::datadogV2::model::CustomDestinationCreateRequestDefinition;
8+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestination;
9+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationGoogleSecurityOperations;
10+
use datadog_api_client::datadogV2::model::CustomDestinationForwardDestinationGoogleSecurityOperationsType;
11+
use datadog_api_client::datadogV2::model::CustomDestinationGoogleSecurityOperationsDestinationAuth;
12+
use datadog_api_client::datadogV2::model::CustomDestinationGoogleSecurityOperationsDestinationAuthType;
13+
use datadog_api_client::datadogV2::model::CustomDestinationType;
14+
15+
#[tokio::main]
16+
async fn main() {
17+
let body =
18+
CustomDestinationCreateRequest
19+
::new().data(
20+
CustomDestinationCreateRequestDefinition::new(
21+
CustomDestinationCreateRequestAttributes::new(
22+
CustomDestinationForwardDestination::CustomDestinationForwardDestinationGoogleSecurityOperations(
23+
Box::new(
24+
CustomDestinationForwardDestinationGoogleSecurityOperations::new(
25+
CustomDestinationGoogleSecurityOperationsDestinationAuth::new(
26+
"[email protected]".to_string(),
27+
"def123456".to_string(),
28+
r#"-----BEGIN PRIVATE KEY-----
29+
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBK...
30+
-----END PRIVATE KEY-----
31+
"#.to_string(),
32+
"abc12345678".to_string(),
33+
"gcp-project".to_string(),
34+
CustomDestinationGoogleSecurityOperationsDestinationAuthType::GCP_PRIVATE_KEY,
35+
),
36+
"123-456-7890".to_string(),
37+
"google-security-operations-namespace".to_string(),
38+
"https://malachiteingestion-pa.googleapis.com".to_string(),
39+
CustomDestinationForwardDestinationGoogleSecurityOperationsType
40+
::GOOGLE_SECURITY_OPERATIONS,
41+
),
42+
),
43+
),
44+
"Nginx logs".to_string(),
45+
)
46+
.enabled(false)
47+
.forward_tags(false)
48+
.forward_tags_restriction_list(vec!["datacenter".to_string(), "host".to_string()])
49+
.forward_tags_restriction_list_type(CustomDestinationAttributeTagsRestrictionListType::ALLOW_LIST)
50+
.query("source:nginx".to_string()),
51+
CustomDestinationType::CUSTOM_DESTINATION,
52+
),
53+
);
54+
let configuration = datadog::Configuration::new();
55+
let api = LogsCustomDestinationsAPI::with_config(configuration);
56+
let resp = api.create_logs_custom_destination(body).await;
57+
if let Ok(value) = resp {
58+
println!("{:#?}", value);
59+
} else {
60+
println!("{:#?}", resp.unwrap_err());
61+
}
62+
}

src/datadogV2/model/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,6 +2360,14 @@ pub mod model_custom_destination_forward_destination_microsoft_sentinel;
23602360
pub use self::model_custom_destination_forward_destination_microsoft_sentinel::CustomDestinationForwardDestinationMicrosoftSentinel;
23612361
pub mod model_custom_destination_forward_destination_microsoft_sentinel_type;
23622362
pub use self::model_custom_destination_forward_destination_microsoft_sentinel_type::CustomDestinationForwardDestinationMicrosoftSentinelType;
2363+
pub mod model_custom_destination_forward_destination_google_security_operations;
2364+
pub use self::model_custom_destination_forward_destination_google_security_operations::CustomDestinationForwardDestinationGoogleSecurityOperations;
2365+
pub mod model_custom_destination_google_security_operations_destination_auth;
2366+
pub use self::model_custom_destination_google_security_operations_destination_auth::CustomDestinationGoogleSecurityOperationsDestinationAuth;
2367+
pub mod model_custom_destination_google_security_operations_destination_auth_type;
2368+
pub use self::model_custom_destination_google_security_operations_destination_auth_type::CustomDestinationGoogleSecurityOperationsDestinationAuthType;
2369+
pub mod model_custom_destination_forward_destination_google_security_operations_type;
2370+
pub use self::model_custom_destination_forward_destination_google_security_operations_type::CustomDestinationForwardDestinationGoogleSecurityOperationsType;
23632371
pub mod model_custom_destination_forward_destination;
23642372
pub use self::model_custom_destination_forward_destination::CustomDestinationForwardDestination;
23652373
pub mod model_custom_destination_response;

src/datadogV2/model/model_custom_destination_forward_destination.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ pub enum CustomDestinationForwardDestination {
2020
CustomDestinationForwardDestinationMicrosoftSentinel(
2121
Box<crate::datadogV2::model::CustomDestinationForwardDestinationMicrosoftSentinel>,
2222
),
23+
CustomDestinationForwardDestinationGoogleSecurityOperations(
24+
Box<crate::datadogV2::model::CustomDestinationForwardDestinationGoogleSecurityOperations>,
25+
),
2326
UnparsedObject(crate::datadog::UnparsedObject),
2427
}
2528

@@ -69,6 +72,11 @@ impl<'de> Deserialize<'de> for CustomDestinationForwardDestination {
6972
return Ok(CustomDestinationForwardDestination::CustomDestinationForwardDestinationMicrosoftSentinel(_v));
7073
}
7174
}
75+
if let Ok(_v) = serde_json::from_value::<Box<crate::datadogV2::model::CustomDestinationForwardDestinationGoogleSecurityOperations>>(value.clone()) {
76+
if !_v._unparsed {
77+
return Ok(CustomDestinationForwardDestination::CustomDestinationForwardDestinationGoogleSecurityOperations(_v));
78+
}
79+
}
7280

7381
return Ok(CustomDestinationForwardDestination::UnparsedObject(
7482
crate::datadog::UnparsedObject { value },
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
use serde::de::{Error, MapAccess, Visitor};
5+
use serde::{Deserialize, Deserializer, Serialize};
6+
use serde_with::skip_serializing_none;
7+
use std::fmt::{self, Formatter};
8+
9+
/// The Google Security Operations destination.
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct CustomDestinationForwardDestinationGoogleSecurityOperations {
14+
/// Google Security Operations destination authentication.
15+
#[serde(rename = "auth")]
16+
pub auth: crate::datadogV2::model::CustomDestinationGoogleSecurityOperationsDestinationAuth,
17+
/// The customer ID of the Google Security Operations account.
18+
#[serde(rename = "customer_id")]
19+
pub customer_id: String,
20+
/// The namespace of the Google Security Operations account.
21+
#[serde(rename = "namespace")]
22+
pub namespace: String,
23+
/// The `CustomDestinationForwardDestinationGoogleSecurityOperations` `regional_endpoint`.
24+
#[serde(rename = "regional_endpoint")]
25+
pub regional_endpoint: String,
26+
/// Type of the Google Security Operations destination.
27+
#[serde(rename = "type")]
28+
pub type_:
29+
crate::datadogV2::model::CustomDestinationForwardDestinationGoogleSecurityOperationsType,
30+
#[serde(flatten)]
31+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
32+
#[serde(skip)]
33+
#[serde(default)]
34+
pub(crate) _unparsed: bool,
35+
}
36+
37+
impl CustomDestinationForwardDestinationGoogleSecurityOperations {
38+
pub fn new(
39+
auth: crate::datadogV2::model::CustomDestinationGoogleSecurityOperationsDestinationAuth,
40+
customer_id: String,
41+
namespace: String,
42+
regional_endpoint: String,
43+
type_: crate::datadogV2::model::CustomDestinationForwardDestinationGoogleSecurityOperationsType,
44+
) -> CustomDestinationForwardDestinationGoogleSecurityOperations {
45+
CustomDestinationForwardDestinationGoogleSecurityOperations {
46+
auth,
47+
customer_id,
48+
namespace,
49+
regional_endpoint,
50+
type_,
51+
additional_properties: std::collections::BTreeMap::new(),
52+
_unparsed: false,
53+
}
54+
}
55+
56+
pub fn additional_properties(
57+
mut self,
58+
value: std::collections::BTreeMap<String, serde_json::Value>,
59+
) -> Self {
60+
self.additional_properties = value;
61+
self
62+
}
63+
}
64+
65+
impl<'de> Deserialize<'de> for CustomDestinationForwardDestinationGoogleSecurityOperations {
66+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
67+
where
68+
D: Deserializer<'de>,
69+
{
70+
struct CustomDestinationForwardDestinationGoogleSecurityOperationsVisitor;
71+
impl<'a> Visitor<'a> for CustomDestinationForwardDestinationGoogleSecurityOperationsVisitor {
72+
type Value = CustomDestinationForwardDestinationGoogleSecurityOperations;
73+
74+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
75+
f.write_str("a mapping")
76+
}
77+
78+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
79+
where
80+
M: MapAccess<'a>,
81+
{
82+
let mut auth: Option<crate::datadogV2::model::CustomDestinationGoogleSecurityOperationsDestinationAuth> = None;
83+
let mut customer_id: Option<String> = None;
84+
let mut namespace: Option<String> = None;
85+
let mut regional_endpoint: Option<String> = None;
86+
let mut type_: Option<crate::datadogV2::model::CustomDestinationForwardDestinationGoogleSecurityOperationsType> = None;
87+
let mut additional_properties: std::collections::BTreeMap<
88+
String,
89+
serde_json::Value,
90+
> = std::collections::BTreeMap::new();
91+
let mut _unparsed = false;
92+
93+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
94+
match k.as_str() {
95+
"auth" => {
96+
auth = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
97+
}
98+
"customer_id" => {
99+
customer_id =
100+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
101+
}
102+
"namespace" => {
103+
namespace = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
104+
}
105+
"regional_endpoint" => {
106+
regional_endpoint =
107+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
108+
}
109+
"type" => {
110+
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
111+
if let Some(ref _type_) = type_ {
112+
match _type_ {
113+
crate::datadogV2::model::CustomDestinationForwardDestinationGoogleSecurityOperationsType::UnparsedObject(_type_) => {
114+
_unparsed = true;
115+
},
116+
_ => {}
117+
}
118+
}
119+
}
120+
&_ => {
121+
if let Ok(value) = serde_json::from_value(v.clone()) {
122+
additional_properties.insert(k, value);
123+
}
124+
}
125+
}
126+
}
127+
let auth = auth.ok_or_else(|| M::Error::missing_field("auth"))?;
128+
let customer_id =
129+
customer_id.ok_or_else(|| M::Error::missing_field("customer_id"))?;
130+
let namespace = namespace.ok_or_else(|| M::Error::missing_field("namespace"))?;
131+
let regional_endpoint = regional_endpoint
132+
.ok_or_else(|| M::Error::missing_field("regional_endpoint"))?;
133+
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
134+
135+
let content = CustomDestinationForwardDestinationGoogleSecurityOperations {
136+
auth,
137+
customer_id,
138+
namespace,
139+
regional_endpoint,
140+
type_,
141+
additional_properties,
142+
_unparsed,
143+
};
144+
145+
Ok(content)
146+
}
147+
}
148+
149+
deserializer
150+
.deserialize_any(CustomDestinationForwardDestinationGoogleSecurityOperationsVisitor)
151+
}
152+
}

0 commit comments

Comments
 (0)