org.mongodb.awscdk.resources.mongodbatlas.CfnAlertConfigurationProps Maven / Gradle / Ivy
Show all versions of awscdk-resources-mongodbatlas Show documentation
package org.mongodb.awscdk.resources.mongodbatlas;
/**
* Returns and edits the conditions that trigger alerts and how MongoDB Cloud notifies users.
*
* This collection remains under revision and may change. Refer to the legacy documentation for this collection in the following link.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-30T09:54:28.893Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.CfnAlertConfigurationProps")
@software.amazon.jsii.Jsii.Proxy(CfnAlertConfigurationProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface CfnAlertConfigurationProps extends software.amazon.jsii.JsiiSerializable {
/**
* Event type that triggers an alert.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getEventTypeName() {
return null;
}
/**
* List of rules that determine whether MongoDB Cloud checks an object for the alert configuration.
*
* You can filter using the matchers array if the eventTypeName specifies an event for a host, replica set, or sharded cluster.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getMatchers() {
return null;
}
/**
* Threshold for the metric that, when exceeded, triggers an alert.
*
* The resource returns this parameter when '"eventTypeName" : "OUTSIDE_METRIC_THRESHOLD"'.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdView getMetricThreshold() {
return null;
}
/**
* List that contains the targets that MongoDB Cloud sends notifications.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getNotifications() {
return null;
}
/**
* Profile used to provide credentials information, (a secret with the cfn/atlas/profile/{Profile}, is required), if not provided default is used.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getProfile() {
return null;
}
/**
* Unique 24-hexadecimal digit string that identifies your project.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getProjectId() {
return null;
}
/**
* Limit that triggers an alert when exceeded.
*
* The resource returns this parameter when eventTypeName has not been set to 'OUTSIDE_METRIC_THRESHOLD'.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdView getThreshold() {
return null;
}
/**
* Human-readable label that displays the alert type.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getTypeName() {
return null;
}
/**
* @return a {@link Builder} of {@link CfnAlertConfigurationProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CfnAlertConfigurationProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String eventTypeName;
java.util.List matchers;
org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdView metricThreshold;
java.util.List notifications;
java.lang.String profile;
java.lang.String projectId;
org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdView threshold;
java.lang.String typeName;
/**
* Sets the value of {@link CfnAlertConfigurationProps#getEventTypeName}
* @param eventTypeName Event type that triggers an alert.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder eventTypeName(java.lang.String eventTypeName) {
this.eventTypeName = eventTypeName;
return this;
}
/**
* Sets the value of {@link CfnAlertConfigurationProps#getMatchers}
* @param matchers List of rules that determine whether MongoDB Cloud checks an object for the alert configuration.
* You can filter using the matchers array if the eventTypeName specifies an event for a host, replica set, or sharded cluster.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder matchers(java.util.List extends org.mongodb.awscdk.resources.mongodbatlas.Matcher> matchers) {
this.matchers = (java.util.List)matchers;
return this;
}
/**
* Sets the value of {@link CfnAlertConfigurationProps#getMetricThreshold}
* @param metricThreshold Threshold for the metric that, when exceeded, triggers an alert.
* The resource returns this parameter when '"eventTypeName" : "OUTSIDE_METRIC_THRESHOLD"'.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder metricThreshold(org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdView metricThreshold) {
this.metricThreshold = metricThreshold;
return this;
}
/**
* Sets the value of {@link CfnAlertConfigurationProps#getNotifications}
* @param notifications List that contains the targets that MongoDB Cloud sends notifications.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder notifications(java.util.List extends org.mongodb.awscdk.resources.mongodbatlas.NotificationView> notifications) {
this.notifications = (java.util.List)notifications;
return this;
}
/**
* Sets the value of {@link CfnAlertConfigurationProps#getProfile}
* @param profile Profile used to provide credentials information, (a secret with the cfn/atlas/profile/{Profile}, is required), if not provided default is used.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder profile(java.lang.String profile) {
this.profile = profile;
return this;
}
/**
* Sets the value of {@link CfnAlertConfigurationProps#getProjectId}
* @param projectId Unique 24-hexadecimal digit string that identifies your project.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder projectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
/**
* Sets the value of {@link CfnAlertConfigurationProps#getThreshold}
* @param threshold Limit that triggers an alert when exceeded.
* The resource returns this parameter when eventTypeName has not been set to 'OUTSIDE_METRIC_THRESHOLD'.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder threshold(org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdView threshold) {
this.threshold = threshold;
return this;
}
/**
* Sets the value of {@link CfnAlertConfigurationProps#getTypeName}
* @param typeName Human-readable label that displays the alert type.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder typeName(java.lang.String typeName) {
this.typeName = typeName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CfnAlertConfigurationProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public CfnAlertConfigurationProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CfnAlertConfigurationProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CfnAlertConfigurationProps {
private final java.lang.String eventTypeName;
private final java.util.List matchers;
private final org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdView metricThreshold;
private final java.util.List notifications;
private final java.lang.String profile;
private final java.lang.String projectId;
private final org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdView threshold;
private final java.lang.String typeName;
/**
* 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.eventTypeName = software.amazon.jsii.Kernel.get(this, "eventTypeName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.matchers = software.amazon.jsii.Kernel.get(this, "matchers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.Matcher.class)));
this.metricThreshold = software.amazon.jsii.Kernel.get(this, "metricThreshold", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdView.class));
this.notifications = software.amazon.jsii.Kernel.get(this, "notifications", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.NotificationView.class)));
this.profile = software.amazon.jsii.Kernel.get(this, "profile", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.projectId = software.amazon.jsii.Kernel.get(this, "projectId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.threshold = software.amazon.jsii.Kernel.get(this, "threshold", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdView.class));
this.typeName = software.amazon.jsii.Kernel.get(this, "typeName", software.amazon.jsii.NativeType.forClass(java.lang.String.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.eventTypeName = builder.eventTypeName;
this.matchers = (java.util.List)builder.matchers;
this.metricThreshold = builder.metricThreshold;
this.notifications = (java.util.List)builder.notifications;
this.profile = builder.profile;
this.projectId = builder.projectId;
this.threshold = builder.threshold;
this.typeName = builder.typeName;
}
@Override
public final java.lang.String getEventTypeName() {
return this.eventTypeName;
}
@Override
public final java.util.List getMatchers() {
return this.matchers;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.MetricThresholdView getMetricThreshold() {
return this.metricThreshold;
}
@Override
public final java.util.List getNotifications() {
return this.notifications;
}
@Override
public final java.lang.String getProfile() {
return this.profile;
}
@Override
public final java.lang.String getProjectId() {
return this.projectId;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.IntegerThresholdView getThreshold() {
return this.threshold;
}
@Override
public final java.lang.String getTypeName() {
return this.typeName;
}
@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.getEventTypeName() != null) {
data.set("eventTypeName", om.valueToTree(this.getEventTypeName()));
}
if (this.getMatchers() != null) {
data.set("matchers", om.valueToTree(this.getMatchers()));
}
if (this.getMetricThreshold() != null) {
data.set("metricThreshold", om.valueToTree(this.getMetricThreshold()));
}
if (this.getNotifications() != null) {
data.set("notifications", om.valueToTree(this.getNotifications()));
}
if (this.getProfile() != null) {
data.set("profile", om.valueToTree(this.getProfile()));
}
if (this.getProjectId() != null) {
data.set("projectId", om.valueToTree(this.getProjectId()));
}
if (this.getThreshold() != null) {
data.set("threshold", om.valueToTree(this.getThreshold()));
}
if (this.getTypeName() != null) {
data.set("typeName", om.valueToTree(this.getTypeName()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-resources-mongodbatlas.CfnAlertConfigurationProps"));
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;
CfnAlertConfigurationProps.Jsii$Proxy that = (CfnAlertConfigurationProps.Jsii$Proxy) o;
if (this.eventTypeName != null ? !this.eventTypeName.equals(that.eventTypeName) : that.eventTypeName != null) return false;
if (this.matchers != null ? !this.matchers.equals(that.matchers) : that.matchers != null) return false;
if (this.metricThreshold != null ? !this.metricThreshold.equals(that.metricThreshold) : that.metricThreshold != null) return false;
if (this.notifications != null ? !this.notifications.equals(that.notifications) : that.notifications != null) return false;
if (this.profile != null ? !this.profile.equals(that.profile) : that.profile != null) return false;
if (this.projectId != null ? !this.projectId.equals(that.projectId) : that.projectId != null) return false;
if (this.threshold != null ? !this.threshold.equals(that.threshold) : that.threshold != null) return false;
return this.typeName != null ? this.typeName.equals(that.typeName) : that.typeName == null;
}
@Override
public final int hashCode() {
int result = this.eventTypeName != null ? this.eventTypeName.hashCode() : 0;
result = 31 * result + (this.matchers != null ? this.matchers.hashCode() : 0);
result = 31 * result + (this.metricThreshold != null ? this.metricThreshold.hashCode() : 0);
result = 31 * result + (this.notifications != null ? this.notifications.hashCode() : 0);
result = 31 * result + (this.profile != null ? this.profile.hashCode() : 0);
result = 31 * result + (this.projectId != null ? this.projectId.hashCode() : 0);
result = 31 * result + (this.threshold != null ? this.threshold.hashCode() : 0);
result = 31 * result + (this.typeName != null ? this.typeName.hashCode() : 0);
return result;
}
}
}