Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-06-28 13:29:57.819858",
"spec_repo_commit": "042157e1"
"regenerated": "2023-06-28 20:35:44.639648",
"spec_repo_commit": "e0f0af3f"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-06-28 13:29:57.832502",
"spec_repo_commit": "042157e1"
"regenerated": "2023-06-28 20:35:44.653774",
"spec_repo_commit": "e0f0af3f"
}
}
}
17 changes: 16 additions & 1 deletion .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2731,15 +2731,18 @@ components:
- $ref: '#/components/schemas/FormulaAndFunctionSLOQueryDefinition'
type: object
FormulaAndFunctionResponseFormat:
description: Timeseries or Scalar response.
description: Timeseries, scalar, or event list response. Event list response
formats are supported by Geomap widgets.
enum:
- timeseries
- scalar
- event_list
example: timeseries
type: string
x-enum-varnames:
- TIMESERIES
- SCALAR
- EVENT_LIST
FormulaAndFunctionSLODataSource:
description: Data source for SLO measures queries.
enum:
Expand Down Expand Up @@ -3127,6 +3130,16 @@ components:
GeomapWidgetRequest:
description: An updated geomap widget.
properties:
columns:
description: Widget columns.
example:
- field: timestamp
width: auto
- field: content
width: full
items:
$ref: '#/components/schemas/ListStreamColumn'
type: array
formulas:
description: List of formulas that operate on queries.
items:
Expand All @@ -3142,6 +3155,8 @@ components:
items:
$ref: '#/components/schemas/FormulaAndFunctionQueryDefinition'
type: array
query:
$ref: '#/components/schemas/ListStreamQuery'
response_format:
$ref: '#/components/schemas/FormulaAndFunctionResponseFormat'
rum_query:
Expand Down
98 changes: 98 additions & 0 deletions examples/v1/dashboards/CreateDashboard_3513586382.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Create a geomap widget using an event_list request

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.DashboardsApi;
import com.datadog.api.client.v1.model.Dashboard;
import com.datadog.api.client.v1.model.DashboardLayoutType;
import com.datadog.api.client.v1.model.DashboardReflowType;
import com.datadog.api.client.v1.model.FormulaAndFunctionResponseFormat;
import com.datadog.api.client.v1.model.GeomapWidgetDefinition;
import com.datadog.api.client.v1.model.GeomapWidgetDefinitionStyle;
import com.datadog.api.client.v1.model.GeomapWidgetDefinitionType;
import com.datadog.api.client.v1.model.GeomapWidgetDefinitionView;
import com.datadog.api.client.v1.model.GeomapWidgetRequest;
import com.datadog.api.client.v1.model.ListStreamColumn;
import com.datadog.api.client.v1.model.ListStreamColumnWidth;
import com.datadog.api.client.v1.model.ListStreamQuery;
import com.datadog.api.client.v1.model.ListStreamSource;
import com.datadog.api.client.v1.model.Widget;
import com.datadog.api.client.v1.model.WidgetDefinition;
import com.datadog.api.client.v1.model.WidgetLayout;
import com.datadog.api.client.v1.model.WidgetTextAlign;
import java.util.Arrays;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
DashboardsApi apiInstance = new DashboardsApi(defaultClient);

Dashboard body =
new Dashboard()
.title("Example-Dashboard")
.description("Example-Dashboard")
.widgets(
Collections.singletonList(
new Widget()
.definition(
new WidgetDefinition(
new GeomapWidgetDefinition()
.title("")
.titleSize("16")
.titleAlign(WidgetTextAlign.LEFT)
.type(GeomapWidgetDefinitionType.GEOMAP)
.requests(
Collections.singletonList(
new GeomapWidgetRequest()
.responseFormat(
FormulaAndFunctionResponseFormat.EVENT_LIST)
.query(
new ListStreamQuery()
.dataSource(ListStreamSource.LOGS_STREAM)
.queryString(""))
.columns(
Arrays.asList(
new ListStreamColumn()
.field(
"@network.client.geoip.location.latitude")
.width(ListStreamColumnWidth.AUTO),
new ListStreamColumn()
.field(
"@network.client.geoip.location.longitude")
.width(ListStreamColumnWidth.AUTO),
new ListStreamColumn()
.field(
"@network.client.geoip.country.iso_code")
.width(ListStreamColumnWidth.AUTO),
new ListStreamColumn()
.field(
"@network.client.geoip.subdivision.name")
.width(ListStreamColumnWidth.AUTO),
new ListStreamColumn()
.field("classic")
.width(ListStreamColumnWidth.AUTO),
new ListStreamColumn()
.field("")
.width(ListStreamColumnWidth.AUTO)))))
.style(
new GeomapWidgetDefinitionStyle()
.palette("hostmap_blues")
.paletteFlip(false))
.view(new GeomapWidgetDefinitionView().focus("WORLD"))))
.layout(new WidgetLayout().x(0L).y(0L).width(12L).height(6L))))
.layoutType(DashboardLayoutType.ORDERED)
.reflowType(DashboardReflowType.FIXED);

try {
Dashboard result = apiInstance.createDashboard(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DashboardsApi#createDashboard");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ public ChangeWidgetRequest responseFormat(FormulaAndFunctionResponseFormat respo
}

/**
* Timeseries or Scalar response.
* Timeseries, scalar, or event list response. Event list response formats are supported by Geomap
* widgets.
*
* @return responseFormat
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import java.util.Objects;
import java.util.Set;

/** Timeseries or Scalar response. */
/**
* Timeseries, scalar, or event list response. Event list response formats are supported by Geomap
* widgets.
*/
@JsonSerialize(
using = FormulaAndFunctionResponseFormat.FormulaAndFunctionResponseFormatSerializer.class)
public class FormulaAndFunctionResponseFormat {
Expand All @@ -28,9 +31,11 @@ public class FormulaAndFunctionResponseFormat {
new FormulaAndFunctionResponseFormat("timeseries");
public static final FormulaAndFunctionResponseFormat SCALAR =
new FormulaAndFunctionResponseFormat("scalar");
public static final FormulaAndFunctionResponseFormat EVENT_LIST =
new FormulaAndFunctionResponseFormat("event_list");

private static final Set<String> allowedValues =
new HashSet<String>(Arrays.asList("timeseries", "scalar"));
new HashSet<String>(Arrays.asList("timeseries", "scalar", "event_list"));

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

/** An updated geomap widget. */
@JsonPropertyOrder({
GeomapWidgetRequest.JSON_PROPERTY_COLUMNS,
GeomapWidgetRequest.JSON_PROPERTY_FORMULAS,
GeomapWidgetRequest.JSON_PROPERTY_LOG_QUERY,
GeomapWidgetRequest.JSON_PROPERTY_Q,
GeomapWidgetRequest.JSON_PROPERTY_QUERIES,
GeomapWidgetRequest.JSON_PROPERTY_QUERY,
GeomapWidgetRequest.JSON_PROPERTY_RESPONSE_FORMAT,
GeomapWidgetRequest.JSON_PROPERTY_RUM_QUERY,
GeomapWidgetRequest.JSON_PROPERTY_SECURITY_QUERY
Expand All @@ -32,6 +34,9 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class GeomapWidgetRequest {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_COLUMNS = "columns";
private List<ListStreamColumn> columns = null;

public static final String JSON_PROPERTY_FORMULAS = "formulas";
private List<WidgetFormula> formulas = null;

Expand All @@ -44,6 +49,9 @@ public class GeomapWidgetRequest {
public static final String JSON_PROPERTY_QUERIES = "queries";
private List<FormulaAndFunctionQueryDefinition> queries = null;

public static final String JSON_PROPERTY_QUERY = "query";
private ListStreamQuery query;

public static final String JSON_PROPERTY_RESPONSE_FORMAT = "response_format";
private FormulaAndFunctionResponseFormat responseFormat;

Expand All @@ -53,6 +61,39 @@ public class GeomapWidgetRequest {
public static final String JSON_PROPERTY_SECURITY_QUERY = "security_query";
private LogQueryDefinition securityQuery;

public GeomapWidgetRequest columns(List<ListStreamColumn> columns) {
this.columns = columns;
for (ListStreamColumn item : columns) {
this.unparsed |= item.unparsed;
}
return this;
}

public GeomapWidgetRequest addColumnsItem(ListStreamColumn columnsItem) {
if (this.columns == null) {
this.columns = new ArrayList<>();
}
this.columns.add(columnsItem);
this.unparsed |= columnsItem.unparsed;
return this;
}

/**
* Widget columns.
*
* @return columns
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLUMNS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<ListStreamColumn> getColumns() {
return columns;
}

public void setColumns(List<ListStreamColumn> columns) {
this.columns = columns;
}

public GeomapWidgetRequest formulas(List<WidgetFormula> formulas) {
this.formulas = formulas;
for (WidgetFormula item : formulas) {
Expand Down Expand Up @@ -162,14 +203,37 @@ public void setQueries(List<FormulaAndFunctionQueryDefinition> queries) {
this.queries = queries;
}

public GeomapWidgetRequest query(ListStreamQuery query) {
this.query = query;
this.unparsed |= query.unparsed;
return this;
}

/**
* Updated list stream widget.
*
* @return query
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_QUERY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public ListStreamQuery getQuery() {
return query;
}

public void setQuery(ListStreamQuery query) {
this.query = query;
}

public GeomapWidgetRequest responseFormat(FormulaAndFunctionResponseFormat responseFormat) {
this.responseFormat = responseFormat;
this.unparsed |= !responseFormat.isValid();
return this;
}

/**
* Timeseries or Scalar response.
* Timeseries, scalar, or event list response. Event list response formats are supported by Geomap
* widgets.
*
* @return responseFormat
*/
Expand Down Expand Up @@ -287,10 +351,12 @@ public boolean equals(Object o) {
return false;
}
GeomapWidgetRequest geomapWidgetRequest = (GeomapWidgetRequest) o;
return Objects.equals(this.formulas, geomapWidgetRequest.formulas)
return Objects.equals(this.columns, geomapWidgetRequest.columns)
&& Objects.equals(this.formulas, geomapWidgetRequest.formulas)
&& Objects.equals(this.logQuery, geomapWidgetRequest.logQuery)
&& Objects.equals(this.q, geomapWidgetRequest.q)
&& Objects.equals(this.queries, geomapWidgetRequest.queries)
&& Objects.equals(this.query, geomapWidgetRequest.query)
&& Objects.equals(this.responseFormat, geomapWidgetRequest.responseFormat)
&& Objects.equals(this.rumQuery, geomapWidgetRequest.rumQuery)
&& Objects.equals(this.securityQuery, geomapWidgetRequest.securityQuery)
Expand All @@ -300,10 +366,12 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
columns,
formulas,
logQuery,
q,
queries,
query,
responseFormat,
rumQuery,
securityQuery,
Expand All @@ -314,10 +382,12 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GeomapWidgetRequest {\n");
sb.append(" columns: ").append(toIndentedString(columns)).append("\n");
sb.append(" formulas: ").append(toIndentedString(formulas)).append("\n");
sb.append(" logQuery: ").append(toIndentedString(logQuery)).append("\n");
sb.append(" q: ").append(toIndentedString(q)).append("\n");
sb.append(" queries: ").append(toIndentedString(queries)).append("\n");
sb.append(" query: ").append(toIndentedString(query)).append("\n");
sb.append(" responseFormat: ").append(toIndentedString(responseFormat)).append("\n");
sb.append(" rumQuery: ").append(toIndentedString(rumQuery)).append("\n");
sb.append(" securityQuery: ").append(toIndentedString(securityQuery)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ public QueryValueWidgetRequest responseFormat(FormulaAndFunctionResponseFormat r
}

/**
* Timeseries or Scalar response.
* Timeseries, scalar, or event list response. Event list response formats are supported by Geomap
* widgets.
*
* @return responseFormat
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public ScatterplotTableRequest responseFormat(FormulaAndFunctionResponseFormat r
}

/**
* Timeseries or Scalar response.
* Timeseries, scalar, or event list response. Event list response formats are supported by Geomap
* widgets.
*
* @return responseFormat
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ public SunburstWidgetRequest responseFormat(FormulaAndFunctionResponseFormat res
}

/**
* Timeseries or Scalar response.
* Timeseries, scalar, or event list response. Event list response formats are supported by Geomap
* widgets.
*
* @return responseFormat
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ public TableWidgetRequest responseFormat(FormulaAndFunctionResponseFormat respon
}

/**
* Timeseries or Scalar response.
* Timeseries, scalar, or event list response. Event list response formats are supported by Geomap
* widgets.
*
* @return responseFormat
*/
Expand Down
Loading