Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powerpack add support for prefix and available values #2481

Merged
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.6",
"regenerated": "2024-09-16 14:03:00.908234",
"spec_repo_commit": "966987f5"
"regenerated": "2024-09-18 14:45:19.429970",
"spec_repo_commit": "bae57ce1"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-16 14:03:00.926584",
"spec_repo_commit": "966987f5"
"regenerated": "2024-09-18 14:45:19.444161",
"spec_repo_commit": "bae57ce1"
}
}
}
18 changes: 18 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16297,6 +16297,18 @@ components:
PowerpackTemplateVariable:
description: Powerpack template variables.
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
defaults:
description: One or many template variable default values within the saved
view, which are unioned together using `OR` if more than one is specified.
Expand All @@ -16309,6 +16321,12 @@ components:
description: The name of the variable.
example: datacenter
type: string
prefix:
description: The tag prefix associated with the variable. Only tags with
this prefix appear in the variable drop-down.
example: host
nullable: true
type: string
required:
- name
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,31 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.openapitools.jackson.nullable.JsonNullable;

/** Powerpack template variables. */
@JsonPropertyOrder({
PowerpackTemplateVariable.JSON_PROPERTY_AVAILABLE_VALUES,
PowerpackTemplateVariable.JSON_PROPERTY_DEFAULTS,
PowerpackTemplateVariable.JSON_PROPERTY_NAME
PowerpackTemplateVariable.JSON_PROPERTY_NAME,
PowerpackTemplateVariable.JSON_PROPERTY_PREFIX
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class PowerpackTemplateVariable {
@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_DEFAULTS = "defaults";
private List<String> defaults = null;

public static final String JSON_PROPERTY_NAME = "name";
private String name;

public static final String JSON_PROPERTY_PREFIX = "prefix";
private JsonNullable<String> prefix = JsonNullable.<String>undefined();

public PowerpackTemplateVariable() {}

@JsonCreator
Expand All @@ -42,6 +51,49 @@ public PowerpackTemplateVariable(
this.name = name;
}

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

public PowerpackTemplateVariable 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
*/
@jakarta.annotation.Nullable
@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 PowerpackTemplateVariable defaults(List<String> defaults) {
this.defaults = defaults;
return this;
Expand Down Expand Up @@ -92,6 +144,38 @@ public void setName(String name) {
this.name = name;
}

public PowerpackTemplateVariable prefix(String prefix) {
this.prefix = JsonNullable.<String>of(prefix);
return this;
}

/**
* The tag prefix associated with the variable. Only tags with this prefix appear in the variable
* drop-down.
*
* @return prefix
*/
@jakarta.annotation.Nullable
@JsonIgnore
public String getPrefix() {
return prefix.orElse(null);
}

@JsonProperty(JSON_PROPERTY_PREFIX)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable<String> getPrefix_JsonNullable() {
return prefix;
}

@JsonProperty(JSON_PROPERTY_PREFIX)
public void setPrefix_JsonNullable(JsonNullable<String> prefix) {
this.prefix = prefix;
}

public void setPrefix(String prefix) {
this.prefix = JsonNullable.<String>of(prefix);
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -148,23 +232,27 @@ public boolean equals(Object o) {
return false;
}
PowerpackTemplateVariable powerpackTemplateVariable = (PowerpackTemplateVariable) o;
return Objects.equals(this.defaults, powerpackTemplateVariable.defaults)
return Objects.equals(this.availableValues, powerpackTemplateVariable.availableValues)
&& Objects.equals(this.defaults, powerpackTemplateVariable.defaults)
&& Objects.equals(this.name, powerpackTemplateVariable.name)
&& Objects.equals(this.prefix, powerpackTemplateVariable.prefix)
&& Objects.equals(
this.additionalProperties, powerpackTemplateVariable.additionalProperties);
}

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

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PowerpackTemplateVariable {\n");
sb.append(" availableValues: ").append(toIndentedString(availableValues)).append("\n");
sb.append(" defaults: ").append(toIndentedString(defaults)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
"timeToLive": {
"unlimited": true
},
"id": "af617072-2860-ba27-e045-b00c8baf0188"
"id": "af617072-2860-ba27-e045-b00c8baf0187"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
"timeToLive": {
"unlimited": true
},
"id": "af617072-2860-ba27-e045-b00c8baf0187"
"id": "af617072-2860-ba27-e045-b00c8baf0188"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
"timeToLive": {
"unlimited": true
},
"id": "92cc025e-6a5d-ac9c-a6af-65450cdedad4"
"id": "92cc025e-6a5d-ac9c-a6af-65450cdedad1"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"timeToLive": {
"unlimited": true
},
"id": "a4786fba-223e-c55e-474f-89e7ba3e291f"
"id": "a4786fba-223e-c55e-474f-89e7ba3e2920"
},
{
"httpRequest": {
Expand Down Expand Up @@ -57,7 +57,7 @@
"timeToLive": {
"unlimited": true
},
"id": "92cc025e-6a5d-ac9c-a6af-65450cdedad1"
"id": "92cc025e-6a5d-ac9c-a6af-65450cdedad3"
},
{
"httpRequest": {
Expand Down Expand Up @@ -87,6 +87,6 @@
"timeToLive": {
"unlimited": true
},
"id": "92cc025e-6a5d-ac9c-a6af-65450cdedad2"
"id": "92cc025e-6a5d-ac9c-a6af-65450cdedad4"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"timeToLive": {
"unlimited": true
},
"id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d"
"id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"timeToLive": {
"unlimited": true
},
"id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e"
"id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"timeToLive": {
"unlimited": true
},
"id": "a4786fba-223e-c55e-474f-89e7ba3e2920"
"id": "a4786fba-223e-c55e-474f-89e7ba3e291f"
},
{
"httpRequest": {
Expand Down Expand Up @@ -87,6 +87,6 @@
"timeToLive": {
"unlimited": true
},
"id": "92cc025e-6a5d-ac9c-a6af-65450cdedad3"
"id": "92cc025e-6a5d-ac9c-a6af-65450cdedad2"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"timeToLive": {
"unlimited": true
},
"id": "0a6534d0-42f2-5075-64f8-7ab28f449a8f"
"id": "0a6534d0-42f2-5075-64f8-7ab28f449a98"
},
{
"httpRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"timeToLive": {
"unlimited": true
},
"id": "0a6534d0-42f2-5075-64f8-7ab28f449a95"
"id": "0a6534d0-42f2-5075-64f8-7ab28f449a91"
},
{
"httpRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"timeToLive": {
"unlimited": true
},
"id": "0a6534d0-42f2-5075-64f8-7ab28f449a93"
"id": "0a6534d0-42f2-5075-64f8-7ab28f449a8e"
},
{
"httpRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"timeToLive": {
"unlimited": true
},
"id": "0a6534d0-42f2-5075-64f8-7ab28f449a98"
"id": "0a6534d0-42f2-5075-64f8-7ab28f449a92"
},
{
"httpRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"timeToLive": {
"unlimited": true
},
"id": "01611a93-5e74-0630-3c51-f707c3b51e7b"
"id": "01611a93-5e74-0630-3c51-f707c3b51e7a"
},
{
"httpRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"timeToLive": {
"unlimited": true
},
"id": "01611a93-5e74-0630-3c51-f707c3b51e7d"
"id": "01611a93-5e74-0630-3c51-f707c3b51e7f"
},
{
"httpRequest": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"timeToLive": {
"unlimited": true
},
"id": "33fa4a39-57ef-afdd-007a-0db82f7ed15c"
"id": "33fa4a39-57ef-afdd-007a-0db82f7ed15d"
},
{
"httpRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"timeToLive": {
"unlimited": true
},
"id": "ab2c08c1-60c7-9278-3246-d650bb892174"
"id": "ab2c08c1-60c7-9278-3246-d650bb892175"
},
{
"httpRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"timeToLive": {
"unlimited": true
},
"id": "01611a93-5e74-0630-3c51-f707c3b51e7a"
"id": "01611a93-5e74-0630-3c51-f707c3b51e79"
},
{
"httpRequest": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"timeToLive": {
"unlimited": true
},
"id": "33fa4a39-57ef-afdd-007a-0db82f7ed15a"
"id": "33fa4a39-57ef-afdd-007a-0db82f7ed159"
},
{
"httpRequest": {
Expand Down
Loading
Loading