diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 682c9d1e9b3..8b58b6e874c 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -119518,6 +119518,644 @@ components:
$ref: '#/components/schemas/TimelineCellResource'
type: array
type: object
+ TimeseriesAnomalyInvestigationAnomaly:
+ description: Most significant anomaly detected in the request.
+ properties:
+ anomaly_detection:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationDetection'
+ detected_interval:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationInterval'
+ display_interval:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationInterval'
+ findings:
+ description: Deterministic explanations for the anomaly, ordered by importance.
+ example: []
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationFinding'
+ maxItems: 3
+ type: array
+ maximum_deviation:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationMaximumDeviation'
+ series:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationSeries'
+ tag_analysis:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationTagAnalysis'
+ type:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationAnomalyType'
+ required:
+ - series
+ - anomaly_detection
+ - detected_interval
+ - display_interval
+ - type
+ - maximum_deviation
+ - tag_analysis
+ - findings
+ type: object
+ TimeseriesAnomalyInvestigationAnomalyFinding:
+ description: Finding that describes the anomaly when completed analysis produces no displayable influential tags.
+ properties:
+ description:
+ description: Deterministic explanation of the finding.
+ example: "The service:api series rose outside its expected range."
+ type: string
+ headline:
+ description: Concise, deterministic finding title.
+ example: "An anomaly was detected on service:api"
+ type: string
+ type:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationAnomalyFindingType'
+ required:
+ - type
+ - headline
+ - description
+ type: object
+ TimeseriesAnomalyInvestigationAnomalyFindingType:
+ description: Finding category for an anomaly without a displayable influential tag.
+ enum:
+ - anomaly
+ example: anomaly
+ type: string
+ x-enum-varnames:
+ - ANOMALY
+ TimeseriesAnomalyInvestigationAnomalyType:
+ description: Direction of an anomaly relative to its expected range.
+ enum:
+ - spike
+ - dip
+ example: spike
+ type: string
+ x-enum-varnames:
+ - SPIKE
+ - DIP
+ TimeseriesAnomalyInvestigationCompleteStatus:
+ description: Status value indicating successful completion.
+ enum:
+ - complete
+ example: complete
+ type: string
+ x-enum-varnames:
+ - COMPLETE
+ TimeseriesAnomalyInvestigationConfigurationSource:
+ description: Source of the anomaly detection configuration.
+ enum:
+ - request_formula
+ - watchdog_explains_default
+ example: request_formula
+ type: string
+ x-enum-varnames:
+ - REQUEST_FORMULA
+ - WATCHDOG_EXPLAINS_DEFAULT
+ TimeseriesAnomalyInvestigationDataSource:
+ description: Data source for an anomaly investigation query.
+ enum:
+ - metrics
+ example: metrics
+ type: string
+ x-enum-varnames:
+ - METRICS
+ TimeseriesAnomalyInvestigationDetection:
+ description: Anomaly detection configuration used for the result.
+ properties:
+ configuration_source:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationConfigurationSource'
+ profile:
+ description: Applied Watchdog Explains profile, or null when the request supplied an explicit `anomalies()` formula. The current Watchdog profile is `watchdog_explains_v1`.
+ example:
+ nullable: true
+ type: string
+ required:
+ - configuration_source
+ - profile
+ type: object
+ TimeseriesAnomalyInvestigationFinding:
+ description: Deterministic explanation for a detected anomaly.
+ oneOf:
+ - $ref: '#/components/schemas/TimeseriesAnomalyInvestigationInfluentialTagFinding'
+ - $ref: '#/components/schemas/TimeseriesAnomalyInvestigationAnomalyFinding'
+ TimeseriesAnomalyInvestigationFindingSynonym:
+ description: Tag grouped under an influential tag by synonym analysis.
+ properties:
+ key:
+ description: Synonymous tag key.
+ example: app
+ type: string
+ values:
+ description: Values associated with the synonymous tag.
+ example:
+ - api
+ items:
+ description: Synonymous tag value.
+ example: api
+ type: string
+ type: array
+ required:
+ - key
+ - values
+ type: object
+ TimeseriesAnomalyInvestigationFindingTag:
+ description: Structured tag evidence for an influential-tag finding.
+ properties:
+ influence_type:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationInfluenceType'
+ key:
+ description: Influential tag key.
+ example: service
+ type: string
+ rating:
+ description: Influence rating from 1 through 5.
+ example: 5.0
+ format: double
+ maximum: 5
+ minimum: 1
+ type: number
+ synonyms:
+ description: Tags grouped with this tag by Variation of Influence synonym analysis.
+ example: []
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationFindingSynonym'
+ type: array
+ values:
+ description: Influential values for the tag key.
+ example:
+ - api
+ items:
+ description: Influential tag value.
+ example: api
+ type: string
+ type: array
+ required:
+ - key
+ - values
+ - influence_type
+ - rating
+ - synonyms
+ type: object
+ TimeseriesAnomalyInvestigationFormula:
+ description: Formula evaluated by the timeseries request.
+ properties:
+ formula:
+ description: Formula expression referencing one or more named queries.
+ example: "anomalies(query1, 'agile', 3)"
+ minLength: 1
+ type: string
+ limit:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationFormulaLimit'
+ required:
+ - formula
+ type: object
+ TimeseriesAnomalyInvestigationFormulaLimit:
+ description: Optional formula limit accepted for compatibility with Timeseries API requests. Formula limits have no effect on timeseries queries.
+ properties:
+ count:
+ description: Requested result limit. This field has no effect on a timeseries anomaly investigation.
+ example: 10
+ format: int64
+ minimum: 0
+ type: integer
+ order:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationFormulaLimitOrder'
+ type: object
+ TimeseriesAnomalyInvestigationFormulaLimitOrder:
+ description: Sort order used when applying a formula series limit.
+ enum:
+ - asc
+ - desc
+ example: desc
+ type: string
+ x-enum-varnames:
+ - ASC
+ - DESC
+ TimeseriesAnomalyInvestigationInfluenceType:
+ description: Kind of influence a tag has on a series.
+ enum:
+ - shape
+ - value
+ example: shape
+ type: string
+ x-enum-varnames:
+ - SHAPE
+ - VALUE
+ TimeseriesAnomalyInvestigationInfluentialTagFinding:
+ description: Finding that attributes an anomaly to an influential tag.
+ properties:
+ description:
+ description: Deterministic explanation of the finding.
+ example: "Filtering out service:api flattens the spike."
+ type: string
+ headline:
+ description: Concise, deterministic finding title.
+ example: "service:api is the likely cause"
+ type: string
+ tag:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationFindingTag'
+ type:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationInfluentialTagFindingType'
+ required:
+ - type
+ - headline
+ - description
+ - tag
+ type: object
+ TimeseriesAnomalyInvestigationInfluentialTagFindingType:
+ description: Finding category for an influential tag.
+ enum:
+ - influential_tag
+ example: influential_tag
+ type: string
+ x-enum-varnames:
+ - INFLUENTIAL_TAG
+ TimeseriesAnomalyInvestigationInterval:
+ description: Half-open time interval in milliseconds since the Unix epoch.
+ properties:
+ end:
+ description: Exclusive end of the interval.
+ example: 1754406120000
+ format: int64
+ type: integer
+ start:
+ description: Inclusive start of the interval.
+ example: 1754406060000
+ format: int64
+ type: integer
+ required:
+ - start
+ - end
+ type: object
+ TimeseriesAnomalyInvestigationMaximumDeviation:
+ description: Most anomalous point within the detected interval.
+ properties:
+ delta_from_boundary:
+ description: Absolute distance between the observed value and the nearest anomaly boundary.
+ example: 7.0
+ format: double
+ minimum: 0
+ type: number
+ timestamp:
+ description: Point timestamp in milliseconds since the Unix epoch.
+ example: 1754406090000
+ format: int64
+ type: integer
+ value:
+ description: Observed value at the point.
+ example: 42.0
+ format: double
+ type: number
+ required:
+ - timestamp
+ - value
+ - delta_from_boundary
+ type: object
+ TimeseriesAnomalyInvestigationMetaType:
+ description: Response metadata type for a timeseries anomaly investigation.
+ enum:
+ - timeseries_anomaly_investigation
+ example: timeseries_anomaly_investigation
+ type: string
+ x-enum-varnames:
+ - TIMESERIES_ANOMALY_INVESTIGATION
+ TimeseriesAnomalyInvestigationMetricQuery:
+ description: Metrics query referenced by a formula.
+ properties:
+ aggregator:
+ description: Optional scalar aggregator accepted for request compatibility. This field is ignored for timeseries queries.
+ example: avg
+ type: string
+ cross_org_uuids:
+ description: Optional organization UUID used for a cross-organization query. Each query accepts at most one UUID; use separate queries for separate organizations. Influential-tag analysis is currently unsupported for cross-organization queries, but anomaly detection still runs.
+ example:
+ - "00000000-0000-0000-0000-000000000000"
+ items:
+ description: Organization UUID to query.
+ example: "00000000-0000-0000-0000-000000000000"
+ minLength: 1
+ type: string
+ maxItems: 1
+ type: array
+ data_source:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationDataSource'
+ name:
+ description: Name used to reference this query from formulas.
+ example: query1
+ minLength: 1
+ type: string
+ query:
+ description: Datadog metrics query expression.
+ example: "avg:system.cpu.user{env:prod} by {service}"
+ minLength: 1
+ type: string
+ required:
+ - data_source
+ - name
+ - query
+ type: object
+ TimeseriesAnomalyInvestigationQueryExecutionStatus:
+ description: Current execution status for a named query.
+ enum:
+ - running
+ - done
+ example: done
+ type: string
+ x-enum-varnames:
+ - RUNNING
+ - DONE
+ TimeseriesAnomalyInvestigationQueryStatus:
+ description: Execution status for one named query.
+ properties:
+ name:
+ description: Query name from the request.
+ example: query1
+ type: string
+ status:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationQueryExecutionStatus'
+ required:
+ - name
+ - status
+ type: object
+ TimeseriesAnomalyInvestigationRequest:
+ description: Request to investigate a metrics timeseries for anomalies.
+ properties:
+ data:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationRequestData'
+ required:
+ - data
+ type: object
+ TimeseriesAnomalyInvestigationRequestAttributes:
+ description: Attributes of an anomaly investigation request.
+ properties:
+ requests:
+ description: Timeseries requests to investigate. This API version accepts exactly one request.
+ example:
+ - formulas:
+ - formula: "anomalies(query1, 'agile', 3)"
+ from: 1754406000000
+ queries:
+ - data_source: metrics
+ name: query1
+ query: "avg:system.cpu.user{env:prod} by {service}"
+ to: 1754423940000
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationTimeseriesRequest'
+ maxItems: 1
+ minItems: 1
+ type: array
+ required:
+ - requests
+ type: object
+ TimeseriesAnomalyInvestigationRequestData:
+ description: JSON:API resource containing an anomaly investigation request.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationRequestAttributes'
+ type:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationType'
+ required:
+ - type
+ - attributes
+ type: object
+ TimeseriesAnomalyInvestigationResponse:
+ description: Response containing the anomaly investigation results and timeseries metadata.
+ properties:
+ data:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationResponseData'
+ meta:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationResponseMeta'
+ required:
+ - data
+ - meta
+ type: object
+ TimeseriesAnomalyInvestigationResponseAttributes:
+ description: Attributes of an anomaly investigation response.
+ properties:
+ results:
+ description: Results returned in the same order as the submitted requests. This API version returns exactly one result.
+ example:
+ - anomalies: []
+ status: complete
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationResult'
+ maxItems: 1
+ minItems: 1
+ type: array
+ required:
+ - results
+ type: object
+ TimeseriesAnomalyInvestigationResponseData:
+ description: JSON:API resource containing anomaly investigation results.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationResponseAttributes'
+ id:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationResponseID'
+ type:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationType'
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ TimeseriesAnomalyInvestigationResponseID:
+ description: Stable identifier for an anomaly investigation response resource.
+ enum:
+ - "0"
+ example: "0"
+ type: string
+ x-enum-varnames:
+ - ZERO
+ TimeseriesAnomalyInvestigationResponseMeta:
+ description: Timeseries execution metadata for the single request accepted by this API version.
+ properties:
+ from_date:
+ description: Effective start of the timeseries query in milliseconds since the Unix epoch.
+ example: 1754406000000
+ format: int64
+ type: integer
+ interval:
+ description: Effective timeseries interval in milliseconds.
+ example: 60000
+ format: int64
+ minimum: 1
+ type: integer
+ queries:
+ description: Execution status for the request's queries.
+ example:
+ - name: query1
+ status: done
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationQueryStatus'
+ type: array
+ res_type:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationMetaType'
+ results_warnings:
+ description: Non-fatal warnings produced while executing the investigation.
+ example: []
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationResultsWarning'
+ type: array
+ to_date:
+ description: Effective end of the timeseries query in milliseconds since the Unix epoch.
+ example: 1754423940000
+ format: int64
+ type: integer
+ required:
+ - from_date
+ - to_date
+ - interval
+ - queries
+ - results_warnings
+ - res_type
+ type: object
+ TimeseriesAnomalyInvestigationResult:
+ description: Completed result for one timeseries request. The anomalies array is empty when no qualifying anomaly is found.
+ properties:
+ anomalies:
+ description: Detected anomalies. This API version returns at most one anomaly.
+ example: []
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationAnomaly'
+ maxItems: 1
+ type: array
+ status:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationCompleteStatus'
+ required:
+ - status
+ - anomalies
+ type: object
+ TimeseriesAnomalyInvestigationResultsWarning:
+ description: Non-fatal warning produced while executing the investigation.
+ properties:
+ message:
+ description: Human-readable warning message.
+ example: "Influential tag analysis failed for at least one detected anomaly."
+ type: string
+ name:
+ description: Machine-readable warning name.
+ example: tag_analysis_failed
+ type: string
+ required:
+ - name
+ - message
+ type: object
+ TimeseriesAnomalyInvestigationSeries:
+ description: Logical series on which the anomaly was detected.
+ properties:
+ group_tags:
+ description: Tags identifying the selected group. Empty for a query without grouping.
+ example:
+ - "service:api"
+ items:
+ description: Tag in `key:value` form.
+ example: "service:api"
+ type: string
+ type: array
+ label:
+ description: Display label for the selected series.
+ example: api
+ type: string
+ query_index:
+ description: Zero-based index of the caller's formula that produced the series.
+ example: 0
+ format: int64
+ minimum: 0
+ type: integer
+ required:
+ - query_index
+ - group_tags
+ - label
+ type: object
+ TimeseriesAnomalyInvestigationTagAnalysis:
+ description: Summary of optional influential-tag enrichment. Count and key fields are present only when analysis completes; enrichment availability does not affect completion of the investigation result.
+ properties:
+ analyzed_tag_keys:
+ description: Tag keys analyzed. Present only when analysis completes.
+ example:
+ - service
+ - env
+ items:
+ description: Analyzed tag key.
+ example: service
+ type: string
+ type: array
+ status:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationTagAnalysisStatus'
+ tag_keys_analyzed:
+ description: Number of tag keys analyzed. Present only when analysis completes.
+ example: 2
+ format: int64
+ minimum: 0
+ type: integer
+ tag_values_analyzed:
+ description: Number of tag values analyzed. Present only when analysis completes.
+ example: 4
+ format: int64
+ minimum: 0
+ type: integer
+ required:
+ - status
+ type: object
+ TimeseriesAnomalyInvestigationTagAnalysisStatus:
+ description: Outcome of optional influential-tag enrichment.
+ enum:
+ - complete
+ - unsupported
+ - failed
+ example: complete
+ type: string
+ x-enum-varnames:
+ - COMPLETE
+ - UNSUPPORTED
+ - FAILED
+ TimeseriesAnomalyInvestigationTimeseriesRequest:
+ description: Metrics timeseries request to investigate.
+ properties:
+ formulas:
+ description: Formulas to evaluate. Each formula may contain an explicit `anomalies()` call or a supported metrics expression.
+ example:
+ - formula: "anomalies(query1, 'agile', 3)"
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationFormula'
+ minItems: 1
+ type: array
+ from:
+ description: Start of the investigation time window in milliseconds since the Unix epoch.
+ example: 1754406000000
+ format: int64
+ type: integer
+ interval:
+ description: Optional requested aggregation interval in milliseconds.
+ example: 60000
+ format: int64
+ minimum: 1
+ type: integer
+ queries:
+ description: Metrics queries referenced by the formulas.
+ example:
+ - data_source: metrics
+ name: query1
+ query: "avg:system.cpu.user{env:prod} by {service}"
+ items:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationMetricQuery'
+ minItems: 1
+ type: array
+ to:
+ description: End of the investigation time window in milliseconds since the Unix epoch. Must be later than `from`.
+ example: 1754423940000
+ format: int64
+ type: integer
+ required:
+ - formulas
+ - from
+ - to
+ - queries
+ type: object
+ TimeseriesAnomalyInvestigationType:
+ description: Resource type for a timeseries anomaly investigation.
+ enum:
+ - timeseries_anomaly_investigation
+ example: timeseries_anomaly_investigation
+ type: string
+ x-enum-varnames:
+ - TIMESERIES_ANOMALY_INVESTIGATION
TimeseriesFormulaQueryRequest:
description: A request wrapper around a single timeseries query to be executed.
properties:
@@ -219358,6 +219996,141 @@ paths:
operator: OR
permissions:
- test_optimization_read
+ /api/v2/timeseries-anomaly-investigations:
+ post:
+ description: |-
+ Investigates a metrics timeseries request for its most significant anomaly and returns deterministic findings.
+ Metrics queries with or without grouping are supported. This API version accepts exactly one request and returns at most one anomaly.
+ operationId: CreateTimeseriesAnomalyInvestigation
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ requests:
+ - formulas:
+ - formula: "anomalies(query1, 'agile', 3)"
+ from: 1754406000000
+ queries:
+ - data_source: metrics
+ name: query1
+ query: "avg:system.cpu.user{env:prod} by {service}"
+ to: 1754423940000
+ type: timeseries_anomaly_investigation
+ schema:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationRequest'
+ description: Metrics timeseries request to investigate.
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ results:
+ - anomalies:
+ - anomaly_detection:
+ configuration_source: request_formula
+ profile:
+ detected_interval:
+ end: 1754406120000
+ start: 1754406060000
+ display_interval:
+ end: 1754406150000
+ start: 1754406030000
+ findings:
+ - description: "Filtering out service:api flattens the spike."
+ headline: "service:api is the likely cause"
+ tag:
+ influence_type: shape
+ key: service
+ rating: 5.0
+ synonyms: []
+ values:
+ - api
+ type: influential_tag
+ maximum_deviation:
+ delta_from_boundary: 7.0
+ timestamp: 1754406090000
+ value: 42.0
+ series:
+ group_tags:
+ - "service:api"
+ label: api
+ query_index: 0
+ tag_analysis:
+ analyzed_tag_keys:
+ - service
+ - env
+ status: complete
+ tag_keys_analyzed: 2
+ tag_values_analyzed: 4
+ type: spike
+ status: complete
+ id: "0"
+ type: timeseries_anomaly_investigation
+ meta:
+ from_date: 1754406000000
+ interval: 60000
+ queries:
+ - name: query1
+ status: done
+ res_type: timeseries_anomaly_investigation
+ results_warnings: []
+ to_date: 1754423940000
+ schema:
+ $ref: '#/components/schemas/TimeseriesAnomalyInvestigationResponse'
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Bad Request
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Unauthorized
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ "422":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Unprocessable Entity
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - timeseries_query
+ - metrics_read
+ summary: Investigate a timeseries anomaly
+ tags:
+ - Timeseries Anomaly Investigations
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: AND
+ permissions:
+ - timeseries_query
+ - metrics_read
+ x-unstable: |-
+ **Note**: This endpoint is in preview and is subject to change.
+ If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/trace/{trace_id}:
get:
description: |-
@@ -223722,6 +224495,8 @@ tags:
name: Test Optimization
- description: Ingest and manage threat intelligence data for security enrichment and investigation.
name: Threat Intelligence
+ - description: Investigate metrics timeseries anomalies and return deterministic findings.
+ name: Timeseries Anomaly Investigations
- description: |-
Manage your Datadog Twilio integration accounts directly through the Datadog API.
Create, update, and delete accounts, configure authentication and settings, and
diff --git a/examples/v2/timeseries-anomaly-investigations/CreateTimeseriesAnomalyInvestigation.java b/examples/v2/timeseries-anomaly-investigations/CreateTimeseriesAnomalyInvestigation.java
new file mode 100644
index 00000000000..c131c8f44df
--- /dev/null
+++ b/examples/v2/timeseries-anomaly-investigations/CreateTimeseriesAnomalyInvestigation.java
@@ -0,0 +1,65 @@
+// Investigate a timeseries anomaly returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.TimeseriesAnomalyInvestigationsApi;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationDataSource;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationFormula;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationMetricQuery;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationRequest;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationRequestAttributes;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationRequestData;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationResponse;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationTimeseriesRequest;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationType;
+import java.util.Collections;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.createTimeseriesAnomalyInvestigation", true);
+ TimeseriesAnomalyInvestigationsApi apiInstance =
+ new TimeseriesAnomalyInvestigationsApi(defaultClient);
+
+ TimeseriesAnomalyInvestigationRequest body =
+ new TimeseriesAnomalyInvestigationRequest()
+ .data(
+ new TimeseriesAnomalyInvestigationRequestData()
+ .attributes(
+ new TimeseriesAnomalyInvestigationRequestAttributes()
+ .requests(
+ Collections.singletonList(
+ new TimeseriesAnomalyInvestigationTimeseriesRequest()
+ .formulas(
+ Collections.singletonList(
+ new TimeseriesAnomalyInvestigationFormula()
+ .formula("anomalies(query1, 'agile', 3)")))
+ .from(1754406000000L)
+ .queries(
+ Collections.singletonList(
+ new TimeseriesAnomalyInvestigationMetricQuery()
+ .dataSource(
+ TimeseriesAnomalyInvestigationDataSource
+ .METRICS)
+ .name("query1")
+ .query(
+ "avg:system.cpu.user{env:prod} by"
+ + " {service}")))
+ .to(1754423940000L))))
+ .type(TimeseriesAnomalyInvestigationType.TIMESERIES_ANOMALY_INVESTIGATION));
+
+ try {
+ TimeseriesAnomalyInvestigationResponse result =
+ apiInstance.createTimeseriesAnomalyInvestigation(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println(
+ "Exception when calling"
+ + " TimeseriesAnomalyInvestigationsApi#createTimeseriesAnomalyInvestigation");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java
index a6c79c482af..b0379d79879 100644
--- a/src/main/java/com/datadog/api/client/ApiClient.java
+++ b/src/main/java/com/datadog/api/client/ApiClient.java
@@ -1430,6 +1430,7 @@ public class ApiClient {
put("v2.addMemberTeam", false);
put("v2.listMemberTeams", false);
put("v2.removeMemberTeam", false);
+ put("v2.createTimeseriesAnomalyInvestigation", false);
put("v2.createWebIntegrationAccount", false);
put("v2.deleteWebIntegrationAccount", false);
put("v2.getWebIntegrationAccount", false);
diff --git a/src/main/java/com/datadog/api/client/v2/api/TimeseriesAnomalyInvestigationsApi.java b/src/main/java/com/datadog/api/client/v2/api/TimeseriesAnomalyInvestigationsApi.java
new file mode 100644
index 00000000000..882e1e16420
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/TimeseriesAnomalyInvestigationsApi.java
@@ -0,0 +1,209 @@
+package com.datadog.api.client.v2.api;
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.ApiResponse;
+import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationRequest;
+import com.datadog.api.client.v2.model.TimeseriesAnomalyInvestigationResponse;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.core.GenericType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class TimeseriesAnomalyInvestigationsApi {
+ private ApiClient apiClient;
+
+ public TimeseriesAnomalyInvestigationsApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public TimeseriesAnomalyInvestigationsApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client.
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client.
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Investigate a timeseries anomaly.
+ *
+ *
See {@link #createTimeseriesAnomalyInvestigationWithHttpInfo}.
+ *
+ * @param body Metrics timeseries request to investigate. (required)
+ * @return TimeseriesAnomalyInvestigationResponse
+ * @throws ApiException if fails to make API call
+ */
+ public TimeseriesAnomalyInvestigationResponse createTimeseriesAnomalyInvestigation(
+ TimeseriesAnomalyInvestigationRequest body) throws ApiException {
+ return createTimeseriesAnomalyInvestigationWithHttpInfo(body).getData();
+ }
+
+ /**
+ * Investigate a timeseries anomaly.
+ *
+ *
See {@link #createTimeseriesAnomalyInvestigationWithHttpInfoAsync}.
+ *
+ * @param body Metrics timeseries request to investigate. (required)
+ * @return CompletableFuture<TimeseriesAnomalyInvestigationResponse>
+ */
+ public CompletableFuture
+ createTimeseriesAnomalyInvestigationAsync(TimeseriesAnomalyInvestigationRequest body) {
+ return createTimeseriesAnomalyInvestigationWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Investigates a metrics timeseries request for its most significant anomaly and returns
+ * deterministic findings. Metrics queries with or without grouping are supported. This API
+ * version accepts exactly one request and returns at most one anomaly.
+ *
+ * @param body Metrics timeseries request to investigate. (required)
+ * @return ApiResponse<TimeseriesAnomalyInvestigationResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 401 | Unauthorized | - |
+ * | 403 | Forbidden | - |
+ * | 422 | Unprocessable Entity | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse
+ createTimeseriesAnomalyInvestigationWithHttpInfo(TimeseriesAnomalyInvestigationRequest body)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "createTimeseriesAnomalyInvestigation";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " createTimeseriesAnomalyInvestigation");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/timeseries-anomaly-investigations";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.TimeseriesAnomalyInvestigationsApi.createTimeseriesAnomalyInvestigation",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Investigate a timeseries anomaly.
+ *
+ * See {@link #createTimeseriesAnomalyInvestigationWithHttpInfo}.
+ *
+ * @param body Metrics timeseries request to investigate. (required)
+ * @return CompletableFuture<ApiResponse<TimeseriesAnomalyInvestigationResponse>>
+ */
+ public CompletableFuture>
+ createTimeseriesAnomalyInvestigationWithHttpInfoAsync(
+ TimeseriesAnomalyInvestigationRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "createTimeseriesAnomalyInvestigation";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'body' when calling"
+ + " createTimeseriesAnomalyInvestigation"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/timeseries-anomaly-investigations";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.TimeseriesAnomalyInvestigationsApi.createTimeseriesAnomalyInvestigation",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomaly.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomaly.java
new file mode 100644
index 00000000000..80d985fff40
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomaly.java
@@ -0,0 +1,428 @@
+/*
+ * 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.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/** Most significant anomaly detected in the request. */
+@JsonPropertyOrder({
+ TimeseriesAnomalyInvestigationAnomaly.JSON_PROPERTY_ANOMALY_DETECTION,
+ TimeseriesAnomalyInvestigationAnomaly.JSON_PROPERTY_DETECTED_INTERVAL,
+ TimeseriesAnomalyInvestigationAnomaly.JSON_PROPERTY_DISPLAY_INTERVAL,
+ TimeseriesAnomalyInvestigationAnomaly.JSON_PROPERTY_FINDINGS,
+ TimeseriesAnomalyInvestigationAnomaly.JSON_PROPERTY_MAXIMUM_DEVIATION,
+ TimeseriesAnomalyInvestigationAnomaly.JSON_PROPERTY_SERIES,
+ TimeseriesAnomalyInvestigationAnomaly.JSON_PROPERTY_TAG_ANALYSIS,
+ TimeseriesAnomalyInvestigationAnomaly.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class TimeseriesAnomalyInvestigationAnomaly {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ANOMALY_DETECTION = "anomaly_detection";
+ private TimeseriesAnomalyInvestigationDetection anomalyDetection;
+
+ public static final String JSON_PROPERTY_DETECTED_INTERVAL = "detected_interval";
+ private TimeseriesAnomalyInvestigationInterval detectedInterval;
+
+ public static final String JSON_PROPERTY_DISPLAY_INTERVAL = "display_interval";
+ private TimeseriesAnomalyInvestigationInterval displayInterval;
+
+ public static final String JSON_PROPERTY_FINDINGS = "findings";
+ private List findings = new ArrayList<>();
+
+ public static final String JSON_PROPERTY_MAXIMUM_DEVIATION = "maximum_deviation";
+ private TimeseriesAnomalyInvestigationMaximumDeviation maximumDeviation;
+
+ public static final String JSON_PROPERTY_SERIES = "series";
+ private TimeseriesAnomalyInvestigationSeries series;
+
+ public static final String JSON_PROPERTY_TAG_ANALYSIS = "tag_analysis";
+ private TimeseriesAnomalyInvestigationTagAnalysis tagAnalysis;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private TimeseriesAnomalyInvestigationAnomalyType type;
+
+ public TimeseriesAnomalyInvestigationAnomaly() {}
+
+ @JsonCreator
+ public TimeseriesAnomalyInvestigationAnomaly(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ANOMALY_DETECTION)
+ TimeseriesAnomalyInvestigationDetection anomalyDetection,
+ @JsonProperty(required = true, value = JSON_PROPERTY_DETECTED_INTERVAL)
+ TimeseriesAnomalyInvestigationInterval detectedInterval,
+ @JsonProperty(required = true, value = JSON_PROPERTY_DISPLAY_INTERVAL)
+ TimeseriesAnomalyInvestigationInterval displayInterval,
+ @JsonProperty(required = true, value = JSON_PROPERTY_FINDINGS)
+ List findings,
+ @JsonProperty(required = true, value = JSON_PROPERTY_MAXIMUM_DEVIATION)
+ TimeseriesAnomalyInvestigationMaximumDeviation maximumDeviation,
+ @JsonProperty(required = true, value = JSON_PROPERTY_SERIES)
+ TimeseriesAnomalyInvestigationSeries series,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TAG_ANALYSIS)
+ TimeseriesAnomalyInvestigationTagAnalysis tagAnalysis,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE)
+ TimeseriesAnomalyInvestigationAnomalyType type) {
+ this.anomalyDetection = anomalyDetection;
+ this.unparsed |= anomalyDetection.unparsed;
+ this.detectedInterval = detectedInterval;
+ this.unparsed |= detectedInterval.unparsed;
+ this.displayInterval = displayInterval;
+ this.unparsed |= displayInterval.unparsed;
+ this.findings = findings;
+ for (TimeseriesAnomalyInvestigationFinding item : findings) {
+ this.unparsed |= item.unparsed;
+ }
+ this.maximumDeviation = maximumDeviation;
+ this.unparsed |= maximumDeviation.unparsed;
+ this.series = series;
+ this.unparsed |= series.unparsed;
+ this.tagAnalysis = tagAnalysis;
+ this.unparsed |= tagAnalysis.unparsed;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly anomalyDetection(
+ TimeseriesAnomalyInvestigationDetection anomalyDetection) {
+ this.anomalyDetection = anomalyDetection;
+ this.unparsed |= anomalyDetection.unparsed;
+ return this;
+ }
+
+ /**
+ * Anomaly detection configuration used for the result.
+ *
+ * @return anomalyDetection
+ */
+ @JsonProperty(JSON_PROPERTY_ANOMALY_DETECTION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationDetection getAnomalyDetection() {
+ return anomalyDetection;
+ }
+
+ public void setAnomalyDetection(TimeseriesAnomalyInvestigationDetection anomalyDetection) {
+ this.anomalyDetection = anomalyDetection;
+ if (anomalyDetection != null) {
+ this.unparsed |= anomalyDetection.unparsed;
+ }
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly detectedInterval(
+ TimeseriesAnomalyInvestigationInterval detectedInterval) {
+ this.detectedInterval = detectedInterval;
+ this.unparsed |= detectedInterval.unparsed;
+ return this;
+ }
+
+ /**
+ * Half-open time interval in milliseconds since the Unix epoch.
+ *
+ * @return detectedInterval
+ */
+ @JsonProperty(JSON_PROPERTY_DETECTED_INTERVAL)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationInterval getDetectedInterval() {
+ return detectedInterval;
+ }
+
+ public void setDetectedInterval(TimeseriesAnomalyInvestigationInterval detectedInterval) {
+ this.detectedInterval = detectedInterval;
+ if (detectedInterval != null) {
+ this.unparsed |= detectedInterval.unparsed;
+ }
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly displayInterval(
+ TimeseriesAnomalyInvestigationInterval displayInterval) {
+ this.displayInterval = displayInterval;
+ this.unparsed |= displayInterval.unparsed;
+ return this;
+ }
+
+ /**
+ * Half-open time interval in milliseconds since the Unix epoch.
+ *
+ * @return displayInterval
+ */
+ @JsonProperty(JSON_PROPERTY_DISPLAY_INTERVAL)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationInterval getDisplayInterval() {
+ return displayInterval;
+ }
+
+ public void setDisplayInterval(TimeseriesAnomalyInvestigationInterval displayInterval) {
+ this.displayInterval = displayInterval;
+ if (displayInterval != null) {
+ this.unparsed |= displayInterval.unparsed;
+ }
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly findings(
+ List findings) {
+ this.findings = findings;
+ for (TimeseriesAnomalyInvestigationFinding item : findings) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly addFindingsItem(
+ TimeseriesAnomalyInvestigationFinding findingsItem) {
+ this.findings.add(findingsItem);
+ this.unparsed |= findingsItem.unparsed;
+ return this;
+ }
+
+ /**
+ * Deterministic explanations for the anomaly, ordered by importance.
+ *
+ * @return findings
+ */
+ @JsonProperty(JSON_PROPERTY_FINDINGS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getFindings() {
+ return findings;
+ }
+
+ public void setFindings(List findings) {
+ this.findings = findings;
+ if (findings != null) {
+ for (TimeseriesAnomalyInvestigationFinding item : findings) {
+ this.unparsed |= item.unparsed;
+ }
+ }
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly maximumDeviation(
+ TimeseriesAnomalyInvestigationMaximumDeviation maximumDeviation) {
+ this.maximumDeviation = maximumDeviation;
+ this.unparsed |= maximumDeviation.unparsed;
+ return this;
+ }
+
+ /**
+ * Most anomalous point within the detected interval.
+ *
+ * @return maximumDeviation
+ */
+ @JsonProperty(JSON_PROPERTY_MAXIMUM_DEVIATION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationMaximumDeviation getMaximumDeviation() {
+ return maximumDeviation;
+ }
+
+ public void setMaximumDeviation(TimeseriesAnomalyInvestigationMaximumDeviation maximumDeviation) {
+ this.maximumDeviation = maximumDeviation;
+ if (maximumDeviation != null) {
+ this.unparsed |= maximumDeviation.unparsed;
+ }
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly series(TimeseriesAnomalyInvestigationSeries series) {
+ this.series = series;
+ this.unparsed |= series.unparsed;
+ return this;
+ }
+
+ /**
+ * Logical series on which the anomaly was detected.
+ *
+ * @return series
+ */
+ @JsonProperty(JSON_PROPERTY_SERIES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationSeries getSeries() {
+ return series;
+ }
+
+ public void setSeries(TimeseriesAnomalyInvestigationSeries series) {
+ this.series = series;
+ if (series != null) {
+ this.unparsed |= series.unparsed;
+ }
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly tagAnalysis(
+ TimeseriesAnomalyInvestigationTagAnalysis tagAnalysis) {
+ this.tagAnalysis = tagAnalysis;
+ this.unparsed |= tagAnalysis.unparsed;
+ return this;
+ }
+
+ /**
+ * Summary of optional influential-tag enrichment. Count and key fields are present only when
+ * analysis completes; enrichment availability does not affect completion of the investigation
+ * result.
+ *
+ * @return tagAnalysis
+ */
+ @JsonProperty(JSON_PROPERTY_TAG_ANALYSIS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationTagAnalysis getTagAnalysis() {
+ return tagAnalysis;
+ }
+
+ public void setTagAnalysis(TimeseriesAnomalyInvestigationTagAnalysis tagAnalysis) {
+ this.tagAnalysis = tagAnalysis;
+ if (tagAnalysis != null) {
+ this.unparsed |= tagAnalysis.unparsed;
+ }
+ }
+
+ public TimeseriesAnomalyInvestigationAnomaly type(
+ TimeseriesAnomalyInvestigationAnomalyType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Direction of an anomaly relative to its expected range.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationAnomalyType getType() {
+ return type;
+ }
+
+ public void setType(TimeseriesAnomalyInvestigationAnomalyType 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 TimeseriesAnomalyInvestigationAnomaly
+ */
+ @JsonAnySetter
+ public TimeseriesAnomalyInvestigationAnomaly 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 TimeseriesAnomalyInvestigationAnomaly object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TimeseriesAnomalyInvestigationAnomaly timeseriesAnomalyInvestigationAnomaly =
+ (TimeseriesAnomalyInvestigationAnomaly) o;
+ return Objects.equals(
+ this.anomalyDetection, timeseriesAnomalyInvestigationAnomaly.anomalyDetection)
+ && Objects.equals(
+ this.detectedInterval, timeseriesAnomalyInvestigationAnomaly.detectedInterval)
+ && Objects.equals(
+ this.displayInterval, timeseriesAnomalyInvestigationAnomaly.displayInterval)
+ && Objects.equals(this.findings, timeseriesAnomalyInvestigationAnomaly.findings)
+ && Objects.equals(
+ this.maximumDeviation, timeseriesAnomalyInvestigationAnomaly.maximumDeviation)
+ && Objects.equals(this.series, timeseriesAnomalyInvestigationAnomaly.series)
+ && Objects.equals(this.tagAnalysis, timeseriesAnomalyInvestigationAnomaly.tagAnalysis)
+ && Objects.equals(this.type, timeseriesAnomalyInvestigationAnomaly.type)
+ && Objects.equals(
+ this.additionalProperties, timeseriesAnomalyInvestigationAnomaly.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ anomalyDetection,
+ detectedInterval,
+ displayInterval,
+ findings,
+ maximumDeviation,
+ series,
+ tagAnalysis,
+ type,
+ additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class TimeseriesAnomalyInvestigationAnomaly {\n");
+ sb.append(" anomalyDetection: ").append(toIndentedString(anomalyDetection)).append("\n");
+ sb.append(" detectedInterval: ").append(toIndentedString(detectedInterval)).append("\n");
+ sb.append(" displayInterval: ").append(toIndentedString(displayInterval)).append("\n");
+ sb.append(" findings: ").append(toIndentedString(findings)).append("\n");
+ sb.append(" maximumDeviation: ").append(toIndentedString(maximumDeviation)).append("\n");
+ sb.append(" series: ").append(toIndentedString(series)).append("\n");
+ sb.append(" tagAnalysis: ").append(toIndentedString(tagAnalysis)).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/TimeseriesAnomalyInvestigationAnomalyFinding.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomalyFinding.java
new file mode 100644
index 00000000000..1e9003c2359
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomalyFinding.java
@@ -0,0 +1,216 @@
+/*
+ * 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;
+
+/**
+ * Finding that describes the anomaly when completed analysis produces no displayable influential
+ * tags.
+ */
+@JsonPropertyOrder({
+ TimeseriesAnomalyInvestigationAnomalyFinding.JSON_PROPERTY_DESCRIPTION,
+ TimeseriesAnomalyInvestigationAnomalyFinding.JSON_PROPERTY_HEADLINE,
+ TimeseriesAnomalyInvestigationAnomalyFinding.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class TimeseriesAnomalyInvestigationAnomalyFinding {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DESCRIPTION = "description";
+ private String description;
+
+ public static final String JSON_PROPERTY_HEADLINE = "headline";
+ private String headline;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private TimeseriesAnomalyInvestigationAnomalyFindingType type;
+
+ public TimeseriesAnomalyInvestigationAnomalyFinding() {}
+
+ @JsonCreator
+ public TimeseriesAnomalyInvestigationAnomalyFinding(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description,
+ @JsonProperty(required = true, value = JSON_PROPERTY_HEADLINE) String headline,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE)
+ TimeseriesAnomalyInvestigationAnomalyFindingType type) {
+ this.description = description;
+ this.headline = headline;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public TimeseriesAnomalyInvestigationAnomalyFinding description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Deterministic explanation of the finding.
+ *
+ * @return description
+ */
+ @JsonProperty(JSON_PROPERTY_DESCRIPTION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public TimeseriesAnomalyInvestigationAnomalyFinding headline(String headline) {
+ this.headline = headline;
+ return this;
+ }
+
+ /**
+ * Concise, deterministic finding title.
+ *
+ * @return headline
+ */
+ @JsonProperty(JSON_PROPERTY_HEADLINE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getHeadline() {
+ return headline;
+ }
+
+ public void setHeadline(String headline) {
+ this.headline = headline;
+ }
+
+ public TimeseriesAnomalyInvestigationAnomalyFinding type(
+ TimeseriesAnomalyInvestigationAnomalyFindingType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Finding category for an anomaly without a displayable influential tag.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationAnomalyFindingType getType() {
+ return type;
+ }
+
+ public void setType(TimeseriesAnomalyInvestigationAnomalyFindingType 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 TimeseriesAnomalyInvestigationAnomalyFinding
+ */
+ @JsonAnySetter
+ public TimeseriesAnomalyInvestigationAnomalyFinding 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 TimeseriesAnomalyInvestigationAnomalyFinding object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TimeseriesAnomalyInvestigationAnomalyFinding timeseriesAnomalyInvestigationAnomalyFinding =
+ (TimeseriesAnomalyInvestigationAnomalyFinding) o;
+ return Objects.equals(
+ this.description, timeseriesAnomalyInvestigationAnomalyFinding.description)
+ && Objects.equals(this.headline, timeseriesAnomalyInvestigationAnomalyFinding.headline)
+ && Objects.equals(this.type, timeseriesAnomalyInvestigationAnomalyFinding.type)
+ && Objects.equals(
+ this.additionalProperties,
+ timeseriesAnomalyInvestigationAnomalyFinding.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(description, headline, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class TimeseriesAnomalyInvestigationAnomalyFinding {\n");
+ sb.append(" description: ").append(toIndentedString(description)).append("\n");
+ sb.append(" headline: ").append(toIndentedString(headline)).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/TimeseriesAnomalyInvestigationAnomalyFindingType.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomalyFindingType.java
new file mode 100644
index 00000000000..26ea1956b84
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomalyFindingType.java
@@ -0,0 +1,62 @@
+/*
+ * 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;
+
+/** Finding category for an anomaly without a displayable influential tag. */
+@JsonSerialize(
+ using =
+ TimeseriesAnomalyInvestigationAnomalyFindingType
+ .TimeseriesAnomalyInvestigationAnomalyFindingTypeSerializer.class)
+public class TimeseriesAnomalyInvestigationAnomalyFindingType extends ModelEnum {
+
+ private static final Set allowedValues = new HashSet(Arrays.asList("anomaly"));
+
+ public static final TimeseriesAnomalyInvestigationAnomalyFindingType ANOMALY =
+ new TimeseriesAnomalyInvestigationAnomalyFindingType("anomaly");
+
+ TimeseriesAnomalyInvestigationAnomalyFindingType(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class TimeseriesAnomalyInvestigationAnomalyFindingTypeSerializer
+ extends StdSerializer {
+ public TimeseriesAnomalyInvestigationAnomalyFindingTypeSerializer(
+ Class t) {
+ super(t);
+ }
+
+ public TimeseriesAnomalyInvestigationAnomalyFindingTypeSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ TimeseriesAnomalyInvestigationAnomalyFindingType value,
+ JsonGenerator jgen,
+ SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static TimeseriesAnomalyInvestigationAnomalyFindingType fromValue(String value) {
+ return new TimeseriesAnomalyInvestigationAnomalyFindingType(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomalyType.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomalyType.java
new file mode 100644
index 00000000000..fbd0f19b9e8
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationAnomalyType.java
@@ -0,0 +1,65 @@
+/*
+ * 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;
+
+/** Direction of an anomaly relative to its expected range. */
+@JsonSerialize(
+ using =
+ TimeseriesAnomalyInvestigationAnomalyType
+ .TimeseriesAnomalyInvestigationAnomalyTypeSerializer.class)
+public class TimeseriesAnomalyInvestigationAnomalyType extends ModelEnum {
+
+ private static final Set allowedValues =
+ new HashSet(Arrays.asList("spike", "dip"));
+
+ public static final TimeseriesAnomalyInvestigationAnomalyType SPIKE =
+ new TimeseriesAnomalyInvestigationAnomalyType("spike");
+ public static final TimeseriesAnomalyInvestigationAnomalyType DIP =
+ new TimeseriesAnomalyInvestigationAnomalyType("dip");
+
+ TimeseriesAnomalyInvestigationAnomalyType(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class TimeseriesAnomalyInvestigationAnomalyTypeSerializer
+ extends StdSerializer {
+ public TimeseriesAnomalyInvestigationAnomalyTypeSerializer(
+ Class t) {
+ super(t);
+ }
+
+ public TimeseriesAnomalyInvestigationAnomalyTypeSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ TimeseriesAnomalyInvestigationAnomalyType value,
+ JsonGenerator jgen,
+ SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static TimeseriesAnomalyInvestigationAnomalyType fromValue(String value) {
+ return new TimeseriesAnomalyInvestigationAnomalyType(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationCompleteStatus.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationCompleteStatus.java
new file mode 100644
index 00000000000..15563260c04
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationCompleteStatus.java
@@ -0,0 +1,62 @@
+/*
+ * 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;
+
+/** Status value indicating successful completion. */
+@JsonSerialize(
+ using =
+ TimeseriesAnomalyInvestigationCompleteStatus
+ .TimeseriesAnomalyInvestigationCompleteStatusSerializer.class)
+public class TimeseriesAnomalyInvestigationCompleteStatus extends ModelEnum {
+
+ private static final Set allowedValues = new HashSet(Arrays.asList("complete"));
+
+ public static final TimeseriesAnomalyInvestigationCompleteStatus COMPLETE =
+ new TimeseriesAnomalyInvestigationCompleteStatus("complete");
+
+ TimeseriesAnomalyInvestigationCompleteStatus(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class TimeseriesAnomalyInvestigationCompleteStatusSerializer
+ extends StdSerializer {
+ public TimeseriesAnomalyInvestigationCompleteStatusSerializer(
+ Class t) {
+ super(t);
+ }
+
+ public TimeseriesAnomalyInvestigationCompleteStatusSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ TimeseriesAnomalyInvestigationCompleteStatus value,
+ JsonGenerator jgen,
+ SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static TimeseriesAnomalyInvestigationCompleteStatus fromValue(String value) {
+ return new TimeseriesAnomalyInvestigationCompleteStatus(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationConfigurationSource.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationConfigurationSource.java
new file mode 100644
index 00000000000..01a74d5c6ec
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationConfigurationSource.java
@@ -0,0 +1,65 @@
+/*
+ * 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;
+
+/** Source of the anomaly detection configuration. */
+@JsonSerialize(
+ using =
+ TimeseriesAnomalyInvestigationConfigurationSource
+ .TimeseriesAnomalyInvestigationConfigurationSourceSerializer.class)
+public class TimeseriesAnomalyInvestigationConfigurationSource extends ModelEnum {
+
+ private static final Set allowedValues =
+ new HashSet(Arrays.asList("request_formula", "watchdog_explains_default"));
+
+ public static final TimeseriesAnomalyInvestigationConfigurationSource REQUEST_FORMULA =
+ new TimeseriesAnomalyInvestigationConfigurationSource("request_formula");
+ public static final TimeseriesAnomalyInvestigationConfigurationSource WATCHDOG_EXPLAINS_DEFAULT =
+ new TimeseriesAnomalyInvestigationConfigurationSource("watchdog_explains_default");
+
+ TimeseriesAnomalyInvestigationConfigurationSource(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class TimeseriesAnomalyInvestigationConfigurationSourceSerializer
+ extends StdSerializer {
+ public TimeseriesAnomalyInvestigationConfigurationSourceSerializer(
+ Class t) {
+ super(t);
+ }
+
+ public TimeseriesAnomalyInvestigationConfigurationSourceSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ TimeseriesAnomalyInvestigationConfigurationSource value,
+ JsonGenerator jgen,
+ SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static TimeseriesAnomalyInvestigationConfigurationSource fromValue(String value) {
+ return new TimeseriesAnomalyInvestigationConfigurationSource(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationDataSource.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationDataSource.java
new file mode 100644
index 00000000000..8fd9b3129f0
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationDataSource.java
@@ -0,0 +1,62 @@
+/*
+ * 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;
+
+/** Data source for an anomaly investigation query. */
+@JsonSerialize(
+ using =
+ TimeseriesAnomalyInvestigationDataSource.TimeseriesAnomalyInvestigationDataSourceSerializer
+ .class)
+public class TimeseriesAnomalyInvestigationDataSource extends ModelEnum {
+
+ private static final Set allowedValues = new HashSet(Arrays.asList("metrics"));
+
+ public static final TimeseriesAnomalyInvestigationDataSource METRICS =
+ new TimeseriesAnomalyInvestigationDataSource("metrics");
+
+ TimeseriesAnomalyInvestigationDataSource(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class TimeseriesAnomalyInvestigationDataSourceSerializer
+ extends StdSerializer {
+ public TimeseriesAnomalyInvestigationDataSourceSerializer(
+ Class t) {
+ super(t);
+ }
+
+ public TimeseriesAnomalyInvestigationDataSourceSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ TimeseriesAnomalyInvestigationDataSource value,
+ JsonGenerator jgen,
+ SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static TimeseriesAnomalyInvestigationDataSource fromValue(String value) {
+ return new TimeseriesAnomalyInvestigationDataSource(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationDetection.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationDetection.java
new file mode 100644
index 00000000000..a8b19025baf
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationDetection.java
@@ -0,0 +1,191 @@
+/*
+ * 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;
+
+/** Anomaly detection configuration used for the result. */
+@JsonPropertyOrder({
+ TimeseriesAnomalyInvestigationDetection.JSON_PROPERTY_CONFIGURATION_SOURCE,
+ TimeseriesAnomalyInvestigationDetection.JSON_PROPERTY_PROFILE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class TimeseriesAnomalyInvestigationDetection {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_CONFIGURATION_SOURCE = "configuration_source";
+ private TimeseriesAnomalyInvestigationConfigurationSource configurationSource;
+
+ public static final String JSON_PROPERTY_PROFILE = "profile";
+ private String profile;
+
+ public TimeseriesAnomalyInvestigationDetection() {}
+
+ @JsonCreator
+ public TimeseriesAnomalyInvestigationDetection(
+ @JsonProperty(required = true, value = JSON_PROPERTY_CONFIGURATION_SOURCE)
+ TimeseriesAnomalyInvestigationConfigurationSource configurationSource,
+ @JsonProperty(required = true, value = JSON_PROPERTY_PROFILE) String profile) {
+ this.configurationSource = configurationSource;
+ this.unparsed |= !configurationSource.isValid();
+ this.profile = profile;
+ if (profile != null) {}
+ }
+
+ public TimeseriesAnomalyInvestigationDetection configurationSource(
+ TimeseriesAnomalyInvestigationConfigurationSource configurationSource) {
+ this.configurationSource = configurationSource;
+ this.unparsed |= !configurationSource.isValid();
+ return this;
+ }
+
+ /**
+ * Source of the anomaly detection configuration.
+ *
+ * @return configurationSource
+ */
+ @JsonProperty(JSON_PROPERTY_CONFIGURATION_SOURCE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public TimeseriesAnomalyInvestigationConfigurationSource getConfigurationSource() {
+ return configurationSource;
+ }
+
+ public void setConfigurationSource(
+ TimeseriesAnomalyInvestigationConfigurationSource configurationSource) {
+ if (!configurationSource.isValid()) {
+ this.unparsed = true;
+ }
+ this.configurationSource = configurationSource;
+ }
+
+ public TimeseriesAnomalyInvestigationDetection profile(String profile) {
+ this.profile = profile;
+ if (profile != null) {}
+ return this;
+ }
+
+ /**
+ * Applied Watchdog Explains profile, or null when the request supplied an explicit
+ * anomalies() formula. The current Watchdog profile is watchdog_explains_v1.
+ *
+ * @return profile
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_PROFILE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getProfile() {
+ return profile;
+ }
+
+ public void setProfile(String profile) {
+ this.profile = profile;
+ }
+
+ /**
+ * 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 TimeseriesAnomalyInvestigationDetection
+ */
+ @JsonAnySetter
+ public TimeseriesAnomalyInvestigationDetection 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 TimeseriesAnomalyInvestigationDetection object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TimeseriesAnomalyInvestigationDetection timeseriesAnomalyInvestigationDetection =
+ (TimeseriesAnomalyInvestigationDetection) o;
+ return Objects.equals(
+ this.configurationSource, timeseriesAnomalyInvestigationDetection.configurationSource)
+ && Objects.equals(this.profile, timeseriesAnomalyInvestigationDetection.profile)
+ && Objects.equals(
+ this.additionalProperties,
+ timeseriesAnomalyInvestigationDetection.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(configurationSource, profile, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class TimeseriesAnomalyInvestigationDetection {\n");
+ sb.append(" configurationSource: ")
+ .append(toIndentedString(configurationSource))
+ .append("\n");
+ sb.append(" profile: ").append(toIndentedString(profile)).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/TimeseriesAnomalyInvestigationFinding.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFinding.java
new file mode 100644
index 00000000000..f952b374649
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFinding.java
@@ -0,0 +1,328 @@
+/*
+ * 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.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 =
+ TimeseriesAnomalyInvestigationFinding.TimeseriesAnomalyInvestigationFindingDeserializer
+ .class)
+@JsonSerialize(
+ using =
+ TimeseriesAnomalyInvestigationFinding.TimeseriesAnomalyInvestigationFindingSerializer.class)
+public class TimeseriesAnomalyInvestigationFinding extends AbstractOpenApiSchema {
+ private static final Logger log =
+ Logger.getLogger(TimeseriesAnomalyInvestigationFinding.class.getName());
+
+ @JsonIgnore public boolean unparsed = false;
+
+ public static class TimeseriesAnomalyInvestigationFindingSerializer
+ extends StdSerializer {
+ public TimeseriesAnomalyInvestigationFindingSerializer(
+ Class t) {
+ super(t);
+ }
+
+ public TimeseriesAnomalyInvestigationFindingSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ TimeseriesAnomalyInvestigationFinding value,
+ JsonGenerator jgen,
+ SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.getActualInstance());
+ }
+ }
+
+ public static class TimeseriesAnomalyInvestigationFindingDeserializer
+ extends StdDeserializer {
+ public TimeseriesAnomalyInvestigationFindingDeserializer() {
+ this(TimeseriesAnomalyInvestigationFinding.class);
+ }
+
+ public TimeseriesAnomalyInvestigationFindingDeserializer(Class> vc) {
+ super(vc);
+ }
+
+ @Override
+ public TimeseriesAnomalyInvestigationFinding 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 TimeseriesAnomalyInvestigationInfluentialTagFinding
+ try {
+ boolean attemptParsing = true;
+ // ensure that we respect type coercion as set on the client ObjectMapper
+ if (TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(Integer.class)
+ || TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(Long.class)
+ || TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(Float.class)
+ || TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(Double.class)
+ || TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(Boolean.class)
+ || TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(String.class)) {
+ attemptParsing = typeCoercion;
+ if (!attemptParsing) {
+ attemptParsing |=
+ ((TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(Integer.class)
+ || TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(
+ Long.class))
+ && token == JsonToken.VALUE_NUMBER_INT);
+ attemptParsing |=
+ ((TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(Float.class)
+ || TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(
+ Double.class))
+ && (token == JsonToken.VALUE_NUMBER_FLOAT
+ || token == JsonToken.VALUE_NUMBER_INT));
+ attemptParsing |=
+ (TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(Boolean.class)
+ && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
+ attemptParsing |=
+ (TimeseriesAnomalyInvestigationInfluentialTagFinding.class.equals(String.class)
+ && token == JsonToken.VALUE_STRING);
+ }
+ }
+ if (attemptParsing) {
+ tmp =
+ tree.traverse(jp.getCodec())
+ .readValueAs(TimeseriesAnomalyInvestigationInfluentialTagFinding.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 (!((TimeseriesAnomalyInvestigationInfluentialTagFinding) tmp).unparsed) {
+ deserialized = tmp;
+ match++;
+ }
+ log.log(
+ Level.FINER,
+ "Input data matches schema 'TimeseriesAnomalyInvestigationInfluentialTagFinding'");
+ }
+ } catch (Exception e) {
+ // deserialization failed, continue
+ log.log(
+ Level.FINER,
+ "Input data does not match schema"
+ + " 'TimeseriesAnomalyInvestigationInfluentialTagFinding'",
+ e);
+ }
+
+ // deserialize TimeseriesAnomalyInvestigationAnomalyFinding
+ try {
+ boolean attemptParsing = true;
+ // ensure that we respect type coercion as set on the client ObjectMapper
+ if (TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Integer.class)
+ || TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Long.class)
+ || TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Float.class)
+ || TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Double.class)
+ || TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Boolean.class)
+ || TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(String.class)) {
+ attemptParsing = typeCoercion;
+ if (!attemptParsing) {
+ attemptParsing |=
+ ((TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Integer.class)
+ || TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Long.class))
+ && token == JsonToken.VALUE_NUMBER_INT);
+ attemptParsing |=
+ ((TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Float.class)
+ || TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Double.class))
+ && (token == JsonToken.VALUE_NUMBER_FLOAT
+ || token == JsonToken.VALUE_NUMBER_INT));
+ attemptParsing |=
+ (TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(Boolean.class)
+ && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
+ attemptParsing |=
+ (TimeseriesAnomalyInvestigationAnomalyFinding.class.equals(String.class)
+ && token == JsonToken.VALUE_STRING);
+ }
+ }
+ if (attemptParsing) {
+ tmp =
+ tree.traverse(jp.getCodec())
+ .readValueAs(TimeseriesAnomalyInvestigationAnomalyFinding.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 (!((TimeseriesAnomalyInvestigationAnomalyFinding) tmp).unparsed) {
+ deserialized = tmp;
+ match++;
+ }
+ log.log(
+ Level.FINER,
+ "Input data matches schema 'TimeseriesAnomalyInvestigationAnomalyFinding'");
+ }
+ } catch (Exception e) {
+ // deserialization failed, continue
+ log.log(
+ Level.FINER,
+ "Input data does not match schema 'TimeseriesAnomalyInvestigationAnomalyFinding'",
+ e);
+ }
+
+ TimeseriesAnomalyInvestigationFinding ret = new TimeseriesAnomalyInvestigationFinding();
+ if (match == 1) {
+ ret.setActualInstance(deserialized);
+ } else {
+ Map res =
+ new ObjectMapper()
+ .readValue(
+ tree.traverse(jp.getCodec()).readValueAsTree().toString(),
+ new TypeReference