Skip to content

Commit d9c1fe1

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit de2517ad of spec repo
1 parent 0b522f4 commit d9c1fe1

12 files changed

+648
-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-02 12:38:40.410886",
8-
"spec_repo_commit": "4fd1c189"
7+
"regenerated": "2025-07-02 16:34:47.090537",
8+
"spec_repo_commit": "de2517ad"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-07-02 12:38:40.427530",
13-
"spec_repo_commit": "4fd1c189"
12+
"regenerated": "2025-07-02 16:34:47.107437",
13+
"spec_repo_commit": "de2517ad"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,54 @@ components:
15361536
- type
15371537
- credentials
15381538
type: object
1539+
AWSIntegrationIamPermissionsResponse:
1540+
description: AWS Integration IAM Permissions response body.
1541+
properties:
1542+
data:
1543+
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseData'
1544+
required:
1545+
- data
1546+
type: object
1547+
AWSIntegrationIamPermissionsResponseAttributes:
1548+
description: AWS Integration IAM Permissions response attributes.
1549+
properties:
1550+
permissions:
1551+
description: List of AWS IAM permissions required for the integration.
1552+
example:
1553+
- account:GetContactInformation
1554+
- amplify:ListApps
1555+
- amplify:ListArtifacts
1556+
- amplify:ListBackendEnvironments
1557+
- amplify:ListBranches
1558+
items:
1559+
example: account:GetContactInformation
1560+
type: string
1561+
type: array
1562+
required:
1563+
- permissions
1564+
type: object
1565+
AWSIntegrationIamPermissionsResponseData:
1566+
description: AWS Integration IAM Permissions response data.
1567+
properties:
1568+
attributes:
1569+
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseAttributes'
1570+
id:
1571+
default: permissions
1572+
description: The `AWSIntegrationIamPermissionsResponseData` `id`.
1573+
example: permissions
1574+
type: string
1575+
type:
1576+
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseDataType'
1577+
type: object
1578+
AWSIntegrationIamPermissionsResponseDataType:
1579+
default: permissions
1580+
description: The `AWSIntegrationIamPermissionsResponseData` `type`.
1581+
enum:
1582+
- permissions
1583+
example: permissions
1584+
type: string
1585+
x-enum-varnames:
1586+
- PERMISSIONS
15391587
AWSIntegrationType:
15401588
description: The definition of `AWSIntegrationType` object.
15411589
enum:
@@ -49519,6 +49567,22 @@ paths:
4951949567
x-unstable: '**Note: This endpoint is in Preview. If you have any feedback,
4952049568

4952149569
contact [Datadog support](https://docs.datadoghq.com/help/).**'
49570+
/api/v2/integration/aws/iam_permissions:
49571+
get:
49572+
description: Get all AWS IAM permissions required for the AWS integration.
49573+
operationId: GetAWSIntegrationIAMPermissions
49574+
responses:
49575+
'200':
49576+
content:
49577+
application/json:
49578+
schema:
49579+
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponse'
49580+
description: AWS IAM Permissions object
49581+
'429':
49582+
$ref: '#/components/responses/TooManyRequestsResponse'
49583+
summary: Get AWS integration IAM permissions
49584+
tags:
49585+
- AWS Integration
4952249586
/api/v2/integration/aws/logs/services:
4952349587
get:
4952449588
description: Get a list of AWS services that can send logs to Datadog.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Get AWS integration IAM permissions returns "AWS IAM Permissions object"
2+
// response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = AWSIntegrationAPI::with_config(configuration);
10+
let resp = api.get_aws_integration_iam_permissions().await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}

src/datadogV2/api/api_aws_integration.rs

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ pub enum GetAWSAccountError {
5959
UnknownValue(serde_json::Value),
6060
}
6161

62+
/// GetAWSIntegrationIAMPermissionsError is a struct for typed errors of method [`AWSIntegrationAPI::get_aws_integration_iam_permissions`]
63+
#[derive(Debug, Clone, Serialize, Deserialize)]
64+
#[serde(untagged)]
65+
pub enum GetAWSIntegrationIAMPermissionsError {
66+
APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
67+
UnknownValue(serde_json::Value),
68+
}
69+
6270
/// ListAWSAccountsError is a struct for typed errors of method [`AWSIntegrationAPI::list_aws_accounts`]
6371
#[derive(Debug, Clone, Serialize, Deserialize)]
6472
#[serde(untagged)]
@@ -640,6 +648,116 @@ impl AWSIntegrationAPI {
640648
}
641649
}
642650

651+
/// Get all AWS IAM permissions required for the AWS integration.
652+
pub async fn get_aws_integration_iam_permissions(
653+
&self,
654+
) -> Result<
655+
crate::datadogV2::model::AWSIntegrationIamPermissionsResponse,
656+
datadog::Error<GetAWSIntegrationIAMPermissionsError>,
657+
> {
658+
match self
659+
.get_aws_integration_iam_permissions_with_http_info()
660+
.await
661+
{
662+
Ok(response_content) => {
663+
if let Some(e) = response_content.entity {
664+
Ok(e)
665+
} else {
666+
Err(datadog::Error::Serde(serde::de::Error::custom(
667+
"response content was None",
668+
)))
669+
}
670+
}
671+
Err(err) => Err(err),
672+
}
673+
}
674+
675+
/// Get all AWS IAM permissions required for the AWS integration.
676+
pub async fn get_aws_integration_iam_permissions_with_http_info(
677+
&self,
678+
) -> Result<
679+
datadog::ResponseContent<crate::datadogV2::model::AWSIntegrationIamPermissionsResponse>,
680+
datadog::Error<GetAWSIntegrationIAMPermissionsError>,
681+
> {
682+
let local_configuration = &self.config;
683+
let operation_id = "v2.get_aws_integration_iam_permissions";
684+
685+
let local_client = &self.client;
686+
687+
let local_uri_str = format!(
688+
"{}/api/v2/integration/aws/iam_permissions",
689+
local_configuration.get_operation_host(operation_id)
690+
);
691+
let mut local_req_builder =
692+
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
693+
694+
// build headers
695+
let mut headers = HeaderMap::new();
696+
headers.insert("Accept", HeaderValue::from_static("application/json"));
697+
698+
// build user agent
699+
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
700+
Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
701+
Err(e) => {
702+
log::warn!("Failed to parse user agent header: {e}, falling back to default");
703+
headers.insert(
704+
reqwest::header::USER_AGENT,
705+
HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
706+
)
707+
}
708+
};
709+
710+
// build auth
711+
if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
712+
headers.insert(
713+
"DD-API-KEY",
714+
HeaderValue::from_str(local_key.key.as_str())
715+
.expect("failed to parse DD-API-KEY header"),
716+
);
717+
};
718+
if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
719+
headers.insert(
720+
"DD-APPLICATION-KEY",
721+
HeaderValue::from_str(local_key.key.as_str())
722+
.expect("failed to parse DD-APPLICATION-KEY header"),
723+
);
724+
};
725+
726+
local_req_builder = local_req_builder.headers(headers);
727+
let local_req = local_req_builder.build()?;
728+
log::debug!("request content: {:?}", local_req.body());
729+
let local_resp = local_client.execute(local_req).await?;
730+
731+
let local_status = local_resp.status();
732+
let local_content = local_resp.text().await?;
733+
log::debug!("response content: {}", local_content);
734+
735+
if !local_status.is_client_error() && !local_status.is_server_error() {
736+
match serde_json::from_str::<
737+
crate::datadogV2::model::AWSIntegrationIamPermissionsResponse,
738+
>(&local_content)
739+
{
740+
Ok(e) => {
741+
return Ok(datadog::ResponseContent {
742+
status: local_status,
743+
content: local_content,
744+
entity: Some(e),
745+
})
746+
}
747+
Err(e) => return Err(datadog::Error::Serde(e)),
748+
};
749+
} else {
750+
let local_entity: Option<GetAWSIntegrationIAMPermissionsError> =
751+
serde_json::from_str(&local_content).ok();
752+
let local_error = datadog::ResponseContent {
753+
status: local_status,
754+
content: local_content,
755+
entity: local_entity,
756+
};
757+
Err(datadog::Error::ResponseError(local_error))
758+
}
759+
}
760+
643761
/// Get a list of AWS Account Integration Configs.
644762
pub async fn list_aws_accounts(
645763
&self,

src/datadogV2/model/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,14 @@ pub mod model_aws_new_external_id_response_attributes;
19161916
pub use self::model_aws_new_external_id_response_attributes::AWSNewExternalIDResponseAttributes;
19171917
pub mod model_aws_new_external_id_response_data_type;
19181918
pub use self::model_aws_new_external_id_response_data_type::AWSNewExternalIDResponseDataType;
1919+
pub mod model_aws_integration_iam_permissions_response;
1920+
pub use self::model_aws_integration_iam_permissions_response::AWSIntegrationIamPermissionsResponse;
1921+
pub mod model_aws_integration_iam_permissions_response_data;
1922+
pub use self::model_aws_integration_iam_permissions_response_data::AWSIntegrationIamPermissionsResponseData;
1923+
pub mod model_aws_integration_iam_permissions_response_attributes;
1924+
pub use self::model_aws_integration_iam_permissions_response_attributes::AWSIntegrationIamPermissionsResponseAttributes;
1925+
pub mod model_aws_integration_iam_permissions_response_data_type;
1926+
pub use self::model_aws_integration_iam_permissions_response_data_type::AWSIntegrationIamPermissionsResponseDataType;
19191927
pub mod model_aws_logs_services_response;
19201928
pub use self::model_aws_logs_services_response::AWSLogsServicesResponse;
19211929
pub mod model_aws_logs_services_response_data;
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
/// AWS Integration IAM Permissions response body.
10+
#[non_exhaustive]
11+
#[skip_serializing_none]
12+
#[derive(Clone, Debug, PartialEq, Serialize)]
13+
pub struct AWSIntegrationIamPermissionsResponse {
14+
/// AWS Integration IAM Permissions response data.
15+
#[serde(rename = "data")]
16+
pub data: crate::datadogV2::model::AWSIntegrationIamPermissionsResponseData,
17+
#[serde(flatten)]
18+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
19+
#[serde(skip)]
20+
#[serde(default)]
21+
pub(crate) _unparsed: bool,
22+
}
23+
24+
impl AWSIntegrationIamPermissionsResponse {
25+
pub fn new(
26+
data: crate::datadogV2::model::AWSIntegrationIamPermissionsResponseData,
27+
) -> AWSIntegrationIamPermissionsResponse {
28+
AWSIntegrationIamPermissionsResponse {
29+
data,
30+
additional_properties: std::collections::BTreeMap::new(),
31+
_unparsed: false,
32+
}
33+
}
34+
35+
pub fn additional_properties(
36+
mut self,
37+
value: std::collections::BTreeMap<String, serde_json::Value>,
38+
) -> Self {
39+
self.additional_properties = value;
40+
self
41+
}
42+
}
43+
44+
impl<'de> Deserialize<'de> for AWSIntegrationIamPermissionsResponse {
45+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
46+
where
47+
D: Deserializer<'de>,
48+
{
49+
struct AWSIntegrationIamPermissionsResponseVisitor;
50+
impl<'a> Visitor<'a> for AWSIntegrationIamPermissionsResponseVisitor {
51+
type Value = AWSIntegrationIamPermissionsResponse;
52+
53+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
54+
f.write_str("a mapping")
55+
}
56+
57+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
58+
where
59+
M: MapAccess<'a>,
60+
{
61+
let mut data: Option<
62+
crate::datadogV2::model::AWSIntegrationIamPermissionsResponseData,
63+
> = None;
64+
let mut additional_properties: std::collections::BTreeMap<
65+
String,
66+
serde_json::Value,
67+
> = std::collections::BTreeMap::new();
68+
let mut _unparsed = false;
69+
70+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
71+
match k.as_str() {
72+
"data" => {
73+
data = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
74+
}
75+
&_ => {
76+
if let Ok(value) = serde_json::from_value(v.clone()) {
77+
additional_properties.insert(k, value);
78+
}
79+
}
80+
}
81+
}
82+
let data = data.ok_or_else(|| M::Error::missing_field("data"))?;
83+
84+
let content = AWSIntegrationIamPermissionsResponse {
85+
data,
86+
additional_properties,
87+
_unparsed,
88+
};
89+
90+
Ok(content)
91+
}
92+
}
93+
94+
deserializer.deserialize_any(AWSIntegrationIamPermissionsResponseVisitor)
95+
}
96+
}

0 commit comments

Comments
 (0)