All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.ses.actions.LambdaProps Maven / Gradle / Ivy

There is a newer version: 1.204.0
Show newest version
package software.amazon.awscdk.services.ses.actions;

/**
 * Construction properties for a Lambda action.
 * 

* Example: *

*

 * // The code below shows an example of how to instantiate this type.
 * // The values are placeholders you should change.
 * import software.amazon.awscdk.services.lambda.*;
 * import software.amazon.awscdk.services.ses.actions.*;
 * import software.amazon.awscdk.services.sns.*;
 * Function function_;
 * Topic topic;
 * LambdaProps lambdaProps = LambdaProps.builder()
 *         .function(function_)
 *         // the properties below are optional
 *         .invocationType(LambdaInvocationType.EVENT)
 *         .topic(topic)
 *         .build();
 * 
*/ @javax.annotation.Generated(value = "jsii-pacmak/1.45.0 (build 61747b6)", date = "2021-11-19T21:31:11.264Z") @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ses.actions.$Module.class, fqn = "@aws-cdk/aws-ses-actions.LambdaProps") @software.amazon.jsii.Jsii.Proxy(LambdaProps.Jsii$Proxy.class) @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public interface LambdaProps extends software.amazon.jsii.JsiiSerializable { /** * The Lambda function to invoke. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction getFunction(); /** * The invocation type of the Lambda function. *

* Default: Event */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ses.actions.LambdaInvocationType getInvocationType() { return null; } /** * The SNS topic to notify when the Lambda action is taken. *

* Default: no notification */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.sns.ITopic getTopic() { return null; } /** * @return a {@link Builder} of {@link LambdaProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) static Builder builder() { return new Builder(); } /** * A builder for {@link LambdaProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static final class Builder implements software.amazon.jsii.Builder { software.amazon.awscdk.services.lambda.IFunction function; software.amazon.awscdk.services.ses.actions.LambdaInvocationType invocationType; software.amazon.awscdk.services.sns.ITopic topic; /** * Sets the value of {@link LambdaProps#getFunction} * @param function The Lambda function to invoke. This parameter is required. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder function(software.amazon.awscdk.services.lambda.IFunction function) { this.function = function; return this; } /** * Sets the value of {@link LambdaProps#getInvocationType} * @param invocationType The invocation type of the Lambda function. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder invocationType(software.amazon.awscdk.services.ses.actions.LambdaInvocationType invocationType) { this.invocationType = invocationType; return this; } /** * Sets the value of {@link LambdaProps#getTopic} * @param topic The SNS topic to notify when the Lambda action is taken. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder topic(software.amazon.awscdk.services.sns.ITopic topic) { this.topic = topic; return this; } /** * Builds the configured instance. * @return a new instance of {@link LambdaProps} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override public LambdaProps build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link LambdaProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements LambdaProps { private final software.amazon.awscdk.services.lambda.IFunction function; private final software.amazon.awscdk.services.ses.actions.LambdaInvocationType invocationType; private final software.amazon.awscdk.services.sns.ITopic topic; /** * Constructor that initializes the object based on values retrieved from the JsiiObject. * @param objRef Reference to the JSII managed object. */ protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); this.function = software.amazon.jsii.Kernel.get(this, "function", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.IFunction.class)); this.invocationType = software.amazon.jsii.Kernel.get(this, "invocationType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ses.actions.LambdaInvocationType.class)); this.topic = software.amazon.jsii.Kernel.get(this, "topic", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sns.ITopic.class)); } /** * Constructor that initializes the object based on literal property values passed by the {@link Builder}. */ protected Jsii$Proxy(final Builder builder) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); this.function = java.util.Objects.requireNonNull(builder.function, "function is required"); this.invocationType = builder.invocationType; this.topic = builder.topic; } @Override public final software.amazon.awscdk.services.lambda.IFunction getFunction() { return this.function; } @Override public final software.amazon.awscdk.services.ses.actions.LambdaInvocationType getInvocationType() { return this.invocationType; } @Override public final software.amazon.awscdk.services.sns.ITopic getTopic() { return this.topic; } @Override @software.amazon.jsii.Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); data.set("function", om.valueToTree(this.getFunction())); if (this.getInvocationType() != null) { data.set("invocationType", om.valueToTree(this.getInvocationType())); } if (this.getTopic() != null) { data.set("topic", om.valueToTree(this.getTopic())); } final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("@aws-cdk/aws-ses-actions.LambdaProps")); struct.set("data", data); final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); obj.set("$jsii.struct", struct); return obj; } @Override public final boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LambdaProps.Jsii$Proxy that = (LambdaProps.Jsii$Proxy) o; if (!function.equals(that.function)) return false; if (this.invocationType != null ? !this.invocationType.equals(that.invocationType) : that.invocationType != null) return false; return this.topic != null ? this.topic.equals(that.topic) : that.topic == null; } @Override public final int hashCode() { int result = this.function.hashCode(); result = 31 * result + (this.invocationType != null ? this.invocationType.hashCode() : 0); result = 31 * result + (this.topic != null ? this.topic.hashCode() : 0); return result; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy