diff --git a/.apigentools-info b/.apigentools-info index 5468599b406..834e9a3f8f8 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.5", - "regenerated": "2023-07-14 13:31:57.344296", - "spec_repo_commit": "2bd58701" + "regenerated": "2023-07-14 14:04:16.234493", + "spec_repo_commit": "3868f953" }, "v2": { "apigentools_version": "1.6.5", - "regenerated": "2023-07-14 13:31:57.357559", - "spec_repo_commit": "2bd58701" + "regenerated": "2023-07-14 14:04:16.248147", + "spec_repo_commit": "3868f953" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ce4a0c7bd61..9163a3be172 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15010,6 +15010,17 @@ components: $ref: '#/components/schemas/SpansType' type: object SpansAggregateBucket: + description: Spans aggregate. + properties: + attributes: + $ref: '#/components/schemas/SpansAggregateBucketAttributes' + id: + description: ID of the spans aggregate. + type: string + type: + $ref: '#/components/schemas/SpansAggregateBucketType' + type: object + SpansAggregateBucketAttributes: description: A bucket values. properties: by: @@ -15020,6 +15031,9 @@ components: '@state': success '@version': abc type: object + compute: + description: The compute data. + type: object computes: additionalProperties: $ref: '#/components/schemas/SpansAggregateBucketValue' @@ -15027,6 +15041,14 @@ components: of values for a timeseries. type: object type: object + SpansAggregateBucketType: + description: The spans aggregate bucket type. + enum: + - bucket + example: bucket + type: string + x-enum-varnames: + - BUCKET SpansAggregateBucketValue: description: A bucket value, can be either a timeseries or a single value. oneOf: @@ -15214,6 +15236,10 @@ components: customAttribute: 123 duration: 2345 type: object + custom: + additionalProperties: {} + description: JSON object of custom spans data. + type: object end_timestamp: description: End timestamp of your span. example: '2023-01-02T09:42:36.420Z' diff --git a/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucket.java b/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucket.java index c697225cd65..1f05868155e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucket.java +++ b/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucket.java @@ -16,77 +16,91 @@ import java.util.Map; import java.util.Objects; -/** A bucket values. */ +/** Spans aggregate. */ @JsonPropertyOrder({ - SpansAggregateBucket.JSON_PROPERTY_BY, - SpansAggregateBucket.JSON_PROPERTY_COMPUTES + SpansAggregateBucket.JSON_PROPERTY_ATTRIBUTES, + SpansAggregateBucket.JSON_PROPERTY_ID, + SpansAggregateBucket.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class SpansAggregateBucket { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_BY = "by"; - private Map by = null; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SpansAggregateBucketAttributes attributes; - public static final String JSON_PROPERTY_COMPUTES = "computes"; - private Map computes = null; + public static final String JSON_PROPERTY_ID = "id"; + private String id; - public SpansAggregateBucket by(Map by) { - this.by = by; - return this; - } + public static final String JSON_PROPERTY_TYPE = "type"; + private SpansAggregateBucketType type; - public SpansAggregateBucket putByItem(String key, Object byItem) { - if (this.by == null) { - this.by = new HashMap<>(); - } - this.by.put(key, byItem); + public SpansAggregateBucket attributes(SpansAggregateBucketAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; return this; } /** - * The key, value pairs for each group by. + * A bucket values. * - * @return by + * @return attributes */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BY) + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getBy() { - return by; + public SpansAggregateBucketAttributes getAttributes() { + return attributes; } - public void setBy(Map by) { - this.by = by; + public void setAttributes(SpansAggregateBucketAttributes attributes) { + this.attributes = attributes; } - public SpansAggregateBucket computes(Map computes) { - this.computes = computes; + public SpansAggregateBucket id(String id) { + this.id = id; return this; } - public SpansAggregateBucket putComputesItem(String key, SpansAggregateBucketValue computesItem) { - if (this.computes == null) { - this.computes = new HashMap<>(); - } - this.computes.put(key, computesItem); + /** + * ID of the spans aggregate. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SpansAggregateBucket type(SpansAggregateBucketType type) { + this.type = type; + this.unparsed |= !type.isValid(); return this; } /** - * A map of the metric name -> value for regular compute or list of values for a timeseries. + * The spans aggregate bucket type. * - * @return computes + * @return type */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_COMPUTES) + @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getComputes() { - return computes; + public SpansAggregateBucketType getType() { + return type; } - public void setComputes(Map computes) { - this.computes = computes; + public void setType(SpansAggregateBucketType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; } /** @@ -145,22 +159,24 @@ public boolean equals(Object o) { return false; } SpansAggregateBucket spansAggregateBucket = (SpansAggregateBucket) o; - return Objects.equals(this.by, spansAggregateBucket.by) - && Objects.equals(this.computes, spansAggregateBucket.computes) + return Objects.equals(this.attributes, spansAggregateBucket.attributes) + && Objects.equals(this.id, spansAggregateBucket.id) + && Objects.equals(this.type, spansAggregateBucket.type) && Objects.equals(this.additionalProperties, spansAggregateBucket.additionalProperties); } @Override public int hashCode() { - return Objects.hash(by, computes, additionalProperties); + return Objects.hash(attributes, id, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpansAggregateBucket {\n"); - sb.append(" by: ").append(toIndentedString(by)).append("\n"); - sb.append(" computes: ").append(toIndentedString(computes)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucketAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucketAttributes.java new file mode 100644 index 00000000000..52dc0d92fb5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucketAttributes.java @@ -0,0 +1,210 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A bucket values. */ +@JsonPropertyOrder({ + SpansAggregateBucketAttributes.JSON_PROPERTY_BY, + SpansAggregateBucketAttributes.JSON_PROPERTY_COMPUTE, + SpansAggregateBucketAttributes.JSON_PROPERTY_COMPUTES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SpansAggregateBucketAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BY = "by"; + private Map by = null; + + public static final String JSON_PROPERTY_COMPUTE = "compute"; + private Object compute; + + public static final String JSON_PROPERTY_COMPUTES = "computes"; + private Map computes = null; + + public SpansAggregateBucketAttributes by(Map by) { + this.by = by; + return this; + } + + public SpansAggregateBucketAttributes putByItem(String key, Object byItem) { + if (this.by == null) { + this.by = new HashMap<>(); + } + this.by.put(key, byItem); + return this; + } + + /** + * The key, value pairs for each group by. + * + * @return by + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getBy() { + return by; + } + + public void setBy(Map by) { + this.by = by; + } + + public SpansAggregateBucketAttributes compute(Object compute) { + this.compute = compute; + return this; + } + + /** + * The compute data. + * + * @return compute + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPUTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getCompute() { + return compute; + } + + public void setCompute(Object compute) { + this.compute = compute; + } + + public SpansAggregateBucketAttributes computes(Map computes) { + this.computes = computes; + return this; + } + + public SpansAggregateBucketAttributes putComputesItem( + String key, SpansAggregateBucketValue computesItem) { + if (this.computes == null) { + this.computes = new HashMap<>(); + } + this.computes.put(key, computesItem); + return this; + } + + /** + * A map of the metric name -> value for regular compute or list of values for a timeseries. + * + * @return computes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getComputes() { + return computes; + } + + public void setComputes(Map computes) { + this.computes = computes; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SpansAggregateBucketAttributes + */ + @JsonAnySetter + public SpansAggregateBucketAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SpansAggregateBucketAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpansAggregateBucketAttributes spansAggregateBucketAttributes = + (SpansAggregateBucketAttributes) o; + return Objects.equals(this.by, spansAggregateBucketAttributes.by) + && Objects.equals(this.compute, spansAggregateBucketAttributes.compute) + && Objects.equals(this.computes, spansAggregateBucketAttributes.computes) + && Objects.equals( + this.additionalProperties, spansAggregateBucketAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(by, compute, computes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpansAggregateBucketAttributes {\n"); + sb.append(" by: ").append(toIndentedString(by)).append("\n"); + sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); + sb.append(" computes: ").append(toIndentedString(computes)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .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/v2/model/SpansAggregateBucketType.java b/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucketType.java new file mode 100644 index 00000000000..64d5275a84f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SpansAggregateBucketType.java @@ -0,0 +1,55 @@ +/* + * 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.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The spans aggregate bucket type. */ +@JsonSerialize(using = SpansAggregateBucketType.SpansAggregateBucketTypeSerializer.class) +public class SpansAggregateBucketType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("bucket")); + + public static final SpansAggregateBucketType BUCKET = new SpansAggregateBucketType("bucket"); + + SpansAggregateBucketType(String value) { + super(value, allowedValues); + } + + public static class SpansAggregateBucketTypeSerializer + extends StdSerializer { + public SpansAggregateBucketTypeSerializer(Class t) { + super(t); + } + + public SpansAggregateBucketTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SpansAggregateBucketType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SpansAggregateBucketType fromValue(String value) { + return new SpansAggregateBucketType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SpansAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SpansAttributes.java index 9e2872ca394..e7582f6536f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SpansAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/SpansAttributes.java @@ -22,6 +22,7 @@ /** JSON object containing all span attributes and their associated values. */ @JsonPropertyOrder({ SpansAttributes.JSON_PROPERTY_ATTRIBUTES, + SpansAttributes.JSON_PROPERTY_CUSTOM, SpansAttributes.JSON_PROPERTY_END_TIMESTAMP, SpansAttributes.JSON_PROPERTY_ENV, SpansAttributes.JSON_PROPERTY_HOST, @@ -45,6 +46,9 @@ public class SpansAttributes { public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; private Map attributes = null; + public static final String JSON_PROPERTY_CUSTOM = "custom"; + private Map custom = null; + public static final String JSON_PROPERTY_END_TIMESTAMP = "end_timestamp"; private OffsetDateTime endTimestamp; @@ -119,6 +123,35 @@ public void setAttributes(Map attributes) { this.attributes = attributes; } + public SpansAttributes custom(Map custom) { + this.custom = custom; + return this; + } + + public SpansAttributes putCustomItem(String key, Object customItem) { + if (this.custom == null) { + this.custom = new HashMap<>(); + } + this.custom.put(key, customItem); + return this; + } + + /** + * JSON object of custom spans data. + * + * @return custom + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getCustom() { + return custom; + } + + public void setCustom(Map custom) { + this.custom = custom; + } + public SpansAttributes endTimestamp(OffsetDateTime endTimestamp) { this.endTimestamp = endTimestamp; return this; @@ -501,6 +534,7 @@ public boolean equals(Object o) { } SpansAttributes spansAttributes = (SpansAttributes) o; return Objects.equals(this.attributes, spansAttributes.attributes) + && Objects.equals(this.custom, spansAttributes.custom) && Objects.equals(this.endTimestamp, spansAttributes.endTimestamp) && Objects.equals(this.env, spansAttributes.env) && Objects.equals(this.host, spansAttributes.host) @@ -523,6 +557,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( attributes, + custom, endTimestamp, env, host, @@ -546,6 +581,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SpansAttributes {\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" custom: ").append(toIndentedString(custom)).append("\n"); sb.append(" endTimestamp: ").append(toIndentedString(endTimestamp)).append("\n"); sb.append(" env: ").append(toIndentedString(env)).append("\n"); sb.append(" host: ").append(toIndentedString(host)).append("\n");