software.amazon.awsconstructs.services.apigatewaylambda.ApiGatewayToLambdaProps Maven / Gradle / Ivy
Show all versions of apigatewaylambda Show documentation
package software.amazon.awsconstructs.services.apigatewaylambda;
/**
* The properties for the ApiGatewayToLambda class.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.55.1 (build 07d2d90)", date = "2022-03-30T18:43:29.180Z")
@software.amazon.jsii.Jsii(module = software.amazon.awsconstructs.services.apigatewaylambda.$Module.class, fqn = "@aws-solutions-constructs/aws-apigateway-lambda.ApiGatewayToLambdaProps")
@software.amazon.jsii.Jsii.Proxy(ApiGatewayToLambdaProps.Jsii$Proxy.class)
public interface ApiGatewayToLambdaProps extends software.amazon.jsii.JsiiSerializable {
/**
* Optional user-provided props to override the default props for the API.
*
* Default: - Default props are used.
*/
default @org.jetbrains.annotations.Nullable java.lang.Object getApiGatewayProps() {
return null;
}
/**
* Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.
*
* Default: - None
*/
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.lambda.Function getExistingLambdaObj() {
return null;
}
/**
* User provided props to override the default props for the Lambda function.
*
* Default: - Default props are used.
*/
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.lambda.FunctionProps getLambdaFunctionProps() {
return null;
}
/**
* User provided props to override the default props for the CloudWatchLogs LogGroup.
*
* Default: - Default props are used
*/
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.logs.LogGroupProps getLogGroupProps() {
return null;
}
/**
* @return a {@link Builder} of {@link ApiGatewayToLambdaProps}
*/
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ApiGatewayToLambdaProps}
*/
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Object apiGatewayProps;
software.amazon.awscdk.services.lambda.Function existingLambdaObj;
software.amazon.awscdk.services.lambda.FunctionProps lambdaFunctionProps;
software.amazon.awscdk.services.logs.LogGroupProps logGroupProps;
/**
* Sets the value of {@link ApiGatewayToLambdaProps#getApiGatewayProps}
* @param apiGatewayProps Optional user-provided props to override the default props for the API.
* @return {@code this}
*/
public Builder apiGatewayProps(java.lang.Object apiGatewayProps) {
this.apiGatewayProps = apiGatewayProps;
return this;
}
/**
* Sets the value of {@link ApiGatewayToLambdaProps#getExistingLambdaObj}
* @param existingLambdaObj Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.
* @return {@code this}
*/
public Builder existingLambdaObj(software.amazon.awscdk.services.lambda.Function existingLambdaObj) {
this.existingLambdaObj = existingLambdaObj;
return this;
}
/**
* Sets the value of {@link ApiGatewayToLambdaProps#getLambdaFunctionProps}
* @param lambdaFunctionProps User provided props to override the default props for the Lambda function.
* @return {@code this}
*/
public Builder lambdaFunctionProps(software.amazon.awscdk.services.lambda.FunctionProps lambdaFunctionProps) {
this.lambdaFunctionProps = lambdaFunctionProps;
return this;
}
/**
* Sets the value of {@link ApiGatewayToLambdaProps#getLogGroupProps}
* @param logGroupProps User provided props to override the default props for the CloudWatchLogs LogGroup.
* @return {@code this}
*/
public Builder logGroupProps(software.amazon.awscdk.services.logs.LogGroupProps logGroupProps) {
this.logGroupProps = logGroupProps;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ApiGatewayToLambdaProps}
* @throws NullPointerException if any required attribute was not provided
*/
@Override
public ApiGatewayToLambdaProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ApiGatewayToLambdaProps}
*/
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ApiGatewayToLambdaProps {
private final java.lang.Object apiGatewayProps;
private final software.amazon.awscdk.services.lambda.Function existingLambdaObj;
private final software.amazon.awscdk.services.lambda.FunctionProps lambdaFunctionProps;
private final software.amazon.awscdk.services.logs.LogGroupProps logGroupProps;
/**
* 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.apiGatewayProps = software.amazon.jsii.Kernel.get(this, "apiGatewayProps", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.existingLambdaObj = software.amazon.jsii.Kernel.get(this, "existingLambdaObj", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Function.class));
this.lambdaFunctionProps = software.amazon.jsii.Kernel.get(this, "lambdaFunctionProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.FunctionProps.class));
this.logGroupProps = software.amazon.jsii.Kernel.get(this, "logGroupProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.LogGroupProps.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.apiGatewayProps = builder.apiGatewayProps;
this.existingLambdaObj = builder.existingLambdaObj;
this.lambdaFunctionProps = builder.lambdaFunctionProps;
this.logGroupProps = builder.logGroupProps;
}
@Override
public final java.lang.Object getApiGatewayProps() {
return this.apiGatewayProps;
}
@Override
public final software.amazon.awscdk.services.lambda.Function getExistingLambdaObj() {
return this.existingLambdaObj;
}
@Override
public final software.amazon.awscdk.services.lambda.FunctionProps getLambdaFunctionProps() {
return this.lambdaFunctionProps;
}
@Override
public final software.amazon.awscdk.services.logs.LogGroupProps getLogGroupProps() {
return this.logGroupProps;
}
@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();
if (this.getApiGatewayProps() != null) {
data.set("apiGatewayProps", om.valueToTree(this.getApiGatewayProps()));
}
if (this.getExistingLambdaObj() != null) {
data.set("existingLambdaObj", om.valueToTree(this.getExistingLambdaObj()));
}
if (this.getLambdaFunctionProps() != null) {
data.set("lambdaFunctionProps", om.valueToTree(this.getLambdaFunctionProps()));
}
if (this.getLogGroupProps() != null) {
data.set("logGroupProps", om.valueToTree(this.getLogGroupProps()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-solutions-constructs/aws-apigateway-lambda.ApiGatewayToLambdaProps"));
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;
ApiGatewayToLambdaProps.Jsii$Proxy that = (ApiGatewayToLambdaProps.Jsii$Proxy) o;
if (this.apiGatewayProps != null ? !this.apiGatewayProps.equals(that.apiGatewayProps) : that.apiGatewayProps != null) return false;
if (this.existingLambdaObj != null ? !this.existingLambdaObj.equals(that.existingLambdaObj) : that.existingLambdaObj != null) return false;
if (this.lambdaFunctionProps != null ? !this.lambdaFunctionProps.equals(that.lambdaFunctionProps) : that.lambdaFunctionProps != null) return false;
return this.logGroupProps != null ? this.logGroupProps.equals(that.logGroupProps) : that.logGroupProps == null;
}
@Override
public final int hashCode() {
int result = this.apiGatewayProps != null ? this.apiGatewayProps.hashCode() : 0;
result = 31 * result + (this.existingLambdaObj != null ? this.existingLambdaObj.hashCode() : 0);
result = 31 * result + (this.lambdaFunctionProps != null ? this.lambdaFunctionProps.hashCode() : 0);
result = 31 * result + (this.logGroupProps != null ? this.logGroupProps.hashCode() : 0);
return result;
}
}
}