diff --git a/README.md b/README.md index 3e0370be..6ff25c9b 100644 --- a/README.md +++ b/README.md @@ -449,6 +449,80 @@ By default, the log level to emit events is `INFO`. Log at `TRACE` level for mor This project includes Lambda event struct definitions, [`aws_lambda_events`](https://crates.io/crates/aws_lambda_events). This crate can be leveraged to provide strongly-typed Lambda event structs. You can create your own custom event objects and their corresponding structs as well. +### Builder pattern for event responses + +The `aws_lambda_events` crate provides an optional `builders` feature that adds builder pattern support for constructing event responses. This is particularly useful when working with custom context types that don't implement `Default`. + +Enable the builders feature in your `Cargo.toml`: + +```toml +[dependencies] +aws_lambda_events = { version = "*", features = ["builders"] } +``` + +Example with API Gateway custom authorizers: + +```rust +use aws_lambda_events::event::apigw::{ + ApiGatewayV2CustomAuthorizerSimpleResponseBuilder, + ApiGatewayV2CustomAuthorizerV2Request, +}; +use lambda_runtime::{Error, LambdaEvent}; + +struct MyContext { + user_id: String, + permissions: Vec, +} + +async fn handler( + event: LambdaEvent, +) -> Result, Error> { + let context = MyContext { + user_id: "user-123".to_string(), + permissions: vec!["read".to_string()], + }; + + let response = ApiGatewayV2CustomAuthorizerSimpleResponseBuilder::default() + .is_authorized(true) + .context(context) + .build()?; + + Ok(response) +} +``` + +Example with SQS batch responses: + +```rust +use aws_lambda_events::event::sqs::{ + BatchItemFailureBuilder, + SqsBatchResponseBuilder, + SqsEvent, +}; +use lambda_runtime::{Error, LambdaEvent}; + +async fn handler(event: LambdaEvent) -> Result { + let mut failures = Vec::new(); + + for record in event.payload.records { + if let Err(_) = process_record(&record).await { + let failure = BatchItemFailureBuilder::default() + .item_identifier(record.message_id.unwrap()) + .build()?; + failures.push(failure); + } + } + + let response = SqsBatchResponseBuilder::default() + .batch_item_failures(failures) + .build()?; + + Ok(response) +} +``` + +See the [examples directory](https://github.com/aws/aws-lambda-rust-runtime/tree/main/lambda-events/examples) for more builder pattern examples. + ### Custom event objects To serialize and deserialize events and responses, we suggest using the [`serde`](https://github.com/serde-rs/serde) library. To receive custom events, annotate your structure with Serde's macros: diff --git a/lambda-events/Cargo.toml b/lambda-events/Cargo.toml index ae2d948a..3d558786 100644 --- a/lambda-events/Cargo.toml +++ b/lambda-events/Cargo.toml @@ -20,6 +20,7 @@ edition = "2021" base64 = { workspace = true } bytes = { workspace = true, features = ["serde"], optional = true } chrono = { workspace = true, optional = true } +bon = { version = "3", optional = true } flate2 = { version = "1.0.24", optional = true } http = { workspace = true, optional = true } http-body = { workspace = true, optional = true } @@ -126,6 +127,7 @@ documentdb = [] eventbridge = ["chrono", "serde_with"] catch-all-fields = [] +builders = ["bon"] [package.metadata.docs.rs] all-features = true diff --git a/lambda-events/README.md b/lambda-events/README.md index b091916f..b7e58d3d 100644 --- a/lambda-events/README.md +++ b/lambda-events/README.md @@ -27,6 +27,56 @@ This crate divides all Lambda Events into features named after the service that cargo add aws_lambda_events --no-default-features --features apigw,alb ``` +### Builder pattern support + +The crate provides an optional `builders` feature that adds builder pattern support for event types using the [bon](https://crates.io/crates/bon) crate. This enables type-safe, immutable construction of event responses with a clean, ergonomic API. + +Enable the builders feature: + +``` +cargo add aws_lambda_events --features builders +``` + +Example using builders with API Gateway custom authorizers: + +```rust +use aws_lambda_events::event::apigw::{ + ApiGatewayV2CustomAuthorizerSimpleResponse, + ApiGatewayV2CustomAuthorizerV2Request, +}; +use lambda_runtime::{Error, LambdaEvent}; + +// Context type without Default implementation +struct MyContext { + user_id: String, + permissions: Vec, +} + +async fn handler( + event: LambdaEvent, +) -> Result, Error> { + let context = MyContext { + user_id: "user-123".to_string(), + permissions: vec!["read".to_string()], + }; + + let response = ApiGatewayV2CustomAuthorizerSimpleResponse::builder() + .is_authorized(true) + .context(context) + .build(); + + Ok(response) +} +``` + +Key benefits of bon builders: +- **Clean API**: `Struct::builder().field().build()` - no `.unwrap()` or `?` needed +- **Automatic Option handling**: Optional fields don't need to be explicitly set +- **Type safety**: Compile-time validation of required fields +- **Ergonomic**: Minimal configuration required + +See the [examples directory](https://github.com/aws/aws-lambda-rust-runtime/tree/main/lambda-events/examples) for more builder pattern examples. + ## History The AWS Lambda Events crate was created by [Christian Legnitto](https://github.com/LegNeato). Without all his work and dedication, this project could have not been possible. diff --git a/lambda-events/examples/comprehensive-builders.rs b/lambda-events/examples/comprehensive-builders.rs new file mode 100644 index 00000000..0e275c4f --- /dev/null +++ b/lambda-events/examples/comprehensive-builders.rs @@ -0,0 +1,44 @@ +// Example demonstrating builder pattern usage for AWS Lambda events +#[cfg(feature = "builders")] +use aws_lambda_events::event::{ + dynamodb::Event as DynamoDbEvent, kinesis::KinesisEvent, s3::S3Event, + secretsmanager::SecretsManagerSecretRotationEvent, sns::SnsEvent, sqs::SqsEvent, +}; + +#[cfg(feature = "builders")] +fn main() { + // S3 Event - Object storage notifications + let _s3_event = S3Event::builder().records(vec![]).build(); + + // Kinesis Event - Stream processing + let _kinesis_event = KinesisEvent::builder().records(vec![]).build(); + + // DynamoDB Event - Database change streams + let _dynamodb_event = DynamoDbEvent::builder().records(vec![]).build(); + + // SNS Event - Pub/sub messaging + let _sns_event = SnsEvent::builder().records(vec![]).build(); + + // SQS Event - Queue messaging + #[cfg(feature = "catch-all-fields")] + let _sqs_event = SqsEvent::builder() + .records(vec![]) + .other(serde_json::Map::new()) + .build(); + + #[cfg(not(feature = "catch-all-fields"))] + let _sqs_event = SqsEvent::builder().records(vec![]).build(); + + // Secrets Manager Event - Secret rotation + let _secrets_event = SecretsManagerSecretRotationEvent::builder() + .step("createSecret".to_string()) + .secret_id("test-secret".to_string()) + .client_request_token("token-123".to_string()) + .build(); +} + +#[cfg(not(feature = "builders"))] +fn main() { + println!("This example requires the 'builders' feature to be enabled."); + println!("Run with: cargo run --example comprehensive-builders --all-features"); +} diff --git a/lambda-events/examples/lambda-runtime-authorizer-builder.rs b/lambda-events/examples/lambda-runtime-authorizer-builder.rs new file mode 100644 index 00000000..da0ce0c3 --- /dev/null +++ b/lambda-events/examples/lambda-runtime-authorizer-builder.rs @@ -0,0 +1,145 @@ +// Example showing how builders solve the Default trait requirement problem +// when using lambda_runtime with API Gateway custom authorizers +// +// ❌ OLD WAY (with Default requirement): +// #[derive(Default)] +// struct MyContext { +// // Had to use Option just for Default +// some_thing: Option, +// } +// +// let mut output = Response::default(); +// output.is_authorized = true; +// output.context = MyContext { +// some_thing: Some(thing), // ❌ Unnecessary Some() +// }; +// +// ✅ NEW WAY (with Builder pattern): +// struct MyContext { +// // No Option needed! +// some_thing: ThirdPartyThing, +// } +// +// let output = Response::builder() +// .is_authorized(true) +// .context(context) +// .build()?; +// +// Benefits: +// • No Option wrapper for fields that always exist +// • Type-safe construction +// • Works seamlessly with lambda_runtime::LambdaEvent +// • Cleaner, more idiomatic Rust code + +#[cfg(feature = "builders")] +use aws_lambda_events::event::apigw::{ + ApiGatewayV2CustomAuthorizerSimpleResponse, ApiGatewayV2CustomAuthorizerV2Request, +}; +#[cfg(feature = "builders")] +use lambda_runtime::{Error, LambdaEvent}; +#[cfg(feature = "builders")] +use serde::{Deserialize, Serialize}; + +#[cfg(feature = "builders")] +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SomeThirdPartyThingWithoutDefaultValue { + pub api_key: String, + pub endpoint: String, + pub timeout_ms: u64, +} + +// ❌ OLD WAY: Had to use Option to satisfy Default requirement +#[cfg(feature = "builders")] +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct MyContextOldWay { + // NOT IDEAL: Need to wrap with Option just for Default + some_thing_always_exists: Option, +} + +// ✅ NEW WAY: No Option needed with builder pattern! +#[cfg(feature = "builders")] +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct MyContext { + // IDEAL: Can use the actual type directly! + some_thing_always_exists: SomeThirdPartyThingWithoutDefaultValue, + user_id: String, + permissions: Vec, +} + +// ❌ OLD IMPLEMENTATION: Using Default +#[cfg(feature = "builders")] +pub async fn function_handler_old_way( + _event: LambdaEvent, +) -> Result, Error> { + let mut output: ApiGatewayV2CustomAuthorizerSimpleResponse = + ApiGatewayV2CustomAuthorizerSimpleResponse::default(); + + output.is_authorized = true; + output.context = MyContextOldWay { + // ❌ Had to wrap in Some() even though it always exists + some_thing_always_exists: Some(SomeThirdPartyThingWithoutDefaultValue { + api_key: "secret-key-123".to_string(), + endpoint: "https://api.example.com".to_string(), + timeout_ms: 5000, + }), + }; + + Ok(output) +} + +// ✅ NEW IMPLEMENTATION: Using Builder +#[cfg(feature = "builders")] +pub async fn function_handler( + _event: LambdaEvent, +) -> Result, Error> { + let context = MyContext { + // ✅ No Option wrapper needed! + some_thing_always_exists: SomeThirdPartyThingWithoutDefaultValue { + api_key: "secret-key-123".to_string(), + endpoint: "https://api.example.com".to_string(), + timeout_ms: 5000, + }, + user_id: "user-123".to_string(), + permissions: vec!["read".to_string(), "write".to_string()], + }; + + // ✅ Clean builder pattern - no Default required! + let output = ApiGatewayV2CustomAuthorizerSimpleResponse::builder() + .is_authorized(true) + .context(context) + .build(); + + Ok(output) +} + +#[cfg(feature = "builders")] +fn main() { + let context = MyContext { + some_thing_always_exists: SomeThirdPartyThingWithoutDefaultValue { + api_key: "secret-key-123".to_string(), + endpoint: "https://api.example.com".to_string(), + timeout_ms: 5000, + }, + user_id: "user-123".to_string(), + permissions: vec!["read".to_string(), "write".to_string()], + }; + + let response = ApiGatewayV2CustomAuthorizerSimpleResponse::::builder() + .is_authorized(true) + .context(context) + .build(); + + println!("✅ Built authorizer response for user: {}", response.context.user_id); + println!(" Authorized: {}", response.is_authorized); + println!(" Permissions: {:?}", response.context.permissions); + println!( + " Third-party endpoint: {}", + response.context.some_thing_always_exists.endpoint + ); +} + +#[cfg(not(feature = "builders"))] +fn main() { + println!("This example requires the 'builders' feature to be enabled."); + println!("Run with: cargo run --example lambda-runtime-authorizer-builder --features builders"); +} diff --git a/lambda-events/examples/lambda-runtime-sqs-batch-builder.rs b/lambda-events/examples/lambda-runtime-sqs-batch-builder.rs new file mode 100644 index 00000000..9a89a2db --- /dev/null +++ b/lambda-events/examples/lambda-runtime-sqs-batch-builder.rs @@ -0,0 +1,135 @@ +// Example showing how builders simplify SQS batch response construction +// when handling partial batch failures +// +// ❌ OLD WAY (with Default): +// for record in event.payload.records { +// match process_record(&record).await { +// Err(_) => { +// let mut item = BatchItemFailure::default(); +// item.item_identifier = record.message_id.unwrap(); +// batch_item_failures.push(item) +// } +// } +// } +// let mut response = SqsBatchResponse::default(); +// response.batch_item_failures = batch_item_failures; +// +// ✅ NEW WAY (with Builder): +// for record in event.payload.records { +// match process_record(&record).await { +// Err(_) => { +// let item = BatchItemFailure::builder() +// .item_identifier(record.message_id.unwrap()) +// .build()?; +// batch_item_failures.push(item) +// } +// } +// } +// let response = SqsBatchResponse::builder() +// .batch_item_failures(batch_item_failures) +// .build()?; +// +// Benefits: +// • Immutable construction (no mut needed) +// • Cleaner, more functional style +// • Type-safe field assignment +// • Works seamlessly with lambda_runtime::LambdaEvent + +#[cfg(feature = "builders")] +use aws_lambda_events::event::sqs::{BatchItemFailure, SqsBatchResponse, SqsEvent}; +#[cfg(feature = "builders")] +use lambda_runtime::{Error, LambdaEvent}; + +// Simulate processing a record +#[cfg(feature = "builders")] +#[allow(dead_code)] +async fn process_record(record: &aws_lambda_events::event::sqs::SqsMessage) -> Result<(), String> { + // Simulate some processing logic + if let Some(body) = &record.body { + if body.contains("error") { + return Err(format!("Failed to process message: {}", body)); + } + } + Ok(()) +} + +// ❌ OLD WAY: Using Default and manual field assignment +#[cfg(feature = "builders")] +#[allow(dead_code)] +async fn function_handler_old_way(event: LambdaEvent) -> Result { + let mut batch_item_failures = Vec::new(); + + for record in event.payload.records { + match process_record(&record).await { + Ok(_) => (), + Err(_) => { + let mut item = BatchItemFailure::default(); + item.item_identifier = record.message_id.unwrap(); + + batch_item_failures.push(item) + } + } + } + + let mut response = SqsBatchResponse::default(); + response.batch_item_failures = batch_item_failures; + + Ok(response) +} + +// ✅ NEW WAY: Using Builder pattern +#[cfg(feature = "builders")] +#[allow(dead_code)] +async fn function_handler(event: LambdaEvent) -> Result { + let mut batch_item_failures = Vec::new(); + + for record in event.payload.records { + match process_record(&record).await { + Ok(_) => (), + Err(_) => { + // ✅ Clean builder construction + let item = BatchItemFailure::builder() + .item_identifier(record.message_id.unwrap()) + .build(); + + batch_item_failures.push(item) + } + } + } + + // ✅ Clean response construction with builder + let response = SqsBatchResponse::builder() + .batch_item_failures(batch_item_failures) + .build(); + + Ok(response) +} + +#[cfg(feature = "builders")] +fn main() { + // Demonstrate builder usage with sample data + let failures = vec![ + BatchItemFailure::builder() + .item_identifier("msg-123".to_string()) + .build(), + BatchItemFailure::builder() + .item_identifier("msg-456".to_string()) + .build(), + ]; + + let response = SqsBatchResponse::builder().batch_item_failures(failures).build(); + + println!( + "✅ Built SQS batch response with {} failed items", + response.batch_item_failures.len() + ); + for failure in &response.batch_item_failures { + println!(" Failed message: {}", failure.item_identifier); + } +} + +#[cfg(not(feature = "builders"))] +fn main() { + println!("This example requires the 'builders' feature to be enabled."); + println!("Run with: cargo run --example lambda-runtime-sqs-batch-builder --features builders"); +} diff --git a/lambda-events/src/event/activemq/mod.rs b/lambda-events/src/event/activemq/mod.rs index 60ef8568..ee0ebe37 100644 --- a/lambda-events/src/event/activemq/mod.rs +++ b/lambda-events/src/event/activemq/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -6,6 +8,7 @@ use std::collections::HashMap; use crate::custom_serde::deserialize_lambda_map; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ActiveMqEvent { @@ -20,10 +23,12 @@ pub struct ActiveMqEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ActiveMqMessage { @@ -58,10 +63,12 @@ pub struct ActiveMqMessage { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ActiveMqDestination { @@ -73,6 +80,7 @@ pub struct ActiveMqDestination { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/alb/mod.rs b/lambda-events/src/event/alb/mod.rs index 1829bf01..460aa7bd 100644 --- a/lambda-events/src/event/alb/mod.rs +++ b/lambda-events/src/event/alb/mod.rs @@ -5,6 +5,8 @@ use crate::{ }, encodings::Body, }; +#[cfg(feature = "builders")] +use bon::Builder; use http::{HeaderMap, Method}; use query_map::QueryMap; use serde::{Deserialize, Serialize}; @@ -13,6 +15,7 @@ use serde_json::Value; /// `AlbTargetGroupRequest` contains data originating from the ALB Lambda target group integration #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AlbTargetGroupRequest { @@ -41,11 +44,13 @@ pub struct AlbTargetGroupRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AlbTargetGroupRequestContext` contains the information to identify the load balancer invoking the lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AlbTargetGroupRequestContext { @@ -56,11 +61,13 @@ pub struct AlbTargetGroupRequestContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ElbContext` contains the information to identify the ARN invoking the lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ElbContext { @@ -73,11 +80,13 @@ pub struct ElbContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AlbTargetGroupResponse` configures the response to be returned by the ALB Lambda target group for the request #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AlbTargetGroupResponse { @@ -100,6 +109,7 @@ pub struct AlbTargetGroupResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/apigw/mod.rs b/lambda-events/src/event/apigw/mod.rs index c35da0cd..c4453a38 100644 --- a/lambda-events/src/event/apigw/mod.rs +++ b/lambda-events/src/event/apigw/mod.rs @@ -6,6 +6,8 @@ use crate::{ encodings::Body, iam::IamPolicyStatement, }; +#[cfg(feature = "builders")] +use bon::Builder; use http::{HeaderMap, Method}; use query_map::QueryMap; use serde::{de::DeserializeOwned, ser::SerializeMap, Deserialize, Deserializer, Serialize, Serializer}; @@ -14,6 +16,7 @@ use std::collections::HashMap; /// `ApiGatewayProxyRequest` contains data coming from the API Gateway proxy #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayProxyRequest { @@ -54,11 +57,13 @@ pub struct ApiGatewayProxyRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayProxyResponse` configures the response to be returned by API Gateway for the request #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayProxyResponse { @@ -79,12 +84,14 @@ pub struct ApiGatewayProxyResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayProxyRequestContext` contains the information to identify the AWS account and resources invoking the /// Lambda function. It also includes Cognito identity information for the caller. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayProxyRequestContext { @@ -133,6 +140,7 @@ pub struct ApiGatewayProxyRequestContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -148,6 +156,7 @@ pub struct ApiGatewayProxyRequestContext { /// /// For Custom Authorizer v1 payloads, use the dedicated `ApiGatewayV2CustomAuthorizerV1Request` struct instead. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2httpRequest { @@ -247,11 +256,13 @@ pub struct ApiGatewayV2httpRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayV2httpRequestContext` contains the information to identify the AWS account and resources invoking the Lambda function. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2httpRequestContext { @@ -287,11 +298,13 @@ pub struct ApiGatewayV2httpRequestContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayRequestAuthorizer` contains authorizer information for the request context. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct ApiGatewayRequestAuthorizer { #[serde(skip_serializing_if = "Option::is_none")] @@ -312,11 +325,13 @@ pub struct ApiGatewayRequestAuthorizer { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayRequestAuthorizerJwtDescription` contains JWT authorizer information for the request context. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayRequestAuthorizerJwtDescription { @@ -331,11 +346,13 @@ pub struct ApiGatewayRequestAuthorizerJwtDescription { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayRequestAuthorizerIamDescription` contains IAM information for the request context. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayRequestAuthorizerIamDescription { @@ -359,11 +376,13 @@ pub struct ApiGatewayRequestAuthorizerIamDescription { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayRequestAuthorizerCognitoIdentity` contains Cognito identity information for the request context. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayRequestAuthorizerCognitoIdentity { @@ -378,11 +397,13 @@ pub struct ApiGatewayRequestAuthorizerCognitoIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayV2httpRequestContextHttpDescription` contains HTTP information for the request context. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2httpRequestContextHttpDescription { @@ -402,11 +423,13 @@ pub struct ApiGatewayV2httpRequestContextHttpDescription { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayV2httpResponse` configures the response to be returned by API Gateway V2 for the request #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2httpResponse { @@ -428,11 +451,13 @@ pub struct ApiGatewayV2httpResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayRequestIdentity` contains identity information for the request caller. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayRequestIdentity { @@ -469,11 +494,13 @@ pub struct ApiGatewayRequestIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayWebsocketProxyRequest` contains data coming from the API Gateway proxy #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayWebsocketProxyRequest { @@ -516,6 +543,7 @@ pub struct ApiGatewayWebsocketProxyRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -523,6 +551,7 @@ pub struct ApiGatewayWebsocketProxyRequest { /// the AWS account and resources invoking the Lambda function. It also includes /// Cognito identity information for the caller. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayWebsocketProxyRequestContext { @@ -588,11 +617,13 @@ pub struct ApiGatewayWebsocketProxyRequestContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerRequestTypeRequestIdentity` contains identity information for the request caller including certificate information if using mTLS. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentity { @@ -610,11 +641,13 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert` contains certificate information for the request caller if using mTLS. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert { @@ -635,11 +668,13 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity` contains certificate validity information for the request caller if using mTLS. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity { @@ -653,11 +688,13 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidit #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayV2httpRequestContextAuthentication` contains authentication context information for the request caller including client certificate information if using mTLS. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2httpRequestContextAuthentication { @@ -669,11 +706,13 @@ pub struct ApiGatewayV2httpRequestContextAuthentication { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayV2httpRequestContextAuthenticationClientCert` contains client certificate information for the request caller if using mTLS. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2httpRequestContextAuthenticationClientCert { @@ -694,11 +733,13 @@ pub struct ApiGatewayV2httpRequestContextAuthenticationClientCert { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayV2httpRequestContextAuthenticationClientCertValidity` contains client certificate validity information for the request caller if using mTLS. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2httpRequestContextAuthenticationClientCertValidity { @@ -712,10 +753,12 @@ pub struct ApiGatewayV2httpRequestContextAuthenticationClientCertValidity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2CustomAuthorizerV1RequestTypeRequestContext { @@ -743,10 +786,12 @@ pub struct ApiGatewayV2CustomAuthorizerV1RequestTypeRequestContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2CustomAuthorizerV1Request { @@ -786,10 +831,12 @@ pub struct ApiGatewayV2CustomAuthorizerV1Request { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2CustomAuthorizerV2Request { @@ -829,12 +876,14 @@ pub struct ApiGatewayV2CustomAuthorizerV2Request { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerContext` represents the expected format of an API Gateway custom authorizer response. /// Deprecated. Code should be updated to use the Authorizer map from APIGatewayRequestIdentity. Ex: Authorizer["principalId"] #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayCustomAuthorizerContext { @@ -849,11 +898,13 @@ pub struct ApiGatewayCustomAuthorizerContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerRequestTypeRequestContext` represents the expected format of an API Gateway custom authorizer response. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayCustomAuthorizerRequestTypeRequestContext { @@ -885,11 +936,13 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequestContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerRequest` contains data coming in to a custom API Gateway authorizer function. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayCustomAuthorizerRequest { @@ -906,11 +959,13 @@ pub struct ApiGatewayCustomAuthorizerRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerRequestTypeRequest` contains data coming in to a custom API Gateway authorizer function. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayCustomAuthorizerRequestTypeRequest { @@ -951,11 +1006,13 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerResponse` represents the expected format of an API Gateway authorization response. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayCustomAuthorizerResponse @@ -975,11 +1032,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayV2CustomAuthorizerSimpleResponse` represents the simple format of an API Gateway V2 authorization response. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2CustomAuthorizerSimpleResponse @@ -996,10 +1055,12 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ApiGatewayV2CustomAuthorizerIamPolicyResponse @@ -1018,11 +1079,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ApiGatewayCustomAuthorizerPolicy` represents an IAM policy #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct ApiGatewayCustomAuthorizerPolicy { @@ -1035,6 +1098,7 @@ pub struct ApiGatewayCustomAuthorizerPolicy { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/appsync/mod.rs b/lambda-events/src/event/appsync/mod.rs index 223c706b..e00cd3c3 100644 --- a/lambda-events/src/event/appsync/mod.rs +++ b/lambda-events/src/event/appsync/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; @@ -6,6 +8,7 @@ use crate::custom_serde::deserialize_lambda_map; /// Deprecated: `AppSyncResolverTemplate` does not represent resolver events sent by AppSync. Instead directly model your input schema, or use `map[string]string`, `json.RawMessage`,` interface{}`, etc.. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AppSyncResolverTemplate @@ -24,11 +27,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AppSyncIamIdentity` contains information about the caller authed via IAM. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AppSyncIamIdentity { @@ -53,13 +58,16 @@ pub struct AppSyncIamIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AppSyncCognitoIdentity` contains information about the caller authed via Cognito. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] +#[allow(clippy::should_implement_trait)] pub struct AppSyncCognitoIdentity where T1: DeserializeOwned, @@ -84,6 +92,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -91,6 +100,7 @@ pub type AppSyncOperation = String; /// `AppSyncLambdaAuthorizerRequest` contains an authorization request from AppSync. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AppSyncLambdaAuthorizerRequest { @@ -103,12 +113,14 @@ pub struct AppSyncLambdaAuthorizerRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AppSyncLambdaAuthorizerRequestContext` contains the parameters of the AppSync invocation which triggered /// this authorization request. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AppSyncLambdaAuthorizerRequestContext @@ -137,11 +149,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AppSyncLambdaAuthorizerResponse` represents the expected format of an authorization response to AppSync. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AppSyncLambdaAuthorizerResponse @@ -162,6 +176,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -178,6 +193,7 @@ where /// See also: /// - [AppSync resolver mapping template context reference](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-context-reference.html) #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] pub struct AppSyncDirectResolverEvent where @@ -202,12 +218,14 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AppSyncRequest` contains request-related metadata for a resolver invocation, /// including client-sent headers and optional custom domain name. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AppSyncRequest { @@ -223,11 +241,13 @@ pub struct AppSyncRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AppSyncInfo` contains metadata about the current GraphQL field being resolved. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AppSyncInfo @@ -248,11 +268,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AppSyncPrevResult` contains the result of the previous step in a pipeline resolver. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] pub struct AppSyncPrevResult where @@ -266,6 +288,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -289,7 +312,9 @@ impl Default for AppSyncIdentity { /// `AppSyncIdentityOIDC` represents identity information when using OIDC-based authorization. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] +#[allow(clippy::should_implement_trait)] pub struct AppSyncIdentityOIDC where T: Serialize + DeserializeOwned, @@ -304,11 +329,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AppSyncIdentityLambda` represents identity information when using AWS Lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AppSyncIdentityLambda @@ -323,6 +350,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/autoscaling/mod.rs b/lambda-events/src/event/autoscaling/mod.rs index 9a0eda8a..9cd2d8c7 100644 --- a/lambda-events/src/event/autoscaling/mod.rs +++ b/lambda-events/src/event/autoscaling/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; @@ -7,6 +9,7 @@ use crate::custom_serde::deserialize_lambda_map; /// `AutoScalingEvent` struct is used to parse the json for auto scaling event types // #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct AutoScalingEvent @@ -48,6 +51,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/bedrock_agent_runtime/mod.rs b/lambda-events/src/event/bedrock_agent_runtime/mod.rs index ce119914..ba67b3fa 100644 --- a/lambda-events/src/event/bedrock_agent_runtime/mod.rs +++ b/lambda-events/src/event/bedrock_agent_runtime/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use std::collections::HashMap; /// The Event sent to Lambda from Agents for Amazon Bedrock. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AgentEvent { @@ -38,10 +41,12 @@ pub struct AgentEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct RequestBody { @@ -53,10 +58,12 @@ pub struct RequestBody { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Content { @@ -68,10 +75,12 @@ pub struct Content { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Property { @@ -87,10 +96,12 @@ pub struct Property { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Parameter { @@ -106,10 +117,12 @@ pub struct Parameter { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Agent { @@ -127,6 +140,7 @@ pub struct Agent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/chime_bot/mod.rs b/lambda-events/src/event/chime_bot/mod.rs index 7a0990ef..92a6d391 100644 --- a/lambda-events/src/event/chime_bot/mod.rs +++ b/lambda-events/src/event/chime_bot/mod.rs @@ -1,9 +1,12 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChimeBotEvent { @@ -26,10 +29,12 @@ pub struct ChimeBotEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChimeBotEventSender { @@ -45,10 +50,12 @@ pub struct ChimeBotEventSender { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChimeBotEventDiscussion { @@ -64,10 +71,12 @@ pub struct ChimeBotEventDiscussion { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChimeBotEventInboundHttpsEndpoint { @@ -83,5 +92,6 @@ pub struct ChimeBotEventInboundHttpsEndpoint { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/clientvpn/mod.rs b/lambda-events/src/event/clientvpn/mod.rs index 3d6152c9..d3a6f2e4 100644 --- a/lambda-events/src/event/clientvpn/mod.rs +++ b/lambda-events/src/event/clientvpn/mod.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ClientVpnConnectionHandlerRequest { @@ -38,10 +41,12 @@ pub struct ClientVpnConnectionHandlerRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ClientVpnConnectionHandlerResponse { @@ -60,6 +65,7 @@ pub struct ClientVpnConnectionHandlerResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudformation/mod.rs b/lambda-events/src/event/cloudformation/mod.rs index 3ea66e30..ac937ac3 100644 --- a/lambda-events/src/event/cloudformation/mod.rs +++ b/lambda-events/src/event/cloudformation/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; @@ -27,6 +29,7 @@ impl Default for CloudFormationCustomResourceRequest { } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CreateRequest @@ -49,10 +52,12 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct UpdateRequest @@ -79,10 +84,12 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct DeleteRequest @@ -106,10 +113,12 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CloudFormationCustomResourceResponse { @@ -127,6 +136,7 @@ pub struct CloudFormationCustomResourceResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudformation/provider.rs b/lambda-events/src/event/cloudformation/provider.rs index 34e8136f..4c9cbc13 100644 --- a/lambda-events/src/event/cloudformation/provider.rs +++ b/lambda-events/src/event/cloudformation/provider.rs @@ -4,6 +4,8 @@ //! //! See for details. +#[cfg(feature = "builders")] +use bon::Builder; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; @@ -30,6 +32,7 @@ impl Default for CloudFormationCustomResourceRequest { } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CreateRequest @@ -42,6 +45,7 @@ where } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct UpdateRequest @@ -60,6 +64,7 @@ where } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct DeleteRequest @@ -74,6 +79,7 @@ where } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CommonRequestParams @@ -92,10 +98,12 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CloudFormationCustomResourceResponse @@ -112,6 +120,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_alarms/mod.rs b/lambda-events/src/event/cloudwatch_alarms/mod.rs index 46c9503a..aa66a7de 100644 --- a/lambda-events/src/event/cloudwatch_alarms/mod.rs +++ b/lambda-events/src/event/cloudwatch_alarms/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use std::collections::HashMap; use chrono::{DateTime, Utc}; @@ -13,6 +15,7 @@ use serde_json::Value; /// For examples of events that come via CloudWatch Alarms, /// see #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchAlarm @@ -40,6 +43,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -52,6 +56,7 @@ pub type CloudWatchCompositeAlarm = CloudWatchAlarm; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchAlarmData @@ -74,10 +79,12 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchAlarmState @@ -99,10 +106,12 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchMetricAlarmConfiguration { @@ -116,10 +125,12 @@ pub struct CloudWatchMetricAlarmConfiguration { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchMetricDefinition { @@ -133,10 +144,12 @@ pub struct CloudWatchMetricDefinition { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchMetricStatDefinition { @@ -152,10 +165,12 @@ pub struct CloudWatchMetricStatDefinition { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchMetricStatMetricDefinition { @@ -169,10 +184,12 @@ pub struct CloudWatchMetricStatMetricDefinition { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchCompositeAlarmConfiguration { @@ -186,6 +203,7 @@ pub struct CloudWatchCompositeAlarmConfiguration { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -214,6 +232,7 @@ impl Default for CloudWatchAlarmStateReasonData { } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchAlarmStateReasonDataMetric { @@ -242,10 +261,12 @@ pub struct CloudWatchAlarmStateReasonDataMetric { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchAlarmStateEvaluatedDatapoint { @@ -262,10 +283,12 @@ pub struct CloudWatchAlarmStateEvaluatedDatapoint { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ClodWatchAlarmStateReasonDataComposite { @@ -277,10 +300,12 @@ pub struct ClodWatchAlarmStateReasonDataComposite { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchAlarmStateTriggeringAlarm { @@ -292,10 +317,12 @@ pub struct CloudWatchAlarmStateTriggeringAlarm { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchAlarmStateTriggeringAlarmState { @@ -308,6 +335,7 @@ pub struct CloudWatchAlarmStateTriggeringAlarmState { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/cloudtrail.rs b/lambda-events/src/event/cloudwatch_events/cloudtrail.rs index 70275c4f..2b4d8f37 100644 --- a/lambda-events/src/event/cloudwatch_events/cloudtrail.rs +++ b/lambda-events/src/event/cloudwatch_events/cloudtrail.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AWSAPICall { @@ -30,10 +33,12 @@ pub struct AWSAPICall { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SessionIssuer { @@ -48,10 +53,12 @@ pub struct SessionIssuer { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct WebIdFederationData { @@ -63,10 +70,12 @@ pub struct WebIdFederationData { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Attributes { @@ -78,10 +87,12 @@ pub struct Attributes { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SessionContext { @@ -96,10 +107,12 @@ pub struct SessionContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct OnBehalfOf { @@ -111,11 +124,13 @@ pub struct OnBehalfOf { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } // https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct UserIdentity { @@ -134,6 +149,7 @@ pub struct UserIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/codedeploy.rs b/lambda-events/src/event/cloudwatch_events/codedeploy.rs index f01a5bba..7542844c 100644 --- a/lambda-events/src/event/cloudwatch_events/codedeploy.rs +++ b/lambda-events/src/event/cloudwatch_events/codedeploy.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct StateChangeNotification { @@ -18,10 +21,12 @@ pub struct StateChangeNotification { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct DeploymentStateChangeNotification { @@ -38,10 +43,12 @@ pub struct DeploymentStateChangeNotification { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct InstanceStateChangeNotification { @@ -56,5 +63,6 @@ pub struct InstanceStateChangeNotification { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/codepipeline.rs b/lambda-events/src/event/cloudwatch_events/codepipeline.rs index 89f2029c..a647281e 100644 --- a/lambda-events/src/event/cloudwatch_events/codepipeline.rs +++ b/lambda-events/src/event/cloudwatch_events/codepipeline.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct PipelineExecutionStateChange { @@ -17,10 +20,12 @@ pub struct PipelineExecutionStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct StageExecutionStateChange { @@ -36,10 +41,12 @@ pub struct StageExecutionStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ActionExecutionStateChange { @@ -59,10 +66,12 @@ pub struct ActionExecutionStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ActionExecutionStateChangeType { @@ -76,5 +85,6 @@ pub struct ActionExecutionStateChangeType { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/ec2.rs b/lambda-events/src/event/cloudwatch_events/ec2.rs index 378b64f1..ba668ac3 100644 --- a/lambda-events/src/event/cloudwatch_events/ec2.rs +++ b/lambda-events/src/event/cloudwatch_events/ec2.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct InstanceStateChange { @@ -15,5 +18,6 @@ pub struct InstanceStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/emr.rs b/lambda-events/src/event/cloudwatch_events/emr.rs index f30d5334..d6057381 100644 --- a/lambda-events/src/event/cloudwatch_events/emr.rs +++ b/lambda-events/src/event/cloudwatch_events/emr.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AutoScalingPolicyStateChange { @@ -17,10 +20,12 @@ pub struct AutoScalingPolicyStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ClusterStateChange { @@ -36,10 +41,12 @@ pub struct ClusterStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct InstanceGroupStateChange { @@ -59,10 +66,12 @@ pub struct InstanceGroupStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct StepStatusChange { @@ -79,5 +88,6 @@ pub struct StepStatusChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/gamelift.rs b/lambda-events/src/event/cloudwatch_events/gamelift.rs index 95678329..875ff2ec 100644 --- a/lambda-events/src/event/cloudwatch_events/gamelift.rs +++ b/lambda-events/src/event/cloudwatch_events/gamelift.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use serde_json::Value; use crate::custom_serde::deserialize_nullish_boolean; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MatchmakingSearching { @@ -18,10 +21,12 @@ pub struct MatchmakingSearching { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Ticket { @@ -34,10 +39,12 @@ pub struct Ticket { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Player { @@ -52,10 +59,12 @@ pub struct Player { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct GameSessionInfo { @@ -66,10 +75,12 @@ pub struct GameSessionInfo { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct PotentialMatchCreated { @@ -86,10 +97,12 @@ pub struct PotentialMatchCreated { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct RuleEvaluationMetric { @@ -102,10 +115,12 @@ pub struct RuleEvaluationMetric { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AcceptMatch { @@ -119,10 +134,12 @@ pub struct AcceptMatch { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AcceptMatchCompleted { @@ -137,10 +154,12 @@ pub struct AcceptMatchCompleted { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MatchmakingSucceeded { @@ -154,10 +173,12 @@ pub struct MatchmakingSucceeded { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MatchmakingTimedOut { @@ -173,10 +194,12 @@ pub struct MatchmakingTimedOut { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MatchmakingCancelled { @@ -192,10 +215,12 @@ pub struct MatchmakingCancelled { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MatchmakingFailed { @@ -212,5 +237,6 @@ pub struct MatchmakingFailed { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/glue.rs b/lambda-events/src/event/cloudwatch_events/glue.rs index 69d428b2..d85eebd9 100644 --- a/lambda-events/src/event/cloudwatch_events/glue.rs +++ b/lambda-events/src/event/cloudwatch_events/glue.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct JobRunStateChange { @@ -17,10 +20,12 @@ pub struct JobRunStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CrawlerStarted { @@ -35,10 +40,12 @@ pub struct CrawlerStarted { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CrawlerSucceeded { @@ -63,10 +70,12 @@ pub struct CrawlerSucceeded { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CrawlerFailed { @@ -82,10 +91,12 @@ pub struct CrawlerFailed { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct JobRunStatus { @@ -102,10 +113,12 @@ pub struct JobRunStatus { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct NotificationCondition { @@ -117,10 +130,12 @@ pub struct NotificationCondition { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct DataCatalogTableStateChange { @@ -134,10 +149,12 @@ pub struct DataCatalogTableStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct DataCatalogDatabaseStateChange { @@ -150,5 +167,6 @@ pub struct DataCatalogDatabaseStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/health.rs b/lambda-events/src/event/cloudwatch_events/health.rs index af5ebfc4..727c2e54 100644 --- a/lambda-events/src/event/cloudwatch_events/health.rs +++ b/lambda-events/src/event/cloudwatch_events/health.rs @@ -1,9 +1,12 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; use std::collections::HashMap; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Event { @@ -21,10 +24,12 @@ pub struct Event { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct EventDescription { @@ -36,10 +41,12 @@ pub struct EventDescription { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Entity { @@ -51,5 +58,6 @@ pub struct Entity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/kms.rs b/lambda-events/src/event/cloudwatch_events/kms.rs index c96d2be5..23e12456 100644 --- a/lambda-events/src/event/cloudwatch_events/kms.rs +++ b/lambda-events/src/event/cloudwatch_events/kms.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CMKEvent { @@ -14,5 +17,6 @@ pub struct CMKEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/macie.rs b/lambda-events/src/event/cloudwatch_events/macie.rs index 7a1a989b..a715070f 100644 --- a/lambda-events/src/event/cloudwatch_events/macie.rs +++ b/lambda-events/src/event/cloudwatch_events/macie.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] @@ -5,6 +7,7 @@ use serde_json::Value; use std::collections::HashMap; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Alert { @@ -28,6 +31,7 @@ pub struct Alert { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -36,6 +40,7 @@ pub type BucketWritableAlert = Alert; pub type BucketContainsHighRiskObjectAlert = Alert; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Trigger { @@ -53,10 +58,12 @@ pub struct Trigger { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct BucketScanSummary { @@ -83,10 +90,12 @@ pub struct BucketScanSummary { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Ip { @@ -102,10 +111,12 @@ pub struct Ip { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct TimeRange { @@ -118,10 +129,12 @@ pub struct TimeRange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Location { @@ -133,10 +146,12 @@ pub struct Location { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ActionInfo { @@ -150,10 +165,12 @@ pub struct ActionInfo { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct BucketWritableSummary { @@ -175,10 +192,12 @@ pub struct BucketWritableSummary { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Bucket { @@ -190,10 +209,12 @@ pub struct Bucket { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Acl { @@ -205,10 +226,12 @@ pub struct Acl { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SecretBucketName { @@ -222,10 +245,12 @@ pub struct SecretBucketName { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Owner { @@ -239,10 +264,12 @@ pub struct Owner { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Grant { @@ -256,10 +283,12 @@ pub struct Grant { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Grantee { @@ -272,10 +301,12 @@ pub struct Grantee { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct BucketContainsHighRiskObjectSummary { @@ -301,10 +332,12 @@ pub struct BucketContainsHighRiskObjectSummary { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AlertUpdated { @@ -327,10 +360,12 @@ pub struct AlertUpdated { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct UpdatedTrigger { @@ -343,10 +378,12 @@ pub struct UpdatedTrigger { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct FeatureInfo { @@ -364,5 +401,6 @@ pub struct FeatureInfo { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/mod.rs b/lambda-events/src/event/cloudwatch_events/mod.rs index 91f7e7fd..da93b2bc 100644 --- a/lambda-events/src/event/cloudwatch_events/mod.rs +++ b/lambda-events/src/event/cloudwatch_events/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; @@ -22,6 +24,7 @@ pub mod trustedadvisor; /// `CloudWatchEvent` is the outer structure of an event sent via CloudWatch Events. /// For examples of events that come via CloudWatch Events, see #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CloudWatchEvent @@ -53,5 +56,6 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/opsworks.rs b/lambda-events/src/event/cloudwatch_events/opsworks.rs index 7c26baaf..aeb210a0 100644 --- a/lambda-events/src/event/cloudwatch_events/opsworks.rs +++ b/lambda-events/src/event/cloudwatch_events/opsworks.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct InstanceStateChange { @@ -24,10 +27,12 @@ pub struct InstanceStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CommandStateChange { @@ -43,10 +48,12 @@ pub struct CommandStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct DeploymentStateChange { @@ -65,10 +72,12 @@ pub struct DeploymentStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Alert { @@ -84,5 +93,6 @@ pub struct Alert { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/signin.rs b/lambda-events/src/event/cloudwatch_events/signin.rs index 458787bd..4864f537 100644 --- a/lambda-events/src/event/cloudwatch_events/signin.rs +++ b/lambda-events/src/event/cloudwatch_events/signin.rs @@ -1,7 +1,10 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SignIn { @@ -26,10 +29,12 @@ pub struct SignIn { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct UserIdentity { @@ -43,10 +48,12 @@ pub struct UserIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ResponseElements { @@ -58,10 +65,12 @@ pub struct ResponseElements { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct AdditionalEventData { @@ -77,5 +86,6 @@ pub struct AdditionalEventData { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/sms.rs b/lambda-events/src/event/cloudwatch_events/sms.rs index e3bfeeb4..3a63acae 100644 --- a/lambda-events/src/event/cloudwatch_events/sms.rs +++ b/lambda-events/src/event/cloudwatch_events/sms.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct JobStateChange { @@ -20,5 +23,6 @@ pub struct JobStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/ssm.rs b/lambda-events/src/event/cloudwatch_events/ssm.rs index 1bf81ed2..d71f03e4 100644 --- a/lambda-events/src/event/cloudwatch_events/ssm.rs +++ b/lambda-events/src/event/cloudwatch_events/ssm.rs @@ -1,9 +1,12 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; use std::collections::HashMap; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct EC2AutomationStepStatusChange { @@ -31,10 +34,12 @@ pub struct EC2AutomationStepStatusChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct EC2AutomationExecutionStatusChange { @@ -60,10 +65,12 @@ pub struct EC2AutomationExecutionStatusChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct StateChange { @@ -76,10 +83,12 @@ pub struct StateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ConfigurationComplianceStateChange { @@ -102,10 +111,12 @@ pub struct ConfigurationComplianceStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MaintenanceWindowTargetRegistration { @@ -120,10 +131,12 @@ pub struct MaintenanceWindowTargetRegistration { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MaintenanceWindowExecutionStateChange { @@ -142,10 +155,12 @@ pub struct MaintenanceWindowExecutionStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MaintenanceWindowTaskExecutionStateChange { @@ -166,10 +181,12 @@ pub struct MaintenanceWindowTaskExecutionStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MaintenanceWindowTaskTargetInvocationStateChange { @@ -194,10 +211,12 @@ pub struct MaintenanceWindowTaskTargetInvocationStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct MaintenanceWindowStateChange { @@ -210,10 +229,12 @@ pub struct MaintenanceWindowStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ParameterStoreStateChange { @@ -227,10 +248,12 @@ pub struct ParameterStoreStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct EC2CommandStatusChange { @@ -250,10 +273,12 @@ pub struct EC2CommandStatusChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct EC2CommandInvocationStatusChange { @@ -272,10 +297,12 @@ pub struct EC2CommandInvocationStatusChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct EC2StateManagerAssociationStateChange { @@ -309,10 +336,12 @@ pub struct EC2StateManagerAssociationStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct EC2StateManagerInstanceAssociationStateChange { @@ -348,5 +377,6 @@ pub struct EC2StateManagerInstanceAssociationStateChange { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/tag.rs b/lambda-events/src/event/cloudwatch_events/tag.rs index e6d3b96f..076af690 100644 --- a/lambda-events/src/event/cloudwatch_events/tag.rs +++ b/lambda-events/src/event/cloudwatch_events/tag.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; #[cfg(feature = "catch-all-fields")] use serde_json::Value; use std::collections::HashMap; @@ -5,6 +7,7 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct TagChangeOnResource { @@ -21,5 +24,6 @@ pub struct TagChangeOnResource { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_events/trustedadvisor.rs b/lambda-events/src/event/cloudwatch_events/trustedadvisor.rs index fdaf4a82..f852c923 100644 --- a/lambda-events/src/event/cloudwatch_events/trustedadvisor.rs +++ b/lambda-events/src/event/cloudwatch_events/trustedadvisor.rs @@ -1,9 +1,12 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; use std::collections::HashMap; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CheckItemRefreshNotification { @@ -21,5 +24,6 @@ pub struct CheckItemRefreshNotification { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cloudwatch_logs/mod.rs b/lambda-events/src/event/cloudwatch_logs/mod.rs index e494918a..70a9361a 100644 --- a/lambda-events/src/event/cloudwatch_logs/mod.rs +++ b/lambda-events/src/event/cloudwatch_logs/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{ de::{Error, MapAccess, Visitor}, ser::{Error as SeError, SerializeStruct}, @@ -11,6 +13,7 @@ use std::{fmt, io::BufReader}; /// `LogsEvent` represents the raw event sent by CloudWatch #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct LogsEvent { /// `aws_logs` is gzipped and base64 encoded, it needs a custom deserializer @@ -22,11 +25,13 @@ pub struct LogsEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `AwsLogs` is an unmarshaled, ungzipped, CloudWatch logs event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct AwsLogs { /// `data` is the log data after is decompressed @@ -35,6 +40,7 @@ pub struct AwsLogs { /// `LogData` represents the logs group event information #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct LogData { @@ -56,11 +62,13 @@ pub struct LogData { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `LogEntry` represents a log entry from cloudwatch logs #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct LogEntry { /// Unique id for the entry @@ -75,6 +83,7 @@ pub struct LogEntry { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/code_commit/mod.rs b/lambda-events/src/event/code_commit/mod.rs index 126d7160..d3311261 100644 --- a/lambda-events/src/event/code_commit/mod.rs +++ b/lambda-events/src/event/code_commit/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -7,6 +9,7 @@ use crate::custom_serde::deserialize_nullish_boolean; /// `CodeCommitEvent` represents a CodeCommit event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeCommitEvent { @@ -18,6 +21,7 @@ pub struct CodeCommitEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -25,6 +29,7 @@ pub type CodeCommitEventTime = DateTime; /// `CodeCommitRecord` represents a CodeCommit record #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeCommitRecord { @@ -61,11 +66,13 @@ pub struct CodeCommitRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeCommitCodeCommit` represents a CodeCommit object in a record #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeCommitCodeCommit { @@ -79,11 +86,13 @@ pub struct CodeCommitCodeCommit { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeCommitReference` represents a Reference object in a CodeCommit object #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeCommitReference { @@ -99,6 +108,7 @@ pub struct CodeCommitReference { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/codebuild/mod.rs b/lambda-events/src/event/codebuild/mod.rs index 27a0e060..26ad4c16 100644 --- a/lambda-events/src/event/codebuild/mod.rs +++ b/lambda-events/src/event/codebuild/mod.rs @@ -2,6 +2,8 @@ use crate::{ custom_serde::{codebuild_time, CodeBuildNumber}, encodings::{MinuteDuration, SecondDuration}, }; +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; @@ -13,6 +15,7 @@ pub type CodeBuildPhaseType = String; /// `CodeBuildEvent` is documented at: /// #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildEvent { @@ -51,11 +54,13 @@ pub struct CodeBuildEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeBuildEventDetail` represents the all details related to the code build event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildEventDetail { @@ -99,11 +104,13 @@ pub struct CodeBuildEventDetail { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeBuildEventAdditionalInformation` represents additional information to the code build event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildEventAdditionalInformation { @@ -132,11 +139,13 @@ pub struct CodeBuildEventAdditionalInformation { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeBuildArtifact` represents the artifact provided to build #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildArtifact { @@ -154,11 +163,13 @@ pub struct CodeBuildArtifact { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeBuildEnvironment` represents the environment for a build #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildEnvironment { @@ -179,11 +190,13 @@ pub struct CodeBuildEnvironment { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeBuildEnvironmentVariable` encapsulate environment variables for the code build #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildEnvironmentVariable { @@ -202,11 +215,13 @@ pub struct CodeBuildEnvironmentVariable { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeBuildSource` represent the code source will be build #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildSource { @@ -220,11 +235,13 @@ pub struct CodeBuildSource { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeBuildLogs` gives the log details of a code build #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildLogs { @@ -243,11 +260,13 @@ pub struct CodeBuildLogs { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodeBuildPhase` represents the phase of a build and its details #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeBuildPhase @@ -277,6 +296,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/codedeploy/mod.rs b/lambda-events/src/event/codedeploy/mod.rs index debe2bf5..7f3944b8 100644 --- a/lambda-events/src/event/codedeploy/mod.rs +++ b/lambda-events/src/event/codedeploy/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -8,6 +10,7 @@ pub type CodeDeployDeploymentState = String; /// `CodeDeployEvent` is documented at: /// #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeDeployEvent { @@ -47,10 +50,12 @@ pub struct CodeDeployEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodeDeployEventDetail { @@ -80,10 +85,12 @@ pub struct CodeDeployEventDetail { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "PascalCase")] pub struct CodeDeployLifecycleEvent { @@ -95,6 +102,7 @@ pub struct CodeDeployLifecycleEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/codepipeline_cloudwatch/mod.rs b/lambda-events/src/event/codepipeline_cloudwatch/mod.rs index 087d1452..5ffe7a9c 100644 --- a/lambda-events/src/event/codepipeline_cloudwatch/mod.rs +++ b/lambda-events/src/event/codepipeline_cloudwatch/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -12,6 +14,7 @@ pub type CodePipelineActionState = String; /// CodePipelineEvent is documented at: /// #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineCloudWatchEvent { @@ -51,10 +54,12 @@ pub struct CodePipelineCloudWatchEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineEventDetail { @@ -79,10 +84,12 @@ pub struct CodePipelineEventDetail { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineEventDetailType { @@ -100,6 +107,7 @@ pub struct CodePipelineEventDetailType { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/codepipeline_job/mod.rs b/lambda-events/src/event/codepipeline_job/mod.rs index 83dfce65..388accca 100644 --- a/lambda-events/src/event/codepipeline_job/mod.rs +++ b/lambda-events/src/event/codepipeline_job/mod.rs @@ -1,9 +1,12 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; /// `CodePipelineJobEvent` contains data from an event sent from AWS CodePipeline #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineJobEvent { @@ -15,11 +18,13 @@ pub struct CodePipelineJobEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineJob` represents a job from an AWS CodePipeline event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineJob { @@ -34,11 +39,13 @@ pub struct CodePipelineJob { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineData` represents a job from an AWS CodePipeline event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineData { @@ -55,11 +62,13 @@ pub struct CodePipelineData { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineActionConfiguration` represents an Action Configuration #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineActionConfiguration { @@ -70,11 +79,13 @@ pub struct CodePipelineActionConfiguration { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineConfiguration` represents a configuration for an Action Configuration #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineConfiguration { @@ -90,11 +101,13 @@ pub struct CodePipelineConfiguration { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineInputArtifact` represents an input artifact #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineInputArtifact { @@ -108,11 +121,13 @@ pub struct CodePipelineInputArtifact { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineInputLocation` represents a input location #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineInputLocation { @@ -126,11 +141,13 @@ pub struct CodePipelineInputLocation { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineS3Location` represents an s3 input location #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineS3Location { @@ -144,11 +161,13 @@ pub struct CodePipelineS3Location { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineOutputArtifact` represents an output artifact #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineOutputArtifact { @@ -162,11 +181,13 @@ pub struct CodePipelineOutputArtifact { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineOutputLocation` represents a output location #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineOutputLocation { @@ -180,11 +201,13 @@ pub struct CodePipelineOutputLocation { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CodePipelineArtifactCredentials` represents CodePipeline artifact credentials #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CodePipelineArtifactCredentials { @@ -200,6 +223,7 @@ pub struct CodePipelineArtifactCredentials { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/cognito/mod.rs b/lambda-events/src/event/cognito/mod.rs index d656bb59..1e3740fe 100644 --- a/lambda-events/src/event/cognito/mod.rs +++ b/lambda-events/src/event/cognito/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; @@ -6,6 +8,7 @@ use crate::custom_serde::{deserialize_lambda_map, deserialize_nullish_boolean}; /// `CognitoEvent` contains data from an event sent from AWS Cognito Sync #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEvent { @@ -29,11 +32,13 @@ pub struct CognitoEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoDatasetRecord` represents a record from an AWS Cognito Sync event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoDatasetRecord { @@ -49,12 +54,14 @@ pub struct CognitoDatasetRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPreSignup` is sent by AWS Cognito User Pools when a user attempts to register /// (sign up), allowing a Lambda to perform custom validation to accept or deny the registration request #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreSignup { @@ -69,6 +76,7 @@ pub struct CognitoEventUserPoolsPreSignup { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -87,6 +95,7 @@ pub enum CognitoEventUserPoolsPreSignupTriggerSource { /// `CognitoEventUserPoolsPreAuthentication` is sent by AWS Cognito User Pools when a user submits their information /// to be authenticated, allowing you to perform custom validations to accept or deny the sign in request. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreAuthentication { @@ -102,6 +111,7 @@ pub struct CognitoEventUserPoolsPreAuthentication { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -116,6 +126,7 @@ pub enum CognitoEventUserPoolsPreAuthenticationTriggerSource { /// `CognitoEventUserPoolsPostConfirmation` is sent by AWS Cognito User Pools after a user is confirmed, /// allowing the Lambda to send custom messages or add custom logic. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPostConfirmation @@ -136,6 +147,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -152,6 +164,7 @@ pub enum CognitoEventUserPoolsPostConfirmationTriggerSource { /// `CognitoEventUserPoolsPreTokenGen` is sent by AWS Cognito User Pools when a user attempts to retrieve /// credentials, allowing a Lambda to perform insert, suppress or override claims #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreTokenGen { @@ -166,6 +179,7 @@ pub struct CognitoEventUserPoolsPreTokenGen { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -188,6 +202,7 @@ pub enum CognitoEventUserPoolsPreTokenGenTriggerSource { /// `CognitoEventUserPoolsPostAuthentication` is sent by AWS Cognito User Pools after a user is authenticated, /// allowing the Lambda to add custom logic. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPostAuthentication { @@ -203,6 +218,7 @@ pub struct CognitoEventUserPoolsPostAuthentication { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -217,6 +233,7 @@ pub enum CognitoEventUserPoolsPostAuthenticationTriggerSource { /// `CognitoEventUserPoolsMigrateUser` is sent by AWS Cognito User Pools when a user does not exist in the /// user pool at the time of sign-in with a password, or in the forgot-password flow. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsMigrateUser { @@ -233,6 +250,7 @@ pub struct CognitoEventUserPoolsMigrateUser { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -248,6 +266,7 @@ pub enum CognitoEventUserPoolsMigrateUserTriggerSource { /// `CognitoEventUserPoolsCallerContext` contains information about the caller #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsCallerContext { @@ -262,11 +281,13 @@ pub struct CognitoEventUserPoolsCallerContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsHeader` contains common data from events sent by AWS Cognito User Pools #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsHeader { @@ -288,6 +309,7 @@ pub struct CognitoEventUserPoolsHeader { /// `CognitoEventUserPoolsPreSignupRequest` contains the request portion of a PreSignup event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreSignupRequest { @@ -306,11 +328,13 @@ pub struct CognitoEventUserPoolsPreSignupRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPreSignupResponse` contains the response portion of a PreSignup event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreSignupResponse { @@ -323,11 +347,13 @@ pub struct CognitoEventUserPoolsPreSignupResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPreAuthenticationRequest` contains the request portion of a PreAuthentication event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreAuthenticationRequest { @@ -343,11 +369,13 @@ pub struct CognitoEventUserPoolsPreAuthenticationRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPreAuthenticationResponse` contains the response portion of a PreAuthentication event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct CognitoEventUserPoolsPreAuthenticationResponse { /// Catchall to catch any additional fields that were present but not explicitly defined by this struct. @@ -356,10 +384,12 @@ pub struct CognitoEventUserPoolsPreAuthenticationResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPostConfirmationRequest` contains the request portion of a PostConfirmation event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPostConfirmationRequest { @@ -375,11 +405,13 @@ pub struct CognitoEventUserPoolsPostConfirmationRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPostConfirmationResponse` contains the response portion of a PostConfirmation event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct CognitoEventUserPoolsPostConfirmationResponse { /// Catchall to catch any additional fields that were present but not explicitly defined by this struct. @@ -388,11 +420,13 @@ pub struct CognitoEventUserPoolsPostConfirmationResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPreTokenGenRequest` contains request portion of PreTokenGen event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreTokenGenRequest { @@ -409,11 +443,13 @@ pub struct CognitoEventUserPoolsPreTokenGenRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPreTokenGenResponse` contains the response portion of a PreTokenGen event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreTokenGenResponse { @@ -424,12 +460,14 @@ pub struct CognitoEventUserPoolsPreTokenGenResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPreTokenGenV2` is sent by AWS Cognito User Pools when a user attempts to retrieve /// credentials, allowing a Lambda to perform insert, suppress or override claims. This is the Version 2 Payload #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreTokenGenV2 { @@ -444,11 +482,13 @@ pub struct CognitoEventUserPoolsPreTokenGenV2 { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPreTokenGenRequestV2` contains request portion of PreTokenGenV2 event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreTokenGenRequestV2 { @@ -466,10 +506,12 @@ pub struct CognitoEventUserPoolsPreTokenGenRequestV2 { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPreTokenGenResponseV2 { @@ -480,11 +522,13 @@ pub struct CognitoEventUserPoolsPreTokenGenResponseV2 { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ClaimsAndScopeOverrideDetailsV2` allows lambda to add, suppress or override claims in the token #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ClaimsAndScopeOverrideDetailsV2 { @@ -497,11 +541,13 @@ pub struct ClaimsAndScopeOverrideDetailsV2 { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoIdTokenGenerationV2` allows lambda to customize the ID Token before generation #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoIdTokenGenerationV2 { @@ -513,11 +559,13 @@ pub struct CognitoIdTokenGenerationV2 { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoAccessTokenGenerationV2` allows lambda to customize the Access Token before generation #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoAccessTokenGenerationV2 { @@ -531,11 +579,13 @@ pub struct CognitoAccessTokenGenerationV2 { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPostAuthenticationRequest` contains the request portion of a PostAuthentication event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsPostAuthenticationRequest { @@ -552,11 +602,13 @@ pub struct CognitoEventUserPoolsPostAuthenticationRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsPostAuthenticationResponse` contains the response portion of a PostAuthentication event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct CognitoEventUserPoolsPostAuthenticationResponse { /// Catchall to catch any additional fields that were present but not explicitly defined by this struct. @@ -565,10 +617,12 @@ pub struct CognitoEventUserPoolsPostAuthenticationResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsMigrateUserRequest` contains the request portion of a MigrateUser event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsMigrateUserRequest { @@ -586,11 +640,13 @@ pub struct CognitoEventUserPoolsMigrateUserRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsMigrateUserResponse` contains the response portion of a MigrateUser event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsMigrateUserResponse { @@ -611,11 +667,13 @@ pub struct CognitoEventUserPoolsMigrateUserResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ClaimsOverrideDetails` allows lambda to add, suppress or override claims in the token #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ClaimsOverrideDetails { @@ -630,11 +688,13 @@ pub struct ClaimsOverrideDetails { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `GroupConfiguration` allows lambda to override groups, roles and set a preferred role #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct GroupConfiguration { @@ -647,12 +707,14 @@ pub struct GroupConfiguration { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsChallengeResult` represents a challenge that is presented to the user in the authentication /// process that is underway, along with the corresponding result. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsChallengeResult { @@ -667,11 +729,13 @@ pub struct CognitoEventUserPoolsChallengeResult { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsDefineAuthChallengeRequest` defines auth challenge request parameters #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsDefineAuthChallengeRequest { @@ -690,11 +754,13 @@ pub struct CognitoEventUserPoolsDefineAuthChallengeRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsDefineAuthChallengeResponse` defines auth challenge response parameters #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsDefineAuthChallengeResponse { @@ -710,11 +776,13 @@ pub struct CognitoEventUserPoolsDefineAuthChallengeResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsDefineAuthChallenge` sent by AWS Cognito User Pools to initiate custom authentication flow #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsDefineAuthChallenge { @@ -730,6 +798,7 @@ pub struct CognitoEventUserPoolsDefineAuthChallenge { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -743,6 +812,7 @@ pub enum CognitoEventUserPoolsDefineAuthChallengeTriggerSource { /// `CognitoEventUserPoolsCreateAuthChallengeRequest` defines create auth challenge request parameters #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsCreateAuthChallengeRequest { @@ -763,11 +833,13 @@ pub struct CognitoEventUserPoolsCreateAuthChallengeRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsCreateAuthChallengeResponse` defines create auth challenge response parameters #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsCreateAuthChallengeResponse { @@ -785,11 +857,13 @@ pub struct CognitoEventUserPoolsCreateAuthChallengeResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsCreateAuthChallenge` sent by AWS Cognito User Pools to create a challenge to present to the user #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsCreateAuthChallenge { @@ -805,6 +879,7 @@ pub struct CognitoEventUserPoolsCreateAuthChallenge { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -818,6 +893,7 @@ pub enum CognitoEventUserPoolsCreateAuthChallengeTriggerSource { /// `CognitoEventUserPoolsVerifyAuthChallengeRequest` defines verify auth challenge request parameters #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsVerifyAuthChallengeRequest @@ -844,11 +920,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsVerifyAuthChallengeResponse` defines verify auth challenge response parameters #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsVerifyAuthChallengeResponse { @@ -860,12 +938,14 @@ pub struct CognitoEventUserPoolsVerifyAuthChallengeResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsVerifyAuthChallenge` sent by AWS Cognito User Pools to verify if the response from the end user /// for a custom Auth Challenge is valid or not #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsVerifyAuthChallenge { @@ -881,6 +961,7 @@ pub struct CognitoEventUserPoolsVerifyAuthChallenge { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -895,6 +976,7 @@ pub enum CognitoEventUserPoolsVerifyAuthChallengeTriggerSource { /// `CognitoEventUserPoolsCustomMessage` is sent by AWS Cognito User Pools before a verification or MFA message is sent, /// allowing a user to customize the message dynamically. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsCustomMessage { @@ -909,6 +991,7 @@ pub struct CognitoEventUserPoolsCustomMessage { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -934,6 +1017,7 @@ pub enum CognitoEventUserPoolsCustomMessageTriggerSource { /// `CognitoEventUserPoolsCustomMessageRequest` contains the request portion of a CustomMessage event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsCustomMessageRequest @@ -958,11 +1042,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `CognitoEventUserPoolsCustomMessageResponse` contains the response portion of a CustomMessage event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct CognitoEventUserPoolsCustomMessageResponse { @@ -978,6 +1064,7 @@ pub struct CognitoEventUserPoolsCustomMessageResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/config/mod.rs b/lambda-events/src/event/config/mod.rs index dda9afa3..81cfd438 100644 --- a/lambda-events/src/event/config/mod.rs +++ b/lambda-events/src/event/config/mod.rs @@ -1,9 +1,12 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; /// `ConfigEvent` contains data from an event sent from AWS Config #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ConfigEvent { @@ -43,6 +46,7 @@ pub struct ConfigEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/connect/mod.rs b/lambda-events/src/event/connect/mod.rs index b5f5fe3d..01c1ace6 100644 --- a/lambda-events/src/event/connect/mod.rs +++ b/lambda-events/src/event/connect/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -7,6 +9,7 @@ use crate::custom_serde::deserialize_lambda_map; /// `ConnectEvent` contains the data structure for a Connect event. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ConnectEvent { @@ -22,11 +25,13 @@ pub struct ConnectEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ConnectDetails` holds the details of a Connect event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ConnectDetails { @@ -43,11 +48,13 @@ pub struct ConnectDetails { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ConnectContactData` holds all of the contact information for the user that invoked the Connect event. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ConnectContactData { @@ -87,11 +94,13 @@ pub struct ConnectContactData { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ConnectEndpoint` represents routing information. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ConnectEndpoint { @@ -107,11 +116,13 @@ pub struct ConnectEndpoint { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ConnectQueue` represents a queue object. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ConnectQueue { @@ -127,6 +138,7 @@ pub struct ConnectQueue { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/commom_types.rs b/lambda-events/src/event/documentdb/events/commom_types.rs index 9624901d..16c31213 100644 --- a/lambda-events/src/event/documentdb/events/commom_types.rs +++ b/lambda-events/src/event/documentdb/events/commom_types.rs @@ -1,11 +1,13 @@ -use std::collections::HashMap; - +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; use serde_json::Value; +use std::collections::HashMap; pub type AnyDocument = HashMap; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct DatabaseCollection { @@ -18,10 +20,12 @@ pub struct DatabaseCollection { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct DocumentId { #[serde(rename = "_data")] @@ -32,10 +36,12 @@ pub struct DocumentId { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct DocumentKeyIdOid { #[serde(rename = "$oid")] @@ -46,10 +52,12 @@ pub struct DocumentKeyIdOid { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct DocumentKeyId { #[serde(rename = "_id")] @@ -60,10 +68,12 @@ pub struct DocumentKeyId { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct InnerTimestamp { t: usize, @@ -74,10 +84,12 @@ pub struct InnerTimestamp { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct Timestamp { #[serde(rename = "$timestamp")] @@ -88,5 +100,6 @@ pub struct Timestamp { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/delete_event.rs b/lambda-events/src/event/documentdb/events/delete_event.rs index 1c2e6afe..1bb61dc1 100644 --- a/lambda-events/src/event/documentdb/events/delete_event.rs +++ b/lambda-events/src/event/documentdb/events/delete_event.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use serde_json::Value; use super::commom_types::{AnyDocument, DatabaseCollection, DocumentId, DocumentKeyId, Timestamp}; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChangeDeleteEvent { @@ -26,5 +29,6 @@ pub struct ChangeDeleteEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/drop_database_event.rs b/lambda-events/src/event/documentdb/events/drop_database_event.rs index 2506f9cb..d1c12d49 100644 --- a/lambda-events/src/event/documentdb/events/drop_database_event.rs +++ b/lambda-events/src/event/documentdb/events/drop_database_event.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use serde_json::Value; use super::commom_types::{AnyDocument, DatabaseCollection, DocumentId, Timestamp}; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChangeDropDatabaseEvent { @@ -25,5 +28,6 @@ pub struct ChangeDropDatabaseEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/drop_event.rs b/lambda-events/src/event/documentdb/events/drop_event.rs index 42bb566b..5b01531f 100644 --- a/lambda-events/src/event/documentdb/events/drop_event.rs +++ b/lambda-events/src/event/documentdb/events/drop_event.rs @@ -1,9 +1,12 @@ use super::commom_types::{AnyDocument, DatabaseCollection, DocumentId, Timestamp}; +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChangeDropEvent { @@ -24,5 +27,6 @@ pub struct ChangeDropEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/insert_event.rs b/lambda-events/src/event/documentdb/events/insert_event.rs index 0c139220..0b560232 100644 --- a/lambda-events/src/event/documentdb/events/insert_event.rs +++ b/lambda-events/src/event/documentdb/events/insert_event.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use serde_json::Value; use super::commom_types::{AnyDocument, DatabaseCollection, DocumentId, DocumentKeyId, Timestamp}; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChangeInsertEvent { @@ -26,5 +29,6 @@ pub struct ChangeInsertEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/invalidate_event.rs b/lambda-events/src/event/documentdb/events/invalidate_event.rs index f721013e..9757c220 100644 --- a/lambda-events/src/event/documentdb/events/invalidate_event.rs +++ b/lambda-events/src/event/documentdb/events/invalidate_event.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use serde_json::Value; use super::commom_types::{DocumentId, Timestamp}; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChangeInvalidateEvent { @@ -19,5 +22,6 @@ pub struct ChangeInvalidateEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/rename_event.rs b/lambda-events/src/event/documentdb/events/rename_event.rs index 75797aca..b3b31184 100644 --- a/lambda-events/src/event/documentdb/events/rename_event.rs +++ b/lambda-events/src/event/documentdb/events/rename_event.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use serde_json::Value; use super::commom_types::{AnyDocument, DatabaseCollection, DocumentId, Timestamp}; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChangeRenameEvent { @@ -27,5 +30,6 @@ pub struct ChangeRenameEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/replace_event.rs b/lambda-events/src/event/documentdb/events/replace_event.rs index 0ff6ffba..75be2bf4 100644 --- a/lambda-events/src/event/documentdb/events/replace_event.rs +++ b/lambda-events/src/event/documentdb/events/replace_event.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use serde_json::Value; use super::commom_types::{AnyDocument, DatabaseCollection, DocumentId, DocumentKeyId, Timestamp}; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChangeReplaceEvent { @@ -26,5 +29,6 @@ pub struct ChangeReplaceEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/events/update_event.rs b/lambda-events/src/event/documentdb/events/update_event.rs index 8f6a48a9..1a0de1ed 100644 --- a/lambda-events/src/event/documentdb/events/update_event.rs +++ b/lambda-events/src/event/documentdb/events/update_event.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -5,6 +7,7 @@ use serde_json::Value; use super::commom_types::{AnyDocument, DatabaseCollection, DocumentId, DocumentKeyId, Timestamp}; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct UpdateTruncate { @@ -16,10 +19,12 @@ pub struct UpdateTruncate { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct UpdateDescription { @@ -32,10 +37,12 @@ pub struct UpdateDescription { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ChangeUpdateEvent { @@ -58,5 +65,6 @@ pub struct ChangeUpdateEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/documentdb/mod.rs b/lambda-events/src/event/documentdb/mod.rs index c802db62..a960acf7 100644 --- a/lambda-events/src/event/documentdb/mod.rs +++ b/lambda-events/src/event/documentdb/mod.rs @@ -5,6 +5,8 @@ use self::events::{ insert_event::ChangeInsertEvent, invalidate_event::ChangeInvalidateEvent, rename_event::ChangeRenameEvent, replace_event::ChangeReplaceEvent, update_event::ChangeUpdateEvent, }; +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -24,6 +26,7 @@ pub enum ChangeEvent { } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct DocumentDbInnerEvent { pub event: ChangeEvent, @@ -33,10 +36,12 @@ pub struct DocumentDbInnerEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct DocumentDbEvent { @@ -51,6 +56,7 @@ pub struct DocumentDbEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/dynamodb/mod.rs b/lambda-events/src/event/dynamodb/mod.rs index 5b2b2db5..4dd8ca7e 100644 --- a/lambda-events/src/event/dynamodb/mod.rs +++ b/lambda-events/src/event/dynamodb/mod.rs @@ -3,6 +3,8 @@ use crate::{ streams::DynamoDbBatchItemFailure, time_window::*, }; +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -124,6 +126,7 @@ impl fmt::Display for KeyType { /// The `Event` stream event handled to Lambda /// #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] pub struct Event { #[serde(rename = "Records")] @@ -134,12 +137,14 @@ pub struct Event { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `TimeWindowEvent` represents an Amazon Dynamodb event when using time windows /// ref. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct TimeWindowEvent { @@ -155,11 +160,13 @@ pub struct TimeWindowEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `TimeWindowEventResponse` is the outer structure to report batch item failures for DynamoDBTimeWindowEvent. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct TimeWindowEventResponse { @@ -173,11 +180,13 @@ pub struct TimeWindowEventResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// EventRecord stores information about each record of a DynamoDb stream event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct EventRecord { @@ -241,10 +250,12 @@ pub struct EventRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct UserIdentity { @@ -258,12 +269,14 @@ pub struct UserIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `DynamoDbStreamRecord` represents a description of a single data modification that was performed on an item /// in a DynamoDB table. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct StreamRecord { @@ -307,6 +320,7 @@ pub struct StreamRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/ecr_scan/mod.rs b/lambda-events/src/event/ecr_scan/mod.rs index b28678f4..588edc7e 100644 --- a/lambda-events/src/event/ecr_scan/mod.rs +++ b/lambda-events/src/event/ecr_scan/mod.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct EcrScanEvent { @@ -29,10 +32,12 @@ pub struct EcrScanEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct EcrScanEventDetailType { @@ -55,10 +60,12 @@ pub struct EcrScanEventDetailType { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct EcrScanEventFindingSeverityCounts { @@ -86,6 +93,7 @@ pub struct EcrScanEventFindingSeverityCounts { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/eventbridge/mod.rs b/lambda-events/src/event/eventbridge/mod.rs index 824de1ef..36dc43b0 100644 --- a/lambda-events/src/event/eventbridge/mod.rs +++ b/lambda-events/src/event/eventbridge/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; @@ -7,6 +9,7 @@ use serde_json::Value; /// /// See for structure details. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(bound(deserialize = "T1: DeserializeOwned"))] #[serde(rename_all = "kebab-case")] @@ -37,6 +40,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/firehose/mod.rs b/lambda-events/src/event/firehose/mod.rs index d0dec03d..a23c0f3d 100644 --- a/lambda-events/src/event/firehose/mod.rs +++ b/lambda-events/src/event/firehose/mod.rs @@ -2,6 +2,8 @@ use crate::{ custom_serde::deserialize_lambda_map, encodings::{Base64Data, MillisecondTimestamp}, }; +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -9,6 +11,7 @@ use std::collections::HashMap; /// `KinesisFirehoseEvent` represents the input event from Amazon Kinesis Firehose. It is used as the input parameter. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisFirehoseEvent { @@ -29,10 +32,12 @@ pub struct KinesisFirehoseEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisFirehoseEventRecord { @@ -48,10 +53,12 @@ pub struct KinesisFirehoseEventRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisFirehoseResponse { @@ -62,10 +69,12 @@ pub struct KinesisFirehoseResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisFirehoseResponseRecord { @@ -82,10 +91,12 @@ pub struct KinesisFirehoseResponseRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisFirehoseResponseRecordMetadata { @@ -98,10 +109,12 @@ pub struct KinesisFirehoseResponseRecordMetadata { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisFirehoseRecordMetadata { @@ -119,6 +132,7 @@ pub struct KinesisFirehoseRecordMetadata { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/iam/mod.rs b/lambda-events/src/event/iam/mod.rs index fd190950..9a04a8da 100644 --- a/lambda-events/src/event/iam/mod.rs +++ b/lambda-events/src/event/iam/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; #[cfg(feature = "catch-all-fields")] use serde_json::Value; use std::{borrow::Cow, collections::HashMap, fmt}; @@ -9,6 +11,7 @@ use serde::{ /// `IamPolicyDocument` represents an IAM policy document. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] pub struct IamPolicyDocument { @@ -21,11 +24,13 @@ pub struct IamPolicyDocument { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `IamPolicyStatement` represents one statement from IAM policy with action, effect and resource #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct IamPolicyStatement { @@ -44,6 +49,7 @@ pub struct IamPolicyStatement { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/iot/mod.rs b/lambda-events/src/event/iot/mod.rs index e1d7b504..81123b6e 100644 --- a/lambda-events/src/event/iot/mod.rs +++ b/lambda-events/src/event/iot/mod.rs @@ -1,4 +1,6 @@ use crate::{custom_serde::serialize_headers, encodings::Base64Data, iam::IamPolicyDocument}; +#[cfg(feature = "builders")] +use bon::Builder; use http::HeaderMap; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -7,6 +9,7 @@ use serde_json::Value; /// `IoTCoreCustomAuthorizerRequest` represents the request to an IoT Core custom authorizer. /// See #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCoreCustomAuthorizerRequest { @@ -22,10 +25,12 @@ pub struct IoTCoreCustomAuthorizerRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCoreProtocolData { @@ -38,10 +43,12 @@ pub struct IoTCoreProtocolData { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCoreTlsContext { @@ -53,10 +60,12 @@ pub struct IoTCoreTlsContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCoreHttpContext { @@ -71,10 +80,12 @@ pub struct IoTCoreHttpContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCoreMqttContext { @@ -89,10 +100,12 @@ pub struct IoTCoreMqttContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCoreConnectionMetadata { @@ -104,12 +117,14 @@ pub struct IoTCoreConnectionMetadata { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `IoTCoreCustomAuthorizerResponse` represents the response from an IoT Core custom authorizer. /// See #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCoreCustomAuthorizerResponse { @@ -125,6 +140,7 @@ pub struct IoTCoreCustomAuthorizerResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/iot_1_click/mod.rs b/lambda-events/src/event/iot_1_click/mod.rs index a88041c0..981e1e66 100644 --- a/lambda-events/src/event/iot_1_click/mod.rs +++ b/lambda-events/src/event/iot_1_click/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -8,6 +10,7 @@ use crate::custom_serde::deserialize_lambda_map; /// `IoTOneClickEvent` represents a click event published by clicking button type /// device. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTOneClickEvent { @@ -20,10 +23,12 @@ pub struct IoTOneClickEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTOneClickDeviceEvent { @@ -34,10 +39,12 @@ pub struct IoTOneClickDeviceEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTOneClickButtonClicked { @@ -51,10 +58,12 @@ pub struct IoTOneClickButtonClicked { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTOneClickDeviceInfo { @@ -72,10 +81,12 @@ pub struct IoTOneClickDeviceInfo { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTOneClickPlacementInfo { @@ -95,6 +106,7 @@ pub struct IoTOneClickPlacementInfo { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/iot_button/mod.rs b/lambda-events/src/event/iot_button/mod.rs index 70a24f9d..75ad7ca3 100644 --- a/lambda-events/src/event/iot_button/mod.rs +++ b/lambda-events/src/event/iot_button/mod.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTButtonEvent { @@ -18,6 +21,7 @@ pub struct IoTButtonEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/iot_deprecated/mod.rs b/lambda-events/src/event/iot_deprecated/mod.rs index 22b13db9..e29bfab1 100644 --- a/lambda-events/src/event/iot_deprecated/mod.rs +++ b/lambda-events/src/event/iot_deprecated/mod.rs @@ -1,4 +1,6 @@ use crate::iot::*; +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -6,6 +8,7 @@ use serde_json::Value; /// `IoTCustomAuthorizerRequest` contains data coming in to a custom IoT device gateway authorizer function. /// Deprecated: Use IoTCoreCustomAuthorizerRequest instead. `IoTCustomAuthorizerRequest` does not correctly model the request schema #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCustomAuthorizerRequest { @@ -23,6 +26,7 @@ pub struct IoTCustomAuthorizerRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -35,6 +39,7 @@ pub type IoTTlsContext = IoTCoreTlsContext; /// `IoTCustomAuthorizerResponse` represents the expected format of an IoT device gateway authorization response. /// Deprecated: Use IoTCoreCustomAuthorizerResponse. `IoTCustomAuthorizerResponse` does not correctly model the response schema. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct IoTCustomAuthorizerResponse { @@ -50,5 +55,6 @@ pub struct IoTCustomAuthorizerResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/kafka/mod.rs b/lambda-events/src/event/kafka/mod.rs index ecd02d87..5b71253c 100644 --- a/lambda-events/src/event/kafka/mod.rs +++ b/lambda-events/src/event/kafka/mod.rs @@ -1,10 +1,13 @@ use crate::{custom_serde::deserialize_lambda_map, encodings::MillisecondTimestamp}; +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; use std::collections::HashMap; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KafkaEvent { @@ -23,10 +26,12 @@ pub struct KafkaEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KafkaRecord { @@ -46,6 +51,7 @@ pub struct KafkaRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/kinesis/analytics.rs b/lambda-events/src/event/kinesis/analytics.rs index 9ca62f69..ae438113 100644 --- a/lambda-events/src/event/kinesis/analytics.rs +++ b/lambda-events/src/event/kinesis/analytics.rs @@ -1,9 +1,12 @@ use crate::encodings::Base64Data; +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisAnalyticsOutputDeliveryEvent { @@ -18,10 +21,12 @@ pub struct KinesisAnalyticsOutputDeliveryEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisAnalyticsOutputDeliveryEventRecord { @@ -34,10 +39,12 @@ pub struct KinesisAnalyticsOutputDeliveryEventRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisAnalyticsOutputDeliveryResponse { @@ -48,10 +55,12 @@ pub struct KinesisAnalyticsOutputDeliveryResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisAnalyticsOutputDeliveryResponseRecord { @@ -66,5 +75,6 @@ pub struct KinesisAnalyticsOutputDeliveryResponseRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/kinesis/event.rs b/lambda-events/src/event/kinesis/event.rs index 215e9288..09b54eb4 100644 --- a/lambda-events/src/event/kinesis/event.rs +++ b/lambda-events/src/event/kinesis/event.rs @@ -2,11 +2,14 @@ use crate::{ encodings::{Base64Data, SecondTimestamp}, time_window::{TimeWindowEventResponseProperties, TimeWindowProperties}, }; +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Default, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisEvent { @@ -18,12 +21,14 @@ pub struct KinesisEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `KinesisTimeWindowEvent` represents an Amazon Dynamodb event when using time windows /// ref. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisTimeWindowEvent { @@ -39,11 +44,13 @@ pub struct KinesisTimeWindowEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `KinesisTimeWindowEventResponse` is the outer structure to report batch item failures for KinesisTimeWindowEvent. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisTimeWindowEventResponse { @@ -57,10 +64,12 @@ pub struct KinesisTimeWindowEventResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisEventRecord { @@ -90,10 +99,12 @@ pub struct KinesisEventRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisRecord { @@ -113,6 +124,7 @@ pub struct KinesisRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/lambda_function_urls/mod.rs b/lambda-events/src/event/lambda_function_urls/mod.rs index f5771623..0cf1ceed 100644 --- a/lambda-events/src/event/lambda_function_urls/mod.rs +++ b/lambda-events/src/event/lambda_function_urls/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use http::HeaderMap; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -8,6 +10,7 @@ use crate::custom_serde::{deserialize_lambda_map, serialize_headers}; /// `LambdaFunctionUrlRequest` contains data coming from the HTTP request to a Lambda Function URL. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LambdaFunctionUrlRequest { @@ -34,11 +37,13 @@ pub struct LambdaFunctionUrlRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `LambdaFunctionUrlRequestContext` contains the information to identify the AWS account and resources invoking the Lambda function. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LambdaFunctionUrlRequestContext { @@ -67,11 +72,13 @@ pub struct LambdaFunctionUrlRequestContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `LambdaFunctionUrlRequestContextAuthorizerDescription` contains authorizer information for the request context. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LambdaFunctionUrlRequestContextAuthorizerDescription { @@ -82,11 +89,13 @@ pub struct LambdaFunctionUrlRequestContextAuthorizerDescription { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `LambdaFunctionUrlRequestContextAuthorizerIamDescription` contains IAM information for the request context. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LambdaFunctionUrlRequestContextAuthorizerIamDescription { @@ -106,11 +115,13 @@ pub struct LambdaFunctionUrlRequestContextAuthorizerIamDescription { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `LambdaFunctionUrlRequestContextHttpDescription` contains HTTP information for the request context. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LambdaFunctionUrlRequestContextHttpDescription { @@ -130,11 +141,13 @@ pub struct LambdaFunctionUrlRequestContextHttpDescription { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `LambdaFunctionUrlResponse` configures the HTTP response to be returned by Lambda Function URL for the request. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LambdaFunctionUrlResponse { @@ -152,5 +165,6 @@ pub struct LambdaFunctionUrlResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/lex/mod.rs b/lambda-events/src/event/lex/mod.rs index b64279d7..d48ae117 100644 --- a/lambda-events/src/event/lex/mod.rs +++ b/lambda-events/src/event/lex/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -6,6 +8,7 @@ use std::collections::HashMap; use crate::custom_serde::deserialize_lambda_map; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LexEvent { @@ -29,10 +32,12 @@ pub struct LexEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LexBot { @@ -45,10 +50,12 @@ pub struct LexBot { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LexCurrentIntent { @@ -65,10 +72,12 @@ pub struct LexCurrentIntent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LexAlternativeIntents { @@ -85,10 +94,12 @@ pub struct LexAlternativeIntents { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SlotDetail { @@ -100,10 +111,12 @@ pub struct SlotDetail { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LexDialogAction { @@ -122,6 +135,7 @@ pub struct LexDialogAction { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -130,6 +144,7 @@ pub type SessionAttributes = HashMap; pub type Slots = HashMap>; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LexResponse { @@ -141,10 +156,12 @@ pub struct LexResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct LexResponseCard { @@ -157,10 +174,12 @@ pub struct LexResponseCard { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct Attachment { @@ -175,6 +194,7 @@ pub struct Attachment { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/rabbitmq/mod.rs b/lambda-events/src/event/rabbitmq/mod.rs index 5b75e3c2..e9a07088 100644 --- a/lambda-events/src/event/rabbitmq/mod.rs +++ b/lambda-events/src/event/rabbitmq/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; @@ -5,6 +7,7 @@ use std::collections::HashMap; use crate::custom_serde::deserialize_lambda_map; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct RabbitMqEvent { @@ -22,10 +25,12 @@ pub struct RabbitMqEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct RabbitMqMessage { @@ -39,10 +44,12 @@ pub struct RabbitMqMessage { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct RabbitMqBasicProperties @@ -79,6 +86,7 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/s3/batch_job.rs b/lambda-events/src/event/s3/batch_job.rs index 9b8f419b..a6d3b12a 100644 --- a/lambda-events/src/event/s3/batch_job.rs +++ b/lambda-events/src/event/s3/batch_job.rs @@ -1,9 +1,12 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; /// `S3BatchJobEvent` encapsulates the detail of a s3 batch job #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3BatchJobEvent { @@ -19,11 +22,13 @@ pub struct S3BatchJobEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `S3BatchJob` whichs have the job id #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3BatchJob { @@ -35,11 +40,13 @@ pub struct S3BatchJob { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `S3BatchJobTask` represents one task in the s3 batch job and have all task details #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3BatchJobTask { @@ -57,11 +64,13 @@ pub struct S3BatchJobTask { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `S3BatchJobResponse` is the response of a iven s3 batch job with the results #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3BatchJobResponse { @@ -78,11 +87,13 @@ pub struct S3BatchJobResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `S3BatchJobResult` represents the result of a given task #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3BatchJobResult { @@ -98,5 +109,6 @@ pub struct S3BatchJobResult { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/s3/event.rs b/lambda-events/src/event/s3/event.rs index 68b9aee7..d93a27f8 100644 --- a/lambda-events/src/event/s3/event.rs +++ b/lambda-events/src/event/s3/event.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -8,6 +10,7 @@ use crate::custom_serde::deserialize_lambda_map; /// `S3Event` which wrap an array of `S3Event`Record #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3Event { @@ -19,11 +22,13 @@ pub struct S3Event { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `S3EventRecord` which wrap record data #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3EventRecord { @@ -49,10 +54,12 @@ pub struct S3EventRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3UserIdentity { @@ -64,10 +71,12 @@ pub struct S3UserIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3RequestParameters { @@ -80,10 +89,12 @@ pub struct S3RequestParameters { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3Entity { @@ -100,10 +111,12 @@ pub struct S3Entity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3Bucket { @@ -119,10 +132,12 @@ pub struct S3Bucket { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3Object { @@ -143,6 +158,7 @@ pub struct S3Object { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/s3/object_lambda.rs b/lambda-events/src/event/s3/object_lambda.rs index be52e1f8..8464fcae 100644 --- a/lambda-events/src/event/s3/object_lambda.rs +++ b/lambda-events/src/event/s3/object_lambda.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use http::HeaderMap; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::Value; @@ -8,6 +10,7 @@ use crate::custom_serde::{deserialize_headers, serialize_headers}; /// `S3ObjectLambdaEvent` contains data coming from S3 object lambdas /// See: #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct S3ObjectLambdaEvent

@@ -31,12 +34,14 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `GetObjectContext` contains the input and output details /// for connections to Amazon S3 and S3 Object Lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct GetObjectContext { @@ -49,12 +54,14 @@ pub struct GetObjectContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `HeadObjectContext` /// for connections to Amazon S3 and S3 Object Lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct HeadObjectContext { @@ -65,12 +72,14 @@ pub struct HeadObjectContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ListObjectsContext` /// for connections to Amazon S3 and S3 Object Lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ListObjectsContext { @@ -81,12 +90,14 @@ pub struct ListObjectsContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `ListObjectsV2Context` /// for connections to Amazon S3 and S3 Object Lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ListObjectsV2Context { @@ -97,11 +108,13 @@ pub struct ListObjectsV2Context { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `Configuration` contains information about the Object Lambda access point #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct Configuration

@@ -119,11 +132,13 @@ where #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `UserRequest` contains information about the original call to S3 Object Lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct UserRequest { @@ -137,11 +152,13 @@ pub struct UserRequest { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `UserIdentity` contains details about the identity that made the call to S3 Object Lambda #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct UserIdentity { @@ -157,10 +174,12 @@ pub struct UserIdentity { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SessionContext { @@ -173,10 +192,12 @@ pub struct SessionContext { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SessionIssuer { @@ -191,6 +212,7 @@ pub struct SessionIssuer { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/secretsmanager/mod.rs b/lambda-events/src/event/secretsmanager/mod.rs index 9502d654..0507467f 100644 --- a/lambda-events/src/event/secretsmanager/mod.rs +++ b/lambda-events/src/event/secretsmanager/mod.rs @@ -1,8 +1,11 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] pub struct SecretsManagerSecretRotationEvent { @@ -15,6 +18,7 @@ pub struct SecretsManagerSecretRotationEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/ses/mod.rs b/lambda-events/src/event/ses/mod.rs index 31a55ea3..a088f2fe 100644 --- a/lambda-events/src/event/ses/mod.rs +++ b/lambda-events/src/event/ses/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -5,6 +7,7 @@ use serde_json::Value; /// `SimpleEmailEvent` is the outer structure of an event sent via SES. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailEvent { @@ -16,10 +19,12 @@ pub struct SimpleEmailEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailRecord { @@ -34,10 +39,12 @@ pub struct SimpleEmailRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailService { @@ -50,10 +57,12 @@ pub struct SimpleEmailService { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailMessage { @@ -72,10 +81,12 @@ pub struct SimpleEmailMessage { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailReceipt { @@ -96,10 +107,12 @@ pub struct SimpleEmailReceipt { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailHeader { @@ -113,10 +126,12 @@ pub struct SimpleEmailHeader { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailCommonHeaders { @@ -136,6 +151,7 @@ pub struct SimpleEmailCommonHeaders { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -144,6 +160,7 @@ pub struct SimpleEmailCommonHeaders { /// present for the Lambda Type, and the BucketName and ObjectKey fields are only /// present for the S3 Type. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailReceiptAction { @@ -165,10 +182,12 @@ pub struct SimpleEmailReceiptAction { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailVerdict { @@ -180,6 +199,7 @@ pub struct SimpleEmailVerdict { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -187,6 +207,7 @@ pub type SimpleEmailDispositionValue = String; /// `SimpleEmailDisposition` disposition return for SES to control rule functions #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SimpleEmailDisposition { @@ -197,6 +218,7 @@ pub struct SimpleEmailDisposition { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/sns/mod.rs b/lambda-events/src/event/sns/mod.rs index d40dd45c..3e752259 100644 --- a/lambda-events/src/event/sns/mod.rs +++ b/lambda-events/src/event/sns/mod.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "builders")] +use bon::Builder; use chrono::{DateTime, Utc}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] @@ -10,6 +12,7 @@ use crate::custom_serde::{deserialize_lambda_map, deserialize_nullish_boolean}; /// /// [https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html](https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html) #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct SnsEvent { @@ -21,11 +24,13 @@ pub struct SnsEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// SnsRecord stores information about each record of a SNS event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct SnsRecord { @@ -47,11 +52,13 @@ pub struct SnsRecord { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// SnsMessage stores information about each record of a SNS event #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct SnsMessage { @@ -104,6 +111,7 @@ pub struct SnsMessage { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -111,6 +119,7 @@ pub struct SnsMessage { /// /// [https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html](https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html) #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] #[serde(bound(deserialize = "T: DeserializeOwned"))] @@ -123,11 +132,13 @@ pub struct SnsEventObj { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// Alternative to `SnsRecord`, used alongside `SnsEventObj` and `SnsMessageObj` when deserializing nested objects from within SNS messages) #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] #[serde(bound(deserialize = "T: DeserializeOwned"))] @@ -150,11 +161,13 @@ pub struct SnsRecordObj { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// Alternate version of `SnsMessage` to use in conjunction with `SnsEventObj` and `SnsRecordObj` for deserializing the message into a struct of type `T` #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[serde_with::serde_as] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] @@ -211,6 +224,7 @@ pub struct SnsMessageObj { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -220,6 +234,7 @@ pub struct SnsMessageObj { /// /// Additional details can be found in the [SNS Developer Guide](https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html) #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct MessageAttribute { /// The data type of the attribute. Per the [SNS Developer Guide](https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html), lambda notifications, this will only be **String** or **Binary**. @@ -236,10 +251,12 @@ pub struct MessageAttribute { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CloudWatchAlarmPayload { @@ -260,10 +277,12 @@ pub struct CloudWatchAlarmPayload { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CloudWatchAlarmTrigger { @@ -288,10 +307,12 @@ pub struct CloudWatchAlarmTrigger { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CloudWatchMetricDataQuery { @@ -308,10 +329,12 @@ pub struct CloudWatchMetricDataQuery { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CloudWatchMetricStat { @@ -325,10 +348,12 @@ pub struct CloudWatchMetricStat { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct CloudWatchMetric { @@ -342,10 +367,12 @@ pub struct CloudWatchMetric { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct CloudWatchDimension { pub name: String, @@ -356,6 +383,7 @@ pub struct CloudWatchDimension { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } diff --git a/lambda-events/src/event/sqs/mod.rs b/lambda-events/src/event/sqs/mod.rs index c53f77ef..37a122df 100644 --- a/lambda-events/src/event/sqs/mod.rs +++ b/lambda-events/src/event/sqs/mod.rs @@ -1,4 +1,6 @@ use crate::{custom_serde::deserialize_lambda_map, encodings::Base64Data}; +#[cfg(feature = "builders")] +use bon::Builder; use serde::{de::DeserializeOwned, Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; @@ -6,6 +8,7 @@ use std::collections::HashMap; /// The Event sent to Lambda from SQS. Contains 1 or more individual SQS Messages #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SqsEvent { @@ -16,12 +19,14 @@ pub struct SqsEvent { /// If `catch-all-fields` is disabled, any additional fields that are present will be ignored. #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] + #[cfg_attr(feature = "builders", builder(default))] #[serde(flatten)] pub other: serde_json::Map, } /// An individual SQS Message, its metadata, and Message Attributes #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SqsMessage { @@ -55,11 +60,13 @@ pub struct SqsMessage { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// Alternative to `SqsEvent` to be used alongside `SqsMessageObj` when you need to deserialize a nested object into a struct of type `T` within the SQS Message rather than just using the raw SQS Message string #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] #[serde(bound(deserialize = "T: DeserializeOwned"))] @@ -73,11 +80,13 @@ pub struct SqsEventObj { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// Alternative to `SqsMessage` to be used alongside `SqsEventObj` when you need to deserialize a nested object into a struct of type `T` within the SQS Message rather than just using the raw SQS Message string #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[serde_with::serde_as] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(bound(deserialize = "T: DeserializeOwned"))] @@ -116,10 +125,12 @@ pub struct SqsMessageObj { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SqsMessageAttribute { @@ -137,10 +148,12 @@ pub struct SqsMessageAttribute { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SqsBatchResponse { @@ -151,6 +164,7 @@ pub struct SqsBatchResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -267,6 +281,7 @@ impl SqsBatchResponse { } #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct BatchItemFailure { @@ -277,11 +292,13 @@ pub struct BatchItemFailure { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// The Event sent to Lambda from the SQS API. Contains 1 or more individual SQS Messages #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] #[serde(bound(deserialize = "T: DeserializeOwned"))] @@ -294,11 +311,13 @@ pub struct SqsApiEventObj { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// The Event sent to Lambda from SQS API. Contains 1 or more individual SQS Messages #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct SqsApiEvent { @@ -309,6 +328,7 @@ pub struct SqsApiEvent { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -316,6 +336,7 @@ pub struct SqsApiEvent { /// deserialize a nested object into a struct of type T within the SQS Message rather /// than just using the raw SQS Message string #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[serde_with::serde_as] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(bound(deserialize = "T: DeserializeOwned"))] @@ -346,11 +367,13 @@ pub struct SqsApiMessageObj { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// An individual SQS API Message, its metadata, and Message Attributes #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] pub struct SqsApiMessage { @@ -377,6 +400,7 @@ pub struct SqsApiMessage { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -476,4 +500,52 @@ mod test { assert_eq!(response.batch_item_failures.len(), 1); assert_eq!(response.batch_item_failures[0].item_identifier, "msg-4"); } + + #[test] + #[cfg(all(feature = "sqs", feature = "builders"))] + fn test_bon_sqs_event_builder() { + let event = SqsEvent::builder() + .records(vec![SqsMessage::builder() + .message_id("test-123".to_string()) + .body("Hello World".to_string()) + .attributes(std::collections::HashMap::new()) + .message_attributes(std::collections::HashMap::new()) + .build()]) + .build(); + + assert_eq!(event.records.len(), 1); + assert_eq!(event.records[0].message_id, Some("test-123".to_string())); + assert_eq!(event.records[0].body, Some("Hello World".to_string())); + } + + #[test] + #[cfg(all(feature = "sqs", feature = "builders"))] + fn test_bon_sqs_message_builder() { + let message = SqsMessage::builder() + .message_id("msg-456".to_string()) + .receipt_handle("receipt-handle".to_string()) + .body("Test message body".to_string()) + .attributes(std::collections::HashMap::new()) + .message_attributes(std::collections::HashMap::new()) + .build(); + + assert_eq!(message.message_id, Some("msg-456".to_string())); + assert_eq!(message.receipt_handle, Some("receipt-handle".to_string())); + assert_eq!(message.body, Some("Test message body".to_string())); + } + + #[test] + #[cfg(all(feature = "sqs", feature = "builders"))] + fn test_bon_minimal_builder() { + // Only required fields (non-Option fields with no default) + let message = SqsMessage::builder() + .attributes(std::collections::HashMap::new()) + .message_attributes(std::collections::HashMap::new()) + .build(); + + // All Option fields should be None + assert_eq!(message.message_id, None); + assert_eq!(message.body, None); + assert!(message.attributes.is_empty()); + } } diff --git a/lambda-events/src/event/streams/mod.rs b/lambda-events/src/event/streams/mod.rs index 0e174564..b6be8b1d 100644 --- a/lambda-events/src/event/streams/mod.rs +++ b/lambda-events/src/event/streams/mod.rs @@ -1,9 +1,12 @@ +#[cfg(feature = "builders")] +use bon::Builder; use serde::{Deserialize, Serialize}; #[cfg(feature = "catch-all-fields")] use serde_json::Value; /// `KinesisEventResponse` is the outer structure to report batch item failures for KinesisEvent. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisEventResponse { @@ -14,6 +17,7 @@ pub struct KinesisEventResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } @@ -67,6 +71,7 @@ impl KinesisEventResponse { /// `KinesisBatchItemFailure` is the individual record which failed processing. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct KinesisBatchItemFailure { @@ -78,11 +83,13 @@ pub struct KinesisBatchItemFailure { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `DynamoDbEventResponse` is the outer structure to report batch item failures for DynamoDBEvent. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct DynamoDbEventResponse { @@ -93,11 +100,13 @@ pub struct DynamoDbEventResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `DynamoDbBatchItemFailure` is the individual record which failed processing. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct DynamoDbBatchItemFailure { @@ -109,11 +118,13 @@ pub struct DynamoDbBatchItemFailure { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `SqsEventResponse` is the outer structure to report batch item failures for SQSEvent. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SqsEventResponse { @@ -124,11 +135,13 @@ pub struct SqsEventResponse { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, } /// `SqsBatchItemFailure` is the individual record which failed processing. #[non_exhaustive] +#[cfg_attr(feature = "builders", derive(Builder))] #[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SqsBatchItemFailure { @@ -140,6 +153,7 @@ pub struct SqsBatchItemFailure { #[cfg(feature = "catch-all-fields")] #[cfg_attr(docsrs, doc(cfg(feature = "catch-all-fields")))] #[serde(flatten)] + #[cfg_attr(feature = "builders", builder(default))] pub other: serde_json::Map, }