com.grafana.foundation.dashboard.TimePickerConfig 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.dashboard;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import java.util.List;
// Time picker configuration
// It defines the default config for the time picker and the refresh picker for the specific dashboard.
public class TimePickerConfig {
// Whether timepicker is visible or not.
@JsonProperty("hidden")
public Boolean hidden;
// Interval options available in the refresh picker dropdown.
@JsonProperty("refresh_intervals")
public List refreshIntervals;
// Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard.
@JsonProperty("time_options")
public List timeOptions;
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 TimePickerConfig internal;
public Builder() {
this.internal = new TimePickerConfig();
this.hidden(false);
this.refreshIntervals(List.of("5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"));
this.timeOptions(List.of("5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"));
}
public Builder hidden(Boolean hidden) {
this.internal.hidden = hidden;
return this;
}
public Builder refreshIntervals(List refreshIntervals) {
this.internal.refreshIntervals = refreshIntervals;
return this;
}
public Builder timeOptions(List timeOptions) {
this.internal.timeOptions = timeOptions;
return this;
}
public TimePickerConfig build() {
return this.internal;
}
}
}