com.grafana.foundation.alerting.NotificationPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grafana-foundation-sdk Show documentation
Show all versions of grafana-foundation-sdk Show documentation
A set of tools, types and libraries for building and manipulating Grafana objects.
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package com.grafana.foundation.alerting;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
public class NotificationPolicy {
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("continue")
public Boolean continueArg;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("group_by")
public List groupBy;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("group_interval")
public String groupInterval;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("group_wait")
public String groupWait;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("match")
public Map match;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("match_re")
public Map matchRe;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("matchers")
public List matchers;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("mute_time_intervals")
public List muteTimeIntervals;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("object_matchers")
public List> objectMatchers;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("provenance")
public String provenance;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("receiver")
public String receiver;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("repeat_interval")
public String repeatInterval;
// A Route is a node that contains definitions of how to handle alerts. This is modified
// from the upstream alertmanager in that it adds the ObjectMatchers property.
@JsonProperty("routes")
public List routes;
public String toJSON() throws JsonProcessingException {
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return ow.writeValueAsString(this);
}
public static class Builder implements com.grafana.foundation.cog.Builder {
private final NotificationPolicy internal;
public Builder() {
this.internal = new NotificationPolicy();
}
public Builder continueArg(Boolean continueArg) {
this.internal.continueArg = continueArg;
return this;
}
public Builder groupBy(List groupBy) {
this.internal.groupBy = groupBy;
return this;
}
public Builder groupInterval(String groupInterval) {
this.internal.groupInterval = groupInterval;
return this;
}
public Builder groupWait(String groupWait) {
this.internal.groupWait = groupWait;
return this;
}
public Builder match(Map match) {
this.internal.match = match;
return this;
}
public Builder matchRe(Map matchRe) {
this.internal.matchRe = matchRe;
return this;
}
public Builder matchers(List matchers) {
this.internal.matchers = matchers;
return this;
}
public Builder muteTimeIntervals(List muteTimeIntervals) {
this.internal.muteTimeIntervals = muteTimeIntervals;
return this;
}
public Builder objectMatchers(List> objectMatchers) {
this.internal.objectMatchers = objectMatchers;
return this;
}
public Builder provenance(String provenance) {
this.internal.provenance = provenance;
return this;
}
public Builder receiver(String receiver) {
this.internal.receiver = receiver;
return this;
}
public Builder repeatInterval(String repeatInterval) {
this.internal.repeatInterval = repeatInterval;
return this;
}
public Builder routes(com.grafana.foundation.cog.Builder> routes) {
this.internal.routes = routes.build();
return this;
}
public NotificationPolicy build() {
return this.internal;
}
}
}