io.github.hsiehshujeng.cdk.lambda.subminute.LambdaSubminuteProps Maven / Gradle / Ivy
Show all versions of cdk-lambda-subminute Show documentation
package io.github.hsiehshujeng.cdk.lambda.subminute;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-02T01:20:24.760Z")
@software.amazon.jsii.Jsii(module = io.github.hsiehshujeng.cdk.lambda.subminute.$Module.class, fqn = "cdk-lambda-subminute.LambdaSubminuteProps")
@software.amazon.jsii.Jsii.Proxy(LambdaSubminuteProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface LambdaSubminuteProps extends software.amazon.jsii.JsiiSerializable {
/**
* The Lambda function that is going to be executed per time unit less than one minute.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction getTargetFunction();
/**
* A pattern you want this statemachine to be executed.
*
* Default: cron(50/1 15-17 ? * * *) UTC+0 being run every minute starting from 15:00 PM to 17:00 PM.
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getCronjobExpression() {
return null;
}
/**
* How many times you intent to execute in a minute.
*
* Default: 6
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getFrequency() {
return null;
}
/**
* Seconds for an interval, the product of frequency
and intervalTime
should be approximagely 1 minute.
*
* Default: 10
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getIntervalTime() {
return null;
}
/**
* @return a {@link Builder} of {@link LambdaSubminuteProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link LambdaSubminuteProps}
*/
@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 targetFunction;
java.lang.String cronjobExpression;
java.lang.Number frequency;
java.lang.Number intervalTime;
/**
* Sets the value of {@link LambdaSubminuteProps#getTargetFunction}
* @param targetFunction The Lambda function that is going to be executed per time unit less than one minute. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder targetFunction(software.amazon.awscdk.services.lambda.IFunction targetFunction) {
this.targetFunction = targetFunction;
return this;
}
/**
* Sets the value of {@link LambdaSubminuteProps#getCronjobExpression}
* @param cronjobExpression A pattern you want this statemachine to be executed.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cronjobExpression(java.lang.String cronjobExpression) {
this.cronjobExpression = cronjobExpression;
return this;
}
/**
* Sets the value of {@link LambdaSubminuteProps#getFrequency}
* @param frequency How many times you intent to execute in a minute.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder frequency(java.lang.Number frequency) {
this.frequency = frequency;
return this;
}
/**
* Sets the value of {@link LambdaSubminuteProps#getIntervalTime}
* @param intervalTime Seconds for an interval, the product of frequency
and intervalTime
should be approximagely 1 minute.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder intervalTime(java.lang.Number intervalTime) {
this.intervalTime = intervalTime;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link LambdaSubminuteProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public LambdaSubminuteProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link LambdaSubminuteProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements LambdaSubminuteProps {
private final software.amazon.awscdk.services.lambda.IFunction targetFunction;
private final java.lang.String cronjobExpression;
private final java.lang.Number frequency;
private final java.lang.Number intervalTime;
/**
* 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.targetFunction = software.amazon.jsii.Kernel.get(this, "targetFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.IFunction.class));
this.cronjobExpression = software.amazon.jsii.Kernel.get(this, "cronjobExpression", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.frequency = software.amazon.jsii.Kernel.get(this, "frequency", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.intervalTime = software.amazon.jsii.Kernel.get(this, "intervalTime", software.amazon.jsii.NativeType.forClass(java.lang.Number.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.targetFunction = java.util.Objects.requireNonNull(builder.targetFunction, "targetFunction is required");
this.cronjobExpression = builder.cronjobExpression;
this.frequency = builder.frequency;
this.intervalTime = builder.intervalTime;
}
@Override
public final software.amazon.awscdk.services.lambda.IFunction getTargetFunction() {
return this.targetFunction;
}
@Override
public final java.lang.String getCronjobExpression() {
return this.cronjobExpression;
}
@Override
public final java.lang.Number getFrequency() {
return this.frequency;
}
@Override
public final java.lang.Number getIntervalTime() {
return this.intervalTime;
}
@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("targetFunction", om.valueToTree(this.getTargetFunction()));
if (this.getCronjobExpression() != null) {
data.set("cronjobExpression", om.valueToTree(this.getCronjobExpression()));
}
if (this.getFrequency() != null) {
data.set("frequency", om.valueToTree(this.getFrequency()));
}
if (this.getIntervalTime() != null) {
data.set("intervalTime", om.valueToTree(this.getIntervalTime()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk-lambda-subminute.LambdaSubminuteProps"));
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;
LambdaSubminuteProps.Jsii$Proxy that = (LambdaSubminuteProps.Jsii$Proxy) o;
if (!targetFunction.equals(that.targetFunction)) return false;
if (this.cronjobExpression != null ? !this.cronjobExpression.equals(that.cronjobExpression) : that.cronjobExpression != null) return false;
if (this.frequency != null ? !this.frequency.equals(that.frequency) : that.frequency != null) return false;
return this.intervalTime != null ? this.intervalTime.equals(that.intervalTime) : that.intervalTime == null;
}
@Override
public final int hashCode() {
int result = this.targetFunction.hashCode();
result = 31 * result + (this.cronjobExpression != null ? this.cronjobExpression.hashCode() : 0);
result = 31 * result + (this.frequency != null ? this.frequency.hashCode() : 0);
result = 31 * result + (this.intervalTime != null ? this.intervalTime.hashCode() : 0);
return result;
}
}
}