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>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public TimeseriesAnomalyInvestigationFinding getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "TimeseriesAnomalyInvestigationFinding cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public TimeseriesAnomalyInvestigationFinding() { + super("oneOf", Boolean.FALSE); + } + + public TimeseriesAnomalyInvestigationFinding( + TimeseriesAnomalyInvestigationInfluentialTagFinding o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public TimeseriesAnomalyInvestigationFinding(TimeseriesAnomalyInvestigationAnomalyFinding o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "TimeseriesAnomalyInvestigationInfluentialTagFinding", + new GenericType() {}); + schemas.put( + "TimeseriesAnomalyInvestigationAnomalyFinding", + new GenericType() {}); + JSON.registerDescendants( + TimeseriesAnomalyInvestigationFinding.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return TimeseriesAnomalyInvestigationFinding.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: TimeseriesAnomalyInvestigationInfluentialTagFinding, + * TimeseriesAnomalyInvestigationAnomalyFinding + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + TimeseriesAnomalyInvestigationInfluentialTagFinding.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + TimeseriesAnomalyInvestigationAnomalyFinding.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be TimeseriesAnomalyInvestigationInfluentialTagFinding," + + " TimeseriesAnomalyInvestigationAnomalyFinding"); + } + + /** + * Get the actual instance, which can be the following: + * TimeseriesAnomalyInvestigationInfluentialTagFinding, + * TimeseriesAnomalyInvestigationAnomalyFinding + * + * @return The actual instance (TimeseriesAnomalyInvestigationInfluentialTagFinding, + * TimeseriesAnomalyInvestigationAnomalyFinding) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `TimeseriesAnomalyInvestigationInfluentialTagFinding`. If the actual + * instance is not `TimeseriesAnomalyInvestigationInfluentialTagFinding`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `TimeseriesAnomalyInvestigationInfluentialTagFinding` + * @throws ClassCastException if the instance is not + * `TimeseriesAnomalyInvestigationInfluentialTagFinding` + */ + public TimeseriesAnomalyInvestigationInfluentialTagFinding + getTimeseriesAnomalyInvestigationInfluentialTagFinding() throws ClassCastException { + return (TimeseriesAnomalyInvestigationInfluentialTagFinding) super.getActualInstance(); + } + + /** + * Get the actual instance of `TimeseriesAnomalyInvestigationAnomalyFinding`. If the actual + * instance is not `TimeseriesAnomalyInvestigationAnomalyFinding`, the ClassCastException will be + * thrown. + * + * @return The actual instance of `TimeseriesAnomalyInvestigationAnomalyFinding` + * @throws ClassCastException if the instance is not + * `TimeseriesAnomalyInvestigationAnomalyFinding` + */ + public TimeseriesAnomalyInvestigationAnomalyFinding + getTimeseriesAnomalyInvestigationAnomalyFinding() throws ClassCastException { + return (TimeseriesAnomalyInvestigationAnomalyFinding) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFindingSynonym.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFindingSynonym.java new file mode 100644 index 00000000000..7ac707c3dc7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFindingSynonym.java @@ -0,0 +1,184 @@ +/* + * 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; + +/** Tag grouped under an influential tag by synonym analysis. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationFindingSynonym.JSON_PROPERTY_KEY, + TimeseriesAnomalyInvestigationFindingSynonym.JSON_PROPERTY_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationFindingSynonym { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = new ArrayList<>(); + + public TimeseriesAnomalyInvestigationFindingSynonym() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationFindingSynonym( + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUES) List values) { + this.key = key; + this.values = values; + } + + public TimeseriesAnomalyInvestigationFindingSynonym key(String key) { + this.key = key; + return this; + } + + /** + * Synonymous tag key. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public TimeseriesAnomalyInvestigationFindingSynonym values(List values) { + this.values = values; + return this; + } + + public TimeseriesAnomalyInvestigationFindingSynonym addValuesItem(String valuesItem) { + this.values.add(valuesItem); + return this; + } + + /** + * Values associated with the synonymous tag. + * + * @return values + */ + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + /** + * 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 TimeseriesAnomalyInvestigationFindingSynonym + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationFindingSynonym 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 TimeseriesAnomalyInvestigationFindingSynonym object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationFindingSynonym timeseriesAnomalyInvestigationFindingSynonym = + (TimeseriesAnomalyInvestigationFindingSynonym) o; + return Objects.equals(this.key, timeseriesAnomalyInvestigationFindingSynonym.key) + && Objects.equals(this.values, timeseriesAnomalyInvestigationFindingSynonym.values) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationFindingSynonym.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationFindingSynonym {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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/TimeseriesAnomalyInvestigationFindingTag.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFindingTag.java new file mode 100644 index 00000000000..c56ced2b1aa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFindingTag.java @@ -0,0 +1,295 @@ +/* + * 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; + +/** Structured tag evidence for an influential-tag finding. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationFindingTag.JSON_PROPERTY_INFLUENCE_TYPE, + TimeseriesAnomalyInvestigationFindingTag.JSON_PROPERTY_KEY, + TimeseriesAnomalyInvestigationFindingTag.JSON_PROPERTY_RATING, + TimeseriesAnomalyInvestigationFindingTag.JSON_PROPERTY_SYNONYMS, + TimeseriesAnomalyInvestigationFindingTag.JSON_PROPERTY_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationFindingTag { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INFLUENCE_TYPE = "influence_type"; + private TimeseriesAnomalyInvestigationInfluenceType influenceType; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_RATING = "rating"; + private Double rating; + + public static final String JSON_PROPERTY_SYNONYMS = "synonyms"; + private List synonyms = new ArrayList<>(); + + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = new ArrayList<>(); + + public TimeseriesAnomalyInvestigationFindingTag() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationFindingTag( + @JsonProperty(required = true, value = JSON_PROPERTY_INFLUENCE_TYPE) + TimeseriesAnomalyInvestigationInfluenceType influenceType, + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key, + @JsonProperty(required = true, value = JSON_PROPERTY_RATING) Double rating, + @JsonProperty(required = true, value = JSON_PROPERTY_SYNONYMS) + List synonyms, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUES) List values) { + this.influenceType = influenceType; + this.unparsed |= !influenceType.isValid(); + this.key = key; + this.rating = rating; + this.synonyms = synonyms; + for (TimeseriesAnomalyInvestigationFindingSynonym item : synonyms) { + this.unparsed |= item.unparsed; + } + this.values = values; + } + + public TimeseriesAnomalyInvestigationFindingTag influenceType( + TimeseriesAnomalyInvestigationInfluenceType influenceType) { + this.influenceType = influenceType; + this.unparsed |= !influenceType.isValid(); + return this; + } + + /** + * Kind of influence a tag has on a series. + * + * @return influenceType + */ + @JsonProperty(JSON_PROPERTY_INFLUENCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationInfluenceType getInfluenceType() { + return influenceType; + } + + public void setInfluenceType(TimeseriesAnomalyInvestigationInfluenceType influenceType) { + if (!influenceType.isValid()) { + this.unparsed = true; + } + this.influenceType = influenceType; + } + + public TimeseriesAnomalyInvestigationFindingTag key(String key) { + this.key = key; + return this; + } + + /** + * Influential tag key. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public TimeseriesAnomalyInvestigationFindingTag rating(Double rating) { + this.rating = rating; + return this; + } + + /** + * Influence rating from 1 through 5. minimum: 1 maximum: 5 + * + * @return rating + */ + @JsonProperty(JSON_PROPERTY_RATING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getRating() { + return rating; + } + + public void setRating(Double rating) { + this.rating = rating; + } + + public TimeseriesAnomalyInvestigationFindingTag synonyms( + List synonyms) { + this.synonyms = synonyms; + for (TimeseriesAnomalyInvestigationFindingSynonym item : synonyms) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TimeseriesAnomalyInvestigationFindingTag addSynonymsItem( + TimeseriesAnomalyInvestigationFindingSynonym synonymsItem) { + this.synonyms.add(synonymsItem); + this.unparsed |= synonymsItem.unparsed; + return this; + } + + /** + * Tags grouped with this tag by Variation of Influence synonym analysis. + * + * @return synonyms + */ + @JsonProperty(JSON_PROPERTY_SYNONYMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSynonyms() { + return synonyms; + } + + public void setSynonyms(List synonyms) { + this.synonyms = synonyms; + if (synonyms != null) { + for (TimeseriesAnomalyInvestigationFindingSynonym item : synonyms) { + this.unparsed |= item.unparsed; + } + } + } + + public TimeseriesAnomalyInvestigationFindingTag values(List values) { + this.values = values; + return this; + } + + public TimeseriesAnomalyInvestigationFindingTag addValuesItem(String valuesItem) { + this.values.add(valuesItem); + return this; + } + + /** + * Influential values for the tag key. + * + * @return values + */ + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + /** + * 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 TimeseriesAnomalyInvestigationFindingTag + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationFindingTag 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 TimeseriesAnomalyInvestigationFindingTag object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationFindingTag timeseriesAnomalyInvestigationFindingTag = + (TimeseriesAnomalyInvestigationFindingTag) o; + return Objects.equals( + this.influenceType, timeseriesAnomalyInvestigationFindingTag.influenceType) + && Objects.equals(this.key, timeseriesAnomalyInvestigationFindingTag.key) + && Objects.equals(this.rating, timeseriesAnomalyInvestigationFindingTag.rating) + && Objects.equals(this.synonyms, timeseriesAnomalyInvestigationFindingTag.synonyms) + && Objects.equals(this.values, timeseriesAnomalyInvestigationFindingTag.values) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationFindingTag.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(influenceType, key, rating, synonyms, values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationFindingTag {\n"); + sb.append(" influenceType: ").append(toIndentedString(influenceType)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" rating: ").append(toIndentedString(rating)).append("\n"); + sb.append(" synonyms: ").append(toIndentedString(synonyms)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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/TimeseriesAnomalyInvestigationFormula.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFormula.java new file mode 100644 index 00000000000..278034f8adc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFormula.java @@ -0,0 +1,180 @@ +/* + * 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; + +/** Formula evaluated by the timeseries request. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationFormula.JSON_PROPERTY_FORMULA, + TimeseriesAnomalyInvestigationFormula.JSON_PROPERTY_LIMIT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationFormula { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FORMULA = "formula"; + private String formula; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private TimeseriesAnomalyInvestigationFormulaLimit limit; + + public TimeseriesAnomalyInvestigationFormula() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationFormula( + @JsonProperty(required = true, value = JSON_PROPERTY_FORMULA) String formula) { + this.formula = formula; + } + + public TimeseriesAnomalyInvestigationFormula formula(String formula) { + this.formula = formula; + return this; + } + + /** + * Formula expression referencing one or more named queries. + * + * @return formula + */ + @JsonProperty(JSON_PROPERTY_FORMULA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFormula() { + return formula; + } + + public void setFormula(String formula) { + this.formula = formula; + } + + public TimeseriesAnomalyInvestigationFormula limit( + TimeseriesAnomalyInvestigationFormulaLimit limit) { + this.limit = limit; + this.unparsed |= limit.unparsed; + return this; + } + + /** + * Optional formula limit accepted for compatibility with Timeseries API requests. Formula limits + * have no effect on timeseries queries. + * + * @return limit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TimeseriesAnomalyInvestigationFormulaLimit getLimit() { + return limit; + } + + public void setLimit(TimeseriesAnomalyInvestigationFormulaLimit limit) { + this.limit = limit; + if (limit != null) { + this.unparsed |= limit.unparsed; + } + } + + /** + * 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 TimeseriesAnomalyInvestigationFormula + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationFormula 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 TimeseriesAnomalyInvestigationFormula object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationFormula timeseriesAnomalyInvestigationFormula = + (TimeseriesAnomalyInvestigationFormula) o; + return Objects.equals(this.formula, timeseriesAnomalyInvestigationFormula.formula) + && Objects.equals(this.limit, timeseriesAnomalyInvestigationFormula.limit) + && Objects.equals( + this.additionalProperties, timeseriesAnomalyInvestigationFormula.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(formula, limit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationFormula {\n"); + sb.append(" formula: ").append(toIndentedString(formula)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).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/TimeseriesAnomalyInvestigationFormulaLimit.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFormulaLimit.java new file mode 100644 index 00000000000..7664a32ffca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFormulaLimit.java @@ -0,0 +1,177 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Optional formula limit accepted for compatibility with Timeseries API requests. Formula limits + * have no effect on timeseries queries. + */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationFormulaLimit.JSON_PROPERTY_COUNT, + TimeseriesAnomalyInvestigationFormulaLimit.JSON_PROPERTY_ORDER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationFormulaLimit { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_ORDER = "order"; + private TimeseriesAnomalyInvestigationFormulaLimitOrder order; + + public TimeseriesAnomalyInvestigationFormulaLimit count(Long count) { + this.count = count; + return this; + } + + /** + * Requested result limit. This field has no effect on a timeseries anomaly investigation. + * minimum: 0 + * + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public TimeseriesAnomalyInvestigationFormulaLimit order( + TimeseriesAnomalyInvestigationFormulaLimitOrder order) { + this.order = order; + this.unparsed |= !order.isValid(); + return this; + } + + /** + * Sort order used when applying a formula series limit. + * + * @return order + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TimeseriesAnomalyInvestigationFormulaLimitOrder getOrder() { + return order; + } + + public void setOrder(TimeseriesAnomalyInvestigationFormulaLimitOrder order) { + if (!order.isValid()) { + this.unparsed = true; + } + this.order = order; + } + + /** + * 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 TimeseriesAnomalyInvestigationFormulaLimit + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationFormulaLimit 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 TimeseriesAnomalyInvestigationFormulaLimit object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationFormulaLimit timeseriesAnomalyInvestigationFormulaLimit = + (TimeseriesAnomalyInvestigationFormulaLimit) o; + return Objects.equals(this.count, timeseriesAnomalyInvestigationFormulaLimit.count) + && Objects.equals(this.order, timeseriesAnomalyInvestigationFormulaLimit.order) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationFormulaLimit.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, order, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationFormulaLimit {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" order: ").append(toIndentedString(order)).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/TimeseriesAnomalyInvestigationFormulaLimitOrder.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFormulaLimitOrder.java new file mode 100644 index 00000000000..f44a663b9da --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationFormulaLimitOrder.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; + +/** Sort order used when applying a formula series limit. */ +@JsonSerialize( + using = + TimeseriesAnomalyInvestigationFormulaLimitOrder + .TimeseriesAnomalyInvestigationFormulaLimitOrderSerializer.class) +public class TimeseriesAnomalyInvestigationFormulaLimitOrder extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("asc", "desc")); + + public static final TimeseriesAnomalyInvestigationFormulaLimitOrder ASC = + new TimeseriesAnomalyInvestigationFormulaLimitOrder("asc"); + public static final TimeseriesAnomalyInvestigationFormulaLimitOrder DESC = + new TimeseriesAnomalyInvestigationFormulaLimitOrder("desc"); + + TimeseriesAnomalyInvestigationFormulaLimitOrder(String value) { + super(value, allowedValues); + } + + public static class TimeseriesAnomalyInvestigationFormulaLimitOrderSerializer + extends StdSerializer { + public TimeseriesAnomalyInvestigationFormulaLimitOrderSerializer( + Class t) { + super(t); + } + + public TimeseriesAnomalyInvestigationFormulaLimitOrderSerializer() { + this(null); + } + + @Override + public void serialize( + TimeseriesAnomalyInvestigationFormulaLimitOrder value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimeseriesAnomalyInvestigationFormulaLimitOrder fromValue(String value) { + return new TimeseriesAnomalyInvestigationFormulaLimitOrder(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInfluenceType.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInfluenceType.java new file mode 100644 index 00000000000..32c9275780d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInfluenceType.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; + +/** Kind of influence a tag has on a series. */ +@JsonSerialize( + using = + TimeseriesAnomalyInvestigationInfluenceType + .TimeseriesAnomalyInvestigationInfluenceTypeSerializer.class) +public class TimeseriesAnomalyInvestigationInfluenceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("shape", "value")); + + public static final TimeseriesAnomalyInvestigationInfluenceType SHAPE = + new TimeseriesAnomalyInvestigationInfluenceType("shape"); + public static final TimeseriesAnomalyInvestigationInfluenceType VALUE = + new TimeseriesAnomalyInvestigationInfluenceType("value"); + + TimeseriesAnomalyInvestigationInfluenceType(String value) { + super(value, allowedValues); + } + + public static class TimeseriesAnomalyInvestigationInfluenceTypeSerializer + extends StdSerializer { + public TimeseriesAnomalyInvestigationInfluenceTypeSerializer( + Class t) { + super(t); + } + + public TimeseriesAnomalyInvestigationInfluenceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TimeseriesAnomalyInvestigationInfluenceType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimeseriesAnomalyInvestigationInfluenceType fromValue(String value) { + return new TimeseriesAnomalyInvestigationInfluenceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInfluentialTagFinding.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInfluentialTagFinding.java new file mode 100644 index 00000000000..34d350949d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInfluentialTagFinding.java @@ -0,0 +1,252 @@ +/* + * 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 attributes an anomaly to an influential tag. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationInfluentialTagFinding.JSON_PROPERTY_DESCRIPTION, + TimeseriesAnomalyInvestigationInfluentialTagFinding.JSON_PROPERTY_HEADLINE, + TimeseriesAnomalyInvestigationInfluentialTagFinding.JSON_PROPERTY_TAG, + TimeseriesAnomalyInvestigationInfluentialTagFinding.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationInfluentialTagFinding { + @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_TAG = "tag"; + private TimeseriesAnomalyInvestigationFindingTag tag; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TimeseriesAnomalyInvestigationInfluentialTagFindingType type; + + public TimeseriesAnomalyInvestigationInfluentialTagFinding() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationInfluentialTagFinding( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_HEADLINE) String headline, + @JsonProperty(required = true, value = JSON_PROPERTY_TAG) + TimeseriesAnomalyInvestigationFindingTag tag, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TimeseriesAnomalyInvestigationInfluentialTagFindingType type) { + this.description = description; + this.headline = headline; + this.tag = tag; + this.unparsed |= tag.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TimeseriesAnomalyInvestigationInfluentialTagFinding 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 TimeseriesAnomalyInvestigationInfluentialTagFinding 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 TimeseriesAnomalyInvestigationInfluentialTagFinding tag( + TimeseriesAnomalyInvestigationFindingTag tag) { + this.tag = tag; + this.unparsed |= tag.unparsed; + return this; + } + + /** + * Structured tag evidence for an influential-tag finding. + * + * @return tag + */ + @JsonProperty(JSON_PROPERTY_TAG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationFindingTag getTag() { + return tag; + } + + public void setTag(TimeseriesAnomalyInvestigationFindingTag tag) { + this.tag = tag; + if (tag != null) { + this.unparsed |= tag.unparsed; + } + } + + public TimeseriesAnomalyInvestigationInfluentialTagFinding type( + TimeseriesAnomalyInvestigationInfluentialTagFindingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Finding category for an influential tag. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationInfluentialTagFindingType getType() { + return type; + } + + public void setType(TimeseriesAnomalyInvestigationInfluentialTagFindingType 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 TimeseriesAnomalyInvestigationInfluentialTagFinding + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationInfluentialTagFinding 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 TimeseriesAnomalyInvestigationInfluentialTagFinding object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationInfluentialTagFinding + timeseriesAnomalyInvestigationInfluentialTagFinding = + (TimeseriesAnomalyInvestigationInfluentialTagFinding) o; + return Objects.equals( + this.description, timeseriesAnomalyInvestigationInfluentialTagFinding.description) + && Objects.equals( + this.headline, timeseriesAnomalyInvestigationInfluentialTagFinding.headline) + && Objects.equals(this.tag, timeseriesAnomalyInvestigationInfluentialTagFinding.tag) + && Objects.equals(this.type, timeseriesAnomalyInvestigationInfluentialTagFinding.type) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationInfluentialTagFinding.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, headline, tag, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationInfluentialTagFinding {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" headline: ").append(toIndentedString(headline)).append("\n"); + sb.append(" tag: ").append(toIndentedString(tag)).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/TimeseriesAnomalyInvestigationInfluentialTagFindingType.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInfluentialTagFindingType.java new file mode 100644 index 00000000000..c7b3034ba9d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInfluentialTagFindingType.java @@ -0,0 +1,63 @@ +/* + * 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 influential tag. */ +@JsonSerialize( + using = + TimeseriesAnomalyInvestigationInfluentialTagFindingType + .TimeseriesAnomalyInvestigationInfluentialTagFindingTypeSerializer.class) +public class TimeseriesAnomalyInvestigationInfluentialTagFindingType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("influential_tag")); + + public static final TimeseriesAnomalyInvestigationInfluentialTagFindingType INFLUENTIAL_TAG = + new TimeseriesAnomalyInvestigationInfluentialTagFindingType("influential_tag"); + + TimeseriesAnomalyInvestigationInfluentialTagFindingType(String value) { + super(value, allowedValues); + } + + public static class TimeseriesAnomalyInvestigationInfluentialTagFindingTypeSerializer + extends StdSerializer { + public TimeseriesAnomalyInvestigationInfluentialTagFindingTypeSerializer( + Class t) { + super(t); + } + + public TimeseriesAnomalyInvestigationInfluentialTagFindingTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TimeseriesAnomalyInvestigationInfluentialTagFindingType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimeseriesAnomalyInvestigationInfluentialTagFindingType fromValue(String value) { + return new TimeseriesAnomalyInvestigationInfluentialTagFindingType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInterval.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInterval.java new file mode 100644 index 00000000000..407d971516e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationInterval.java @@ -0,0 +1,175 @@ +/* + * 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; + +/** Half-open time interval in milliseconds since the Unix epoch. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationInterval.JSON_PROPERTY_END, + TimeseriesAnomalyInvestigationInterval.JSON_PROPERTY_START +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationInterval { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END = "end"; + private Long end; + + public static final String JSON_PROPERTY_START = "start"; + private Long start; + + public TimeseriesAnomalyInvestigationInterval() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationInterval( + @JsonProperty(required = true, value = JSON_PROPERTY_END) Long end, + @JsonProperty(required = true, value = JSON_PROPERTY_START) Long start) { + this.end = end; + this.start = start; + } + + public TimeseriesAnomalyInvestigationInterval end(Long end) { + this.end = end; + return this; + } + + /** + * Exclusive end of the interval. + * + * @return end + */ + @JsonProperty(JSON_PROPERTY_END) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getEnd() { + return end; + } + + public void setEnd(Long end) { + this.end = end; + } + + public TimeseriesAnomalyInvestigationInterval start(Long start) { + this.start = start; + return this; + } + + /** + * Inclusive start of the interval. + * + * @return start + */ + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getStart() { + return start; + } + + public void setStart(Long start) { + this.start = start; + } + + /** + * 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 TimeseriesAnomalyInvestigationInterval + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationInterval 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 TimeseriesAnomalyInvestigationInterval object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationInterval timeseriesAnomalyInvestigationInterval = + (TimeseriesAnomalyInvestigationInterval) o; + return Objects.equals(this.end, timeseriesAnomalyInvestigationInterval.end) + && Objects.equals(this.start, timeseriesAnomalyInvestigationInterval.start) + && Objects.equals( + this.additionalProperties, timeseriesAnomalyInvestigationInterval.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(end, start, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationInterval {\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" start: ").append(toIndentedString(start)).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/TimeseriesAnomalyInvestigationMaximumDeviation.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationMaximumDeviation.java new file mode 100644 index 00000000000..d6c0bad6ab2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationMaximumDeviation.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** Most anomalous point within the detected interval. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationMaximumDeviation.JSON_PROPERTY_DELTA_FROM_BOUNDARY, + TimeseriesAnomalyInvestigationMaximumDeviation.JSON_PROPERTY_TIMESTAMP, + TimeseriesAnomalyInvestigationMaximumDeviation.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationMaximumDeviation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DELTA_FROM_BOUNDARY = "delta_from_boundary"; + private Double deltaFromBoundary; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private Long timestamp; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Double value; + + public TimeseriesAnomalyInvestigationMaximumDeviation() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationMaximumDeviation( + @JsonProperty(required = true, value = JSON_PROPERTY_DELTA_FROM_BOUNDARY) + Double deltaFromBoundary, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMESTAMP) Long timestamp, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Double value) { + this.deltaFromBoundary = deltaFromBoundary; + this.timestamp = timestamp; + this.value = value; + } + + public TimeseriesAnomalyInvestigationMaximumDeviation deltaFromBoundary( + Double deltaFromBoundary) { + this.deltaFromBoundary = deltaFromBoundary; + return this; + } + + /** + * Absolute distance between the observed value and the nearest anomaly boundary. minimum: 0 + * + * @return deltaFromBoundary + */ + @JsonProperty(JSON_PROPERTY_DELTA_FROM_BOUNDARY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getDeltaFromBoundary() { + return deltaFromBoundary; + } + + public void setDeltaFromBoundary(Double deltaFromBoundary) { + this.deltaFromBoundary = deltaFromBoundary; + } + + public TimeseriesAnomalyInvestigationMaximumDeviation timestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Point timestamp in milliseconds since the Unix epoch. + * + * @return timestamp + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(Long timestamp) { + this.timestamp = timestamp; + } + + public TimeseriesAnomalyInvestigationMaximumDeviation value(Double value) { + this.value = value; + return this; + } + + /** + * Observed value at the point. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getValue() { + return value; + } + + public void setValue(Double value) { + this.value = value; + } + + /** + * 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 TimeseriesAnomalyInvestigationMaximumDeviation + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationMaximumDeviation 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 TimeseriesAnomalyInvestigationMaximumDeviation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationMaximumDeviation timeseriesAnomalyInvestigationMaximumDeviation = + (TimeseriesAnomalyInvestigationMaximumDeviation) o; + return Objects.equals( + this.deltaFromBoundary, + timeseriesAnomalyInvestigationMaximumDeviation.deltaFromBoundary) + && Objects.equals(this.timestamp, timeseriesAnomalyInvestigationMaximumDeviation.timestamp) + && Objects.equals(this.value, timeseriesAnomalyInvestigationMaximumDeviation.value) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationMaximumDeviation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deltaFromBoundary, timestamp, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationMaximumDeviation {\n"); + sb.append(" deltaFromBoundary: ").append(toIndentedString(deltaFromBoundary)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/TimeseriesAnomalyInvestigationMetaType.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationMetaType.java new file mode 100644 index 00000000000..6ad387863d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationMetaType.java @@ -0,0 +1,63 @@ +/* + * 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; + +/** Response metadata type for a timeseries anomaly investigation. */ +@JsonSerialize( + using = + TimeseriesAnomalyInvestigationMetaType.TimeseriesAnomalyInvestigationMetaTypeSerializer + .class) +public class TimeseriesAnomalyInvestigationMetaType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("timeseries_anomaly_investigation")); + + public static final TimeseriesAnomalyInvestigationMetaType TIMESERIES_ANOMALY_INVESTIGATION = + new TimeseriesAnomalyInvestigationMetaType("timeseries_anomaly_investigation"); + + TimeseriesAnomalyInvestigationMetaType(String value) { + super(value, allowedValues); + } + + public static class TimeseriesAnomalyInvestigationMetaTypeSerializer + extends StdSerializer { + public TimeseriesAnomalyInvestigationMetaTypeSerializer( + Class t) { + super(t); + } + + public TimeseriesAnomalyInvestigationMetaTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TimeseriesAnomalyInvestigationMetaType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimeseriesAnomalyInvestigationMetaType fromValue(String value) { + return new TimeseriesAnomalyInvestigationMetaType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationMetricQuery.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationMetricQuery.java new file mode 100644 index 00000000000..186c4917bde --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationMetricQuery.java @@ -0,0 +1,279 @@ +/* + * 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; + +/** Metrics query referenced by a formula. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationMetricQuery.JSON_PROPERTY_AGGREGATOR, + TimeseriesAnomalyInvestigationMetricQuery.JSON_PROPERTY_CROSS_ORG_UUIDS, + TimeseriesAnomalyInvestigationMetricQuery.JSON_PROPERTY_DATA_SOURCE, + TimeseriesAnomalyInvestigationMetricQuery.JSON_PROPERTY_NAME, + TimeseriesAnomalyInvestigationMetricQuery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationMetricQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATOR = "aggregator"; + private String aggregator; + + public static final String JSON_PROPERTY_CROSS_ORG_UUIDS = "cross_org_uuids"; + private List crossOrgUuids = null; + + public static final String JSON_PROPERTY_DATA_SOURCE = "data_source"; + private TimeseriesAnomalyInvestigationDataSource dataSource; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public TimeseriesAnomalyInvestigationMetricQuery() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationMetricQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE) + TimeseriesAnomalyInvestigationDataSource dataSource, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + this.name = name; + this.query = query; + } + + public TimeseriesAnomalyInvestigationMetricQuery aggregator(String aggregator) { + this.aggregator = aggregator; + return this; + } + + /** + * Optional scalar aggregator accepted for request compatibility. This field is ignored for + * timeseries queries. + * + * @return aggregator + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AGGREGATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAggregator() { + return aggregator; + } + + public void setAggregator(String aggregator) { + this.aggregator = aggregator; + } + + public TimeseriesAnomalyInvestigationMetricQuery crossOrgUuids(List crossOrgUuids) { + this.crossOrgUuids = crossOrgUuids; + return this; + } + + public TimeseriesAnomalyInvestigationMetricQuery addCrossOrgUuidsItem(String crossOrgUuidsItem) { + if (this.crossOrgUuids == null) { + this.crossOrgUuids = new ArrayList<>(); + } + this.crossOrgUuids.add(crossOrgUuidsItem); + return this; + } + + /** + * 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. + * + * @return crossOrgUuids + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_ORG_UUIDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCrossOrgUuids() { + return crossOrgUuids; + } + + public void setCrossOrgUuids(List crossOrgUuids) { + this.crossOrgUuids = crossOrgUuids; + } + + public TimeseriesAnomalyInvestigationMetricQuery dataSource( + TimeseriesAnomalyInvestigationDataSource dataSource) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + return this; + } + + /** + * Data source for an anomaly investigation query. + * + * @return dataSource + */ + @JsonProperty(JSON_PROPERTY_DATA_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationDataSource getDataSource() { + return dataSource; + } + + public void setDataSource(TimeseriesAnomalyInvestigationDataSource dataSource) { + if (!dataSource.isValid()) { + this.unparsed = true; + } + this.dataSource = dataSource; + } + + public TimeseriesAnomalyInvestigationMetricQuery name(String name) { + this.name = name; + return this; + } + + /** + * Name used to reference this query from formulas. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TimeseriesAnomalyInvestigationMetricQuery query(String query) { + this.query = query; + return this; + } + + /** + * Datadog metrics query expression. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * 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 TimeseriesAnomalyInvestigationMetricQuery + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationMetricQuery 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 TimeseriesAnomalyInvestigationMetricQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationMetricQuery timeseriesAnomalyInvestigationMetricQuery = + (TimeseriesAnomalyInvestigationMetricQuery) o; + return Objects.equals(this.aggregator, timeseriesAnomalyInvestigationMetricQuery.aggregator) + && Objects.equals( + this.crossOrgUuids, timeseriesAnomalyInvestigationMetricQuery.crossOrgUuids) + && Objects.equals(this.dataSource, timeseriesAnomalyInvestigationMetricQuery.dataSource) + && Objects.equals(this.name, timeseriesAnomalyInvestigationMetricQuery.name) + && Objects.equals(this.query, timeseriesAnomalyInvestigationMetricQuery.query) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationMetricQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregator, crossOrgUuids, dataSource, name, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationMetricQuery {\n"); + sb.append(" aggregator: ").append(toIndentedString(aggregator)).append("\n"); + sb.append(" crossOrgUuids: ").append(toIndentedString(crossOrgUuids)).append("\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/TimeseriesAnomalyInvestigationQueryExecutionStatus.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationQueryExecutionStatus.java new file mode 100644 index 00000000000..b605db640e4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationQueryExecutionStatus.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; + +/** Current execution status for a named query. */ +@JsonSerialize( + using = + TimeseriesAnomalyInvestigationQueryExecutionStatus + .TimeseriesAnomalyInvestigationQueryExecutionStatusSerializer.class) +public class TimeseriesAnomalyInvestigationQueryExecutionStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("running", "done")); + + public static final TimeseriesAnomalyInvestigationQueryExecutionStatus RUNNING = + new TimeseriesAnomalyInvestigationQueryExecutionStatus("running"); + public static final TimeseriesAnomalyInvestigationQueryExecutionStatus DONE = + new TimeseriesAnomalyInvestigationQueryExecutionStatus("done"); + + TimeseriesAnomalyInvestigationQueryExecutionStatus(String value) { + super(value, allowedValues); + } + + public static class TimeseriesAnomalyInvestigationQueryExecutionStatusSerializer + extends StdSerializer { + public TimeseriesAnomalyInvestigationQueryExecutionStatusSerializer( + Class t) { + super(t); + } + + public TimeseriesAnomalyInvestigationQueryExecutionStatusSerializer() { + this(null); + } + + @Override + public void serialize( + TimeseriesAnomalyInvestigationQueryExecutionStatus value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimeseriesAnomalyInvestigationQueryExecutionStatus fromValue(String value) { + return new TimeseriesAnomalyInvestigationQueryExecutionStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationQueryStatus.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationQueryStatus.java new file mode 100644 index 00000000000..a6628d4fa87 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationQueryStatus.java @@ -0,0 +1,183 @@ +/* + * 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; + +/** Execution status for one named query. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationQueryStatus.JSON_PROPERTY_NAME, + TimeseriesAnomalyInvestigationQueryStatus.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationQueryStatus { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_STATUS = "status"; + private TimeseriesAnomalyInvestigationQueryExecutionStatus status; + + public TimeseriesAnomalyInvestigationQueryStatus() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationQueryStatus( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + TimeseriesAnomalyInvestigationQueryExecutionStatus status) { + this.name = name; + this.status = status; + this.unparsed |= !status.isValid(); + } + + public TimeseriesAnomalyInvestigationQueryStatus name(String name) { + this.name = name; + return this; + } + + /** + * Query name from the request. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TimeseriesAnomalyInvestigationQueryStatus status( + TimeseriesAnomalyInvestigationQueryExecutionStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Current execution status for a named query. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationQueryExecutionStatus getStatus() { + return status; + } + + public void setStatus(TimeseriesAnomalyInvestigationQueryExecutionStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * 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 TimeseriesAnomalyInvestigationQueryStatus + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationQueryStatus 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 TimeseriesAnomalyInvestigationQueryStatus object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationQueryStatus timeseriesAnomalyInvestigationQueryStatus = + (TimeseriesAnomalyInvestigationQueryStatus) o; + return Objects.equals(this.name, timeseriesAnomalyInvestigationQueryStatus.name) + && Objects.equals(this.status, timeseriesAnomalyInvestigationQueryStatus.status) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationQueryStatus.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationQueryStatus {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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/TimeseriesAnomalyInvestigationRequest.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationRequest.java new file mode 100644 index 00000000000..8c2ed6e42b1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationRequest.java @@ -0,0 +1,152 @@ +/* + * 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; + +/** Request to investigate a metrics timeseries for anomalies. */ +@JsonPropertyOrder({TimeseriesAnomalyInvestigationRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TimeseriesAnomalyInvestigationRequestData data; + + public TimeseriesAnomalyInvestigationRequest() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TimeseriesAnomalyInvestigationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TimeseriesAnomalyInvestigationRequest data( + TimeseriesAnomalyInvestigationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * JSON:API resource containing an anomaly investigation request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationRequestData getData() { + return data; + } + + public void setData(TimeseriesAnomalyInvestigationRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 TimeseriesAnomalyInvestigationRequest + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationRequest 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 TimeseriesAnomalyInvestigationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationRequest timeseriesAnomalyInvestigationRequest = + (TimeseriesAnomalyInvestigationRequest) o; + return Objects.equals(this.data, timeseriesAnomalyInvestigationRequest.data) + && Objects.equals( + this.additionalProperties, timeseriesAnomalyInvestigationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/TimeseriesAnomalyInvestigationRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationRequestAttributes.java new file mode 100644 index 00000000000..f499872bfbc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationRequestAttributes.java @@ -0,0 +1,170 @@ +/* + * 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; + +/** Attributes of an anomaly investigation request. */ +@JsonPropertyOrder({TimeseriesAnomalyInvestigationRequestAttributes.JSON_PROPERTY_REQUESTS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REQUESTS = "requests"; + private List requests = new ArrayList<>(); + + public TimeseriesAnomalyInvestigationRequestAttributes() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_REQUESTS) + List requests) { + this.requests = requests; + for (TimeseriesAnomalyInvestigationTimeseriesRequest item : requests) { + this.unparsed |= item.unparsed; + } + } + + public TimeseriesAnomalyInvestigationRequestAttributes requests( + List requests) { + this.requests = requests; + for (TimeseriesAnomalyInvestigationTimeseriesRequest item : requests) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TimeseriesAnomalyInvestigationRequestAttributes addRequestsItem( + TimeseriesAnomalyInvestigationTimeseriesRequest requestsItem) { + this.requests.add(requestsItem); + this.unparsed |= requestsItem.unparsed; + return this; + } + + /** + * Timeseries requests to investigate. This API version accepts exactly one request. + * + * @return requests + */ + @JsonProperty(JSON_PROPERTY_REQUESTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRequests() { + return requests; + } + + public void setRequests(List requests) { + this.requests = requests; + if (requests != null) { + for (TimeseriesAnomalyInvestigationTimeseriesRequest item : requests) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * 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 TimeseriesAnomalyInvestigationRequestAttributes + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationRequestAttributes 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 TimeseriesAnomalyInvestigationRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationRequestAttributes + timeseriesAnomalyInvestigationRequestAttributes = + (TimeseriesAnomalyInvestigationRequestAttributes) o; + return Objects.equals(this.requests, timeseriesAnomalyInvestigationRequestAttributes.requests) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(requests, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationRequestAttributes {\n"); + sb.append(" requests: ").append(toIndentedString(requests)).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/TimeseriesAnomalyInvestigationRequestData.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationRequestData.java new file mode 100644 index 00000000000..073a2db0714 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationRequestData.java @@ -0,0 +1,189 @@ +/* + * 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; + +/** JSON:API resource containing an anomaly investigation request. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationRequestData.JSON_PROPERTY_ATTRIBUTES, + TimeseriesAnomalyInvestigationRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TimeseriesAnomalyInvestigationRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TimeseriesAnomalyInvestigationType type; + + public TimeseriesAnomalyInvestigationRequestData() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TimeseriesAnomalyInvestigationRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TimeseriesAnomalyInvestigationType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TimeseriesAnomalyInvestigationRequestData attributes( + TimeseriesAnomalyInvestigationRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an anomaly investigation request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TimeseriesAnomalyInvestigationRequestAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public TimeseriesAnomalyInvestigationRequestData type(TimeseriesAnomalyInvestigationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Resource type for a timeseries anomaly investigation. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationType getType() { + return type; + } + + public void setType(TimeseriesAnomalyInvestigationType 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 TimeseriesAnomalyInvestigationRequestData + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationRequestData 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 TimeseriesAnomalyInvestigationRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationRequestData timeseriesAnomalyInvestigationRequestData = + (TimeseriesAnomalyInvestigationRequestData) o; + return Objects.equals(this.attributes, timeseriesAnomalyInvestigationRequestData.attributes) + && Objects.equals(this.type, timeseriesAnomalyInvestigationRequestData.type) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/TimeseriesAnomalyInvestigationResponse.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponse.java new file mode 100644 index 00000000000..c4860809b8d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponse.java @@ -0,0 +1,189 @@ +/* + * 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; + +/** Response containing the anomaly investigation results and timeseries metadata. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationResponse.JSON_PROPERTY_DATA, + TimeseriesAnomalyInvestigationResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TimeseriesAnomalyInvestigationResponseData data; + + public static final String JSON_PROPERTY_META = "meta"; + private TimeseriesAnomalyInvestigationResponseMeta meta; + + public TimeseriesAnomalyInvestigationResponse() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TimeseriesAnomalyInvestigationResponseData data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) + TimeseriesAnomalyInvestigationResponseMeta meta) { + this.data = data; + this.unparsed |= data.unparsed; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public TimeseriesAnomalyInvestigationResponse data( + TimeseriesAnomalyInvestigationResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * JSON:API resource containing anomaly investigation results. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationResponseData getData() { + return data; + } + + public void setData(TimeseriesAnomalyInvestigationResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public TimeseriesAnomalyInvestigationResponse meta( + TimeseriesAnomalyInvestigationResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Timeseries execution metadata for the single request accepted by this API version. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationResponseMeta getMeta() { + return meta; + } + + public void setMeta(TimeseriesAnomalyInvestigationResponseMeta meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + /** + * 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 TimeseriesAnomalyInvestigationResponse + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationResponse 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 TimeseriesAnomalyInvestigationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationResponse timeseriesAnomalyInvestigationResponse = + (TimeseriesAnomalyInvestigationResponse) o; + return Objects.equals(this.data, timeseriesAnomalyInvestigationResponse.data) + && Objects.equals(this.meta, timeseriesAnomalyInvestigationResponse.meta) + && Objects.equals( + this.additionalProperties, timeseriesAnomalyInvestigationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/TimeseriesAnomalyInvestigationResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseAttributes.java new file mode 100644 index 00000000000..90fc4785e0c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseAttributes.java @@ -0,0 +1,171 @@ +/* + * 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; + +/** Attributes of an anomaly investigation response. */ +@JsonPropertyOrder({TimeseriesAnomalyInvestigationResponseAttributes.JSON_PROPERTY_RESULTS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESULTS = "results"; + private List results = new ArrayList<>(); + + public TimeseriesAnomalyInvestigationResponseAttributes() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_RESULTS) + List results) { + this.results = results; + for (TimeseriesAnomalyInvestigationResult item : results) { + this.unparsed |= item.unparsed; + } + } + + public TimeseriesAnomalyInvestigationResponseAttributes results( + List results) { + this.results = results; + for (TimeseriesAnomalyInvestigationResult item : results) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TimeseriesAnomalyInvestigationResponseAttributes addResultsItem( + TimeseriesAnomalyInvestigationResult resultsItem) { + this.results.add(resultsItem); + this.unparsed |= resultsItem.unparsed; + return this; + } + + /** + * Results returned in the same order as the submitted requests. This API version returns exactly + * one result. + * + * @return results + */ + @JsonProperty(JSON_PROPERTY_RESULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + if (results != null) { + for (TimeseriesAnomalyInvestigationResult item : results) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * 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 TimeseriesAnomalyInvestigationResponseAttributes + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationResponseAttributes 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 TimeseriesAnomalyInvestigationResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationResponseAttributes + timeseriesAnomalyInvestigationResponseAttributes = + (TimeseriesAnomalyInvestigationResponseAttributes) o; + return Objects.equals(this.results, timeseriesAnomalyInvestigationResponseAttributes.results) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(results, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationResponseAttributes {\n"); + sb.append(" results: ").append(toIndentedString(results)).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/TimeseriesAnomalyInvestigationResponseData.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseData.java new file mode 100644 index 00000000000..fbc1d64ca98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseData.java @@ -0,0 +1,225 @@ +/* + * 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; + +/** JSON:API resource containing anomaly investigation results. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationResponseData.JSON_PROPERTY_ATTRIBUTES, + TimeseriesAnomalyInvestigationResponseData.JSON_PROPERTY_ID, + TimeseriesAnomalyInvestigationResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TimeseriesAnomalyInvestigationResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private TimeseriesAnomalyInvestigationResponseID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TimeseriesAnomalyInvestigationType type; + + public TimeseriesAnomalyInvestigationResponseData() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TimeseriesAnomalyInvestigationResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) + TimeseriesAnomalyInvestigationResponseID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TimeseriesAnomalyInvestigationType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.unparsed |= !id.isValid(); + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TimeseriesAnomalyInvestigationResponseData attributes( + TimeseriesAnomalyInvestigationResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an anomaly investigation response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TimeseriesAnomalyInvestigationResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public TimeseriesAnomalyInvestigationResponseData id( + TimeseriesAnomalyInvestigationResponseID id) { + this.id = id; + this.unparsed |= !id.isValid(); + return this; + } + + /** + * Stable identifier for an anomaly investigation response resource. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationResponseID getId() { + return id; + } + + public void setId(TimeseriesAnomalyInvestigationResponseID id) { + if (!id.isValid()) { + this.unparsed = true; + } + this.id = id; + } + + public TimeseriesAnomalyInvestigationResponseData type(TimeseriesAnomalyInvestigationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Resource type for a timeseries anomaly investigation. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationType getType() { + return type; + } + + public void setType(TimeseriesAnomalyInvestigationType 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 TimeseriesAnomalyInvestigationResponseData + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationResponseData 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 TimeseriesAnomalyInvestigationResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationResponseData timeseriesAnomalyInvestigationResponseData = + (TimeseriesAnomalyInvestigationResponseData) o; + return Objects.equals(this.attributes, timeseriesAnomalyInvestigationResponseData.attributes) + && Objects.equals(this.id, timeseriesAnomalyInvestigationResponseData.id) + && Objects.equals(this.type, timeseriesAnomalyInvestigationResponseData.type) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + 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/TimeseriesAnomalyInvestigationResponseID.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseID.java new file mode 100644 index 00000000000..48a686333c7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseID.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; + +/** Stable identifier for an anomaly investigation response resource. */ +@JsonSerialize( + using = + TimeseriesAnomalyInvestigationResponseID.TimeseriesAnomalyInvestigationResponseIDSerializer + .class) +public class TimeseriesAnomalyInvestigationResponseID extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("0")); + + public static final TimeseriesAnomalyInvestigationResponseID ZERO = + new TimeseriesAnomalyInvestigationResponseID("0"); + + TimeseriesAnomalyInvestigationResponseID(String value) { + super(value, allowedValues); + } + + public static class TimeseriesAnomalyInvestigationResponseIDSerializer + extends StdSerializer { + public TimeseriesAnomalyInvestigationResponseIDSerializer( + Class t) { + super(t); + } + + public TimeseriesAnomalyInvestigationResponseIDSerializer() { + this(null); + } + + @Override + public void serialize( + TimeseriesAnomalyInvestigationResponseID value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimeseriesAnomalyInvestigationResponseID fromValue(String value) { + return new TimeseriesAnomalyInvestigationResponseID(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseMeta.java new file mode 100644 index 00000000000..6d01ac56b72 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResponseMeta.java @@ -0,0 +1,341 @@ +/* + * 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; + +/** Timeseries execution metadata for the single request accepted by this API version. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationResponseMeta.JSON_PROPERTY_FROM_DATE, + TimeseriesAnomalyInvestigationResponseMeta.JSON_PROPERTY_INTERVAL, + TimeseriesAnomalyInvestigationResponseMeta.JSON_PROPERTY_QUERIES, + TimeseriesAnomalyInvestigationResponseMeta.JSON_PROPERTY_RES_TYPE, + TimeseriesAnomalyInvestigationResponseMeta.JSON_PROPERTY_RESULTS_WARNINGS, + TimeseriesAnomalyInvestigationResponseMeta.JSON_PROPERTY_TO_DATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FROM_DATE = "from_date"; + private Long fromDate; + + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private Long interval; + + public static final String JSON_PROPERTY_QUERIES = "queries"; + private List queries = new ArrayList<>(); + + public static final String JSON_PROPERTY_RES_TYPE = "res_type"; + private TimeseriesAnomalyInvestigationMetaType resType; + + public static final String JSON_PROPERTY_RESULTS_WARNINGS = "results_warnings"; + private List resultsWarnings = new ArrayList<>(); + + public static final String JSON_PROPERTY_TO_DATE = "to_date"; + private Long toDate; + + public TimeseriesAnomalyInvestigationResponseMeta() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationResponseMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_FROM_DATE) Long fromDate, + @JsonProperty(required = true, value = JSON_PROPERTY_INTERVAL) Long interval, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERIES) + List queries, + @JsonProperty(required = true, value = JSON_PROPERTY_RES_TYPE) + TimeseriesAnomalyInvestigationMetaType resType, + @JsonProperty(required = true, value = JSON_PROPERTY_RESULTS_WARNINGS) + List resultsWarnings, + @JsonProperty(required = true, value = JSON_PROPERTY_TO_DATE) Long toDate) { + this.fromDate = fromDate; + this.interval = interval; + this.queries = queries; + for (TimeseriesAnomalyInvestigationQueryStatus item : queries) { + this.unparsed |= item.unparsed; + } + this.resType = resType; + this.unparsed |= !resType.isValid(); + this.resultsWarnings = resultsWarnings; + for (TimeseriesAnomalyInvestigationResultsWarning item : resultsWarnings) { + this.unparsed |= item.unparsed; + } + this.toDate = toDate; + } + + public TimeseriesAnomalyInvestigationResponseMeta fromDate(Long fromDate) { + this.fromDate = fromDate; + return this; + } + + /** + * Effective start of the timeseries query in milliseconds since the Unix epoch. + * + * @return fromDate + */ + @JsonProperty(JSON_PROPERTY_FROM_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getFromDate() { + return fromDate; + } + + public void setFromDate(Long fromDate) { + this.fromDate = fromDate; + } + + public TimeseriesAnomalyInvestigationResponseMeta interval(Long interval) { + this.interval = interval; + return this; + } + + /** + * Effective timeseries interval in milliseconds. minimum: 1 + * + * @return interval + */ + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getInterval() { + return interval; + } + + public void setInterval(Long interval) { + this.interval = interval; + } + + public TimeseriesAnomalyInvestigationResponseMeta queries( + List queries) { + this.queries = queries; + for (TimeseriesAnomalyInvestigationQueryStatus item : queries) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TimeseriesAnomalyInvestigationResponseMeta addQueriesItem( + TimeseriesAnomalyInvestigationQueryStatus queriesItem) { + this.queries.add(queriesItem); + this.unparsed |= queriesItem.unparsed; + return this; + } + + /** + * Execution status for the request's queries. + * + * @return queries + */ + @JsonProperty(JSON_PROPERTY_QUERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getQueries() { + return queries; + } + + public void setQueries(List queries) { + this.queries = queries; + if (queries != null) { + for (TimeseriesAnomalyInvestigationQueryStatus item : queries) { + this.unparsed |= item.unparsed; + } + } + } + + public TimeseriesAnomalyInvestigationResponseMeta resType( + TimeseriesAnomalyInvestigationMetaType resType) { + this.resType = resType; + this.unparsed |= !resType.isValid(); + return this; + } + + /** + * Response metadata type for a timeseries anomaly investigation. + * + * @return resType + */ + @JsonProperty(JSON_PROPERTY_RES_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationMetaType getResType() { + return resType; + } + + public void setResType(TimeseriesAnomalyInvestigationMetaType resType) { + if (!resType.isValid()) { + this.unparsed = true; + } + this.resType = resType; + } + + public TimeseriesAnomalyInvestigationResponseMeta resultsWarnings( + List resultsWarnings) { + this.resultsWarnings = resultsWarnings; + for (TimeseriesAnomalyInvestigationResultsWarning item : resultsWarnings) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TimeseriesAnomalyInvestigationResponseMeta addResultsWarningsItem( + TimeseriesAnomalyInvestigationResultsWarning resultsWarningsItem) { + this.resultsWarnings.add(resultsWarningsItem); + this.unparsed |= resultsWarningsItem.unparsed; + return this; + } + + /** + * Non-fatal warnings produced while executing the investigation. + * + * @return resultsWarnings + */ + @JsonProperty(JSON_PROPERTY_RESULTS_WARNINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getResultsWarnings() { + return resultsWarnings; + } + + public void setResultsWarnings( + List resultsWarnings) { + this.resultsWarnings = resultsWarnings; + if (resultsWarnings != null) { + for (TimeseriesAnomalyInvestigationResultsWarning item : resultsWarnings) { + this.unparsed |= item.unparsed; + } + } + } + + public TimeseriesAnomalyInvestigationResponseMeta toDate(Long toDate) { + this.toDate = toDate; + return this; + } + + /** + * Effective end of the timeseries query in milliseconds since the Unix epoch. + * + * @return toDate + */ + @JsonProperty(JSON_PROPERTY_TO_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getToDate() { + return toDate; + } + + public void setToDate(Long toDate) { + this.toDate = toDate; + } + + /** + * 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 TimeseriesAnomalyInvestigationResponseMeta + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationResponseMeta 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 TimeseriesAnomalyInvestigationResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationResponseMeta timeseriesAnomalyInvestigationResponseMeta = + (TimeseriesAnomalyInvestigationResponseMeta) o; + return Objects.equals(this.fromDate, timeseriesAnomalyInvestigationResponseMeta.fromDate) + && Objects.equals(this.interval, timeseriesAnomalyInvestigationResponseMeta.interval) + && Objects.equals(this.queries, timeseriesAnomalyInvestigationResponseMeta.queries) + && Objects.equals(this.resType, timeseriesAnomalyInvestigationResponseMeta.resType) + && Objects.equals( + this.resultsWarnings, timeseriesAnomalyInvestigationResponseMeta.resultsWarnings) + && Objects.equals(this.toDate, timeseriesAnomalyInvestigationResponseMeta.toDate) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + fromDate, interval, queries, resType, resultsWarnings, toDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationResponseMeta {\n"); + sb.append(" fromDate: ").append(toIndentedString(fromDate)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" queries: ").append(toIndentedString(queries)).append("\n"); + sb.append(" resType: ").append(toIndentedString(resType)).append("\n"); + sb.append(" resultsWarnings: ").append(toIndentedString(resultsWarnings)).append("\n"); + sb.append(" toDate: ").append(toIndentedString(toDate)).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/TimeseriesAnomalyInvestigationResult.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResult.java new file mode 100644 index 00000000000..6238a26dd59 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResult.java @@ -0,0 +1,207 @@ +/* + * 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; + +/** + * Completed result for one timeseries request. The anomalies array is empty when no qualifying + * anomaly is found. + */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationResult.JSON_PROPERTY_ANOMALIES, + TimeseriesAnomalyInvestigationResult.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANOMALIES = "anomalies"; + private List anomalies = new ArrayList<>(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private TimeseriesAnomalyInvestigationCompleteStatus status; + + public TimeseriesAnomalyInvestigationResult() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationResult( + @JsonProperty(required = true, value = JSON_PROPERTY_ANOMALIES) + List anomalies, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + TimeseriesAnomalyInvestigationCompleteStatus status) { + this.anomalies = anomalies; + for (TimeseriesAnomalyInvestigationAnomaly item : anomalies) { + this.unparsed |= item.unparsed; + } + this.status = status; + this.unparsed |= !status.isValid(); + } + + public TimeseriesAnomalyInvestigationResult anomalies( + List anomalies) { + this.anomalies = anomalies; + for (TimeseriesAnomalyInvestigationAnomaly item : anomalies) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TimeseriesAnomalyInvestigationResult addAnomaliesItem( + TimeseriesAnomalyInvestigationAnomaly anomaliesItem) { + this.anomalies.add(anomaliesItem); + this.unparsed |= anomaliesItem.unparsed; + return this; + } + + /** + * Detected anomalies. This API version returns at most one anomaly. + * + * @return anomalies + */ + @JsonProperty(JSON_PROPERTY_ANOMALIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getAnomalies() { + return anomalies; + } + + public void setAnomalies(List anomalies) { + this.anomalies = anomalies; + if (anomalies != null) { + for (TimeseriesAnomalyInvestigationAnomaly item : anomalies) { + this.unparsed |= item.unparsed; + } + } + } + + public TimeseriesAnomalyInvestigationResult status( + TimeseriesAnomalyInvestigationCompleteStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Status value indicating successful completion. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationCompleteStatus getStatus() { + return status; + } + + public void setStatus(TimeseriesAnomalyInvestigationCompleteStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + /** + * 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 TimeseriesAnomalyInvestigationResult + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationResult 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 TimeseriesAnomalyInvestigationResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationResult timeseriesAnomalyInvestigationResult = + (TimeseriesAnomalyInvestigationResult) o; + return Objects.equals(this.anomalies, timeseriesAnomalyInvestigationResult.anomalies) + && Objects.equals(this.status, timeseriesAnomalyInvestigationResult.status) + && Objects.equals( + this.additionalProperties, timeseriesAnomalyInvestigationResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(anomalies, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationResult {\n"); + sb.append(" anomalies: ").append(toIndentedString(anomalies)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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/TimeseriesAnomalyInvestigationResultsWarning.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResultsWarning.java new file mode 100644 index 00000000000..64185625d4e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationResultsWarning.java @@ -0,0 +1,177 @@ +/* + * 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; + +/** Non-fatal warning produced while executing the investigation. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationResultsWarning.JSON_PROPERTY_MESSAGE, + TimeseriesAnomalyInvestigationResultsWarning.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationResultsWarning { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public TimeseriesAnomalyInvestigationResultsWarning() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationResultsWarning( + @JsonProperty(required = true, value = JSON_PROPERTY_MESSAGE) String message, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.message = message; + this.name = name; + } + + public TimeseriesAnomalyInvestigationResultsWarning message(String message) { + this.message = message; + return this; + } + + /** + * Human-readable warning message. + * + * @return message + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public TimeseriesAnomalyInvestigationResultsWarning name(String name) { + this.name = name; + return this; + } + + /** + * Machine-readable warning name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 TimeseriesAnomalyInvestigationResultsWarning + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationResultsWarning 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 TimeseriesAnomalyInvestigationResultsWarning object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationResultsWarning timeseriesAnomalyInvestigationResultsWarning = + (TimeseriesAnomalyInvestigationResultsWarning) o; + return Objects.equals(this.message, timeseriesAnomalyInvestigationResultsWarning.message) + && Objects.equals(this.name, timeseriesAnomalyInvestigationResultsWarning.name) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationResultsWarning.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationResultsWarning {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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/TimeseriesAnomalyInvestigationSeries.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationSeries.java new file mode 100644 index 00000000000..641db069897 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationSeries.java @@ -0,0 +1,210 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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; + +/** Logical series on which the anomaly was detected. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationSeries.JSON_PROPERTY_GROUP_TAGS, + TimeseriesAnomalyInvestigationSeries.JSON_PROPERTY_LABEL, + TimeseriesAnomalyInvestigationSeries.JSON_PROPERTY_QUERY_INDEX +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationSeries { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GROUP_TAGS = "group_tags"; + private List groupTags = new ArrayList<>(); + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_QUERY_INDEX = "query_index"; + private Long queryIndex; + + public TimeseriesAnomalyInvestigationSeries() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationSeries( + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP_TAGS) List groupTags, + @JsonProperty(required = true, value = JSON_PROPERTY_LABEL) String label, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY_INDEX) Long queryIndex) { + this.groupTags = groupTags; + this.label = label; + this.queryIndex = queryIndex; + } + + public TimeseriesAnomalyInvestigationSeries groupTags(List groupTags) { + this.groupTags = groupTags; + return this; + } + + public TimeseriesAnomalyInvestigationSeries addGroupTagsItem(String groupTagsItem) { + this.groupTags.add(groupTagsItem); + return this; + } + + /** + * Tags identifying the selected group. Empty for a query without grouping. + * + * @return groupTags + */ + @JsonProperty(JSON_PROPERTY_GROUP_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroupTags() { + return groupTags; + } + + public void setGroupTags(List groupTags) { + this.groupTags = groupTags; + } + + public TimeseriesAnomalyInvestigationSeries label(String label) { + this.label = label; + return this; + } + + /** + * Display label for the selected series. + * + * @return label + */ + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public TimeseriesAnomalyInvestigationSeries queryIndex(Long queryIndex) { + this.queryIndex = queryIndex; + return this; + } + + /** + * Zero-based index of the caller's formula that produced the series. minimum: 0 + * + * @return queryIndex + */ + @JsonProperty(JSON_PROPERTY_QUERY_INDEX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getQueryIndex() { + return queryIndex; + } + + public void setQueryIndex(Long queryIndex) { + this.queryIndex = queryIndex; + } + + /** + * 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 TimeseriesAnomalyInvestigationSeries + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationSeries 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 TimeseriesAnomalyInvestigationSeries object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationSeries timeseriesAnomalyInvestigationSeries = + (TimeseriesAnomalyInvestigationSeries) o; + return Objects.equals(this.groupTags, timeseriesAnomalyInvestigationSeries.groupTags) + && Objects.equals(this.label, timeseriesAnomalyInvestigationSeries.label) + && Objects.equals(this.queryIndex, timeseriesAnomalyInvestigationSeries.queryIndex) + && Objects.equals( + this.additionalProperties, timeseriesAnomalyInvestigationSeries.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groupTags, label, queryIndex, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationSeries {\n"); + sb.append(" groupTags: ").append(toIndentedString(groupTags)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" queryIndex: ").append(toIndentedString(queryIndex)).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/TimeseriesAnomalyInvestigationTagAnalysis.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationTagAnalysis.java new file mode 100644 index 00000000000..eff4d3db7fc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationTagAnalysis.java @@ -0,0 +1,255 @@ +/* + * 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; + +/** + * 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. + */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationTagAnalysis.JSON_PROPERTY_ANALYZED_TAG_KEYS, + TimeseriesAnomalyInvestigationTagAnalysis.JSON_PROPERTY_STATUS, + TimeseriesAnomalyInvestigationTagAnalysis.JSON_PROPERTY_TAG_KEYS_ANALYZED, + TimeseriesAnomalyInvestigationTagAnalysis.JSON_PROPERTY_TAG_VALUES_ANALYZED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationTagAnalysis { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANALYZED_TAG_KEYS = "analyzed_tag_keys"; + private List analyzedTagKeys = null; + + public static final String JSON_PROPERTY_STATUS = "status"; + private TimeseriesAnomalyInvestigationTagAnalysisStatus status; + + public static final String JSON_PROPERTY_TAG_KEYS_ANALYZED = "tag_keys_analyzed"; + private Long tagKeysAnalyzed; + + public static final String JSON_PROPERTY_TAG_VALUES_ANALYZED = "tag_values_analyzed"; + private Long tagValuesAnalyzed; + + public TimeseriesAnomalyInvestigationTagAnalysis() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationTagAnalysis( + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + TimeseriesAnomalyInvestigationTagAnalysisStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + } + + public TimeseriesAnomalyInvestigationTagAnalysis analyzedTagKeys(List analyzedTagKeys) { + this.analyzedTagKeys = analyzedTagKeys; + return this; + } + + public TimeseriesAnomalyInvestigationTagAnalysis addAnalyzedTagKeysItem( + String analyzedTagKeysItem) { + if (this.analyzedTagKeys == null) { + this.analyzedTagKeys = new ArrayList<>(); + } + this.analyzedTagKeys.add(analyzedTagKeysItem); + return this; + } + + /** + * Tag keys analyzed. Present only when analysis completes. + * + * @return analyzedTagKeys + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANALYZED_TAG_KEYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAnalyzedTagKeys() { + return analyzedTagKeys; + } + + public void setAnalyzedTagKeys(List analyzedTagKeys) { + this.analyzedTagKeys = analyzedTagKeys; + } + + public TimeseriesAnomalyInvestigationTagAnalysis status( + TimeseriesAnomalyInvestigationTagAnalysisStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Outcome of optional influential-tag enrichment. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TimeseriesAnomalyInvestigationTagAnalysisStatus getStatus() { + return status; + } + + public void setStatus(TimeseriesAnomalyInvestigationTagAnalysisStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public TimeseriesAnomalyInvestigationTagAnalysis tagKeysAnalyzed(Long tagKeysAnalyzed) { + this.tagKeysAnalyzed = tagKeysAnalyzed; + return this; + } + + /** + * Number of tag keys analyzed. Present only when analysis completes. minimum: 0 + * + * @return tagKeysAnalyzed + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG_KEYS_ANALYZED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTagKeysAnalyzed() { + return tagKeysAnalyzed; + } + + public void setTagKeysAnalyzed(Long tagKeysAnalyzed) { + this.tagKeysAnalyzed = tagKeysAnalyzed; + } + + public TimeseriesAnomalyInvestigationTagAnalysis tagValuesAnalyzed(Long tagValuesAnalyzed) { + this.tagValuesAnalyzed = tagValuesAnalyzed; + return this; + } + + /** + * Number of tag values analyzed. Present only when analysis completes. minimum: 0 + * + * @return tagValuesAnalyzed + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG_VALUES_ANALYZED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTagValuesAnalyzed() { + return tagValuesAnalyzed; + } + + public void setTagValuesAnalyzed(Long tagValuesAnalyzed) { + this.tagValuesAnalyzed = tagValuesAnalyzed; + } + + /** + * 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 TimeseriesAnomalyInvestigationTagAnalysis + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationTagAnalysis 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 TimeseriesAnomalyInvestigationTagAnalysis object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationTagAnalysis timeseriesAnomalyInvestigationTagAnalysis = + (TimeseriesAnomalyInvestigationTagAnalysis) o; + return Objects.equals( + this.analyzedTagKeys, timeseriesAnomalyInvestigationTagAnalysis.analyzedTagKeys) + && Objects.equals(this.status, timeseriesAnomalyInvestigationTagAnalysis.status) + && Objects.equals( + this.tagKeysAnalyzed, timeseriesAnomalyInvestigationTagAnalysis.tagKeysAnalyzed) + && Objects.equals( + this.tagValuesAnalyzed, timeseriesAnomalyInvestigationTagAnalysis.tagValuesAnalyzed) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationTagAnalysis.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + analyzedTagKeys, status, tagKeysAnalyzed, tagValuesAnalyzed, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationTagAnalysis {\n"); + sb.append(" analyzedTagKeys: ").append(toIndentedString(analyzedTagKeys)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tagKeysAnalyzed: ").append(toIndentedString(tagKeysAnalyzed)).append("\n"); + sb.append(" tagValuesAnalyzed: ").append(toIndentedString(tagValuesAnalyzed)).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/TimeseriesAnomalyInvestigationTagAnalysisStatus.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationTagAnalysisStatus.java new file mode 100644 index 00000000000..a91c2aef737 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationTagAnalysisStatus.java @@ -0,0 +1,67 @@ +/* + * 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; + +/** Outcome of optional influential-tag enrichment. */ +@JsonSerialize( + using = + TimeseriesAnomalyInvestigationTagAnalysisStatus + .TimeseriesAnomalyInvestigationTagAnalysisStatusSerializer.class) +public class TimeseriesAnomalyInvestigationTagAnalysisStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("complete", "unsupported", "failed")); + + public static final TimeseriesAnomalyInvestigationTagAnalysisStatus COMPLETE = + new TimeseriesAnomalyInvestigationTagAnalysisStatus("complete"); + public static final TimeseriesAnomalyInvestigationTagAnalysisStatus UNSUPPORTED = + new TimeseriesAnomalyInvestigationTagAnalysisStatus("unsupported"); + public static final TimeseriesAnomalyInvestigationTagAnalysisStatus FAILED = + new TimeseriesAnomalyInvestigationTagAnalysisStatus("failed"); + + TimeseriesAnomalyInvestigationTagAnalysisStatus(String value) { + super(value, allowedValues); + } + + public static class TimeseriesAnomalyInvestigationTagAnalysisStatusSerializer + extends StdSerializer { + public TimeseriesAnomalyInvestigationTagAnalysisStatusSerializer( + Class t) { + super(t); + } + + public TimeseriesAnomalyInvestigationTagAnalysisStatusSerializer() { + this(null); + } + + @Override + public void serialize( + TimeseriesAnomalyInvestigationTagAnalysisStatus value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimeseriesAnomalyInvestigationTagAnalysisStatus fromValue(String value) { + return new TimeseriesAnomalyInvestigationTagAnalysisStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationTimeseriesRequest.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationTimeseriesRequest.java new file mode 100644 index 00000000000..d6fdae91a51 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationTimeseriesRequest.java @@ -0,0 +1,305 @@ +/* + * 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; + +/** Metrics timeseries request to investigate. */ +@JsonPropertyOrder({ + TimeseriesAnomalyInvestigationTimeseriesRequest.JSON_PROPERTY_FORMULAS, + TimeseriesAnomalyInvestigationTimeseriesRequest.JSON_PROPERTY_FROM, + TimeseriesAnomalyInvestigationTimeseriesRequest.JSON_PROPERTY_INTERVAL, + TimeseriesAnomalyInvestigationTimeseriesRequest.JSON_PROPERTY_QUERIES, + TimeseriesAnomalyInvestigationTimeseriesRequest.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TimeseriesAnomalyInvestigationTimeseriesRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FORMULAS = "formulas"; + private List formulas = new ArrayList<>(); + + public static final String JSON_PROPERTY_FROM = "from"; + private Long from; + + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private Long interval; + + public static final String JSON_PROPERTY_QUERIES = "queries"; + private List queries = new ArrayList<>(); + + public static final String JSON_PROPERTY_TO = "to"; + private Long to; + + public TimeseriesAnomalyInvestigationTimeseriesRequest() {} + + @JsonCreator + public TimeseriesAnomalyInvestigationTimeseriesRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_FORMULAS) + List formulas, + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) Long from, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERIES) + List queries, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) Long to) { + this.formulas = formulas; + for (TimeseriesAnomalyInvestigationFormula item : formulas) { + this.unparsed |= item.unparsed; + } + this.from = from; + this.queries = queries; + for (TimeseriesAnomalyInvestigationMetricQuery item : queries) { + this.unparsed |= item.unparsed; + } + this.to = to; + } + + public TimeseriesAnomalyInvestigationTimeseriesRequest formulas( + List formulas) { + this.formulas = formulas; + for (TimeseriesAnomalyInvestigationFormula item : formulas) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TimeseriesAnomalyInvestigationTimeseriesRequest addFormulasItem( + TimeseriesAnomalyInvestigationFormula formulasItem) { + this.formulas.add(formulasItem); + this.unparsed |= formulasItem.unparsed; + return this; + } + + /** + * Formulas to evaluate. Each formula may contain an explicit anomalies() call or a + * supported metrics expression. + * + * @return formulas + */ + @JsonProperty(JSON_PROPERTY_FORMULAS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFormulas() { + return formulas; + } + + public void setFormulas(List formulas) { + this.formulas = formulas; + if (formulas != null) { + for (TimeseriesAnomalyInvestigationFormula item : formulas) { + this.unparsed |= item.unparsed; + } + } + } + + public TimeseriesAnomalyInvestigationTimeseriesRequest from(Long from) { + this.from = from; + return this; + } + + /** + * Start of the investigation time window in milliseconds since the Unix epoch. + * + * @return from + */ + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getFrom() { + return from; + } + + public void setFrom(Long from) { + this.from = from; + } + + public TimeseriesAnomalyInvestigationTimeseriesRequest interval(Long interval) { + this.interval = interval; + return this; + } + + /** + * Optional requested aggregation interval in milliseconds. minimum: 1 + * + * @return interval + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInterval() { + return interval; + } + + public void setInterval(Long interval) { + this.interval = interval; + } + + public TimeseriesAnomalyInvestigationTimeseriesRequest queries( + List queries) { + this.queries = queries; + for (TimeseriesAnomalyInvestigationMetricQuery item : queries) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TimeseriesAnomalyInvestigationTimeseriesRequest addQueriesItem( + TimeseriesAnomalyInvestigationMetricQuery queriesItem) { + this.queries.add(queriesItem); + this.unparsed |= queriesItem.unparsed; + return this; + } + + /** + * Metrics queries referenced by the formulas. + * + * @return queries + */ + @JsonProperty(JSON_PROPERTY_QUERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getQueries() { + return queries; + } + + public void setQueries(List queries) { + this.queries = queries; + if (queries != null) { + for (TimeseriesAnomalyInvestigationMetricQuery item : queries) { + this.unparsed |= item.unparsed; + } + } + } + + public TimeseriesAnomalyInvestigationTimeseriesRequest to(Long to) { + this.to = to; + return this; + } + + /** + * End of the investigation time window in milliseconds since the Unix epoch. Must be later than + * from. + * + * @return to + */ + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTo() { + return to; + } + + public void setTo(Long to) { + this.to = to; + } + + /** + * 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 TimeseriesAnomalyInvestigationTimeseriesRequest + */ + @JsonAnySetter + public TimeseriesAnomalyInvestigationTimeseriesRequest 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 TimeseriesAnomalyInvestigationTimeseriesRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeseriesAnomalyInvestigationTimeseriesRequest + timeseriesAnomalyInvestigationTimeseriesRequest = + (TimeseriesAnomalyInvestigationTimeseriesRequest) o; + return Objects.equals(this.formulas, timeseriesAnomalyInvestigationTimeseriesRequest.formulas) + && Objects.equals(this.from, timeseriesAnomalyInvestigationTimeseriesRequest.from) + && Objects.equals(this.interval, timeseriesAnomalyInvestigationTimeseriesRequest.interval) + && Objects.equals(this.queries, timeseriesAnomalyInvestigationTimeseriesRequest.queries) + && Objects.equals(this.to, timeseriesAnomalyInvestigationTimeseriesRequest.to) + && Objects.equals( + this.additionalProperties, + timeseriesAnomalyInvestigationTimeseriesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(formulas, from, interval, queries, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeseriesAnomalyInvestigationTimeseriesRequest {\n"); + sb.append(" formulas: ").append(toIndentedString(formulas)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" queries: ").append(toIndentedString(queries)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).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/TimeseriesAnomalyInvestigationType.java b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationType.java new file mode 100644 index 00000000000..dd199751fa6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TimeseriesAnomalyInvestigationType.java @@ -0,0 +1,59 @@ +/* + * 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; + +/** Resource type for a timeseries anomaly investigation. */ +@JsonSerialize( + using = TimeseriesAnomalyInvestigationType.TimeseriesAnomalyInvestigationTypeSerializer.class) +public class TimeseriesAnomalyInvestigationType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("timeseries_anomaly_investigation")); + + public static final TimeseriesAnomalyInvestigationType TIMESERIES_ANOMALY_INVESTIGATION = + new TimeseriesAnomalyInvestigationType("timeseries_anomaly_investigation"); + + TimeseriesAnomalyInvestigationType(String value) { + super(value, allowedValues); + } + + public static class TimeseriesAnomalyInvestigationTypeSerializer + extends StdSerializer { + public TimeseriesAnomalyInvestigationTypeSerializer( + Class t) { + super(t); + } + + public TimeseriesAnomalyInvestigationTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TimeseriesAnomalyInvestigationType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TimeseriesAnomalyInvestigationType fromValue(String value) { + return new TimeseriesAnomalyInvestigationType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/timeseries_anomaly_investigations.feature b/src/test/resources/com/datadog/api/client/v2/api/timeseries_anomaly_investigations.feature new file mode 100644 index 00000000000..78dfb223cbe --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/timeseries_anomaly_investigations.feature @@ -0,0 +1,27 @@ +@endpoint(timeseries-anomaly-investigations) @endpoint(timeseries-anomaly-investigations-v2) +Feature: Timeseries Anomaly Investigations + Investigate metrics timeseries anomalies and return deterministic + findings. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "TimeseriesAnomalyInvestigations" API + And operation "CreateTimeseriesAnomalyInvestigation" enabled + And new "CreateTimeseriesAnomalyInvestigation" request + And body with 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"}} + + @generated @skip @team:DataDog/dataviz-backend-maintainers + Scenario: Investigate a timeseries anomaly returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/dataviz-backend-maintainers + Scenario: Investigate a timeseries anomaly returns "OK" response + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/dataviz-backend-maintainers + Scenario: Investigate a timeseries anomaly returns "Unprocessable Entity" response + When the request is sent + Then the response status is 422 Unprocessable Entity diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 960023eb2f2..a0b26605ec1 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -10116,6 +10116,12 @@ "type": "safe" } }, + "CreateTimeseriesAnomalyInvestigation": { + "tag": "Timeseries Anomaly Investigations", + "undo": { + "type": "safe" + } + }, "GetTraceByID": { "tag": "APM Trace", "undo": {