Skip to content

Commit

Permalink
Change to markdown for links to expressions in JsonPropertyDescriptio…
Browse files Browse the repository at this point in the history
…n, add @Valid annotation for DDB source config models

Signed-off-by: Taylor Gray <tylgry@amazon.com>
  • Loading branch information
graytaylor0 committed Aug 20, 2024
1 parent 6e411fb commit 52aef81
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class AggregateProcessorConfig {
@JsonProperty("aggregated_events_tag")
private String aggregatedEventsTag;

@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the processor will be run on the event.")
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the processor will be run on the event.")
@JsonProperty("aggregate_when")
private String whenCondition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TailSamplerAggregateActionConfig {
@NotNull
private Integer percent;

@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the event is an error event or not")
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the event is an error event or not")
@JsonProperty("condition")
private String condition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class CsvProcessorConfig {
private List<String> columnNames;

@JsonProperty("csv_when")
@JsonPropertyDescription("Allows you to specify a Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
@JsonPropertyDescription("Allows you to specify a Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
"such as `/some-key == \"test\"`, that will be evaluated to determine whether " +
"the processor should be applied to the event.")
private String csvWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DissectProcessorConfig {
"`double`, `string`, `long`, `big_decimal`, and `boolean`. By default, all fields are of the `string` type.")
private Map<String, TargetType> targetTypes;
@JsonProperty("dissect_when")
@JsonPropertyDescription("Specifies a condition for performing the `dissect` operation using a Data Prepper conditional expression " +
@JsonPropertyDescription("Specifies a condition for performing the `dissect` operation using a Data Prepper [conditional expression]" +
"(https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/). " +
"If specified, the `dissect` operation will only run when the expression evaluates to true.")
private String dissectWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class DropEventProcessorConfig {

@JsonPropertyDescription("Accepts a Data Prepper conditional expression string following the Data Prepper Expression Syntax (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/). Configuring drop_events with drop_when: true drops all the events received.")
@JsonPropertyDescription("Accepts a Data Prepper conditional expression string following the [Data Prepper Expression Syntax](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/). Configuring drop_events with drop_when: true drops all the events received.")
@JsonProperty("drop_when")
@NotEmpty
private String dropWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.Valid;
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import org.opensearch.dataprepper.plugins.source.dynamodb.configuration.AwsAuthenticationConfig;
import org.opensearch.dataprepper.plugins.source.dynamodb.configuration.TableConfig;
Expand All @@ -22,6 +23,9 @@
public class DynamoDBSourceConfig {

@JsonProperty("tables")
@NotEmpty
@NotNull
@Valid
private List<TableConfig> tableConfigs = Collections.emptyList();

@JsonProperty("aws")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package org.opensearch.dataprepper.plugins.source.dynamodb.configuration;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

Expand All @@ -17,9 +18,11 @@ public class TableConfig {
private String tableArn;

@JsonProperty("export")
@Valid
private ExportConfig exportConfig;

@JsonProperty(value = "stream")
@Valid
private StreamConfig streamConfig;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class FlattenProcessorConfig {
private List<String> excludeKeys = DEFAULT_EXCLUDE_KEYS;

@JsonProperty("flatten_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
"such as `/some-key == \"test\"'`, that determines whether the `flatten` processor will be run on the " +
"event. Default is `null`, which means that all events will be processed unless otherwise stated.")
private String flattenWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class GeoIPProcessorConfig {
private List<String> tagsOnNoValidIp;

@JsonProperty("geoip_when")
@JsonPropertyDescription("Specifies a condition for including Events in the `geoip` processor using a Data Prepper conditional expression " +
@JsonPropertyDescription("Specifies a condition for including Events in the `geoip` processor using a Data Prepper [conditional expression]" +
"(https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/)." +
" If specified, the `geoip` processor will only run when the expression evaluates to true.")
private String whenCondition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public class KeyValueProcessorConfig {
private boolean dropKeysWithNoValue = false;

@JsonProperty("key_value_when")
@JsonPropertyDescription("Allows you to specify a Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
@JsonPropertyDescription("Allows you to specify a Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
"such as `/some-key == \"test\"`, that will be evaluated to determine whether " +
"the processor should be applied to the event.")
private String keyValueWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ConvertEntryTypeProcessorConfig implements ConverterArguments {
private int scale = 0;

@JsonProperty("convert_when")
@JsonPropertyDescription("Specifies a condition using a Data Prepper expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/) for performing the convert_entry_type operation. If specified, the convert_entry_type operation runs only when the expression evaluates to true.")
@JsonPropertyDescription("Specifies a condition using a [Data Prepper expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/) for performing the convert_entry_type operation. If specified, the convert_entry_type operation runs only when the expression evaluates to true.")
private String convertWhen;

@JsonProperty("null_values")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static FlattenedElement fromOptionValue(final String option) {
private FlattenedElement flattenedElement = FlattenedElement.FIRST;

@JsonProperty("list_to_map_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
"such as `/some-key == \"test\"'`, that will be evaluated to determine whether the processor will be " +
"run on the event. Default is `null`. All events will be processed unless otherwise stated.")
private String listToMapWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class MapToListProcessorConfig {
private String valueName = DEFAULT_VALUE_NAME;

@JsonProperty("map_to_list_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
"such as `/some-key == \"test\"'`, that will be evaluated to determine whether the processor will " +
"be run on the event. Default is `null`. All events will be processed unless otherwise stated.")
private String mapToListWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static class Entry {
private boolean overwriteIfToKeyExists = false;

@JsonProperty("rename_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
"such as `/some-key == \"test\"'`, that will be evaluated to determine whether the processor will be " +
"run on the event. Default is `null`. All events will be processed unless otherwise stated.")
private String renameWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SelectEntriesProcessorConfig {
private List<String> includeKeys;

@JsonProperty("select_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
"such as `/some-key == \"test\"'`, that will be evaluated to determine whether the processor will be " +
"run on the event. Default is `null`. All events will be processed unless otherwise stated.")
private String selectWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static class Entry {
private String to;

@JsonProperty("substitute_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
"such as `/some-key == \"test\"'`, that will be evaluated to determine whether the processor will be " +
"run on the event. Default is `null`. All events will be processed unless otherwise stated.")
private String substituteWhen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ParseIonProcessorConfig implements CommonParseConfig {
private String pointer;

@JsonProperty("parse_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the processor will be run on the event.")
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the processor will be run on the event.")
private String parseWhen;

@JsonProperty("tags_on_failure")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ParseJsonProcessorConfig implements CommonParseConfig {
private String pointer;

@JsonProperty("parse_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the processor will be run on the event.")
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the processor will be run on the event.")
private String parseWhen;

@JsonProperty("tags_on_failure")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class ParseXmlProcessorConfig implements CommonParseConfig {
private String pointer;

@JsonProperty("parse_when")
@JsonPropertyDescription("A Data Prepper conditional expression (https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the processor will be run on the event.")
@JsonPropertyDescription("A Data Prepper [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), such as '/some-key == \"test\"', that will be evaluated to determine whether the processor will be run on the event.")
private String parseWhen;

@JsonProperty("tags_on_failure")
Expand Down

0 comments on commit 52aef81

Please sign in to comment.