com.github.eladb.watchful.WatchLambdaFunction Maven / Gradle / Ivy
package com.github.eladb.watchful;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.13.0 (build 385c325)", date = "2020-10-05T09:37:29.738Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = com.github.eladb.watchful.$Module.class, fqn = "cdk-watchful.WatchLambdaFunction")
public class WatchLambdaFunction extends software.amazon.awscdk.core.Construct {
protected WatchLambdaFunction(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected WatchLambdaFunction(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public WatchLambdaFunction(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull com.github.eladb.watchful.WatchLambdaFunctionProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* A fluent builder for {@link com.github.eladb.watchful.WatchLambdaFunction}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.amazon.awscdk.core.Construct scope;
private final java.lang.String id;
private final com.github.eladb.watchful.WatchLambdaFunctionProps.Builder props;
private Builder(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new com.github.eladb.watchful.WatchLambdaFunctionProps.Builder();
}
/**
* Threshold for the duration alarm as percentage of the function's timeout value.
*
* If this is set to 50%, the alarm will be set when p99 latency of the
* function exceeds 50% of the function's timeout setting.
*
* Default: 80
*
* @return {@code this}
* @param durationThresholdPercent Threshold for the duration alarm as percentage of the function's timeout value. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder durationThresholdPercent(final java.lang.Number durationThresholdPercent) {
this.props.durationThresholdPercent(durationThresholdPercent);
return this;
}
/**
* Number of allowed errors per minute.
*
* If there are more errors than that, an alarm will trigger.
*
* Default: 0
*
* @return {@code this}
* @param errorsPerMinuteThreshold Number of allowed errors per minute. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder errorsPerMinuteThreshold(final java.lang.Number errorsPerMinuteThreshold) {
this.props.errorsPerMinuteThreshold(errorsPerMinuteThreshold);
return this;
}
/**
* Number of allowed throttles per minute.
*
* Default: 0
*
* @return {@code this}
* @param throttlesPerMinuteThreshold Number of allowed throttles per minute. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder throttlesPerMinuteThreshold(final java.lang.Number throttlesPerMinuteThreshold) {
this.props.throttlesPerMinuteThreshold(throttlesPerMinuteThreshold);
return this;
}
/**
* @return {@code this}
* @param fn This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder fn(final software.amazon.awscdk.services.lambda.Function fn) {
this.props.fn(fn);
return this;
}
/**
* @return {@code this}
* @param title This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder title(final java.lang.String title) {
this.props.title(title);
return this;
}
/**
* @return {@code this}
* @param watchful This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder watchful(final com.github.eladb.watchful.IWatchful watchful) {
this.props.watchful(watchful);
return this;
}
/**
* @returns a newly built instance of {@link com.github.eladb.watchful.WatchLambdaFunction}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public com.github.eladb.watchful.WatchLambdaFunction build() {
return new com.github.eladb.watchful.WatchLambdaFunction(
this.scope,
this.id,
this.props.build()
);
}
}
}