com.thedesignium.cdklognotifier.LogNotifierProps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdk-log-notifier Show documentation
Show all versions of cdk-log-notifier Show documentation
@thedesignium/cdk-log-notifier
The newest version!
package com.thedesignium.cdklognotifier;
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-31T07:21:45.559Z")
@software.amazon.jsii.Jsii(module = com.thedesignium.cdklognotifier.$Module.class, fqn = "@thedesignium/cdk-log-notifier.LogNotifierProps")
@software.amazon.jsii.Jsii.Proxy(LogNotifierProps.Jsii$Proxy.class)
public interface LogNotifierProps extends software.amazon.jsii.JsiiSerializable {
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.logs.IFilterPattern getFilterPattern();
@org.jetbrains.annotations.NotNull java.lang.String getSlackIncomingWebhookUrl();
default @org.jetbrains.annotations.Nullable com.thedesignium.cdklognotifier.DateTimeFormatOptions getDateTimeFormatOptions() {
return null;
}
/**
* @return a {@link Builder} of {@link LogNotifierProps}
*/
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link LogNotifierProps}
*/
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.logs.IFilterPattern filterPattern;
java.lang.String slackIncomingWebhookUrl;
com.thedesignium.cdklognotifier.DateTimeFormatOptions dateTimeFormatOptions;
/**
* Sets the value of {@link LogNotifierProps#getFilterPattern}
* @param filterPattern the value to be set. This parameter is required.
* @return {@code this}
*/
public Builder filterPattern(software.amazon.awscdk.services.logs.IFilterPattern filterPattern) {
this.filterPattern = filterPattern;
return this;
}
/**
* Sets the value of {@link LogNotifierProps#getSlackIncomingWebhookUrl}
* @param slackIncomingWebhookUrl the value to be set. This parameter is required.
* @return {@code this}
*/
public Builder slackIncomingWebhookUrl(java.lang.String slackIncomingWebhookUrl) {
this.slackIncomingWebhookUrl = slackIncomingWebhookUrl;
return this;
}
/**
* Sets the value of {@link LogNotifierProps#getDateTimeFormatOptions}
* @param dateTimeFormatOptions the value to be set.
* @return {@code this}
*/
public Builder dateTimeFormatOptions(com.thedesignium.cdklognotifier.DateTimeFormatOptions dateTimeFormatOptions) {
this.dateTimeFormatOptions = dateTimeFormatOptions;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link LogNotifierProps}
* @throws NullPointerException if any required attribute was not provided
*/
@Override
public LogNotifierProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link LogNotifierProps}
*/
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements LogNotifierProps {
private final software.amazon.awscdk.services.logs.IFilterPattern filterPattern;
private final java.lang.String slackIncomingWebhookUrl;
private final com.thedesignium.cdklognotifier.DateTimeFormatOptions dateTimeFormatOptions;
/**
* 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.filterPattern = software.amazon.jsii.Kernel.get(this, "filterPattern", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.IFilterPattern.class));
this.slackIncomingWebhookUrl = software.amazon.jsii.Kernel.get(this, "slackIncomingWebhookUrl", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.dateTimeFormatOptions = software.amazon.jsii.Kernel.get(this, "dateTimeFormatOptions", software.amazon.jsii.NativeType.forClass(com.thedesignium.cdklognotifier.DateTimeFormatOptions.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.filterPattern = java.util.Objects.requireNonNull(builder.filterPattern, "filterPattern is required");
this.slackIncomingWebhookUrl = java.util.Objects.requireNonNull(builder.slackIncomingWebhookUrl, "slackIncomingWebhookUrl is required");
this.dateTimeFormatOptions = builder.dateTimeFormatOptions;
}
@Override
public final software.amazon.awscdk.services.logs.IFilterPattern getFilterPattern() {
return this.filterPattern;
}
@Override
public final java.lang.String getSlackIncomingWebhookUrl() {
return this.slackIncomingWebhookUrl;
}
@Override
public final com.thedesignium.cdklognotifier.DateTimeFormatOptions getDateTimeFormatOptions() {
return this.dateTimeFormatOptions;
}
@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("filterPattern", om.valueToTree(this.getFilterPattern()));
data.set("slackIncomingWebhookUrl", om.valueToTree(this.getSlackIncomingWebhookUrl()));
if (this.getDateTimeFormatOptions() != null) {
data.set("dateTimeFormatOptions", om.valueToTree(this.getDateTimeFormatOptions()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@thedesignium/cdk-log-notifier.LogNotifierProps"));
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;
LogNotifierProps.Jsii$Proxy that = (LogNotifierProps.Jsii$Proxy) o;
if (!filterPattern.equals(that.filterPattern)) return false;
if (!slackIncomingWebhookUrl.equals(that.slackIncomingWebhookUrl)) return false;
return this.dateTimeFormatOptions != null ? this.dateTimeFormatOptions.equals(that.dateTimeFormatOptions) : that.dateTimeFormatOptions == null;
}
@Override
public final int hashCode() {
int result = this.filterPattern.hashCode();
result = 31 * result + (this.slackIncomingWebhookUrl.hashCode());
result = 31 * result + (this.dateTimeFormatOptions != null ? this.dateTimeFormatOptions.hashCode() : 0);
return result;
}
}
}