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.5",
"regenerated": "2023-08-01 14:52:06.656524",
"spec_repo_commit": "279094e1"
"regenerated": "2023-08-01 15:39:48.809645",
"spec_repo_commit": "87a5a9d8"
},
"v2": {
"apigentools_version": "1.6.5",
"regenerated": "2023-08-01 14:52:06.672712",
"spec_repo_commit": "279094e1"
"regenerated": "2023-08-01 15:39:48.828803",
"spec_repo_commit": "87a5a9d8"
}
}
}
5 changes: 5 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,11 @@ components:
across one or several tags, such as hosts.\nUnlike the heat map, a distribution
graph\u2019s x-axis is quantity rather than time."
properties:
custom_links:
description: A list of custom links.
items:
$ref: '#/components/schemas/WidgetCustomLink'
type: array
legend_size:
deprecated: true
description: (Deprecated) The widget legend was replaced by a tooltip and
Expand Down
6 changes: 6 additions & 0 deletions examples/v1/dashboards/CreateDashboard_252716965.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricDataSource;
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricQueryDefinition;
import com.datadog.api.client.v1.model.Widget;
import com.datadog.api.client.v1.model.WidgetCustomLink;
import com.datadog.api.client.v1.model.WidgetDefinition;
import com.datadog.api.client.v1.model.WidgetLayout;
import com.datadog.api.client.v1.model.WidgetStyle;
Expand All @@ -41,6 +42,11 @@ public static void main(String[] args) {
.titleAlign(WidgetTextAlign.LEFT)
.showLegend(false)
.type(DistributionWidgetDefinitionType.DISTRIBUTION)
.customLinks(
Collections.singletonList(
new WidgetCustomLink()
.label("Example")
.link("https://example.org/")))
.xaxis(
new DistributionWidgetXAxis()
.max("auto")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* time.
*/
@JsonPropertyOrder({
DistributionWidgetDefinition.JSON_PROPERTY_CUSTOM_LINKS,
DistributionWidgetDefinition.JSON_PROPERTY_LEGEND_SIZE,
DistributionWidgetDefinition.JSON_PROPERTY_MARKERS,
DistributionWidgetDefinition.JSON_PROPERTY_REQUESTS,
Expand All @@ -41,6 +42,9 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class DistributionWidgetDefinition {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_CUSTOM_LINKS = "custom_links";
private List<WidgetCustomLink> customLinks = null;

public static final String JSON_PROPERTY_LEGEND_SIZE = "legend_size";
private String legendSize;

Expand Down Expand Up @@ -87,6 +91,39 @@ public DistributionWidgetDefinition(
this.unparsed |= !type.isValid();
}

public DistributionWidgetDefinition customLinks(List<WidgetCustomLink> customLinks) {
this.customLinks = customLinks;
for (WidgetCustomLink item : customLinks) {
this.unparsed |= item.unparsed;
}
return this;
}

public DistributionWidgetDefinition addCustomLinksItem(WidgetCustomLink customLinksItem) {
if (this.customLinks == null) {
this.customLinks = new ArrayList<>();
}
this.customLinks.add(customLinksItem);
this.unparsed |= customLinksItem.unparsed;
return this;
}

/**
* A list of custom links.
*
* @return customLinks
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CUSTOM_LINKS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<WidgetCustomLink> getCustomLinks() {
return customLinks;
}

public void setCustomLinks(List<WidgetCustomLink> customLinks) {
this.customLinks = customLinks;
}

public DistributionWidgetDefinition legendSize(String legendSize) {
this.legendSize = legendSize;
return this;
Expand Down Expand Up @@ -414,7 +451,8 @@ public boolean equals(Object o) {
return false;
}
DistributionWidgetDefinition distributionWidgetDefinition = (DistributionWidgetDefinition) o;
return Objects.equals(this.legendSize, distributionWidgetDefinition.legendSize)
return Objects.equals(this.customLinks, distributionWidgetDefinition.customLinks)
&& Objects.equals(this.legendSize, distributionWidgetDefinition.legendSize)
&& Objects.equals(this.markers, distributionWidgetDefinition.markers)
&& Objects.equals(this.requests, distributionWidgetDefinition.requests)
&& Objects.equals(this.showLegend, distributionWidgetDefinition.showLegend)
Expand All @@ -432,6 +470,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
customLinks,
legendSize,
markers,
requests,
Expand All @@ -450,6 +489,7 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DistributionWidgetDefinition {\n");
sb.append(" customLinks: ").append(toIndentedString(customLinks)).append("\n");
sb.append(" legendSize: ").append(toIndentedString(legendSize)).append("\n");
sb.append(" markers: ").append(toIndentedString(markers)).append("\n");
sb.append(" requests: ").append(toIndentedString(requests)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-06-03T14:40:32.372Z
2023-08-01T15:16:44.506Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_metrics_q-1654267232\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"histogram:trace.Load{*}\"},\"request_type\":\"histogram\",\"style\":{\"palette\":\"dog_classic\"}}],\"show_legend\":false,\"title\":\"Metrics HOP\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"distribution\",\"xaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"},\"yaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"}},\"layout\":{\"height\":2,\"width\":4,\"x\":0,\"y\":0}}]}"
"json": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_metrics_q-1690903004\",\"widgets\":[{\"definition\":{\"custom_links\":[{\"label\":\"Example\",\"link\":\"https://example.org/\"}],\"requests\":[{\"query\":{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"histogram:trace.Load{*}\"},\"request_type\":\"histogram\",\"style\":{\"palette\":\"dog_classic\"}}],\"show_legend\":false,\"title\":\"Metrics HOP\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"distribution\",\"xaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"},\"yaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"}},\"layout\":{\"height\":2,\"width\":4,\"x\":0,\"y\":0}}]}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"gb2-e78-emw\",\"title\":\"Test-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_metrics_q-1654267232\",\"url\":\"/dashboard/gb2-e78-emw/test-createadistributionwidgetusingahistogramrequestcontainingaformulasandfuncti\",\"created_at\":\"2022-06-03T14:40:32.735409+00:00\",\"modified_at\":\"2022-06-03T14:40:32.735409+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"title_size\":\"16\",\"title\":\"Metrics HOP\",\"title_align\":\"left\",\"yaxis\":{\"include_zero\":true,\"scale\":\"linear\",\"min\":\"auto\",\"max\":\"auto\"},\"show_legend\":false,\"xaxis\":{\"include_zero\":true,\"scale\":\"linear\",\"min\":\"auto\",\"max\":\"auto\"},\"requests\":[{\"query\":{\"query\":\"histogram:trace.Load{*}\",\"data_source\":\"metrics\",\"name\":\"query1\"},\"request_type\":\"histogram\",\"style\":{\"palette\":\"dog_classic\"}}],\"type\":\"distribution\"},\"layout\":{\"y\":0,\"width\":4,\"x\":0,\"height\":2},\"id\":3096166427221540}],\"layout_type\":\"ordered\"}",
"body": "{\"id\":\"uts-6em-2su\",\"title\":\"Test-Create_a_distribution_widget_using_a_histogram_request_containing_a_formulas_and_functions_metrics_q-1690903004\",\"description\":null,\"author_handle\":\"frog@datadoghq.com\",\"author_name\":null,\"layout_type\":\"ordered\",\"url\":\"/dashboard/uts-6em-2su/test-createadistributionwidgetusingahistogramrequestcontainingaformulasandfuncti\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"custom_links\":[{\"label\":\"Example\",\"link\":\"https://example.org/\"}],\"requests\":[{\"query\":{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"histogram:trace.Load{*}\"},\"request_type\":\"histogram\",\"style\":{\"palette\":\"dog_classic\"}}],\"show_legend\":false,\"title\":\"Metrics HOP\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"distribution\",\"xaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"},\"yaxis\":{\"include_zero\":true,\"max\":\"auto\",\"min\":\"auto\",\"scale\":\"linear\"}},\"layout\":{\"height\":2,\"width\":4,\"x\":0,\"y\":0},\"id\":4570406064684725}],\"notify_list\":null,\"created_at\":\"2023-08-01T15:16:44.785380+00:00\",\"modified_at\":\"2023-08-01T15:16:44.785380+00:00\",\"restricted_roles\":[]}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,18 +27,18 @@
"timeToLive": {
"unlimited": true
},
"id": "740963bc-6d6e-0f0c-d12c-4ac2cf50f5e5"
"id": "f7984f12-f97f-da28-ade3-6ae75d3e477a"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v1/dashboard/gb2-e78-emw",
"path": "/api/v1/dashboard/uts-6em-2su",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"deleted_dashboard_id\":\"gb2-e78-emw\"}",
"body": "{\"deleted_dashboard_id\":\"uts-6em-2su\"}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -53,6 +53,6 @@
"timeToLive": {
"unlimited": true
},
"id": "54dd620c-2ec3-89a1-992b-bd279b6a6b9c"
"id": "7638967a-6538-7095-de2b-f2971833f07b"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ Feature: Dashboards
@team:DataDog/dashboards-backend
Scenario: Create a distribution widget using a histogram request containing a formulas and functions metrics query
Given new "CreateDashboard" request
And body with value { "title": "{{ unique }}", "widgets": [ { "definition": { "title": "Metrics HOP", "title_size": "16", "title_align": "left", "show_legend": false, "type": "distribution", "xaxis": { "max": "auto", "include_zero": true, "scale": "linear", "min": "auto" }, "yaxis": { "max": "auto", "include_zero": true, "scale": "linear", "min": "auto" }, "requests": [ { "query": { "query": "histogram:trace.Load{*}", "data_source": "metrics", "name": "query1" }, "request_type": "histogram", "style": { "palette": "dog_classic" } } ] }, "layout": { "x": 0, "y": 0, "width": 4, "height": 2 } } ], "layout_type": "ordered" }
And body with value {"title":"{{ unique }}","widgets":[{"definition":{"title":"Metrics HOP","title_size":"16","title_align":"left","show_legend":false,"type":"distribution","custom_links":[{"label":"Example","link":"https://example.org/"}],"xaxis":{"max":"auto","include_zero":true,"scale":"linear","min":"auto"},"yaxis":{"max":"auto","include_zero":true,"scale":"linear","min":"auto"},"requests":[{"query":{"query":"histogram:trace.Load{*}","data_source":"metrics","name":"query1"},"request_type":"histogram","style":{"palette":"dog_classic"}}]},"layout":{"x":0,"y":0,"width":4,"height":2}}],"layout_type":"ordered"}
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.requests[0].request_type" is equal to "histogram"
And the response "widgets[0].definition.requests[0].style" is equal to { "palette": "dog_classic" }
And the response "widgets[0].definition.requests[0].query.query" is equal to "histogram:trace.Load{*}"
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "metrics"
And the response "widgets[0].definition.requests[0].query.name" is equal to "query1"
And the response "widgets[0].definition.custom_links" has item with field "label" with value "Example"

@team:DataDog/dashboards-backend
Scenario: Create a geomap widget using an event_list request
Expand Down