software.amazon.awsconstructs.services.cloudfrontapigateway.CloudFrontToApiGatewayProps Maven / Gradle / Ivy
Show all versions of cloudfrontapigateway Show documentation
package software.amazon.awsconstructs.services.cloudfrontapigateway;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.62.0 (build 293ac17)", date = "2022-07-26T14:27:44.861Z")
@software.amazon.jsii.Jsii(module = software.amazon.awsconstructs.services.cloudfrontapigateway.$Module.class, fqn = "@aws-solutions-constructs/aws-cloudfront-apigateway.CloudFrontToApiGatewayProps")
@software.amazon.jsii.Jsii.Proxy(CloudFrontToApiGatewayProps.Jsii$Proxy.class)
public interface CloudFrontToApiGatewayProps extends software.amazon.jsii.JsiiSerializable {
/**
* Existing instance of api.RestApi object.
*
* Default: - None
*/
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.apigateway.RestApi getExistingApiGatewayObj();
/**
* Optional user provided props to override the default props.
*
* Default: - Default props are used
*/
default @org.jetbrains.annotations.Nullable java.lang.Object getCloudFrontDistributionProps() {
return null;
}
/**
* Optional user provided props to override the default props for the CloudFront Logging Bucket.
*
* Default: - Default props are used
*/
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.s3.BucketProps getCloudFrontLoggingBucketProps() {
return null;
}
/**
* Optional user provided props to turn on/off the automatic injection of best practice HTTP security headers in all responses from cloudfront.
*
* Default: - true
*/
default @org.jetbrains.annotations.Nullable java.lang.Boolean getInsertHttpSecurityHeaders() {
return null;
}
/**
* @return a {@link Builder} of {@link CloudFrontToApiGatewayProps}
*/
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CloudFrontToApiGatewayProps}
*/
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.apigateway.RestApi existingApiGatewayObj;
java.lang.Object cloudFrontDistributionProps;
software.amazon.awscdk.services.s3.BucketProps cloudFrontLoggingBucketProps;
java.lang.Boolean insertHttpSecurityHeaders;
/**
* Sets the value of {@link CloudFrontToApiGatewayProps#getExistingApiGatewayObj}
* @param existingApiGatewayObj Existing instance of api.RestApi object. This parameter is required.
* @return {@code this}
*/
public Builder existingApiGatewayObj(software.amazon.awscdk.services.apigateway.RestApi existingApiGatewayObj) {
this.existingApiGatewayObj = existingApiGatewayObj;
return this;
}
/**
* Sets the value of {@link CloudFrontToApiGatewayProps#getCloudFrontDistributionProps}
* @param cloudFrontDistributionProps Optional user provided props to override the default props.
* @return {@code this}
*/
public Builder cloudFrontDistributionProps(java.lang.Object cloudFrontDistributionProps) {
this.cloudFrontDistributionProps = cloudFrontDistributionProps;
return this;
}
/**
* Sets the value of {@link CloudFrontToApiGatewayProps#getCloudFrontLoggingBucketProps}
* @param cloudFrontLoggingBucketProps Optional user provided props to override the default props for the CloudFront Logging Bucket.
* @return {@code this}
*/
public Builder cloudFrontLoggingBucketProps(software.amazon.awscdk.services.s3.BucketProps cloudFrontLoggingBucketProps) {
this.cloudFrontLoggingBucketProps = cloudFrontLoggingBucketProps;
return this;
}
/**
* Sets the value of {@link CloudFrontToApiGatewayProps#getInsertHttpSecurityHeaders}
* @param insertHttpSecurityHeaders Optional user provided props to turn on/off the automatic injection of best practice HTTP security headers in all responses from cloudfront.
* @return {@code this}
*/
public Builder insertHttpSecurityHeaders(java.lang.Boolean insertHttpSecurityHeaders) {
this.insertHttpSecurityHeaders = insertHttpSecurityHeaders;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CloudFrontToApiGatewayProps}
* @throws NullPointerException if any required attribute was not provided
*/
@Override
public CloudFrontToApiGatewayProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CloudFrontToApiGatewayProps}
*/
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CloudFrontToApiGatewayProps {
private final software.amazon.awscdk.services.apigateway.RestApi existingApiGatewayObj;
private final java.lang.Object cloudFrontDistributionProps;
private final software.amazon.awscdk.services.s3.BucketProps cloudFrontLoggingBucketProps;
private final java.lang.Boolean insertHttpSecurityHeaders;
/**
* 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.existingApiGatewayObj = software.amazon.jsii.Kernel.get(this, "existingApiGatewayObj", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.apigateway.RestApi.class));
this.cloudFrontDistributionProps = software.amazon.jsii.Kernel.get(this, "cloudFrontDistributionProps", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.cloudFrontLoggingBucketProps = software.amazon.jsii.Kernel.get(this, "cloudFrontLoggingBucketProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.BucketProps.class));
this.insertHttpSecurityHeaders = software.amazon.jsii.Kernel.get(this, "insertHttpSecurityHeaders", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.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.existingApiGatewayObj = java.util.Objects.requireNonNull(builder.existingApiGatewayObj, "existingApiGatewayObj is required");
this.cloudFrontDistributionProps = builder.cloudFrontDistributionProps;
this.cloudFrontLoggingBucketProps = builder.cloudFrontLoggingBucketProps;
this.insertHttpSecurityHeaders = builder.insertHttpSecurityHeaders;
}
@Override
public final software.amazon.awscdk.services.apigateway.RestApi getExistingApiGatewayObj() {
return this.existingApiGatewayObj;
}
@Override
public final java.lang.Object getCloudFrontDistributionProps() {
return this.cloudFrontDistributionProps;
}
@Override
public final software.amazon.awscdk.services.s3.BucketProps getCloudFrontLoggingBucketProps() {
return this.cloudFrontLoggingBucketProps;
}
@Override
public final java.lang.Boolean getInsertHttpSecurityHeaders() {
return this.insertHttpSecurityHeaders;
}
@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("existingApiGatewayObj", om.valueToTree(this.getExistingApiGatewayObj()));
if (this.getCloudFrontDistributionProps() != null) {
data.set("cloudFrontDistributionProps", om.valueToTree(this.getCloudFrontDistributionProps()));
}
if (this.getCloudFrontLoggingBucketProps() != null) {
data.set("cloudFrontLoggingBucketProps", om.valueToTree(this.getCloudFrontLoggingBucketProps()));
}
if (this.getInsertHttpSecurityHeaders() != null) {
data.set("insertHttpSecurityHeaders", om.valueToTree(this.getInsertHttpSecurityHeaders()));
}
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-cloudfront-apigateway.CloudFrontToApiGatewayProps"));
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;
CloudFrontToApiGatewayProps.Jsii$Proxy that = (CloudFrontToApiGatewayProps.Jsii$Proxy) o;
if (!existingApiGatewayObj.equals(that.existingApiGatewayObj)) return false;
if (this.cloudFrontDistributionProps != null ? !this.cloudFrontDistributionProps.equals(that.cloudFrontDistributionProps) : that.cloudFrontDistributionProps != null) return false;
if (this.cloudFrontLoggingBucketProps != null ? !this.cloudFrontLoggingBucketProps.equals(that.cloudFrontLoggingBucketProps) : that.cloudFrontLoggingBucketProps != null) return false;
return this.insertHttpSecurityHeaders != null ? this.insertHttpSecurityHeaders.equals(that.insertHttpSecurityHeaders) : that.insertHttpSecurityHeaders == null;
}
@Override
public final int hashCode() {
int result = this.existingApiGatewayObj.hashCode();
result = 31 * result + (this.cloudFrontDistributionProps != null ? this.cloudFrontDistributionProps.hashCode() : 0);
result = 31 * result + (this.cloudFrontLoggingBucketProps != null ? this.cloudFrontLoggingBucketProps.hashCode() : 0);
result = 31 * result + (this.insertHttpSecurityHeaders != null ? this.insertHttpSecurityHeaders.hashCode() : 0);
return result;
}
}
}