org.mongodb.awscdk.resources.mongodbatlas.DatabaseConfig Maven / Gradle / Ivy
Show all versions of awscdk-resources-mongodbatlas Show documentation
package org.mongodb.awscdk.resources.mongodbatlas;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-30T09:54:29.013Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.DatabaseConfig")
@software.amazon.jsii.Jsii.Proxy(DatabaseConfig.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface DatabaseConfig extends software.amazon.jsii.JsiiSerializable {
/**
* The name of a collection in the specified database.
*
* The
* trigger listens to events from this collection.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getCollection() {
return null;
}
/**
* The name of a database in the linked data source.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getDatabase() {
return null;
}
/**
* If true
, indicates that UPDATE
change events should include the most current majority-committed version of the modified document in the fullDocument
field.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getFullDocument() {
return null;
}
/**
* If true, indicates that UPDATE
change events should include a snapshot of the modified document from immediately before the update was applied.
*
* You must enable document
* preimages
* for your cluster to include these snapshots.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getFullDocumentBeforeChange() {
return null;
}
/**
* stringify version of a $match expression filters change events. The trigger will only fire if the expression evaluates to true for a given change event.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getMatch() {
return null;
}
/**
* The type(s) of MongoDB change event that the trigger listens for.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getOperationTypes() {
return null;
}
/**
* stringify version of a $project expressions to limit the data included in each event.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getProject() {
return null;
}
/**
* The _id value of a linked MongoDB data source.
*
* See Get a Data Source.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getServiceId() {
return null;
}
/**
* If true
, enabling the Trigger after it was disabled will not invoke events that occurred while the Trigger was disabled.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getSkipCatchupEvents() {
return null;
}
/**
* If true
, when this Trigger's resume token cannot be found in the cluster's oplog, the Trigger automatically resumes processing events at the next relevant change stream event.
*
* All change stream events from when the Trigger was suspended until the Trigger
* resumes execution do not have the Trigger fire for them.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getTolerateResumeErrors() {
return null;
}
/**
* If true
, event ordering is disabled and this Trigger can process events in parallel.
*
* If false
, event
* ordering is enabled and the Trigger executes events
* serially.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getUnordered() {
return null;
}
/**
* @return a {@link Builder} of {@link DatabaseConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link DatabaseConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String collection;
java.lang.String database;
java.lang.Boolean fullDocument;
java.lang.Boolean fullDocumentBeforeChange;
java.lang.String match;
java.util.List operationTypes;
java.lang.String project;
java.lang.String serviceId;
java.lang.Boolean skipCatchupEvents;
java.lang.Boolean tolerateResumeErrors;
java.lang.Boolean unordered;
/**
* Sets the value of {@link DatabaseConfig#getCollection}
* @param collection The name of a collection in the specified database.
* The
* trigger listens to events from this collection.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder collection(java.lang.String collection) {
this.collection = collection;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getDatabase}
* @param database The name of a database in the linked data source.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder database(java.lang.String database) {
this.database = database;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getFullDocument}
* @param fullDocument If true
, indicates that UPDATE
change events should include the most current majority-committed version of the modified document in the fullDocument
field.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder fullDocument(java.lang.Boolean fullDocument) {
this.fullDocument = fullDocument;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getFullDocumentBeforeChange}
* @param fullDocumentBeforeChange If true, indicates that UPDATE
change events should include a snapshot of the modified document from immediately before the update was applied.
* You must enable document
* preimages
* for your cluster to include these snapshots.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder fullDocumentBeforeChange(java.lang.Boolean fullDocumentBeforeChange) {
this.fullDocumentBeforeChange = fullDocumentBeforeChange;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getMatch}
* @param match stringify version of a $match expression filters change events. The trigger will only fire if the expression evaluates to true for a given change event.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder match(java.lang.String match) {
this.match = match;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getOperationTypes}
* @param operationTypes The type(s) of MongoDB change event that the trigger listens for.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder operationTypes(java.util.List extends org.mongodb.awscdk.resources.mongodbatlas.DatabaseConfigOperationTypes> operationTypes) {
this.operationTypes = (java.util.List)operationTypes;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getProject}
* @param project stringify version of a $project expressions to limit the data included in each event.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder project(java.lang.String project) {
this.project = project;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getServiceId}
* @param serviceId The _id value of a linked MongoDB data source.
* See Get a Data Source.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder serviceId(java.lang.String serviceId) {
this.serviceId = serviceId;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getSkipCatchupEvents}
* @param skipCatchupEvents If true
, enabling the Trigger after it was disabled will not invoke events that occurred while the Trigger was disabled.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder skipCatchupEvents(java.lang.Boolean skipCatchupEvents) {
this.skipCatchupEvents = skipCatchupEvents;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getTolerateResumeErrors}
* @param tolerateResumeErrors If true
, when this Trigger's resume token cannot be found in the cluster's oplog, the Trigger automatically resumes processing events at the next relevant change stream event.
* All change stream events from when the Trigger was suspended until the Trigger
* resumes execution do not have the Trigger fire for them.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder tolerateResumeErrors(java.lang.Boolean tolerateResumeErrors) {
this.tolerateResumeErrors = tolerateResumeErrors;
return this;
}
/**
* Sets the value of {@link DatabaseConfig#getUnordered}
* @param unordered If true
, event ordering is disabled and this Trigger can process events in parallel.
* If false
, event
* ordering is enabled and the Trigger executes events
* serially.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder unordered(java.lang.Boolean unordered) {
this.unordered = unordered;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link DatabaseConfig}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public DatabaseConfig build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link DatabaseConfig}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements DatabaseConfig {
private final java.lang.String collection;
private final java.lang.String database;
private final java.lang.Boolean fullDocument;
private final java.lang.Boolean fullDocumentBeforeChange;
private final java.lang.String match;
private final java.util.List operationTypes;
private final java.lang.String project;
private final java.lang.String serviceId;
private final java.lang.Boolean skipCatchupEvents;
private final java.lang.Boolean tolerateResumeErrors;
private final java.lang.Boolean unordered;
/**
* 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.collection = software.amazon.jsii.Kernel.get(this, "collection", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.database = software.amazon.jsii.Kernel.get(this, "database", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.fullDocument = software.amazon.jsii.Kernel.get(this, "fullDocument", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.fullDocumentBeforeChange = software.amazon.jsii.Kernel.get(this, "fullDocumentBeforeChange", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.match = software.amazon.jsii.Kernel.get(this, "match", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.operationTypes = software.amazon.jsii.Kernel.get(this, "operationTypes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.DatabaseConfigOperationTypes.class)));
this.project = software.amazon.jsii.Kernel.get(this, "project", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.serviceId = software.amazon.jsii.Kernel.get(this, "serviceId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.skipCatchupEvents = software.amazon.jsii.Kernel.get(this, "skipCatchupEvents", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.tolerateResumeErrors = software.amazon.jsii.Kernel.get(this, "tolerateResumeErrors", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.unordered = software.amazon.jsii.Kernel.get(this, "unordered", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.collection = builder.collection;
this.database = builder.database;
this.fullDocument = builder.fullDocument;
this.fullDocumentBeforeChange = builder.fullDocumentBeforeChange;
this.match = builder.match;
this.operationTypes = (java.util.List)builder.operationTypes;
this.project = builder.project;
this.serviceId = builder.serviceId;
this.skipCatchupEvents = builder.skipCatchupEvents;
this.tolerateResumeErrors = builder.tolerateResumeErrors;
this.unordered = builder.unordered;
}
@Override
public final java.lang.String getCollection() {
return this.collection;
}
@Override
public final java.lang.String getDatabase() {
return this.database;
}
@Override
public final java.lang.Boolean getFullDocument() {
return this.fullDocument;
}
@Override
public final java.lang.Boolean getFullDocumentBeforeChange() {
return this.fullDocumentBeforeChange;
}
@Override
public final java.lang.String getMatch() {
return this.match;
}
@Override
public final java.util.List getOperationTypes() {
return this.operationTypes;
}
@Override
public final java.lang.String getProject() {
return this.project;
}
@Override
public final java.lang.String getServiceId() {
return this.serviceId;
}
@Override
public final java.lang.Boolean getSkipCatchupEvents() {
return this.skipCatchupEvents;
}
@Override
public final java.lang.Boolean getTolerateResumeErrors() {
return this.tolerateResumeErrors;
}
@Override
public final java.lang.Boolean getUnordered() {
return this.unordered;
}
@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.getCollection() != null) {
data.set("collection", om.valueToTree(this.getCollection()));
}
if (this.getDatabase() != null) {
data.set("database", om.valueToTree(this.getDatabase()));
}
if (this.getFullDocument() != null) {
data.set("fullDocument", om.valueToTree(this.getFullDocument()));
}
if (this.getFullDocumentBeforeChange() != null) {
data.set("fullDocumentBeforeChange", om.valueToTree(this.getFullDocumentBeforeChange()));
}
if (this.getMatch() != null) {
data.set("match", om.valueToTree(this.getMatch()));
}
if (this.getOperationTypes() != null) {
data.set("operationTypes", om.valueToTree(this.getOperationTypes()));
}
if (this.getProject() != null) {
data.set("project", om.valueToTree(this.getProject()));
}
if (this.getServiceId() != null) {
data.set("serviceId", om.valueToTree(this.getServiceId()));
}
if (this.getSkipCatchupEvents() != null) {
data.set("skipCatchupEvents", om.valueToTree(this.getSkipCatchupEvents()));
}
if (this.getTolerateResumeErrors() != null) {
data.set("tolerateResumeErrors", om.valueToTree(this.getTolerateResumeErrors()));
}
if (this.getUnordered() != null) {
data.set("unordered", om.valueToTree(this.getUnordered()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-resources-mongodbatlas.DatabaseConfig"));
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;
DatabaseConfig.Jsii$Proxy that = (DatabaseConfig.Jsii$Proxy) o;
if (this.collection != null ? !this.collection.equals(that.collection) : that.collection != null) return false;
if (this.database != null ? !this.database.equals(that.database) : that.database != null) return false;
if (this.fullDocument != null ? !this.fullDocument.equals(that.fullDocument) : that.fullDocument != null) return false;
if (this.fullDocumentBeforeChange != null ? !this.fullDocumentBeforeChange.equals(that.fullDocumentBeforeChange) : that.fullDocumentBeforeChange != null) return false;
if (this.match != null ? !this.match.equals(that.match) : that.match != null) return false;
if (this.operationTypes != null ? !this.operationTypes.equals(that.operationTypes) : that.operationTypes != null) return false;
if (this.project != null ? !this.project.equals(that.project) : that.project != null) return false;
if (this.serviceId != null ? !this.serviceId.equals(that.serviceId) : that.serviceId != null) return false;
if (this.skipCatchupEvents != null ? !this.skipCatchupEvents.equals(that.skipCatchupEvents) : that.skipCatchupEvents != null) return false;
if (this.tolerateResumeErrors != null ? !this.tolerateResumeErrors.equals(that.tolerateResumeErrors) : that.tolerateResumeErrors != null) return false;
return this.unordered != null ? this.unordered.equals(that.unordered) : that.unordered == null;
}
@Override
public final int hashCode() {
int result = this.collection != null ? this.collection.hashCode() : 0;
result = 31 * result + (this.database != null ? this.database.hashCode() : 0);
result = 31 * result + (this.fullDocument != null ? this.fullDocument.hashCode() : 0);
result = 31 * result + (this.fullDocumentBeforeChange != null ? this.fullDocumentBeforeChange.hashCode() : 0);
result = 31 * result + (this.match != null ? this.match.hashCode() : 0);
result = 31 * result + (this.operationTypes != null ? this.operationTypes.hashCode() : 0);
result = 31 * result + (this.project != null ? this.project.hashCode() : 0);
result = 31 * result + (this.serviceId != null ? this.serviceId.hashCode() : 0);
result = 31 * result + (this.skipCatchupEvents != null ? this.skipCatchupEvents.hashCode() : 0);
result = 31 * result + (this.tolerateResumeErrors != null ? this.tolerateResumeErrors.hashCode() : 0);
result = 31 * result + (this.unordered != null ? this.unordered.hashCode() : 0);
return result;
}
}
}