software.amazon.awsconstructs.services.apigatewaydynamodb.ApiGatewayToDynamoDBProps Maven / Gradle / Ivy
Show all versions of apigatewaydynamodb Show documentation
package software.amazon.awsconstructs.services.apigatewaydynamodb;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.71.0 (build f1f58ae)", date = "2022-11-30T20:11:34.053Z")
@software.amazon.jsii.Jsii(module = software.amazon.awsconstructs.services.apigatewaydynamodb.$Module.class, fqn = "@aws-solutions-constructs/aws-apigateway-dynamodb.ApiGatewayToDynamoDBProps")
@software.amazon.jsii.Jsii.Proxy(ApiGatewayToDynamoDBProps.Jsii$Proxy.class)
public interface ApiGatewayToDynamoDBProps extends software.amazon.jsii.JsiiSerializable {
/**
* Whether to deploy API Gateway Method for Create operation on DynamoDB table.
*
* Default: - false
*/
default @org.jetbrains.annotations.Nullable java.lang.Boolean getAllowCreateOperation() {
return null;
}
/**
* Whether to deploy API Gateway Method for Delete operation on DynamoDB table.
*
* Default: - false
*/
default @org.jetbrains.annotations.Nullable java.lang.Boolean getAllowDeleteOperation() {
return null;
}
/**
* Whether to deploy API Gateway Method for Read operation on DynamoDB table.
*
* Default: - true
*/
default @org.jetbrains.annotations.Nullable java.lang.Boolean getAllowReadOperation() {
return null;
}
/**
* Whether to deploy API Gateway Method for Update operation on DynamoDB table.
*
* Default: - false
*/
default @org.jetbrains.annotations.Nullable java.lang.Boolean getAllowUpdateOperation() {
return null;
}
/**
* Optional user-provided props to override the default props for the API Gateway.
*
* Default: - Default properties are used.
*/
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.apigateway.RestApiProps getApiGatewayProps() {
return null;
}
/**
* API Gateway Request template for Create method, required if allowCreateOperation set to true.
*
* Default: - None
*/
default @org.jetbrains.annotations.Nullable java.lang.String getCreateRequestTemplate() {
return null;
}
/**
* Optional API Gateway Request template for Delete method, it will use the default template if allowDeleteOperation is true and deleteRequestTemplate is not provided.
*
* The default template only supports a partition key and not partition + sort keys.
*
* Default: - None
*/
default @org.jetbrains.annotations.Nullable java.lang.String getDeleteRequestTemplate() {
return null;
}
/**
* Optional user provided props to override the default props.
*
* Default: - Default props are used
*/
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.dynamodb.TableProps getDynamoTableProps() {
return null;
}
/**
* Existing instance of DynamoDB table object, providing both this and `dynamoTableProps` will cause an error.
*
* Default: - None
*/
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.dynamodb.Table getExistingTableObj() {
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;
}
/**
* Optional API Gateway Request template for Read method, it will use the default template if allowReadOperation is true and readRequestTemplate is not provided.
*
* The default template only supports a partition key and not partition + sort keys.
*
* Default: - None
*/
default @org.jetbrains.annotations.Nullable java.lang.String getReadRequestTemplate() {
return null;
}
/**
* API Gateway Request template for Update method, required if allowUpdateOperation set to true.
*
* Default: - None
*/
default @org.jetbrains.annotations.Nullable java.lang.String getUpdateRequestTemplate() {
return null;
}
/**
* @return a {@link Builder} of {@link ApiGatewayToDynamoDBProps}
*/
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ApiGatewayToDynamoDBProps}
*/
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Boolean allowCreateOperation;
java.lang.Boolean allowDeleteOperation;
java.lang.Boolean allowReadOperation;
java.lang.Boolean allowUpdateOperation;
software.amazon.awscdk.services.apigateway.RestApiProps apiGatewayProps;
java.lang.String createRequestTemplate;
java.lang.String deleteRequestTemplate;
software.amazon.awscdk.services.dynamodb.TableProps dynamoTableProps;
software.amazon.awscdk.services.dynamodb.Table existingTableObj;
software.amazon.awscdk.services.logs.LogGroupProps logGroupProps;
java.lang.String readRequestTemplate;
java.lang.String updateRequestTemplate;
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getAllowCreateOperation}
* @param allowCreateOperation Whether to deploy API Gateway Method for Create operation on DynamoDB table.
* @return {@code this}
*/
public Builder allowCreateOperation(java.lang.Boolean allowCreateOperation) {
this.allowCreateOperation = allowCreateOperation;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getAllowDeleteOperation}
* @param allowDeleteOperation Whether to deploy API Gateway Method for Delete operation on DynamoDB table.
* @return {@code this}
*/
public Builder allowDeleteOperation(java.lang.Boolean allowDeleteOperation) {
this.allowDeleteOperation = allowDeleteOperation;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getAllowReadOperation}
* @param allowReadOperation Whether to deploy API Gateway Method for Read operation on DynamoDB table.
* @return {@code this}
*/
public Builder allowReadOperation(java.lang.Boolean allowReadOperation) {
this.allowReadOperation = allowReadOperation;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getAllowUpdateOperation}
* @param allowUpdateOperation Whether to deploy API Gateway Method for Update operation on DynamoDB table.
* @return {@code this}
*/
public Builder allowUpdateOperation(java.lang.Boolean allowUpdateOperation) {
this.allowUpdateOperation = allowUpdateOperation;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getApiGatewayProps}
* @param apiGatewayProps Optional user-provided props to override the default props for the API Gateway.
* @return {@code this}
*/
public Builder apiGatewayProps(software.amazon.awscdk.services.apigateway.RestApiProps apiGatewayProps) {
this.apiGatewayProps = apiGatewayProps;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getCreateRequestTemplate}
* @param createRequestTemplate API Gateway Request template for Create method, required if allowCreateOperation set to true.
* @return {@code this}
*/
public Builder createRequestTemplate(java.lang.String createRequestTemplate) {
this.createRequestTemplate = createRequestTemplate;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getDeleteRequestTemplate}
* @param deleteRequestTemplate Optional API Gateway Request template for Delete method, it will use the default template if allowDeleteOperation is true and deleteRequestTemplate is not provided.
* The default template only supports a partition key and not partition + sort keys.
* @return {@code this}
*/
public Builder deleteRequestTemplate(java.lang.String deleteRequestTemplate) {
this.deleteRequestTemplate = deleteRequestTemplate;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getDynamoTableProps}
* @param dynamoTableProps Optional user provided props to override the default props.
* @return {@code this}
*/
public Builder dynamoTableProps(software.amazon.awscdk.services.dynamodb.TableProps dynamoTableProps) {
this.dynamoTableProps = dynamoTableProps;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getExistingTableObj}
* @param existingTableObj Existing instance of DynamoDB table object, providing both this and `dynamoTableProps` will cause an error.
* @return {@code this}
*/
public Builder existingTableObj(software.amazon.awscdk.services.dynamodb.Table existingTableObj) {
this.existingTableObj = existingTableObj;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#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;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getReadRequestTemplate}
* @param readRequestTemplate Optional API Gateway Request template for Read method, it will use the default template if allowReadOperation is true and readRequestTemplate is not provided.
* The default template only supports a partition key and not partition + sort keys.
* @return {@code this}
*/
public Builder readRequestTemplate(java.lang.String readRequestTemplate) {
this.readRequestTemplate = readRequestTemplate;
return this;
}
/**
* Sets the value of {@link ApiGatewayToDynamoDBProps#getUpdateRequestTemplate}
* @param updateRequestTemplate API Gateway Request template for Update method, required if allowUpdateOperation set to true.
* @return {@code this}
*/
public Builder updateRequestTemplate(java.lang.String updateRequestTemplate) {
this.updateRequestTemplate = updateRequestTemplate;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ApiGatewayToDynamoDBProps}
* @throws NullPointerException if any required attribute was not provided
*/
@Override
public ApiGatewayToDynamoDBProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ApiGatewayToDynamoDBProps}
*/
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ApiGatewayToDynamoDBProps {
private final java.lang.Boolean allowCreateOperation;
private final java.lang.Boolean allowDeleteOperation;
private final java.lang.Boolean allowReadOperation;
private final java.lang.Boolean allowUpdateOperation;
private final software.amazon.awscdk.services.apigateway.RestApiProps apiGatewayProps;
private final java.lang.String createRequestTemplate;
private final java.lang.String deleteRequestTemplate;
private final software.amazon.awscdk.services.dynamodb.TableProps dynamoTableProps;
private final software.amazon.awscdk.services.dynamodb.Table existingTableObj;
private final software.amazon.awscdk.services.logs.LogGroupProps logGroupProps;
private final java.lang.String readRequestTemplate;
private final java.lang.String updateRequestTemplate;
/**
* 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.allowCreateOperation = software.amazon.jsii.Kernel.get(this, "allowCreateOperation", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.allowDeleteOperation = software.amazon.jsii.Kernel.get(this, "allowDeleteOperation", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.allowReadOperation = software.amazon.jsii.Kernel.get(this, "allowReadOperation", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.allowUpdateOperation = software.amazon.jsii.Kernel.get(this, "allowUpdateOperation", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.apiGatewayProps = software.amazon.jsii.Kernel.get(this, "apiGatewayProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.apigateway.RestApiProps.class));
this.createRequestTemplate = software.amazon.jsii.Kernel.get(this, "createRequestTemplate", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.deleteRequestTemplate = software.amazon.jsii.Kernel.get(this, "deleteRequestTemplate", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.dynamoTableProps = software.amazon.jsii.Kernel.get(this, "dynamoTableProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.dynamodb.TableProps.class));
this.existingTableObj = software.amazon.jsii.Kernel.get(this, "existingTableObj", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.dynamodb.Table.class));
this.logGroupProps = software.amazon.jsii.Kernel.get(this, "logGroupProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.LogGroupProps.class));
this.readRequestTemplate = software.amazon.jsii.Kernel.get(this, "readRequestTemplate", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.updateRequestTemplate = software.amazon.jsii.Kernel.get(this, "updateRequestTemplate", software.amazon.jsii.NativeType.forClass(java.lang.String.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.allowCreateOperation = builder.allowCreateOperation;
this.allowDeleteOperation = builder.allowDeleteOperation;
this.allowReadOperation = builder.allowReadOperation;
this.allowUpdateOperation = builder.allowUpdateOperation;
this.apiGatewayProps = builder.apiGatewayProps;
this.createRequestTemplate = builder.createRequestTemplate;
this.deleteRequestTemplate = builder.deleteRequestTemplate;
this.dynamoTableProps = builder.dynamoTableProps;
this.existingTableObj = builder.existingTableObj;
this.logGroupProps = builder.logGroupProps;
this.readRequestTemplate = builder.readRequestTemplate;
this.updateRequestTemplate = builder.updateRequestTemplate;
}
@Override
public final java.lang.Boolean getAllowCreateOperation() {
return this.allowCreateOperation;
}
@Override
public final java.lang.Boolean getAllowDeleteOperation() {
return this.allowDeleteOperation;
}
@Override
public final java.lang.Boolean getAllowReadOperation() {
return this.allowReadOperation;
}
@Override
public final java.lang.Boolean getAllowUpdateOperation() {
return this.allowUpdateOperation;
}
@Override
public final software.amazon.awscdk.services.apigateway.RestApiProps getApiGatewayProps() {
return this.apiGatewayProps;
}
@Override
public final java.lang.String getCreateRequestTemplate() {
return this.createRequestTemplate;
}
@Override
public final java.lang.String getDeleteRequestTemplate() {
return this.deleteRequestTemplate;
}
@Override
public final software.amazon.awscdk.services.dynamodb.TableProps getDynamoTableProps() {
return this.dynamoTableProps;
}
@Override
public final software.amazon.awscdk.services.dynamodb.Table getExistingTableObj() {
return this.existingTableObj;
}
@Override
public final software.amazon.awscdk.services.logs.LogGroupProps getLogGroupProps() {
return this.logGroupProps;
}
@Override
public final java.lang.String getReadRequestTemplate() {
return this.readRequestTemplate;
}
@Override
public final java.lang.String getUpdateRequestTemplate() {
return this.updateRequestTemplate;
}
@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.getAllowCreateOperation() != null) {
data.set("allowCreateOperation", om.valueToTree(this.getAllowCreateOperation()));
}
if (this.getAllowDeleteOperation() != null) {
data.set("allowDeleteOperation", om.valueToTree(this.getAllowDeleteOperation()));
}
if (this.getAllowReadOperation() != null) {
data.set("allowReadOperation", om.valueToTree(this.getAllowReadOperation()));
}
if (this.getAllowUpdateOperation() != null) {
data.set("allowUpdateOperation", om.valueToTree(this.getAllowUpdateOperation()));
}
if (this.getApiGatewayProps() != null) {
data.set("apiGatewayProps", om.valueToTree(this.getApiGatewayProps()));
}
if (this.getCreateRequestTemplate() != null) {
data.set("createRequestTemplate", om.valueToTree(this.getCreateRequestTemplate()));
}
if (this.getDeleteRequestTemplate() != null) {
data.set("deleteRequestTemplate", om.valueToTree(this.getDeleteRequestTemplate()));
}
if (this.getDynamoTableProps() != null) {
data.set("dynamoTableProps", om.valueToTree(this.getDynamoTableProps()));
}
if (this.getExistingTableObj() != null) {
data.set("existingTableObj", om.valueToTree(this.getExistingTableObj()));
}
if (this.getLogGroupProps() != null) {
data.set("logGroupProps", om.valueToTree(this.getLogGroupProps()));
}
if (this.getReadRequestTemplate() != null) {
data.set("readRequestTemplate", om.valueToTree(this.getReadRequestTemplate()));
}
if (this.getUpdateRequestTemplate() != null) {
data.set("updateRequestTemplate", om.valueToTree(this.getUpdateRequestTemplate()));
}
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-dynamodb.ApiGatewayToDynamoDBProps"));
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;
ApiGatewayToDynamoDBProps.Jsii$Proxy that = (ApiGatewayToDynamoDBProps.Jsii$Proxy) o;
if (this.allowCreateOperation != null ? !this.allowCreateOperation.equals(that.allowCreateOperation) : that.allowCreateOperation != null) return false;
if (this.allowDeleteOperation != null ? !this.allowDeleteOperation.equals(that.allowDeleteOperation) : that.allowDeleteOperation != null) return false;
if (this.allowReadOperation != null ? !this.allowReadOperation.equals(that.allowReadOperation) : that.allowReadOperation != null) return false;
if (this.allowUpdateOperation != null ? !this.allowUpdateOperation.equals(that.allowUpdateOperation) : that.allowUpdateOperation != null) return false;
if (this.apiGatewayProps != null ? !this.apiGatewayProps.equals(that.apiGatewayProps) : that.apiGatewayProps != null) return false;
if (this.createRequestTemplate != null ? !this.createRequestTemplate.equals(that.createRequestTemplate) : that.createRequestTemplate != null) return false;
if (this.deleteRequestTemplate != null ? !this.deleteRequestTemplate.equals(that.deleteRequestTemplate) : that.deleteRequestTemplate != null) return false;
if (this.dynamoTableProps != null ? !this.dynamoTableProps.equals(that.dynamoTableProps) : that.dynamoTableProps != null) return false;
if (this.existingTableObj != null ? !this.existingTableObj.equals(that.existingTableObj) : that.existingTableObj != null) return false;
if (this.logGroupProps != null ? !this.logGroupProps.equals(that.logGroupProps) : that.logGroupProps != null) return false;
if (this.readRequestTemplate != null ? !this.readRequestTemplate.equals(that.readRequestTemplate) : that.readRequestTemplate != null) return false;
return this.updateRequestTemplate != null ? this.updateRequestTemplate.equals(that.updateRequestTemplate) : that.updateRequestTemplate == null;
}
@Override
public final int hashCode() {
int result = this.allowCreateOperation != null ? this.allowCreateOperation.hashCode() : 0;
result = 31 * result + (this.allowDeleteOperation != null ? this.allowDeleteOperation.hashCode() : 0);
result = 31 * result + (this.allowReadOperation != null ? this.allowReadOperation.hashCode() : 0);
result = 31 * result + (this.allowUpdateOperation != null ? this.allowUpdateOperation.hashCode() : 0);
result = 31 * result + (this.apiGatewayProps != null ? this.apiGatewayProps.hashCode() : 0);
result = 31 * result + (this.createRequestTemplate != null ? this.createRequestTemplate.hashCode() : 0);
result = 31 * result + (this.deleteRequestTemplate != null ? this.deleteRequestTemplate.hashCode() : 0);
result = 31 * result + (this.dynamoTableProps != null ? this.dynamoTableProps.hashCode() : 0);
result = 31 * result + (this.existingTableObj != null ? this.existingTableObj.hashCode() : 0);
result = 31 * result + (this.logGroupProps != null ? this.logGroupProps.hashCode() : 0);
result = 31 * result + (this.readRequestTemplate != null ? this.readRequestTemplate.hashCode() : 0);
result = 31 * result + (this.updateRequestTemplate != null ? this.updateRequestTemplate.hashCode() : 0);
return result;
}
}
}