#![allow(
dead_code,
clippy::too_many_lines,
clippy::unused_async,
clippy::implicit_clone
)]
use cortexa_aws_core::client::AwsClient;
use cortexa_aws_core::transport::{DefaultRuntime, Runtime};
use cortexa_aws_errors::AwsError;
use super::types::*;
#[derive(Debug)]
#[repr(transparent)]
pub struct GeneratedClient<R: Runtime = DefaultRuntime> {
client: AwsClient<R>,
}
impl<R: Runtime> Clone for GeneratedClient<R> {
fn clone(&self) -> Self {
Self {
client: self.client.clone(),
}
}
}
impl<R: Runtime> GeneratedClient<R> {
#[must_use]
pub const fn new(client: AwsClient<R>) -> Self {
Self { client }
}
#[must_use]
pub const fn inner(&self) -> &AwsClient<R> {
&self.client
}
pub async fn put_audit_events(
&self,
input: &PutAuditEventsRequest,
) -> Result<PutAuditEventsResponse, AwsError> {
let path = "/PutAuditEvents".to_owned();
let mut query_owned: Vec<(&'static str, String)> = Vec::new();
if let Some(v) = input.channel_arn.as_ref() {
query_owned.push(("channelArn", v.to_string()));
}
if let Some(v) = input.external_id.as_ref() {
query_owned.push(("externalId", v.to_string()));
}
let query_refs: Vec<(&str, &str)> =
query_owned.iter().map(|(k, v)| (*k, v.as_str())).collect();
cortexa_aws_protocols::invoke::invoke_rest_json(
&self.client,
"cloudtrail-data",
"cloudtrail-data",
None,
cortexa_aws_core::transport::HttpMethod::Post,
&path,
&query_refs,
"PutAuditEvents",
Some(input),
)
.await
}
}