com.grafana.foundation.dashboard.DashboardLink 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 com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.List;
// Links with references to other dashboards or external resources
public class DashboardLink {
// Title to display with the link
@JsonProperty("title")
public String title;
// Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)
@JsonProperty("type")
public DashboardLinkType type;
// Icon name to be displayed with the link
@JsonProperty("icon")
public String icon;
// Tooltip to display when the user hovers their mouse over it
@JsonProperty("tooltip")
public String tooltip;
// Link URL. Only required/valid if the type is link
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@JsonProperty("url")
public String url;
// List of tags to limit the linked dashboards. If empty, all dashboards will be displayed. Only valid if the type is dashboards
@JsonProperty("tags")
public List tags;
// If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards
@JsonProperty("asDropdown")
public Boolean asDropdown;
// If true, the link will be opened in a new tab
@JsonProperty("targetBlank")
public Boolean targetBlank;
// If true, includes current template variables values in the link as query params
@JsonProperty("includeVars")
public Boolean includeVars;
// If true, includes current time range in the link as query params
@JsonProperty("keepTime")
public Boolean keepTime;
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 DashboardLink internal;
public Builder(String title) {
this.internal = new DashboardLink();
this.internal.title = title;
this.asDropdown(false);
this.targetBlank(false);
this.includeVars(false);
this.keepTime(false);
}
public Builder title(String title) {
this.internal.title = title;
return this;
}
public Builder type(DashboardLinkType type) {
this.internal.type = type;
return this;
}
public Builder icon(String icon) {
this.internal.icon = icon;
return this;
}
public Builder tooltip(String tooltip) {
this.internal.tooltip = tooltip;
return this;
}
public Builder url(String url) {
this.internal.url = url;
return this;
}
public Builder tags(List tags) {
this.internal.tags = tags;
return this;
}
public Builder asDropdown(Boolean asDropdown) {
this.internal.asDropdown = asDropdown;
return this;
}
public Builder targetBlank(Boolean targetBlank) {
this.internal.targetBlank = targetBlank;
return this;
}
public Builder includeVars(Boolean includeVars) {
this.internal.includeVars = includeVars;
return this;
}
public Builder keepTime(Boolean keepTime) {
this.internal.keepTime = keepTime;
return this;
}
public DashboardLink build() {
return this.internal;
}
}
}