From 7daacc7cd00cb2053c7ce7c044dfca9d61a331ae Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 1 Oct 2026 11:01:04 +0000 Subject: [PATCH] Regenerate client from commit 6261ff4 of spec repo --- .generator/schemas/v2/openapi.yaml | 182 +++++++++ .../ValidatePipeline_1795564228.java | 125 ++++++ .../ValidatePipeline_4239139905.java | 116 ++++++ ...ervabilityPipelineConfigProcessorItem.java | 100 ++++- ...lityPipelineMetricEnrichmentTableFile.java | 219 +++++++++++ ...yPipelineMetricEnrichmentTableFileKey.java | 186 +++++++++ ...ineMetricEnrichmentTableFileProcessor.java | 311 +++++++++++++++ ...lineMetricEnrichmentTableLookupSource.java | 345 +++++++++++++++++ ...MetricEnrichmentTableMetricNameLookup.java | 160 ++++++++ ...icEnrichmentTableMetricNameLookupType.java | 65 ++++ ...ipelineMetricEnrichmentTableProcessor.java | 355 ++++++++++++++++++ ...lineMetricEnrichmentTableReferenceKey.java | 160 ++++++++ ...neMetricEnrichmentTableReferenceTable.java | 258 +++++++++++++ ...nrichmentTableReferenceTableProcessor.java | 322 ++++++++++++++++ ...ipelineMetricEnrichmentTableTagLookup.java | 188 ++++++++++ ...ineMetricEnrichmentTableTagLookupType.java | 62 +++ .../v2/api/observability_pipelines.feature | 16 + .../test-runner-data/manifest.json | 14 + ...essor-file-lookup-returns-ok-response.json | 84 +++++ ...r-reference-table-returns-ok-response.json | 81 ++++ .../v2/observability-pipelines.json | 175 +++++++++ 21 files changed, 3519 insertions(+), 5 deletions(-) create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_1795564228.java create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_4239139905.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFile.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFileKey.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFileProcessor.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableLookupSource.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableProcessor.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceKey.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceTable.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableTagLookup.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableTagLookupType.java create mode 100644 src/test/resources/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 90e97c4cc9d..77250e92e64 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -76346,6 +76346,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineThrottleProcessor" - $ref: "#/components/schemas/ObservabilityPipelineAddMetricTagsProcessor" - $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableProcessor" - $ref: "#/components/schemas/ObservabilityPipelineMetricTagsProcessor" - $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessor" - $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessor" @@ -78491,6 +78492,187 @@ components: - name - value type: object + ObservabilityPipelineMetricEnrichmentTableFile: + description: Defines a static enrichment table loaded from a CSV file for metric enrichment. + properties: + encoding: + $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileEncoding" + key: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFileKey" + path: + description: Path to the CSV file. + example: /etc/enrichment/lookup.csv + type: string + required: + - encoding + - key + - path + type: object + ObservabilityPipelineMetricEnrichmentTableFileKey: + description: Defines how to map a metric lookup value to a CSV column during enrichment table lookups. + properties: + column: + description: The CSV column name or index to match against the lookup value. + example: service + type: string + source: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableLookupSource" + required: + - column + - source + type: object + ObservabilityPipelineMetricEnrichmentTableFileProcessor: + description: An `enrichment_table` processor that enriches metrics using a static CSV file. + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + file: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFile" + id: + description: |- + The unique identifier for this component. Used in other parts of the pipeline to reference this component + (for example, as the `input` to downstream components). + example: enrichment-table-processor + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + type: + $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableProcessorType" + required: + - id + - type + - include + - file + - enabled + type: object + ObservabilityPipelineMetricEnrichmentTableLookupSource: + description: |- + Specifies the source of the key value used for metric enrichment table lookups. + The lookup key can be either the metric name or a metric tag. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableMetricNameLookup" + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableTagLookup" + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup: + description: Uses the metric name as the lookup key for enrichment table matching. + properties: + type: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType" + required: + - type + type: object + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType: + default: metric_name + description: The lookup source type. The value should always be `metric_name`. + enum: [metric_name] + example: metric_name + type: string + x-enum-varnames: + - METRIC_NAME + ObservabilityPipelineMetricEnrichmentTableProcessor: + description: |- + The `enrichment_table` processor enriches metrics with tags from a static CSV file or a Datadog reference table. + It looks up a row using the metric name or a metric tag value. It then adds each column of the matching row as a + metric tag, overwriting any existing tag with the same key. Exactly one of `file` or `reference_table` must be + configured. + + **Supported pipeline types:** metrics + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFileProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor" + x-pipeline-types: [metrics] + ObservabilityPipelineMetricEnrichmentTableReferenceKey: + description: Defines the metric lookup value used as the reference-table row ID. + properties: + source: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableLookupSource" + required: + - source + type: object + ObservabilityPipelineMetricEnrichmentTableReferenceTable: + description: Uses a Datadog reference table to enrich metrics. + properties: + app_key_key: + description: |- + The name of the environment variable or secret that holds the Datadog application key used to access the + reference table. + example: DD_APP_KEY + type: string + columns: + description: |- + A list of column names to include from the reference table. If not provided, all columns are included. + items: + description: The name of a column to include from the reference table. + type: string + maxItems: 50 + type: array + key: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceKey" + table_id: + description: The unique identifier of the reference table. + example: 550e8400-e29b-41d4-a716-446655440000 + type: string + required: + - key + - table_id + type: object + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor: + description: An `enrichment_table` processor that enriches metrics using a Datadog reference table. + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: |- + The unique identifier for this component. Used in other parts of the pipeline to reference this component + (for example, as the `input` to downstream components). + example: enrichment-table-processor + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + reference_table: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceTable" + type: + $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableProcessorType" + required: + - id + - type + - include + - reference_table + - enabled + type: object + ObservabilityPipelineMetricEnrichmentTableTagLookup: + description: Uses a metric tag as the lookup key for enrichment table matching. + properties: + name: + description: The Datadog tag key used as the lookup key. + example: service + maxLength: 200 + type: string + type: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableTagLookupType" + required: + - type + - name + type: object + ObservabilityPipelineMetricEnrichmentTableTagLookupType: + default: tag + description: The lookup source type. The value should always be `tag`. + enum: [tag] + example: tag + type: string + x-enum-varnames: + - TAG ObservabilityPipelineMetricTagsProcessor: description: |- The `metric_tags` processor filters metrics based on their tags using Datadog tag key patterns. diff --git a/examples/v2/observability-pipelines/ValidatePipeline_1795564228.java b/examples/v2/observability-pipelines/ValidatePipeline_1795564228.java new file mode 100644 index 00000000000..560f2af443a --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_1795564228.java @@ -0,0 +1,125 @@ +// Validate a metrics pipeline with enrichment table processor file lookup returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ObservabilityPipelinesApi; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfig; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigDestinationItem; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigPipelineType; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigProcessorGroup; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigProcessorItem; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigSourceItem; +import com.datadog.api.client.v2.model.ObservabilityPipelineDataAttributes; +import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogAgentSource; +import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogAgentSourceType; +import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogMetricsDestination; +import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogMetricsDestinationType; +import com.datadog.api.client.v2.model.ObservabilityPipelineEnrichmentTableFileEncoding; +import com.datadog.api.client.v2.model.ObservabilityPipelineEnrichmentTableFileEncodingType; +import com.datadog.api.client.v2.model.ObservabilityPipelineEnrichmentTableProcessorType; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableFile; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableFileKey; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableFileProcessor; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableLookupSource; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableProcessor; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableTagLookup; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableTagLookupType; +import com.datadog.api.client.v2.model.ObservabilityPipelineSpec; +import com.datadog.api.client.v2.model.ObservabilityPipelineSpecData; +import com.datadog.api.client.v2.model.ValidationResponse; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + ObservabilityPipelinesApi apiInstance = new ObservabilityPipelinesApi(defaultClient); + + ObservabilityPipelineSpec body = + new ObservabilityPipelineSpec() + .data( + new ObservabilityPipelineSpecData() + .attributes( + new ObservabilityPipelineDataAttributes() + .config( + new ObservabilityPipelineConfig() + .pipelineType(ObservabilityPipelineConfigPipelineType.METRICS) + .destinations( + Collections.singletonList( + new ObservabilityPipelineConfigDestinationItem( + new ObservabilityPipelineDatadogMetricsDestination() + .id("datadog-metrics-destination") + .inputs( + Collections.singletonList( + "my-processor-group")) + .type( + ObservabilityPipelineDatadogMetricsDestinationType + .DATADOG_METRICS)))) + .processorGroups( + Collections.singletonList( + new ObservabilityPipelineConfigProcessorGroup() + .enabled(true) + .id("my-processor-group") + .include("*") + .inputs( + Collections.singletonList( + "datadog-agent-source")) + .processors( + Collections.singletonList( + new ObservabilityPipelineConfigProcessorItem( + new ObservabilityPipelineMetricEnrichmentTableProcessor( + new ObservabilityPipelineMetricEnrichmentTableFileProcessor() + .enabled(true) + .id( + "enrichment-table-processor") + .include("*") + .type( + ObservabilityPipelineEnrichmentTableProcessorType + .ENRICHMENT_TABLE) + .file( + new ObservabilityPipelineMetricEnrichmentTableFile() + .encoding( + new ObservabilityPipelineEnrichmentTableFileEncoding() + .delimiter(",") + .type( + ObservabilityPipelineEnrichmentTableFileEncodingType + .CSV) + .includesHeaders( + true)) + .key( + new ObservabilityPipelineMetricEnrichmentTableFileKey() + .column( + "service") + .source( + new ObservabilityPipelineMetricEnrichmentTableLookupSource( + new ObservabilityPipelineMetricEnrichmentTableTagLookup() + .type( + ObservabilityPipelineMetricEnrichmentTableTagLookupType + .TAG) + .name( + "service")))) + .path( + "/etc/enrichment/lookup.csv")))))))) + .sources( + Collections.singletonList( + new ObservabilityPipelineConfigSourceItem( + new ObservabilityPipelineDatadogAgentSource() + .id("datadog-agent-source") + .type( + ObservabilityPipelineDatadogAgentSourceType + .DATADOG_AGENT))))) + .name("Metrics Pipeline with Enrichment Table File Lookup")) + .type("pipelines")); + + try { + ValidationResponse result = apiInstance.validatePipeline(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObservabilityPipelinesApi#validatePipeline"); + 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/examples/v2/observability-pipelines/ValidatePipeline_4239139905.java b/examples/v2/observability-pipelines/ValidatePipeline_4239139905.java new file mode 100644 index 00000000000..5ac15d5beaf --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_4239139905.java @@ -0,0 +1,116 @@ +// Validate a metrics pipeline with enrichment table processor reference table returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ObservabilityPipelinesApi; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfig; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigDestinationItem; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigPipelineType; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigProcessorGroup; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigProcessorItem; +import com.datadog.api.client.v2.model.ObservabilityPipelineConfigSourceItem; +import com.datadog.api.client.v2.model.ObservabilityPipelineDataAttributes; +import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogAgentSource; +import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogAgentSourceType; +import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogMetricsDestination; +import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogMetricsDestinationType; +import com.datadog.api.client.v2.model.ObservabilityPipelineEnrichmentTableProcessorType; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableLookupSource; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableMetricNameLookup; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableProcessor; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableReferenceKey; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableReferenceTable; +import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor; +import com.datadog.api.client.v2.model.ObservabilityPipelineSpec; +import com.datadog.api.client.v2.model.ObservabilityPipelineSpecData; +import com.datadog.api.client.v2.model.ValidationResponse; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + ObservabilityPipelinesApi apiInstance = new ObservabilityPipelinesApi(defaultClient); + + ObservabilityPipelineSpec body = + new ObservabilityPipelineSpec() + .data( + new ObservabilityPipelineSpecData() + .attributes( + new ObservabilityPipelineDataAttributes() + .config( + new ObservabilityPipelineConfig() + .pipelineType(ObservabilityPipelineConfigPipelineType.METRICS) + .destinations( + Collections.singletonList( + new ObservabilityPipelineConfigDestinationItem( + new ObservabilityPipelineDatadogMetricsDestination() + .id("datadog-metrics-destination") + .inputs( + Collections.singletonList( + "my-processor-group")) + .type( + ObservabilityPipelineDatadogMetricsDestinationType + .DATADOG_METRICS)))) + .processorGroups( + Collections.singletonList( + new ObservabilityPipelineConfigProcessorGroup() + .enabled(true) + .id("my-processor-group") + .include("*") + .inputs( + Collections.singletonList( + "datadog-agent-source")) + .processors( + Collections.singletonList( + new ObservabilityPipelineConfigProcessorItem( + new ObservabilityPipelineMetricEnrichmentTableProcessor( + new ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor() + .enabled(true) + .id( + "enrichment-table-processor") + .include("*") + .type( + ObservabilityPipelineEnrichmentTableProcessorType + .ENRICHMENT_TABLE) + .referenceTable( + new ObservabilityPipelineMetricEnrichmentTableReferenceTable() + .tableId( + "metric-enrichment") + .key( + new ObservabilityPipelineMetricEnrichmentTableReferenceKey() + .source( + new ObservabilityPipelineMetricEnrichmentTableLookupSource( + new ObservabilityPipelineMetricEnrichmentTableMetricNameLookup() + .type( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType + .METRIC_NAME)))) + .columns( + Arrays.asList( + "environment", + "team"))))))))) + .sources( + Collections.singletonList( + new ObservabilityPipelineConfigSourceItem( + new ObservabilityPipelineDatadogAgentSource() + .id("datadog-agent-source") + .type( + ObservabilityPipelineDatadogAgentSourceType + .DATADOG_AGENT))))) + .name("Metrics Pipeline with Enrichment Table Reference Table")) + .type("pipelines")); + + try { + ValidationResponse result = apiInstance.validatePipeline(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ObservabilityPipelinesApi#validatePipeline"); + 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/v2/model/ObservabilityPipelineConfigProcessorItem.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfigProcessorItem.java index e3f1a3d6e13..af7d9e07183 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfigProcessorItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfigProcessorItem.java @@ -1311,6 +1311,63 @@ public ObservabilityPipelineConfigProcessorItem deserialize( e); } + // deserialize ObservabilityPipelineMetricEnrichmentTableProcessor + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(Integer.class) + || ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(Long.class) + || ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(Float.class) + || ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(Double.class) + || ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(Boolean.class) + || ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(Integer.class) + || ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(Float.class) + || ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableProcessor.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ObservabilityPipelineMetricEnrichmentTableProcessor.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 (!((ObservabilityPipelineMetricEnrichmentTableProcessor) tmp).unparsed + && !(((ObservabilityPipelineMetricEnrichmentTableProcessor) tmp).getActualInstance() + instanceof UnparsedObject)) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'ObservabilityPipelineMetricEnrichmentTableProcessor'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ObservabilityPipelineMetricEnrichmentTableProcessor'", + e); + } + // deserialize ObservabilityPipelineMetricTagsProcessor try { boolean attemptParsing = true; @@ -1621,6 +1678,12 @@ public ObservabilityPipelineConfigProcessorItem(ObservabilityPipelineAggregatePr setActualInstance(o); } + public ObservabilityPipelineConfigProcessorItem( + ObservabilityPipelineMetricEnrichmentTableProcessor o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public ObservabilityPipelineConfigProcessorItem(ObservabilityPipelineMetricTagsProcessor o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -1711,6 +1774,9 @@ public ObservabilityPipelineConfigProcessorItem( schemas.put( "ObservabilityPipelineAggregateProcessor", new GenericType() {}); + schemas.put( + "ObservabilityPipelineMetricEnrichmentTableProcessor", + new GenericType() {}); schemas.put( "ObservabilityPipelineMetricTagsProcessor", new GenericType() {}); @@ -1743,8 +1809,8 @@ public Map getSchemas() { * ObservabilityPipelineRenameFieldsProcessor, ObservabilityPipelineSampleProcessor, * ObservabilityPipelineSensitiveDataScannerProcessor, ObservabilityPipelineSplitArrayProcessor, * ObservabilityPipelineThrottleProcessor, ObservabilityPipelineAddMetricTagsProcessor, - * ObservabilityPipelineAggregateProcessor, ObservabilityPipelineMetricTagsProcessor, - * ObservabilityPipelineRenameMetricTagsProcessor, + * ObservabilityPipelineAggregateProcessor, ObservabilityPipelineMetricEnrichmentTableProcessor, + * ObservabilityPipelineMetricTagsProcessor, ObservabilityPipelineRenameMetricTagsProcessor, * ObservabilityPipelineTagCardinalityLimitProcessor * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a @@ -1874,6 +1940,13 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf( + ObservabilityPipelineMetricEnrichmentTableProcessor.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf( ObservabilityPipelineMetricTagsProcessor.class, instance, new HashSet>())) { super.setActualInstance(instance); @@ -1912,7 +1985,9 @@ public void setActualInstance(Object instance) { + " ObservabilityPipelineSensitiveDataScannerProcessor," + " ObservabilityPipelineSplitArrayProcessor, ObservabilityPipelineThrottleProcessor," + " ObservabilityPipelineAddMetricTagsProcessor," - + " ObservabilityPipelineAggregateProcessor, ObservabilityPipelineMetricTagsProcessor," + + " ObservabilityPipelineAggregateProcessor," + + " ObservabilityPipelineMetricEnrichmentTableProcessor," + + " ObservabilityPipelineMetricTagsProcessor," + " ObservabilityPipelineRenameMetricTagsProcessor," + " ObservabilityPipelineTagCardinalityLimitProcessor"); } @@ -1930,8 +2005,8 @@ public void setActualInstance(Object instance) { * ObservabilityPipelineRenameFieldsProcessor, ObservabilityPipelineSampleProcessor, * ObservabilityPipelineSensitiveDataScannerProcessor, ObservabilityPipelineSplitArrayProcessor, * ObservabilityPipelineThrottleProcessor, ObservabilityPipelineAddMetricTagsProcessor, - * ObservabilityPipelineAggregateProcessor, ObservabilityPipelineMetricTagsProcessor, - * ObservabilityPipelineRenameMetricTagsProcessor, + * ObservabilityPipelineAggregateProcessor, ObservabilityPipelineMetricEnrichmentTableProcessor, + * ObservabilityPipelineMetricTagsProcessor, ObservabilityPipelineRenameMetricTagsProcessor, * ObservabilityPipelineTagCardinalityLimitProcessor * * @return The actual instance (ObservabilityPipelineFilterProcessor, @@ -1948,6 +2023,7 @@ public void setActualInstance(Object instance) { * ObservabilityPipelineSensitiveDataScannerProcessor, * ObservabilityPipelineSplitArrayProcessor, ObservabilityPipelineThrottleProcessor, * ObservabilityPipelineAddMetricTagsProcessor, ObservabilityPipelineAggregateProcessor, + * ObservabilityPipelineMetricEnrichmentTableProcessor, * ObservabilityPipelineMetricTagsProcessor, ObservabilityPipelineRenameMetricTagsProcessor, * ObservabilityPipelineTagCardinalityLimitProcessor) */ @@ -2253,6 +2329,20 @@ public ObservabilityPipelineAggregateProcessor getObservabilityPipelineAggregate return (ObservabilityPipelineAggregateProcessor) super.getActualInstance(); } + /** + * Get the actual instance of `ObservabilityPipelineMetricEnrichmentTableProcessor`. If the actual + * instance is not `ObservabilityPipelineMetricEnrichmentTableProcessor`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `ObservabilityPipelineMetricEnrichmentTableProcessor` + * @throws ClassCastException if the instance is not + * `ObservabilityPipelineMetricEnrichmentTableProcessor` + */ + public ObservabilityPipelineMetricEnrichmentTableProcessor + getObservabilityPipelineMetricEnrichmentTableProcessor() throws ClassCastException { + return (ObservabilityPipelineMetricEnrichmentTableProcessor) super.getActualInstance(); + } + /** * Get the actual instance of `ObservabilityPipelineMetricTagsProcessor`. If the actual instance * is not `ObservabilityPipelineMetricTagsProcessor`, the ClassCastException will be thrown. diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFile.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFile.java new file mode 100644 index 00000000000..5b0bb3054bc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFile.java @@ -0,0 +1,219 @@ +/* + * 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; + +/** Defines a static enrichment table loaded from a CSV file for metric enrichment. */ +@JsonPropertyOrder({ + ObservabilityPipelineMetricEnrichmentTableFile.JSON_PROPERTY_ENCODING, + ObservabilityPipelineMetricEnrichmentTableFile.JSON_PROPERTY_KEY, + ObservabilityPipelineMetricEnrichmentTableFile.JSON_PROPERTY_PATH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineMetricEnrichmentTableFile { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENCODING = "encoding"; + private ObservabilityPipelineEnrichmentTableFileEncoding encoding; + + public static final String JSON_PROPERTY_KEY = "key"; + private ObservabilityPipelineMetricEnrichmentTableFileKey key; + + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public ObservabilityPipelineMetricEnrichmentTableFile() {} + + @JsonCreator + public ObservabilityPipelineMetricEnrichmentTableFile( + @JsonProperty(required = true, value = JSON_PROPERTY_ENCODING) + ObservabilityPipelineEnrichmentTableFileEncoding encoding, + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) + ObservabilityPipelineMetricEnrichmentTableFileKey key, + @JsonProperty(required = true, value = JSON_PROPERTY_PATH) String path) { + this.encoding = encoding; + this.unparsed |= encoding.unparsed; + this.key = key; + this.unparsed |= key.unparsed; + this.path = path; + } + + public ObservabilityPipelineMetricEnrichmentTableFile encoding( + ObservabilityPipelineEnrichmentTableFileEncoding encoding) { + this.encoding = encoding; + this.unparsed |= encoding.unparsed; + return this; + } + + /** + * File encoding format. + * + * @return encoding + */ + @JsonProperty(JSON_PROPERTY_ENCODING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineEnrichmentTableFileEncoding getEncoding() { + return encoding; + } + + public void setEncoding(ObservabilityPipelineEnrichmentTableFileEncoding encoding) { + this.encoding = encoding; + if (encoding != null) { + this.unparsed |= encoding.unparsed; + } + } + + public ObservabilityPipelineMetricEnrichmentTableFile key( + ObservabilityPipelineMetricEnrichmentTableFileKey key) { + this.key = key; + this.unparsed |= key.unparsed; + return this; + } + + /** + * Defines how to map a metric lookup value to a CSV column during enrichment table lookups. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineMetricEnrichmentTableFileKey getKey() { + return key; + } + + public void setKey(ObservabilityPipelineMetricEnrichmentTableFileKey key) { + this.key = key; + if (key != null) { + this.unparsed |= key.unparsed; + } + } + + public ObservabilityPipelineMetricEnrichmentTableFile path(String path) { + this.path = path; + return this; + } + + /** + * Path to the CSV file. + * + * @return path + */ + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + /** + * 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 ObservabilityPipelineMetricEnrichmentTableFile + */ + @JsonAnySetter + public ObservabilityPipelineMetricEnrichmentTableFile 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 ObservabilityPipelineMetricEnrichmentTableFile object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineMetricEnrichmentTableFile observabilityPipelineMetricEnrichmentTableFile = + (ObservabilityPipelineMetricEnrichmentTableFile) o; + return Objects.equals(this.encoding, observabilityPipelineMetricEnrichmentTableFile.encoding) + && Objects.equals(this.key, observabilityPipelineMetricEnrichmentTableFile.key) + && Objects.equals(this.path, observabilityPipelineMetricEnrichmentTableFile.path) + && Objects.equals( + this.additionalProperties, + observabilityPipelineMetricEnrichmentTableFile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(encoding, key, path, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineMetricEnrichmentTableFile {\n"); + sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).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/ObservabilityPipelineMetricEnrichmentTableFileKey.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFileKey.java new file mode 100644 index 00000000000..142d3525ee9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFileKey.java @@ -0,0 +1,186 @@ +/* + * 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; + +/** Defines how to map a metric lookup value to a CSV column during enrichment table lookups. */ +@JsonPropertyOrder({ + ObservabilityPipelineMetricEnrichmentTableFileKey.JSON_PROPERTY_COLUMN, + ObservabilityPipelineMetricEnrichmentTableFileKey.JSON_PROPERTY_SOURCE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineMetricEnrichmentTableFileKey { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMN = "column"; + private String column; + + public static final String JSON_PROPERTY_SOURCE = "source"; + private ObservabilityPipelineMetricEnrichmentTableLookupSource source; + + public ObservabilityPipelineMetricEnrichmentTableFileKey() {} + + @JsonCreator + public ObservabilityPipelineMetricEnrichmentTableFileKey( + @JsonProperty(required = true, value = JSON_PROPERTY_COLUMN) String column, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) + ObservabilityPipelineMetricEnrichmentTableLookupSource source) { + this.column = column; + this.source = source; + this.unparsed |= source.unparsed; + } + + public ObservabilityPipelineMetricEnrichmentTableFileKey column(String column) { + this.column = column; + return this; + } + + /** + * The CSV column name or index to match against the lookup value. + * + * @return column + */ + @JsonProperty(JSON_PROPERTY_COLUMN) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getColumn() { + return column; + } + + public void setColumn(String column) { + this.column = column; + } + + public ObservabilityPipelineMetricEnrichmentTableFileKey source( + ObservabilityPipelineMetricEnrichmentTableLookupSource source) { + this.source = source; + this.unparsed |= source.unparsed; + return this; + } + + /** + * Specifies the source of the key value used for metric enrichment table lookups. The lookup key + * can be either the metric name or a metric tag. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineMetricEnrichmentTableLookupSource getSource() { + return source; + } + + public void setSource(ObservabilityPipelineMetricEnrichmentTableLookupSource source) { + this.source = source; + if (source != null) { + this.unparsed |= source.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 ObservabilityPipelineMetricEnrichmentTableFileKey + */ + @JsonAnySetter + public ObservabilityPipelineMetricEnrichmentTableFileKey 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 ObservabilityPipelineMetricEnrichmentTableFileKey object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineMetricEnrichmentTableFileKey + observabilityPipelineMetricEnrichmentTableFileKey = + (ObservabilityPipelineMetricEnrichmentTableFileKey) o; + return Objects.equals(this.column, observabilityPipelineMetricEnrichmentTableFileKey.column) + && Objects.equals(this.source, observabilityPipelineMetricEnrichmentTableFileKey.source) + && Objects.equals( + this.additionalProperties, + observabilityPipelineMetricEnrichmentTableFileKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(column, source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineMetricEnrichmentTableFileKey {\n"); + sb.append(" column: ").append(toIndentedString(column)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).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/ObservabilityPipelineMetricEnrichmentTableFileProcessor.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFileProcessor.java new file mode 100644 index 00000000000..fcbd7851fba --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableFileProcessor.java @@ -0,0 +1,311 @@ +/* + * 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; + +/** An enrichment_table processor that enriches metrics using a static CSV file. */ +@JsonPropertyOrder({ + ObservabilityPipelineMetricEnrichmentTableFileProcessor.JSON_PROPERTY_DISPLAY_NAME, + ObservabilityPipelineMetricEnrichmentTableFileProcessor.JSON_PROPERTY_ENABLED, + ObservabilityPipelineMetricEnrichmentTableFileProcessor.JSON_PROPERTY_FILE, + ObservabilityPipelineMetricEnrichmentTableFileProcessor.JSON_PROPERTY_ID, + ObservabilityPipelineMetricEnrichmentTableFileProcessor.JSON_PROPERTY_INCLUDE, + ObservabilityPipelineMetricEnrichmentTableFileProcessor.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineMetricEnrichmentTableFileProcessor { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_FILE = "file"; + private ObservabilityPipelineMetricEnrichmentTableFile file; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INCLUDE = "include"; + private String include; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ObservabilityPipelineEnrichmentTableProcessorType type = + ObservabilityPipelineEnrichmentTableProcessorType.ENRICHMENT_TABLE; + + public ObservabilityPipelineMetricEnrichmentTableFileProcessor() {} + + @JsonCreator + public ObservabilityPipelineMetricEnrichmentTableFileProcessor( + @JsonProperty(required = true, value = JSON_PROPERTY_ENABLED) Boolean enabled, + @JsonProperty(required = true, value = JSON_PROPERTY_FILE) + ObservabilityPipelineMetricEnrichmentTableFile file, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDE) String include, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ObservabilityPipelineEnrichmentTableProcessorType type) { + this.enabled = enabled; + this.file = file; + this.unparsed |= file.unparsed; + this.id = id; + this.include = include; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ObservabilityPipelineMetricEnrichmentTableFileProcessor displayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The display name for a component. + * + * @return displayName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public ObservabilityPipelineMetricEnrichmentTableFileProcessor enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the processor is enabled. + * + * @return enabled + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ObservabilityPipelineMetricEnrichmentTableFileProcessor file( + ObservabilityPipelineMetricEnrichmentTableFile file) { + this.file = file; + this.unparsed |= file.unparsed; + return this; + } + + /** + * Defines a static enrichment table loaded from a CSV file for metric enrichment. + * + * @return file + */ + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineMetricEnrichmentTableFile getFile() { + return file; + } + + public void setFile(ObservabilityPipelineMetricEnrichmentTableFile file) { + this.file = file; + if (file != null) { + this.unparsed |= file.unparsed; + } + } + + public ObservabilityPipelineMetricEnrichmentTableFileProcessor id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier for this component. Used in other parts of the pipeline to reference this + * component (for example, as the input to downstream components). + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ObservabilityPipelineMetricEnrichmentTableFileProcessor include(String include) { + this.include = include; + return this; + } + + /** + * A Datadog search query used to determine which metrics this processor targets. + * + * @return include + */ + @JsonProperty(JSON_PROPERTY_INCLUDE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInclude() { + return include; + } + + public void setInclude(String include) { + this.include = include; + } + + public ObservabilityPipelineMetricEnrichmentTableFileProcessor type( + ObservabilityPipelineEnrichmentTableProcessorType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The processor type. The value should always be enrichment_table. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineEnrichmentTableProcessorType getType() { + return type; + } + + public void setType(ObservabilityPipelineEnrichmentTableProcessorType 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 ObservabilityPipelineMetricEnrichmentTableFileProcessor + */ + @JsonAnySetter + public ObservabilityPipelineMetricEnrichmentTableFileProcessor 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 ObservabilityPipelineMetricEnrichmentTableFileProcessor object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineMetricEnrichmentTableFileProcessor + observabilityPipelineMetricEnrichmentTableFileProcessor = + (ObservabilityPipelineMetricEnrichmentTableFileProcessor) o; + return Objects.equals( + this.displayName, observabilityPipelineMetricEnrichmentTableFileProcessor.displayName) + && Objects.equals( + this.enabled, observabilityPipelineMetricEnrichmentTableFileProcessor.enabled) + && Objects.equals(this.file, observabilityPipelineMetricEnrichmentTableFileProcessor.file) + && Objects.equals(this.id, observabilityPipelineMetricEnrichmentTableFileProcessor.id) + && Objects.equals( + this.include, observabilityPipelineMetricEnrichmentTableFileProcessor.include) + && Objects.equals(this.type, observabilityPipelineMetricEnrichmentTableFileProcessor.type) + && Objects.equals( + this.additionalProperties, + observabilityPipelineMetricEnrichmentTableFileProcessor.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, enabled, file, id, include, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineMetricEnrichmentTableFileProcessor {\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" include: ").append(toIndentedString(include)).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/ObservabilityPipelineMetricEnrichmentTableLookupSource.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableLookupSource.java new file mode 100644 index 00000000000..67774933171 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableLookupSource.java @@ -0,0 +1,345 @@ +/* + * 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 = + ObservabilityPipelineMetricEnrichmentTableLookupSource + .ObservabilityPipelineMetricEnrichmentTableLookupSourceDeserializer.class) +@JsonSerialize( + using = + ObservabilityPipelineMetricEnrichmentTableLookupSource + .ObservabilityPipelineMetricEnrichmentTableLookupSourceSerializer.class) +public class ObservabilityPipelineMetricEnrichmentTableLookupSource extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(ObservabilityPipelineMetricEnrichmentTableLookupSource.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ObservabilityPipelineMetricEnrichmentTableLookupSourceSerializer + extends StdSerializer { + public ObservabilityPipelineMetricEnrichmentTableLookupSourceSerializer( + Class t) { + super(t); + } + + public ObservabilityPipelineMetricEnrichmentTableLookupSourceSerializer() { + this(null); + } + + @Override + public void serialize( + ObservabilityPipelineMetricEnrichmentTableLookupSource value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ObservabilityPipelineMetricEnrichmentTableLookupSourceDeserializer + extends StdDeserializer { + public ObservabilityPipelineMetricEnrichmentTableLookupSourceDeserializer() { + this(ObservabilityPipelineMetricEnrichmentTableLookupSource.class); + } + + public ObservabilityPipelineMetricEnrichmentTableLookupSourceDeserializer(Class vc) { + super(vc); + } + + @Override + public ObservabilityPipelineMetricEnrichmentTableLookupSource 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 ObservabilityPipelineMetricEnrichmentTableMetricNameLookup + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals(Integer.class) + || ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals(Long.class) + || ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals(Float.class) + || ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals(Double.class) + || ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals( + Boolean.class) + || ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals( + String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals( + Integer.class) + || ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals( + Float.class) + || ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals( + Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class.equals( + String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.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 (!((ObservabilityPipelineMetricEnrichmentTableMetricNameLookup) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema" + + " 'ObservabilityPipelineMetricEnrichmentTableMetricNameLookup'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ObservabilityPipelineMetricEnrichmentTableMetricNameLookup'", + e); + } + + // deserialize ObservabilityPipelineMetricEnrichmentTableTagLookup + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(Integer.class) + || ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(Long.class) + || ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(Float.class) + || ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(Double.class) + || ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(Boolean.class) + || ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(Integer.class) + || ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(Float.class) + || ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableTagLookup.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ObservabilityPipelineMetricEnrichmentTableTagLookup.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 (!((ObservabilityPipelineMetricEnrichmentTableTagLookup) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'ObservabilityPipelineMetricEnrichmentTableTagLookup'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ObservabilityPipelineMetricEnrichmentTableTagLookup'", + e); + } + + ObservabilityPipelineMetricEnrichmentTableLookupSource ret = + new ObservabilityPipelineMetricEnrichmentTableLookupSource(); + 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 ObservabilityPipelineMetricEnrichmentTableLookupSource getNullValue( + DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), + "ObservabilityPipelineMetricEnrichmentTableLookupSource cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ObservabilityPipelineMetricEnrichmentTableLookupSource() { + super("oneOf", Boolean.FALSE); + } + + public ObservabilityPipelineMetricEnrichmentTableLookupSource( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ObservabilityPipelineMetricEnrichmentTableLookupSource( + ObservabilityPipelineMetricEnrichmentTableTagLookup o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "ObservabilityPipelineMetricEnrichmentTableMetricNameLookup", + new GenericType() {}); + schemas.put( + "ObservabilityPipelineMetricEnrichmentTableTagLookup", + new GenericType() {}); + JSON.registerDescendants( + ObservabilityPipelineMetricEnrichmentTableLookupSource.class, + Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ObservabilityPipelineMetricEnrichmentTableLookupSource.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + * ObservabilityPipelineMetricEnrichmentTableTagLookup + * + *

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( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + ObservabilityPipelineMetricEnrichmentTableTagLookup.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 ObservabilityPipelineMetricEnrichmentTableMetricNameLookup," + + " ObservabilityPipelineMetricEnrichmentTableTagLookup"); + } + + /** + * Get the actual instance, which can be the following: + * ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + * ObservabilityPipelineMetricEnrichmentTableTagLookup + * + * @return The actual instance (ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + * ObservabilityPipelineMetricEnrichmentTableTagLookup) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ObservabilityPipelineMetricEnrichmentTableMetricNameLookup`. If the + * actual instance is not `ObservabilityPipelineMetricEnrichmentTableMetricNameLookup`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `ObservabilityPipelineMetricEnrichmentTableMetricNameLookup` + * @throws ClassCastException if the instance is not + * `ObservabilityPipelineMetricEnrichmentTableMetricNameLookup` + */ + public ObservabilityPipelineMetricEnrichmentTableMetricNameLookup + getObservabilityPipelineMetricEnrichmentTableMetricNameLookup() throws ClassCastException { + return (ObservabilityPipelineMetricEnrichmentTableMetricNameLookup) super.getActualInstance(); + } + + /** + * Get the actual instance of `ObservabilityPipelineMetricEnrichmentTableTagLookup`. If the actual + * instance is not `ObservabilityPipelineMetricEnrichmentTableTagLookup`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `ObservabilityPipelineMetricEnrichmentTableTagLookup` + * @throws ClassCastException if the instance is not + * `ObservabilityPipelineMetricEnrichmentTableTagLookup` + */ + public ObservabilityPipelineMetricEnrichmentTableTagLookup + getObservabilityPipelineMetricEnrichmentTableTagLookup() throws ClassCastException { + return (ObservabilityPipelineMetricEnrichmentTableTagLookup) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.java new file mode 100644 index 00000000000..5f5e46a3e7e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.java @@ -0,0 +1,160 @@ +/* + * 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; + +/** Uses the metric name as the lookup key for enrichment table matching. */ +@JsonPropertyOrder({ObservabilityPipelineMetricEnrichmentTableMetricNameLookup.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineMetricEnrichmentTableMetricNameLookup { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType type = + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType.METRIC_NAME; + + public ObservabilityPipelineMetricEnrichmentTableMetricNameLookup() {} + + @JsonCreator + public ObservabilityPipelineMetricEnrichmentTableMetricNameLookup( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ObservabilityPipelineMetricEnrichmentTableMetricNameLookup type( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The lookup source type. The value should always be metric_name. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType getType() { + return type; + } + + public void setType(ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType 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 ObservabilityPipelineMetricEnrichmentTableMetricNameLookup + */ + @JsonAnySetter + public ObservabilityPipelineMetricEnrichmentTableMetricNameLookup 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 ObservabilityPipelineMetricEnrichmentTableMetricNameLookup object is equal + * to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup + observabilityPipelineMetricEnrichmentTableMetricNameLookup = + (ObservabilityPipelineMetricEnrichmentTableMetricNameLookup) o; + return Objects.equals( + this.type, observabilityPipelineMetricEnrichmentTableMetricNameLookup.type) + && Objects.equals( + this.additionalProperties, + observabilityPipelineMetricEnrichmentTableMetricNameLookup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineMetricEnrichmentTableMetricNameLookup {\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/ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType.java new file mode 100644 index 00000000000..d6dc877aa82 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType.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; + +/** The lookup source type. The value should always be metric_name. */ +@JsonSerialize( + using = + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType + .ObservabilityPipelineMetricEnrichmentTableMetricNameLookupTypeSerializer.class) +public class ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType + extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("metric_name")); + + public static final ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType METRIC_NAME = + new ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType("metric_name"); + + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType(String value) { + super(value, allowedValues); + } + + public static class ObservabilityPipelineMetricEnrichmentTableMetricNameLookupTypeSerializer + extends StdSerializer { + public ObservabilityPipelineMetricEnrichmentTableMetricNameLookupTypeSerializer( + Class t) { + super(t); + } + + public ObservabilityPipelineMetricEnrichmentTableMetricNameLookupTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType fromValue( + String value) { + return new ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableProcessor.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableProcessor.java new file mode 100644 index 00000000000..57f93eb9db1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableProcessor.java @@ -0,0 +1,355 @@ +/* + * 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 = + ObservabilityPipelineMetricEnrichmentTableProcessor + .ObservabilityPipelineMetricEnrichmentTableProcessorDeserializer.class) +@JsonSerialize( + using = + ObservabilityPipelineMetricEnrichmentTableProcessor + .ObservabilityPipelineMetricEnrichmentTableProcessorSerializer.class) +public class ObservabilityPipelineMetricEnrichmentTableProcessor extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(ObservabilityPipelineMetricEnrichmentTableProcessor.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class ObservabilityPipelineMetricEnrichmentTableProcessorSerializer + extends StdSerializer { + public ObservabilityPipelineMetricEnrichmentTableProcessorSerializer( + Class t) { + super(t); + } + + public ObservabilityPipelineMetricEnrichmentTableProcessorSerializer() { + this(null); + } + + @Override + public void serialize( + ObservabilityPipelineMetricEnrichmentTableProcessor value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ObservabilityPipelineMetricEnrichmentTableProcessorDeserializer + extends StdDeserializer { + public ObservabilityPipelineMetricEnrichmentTableProcessorDeserializer() { + this(ObservabilityPipelineMetricEnrichmentTableProcessor.class); + } + + public ObservabilityPipelineMetricEnrichmentTableProcessorDeserializer(Class vc) { + super(vc); + } + + @Override + public ObservabilityPipelineMetricEnrichmentTableProcessor 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 ObservabilityPipelineMetricEnrichmentTableFileProcessor + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(Integer.class) + || ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(Long.class) + || ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(Float.class) + || ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(Double.class) + || ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(Boolean.class) + || ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals( + Integer.class) + || ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(Float.class) + || ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableFileProcessor.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(ObservabilityPipelineMetricEnrichmentTableFileProcessor.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 (!((ObservabilityPipelineMetricEnrichmentTableFileProcessor) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema" + + " 'ObservabilityPipelineMetricEnrichmentTableFileProcessor'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ObservabilityPipelineMetricEnrichmentTableFileProcessor'", + e); + } + + // deserialize ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + Integer.class) + || ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + Long.class) + || ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + Float.class) + || ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + Double.class) + || ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + Boolean.class) + || ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + Integer.class) + || ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class + .equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + Float.class) + || ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class + .equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.class.equals( + String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs( + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.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 (!((ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema" + + " 'ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor'", + e); + } + + ObservabilityPipelineMetricEnrichmentTableProcessor ret = + new ObservabilityPipelineMetricEnrichmentTableProcessor(); + 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 ObservabilityPipelineMetricEnrichmentTableProcessor getNullValue( + DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "ObservabilityPipelineMetricEnrichmentTableProcessor cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public ObservabilityPipelineMetricEnrichmentTableProcessor() { + super("oneOf", Boolean.FALSE); + } + + public ObservabilityPipelineMetricEnrichmentTableProcessor( + ObservabilityPipelineMetricEnrichmentTableFileProcessor o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ObservabilityPipelineMetricEnrichmentTableProcessor( + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "ObservabilityPipelineMetricEnrichmentTableFileProcessor", + new GenericType() {}); + schemas.put( + "ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor", + new GenericType() {}); + JSON.registerDescendants( + ObservabilityPipelineMetricEnrichmentTableProcessor.class, + Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return ObservabilityPipelineMetricEnrichmentTableProcessor.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ObservabilityPipelineMetricEnrichmentTableFileProcessor, + * ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor + * + *

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( + ObservabilityPipelineMetricEnrichmentTableFileProcessor.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.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 ObservabilityPipelineMetricEnrichmentTableFileProcessor," + + " ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor"); + } + + /** + * Get the actual instance, which can be the following: + * ObservabilityPipelineMetricEnrichmentTableFileProcessor, + * ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor + * + * @return The actual instance (ObservabilityPipelineMetricEnrichmentTableFileProcessor, + * ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ObservabilityPipelineMetricEnrichmentTableFileProcessor`. If the + * actual instance is not `ObservabilityPipelineMetricEnrichmentTableFileProcessor`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `ObservabilityPipelineMetricEnrichmentTableFileProcessor` + * @throws ClassCastException if the instance is not + * `ObservabilityPipelineMetricEnrichmentTableFileProcessor` + */ + public ObservabilityPipelineMetricEnrichmentTableFileProcessor + getObservabilityPipelineMetricEnrichmentTableFileProcessor() throws ClassCastException { + return (ObservabilityPipelineMetricEnrichmentTableFileProcessor) super.getActualInstance(); + } + + /** + * Get the actual instance of `ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor`. + * If the actual instance is not + * `ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor`, the ClassCastException + * will be thrown. + * + * @return The actual instance of + * `ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor` + * @throws ClassCastException if the instance is not + * `ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor` + */ + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor + getObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor() + throws ClassCastException { + return (ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor) + super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceKey.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceKey.java new file mode 100644 index 00000000000..c4f58b16261 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceKey.java @@ -0,0 +1,160 @@ +/* + * 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; + +/** Defines the metric lookup value used as the reference-table row ID. */ +@JsonPropertyOrder({ObservabilityPipelineMetricEnrichmentTableReferenceKey.JSON_PROPERTY_SOURCE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineMetricEnrichmentTableReferenceKey { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SOURCE = "source"; + private ObservabilityPipelineMetricEnrichmentTableLookupSource source; + + public ObservabilityPipelineMetricEnrichmentTableReferenceKey() {} + + @JsonCreator + public ObservabilityPipelineMetricEnrichmentTableReferenceKey( + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) + ObservabilityPipelineMetricEnrichmentTableLookupSource source) { + this.source = source; + this.unparsed |= source.unparsed; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceKey source( + ObservabilityPipelineMetricEnrichmentTableLookupSource source) { + this.source = source; + this.unparsed |= source.unparsed; + return this; + } + + /** + * Specifies the source of the key value used for metric enrichment table lookups. The lookup key + * can be either the metric name or a metric tag. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineMetricEnrichmentTableLookupSource getSource() { + return source; + } + + public void setSource(ObservabilityPipelineMetricEnrichmentTableLookupSource source) { + this.source = source; + if (source != null) { + this.unparsed |= source.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 ObservabilityPipelineMetricEnrichmentTableReferenceKey + */ + @JsonAnySetter + public ObservabilityPipelineMetricEnrichmentTableReferenceKey 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 ObservabilityPipelineMetricEnrichmentTableReferenceKey object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineMetricEnrichmentTableReferenceKey + observabilityPipelineMetricEnrichmentTableReferenceKey = + (ObservabilityPipelineMetricEnrichmentTableReferenceKey) o; + return Objects.equals( + this.source, observabilityPipelineMetricEnrichmentTableReferenceKey.source) + && Objects.equals( + this.additionalProperties, + observabilityPipelineMetricEnrichmentTableReferenceKey.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(source, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineMetricEnrichmentTableReferenceKey {\n"); + sb.append(" source: ").append(toIndentedString(source)).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/ObservabilityPipelineMetricEnrichmentTableReferenceTable.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceTable.java new file mode 100644 index 00000000000..f1e1b6cab48 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceTable.java @@ -0,0 +1,258 @@ +/* + * 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; + +/** Uses a Datadog reference table to enrich metrics. */ +@JsonPropertyOrder({ + ObservabilityPipelineMetricEnrichmentTableReferenceTable.JSON_PROPERTY_APP_KEY_KEY, + ObservabilityPipelineMetricEnrichmentTableReferenceTable.JSON_PROPERTY_COLUMNS, + ObservabilityPipelineMetricEnrichmentTableReferenceTable.JSON_PROPERTY_KEY, + ObservabilityPipelineMetricEnrichmentTableReferenceTable.JSON_PROPERTY_TABLE_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineMetricEnrichmentTableReferenceTable { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APP_KEY_KEY = "app_key_key"; + private String appKeyKey; + + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = null; + + public static final String JSON_PROPERTY_KEY = "key"; + private ObservabilityPipelineMetricEnrichmentTableReferenceKey key; + + public static final String JSON_PROPERTY_TABLE_ID = "table_id"; + private String tableId; + + public ObservabilityPipelineMetricEnrichmentTableReferenceTable() {} + + @JsonCreator + public ObservabilityPipelineMetricEnrichmentTableReferenceTable( + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) + ObservabilityPipelineMetricEnrichmentTableReferenceKey key, + @JsonProperty(required = true, value = JSON_PROPERTY_TABLE_ID) String tableId) { + this.key = key; + this.unparsed |= key.unparsed; + this.tableId = tableId; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTable appKeyKey(String appKeyKey) { + this.appKeyKey = appKeyKey; + return this; + } + + /** + * The name of the environment variable or secret that holds the Datadog application key used to + * access the reference table. + * + * @return appKeyKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APP_KEY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppKeyKey() { + return appKeyKey; + } + + public void setAppKeyKey(String appKeyKey) { + this.appKeyKey = appKeyKey; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTable columns(List columns) { + this.columns = columns; + return this; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTable addColumnsItem( + String columnsItem) { + if (this.columns == null) { + this.columns = new ArrayList<>(); + } + this.columns.add(columnsItem); + return this; + } + + /** + * A list of column names to include from the reference table. If not provided, all columns are + * included. + * + * @return columns + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTable key( + ObservabilityPipelineMetricEnrichmentTableReferenceKey key) { + this.key = key; + this.unparsed |= key.unparsed; + return this; + } + + /** + * Defines the metric lookup value used as the reference-table row ID. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineMetricEnrichmentTableReferenceKey getKey() { + return key; + } + + public void setKey(ObservabilityPipelineMetricEnrichmentTableReferenceKey key) { + this.key = key; + if (key != null) { + this.unparsed |= key.unparsed; + } + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTable tableId(String tableId) { + this.tableId = tableId; + return this; + } + + /** + * The unique identifier of the reference table. + * + * @return tableId + */ + @JsonProperty(JSON_PROPERTY_TABLE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTableId() { + return tableId; + } + + public void setTableId(String tableId) { + this.tableId = tableId; + } + + /** + * 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 ObservabilityPipelineMetricEnrichmentTableReferenceTable + */ + @JsonAnySetter + public ObservabilityPipelineMetricEnrichmentTableReferenceTable 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 ObservabilityPipelineMetricEnrichmentTableReferenceTable object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineMetricEnrichmentTableReferenceTable + observabilityPipelineMetricEnrichmentTableReferenceTable = + (ObservabilityPipelineMetricEnrichmentTableReferenceTable) o; + return Objects.equals( + this.appKeyKey, observabilityPipelineMetricEnrichmentTableReferenceTable.appKeyKey) + && Objects.equals( + this.columns, observabilityPipelineMetricEnrichmentTableReferenceTable.columns) + && Objects.equals(this.key, observabilityPipelineMetricEnrichmentTableReferenceTable.key) + && Objects.equals( + this.tableId, observabilityPipelineMetricEnrichmentTableReferenceTable.tableId) + && Objects.equals( + this.additionalProperties, + observabilityPipelineMetricEnrichmentTableReferenceTable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appKeyKey, columns, key, tableId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineMetricEnrichmentTableReferenceTable {\n"); + sb.append(" appKeyKey: ").append(toIndentedString(appKeyKey)).append("\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" tableId: ").append(toIndentedString(tableId)).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/ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.java new file mode 100644 index 00000000000..50508c40d58 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.java @@ -0,0 +1,322 @@ +/* + * 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; + +/** + * An enrichment_table processor that enriches metrics using a Datadog reference table. + */ +@JsonPropertyOrder({ + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.JSON_PROPERTY_DISPLAY_NAME, + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.JSON_PROPERTY_ENABLED, + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.JSON_PROPERTY_ID, + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.JSON_PROPERTY_INCLUDE, + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.JSON_PROPERTY_REFERENCE_TABLE, + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DISPLAY_NAME = "display_name"; + private String displayName; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INCLUDE = "include"; + private String include; + + public static final String JSON_PROPERTY_REFERENCE_TABLE = "reference_table"; + private ObservabilityPipelineMetricEnrichmentTableReferenceTable referenceTable; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ObservabilityPipelineEnrichmentTableProcessorType type = + ObservabilityPipelineEnrichmentTableProcessorType.ENRICHMENT_TABLE; + + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor() {} + + @JsonCreator + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor( + @JsonProperty(required = true, value = JSON_PROPERTY_ENABLED) Boolean enabled, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDE) String include, + @JsonProperty(required = true, value = JSON_PROPERTY_REFERENCE_TABLE) + ObservabilityPipelineMetricEnrichmentTableReferenceTable referenceTable, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ObservabilityPipelineEnrichmentTableProcessorType type) { + this.enabled = enabled; + this.id = id; + this.include = include; + this.referenceTable = referenceTable; + this.unparsed |= referenceTable.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor displayName( + String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The display name for a component. + * + * @return displayName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor enabled( + Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the processor is enabled. + * + * @return enabled + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier for this component. Used in other parts of the pipeline to reference this + * component (for example, as the input to downstream components). + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor include(String include) { + this.include = include; + return this; + } + + /** + * A Datadog search query used to determine which metrics this processor targets. + * + * @return include + */ + @JsonProperty(JSON_PROPERTY_INCLUDE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInclude() { + return include; + } + + public void setInclude(String include) { + this.include = include; + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor referenceTable( + ObservabilityPipelineMetricEnrichmentTableReferenceTable referenceTable) { + this.referenceTable = referenceTable; + this.unparsed |= referenceTable.unparsed; + return this; + } + + /** + * Uses a Datadog reference table to enrich metrics. + * + * @return referenceTable + */ + @JsonProperty(JSON_PROPERTY_REFERENCE_TABLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineMetricEnrichmentTableReferenceTable getReferenceTable() { + return referenceTable; + } + + public void setReferenceTable( + ObservabilityPipelineMetricEnrichmentTableReferenceTable referenceTable) { + this.referenceTable = referenceTable; + if (referenceTable != null) { + this.unparsed |= referenceTable.unparsed; + } + } + + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor type( + ObservabilityPipelineEnrichmentTableProcessorType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The processor type. The value should always be enrichment_table. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineEnrichmentTableProcessorType getType() { + return type; + } + + public void setType(ObservabilityPipelineEnrichmentTableProcessorType 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 ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor + */ + @JsonAnySetter + public ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor 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 ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor object is + * equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor + observabilityPipelineMetricEnrichmentTableReferenceTableProcessor = + (ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor) o; + return Objects.equals( + this.displayName, + observabilityPipelineMetricEnrichmentTableReferenceTableProcessor.displayName) + && Objects.equals( + this.enabled, observabilityPipelineMetricEnrichmentTableReferenceTableProcessor.enabled) + && Objects.equals( + this.id, observabilityPipelineMetricEnrichmentTableReferenceTableProcessor.id) + && Objects.equals( + this.include, observabilityPipelineMetricEnrichmentTableReferenceTableProcessor.include) + && Objects.equals( + this.referenceTable, + observabilityPipelineMetricEnrichmentTableReferenceTableProcessor.referenceTable) + && Objects.equals( + this.type, observabilityPipelineMetricEnrichmentTableReferenceTableProcessor.type) + && Objects.equals( + this.additionalProperties, + observabilityPipelineMetricEnrichmentTableReferenceTableProcessor.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + displayName, enabled, id, include, referenceTable, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor {\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" include: ").append(toIndentedString(include)).append("\n"); + sb.append(" referenceTable: ").append(toIndentedString(referenceTable)).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/ObservabilityPipelineMetricEnrichmentTableTagLookup.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableTagLookup.java new file mode 100644 index 00000000000..4d27fa8954f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableTagLookup.java @@ -0,0 +1,188 @@ +/* + * 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; + +/** Uses a metric tag as the lookup key for enrichment table matching. */ +@JsonPropertyOrder({ + ObservabilityPipelineMetricEnrichmentTableTagLookup.JSON_PROPERTY_NAME, + ObservabilityPipelineMetricEnrichmentTableTagLookup.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineMetricEnrichmentTableTagLookup { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ObservabilityPipelineMetricEnrichmentTableTagLookupType type = + ObservabilityPipelineMetricEnrichmentTableTagLookupType.TAG; + + public ObservabilityPipelineMetricEnrichmentTableTagLookup() {} + + @JsonCreator + public ObservabilityPipelineMetricEnrichmentTableTagLookup( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ObservabilityPipelineMetricEnrichmentTableTagLookupType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ObservabilityPipelineMetricEnrichmentTableTagLookup name(String name) { + this.name = name; + return this; + } + + /** + * The Datadog tag key used as the lookup key. + * + * @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 ObservabilityPipelineMetricEnrichmentTableTagLookup type( + ObservabilityPipelineMetricEnrichmentTableTagLookupType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The lookup source type. The value should always be tag. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ObservabilityPipelineMetricEnrichmentTableTagLookupType getType() { + return type; + } + + public void setType(ObservabilityPipelineMetricEnrichmentTableTagLookupType 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 ObservabilityPipelineMetricEnrichmentTableTagLookup + */ + @JsonAnySetter + public ObservabilityPipelineMetricEnrichmentTableTagLookup 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 ObservabilityPipelineMetricEnrichmentTableTagLookup object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineMetricEnrichmentTableTagLookup + observabilityPipelineMetricEnrichmentTableTagLookup = + (ObservabilityPipelineMetricEnrichmentTableTagLookup) o; + return Objects.equals(this.name, observabilityPipelineMetricEnrichmentTableTagLookup.name) + && Objects.equals(this.type, observabilityPipelineMetricEnrichmentTableTagLookup.type) + && Objects.equals( + this.additionalProperties, + observabilityPipelineMetricEnrichmentTableTagLookup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineMetricEnrichmentTableTagLookup {\n"); + sb.append(" name: ").append(toIndentedString(name)).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/ObservabilityPipelineMetricEnrichmentTableTagLookupType.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableTagLookupType.java new file mode 100644 index 00000000000..d1ec965046d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineMetricEnrichmentTableTagLookupType.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; + +/** The lookup source type. The value should always be tag. */ +@JsonSerialize( + using = + ObservabilityPipelineMetricEnrichmentTableTagLookupType + .ObservabilityPipelineMetricEnrichmentTableTagLookupTypeSerializer.class) +public class ObservabilityPipelineMetricEnrichmentTableTagLookupType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("tag")); + + public static final ObservabilityPipelineMetricEnrichmentTableTagLookupType TAG = + new ObservabilityPipelineMetricEnrichmentTableTagLookupType("tag"); + + ObservabilityPipelineMetricEnrichmentTableTagLookupType(String value) { + super(value, allowedValues); + } + + public static class ObservabilityPipelineMetricEnrichmentTableTagLookupTypeSerializer + extends StdSerializer { + public ObservabilityPipelineMetricEnrichmentTableTagLookupTypeSerializer( + Class t) { + super(t); + } + + public ObservabilityPipelineMetricEnrichmentTableTagLookupTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ObservabilityPipelineMetricEnrichmentTableTagLookupType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ObservabilityPipelineMetricEnrichmentTableTagLookupType fromValue(String value) { + return new ObservabilityPipelineMetricEnrichmentTableTagLookupType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/observability_pipelines.feature b/src/test/resources/com/datadog/api/client/v2/api/observability_pipelines.feature index 78729ae2e8b..a25563f62ae 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/observability_pipelines.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/observability_pipelines.feature @@ -149,6 +149,22 @@ Feature: Observability Pipelines And the response "data.attributes.config.destinations" has length 1 And the response "data.attributes.config.destinations[0].id" is equal to "updated-datadog-logs-destination-id" + @team:DataDog/observability-pipelines + Scenario: Validate a metrics pipeline with enrichment table processor file lookup returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"pipeline_type": "metrics", "destinations": [{"id": "datadog-metrics-destination", "inputs": ["my-processor-group"], "type": "datadog_metrics"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "*", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "enrichment-table-processor", "include": "*", "type": "enrichment_table", "file": {"encoding": {"delimiter": ",", "type": "csv", "includes_headers": true}, "key": {"column": "service", "source": {"type": "tag", "name": "service"}}, "path": "/etc/enrichment/lookup.csv"}}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Metrics Pipeline with Enrichment Table File Lookup"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + + @team:DataDog/observability-pipelines + Scenario: Validate a metrics pipeline with enrichment table processor reference table returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"pipeline_type": "metrics", "destinations": [{"id": "datadog-metrics-destination", "inputs": ["my-processor-group"], "type": "datadog_metrics"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "*", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "enrichment-table-processor", "include": "*", "type": "enrichment_table", "reference_table": {"table_id": "metric-enrichment", "key": {"source": {"type": "metric_name"}}, "columns": ["environment", "team"]}}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Metrics Pipeline with Enrichment Table Reference Table"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + @team:DataDog/observability-pipelines Scenario: Validate a metrics pipeline with opentelemetry source returns "OK" response Given new "ValidatePipeline" request diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index 64ce8c4b210..3cab5b2068e 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -7952,6 +7952,20 @@ "scenario": "Update a pipeline returns \"OK\" response", "version": "v2" }, + { + "feature": "Observability Pipelines", + "feature_file": "../../com/datadog/api/client/v2/api/observability_pipelines.feature", + "file": "v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json", + "scenario": "Validate a metrics pipeline with enrichment table processor file lookup returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Observability Pipelines", + "feature_file": "../../com/datadog/api/client/v2/api/observability_pipelines.feature", + "file": "v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json", + "scenario": "Validate a metrics pipeline with enrichment table processor reference table returns \"OK\" response", + "version": "v2" + }, { "feature": "Observability Pipelines", "feature_file": "../../com/datadog/api/client/v2/api/observability_pipelines.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json new file mode 100644 index 00000000000..1e6e133340c --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json @@ -0,0 +1,84 @@ +{ + "api": "ObservabilityPipelines", + "expected_status": 200, + "feature": "Observability Pipelines", + "id": "v2/Observability Pipelines/Validate a metrics pipeline with enrichment table processor file lookup returns \"OK\" response", + "operation_id": "ValidatePipeline", + "request": { + "body": { + "schema": { + "format": null, + "ref": "ObservabilityPipelineSpec", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "config": { + "destinations": [ + { + "id": "datadog-metrics-destination", + "inputs": [ + "my-processor-group" + ], + "type": "datadog_metrics" + } + ], + "pipeline_type": "metrics", + "processor_groups": [ + { + "enabled": true, + "id": "my-processor-group", + "include": "*", + "inputs": [ + "datadog-agent-source" + ], + "processors": [ + { + "enabled": true, + "file": { + "encoding": { + "delimiter": ",", + "includes_headers": true, + "type": "csv" + }, + "key": { + "column": "service", + "source": { + "name": "service", + "type": "tag" + } + }, + "path": "/etc/enrichment/lookup.csv" + }, + "id": "enrichment-table-processor", + "include": "*", + "type": "enrichment_table" + } + ] + } + ], + "sources": [ + { + "id": "datadog-agent-source", + "type": "datadog_agent" + } + ] + }, + "name": "Metrics Pipeline with Enrichment Table File Lookup" + }, + "type": "pipelines" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/obs-pipelines/pipelines/validate" + }, + "scenario": "Validate a metrics pipeline with enrichment table processor file lookup returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json new file mode 100644 index 00000000000..a9750587c7b --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json @@ -0,0 +1,81 @@ +{ + "api": "ObservabilityPipelines", + "expected_status": 200, + "feature": "Observability Pipelines", + "id": "v2/Observability Pipelines/Validate a metrics pipeline with enrichment table processor reference table returns \"OK\" response", + "operation_id": "ValidatePipeline", + "request": { + "body": { + "schema": { + "format": null, + "ref": "ObservabilityPipelineSpec", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "config": { + "destinations": [ + { + "id": "datadog-metrics-destination", + "inputs": [ + "my-processor-group" + ], + "type": "datadog_metrics" + } + ], + "pipeline_type": "metrics", + "processor_groups": [ + { + "enabled": true, + "id": "my-processor-group", + "include": "*", + "inputs": [ + "datadog-agent-source" + ], + "processors": [ + { + "enabled": true, + "id": "enrichment-table-processor", + "include": "*", + "reference_table": { + "columns": [ + "environment", + "team" + ], + "key": { + "source": { + "type": "metric_name" + } + }, + "table_id": "metric-enrichment" + }, + "type": "enrichment_table" + } + ] + } + ], + "sources": [ + { + "id": "datadog-agent-source", + "type": "datadog_agent" + } + ] + }, + "name": "Metrics Pipeline with Enrichment Table Reference Table" + }, + "type": "pipelines" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/obs-pipelines/pipelines/validate" + }, + "scenario": "Validate a metrics pipeline with enrichment table processor reference table returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/v2/observability-pipelines.json b/src/test/resources/generated-test/test-server-data/v2/observability-pipelines.json index 428d57f5b9d..5211f2b1d1a 100644 --- a/src/test/resources/generated-test/test-server-data/v2/observability-pipelines.json +++ b/src/test/resources/generated-test/test-server-data/v2/observability-pipelines.json @@ -1205,6 +1205,181 @@ "scenario": "Update a pipeline returns \"OK\" response", "version": "v2" }, + { + "feature": "Observability Pipelines", + "frozen_at": "2026-09-30T13:15:58.810Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "config": { + "destinations": [ + { + "id": "datadog-metrics-destination", + "inputs": [ + "my-processor-group" + ], + "type": "datadog_metrics" + } + ], + "pipeline_type": "metrics", + "processor_groups": [ + { + "enabled": true, + "id": "my-processor-group", + "include": "*", + "inputs": [ + "datadog-agent-source" + ], + "processors": [ + { + "enabled": true, + "file": { + "encoding": { + "delimiter": ",", + "includes_headers": true, + "type": "csv" + }, + "key": { + "column": "service", + "source": { + "name": "service", + "type": "tag" + } + }, + "path": "/etc/enrichment/lookup.csv" + }, + "id": "enrichment-table-processor", + "include": "*", + "type": "enrichment_table" + } + ] + } + ], + "sources": [ + { + "id": "datadog-agent-source", + "type": "datadog_agent" + } + ] + }, + "name": "Metrics Pipeline with Enrichment Table File Lookup" + }, + "type": "pipelines" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/obs-pipelines/pipelines/validate", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[]}\n" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Validate a metrics pipeline with enrichment table processor file lookup returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Observability Pipelines", + "frozen_at": "2026-09-30T13:15:58.904Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "config": { + "destinations": [ + { + "id": "datadog-metrics-destination", + "inputs": [ + "my-processor-group" + ], + "type": "datadog_metrics" + } + ], + "pipeline_type": "metrics", + "processor_groups": [ + { + "enabled": true, + "id": "my-processor-group", + "include": "*", + "inputs": [ + "datadog-agent-source" + ], + "processors": [ + { + "enabled": true, + "id": "enrichment-table-processor", + "include": "*", + "reference_table": { + "columns": [ + "environment", + "team" + ], + "key": { + "source": { + "type": "metric_name" + } + }, + "table_id": "metric-enrichment" + }, + "type": "enrichment_table" + } + ] + } + ], + "sources": [ + { + "id": "datadog-agent-source", + "type": "datadog_agent" + } + ] + }, + "name": "Metrics Pipeline with Enrichment Table Reference Table" + }, + "type": "pipelines" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/obs-pipelines/pipelines/validate", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[]}\n" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Validate a metrics pipeline with enrichment table processor reference table returns \"OK\" response", + "version": "v2" + }, { "feature": "Observability Pipelines", "frozen_at": "2026-03-10T16:11:47.487Z",