diff --git a/data-prepper-plugins/date-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/date/DateProcessorConfig.java b/data-prepper-plugins/date-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/date/DateProcessorConfig.java index 9960ae33b2..f66303a170 100644 --- a/data-prepper-plugins/date-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/date/DateProcessorConfig.java +++ b/data-prepper-plugins/date-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/date/DateProcessorConfig.java @@ -13,6 +13,8 @@ import jakarta.validation.constraints.AssertTrue; import org.opensearch.dataprepper.model.annotations.AlsoRequired; import org.opensearch.dataprepper.model.annotations.ConditionalRequired; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.IfThenElse; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.SchemaProperty; import org.opensearch.dataprepper.model.annotations.ExampleValues; import org.opensearch.dataprepper.model.annotations.ExampleValues.Example; @@ -22,13 +24,13 @@ import java.time.format.DateTimeFormatter; @ConditionalRequired(value = { - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "match", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "from_time_received", value = "true")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "match", value = "null")}, + thenExpect = {@SchemaProperty(field = "from_time_received", value = "true")} ), - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "from_time_received", value = "false")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "match")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "from_time_received", value = "false")}, + thenExpect = {@SchemaProperty(field = "match")} ) }) @JsonPropertyOrder diff --git a/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/AddEntryProcessorConfig.java b/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/AddEntryProcessorConfig.java index 49cf29d345..008572a2a3 100644 --- a/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/AddEntryProcessorConfig.java +++ b/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/AddEntryProcessorConfig.java @@ -15,39 +15,41 @@ import jakarta.validation.constraints.NotNull; import org.opensearch.dataprepper.model.annotations.AlsoRequired; import org.opensearch.dataprepper.model.annotations.ConditionalRequired; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.IfThenElse; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.SchemaProperty; import java.util.List; import java.util.stream.Stream; @ConditionalRequired(value = { - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "key", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "metadata_key")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "key", value = "null")}, + thenExpect = {@SchemaProperty(field = "metadata_key")} ), - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "metadata_key", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "key")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "metadata_key", value = "null")}, + thenExpect = {@SchemaProperty(field = "key")} ), - @ConditionalRequired.IfThenElse( + @IfThenElse( ifFulfilled = { - @ConditionalRequired.SchemaProperty(field = "format", value = "null"), - @ConditionalRequired.SchemaProperty(field = "value", value = "null"), + @SchemaProperty(field = "format", value = "null"), + @SchemaProperty(field = "value", value = "null"), }, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "value_expression")} + thenExpect = {@SchemaProperty(field = "value_expression")} ), - @ConditionalRequired.IfThenElse( + @IfThenElse( ifFulfilled = { - @ConditionalRequired.SchemaProperty(field = "format", value = "null"), - @ConditionalRequired.SchemaProperty(field = "value_expression", value = "null"), + @SchemaProperty(field = "format", value = "null"), + @SchemaProperty(field = "value_expression", value = "null"), }, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "value")} + thenExpect = {@SchemaProperty(field = "value")} ), - @ConditionalRequired.IfThenElse( + @IfThenElse( ifFulfilled = { - @ConditionalRequired.SchemaProperty(field = "value", value = "null"), - @ConditionalRequired.SchemaProperty(field = "value_expression", value = "null"), + @SchemaProperty(field = "value", value = "null"), + @SchemaProperty(field = "value_expression", value = "null"), }, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "format")} + thenExpect = {@SchemaProperty(field = "format")} ) }) @JsonPropertyOrder diff --git a/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/ConvertEntryTypeProcessorConfig.java b/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/ConvertEntryTypeProcessorConfig.java index a2e403c2b2..7b401ec843 100644 --- a/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/ConvertEntryTypeProcessorConfig.java +++ b/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/ConvertEntryTypeProcessorConfig.java @@ -11,19 +11,21 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; import org.opensearch.dataprepper.model.annotations.AlsoRequired; import org.opensearch.dataprepper.model.annotations.ConditionalRequired; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.IfThenElse; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.SchemaProperty; import org.opensearch.dataprepper.typeconverter.ConverterArguments; import java.util.List; import java.util.Optional; @ConditionalRequired(value = { - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "key", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "keys")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "key", value = "null")}, + thenExpect = {@SchemaProperty(field = "keys")} ), - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "keys", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "key")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "keys", value = "null")}, + thenExpect = {@SchemaProperty(field = "key")} ) }) @JsonPropertyOrder diff --git a/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/ListToMapProcessorConfig.java b/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/ListToMapProcessorConfig.java index 065e56d7bb..91fb38a1f1 100644 --- a/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/ListToMapProcessorConfig.java +++ b/data-prepper-plugins/mutate-event-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutateevent/ListToMapProcessorConfig.java @@ -14,6 +14,8 @@ import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import org.opensearch.dataprepper.model.annotations.ConditionalRequired; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.IfThenElse; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.SchemaProperty; import java.util.Arrays; import java.util.List; @@ -21,9 +23,9 @@ import java.util.stream.Collectors; @ConditionalRequired(value = { - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "use_source_key", value = "false")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "key")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "use_source_key", value = "false")}, + thenExpect = {@SchemaProperty(field = "key")} ) }) @JsonPropertyOrder diff --git a/data-prepper-plugins/mutate-string-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutatestring/SplitStringProcessorConfig.java b/data-prepper-plugins/mutate-string-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutatestring/SplitStringProcessorConfig.java index 568abc6461..11116859aa 100644 --- a/data-prepper-plugins/mutate-string-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutatestring/SplitStringProcessorConfig.java +++ b/data-prepper-plugins/mutate-string-processors/src/main/java/org/opensearch/dataprepper/plugins/processor/mutatestring/SplitStringProcessorConfig.java @@ -16,18 +16,20 @@ import jakarta.validation.constraints.Size; import org.opensearch.dataprepper.model.annotations.AlsoRequired; import org.opensearch.dataprepper.model.annotations.ConditionalRequired; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.IfThenElse; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.SchemaProperty; import org.opensearch.dataprepper.model.event.EventKey; import java.util.List; @ConditionalRequired(value = { - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "delimiter", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "delimiter_regex")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "delimiter", value = "null")}, + thenExpect = {@SchemaProperty(field = "delimiter_regex")} ), - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "delimiter_regex", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "delimiter")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "delimiter_regex", value = "null")}, + thenExpect = {@SchemaProperty(field = "delimiter")} ) }) @JsonPropertyOrder diff --git a/data-prepper-plugins/split-event-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/splitevent/SplitEventProcessorConfig.java b/data-prepper-plugins/split-event-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/splitevent/SplitEventProcessorConfig.java index b4acbff42b..188d3cfc9f 100644 --- a/data-prepper-plugins/split-event-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/splitevent/SplitEventProcessorConfig.java +++ b/data-prepper-plugins/split-event-processor/src/main/java/org/opensearch/dataprepper/plugins/processor/splitevent/SplitEventProcessorConfig.java @@ -19,15 +19,17 @@ import jakarta.validation.constraints.Size; import org.opensearch.dataprepper.model.annotations.AlsoRequired; import org.opensearch.dataprepper.model.annotations.ConditionalRequired; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.IfThenElse; +import org.opensearch.dataprepper.model.annotations.ConditionalRequired.SchemaProperty; @ConditionalRequired(value = { - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "delimiter", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "delimiter_regex")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "delimiter", value = "null")}, + thenExpect = {@SchemaProperty(field = "delimiter_regex")} ), - @ConditionalRequired.IfThenElse( - ifFulfilled = {@ConditionalRequired.SchemaProperty(field = "delimiter_regex", value = "null")}, - thenExpect = {@ConditionalRequired.SchemaProperty(field = "delimiter")} + @IfThenElse( + ifFulfilled = {@SchemaProperty(field = "delimiter_regex", value = "null")}, + thenExpect = {@SchemaProperty(field = "delimiter")} ) }) @JsonPropertyOrder