diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 531154bda8c..63d00228781 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -82253,6 +82253,8 @@ components: **Supported pipeline types:** metrics properties: + aggregation_timing: + $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessorAggregationTiming" display_name: $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" enabled: @@ -82287,6 +82289,31 @@ components: - enabled type: object x-pipeline-types: [metrics] + ObservabilityPipelineAggregateProcessorAggregationTiming: + description: Configures how metrics are assigned to aggregation windows. When omitted, metrics are grouped using system time. + properties: + allowed_lateness_secs: + description: Grace period, in seconds, for late-arriving metrics when using event time. Defaults to 10 seconds when omitted. + example: 10 + format: int64 + maximum: 3600 + minimum: 0 + type: integer + type: + $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessorAggregationTimingType" + required: + - type + type: object + ObservabilityPipelineAggregateProcessorAggregationTimingType: + description: Determines whether metrics are assigned to aggregation windows based on when they are processed or their timestamps. + enum: + - system_time + - event_time + example: event_time + type: string + x-enum-varnames: + - SYSTEM_TIME + - EVENT_TIME ObservabilityPipelineAggregateProcessorMode: description: The aggregation mode applied to metrics that share the same name and tags within the interval. enum: diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessor.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessor.java index a624feca8df..24baec7c0e0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessor.java +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessor.java @@ -24,6 +24,7 @@ *

Supported pipeline types: metrics */ @JsonPropertyOrder({ + ObservabilityPipelineAggregateProcessor.JSON_PROPERTY_AGGREGATION_TIMING, ObservabilityPipelineAggregateProcessor.JSON_PROPERTY_DISPLAY_NAME, ObservabilityPipelineAggregateProcessor.JSON_PROPERTY_ENABLED, ObservabilityPipelineAggregateProcessor.JSON_PROPERTY_ID, @@ -36,6 +37,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class ObservabilityPipelineAggregateProcessor { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATION_TIMING = "aggregation_timing"; + private ObservabilityPipelineAggregateProcessorAggregationTiming aggregationTiming; + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; private String displayName; @@ -80,6 +84,34 @@ public ObservabilityPipelineAggregateProcessor( this.unparsed |= !type.isValid(); } + public ObservabilityPipelineAggregateProcessor aggregationTiming( + ObservabilityPipelineAggregateProcessorAggregationTiming aggregationTiming) { + this.aggregationTiming = aggregationTiming; + this.unparsed |= aggregationTiming.unparsed; + return this; + } + + /** + * Configures how metrics are assigned to aggregation windows. When omitted, metrics are grouped + * using system time. + * + * @return aggregationTiming + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGGREGATION_TIMING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ObservabilityPipelineAggregateProcessorAggregationTiming getAggregationTiming() { + return aggregationTiming; + } + + public void setAggregationTiming( + ObservabilityPipelineAggregateProcessorAggregationTiming aggregationTiming) { + this.aggregationTiming = aggregationTiming; + if (aggregationTiming != null) { + this.unparsed |= aggregationTiming.unparsed; + } + } + public ObservabilityPipelineAggregateProcessor displayName(String displayName) { this.displayName = displayName; return this; @@ -289,7 +321,9 @@ public boolean equals(Object o) { } ObservabilityPipelineAggregateProcessor observabilityPipelineAggregateProcessor = (ObservabilityPipelineAggregateProcessor) o; - return Objects.equals(this.displayName, observabilityPipelineAggregateProcessor.displayName) + return Objects.equals( + this.aggregationTiming, observabilityPipelineAggregateProcessor.aggregationTiming) + && Objects.equals(this.displayName, observabilityPipelineAggregateProcessor.displayName) && Objects.equals(this.enabled, observabilityPipelineAggregateProcessor.enabled) && Objects.equals(this.id, observabilityPipelineAggregateProcessor.id) && Objects.equals(this.include, observabilityPipelineAggregateProcessor.include) @@ -304,13 +338,22 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - displayName, enabled, id, include, intervalSecs, mode, type, additionalProperties); + aggregationTiming, + displayName, + enabled, + id, + include, + intervalSecs, + mode, + type, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ObservabilityPipelineAggregateProcessor {\n"); + sb.append(" aggregationTiming: ").append(toIndentedString(aggregationTiming)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessorAggregationTiming.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessorAggregationTiming.java new file mode 100644 index 00000000000..c721441b52f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessorAggregationTiming.java @@ -0,0 +1,197 @@ +/* + * 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.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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Configures how metrics are assigned to aggregation windows. When omitted, metrics are grouped + * using system time. + */ +@JsonPropertyOrder({ + ObservabilityPipelineAggregateProcessorAggregationTiming.JSON_PROPERTY_ALLOWED_LATENESS_SECS, + ObservabilityPipelineAggregateProcessorAggregationTiming.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineAggregateProcessorAggregationTiming { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ALLOWED_LATENESS_SECS = "allowed_lateness_secs"; + private Long allowedLatenessSecs; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ObservabilityPipelineAggregateProcessorAggregationTimingType type; + + public ObservabilityPipelineAggregateProcessorAggregationTiming() {} + + @JsonCreator + public ObservabilityPipelineAggregateProcessorAggregationTiming( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ObservabilityPipelineAggregateProcessorAggregationTimingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ObservabilityPipelineAggregateProcessorAggregationTiming allowedLatenessSecs( + Long allowedLatenessSecs) { + this.allowedLatenessSecs = allowedLatenessSecs; + return this; + } + + /** + * Grace period, in seconds, for late-arriving metrics when using event time. Defaults to 10 + * seconds when omitted. minimum: 0 maximum: 3600 + * + * @return allowedLatenessSecs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALLOWED_LATENESS_SECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getAllowedLatenessSecs() { + return allowedLatenessSecs; + } + + public void setAllowedLatenessSecs(Long allowedLatenessSecs) { + this.allowedLatenessSecs = allowedLatenessSecs; + } + + public ObservabilityPipelineAggregateProcessorAggregationTiming type( + ObservabilityPipelineAggregateProcessorAggregationTimingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Determines whether metrics are assigned to aggregation windows based on when they are processed + * or their timestamps. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineAggregateProcessorAggregationTimingType getType() { + return type; + } + + public void setType(ObservabilityPipelineAggregateProcessorAggregationTimingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 ObservabilityPipelineAggregateProcessorAggregationTiming + */ + @JsonAnySetter + public ObservabilityPipelineAggregateProcessorAggregationTiming 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 ObservabilityPipelineAggregateProcessorAggregationTiming object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineAggregateProcessorAggregationTiming + observabilityPipelineAggregateProcessorAggregationTiming = + (ObservabilityPipelineAggregateProcessorAggregationTiming) o; + return Objects.equals( + this.allowedLatenessSecs, + observabilityPipelineAggregateProcessorAggregationTiming.allowedLatenessSecs) + && Objects.equals(this.type, observabilityPipelineAggregateProcessorAggregationTiming.type) + && Objects.equals( + this.additionalProperties, + observabilityPipelineAggregateProcessorAggregationTiming.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(allowedLatenessSecs, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineAggregateProcessorAggregationTiming {\n"); + sb.append(" allowedLatenessSecs: ") + .append(toIndentedString(allowedLatenessSecs)) + .append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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/ObservabilityPipelineAggregateProcessorAggregationTimingType.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessorAggregationTimingType.java new file mode 100644 index 00000000000..e6ac367c695 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAggregateProcessorAggregationTimingType.java @@ -0,0 +1,70 @@ +/* + * 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; + +/** + * Determines whether metrics are assigned to aggregation windows based on when they are processed + * or their timestamps. + */ +@JsonSerialize( + using = + ObservabilityPipelineAggregateProcessorAggregationTimingType + .ObservabilityPipelineAggregateProcessorAggregationTimingTypeSerializer.class) +public class ObservabilityPipelineAggregateProcessorAggregationTimingType + extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("system_time", "event_time")); + + public static final ObservabilityPipelineAggregateProcessorAggregationTimingType SYSTEM_TIME = + new ObservabilityPipelineAggregateProcessorAggregationTimingType("system_time"); + public static final ObservabilityPipelineAggregateProcessorAggregationTimingType EVENT_TIME = + new ObservabilityPipelineAggregateProcessorAggregationTimingType("event_time"); + + ObservabilityPipelineAggregateProcessorAggregationTimingType(String value) { + super(value, allowedValues); + } + + public static class ObservabilityPipelineAggregateProcessorAggregationTimingTypeSerializer + extends StdSerializer { + public ObservabilityPipelineAggregateProcessorAggregationTimingTypeSerializer( + Class t) { + super(t); + } + + public ObservabilityPipelineAggregateProcessorAggregationTimingTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ObservabilityPipelineAggregateProcessorAggregationTimingType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ObservabilityPipelineAggregateProcessorAggregationTimingType fromValue( + String value) { + return new ObservabilityPipelineAggregateProcessorAggregationTimingType(value); + } +}