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.4.1.dev11",
"regenerated": "2021-08-27 15:15:14.535937",
"spec_repo_commit": "04b2dd3"
"regenerated": "2021-09-03 13:54:25.660852",
"spec_repo_commit": "e9ac191"
},
"v2": {
"apigentools_version": "1.4.1.dev11",
"regenerated": "2021-08-27 15:16:03.083324",
"spec_repo_commit": "04b2dd3"
"regenerated": "2021-09-03 13:55:16.624933",
"spec_repo_commit": "e9ac191"
}
}
}
1 change: 1 addition & 0 deletions api_docs/v1/DashboardTemplateVariable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Template variable.

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**availableValues** | **List<String>** | The list of values that the template variable drop-down is limited to. | [optional]
**_default** | **String** | The default value for the template variable on dashboard load. | [optional]
**name** | **String** | The name of the variable. |
**prefix** | **String** | The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down. | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.openapitools.jackson.nullable.JsonNullable;

/** Template variable. */
@ApiModel(description = "Template variable.")
@JsonPropertyOrder({
DashboardTemplateVariable.JSON_PROPERTY_AVAILABLE_VALUES,
DashboardTemplateVariable.JSON_PROPERTY_DEFAULT,
DashboardTemplateVariable.JSON_PROPERTY_NAME,
DashboardTemplateVariable.JSON_PROPERTY_PREFIX
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class DashboardTemplateVariable {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_AVAILABLE_VALUES = "available_values";
private JsonNullable<List<String>> availableValues = JsonNullable.<List<String>>undefined();

public static final String JSON_PROPERTY_DEFAULT = "default";
private JsonNullable<String> _default = JsonNullable.<String>undefined();

Expand All @@ -47,6 +53,52 @@ public DashboardTemplateVariable(
this.name = name;
}

public DashboardTemplateVariable availableValues(List<String> availableValues) {
this.availableValues = JsonNullable.<List<String>>of(availableValues);
return this;
}

public DashboardTemplateVariable addAvailableValuesItem(String availableValuesItem) {
if (this.availableValues == null || !this.availableValues.isPresent()) {
this.availableValues = JsonNullable.<List<String>>of(new ArrayList<>());
}
try {
this.availableValues.get().add(availableValuesItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}

/**
* The list of values that the template variable drop-down is limited to.
*
* @return availableValues
*/
@javax.annotation.Nullable
@ApiModelProperty(
example = "[\"my-host\",\"host1\",\"host2\"]",
value = "The list of values that the template variable drop-down is limited to.")
@JsonIgnore
public List<String> getAvailableValues() {
return availableValues.orElse(null);
}

@JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable<List<String>> getAvailableValues_JsonNullable() {
return availableValues;
}

@JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES)
public void setAvailableValues_JsonNullable(JsonNullable<List<String>> availableValues) {
this.availableValues = availableValues;
}

public void setAvailableValues(List<String> availableValues) {
this.availableValues = JsonNullable.<List<String>>of(availableValues);
}

public DashboardTemplateVariable _default(String _default) {
this._default = JsonNullable.<String>of(_default);
return this;
Expand Down Expand Up @@ -149,20 +201,22 @@ public boolean equals(Object o) {
return false;
}
DashboardTemplateVariable dashboardTemplateVariable = (DashboardTemplateVariable) o;
return Objects.equals(this._default, dashboardTemplateVariable._default)
return Objects.equals(this.availableValues, dashboardTemplateVariable.availableValues)
&& Objects.equals(this._default, dashboardTemplateVariable._default)
&& Objects.equals(this.name, dashboardTemplateVariable.name)
&& Objects.equals(this.prefix, dashboardTemplateVariable.prefix);
}

@Override
public int hashCode() {
return Objects.hash(_default, name, prefix);
return Objects.hash(availableValues, _default, name, prefix);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DashboardTemplateVariable {\n");
sb.append(" availableValues: ").append(toIndentedString(availableValues)).append("\n");
sb.append(" _default: ").append(toIndentedString(_default)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n");
Expand Down
26 changes: 25 additions & 1 deletion src/main/java/com/datadog/api/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11466,9 +11466,17 @@ components:
- default: my-host
prefix: host
name: host1
available_values:
- my-host
- host1
- host2
- default: my-host
prefix: host
name: host1
available_values:
- my-host
- host1
- host2
url: /dashboard/123-abc-456/example-dashboard-title
is_read_only: false
id: 123-abc-456
Expand Down Expand Up @@ -11836,7 +11844,23 @@ components:
default: my-host
prefix: host
name: host1
properties:
available_values:
- my-host
- host1
- host2
properties:
available_values:
description: The list of values that the template variable drop-down is
limited to.
example:
- my-host
- host1
- host2
items:
description: Template variable value.
type: string
nullable: true
type: array
default:
description: The default value for the template variable on dashboard load.
example: my-host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Feature: Dashboards
@generated @skip
Scenario: Create a new dashboard returns "Bad Request" response
Given new "CreateDashboard" request
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Create a new dashboard returns "OK" response
Given new "CreateDashboard" request
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
When the request is sent
Then the response status is 200 OK

Expand Down Expand Up @@ -138,22 +138,22 @@ Feature: Dashboards
Scenario: Update a dashboard returns "Bad Request" response
Given new "UpdateDashboard" request
And request contains "dashboard_id" parameter from "<PATH>"
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Update a dashboard returns "Item Not Found" response
Given new "UpdateDashboard" request
And request contains "dashboard_id" parameter from "<PATH>"
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
When the request is sent
Then the response status is 404 Item Not Found

@generated @skip
Scenario: Update a dashboard returns "OK" response
Given new "UpdateDashboard" request
And request contains "dashboard_id" parameter from "<PATH>"
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]}
When the request is sent
Then the response status is 200 OK