1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An action that Amazon SES can take when it receives an email on behalf of one or more email addresses or domains that you own. An instance of this data type can represent only one action.</p>
/// <p>For information about setting up receipt rules, see the <a href="https://docs.aws.amazon.com/ses/latest/dg/receiving-email-receipt-rules-console-walkthrough.html">Amazon SES Developer Guide</a>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ReceiptAction {
/// <p>Saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon SNS.</p>
pub s3_action: ::std::option::Option<crate::types::S3Action>,
/// <p>Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).</p>
pub bounce_action: ::std::option::Option<crate::types::BounceAction>,
/// <p>Calls Amazon WorkMail and, optionally, publishes a notification to Amazon Amazon SNS.</p>
pub workmail_action: ::std::option::Option<crate::types::WorkmailAction>,
/// <p>Calls an Amazon Web Services Lambda function, and optionally, publishes a notification to Amazon SNS.</p>
pub lambda_action: ::std::option::Option<crate::types::LambdaAction>,
/// <p>Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.</p>
pub stop_action: ::std::option::Option<crate::types::StopAction>,
/// <p>Adds a header to the received email.</p>
pub add_header_action: ::std::option::Option<crate::types::AddHeaderAction>,
/// <p>Publishes the email content within a notification to Amazon SNS.</p>
pub sns_action: ::std::option::Option<crate::types::SnsAction>,
}
impl ReceiptAction {
/// <p>Saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon SNS.</p>
pub fn s3_action(&self) -> ::std::option::Option<&crate::types::S3Action> {
self.s3_action.as_ref()
}
/// <p>Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).</p>
pub fn bounce_action(&self) -> ::std::option::Option<&crate::types::BounceAction> {
self.bounce_action.as_ref()
}
/// <p>Calls Amazon WorkMail and, optionally, publishes a notification to Amazon Amazon SNS.</p>
pub fn workmail_action(&self) -> ::std::option::Option<&crate::types::WorkmailAction> {
self.workmail_action.as_ref()
}
/// <p>Calls an Amazon Web Services Lambda function, and optionally, publishes a notification to Amazon SNS.</p>
pub fn lambda_action(&self) -> ::std::option::Option<&crate::types::LambdaAction> {
self.lambda_action.as_ref()
}
/// <p>Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.</p>
pub fn stop_action(&self) -> ::std::option::Option<&crate::types::StopAction> {
self.stop_action.as_ref()
}
/// <p>Adds a header to the received email.</p>
pub fn add_header_action(&self) -> ::std::option::Option<&crate::types::AddHeaderAction> {
self.add_header_action.as_ref()
}
/// <p>Publishes the email content within a notification to Amazon SNS.</p>
pub fn sns_action(&self) -> ::std::option::Option<&crate::types::SnsAction> {
self.sns_action.as_ref()
}
}
impl ReceiptAction {
/// Creates a new builder-style object to manufacture [`ReceiptAction`](crate::types::ReceiptAction).
pub fn builder() -> crate::types::builders::ReceiptActionBuilder {
crate::types::builders::ReceiptActionBuilder::default()
}
}
/// A builder for [`ReceiptAction`](crate::types::ReceiptAction).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ReceiptActionBuilder {
pub(crate) s3_action: ::std::option::Option<crate::types::S3Action>,
pub(crate) bounce_action: ::std::option::Option<crate::types::BounceAction>,
pub(crate) workmail_action: ::std::option::Option<crate::types::WorkmailAction>,
pub(crate) lambda_action: ::std::option::Option<crate::types::LambdaAction>,
pub(crate) stop_action: ::std::option::Option<crate::types::StopAction>,
pub(crate) add_header_action: ::std::option::Option<crate::types::AddHeaderAction>,
pub(crate) sns_action: ::std::option::Option<crate::types::SnsAction>,
}
impl ReceiptActionBuilder {
/// <p>Saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon SNS.</p>
pub fn s3_action(mut self, input: crate::types::S3Action) -> Self {
self.s3_action = ::std::option::Option::Some(input);
self
}
/// <p>Saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon SNS.</p>
pub fn set_s3_action(mut self, input: ::std::option::Option<crate::types::S3Action>) -> Self {
self.s3_action = input;
self
}
/// <p>Saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon SNS.</p>
pub fn get_s3_action(&self) -> &::std::option::Option<crate::types::S3Action> {
&self.s3_action
}
/// <p>Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).</p>
pub fn bounce_action(mut self, input: crate::types::BounceAction) -> Self {
self.bounce_action = ::std::option::Option::Some(input);
self
}
/// <p>Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).</p>
pub fn set_bounce_action(mut self, input: ::std::option::Option<crate::types::BounceAction>) -> Self {
self.bounce_action = input;
self
}
/// <p>Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).</p>
pub fn get_bounce_action(&self) -> &::std::option::Option<crate::types::BounceAction> {
&self.bounce_action
}
/// <p>Calls Amazon WorkMail and, optionally, publishes a notification to Amazon Amazon SNS.</p>
pub fn workmail_action(mut self, input: crate::types::WorkmailAction) -> Self {
self.workmail_action = ::std::option::Option::Some(input);
self
}
/// <p>Calls Amazon WorkMail and, optionally, publishes a notification to Amazon Amazon SNS.</p>
pub fn set_workmail_action(mut self, input: ::std::option::Option<crate::types::WorkmailAction>) -> Self {
self.workmail_action = input;
self
}
/// <p>Calls Amazon WorkMail and, optionally, publishes a notification to Amazon Amazon SNS.</p>
pub fn get_workmail_action(&self) -> &::std::option::Option<crate::types::WorkmailAction> {
&self.workmail_action
}
/// <p>Calls an Amazon Web Services Lambda function, and optionally, publishes a notification to Amazon SNS.</p>
pub fn lambda_action(mut self, input: crate::types::LambdaAction) -> Self {
self.lambda_action = ::std::option::Option::Some(input);
self
}
/// <p>Calls an Amazon Web Services Lambda function, and optionally, publishes a notification to Amazon SNS.</p>
pub fn set_lambda_action(mut self, input: ::std::option::Option<crate::types::LambdaAction>) -> Self {
self.lambda_action = input;
self
}
/// <p>Calls an Amazon Web Services Lambda function, and optionally, publishes a notification to Amazon SNS.</p>
pub fn get_lambda_action(&self) -> &::std::option::Option<crate::types::LambdaAction> {
&self.lambda_action
}
/// <p>Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.</p>
pub fn stop_action(mut self, input: crate::types::StopAction) -> Self {
self.stop_action = ::std::option::Option::Some(input);
self
}
/// <p>Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.</p>
pub fn set_stop_action(mut self, input: ::std::option::Option<crate::types::StopAction>) -> Self {
self.stop_action = input;
self
}
/// <p>Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.</p>
pub fn get_stop_action(&self) -> &::std::option::Option<crate::types::StopAction> {
&self.stop_action
}
/// <p>Adds a header to the received email.</p>
pub fn add_header_action(mut self, input: crate::types::AddHeaderAction) -> Self {
self.add_header_action = ::std::option::Option::Some(input);
self
}
/// <p>Adds a header to the received email.</p>
pub fn set_add_header_action(mut self, input: ::std::option::Option<crate::types::AddHeaderAction>) -> Self {
self.add_header_action = input;
self
}
/// <p>Adds a header to the received email.</p>
pub fn get_add_header_action(&self) -> &::std::option::Option<crate::types::AddHeaderAction> {
&self.add_header_action
}
/// <p>Publishes the email content within a notification to Amazon SNS.</p>
pub fn sns_action(mut self, input: crate::types::SnsAction) -> Self {
self.sns_action = ::std::option::Option::Some(input);
self
}
/// <p>Publishes the email content within a notification to Amazon SNS.</p>
pub fn set_sns_action(mut self, input: ::std::option::Option<crate::types::SnsAction>) -> Self {
self.sns_action = input;
self
}
/// <p>Publishes the email content within a notification to Amazon SNS.</p>
pub fn get_sns_action(&self) -> &::std::option::Option<crate::types::SnsAction> {
&self.sns_action
}
/// Consumes the builder and constructs a [`ReceiptAction`](crate::types::ReceiptAction).
pub fn build(self) -> crate::types::ReceiptAction {
crate::types::ReceiptAction {
s3_action: self.s3_action,
bounce_action: self.bounce_action,
workmail_action: self.workmail_action,
lambda_action: self.lambda_action,
stop_action: self.stop_action,
add_header_action: self.add_header_action,
sns_action: self.sns_action,
}
}
}