From e50de4213c1e4258dc530c0569246b97cba663a0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 6 Jul 2026 15:19:32 +0000 Subject: [PATCH] Regenerate client from commit c9aabc1 of spec repo --- .generator/schemas/v1/openapi.yaml | 146 +++++++ .../model/NotebookCreateDataAttributes.java | 57 ++- .../model/NotebookResponseDataAttributes.java | 65 ++- .../v1/model/NotebookTemplateVariable.java | 391 ++++++++++++++++++ ...kTemplateVariableAvailableValuesQuery.java | 338 +++++++++++++++ ...teVariableAvailableValuesQueryGroupBy.java | 93 +++++ ...riableAvailableValuesQueryLogRumSpans.java | 174 ++++++++ ...teVariableAvailableValuesQueryMetrics.java | 124 ++++++ ...ateVariableAvailableValuesQuerySearch.java | 93 +++++ .../model/NotebookUpdateDataAttributes.java | 57 ++- .../NotebooksResponseDataAttributes.java | 65 ++- .../api/client/v1/api/notebooks.feature | 8 +- 12 files changed, 1603 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariable.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQuery.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryGroupBy.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryLogRumSpans.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryMetrics.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQuerySearch.java diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 050e782eb9c..888611645f2 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -11287,6 +11287,12 @@ components: type: string status: $ref: "#/components/schemas/NotebookStatus" + template_variables: + description: List of template variables for this notebook. + items: + $ref: "#/components/schemas/NotebookTemplateVariable" + nullable: true + type: array time: $ref: "#/components/schemas/NotebookGlobalTime" required: @@ -11506,6 +11512,12 @@ components: type: string status: $ref: "#/components/schemas/NotebookStatus" + template_variables: + description: List of template variables for this notebook. + items: + $ref: "#/components/schemas/NotebookTemplateVariable" + nullable: true + type: array time: $ref: "#/components/schemas/NotebookGlobalTime" required: @@ -11548,6 +11560,128 @@ components: type: string x-enum-varnames: - PUBLISHED + NotebookTemplateVariable: + additionalProperties: false + description: Notebook template variable. + 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. + minLength: 1 + type: string + nullable: true + type: array + uniqueItems: true + available_values_query: + $ref: "#/components/schemas/NotebookTemplateVariableAvailableValuesQuery" + data_source_mappings: + additionalProperties: + description: The value for the given data source. + type: string + description: Mapping of data source names to template variable values. + type: object + default: + deprecated: true + description: |- + (deprecated) The default value for the template variable on notebook load. + Cannot be used in conjunction with `defaults`. + example: my-host + nullable: true + type: string + defaults: + description: One or many default values for the template variable. Cannot be used in conjunction with `default`. + example: ["my-host-1", "my-host-2"] + items: + description: A default value for the template variable. + minLength: 1 + type: string + type: array + uniqueItems: true + name: + description: The name of the variable. + example: host1 + type: string + placement: + description: The placement of the template variable in the notebook. + example: global + 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 + type: + description: The type of the template variable. + example: tag + type: string + required: + - name + type: object + NotebookTemplateVariableAvailableValuesQuery: + description: Query used to dynamically populate the list of available values for the template variable. + oneOf: + - $ref: "#/components/schemas/NotebookTemplateVariableAvailableValuesQueryLogRumSpans" + - $ref: "#/components/schemas/NotebookTemplateVariableAvailableValuesQueryMetrics" + NotebookTemplateVariableAvailableValuesQueryGroupBy: + additionalProperties: false + description: A group-by facet for an available values query. + properties: + facet: + description: The facet name to group by. + example: host + type: string + required: + - facet + type: object + NotebookTemplateVariableAvailableValuesQueryLogRumSpans: + additionalProperties: false + description: Available values query for logs, RUM, or spans data sources. + properties: + data_source: + description: The data source for the query. Must be one of `logs`, `rum`, or `spans`. + example: logs + type: string + group_by: + description: Group-by fields for the query. + items: + $ref: "#/components/schemas/NotebookTemplateVariableAvailableValuesQueryGroupBy" + type: array + search: + $ref: "#/components/schemas/NotebookTemplateVariableAvailableValuesQuerySearch" + required: + - data_source + - search + - group_by + type: object + NotebookTemplateVariableAvailableValuesQueryMetrics: + additionalProperties: false + description: Available values query for the metrics data source. + properties: + data_source: + description: The data source for the query. Must be `metrics`. + example: metrics + type: string + query: + description: The metrics query string. + example: "avg:system.cpu.user{*} by {host}" + type: string + required: + - data_source + - query + type: object + NotebookTemplateVariableAvailableValuesQuerySearch: + additionalProperties: false + description: Search parameters for an available values query. + properties: + query: + description: The search query string. + example: "service:web" + type: string + required: + - query + type: object NotebookTimeseriesCellAttributes: description: The attributes of a notebook `timeseries` cell. properties: @@ -11613,6 +11747,12 @@ components: type: string status: $ref: "#/components/schemas/NotebookStatus" + template_variables: + description: List of template variables for this notebook. + items: + $ref: "#/components/schemas/NotebookTemplateVariable" + nullable: true + type: array time: $ref: "#/components/schemas/NotebookGlobalTime" required: @@ -11689,6 +11829,12 @@ components: type: string status: $ref: "#/components/schemas/NotebookStatus" + template_variables: + description: List of template variables for this notebook. + items: + $ref: "#/components/schemas/NotebookTemplateVariable" + nullable: true + type: array time: $ref: "#/components/schemas/NotebookGlobalTime" required: diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookCreateDataAttributes.java b/src/main/java/com/datadog/api/client/v1/model/NotebookCreateDataAttributes.java index bb6142e3295..885dc82b5dd 100644 --- a/src/main/java/com/datadog/api/client/v1/model/NotebookCreateDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookCreateDataAttributes.java @@ -18,6 +18,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** The data attributes of a notebook. */ @JsonPropertyOrder({ @@ -25,6 +26,7 @@ NotebookCreateDataAttributes.JSON_PROPERTY_METADATA, NotebookCreateDataAttributes.JSON_PROPERTY_NAME, NotebookCreateDataAttributes.JSON_PROPERTY_STATUS, + NotebookCreateDataAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, NotebookCreateDataAttributes.JSON_PROPERTY_TIME }) @jakarta.annotation.Generated( @@ -43,6 +45,10 @@ public class NotebookCreateDataAttributes { public static final String JSON_PROPERTY_STATUS = "status"; private NotebookStatus status = NotebookStatus.PUBLISHED; + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private JsonNullable> templateVariables = + JsonNullable.>undefined(); + public static final String JSON_PROPERTY_TIME = "time"; private NotebookGlobalTime time; @@ -156,6 +162,52 @@ public void setStatus(NotebookStatus status) { this.status = status; } + public NotebookCreateDataAttributes templateVariables( + List templateVariables) { + this.templateVariables = JsonNullable.>of(templateVariables); + return this; + } + + public NotebookCreateDataAttributes addTemplateVariablesItem( + NotebookTemplateVariable templateVariablesItem) { + if (this.templateVariables == null || !this.templateVariables.isPresent()) { + this.templateVariables = JsonNullable.>of(new ArrayList<>()); + } + try { + this.templateVariables.get().add(templateVariablesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * List of template variables for this notebook. + * + * @return templateVariables + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTemplateVariables() { + return templateVariables.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTemplateVariables_JsonNullable() { + return templateVariables; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + public void setTemplateVariables_JsonNullable( + JsonNullable> templateVariables) { + this.templateVariables = templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = JsonNullable.>of(templateVariables); + } + public NotebookCreateDataAttributes time(NotebookGlobalTime time) { this.time = time; this.unparsed |= time.unparsed; @@ -237,6 +289,7 @@ public boolean equals(Object o) { && Objects.equals(this.metadata, notebookCreateDataAttributes.metadata) && Objects.equals(this.name, notebookCreateDataAttributes.name) && Objects.equals(this.status, notebookCreateDataAttributes.status) + && Objects.equals(this.templateVariables, notebookCreateDataAttributes.templateVariables) && Objects.equals(this.time, notebookCreateDataAttributes.time) && Objects.equals( this.additionalProperties, notebookCreateDataAttributes.additionalProperties); @@ -244,7 +297,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(cells, metadata, name, status, time, additionalProperties); + return Objects.hash( + cells, metadata, name, status, templateVariables, time, additionalProperties); } @Override @@ -255,6 +309,7 @@ public String toString() { sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v1/model/NotebookResponseDataAttributes.java index ce953911189..4045a343cb4 100644 --- a/src/main/java/com/datadog/api/client/v1/model/NotebookResponseDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookResponseDataAttributes.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** The attributes of a notebook. */ @JsonPropertyOrder({ @@ -29,6 +30,7 @@ NotebookResponseDataAttributes.JSON_PROPERTY_MODIFIED, NotebookResponseDataAttributes.JSON_PROPERTY_NAME, NotebookResponseDataAttributes.JSON_PROPERTY_STATUS, + NotebookResponseDataAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, NotebookResponseDataAttributes.JSON_PROPERTY_TIME }) @jakarta.annotation.Generated( @@ -56,6 +58,10 @@ public class NotebookResponseDataAttributes { public static final String JSON_PROPERTY_STATUS = "status"; private NotebookStatus status = NotebookStatus.PUBLISHED; + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private JsonNullable> templateVariables = + JsonNullable.>undefined(); + public static final String JSON_PROPERTY_TIME = "time"; private NotebookGlobalTime time; @@ -214,6 +220,52 @@ public void setStatus(NotebookStatus status) { this.status = status; } + public NotebookResponseDataAttributes templateVariables( + List templateVariables) { + this.templateVariables = JsonNullable.>of(templateVariables); + return this; + } + + public NotebookResponseDataAttributes addTemplateVariablesItem( + NotebookTemplateVariable templateVariablesItem) { + if (this.templateVariables == null || !this.templateVariables.isPresent()) { + this.templateVariables = JsonNullable.>of(new ArrayList<>()); + } + try { + this.templateVariables.get().add(templateVariablesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * List of template variables for this notebook. + * + * @return templateVariables + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTemplateVariables() { + return templateVariables.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTemplateVariables_JsonNullable() { + return templateVariables; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + public void setTemplateVariables_JsonNullable( + JsonNullable> templateVariables) { + this.templateVariables = templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = JsonNullable.>of(templateVariables); + } + public NotebookResponseDataAttributes time(NotebookGlobalTime time) { this.time = time; this.unparsed |= time.unparsed; @@ -299,6 +351,7 @@ public boolean equals(Object o) { && Objects.equals(this.modified, notebookResponseDataAttributes.modified) && Objects.equals(this.name, notebookResponseDataAttributes.name) && Objects.equals(this.status, notebookResponseDataAttributes.status) + && Objects.equals(this.templateVariables, notebookResponseDataAttributes.templateVariables) && Objects.equals(this.time, notebookResponseDataAttributes.time) && Objects.equals( this.additionalProperties, notebookResponseDataAttributes.additionalProperties); @@ -307,7 +360,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - author, cells, created, metadata, modified, name, status, time, additionalProperties); + author, + cells, + created, + metadata, + modified, + name, + status, + templateVariables, + time, + additionalProperties); } @Override @@ -321,6 +383,7 @@ public String toString() { sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariable.java b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariable.java new file mode 100644 index 00000000000..6c162829bfa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariable.java @@ -0,0 +1,391 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Notebook template variable. */ +@JsonPropertyOrder({ + NotebookTemplateVariable.JSON_PROPERTY_AVAILABLE_VALUES, + NotebookTemplateVariable.JSON_PROPERTY_AVAILABLE_VALUES_QUERY, + NotebookTemplateVariable.JSON_PROPERTY_DATA_SOURCE_MAPPINGS, + NotebookTemplateVariable.JSON_PROPERTY_DEFAULT, + NotebookTemplateVariable.JSON_PROPERTY_DEFAULTS, + NotebookTemplateVariable.JSON_PROPERTY_NAME, + NotebookTemplateVariable.JSON_PROPERTY_PLACEMENT, + NotebookTemplateVariable.JSON_PROPERTY_PREFIX, + NotebookTemplateVariable.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookTemplateVariable { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AVAILABLE_VALUES = "available_values"; + private JsonNullable> availableValues = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_AVAILABLE_VALUES_QUERY = "available_values_query"; + private NotebookTemplateVariableAvailableValuesQuery availableValuesQuery; + + public static final String JSON_PROPERTY_DATA_SOURCE_MAPPINGS = "data_source_mappings"; + private Map dataSourceMappings = null; + + public static final String JSON_PROPERTY_DEFAULT = "default"; + private JsonNullable _default = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DEFAULTS = "defaults"; + private List defaults = null; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PLACEMENT = "placement"; + private String placement; + + public static final String JSON_PROPERTY_PREFIX = "prefix"; + private JsonNullable prefix = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public NotebookTemplateVariable() {} + + @JsonCreator + public NotebookTemplateVariable( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public NotebookTemplateVariable availableValues(List availableValues) { + this.availableValues = JsonNullable.>of(availableValues); + return this; + } + + public NotebookTemplateVariable addAvailableValuesItem(String availableValuesItem) { + if (this.availableValues == null || !this.availableValues.isPresent()) { + this.availableValues = JsonNullable.>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 getAvailableValues() { + return availableValues.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getAvailableValues_JsonNullable() { + return availableValues; + } + + @JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES) + public void setAvailableValues_JsonNullable(JsonNullable> availableValues) { + this.availableValues = availableValues; + } + + public void setAvailableValues(List availableValues) { + this.availableValues = JsonNullable.>of(availableValues); + } + + public NotebookTemplateVariable availableValuesQuery( + NotebookTemplateVariableAvailableValuesQuery availableValuesQuery) { + this.availableValuesQuery = availableValuesQuery; + this.unparsed |= availableValuesQuery.unparsed; + return this; + } + + /** + * Query used to dynamically populate the list of available values for the template variable. + * + * @return availableValuesQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AVAILABLE_VALUES_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NotebookTemplateVariableAvailableValuesQuery getAvailableValuesQuery() { + return availableValuesQuery; + } + + public void setAvailableValuesQuery( + NotebookTemplateVariableAvailableValuesQuery availableValuesQuery) { + this.availableValuesQuery = availableValuesQuery; + } + + public NotebookTemplateVariable dataSourceMappings(Map dataSourceMappings) { + this.dataSourceMappings = dataSourceMappings; + return this; + } + + public NotebookTemplateVariable putDataSourceMappingsItem( + String key, String dataSourceMappingsItem) { + if (this.dataSourceMappings == null) { + this.dataSourceMappings = new HashMap<>(); + } + this.dataSourceMappings.put(key, dataSourceMappingsItem); + return this; + } + + /** + * Mapping of data source names to template variable values. + * + * @return dataSourceMappings + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA_SOURCE_MAPPINGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDataSourceMappings() { + return dataSourceMappings; + } + + public void setDataSourceMappings(Map dataSourceMappings) { + this.dataSourceMappings = dataSourceMappings; + } + + public NotebookTemplateVariable _default(String _default) { + this._default = JsonNullable.of(_default); + return this; + } + + /** + * (deprecated) The default value for the template variable on notebook load. Cannot be used in + * conjunction with defaults. + * + * @return _default + * @deprecated + */ + @Deprecated + @jakarta.annotation.Nullable + @JsonIgnore + public String getDefault() { + return _default.orElse(null); + } + + @Deprecated + @JsonProperty(JSON_PROPERTY_DEFAULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDefault_JsonNullable() { + return _default; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT) + public void setDefault_JsonNullable(JsonNullable _default) { + this._default = _default; + } + + public void setDefault(String _default) { + this._default = JsonNullable.of(_default); + } + + public NotebookTemplateVariable defaults(List defaults) { + this.defaults = defaults; + return this; + } + + public NotebookTemplateVariable addDefaultsItem(String defaultsItem) { + if (this.defaults == null) { + this.defaults = new ArrayList<>(); + } + this.defaults.add(defaultsItem); + return this; + } + + /** + * One or many default values for the template variable. Cannot be used in conjunction with + * default. + * + * @return defaults + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDefaults() { + return defaults; + } + + public void setDefaults(List defaults) { + this.defaults = defaults; + } + + public NotebookTemplateVariable name(String name) { + this.name = name; + return this; + } + + /** + * The name of the variable. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public NotebookTemplateVariable placement(String placement) { + this.placement = placement; + return this; + } + + /** + * The placement of the template variable in the notebook. + * + * @return placement + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PLACEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPlacement() { + return placement; + } + + public void setPlacement(String placement) { + this.placement = placement; + } + + public NotebookTemplateVariable prefix(String prefix) { + this.prefix = JsonNullable.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 getPrefix_JsonNullable() { + return prefix; + } + + @JsonProperty(JSON_PROPERTY_PREFIX) + public void setPrefix_JsonNullable(JsonNullable prefix) { + this.prefix = prefix; + } + + public void setPrefix(String prefix) { + this.prefix = JsonNullable.of(prefix); + } + + public NotebookTemplateVariable type(String type) { + this.type = type; + return this; + } + + /** + * The type of the template variable. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** Return true if this NotebookTemplateVariable object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookTemplateVariable notebookTemplateVariable = (NotebookTemplateVariable) o; + return Objects.equals(this.availableValues, notebookTemplateVariable.availableValues) + && Objects.equals(this.availableValuesQuery, notebookTemplateVariable.availableValuesQuery) + && Objects.equals(this.dataSourceMappings, notebookTemplateVariable.dataSourceMappings) + && Objects.equals(this._default, notebookTemplateVariable._default) + && Objects.equals(this.defaults, notebookTemplateVariable.defaults) + && Objects.equals(this.name, notebookTemplateVariable.name) + && Objects.equals(this.placement, notebookTemplateVariable.placement) + && Objects.equals(this.prefix, notebookTemplateVariable.prefix) + && Objects.equals(this.type, notebookTemplateVariable.type); + } + + @Override + public int hashCode() { + return Objects.hash( + availableValues, + availableValuesQuery, + dataSourceMappings, + _default, + defaults, + name, + placement, + prefix, + type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookTemplateVariable {\n"); + sb.append(" availableValues: ").append(toIndentedString(availableValues)).append("\n"); + sb.append(" availableValuesQuery: ") + .append(toIndentedString(availableValuesQuery)) + .append("\n"); + sb.append(" dataSourceMappings: ").append(toIndentedString(dataSourceMappings)).append("\n"); + sb.append(" _default: ").append(toIndentedString(_default)).append("\n"); + sb.append(" defaults: ").append(toIndentedString(defaults)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" placement: ").append(toIndentedString(placement)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQuery.java b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQuery.java new file mode 100644 index 00000000000..4641d9960cb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQuery.java @@ -0,0 +1,338 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = + NotebookTemplateVariableAvailableValuesQuery + .NotebookTemplateVariableAvailableValuesQueryDeserializer.class) +@JsonSerialize( + using = + NotebookTemplateVariableAvailableValuesQuery + .NotebookTemplateVariableAvailableValuesQuerySerializer.class) +public class NotebookTemplateVariableAvailableValuesQuery extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(NotebookTemplateVariableAvailableValuesQuery.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class NotebookTemplateVariableAvailableValuesQuerySerializer + extends StdSerializer { + public NotebookTemplateVariableAvailableValuesQuerySerializer( + Class t) { + super(t); + } + + public NotebookTemplateVariableAvailableValuesQuerySerializer() { + this(null); + } + + @Override + public void serialize( + NotebookTemplateVariableAvailableValuesQuery value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class NotebookTemplateVariableAvailableValuesQueryDeserializer + extends StdDeserializer { + public NotebookTemplateVariableAvailableValuesQueryDeserializer() { + this(NotebookTemplateVariableAvailableValuesQuery.class); + } + + public NotebookTemplateVariableAvailableValuesQueryDeserializer(Class vc) { + super(vc); + } + + @Override + public NotebookTemplateVariableAvailableValuesQuery deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize NotebookTemplateVariableAvailableValuesQueryLogRumSpans + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(Integer.class) + || NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(Long.class) + || NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(Float.class) + || NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(Double.class) + || NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(Boolean.class) + || NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals( + Integer.class) + || NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(Float.class) + || NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((NotebookTemplateVariableAvailableValuesQueryLogRumSpans) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema" + + " 'NotebookTemplateVariableAvailableValuesQueryLogRumSpans'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'NotebookTemplateVariableAvailableValuesQueryLogRumSpans'", + e); + } + + // deserialize NotebookTemplateVariableAvailableValuesQueryMetrics + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(Integer.class) + || NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(Long.class) + || NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(Float.class) + || NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(Double.class) + || NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(Boolean.class) + || NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(Integer.class) + || NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(Float.class) + || NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (NotebookTemplateVariableAvailableValuesQueryMetrics.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(NotebookTemplateVariableAvailableValuesQueryMetrics.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((NotebookTemplateVariableAvailableValuesQueryMetrics) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'NotebookTemplateVariableAvailableValuesQueryMetrics'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'NotebookTemplateVariableAvailableValuesQueryMetrics'", + e); + } + + NotebookTemplateVariableAvailableValuesQuery ret = + new NotebookTemplateVariableAvailableValuesQuery(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public NotebookTemplateVariableAvailableValuesQuery getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "NotebookTemplateVariableAvailableValuesQuery cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public NotebookTemplateVariableAvailableValuesQuery() { + super("oneOf", Boolean.FALSE); + } + + public NotebookTemplateVariableAvailableValuesQuery( + NotebookTemplateVariableAvailableValuesQueryLogRumSpans o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public NotebookTemplateVariableAvailableValuesQuery( + NotebookTemplateVariableAvailableValuesQueryMetrics o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "NotebookTemplateVariableAvailableValuesQueryLogRumSpans", + new GenericType() {}); + schemas.put( + "NotebookTemplateVariableAvailableValuesQueryMetrics", + new GenericType() {}); + JSON.registerDescendants( + NotebookTemplateVariableAvailableValuesQuery.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return NotebookTemplateVariableAvailableValuesQuery.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: NotebookTemplateVariableAvailableValuesQueryLogRumSpans, + * NotebookTemplateVariableAvailableValuesQueryMetrics + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + NotebookTemplateVariableAvailableValuesQueryLogRumSpans.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + NotebookTemplateVariableAvailableValuesQueryMetrics.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be NotebookTemplateVariableAvailableValuesQueryLogRumSpans," + + " NotebookTemplateVariableAvailableValuesQueryMetrics"); + } + + /** + * Get the actual instance, which can be the following: + * NotebookTemplateVariableAvailableValuesQueryLogRumSpans, + * NotebookTemplateVariableAvailableValuesQueryMetrics + * + * @return The actual instance (NotebookTemplateVariableAvailableValuesQueryLogRumSpans, + * NotebookTemplateVariableAvailableValuesQueryMetrics) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `NotebookTemplateVariableAvailableValuesQueryLogRumSpans`. If the + * actual instance is not `NotebookTemplateVariableAvailableValuesQueryLogRumSpans`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `NotebookTemplateVariableAvailableValuesQueryLogRumSpans` + * @throws ClassCastException if the instance is not + * `NotebookTemplateVariableAvailableValuesQueryLogRumSpans` + */ + public NotebookTemplateVariableAvailableValuesQueryLogRumSpans + getNotebookTemplateVariableAvailableValuesQueryLogRumSpans() throws ClassCastException { + return (NotebookTemplateVariableAvailableValuesQueryLogRumSpans) super.getActualInstance(); + } + + /** + * Get the actual instance of `NotebookTemplateVariableAvailableValuesQueryMetrics`. If the actual + * instance is not `NotebookTemplateVariableAvailableValuesQueryMetrics`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `NotebookTemplateVariableAvailableValuesQueryMetrics` + * @throws ClassCastException if the instance is not + * `NotebookTemplateVariableAvailableValuesQueryMetrics` + */ + public NotebookTemplateVariableAvailableValuesQueryMetrics + getNotebookTemplateVariableAvailableValuesQueryMetrics() throws ClassCastException { + return (NotebookTemplateVariableAvailableValuesQueryMetrics) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryGroupBy.java b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryGroupBy.java new file mode 100644 index 00000000000..3848cebf4fa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryGroupBy.java @@ -0,0 +1,93 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** A group-by facet for an available values query. */ +@JsonPropertyOrder({NotebookTemplateVariableAvailableValuesQueryGroupBy.JSON_PROPERTY_FACET}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookTemplateVariableAvailableValuesQueryGroupBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FACET = "facet"; + private String facet; + + public NotebookTemplateVariableAvailableValuesQueryGroupBy() {} + + @JsonCreator + public NotebookTemplateVariableAvailableValuesQueryGroupBy( + @JsonProperty(required = true, value = JSON_PROPERTY_FACET) String facet) { + this.facet = facet; + } + + public NotebookTemplateVariableAvailableValuesQueryGroupBy facet(String facet) { + this.facet = facet; + return this; + } + + /** + * The facet name to group by. + * + * @return facet + */ + @JsonProperty(JSON_PROPERTY_FACET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFacet() { + return facet; + } + + public void setFacet(String facet) { + this.facet = facet; + } + + /** + * Return true if this NotebookTemplateVariableAvailableValuesQueryGroupBy object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookTemplateVariableAvailableValuesQueryGroupBy + notebookTemplateVariableAvailableValuesQueryGroupBy = + (NotebookTemplateVariableAvailableValuesQueryGroupBy) o; + return Objects.equals(this.facet, notebookTemplateVariableAvailableValuesQueryGroupBy.facet); + } + + @Override + public int hashCode() { + return Objects.hash(facet); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookTemplateVariableAvailableValuesQueryGroupBy {\n"); + sb.append(" facet: ").append(toIndentedString(facet)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryLogRumSpans.java b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryLogRumSpans.java new file mode 100644 index 00000000000..7086956c324 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryLogRumSpans.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Available values query for logs, RUM, or spans data sources. */ +@JsonPropertyOrder({ + NotebookTemplateVariableAvailableValuesQueryLogRumSpans.JSON_PROPERTY_DATA_SOURCE, + NotebookTemplateVariableAvailableValuesQueryLogRumSpans.JSON_PROPERTY_GROUP_BY, + NotebookTemplateVariableAvailableValuesQueryLogRumSpans.JSON_PROPERTY_SEARCH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookTemplateVariableAvailableValuesQueryLogRumSpans { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA_SOURCE = "data_source"; + private String dataSource; + + public static final String JSON_PROPERTY_GROUP_BY = "group_by"; + private List groupBy = new ArrayList<>(); + + public static final String JSON_PROPERTY_SEARCH = "search"; + private NotebookTemplateVariableAvailableValuesQuerySearch search; + + public NotebookTemplateVariableAvailableValuesQueryLogRumSpans() {} + + @JsonCreator + public NotebookTemplateVariableAvailableValuesQueryLogRumSpans( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE) String dataSource, + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP_BY) + List groupBy, + @JsonProperty(required = true, value = JSON_PROPERTY_SEARCH) + NotebookTemplateVariableAvailableValuesQuerySearch search) { + this.dataSource = dataSource; + this.groupBy = groupBy; + this.search = search; + this.unparsed |= search.unparsed; + } + + public NotebookTemplateVariableAvailableValuesQueryLogRumSpans dataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * The data source for the query. Must be one of logs, rum, or + * spans. + * + * @return dataSource + */ + @JsonProperty(JSON_PROPERTY_DATA_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDataSource() { + return dataSource; + } + + public void setDataSource(String dataSource) { + this.dataSource = dataSource; + } + + public NotebookTemplateVariableAvailableValuesQueryLogRumSpans groupBy( + List groupBy) { + this.groupBy = groupBy; + for (NotebookTemplateVariableAvailableValuesQueryGroupBy item : groupBy) { + this.unparsed |= item.unparsed; + } + return this; + } + + public NotebookTemplateVariableAvailableValuesQueryLogRumSpans addGroupByItem( + NotebookTemplateVariableAvailableValuesQueryGroupBy groupByItem) { + this.groupBy.add(groupByItem); + this.unparsed |= groupByItem.unparsed; + return this; + } + + /** + * Group-by fields for the query. + * + * @return groupBy + */ + @JsonProperty(JSON_PROPERTY_GROUP_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroupBy() { + return groupBy; + } + + public void setGroupBy(List groupBy) { + this.groupBy = groupBy; + } + + public NotebookTemplateVariableAvailableValuesQueryLogRumSpans search( + NotebookTemplateVariableAvailableValuesQuerySearch search) { + this.search = search; + this.unparsed |= search.unparsed; + return this; + } + + /** + * Search parameters for an available values query. + * + * @return search + */ + @JsonProperty(JSON_PROPERTY_SEARCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public NotebookTemplateVariableAvailableValuesQuerySearch getSearch() { + return search; + } + + public void setSearch(NotebookTemplateVariableAvailableValuesQuerySearch search) { + this.search = search; + } + + /** + * Return true if this NotebookTemplateVariableAvailableValuesQueryLogRumSpans object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookTemplateVariableAvailableValuesQueryLogRumSpans + notebookTemplateVariableAvailableValuesQueryLogRumSpans = + (NotebookTemplateVariableAvailableValuesQueryLogRumSpans) o; + return Objects.equals( + this.dataSource, notebookTemplateVariableAvailableValuesQueryLogRumSpans.dataSource) + && Objects.equals( + this.groupBy, notebookTemplateVariableAvailableValuesQueryLogRumSpans.groupBy) + && Objects.equals( + this.search, notebookTemplateVariableAvailableValuesQueryLogRumSpans.search); + } + + @Override + public int hashCode() { + return Objects.hash(dataSource, groupBy, search); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookTemplateVariableAvailableValuesQueryLogRumSpans {\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" search: ").append(toIndentedString(search)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryMetrics.java b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryMetrics.java new file mode 100644 index 00000000000..e40ca93c2ce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQueryMetrics.java @@ -0,0 +1,124 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Available values query for the metrics data source. */ +@JsonPropertyOrder({ + NotebookTemplateVariableAvailableValuesQueryMetrics.JSON_PROPERTY_DATA_SOURCE, + NotebookTemplateVariableAvailableValuesQueryMetrics.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookTemplateVariableAvailableValuesQueryMetrics { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA_SOURCE = "data_source"; + private String dataSource; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public NotebookTemplateVariableAvailableValuesQueryMetrics() {} + + @JsonCreator + public NotebookTemplateVariableAvailableValuesQueryMetrics( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE) String dataSource, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.dataSource = dataSource; + this.query = query; + } + + public NotebookTemplateVariableAvailableValuesQueryMetrics dataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * The data source for the query. Must be metrics. + * + * @return dataSource + */ + @JsonProperty(JSON_PROPERTY_DATA_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDataSource() { + return dataSource; + } + + public void setDataSource(String dataSource) { + this.dataSource = dataSource; + } + + public NotebookTemplateVariableAvailableValuesQueryMetrics query(String query) { + this.query = query; + return this; + } + + /** + * The metrics query string. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * Return true if this NotebookTemplateVariableAvailableValuesQueryMetrics object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookTemplateVariableAvailableValuesQueryMetrics + notebookTemplateVariableAvailableValuesQueryMetrics = + (NotebookTemplateVariableAvailableValuesQueryMetrics) o; + return Objects.equals( + this.dataSource, notebookTemplateVariableAvailableValuesQueryMetrics.dataSource) + && Objects.equals(this.query, notebookTemplateVariableAvailableValuesQueryMetrics.query); + } + + @Override + public int hashCode() { + return Objects.hash(dataSource, query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookTemplateVariableAvailableValuesQueryMetrics {\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQuerySearch.java b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQuerySearch.java new file mode 100644 index 00000000000..2533072fea2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookTemplateVariableAvailableValuesQuerySearch.java @@ -0,0 +1,93 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** Search parameters for an available values query. */ +@JsonPropertyOrder({NotebookTemplateVariableAvailableValuesQuerySearch.JSON_PROPERTY_QUERY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class NotebookTemplateVariableAvailableValuesQuerySearch { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public NotebookTemplateVariableAvailableValuesQuerySearch() {} + + @JsonCreator + public NotebookTemplateVariableAvailableValuesQuerySearch( + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.query = query; + } + + public NotebookTemplateVariableAvailableValuesQuerySearch query(String query) { + this.query = query; + return this; + } + + /** + * The search query string. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * Return true if this NotebookTemplateVariableAvailableValuesQuerySearch object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotebookTemplateVariableAvailableValuesQuerySearch + notebookTemplateVariableAvailableValuesQuerySearch = + (NotebookTemplateVariableAvailableValuesQuerySearch) o; + return Objects.equals(this.query, notebookTemplateVariableAvailableValuesQuerySearch.query); + } + + @Override + public int hashCode() { + return Objects.hash(query); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotebookTemplateVariableAvailableValuesQuerySearch {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebookUpdateDataAttributes.java b/src/main/java/com/datadog/api/client/v1/model/NotebookUpdateDataAttributes.java index ccb327a5700..20d73d686cf 100644 --- a/src/main/java/com/datadog/api/client/v1/model/NotebookUpdateDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v1/model/NotebookUpdateDataAttributes.java @@ -18,6 +18,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** The data attributes of a notebook. */ @JsonPropertyOrder({ @@ -25,6 +26,7 @@ NotebookUpdateDataAttributes.JSON_PROPERTY_METADATA, NotebookUpdateDataAttributes.JSON_PROPERTY_NAME, NotebookUpdateDataAttributes.JSON_PROPERTY_STATUS, + NotebookUpdateDataAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, NotebookUpdateDataAttributes.JSON_PROPERTY_TIME }) @jakarta.annotation.Generated( @@ -43,6 +45,10 @@ public class NotebookUpdateDataAttributes { public static final String JSON_PROPERTY_STATUS = "status"; private NotebookStatus status = NotebookStatus.PUBLISHED; + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private JsonNullable> templateVariables = + JsonNullable.>undefined(); + public static final String JSON_PROPERTY_TIME = "time"; private NotebookGlobalTime time; @@ -155,6 +161,52 @@ public void setStatus(NotebookStatus status) { this.status = status; } + public NotebookUpdateDataAttributes templateVariables( + List templateVariables) { + this.templateVariables = JsonNullable.>of(templateVariables); + return this; + } + + public NotebookUpdateDataAttributes addTemplateVariablesItem( + NotebookTemplateVariable templateVariablesItem) { + if (this.templateVariables == null || !this.templateVariables.isPresent()) { + this.templateVariables = JsonNullable.>of(new ArrayList<>()); + } + try { + this.templateVariables.get().add(templateVariablesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * List of template variables for this notebook. + * + * @return templateVariables + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTemplateVariables() { + return templateVariables.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTemplateVariables_JsonNullable() { + return templateVariables; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + public void setTemplateVariables_JsonNullable( + JsonNullable> templateVariables) { + this.templateVariables = templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = JsonNullable.>of(templateVariables); + } + public NotebookUpdateDataAttributes time(NotebookGlobalTime time) { this.time = time; this.unparsed |= time.unparsed; @@ -236,6 +288,7 @@ public boolean equals(Object o) { && Objects.equals(this.metadata, notebookUpdateDataAttributes.metadata) && Objects.equals(this.name, notebookUpdateDataAttributes.name) && Objects.equals(this.status, notebookUpdateDataAttributes.status) + && Objects.equals(this.templateVariables, notebookUpdateDataAttributes.templateVariables) && Objects.equals(this.time, notebookUpdateDataAttributes.time) && Objects.equals( this.additionalProperties, notebookUpdateDataAttributes.additionalProperties); @@ -243,7 +296,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(cells, metadata, name, status, time, additionalProperties); + return Objects.hash( + cells, metadata, name, status, templateVariables, time, additionalProperties); } @Override @@ -254,6 +308,7 @@ public String toString() { sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v1/model/NotebooksResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v1/model/NotebooksResponseDataAttributes.java index 0a1dfc622ff..53d2c201f5a 100644 --- a/src/main/java/com/datadog/api/client/v1/model/NotebooksResponseDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v1/model/NotebooksResponseDataAttributes.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** The attributes of a notebook in get all response. */ @JsonPropertyOrder({ @@ -29,6 +30,7 @@ NotebooksResponseDataAttributes.JSON_PROPERTY_MODIFIED, NotebooksResponseDataAttributes.JSON_PROPERTY_NAME, NotebooksResponseDataAttributes.JSON_PROPERTY_STATUS, + NotebooksResponseDataAttributes.JSON_PROPERTY_TEMPLATE_VARIABLES, NotebooksResponseDataAttributes.JSON_PROPERTY_TIME }) @jakarta.annotation.Generated( @@ -56,6 +58,10 @@ public class NotebooksResponseDataAttributes { public static final String JSON_PROPERTY_STATUS = "status"; private NotebookStatus status = NotebookStatus.PUBLISHED; + public static final String JSON_PROPERTY_TEMPLATE_VARIABLES = "template_variables"; + private JsonNullable> templateVariables = + JsonNullable.>undefined(); + public static final String JSON_PROPERTY_TIME = "time"; private NotebookGlobalTime time; @@ -213,6 +219,52 @@ public void setStatus(NotebookStatus status) { this.status = status; } + public NotebooksResponseDataAttributes templateVariables( + List templateVariables) { + this.templateVariables = JsonNullable.>of(templateVariables); + return this; + } + + public NotebooksResponseDataAttributes addTemplateVariablesItem( + NotebookTemplateVariable templateVariablesItem) { + if (this.templateVariables == null || !this.templateVariables.isPresent()) { + this.templateVariables = JsonNullable.>of(new ArrayList<>()); + } + try { + this.templateVariables.get().add(templateVariablesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * List of template variables for this notebook. + * + * @return templateVariables + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTemplateVariables() { + return templateVariables.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTemplateVariables_JsonNullable() { + return templateVariables; + } + + @JsonProperty(JSON_PROPERTY_TEMPLATE_VARIABLES) + public void setTemplateVariables_JsonNullable( + JsonNullable> templateVariables) { + this.templateVariables = templateVariables; + } + + public void setTemplateVariables(List templateVariables) { + this.templateVariables = JsonNullable.>of(templateVariables); + } + public NotebooksResponseDataAttributes time(NotebookGlobalTime time) { this.time = time; this.unparsed |= time.unparsed; @@ -299,6 +351,7 @@ public boolean equals(Object o) { && Objects.equals(this.modified, notebooksResponseDataAttributes.modified) && Objects.equals(this.name, notebooksResponseDataAttributes.name) && Objects.equals(this.status, notebooksResponseDataAttributes.status) + && Objects.equals(this.templateVariables, notebooksResponseDataAttributes.templateVariables) && Objects.equals(this.time, notebooksResponseDataAttributes.time) && Objects.equals( this.additionalProperties, notebooksResponseDataAttributes.additionalProperties); @@ -307,7 +360,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - author, cells, created, metadata, modified, name, status, time, additionalProperties); + author, + cells, + created, + metadata, + modified, + name, + status, + templateVariables, + time, + additionalProperties); } @Override @@ -321,6 +383,7 @@ public String toString() { sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" templateVariables: ").append(toIndentedString(templateVariables)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/test/resources/com/datadog/api/client/v1/api/notebooks.feature b/src/test/resources/com/datadog/api/client/v1/api/notebooks.feature index 3ff8343c9b1..1a7dcacb6b8 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/notebooks.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/notebooks.feature @@ -13,7 +13,7 @@ Feature: Notebooks @generated @skip @team:DataDog/notebooks Scenario: Create a notebook returns "Bad Request" response Given new "CreateNotebook" request - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": ["my-host", "host1", "host2"], "available_values_query": {"data_source": "logs", "group_by": [{"facet": "host"}], "search": {"query": "service:web"}}, "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "placement": "global", "prefix": "host", "type": "tag"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 400 Bad Request @@ -98,7 +98,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Bad Request" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": ["my-host", "host1", "host2"], "available_values_query": {"data_source": "logs", "group_by": [{"facet": "host"}], "search": {"query": "service:web"}}, "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "placement": "global", "prefix": "host", "type": "tag"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 400 Bad Request @@ -106,7 +106,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Conflict" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": ["my-host", "host1", "host2"], "available_values_query": {"data_source": "logs", "group_by": [{"facet": "host"}], "search": {"query": "service:web"}}, "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "placement": "global", "prefix": "host", "type": "tag"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 409 Conflict @@ -114,7 +114,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Not Found" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": ["my-host", "host1", "host2"], "available_values_query": {"data_source": "logs", "group_by": [{"facet": "host"}], "search": {"query": "service:web"}}, "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "placement": "global", "prefix": "host", "type": "tag"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 404 Not Found