-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c62fd37
commit 3f0e863
Showing
20 changed files
with
382 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
core/src/main/java/io/kestra/core/models/flows/input/BooleanInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class BooleanInput extends Input<Boolean> { | ||
@Override | ||
public void validate(Boolean input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
core/src/main/java/io/kestra/core/models/flows/input/DateInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.time.LocalDate; | ||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class DateInput extends Input<LocalDate> { | ||
@Override | ||
public void validate(LocalDate input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
core/src/main/java/io/kestra/core/models/flows/input/DateTimeInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.time.Instant; | ||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class DateTimeInput extends Input<Instant> { | ||
@Override | ||
public void validate(Instant input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
core/src/main/java/io/kestra/core/models/flows/input/DurationInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.time.Duration; | ||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class DurationInput extends Input<Duration> { | ||
@Override | ||
public void validate(Duration input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
core/src/main/java/io/kestra/core/models/flows/input/FileInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.net.URI; | ||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class FileInput extends Input<URI> { | ||
@Override | ||
public void validate(URI input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
core/src/main/java/io/kestra/core/models/flows/input/FloatInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class FloatInput extends Input<Float> { | ||
@Override | ||
public void validate(Float input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
core/src/main/java/io/kestra/core/models/flows/input/IntInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class IntInput extends Input<Integer> { | ||
@Override | ||
public void validate(Integer input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
core/src/main/java/io/kestra/core/models/flows/input/JsonInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class JsonInput extends Input<Object> { | ||
@Override | ||
public void validate(Object input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
core/src/main/java/io/kestra/core/models/flows/input/StringInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import io.kestra.core.models.validations.ManualConstraintViolation; | ||
import io.kestra.core.validations.Regex; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.Set; | ||
import java.util.regex.Pattern; | ||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class StringInput extends Input<String> { | ||
@Schema( | ||
title = "Regular expression validating the value." | ||
) | ||
@Regex | ||
String validator; | ||
|
||
@Override | ||
public void validate(String input) throws ConstraintViolationException { | ||
if (validator != null && ! Pattern.matches(validator, input)) { | ||
throw new ConstraintViolationException("Invalid input '" + input + "', it must match the pattern '" + validator + "'", | ||
Set.of(ManualConstraintViolation.of( | ||
"Invalid input", | ||
this, | ||
StringInput.class, | ||
getName(), | ||
input | ||
))); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
core/src/main/java/io/kestra/core/models/flows/input/TimeInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.time.LocalTime; | ||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class TimeInput extends Input<LocalTime> { | ||
@Override | ||
public void validate(LocalTime input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
core/src/main/java/io/kestra/core/models/flows/input/URIInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.kestra.core.models.flows.input; | ||
|
||
import io.kestra.core.models.flows.Input; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.validation.ConstraintViolationException; | ||
|
||
@SuperBuilder | ||
@Getter | ||
@NoArgsConstructor | ||
public class URIInput extends Input<String> { | ||
@Override | ||
public void validate(String input) throws ConstraintViolationException { | ||
// no validation yet | ||
} | ||
} |
Oops, something went wrong.