createReceiptRule
inline suspend fun SesClient.createReceiptRule(crossinline block: CreateReceiptRuleRequest.Builder.() -> Unit): CreateReceiptRuleResponse
Creates a receipt rule.
For information about setting up receipt rules, see the Amazon SES Developer Guide.
You can execute this operation no more than once per second.
Samples
import aws.sdk.kotlin.services.ses.model.ReceiptAction
import aws.sdk.kotlin.services.ses.model.ReceiptRule
import aws.sdk.kotlin.services.ses.model.S3Action
import aws.sdk.kotlin.services.ses.model.TlsPolicy
fun main() {
//sampleStart
// The following example creates a new receipt rule
sesClient.createReceiptRule {
ruleSetName = "MyRuleSet"
after = ""
rule = ReceiptRule {
tlsPolicy = TlsPolicy.fromValue("Optional")
enabled = true
name = "MyRule"
actions = listOf<ReceiptAction>(
ReceiptAction {
s3Action = S3Action {
objectKeyPrefix = "email"
bucketName = "MyBucket"
}
}
)
scanEnabled = true
}
}
//sampleEnd
}