Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lambda-events/src/encodings/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde::{
use std::ops::{Deref, DerefMut};

/// Timestamp with millisecond precision.
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[derive(Clone, Default, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct MillisecondTimestamp(
#[serde(deserialize_with = "deserialize_milliseconds")]
#[serde(serialize_with = "serialize_milliseconds")]
Expand Down Expand Up @@ -73,7 +73,7 @@ impl DerefMut for SecondDuration {
}

/// Duration with minute precision.
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[derive(Clone, Default, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct MinuteDuration(
#[serde(deserialize_with = "deserialize_duration_minutes")]
#[serde(serialize_with = "serialize_duration_minutes")]
Expand Down
6 changes: 3 additions & 3 deletions lambda-events/src/event/activemq/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::collections::HashMap;

use crate::custom_serde::deserialize_lambda_map;

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ActiveMqEvent {
#[serde(default)]
Expand All @@ -22,7 +22,7 @@ pub struct ActiveMqEvent {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ActiveMqMessage {
#[serde(default)]
Expand Down Expand Up @@ -59,7 +59,7 @@ pub struct ActiveMqMessage {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ActiveMqDestination {
#[serde(default)]
Expand Down
2 changes: 1 addition & 1 deletion lambda-events/src/event/autoscaling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::collections::HashMap;
use crate::custom_serde::deserialize_lambda_map;

/// `AutoScalingEvent` struct is used to parse the json for auto scaling event types //
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct AutoScalingEvent<T1 = Value>
where
Expand Down
8 changes: 4 additions & 4 deletions lambda-events/src/event/chime_bot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
#[cfg(feature = "catch-all-fields")]
use serde_json::Value;

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ChimeBotEvent {
#[serde(rename = "Sender")]
Expand All @@ -28,7 +28,7 @@ pub struct ChimeBotEvent {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ChimeBotEventSender {
#[serde(default)]
Expand All @@ -46,7 +46,7 @@ pub struct ChimeBotEventSender {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ChimeBotEventDiscussion {
#[serde(default)]
Expand All @@ -64,7 +64,7 @@ pub struct ChimeBotEventDiscussion {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ChimeBotEventInboundHttpsEndpoint {
#[serde(default)]
Expand Down
13 changes: 10 additions & 3 deletions lambda-events/src/event/cloudformation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ where
Delete(DeleteRequest<P2>),
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
impl Default for CloudFormationCustomResourceRequest {
fn default() -> Self {
CloudFormationCustomResourceRequest::Create(CreateRequest::default())
}
}

#[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct CreateRequest<P2 = Value>
where
Expand Down Expand Up @@ -99,7 +105,7 @@ where
pub other: serde_json::Map<String, Value>,
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct CloudFormationCustomResourceResponse {
pub status: CloudFormationCustomResourceResponseStatus,
Expand All @@ -119,9 +125,10 @@ pub struct CloudFormationCustomResourceResponse {
pub other: serde_json::Map<String, Value>,
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum CloudFormationCustomResourceResponseStatus {
#[default]
Success,
Failed,
}
Expand Down
12 changes: 9 additions & 3 deletions lambda-events/src/event/cloudformation/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ where
Delete(DeleteRequest<P2>),
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
impl Default for CloudFormationCustomResourceRequest {
fn default() -> Self {
CloudFormationCustomResourceRequest::Create(CreateRequest::default())
}
}

#[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct CreateRequest<P2 = Value>
where
Expand Down Expand Up @@ -63,7 +69,7 @@ where
// No `other` catch-all here; any additional fields will be caught in `common.other` instead
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct CommonRequestParams<P2 = Value>
where
Expand All @@ -84,7 +90,7 @@ where
pub other: serde_json::Map<String, Value>,
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, Default)]
#[derive(Clone, Default, Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct CloudFormationCustomResourceResponse<D = Value>
where
Expand Down
2 changes: 1 addition & 1 deletion lambda-events/src/event/cloudwatch_events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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 <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html>
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[derive(Clone, Default, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CloudWatchEvent<T1 = Value>
where
Expand Down
2 changes: 1 addition & 1 deletion lambda-events/src/event/code_commit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use serde_json::Value;
use crate::custom_serde::deserialize_nullish_boolean;

/// `CodeCommitEvent` represents a CodeCommit event
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeCommitEvent {
#[serde(rename = "Records")]
Expand Down
14 changes: 7 additions & 7 deletions lambda-events/src/event/codebuild/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub type CodeBuildPhaseType = String;

/// `CodeBuildEvent` is documented at:
/// <https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html#sample-build-notifications-ref>
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeBuildEvent {
/// AccountID is the id of the AWS account from which the event originated.
Expand Down Expand Up @@ -54,7 +54,7 @@ pub struct CodeBuildEvent {
}

/// `CodeBuildEventDetail` represents the all details related to the code build event
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeBuildEventDetail {
#[serde(rename = "build-status")]
Expand Down Expand Up @@ -101,7 +101,7 @@ pub struct CodeBuildEventDetail {
}

/// `CodeBuildEventAdditionalInformation` represents additional information to the code build event
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeBuildEventAdditionalInformation {
pub artifact: CodeBuildArtifact,
Expand Down Expand Up @@ -133,7 +133,7 @@ pub struct CodeBuildEventAdditionalInformation {
}

/// `CodeBuildArtifact` represents the artifact provided to build
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeBuildArtifact {
#[serde(default)]
Expand All @@ -154,7 +154,7 @@ pub struct CodeBuildArtifact {
}

/// `CodeBuildEnvironment` represents the environment for a build
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeBuildEnvironment {
#[serde(default)]
Expand Down Expand Up @@ -200,7 +200,7 @@ pub struct CodeBuildEnvironmentVariable {
}

/// `CodeBuildSource` represent the code source will be build
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeBuildSource {
#[serde(default)]
Expand All @@ -217,7 +217,7 @@ pub struct CodeBuildSource {
}

/// `CodeBuildLogs` gives the log details of a code build
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeBuildLogs {
#[serde(default)]
Expand Down
6 changes: 3 additions & 3 deletions lambda-events/src/event/codedeploy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub type CodeDeployDeploymentState = String;

/// `CodeDeployEvent` is documented at:
/// <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html#acd_event_types>
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeDeployEvent {
/// AccountID is the id of the AWS account from which the event originated.
Expand Down Expand Up @@ -49,7 +49,7 @@ pub struct CodeDeployEvent {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodeDeployEventDetail {
/// InstanceGroupID is the ID of the instance group.
Expand Down Expand Up @@ -81,7 +81,7 @@ pub struct CodeDeployEventDetail {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq)]
#[derive(Debug, Default, Clone, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct CodeDeployLifecycleEvent {
pub deployment_id: String,
Expand Down
6 changes: 3 additions & 3 deletions lambda-events/src/event/codepipeline_cloudwatch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub type CodePipelineActionState = String;

/// CodePipelineEvent is documented at:
/// <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html#codepipeline_event_type>
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineCloudWatchEvent {
/// Version is the version of the event's schema.
Expand Down Expand Up @@ -53,7 +53,7 @@ pub struct CodePipelineCloudWatchEvent {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineEventDetail {
#[serde(default)]
Expand All @@ -80,7 +80,7 @@ pub struct CodePipelineEventDetail {
pub other: serde_json::Map<String, Value>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineEventDetailType {
#[serde(default)]
Expand Down
22 changes: 11 additions & 11 deletions lambda-events/src/event/codepipeline_job/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use serde_json::Value;

/// `CodePipelineJobEvent` contains data from an event sent from AWS CodePipeline
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineJobEvent {
#[serde(rename = "CodePipeline.job")]
Expand All @@ -18,7 +18,7 @@ pub struct CodePipelineJobEvent {
}

/// `CodePipelineJob` represents a job from an AWS CodePipeline event
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineJob {
#[serde(default)]
Expand All @@ -36,7 +36,7 @@ pub struct CodePipelineJob {
}

/// `CodePipelineData` represents a job from an AWS CodePipeline event
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineData {
pub action_configuration: CodePipelineActionConfiguration,
Expand All @@ -56,7 +56,7 @@ pub struct CodePipelineData {
}

/// `CodePipelineActionConfiguration` represents an Action Configuration
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineActionConfiguration {
pub configuration: CodePipelineConfiguration,
Expand All @@ -70,7 +70,7 @@ pub struct CodePipelineActionConfiguration {
}

/// `CodePipelineConfiguration` represents a configuration for an Action Configuration
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineConfiguration {
#[serde(default)]
Expand All @@ -89,7 +89,7 @@ pub struct CodePipelineConfiguration {
}

/// `CodePipelineInputArtifact` represents an input artifact
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineInputArtifact {
pub location: CodePipelineInputLocation,
Expand All @@ -106,7 +106,7 @@ pub struct CodePipelineInputArtifact {
}

/// `CodePipelineInputLocation` represents a input location
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineInputLocation {
pub s3_location: CodePipelineS3Location,
Expand All @@ -123,7 +123,7 @@ pub struct CodePipelineInputLocation {
}

/// `CodePipelineS3Location` represents an s3 input location
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineS3Location {
#[serde(default)]
Expand All @@ -140,7 +140,7 @@ pub struct CodePipelineS3Location {
}

/// `CodePipelineOutputArtifact` represents an output artifact
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineOutputArtifact {
pub location: CodePipelineInputLocation,
Expand All @@ -157,7 +157,7 @@ pub struct CodePipelineOutputArtifact {
}

/// `CodePipelineOutputLocation` represents a output location
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineOutputLocation {
pub s3_location: CodePipelineS3Location,
Expand All @@ -174,7 +174,7 @@ pub struct CodePipelineOutputLocation {
}

/// `CodePipelineArtifactCredentials` represents CodePipeline artifact credentials
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CodePipelineArtifactCredentials {
#[serde(default)]
Expand Down
Loading
Loading