diff --git a/src/main/java/io/kestra/plugin/fivetran/AbstractFivetranConnection.java b/src/main/java/io/kestra/plugin/fivetran/AbstractFivetranConnection.java index d158b9e..462b4d9 100644 --- a/src/main/java/io/kestra/plugin/fivetran/AbstractFivetranConnection.java +++ b/src/main/java/io/kestra/plugin/fivetran/AbstractFivetranConnection.java @@ -2,6 +2,7 @@ import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.annotations.PluginProperty; +import io.kestra.core.models.property.Property; import io.kestra.core.models.tasks.Task; import io.kestra.core.runners.DefaultRunContext; import io.kestra.core.runners.RunContext; @@ -36,16 +37,14 @@ public abstract class AbstractFivetranConnection extends Task { @Schema( title = "API key" ) - @PluginProperty(dynamic = true) @NotNull - String apiKey; + Property apiKey; @Schema( title = "API secret" ) - @PluginProperty(dynamic = true) @NotNull - String apiSecret; + Property apiSecret; private static final NettyHttpClientFactory FACTORY = new NettyHttpClientFactory(); @@ -63,7 +62,7 @@ protected HttpResponse request(RunContext runContext, MutableHtt request = request .contentType(MediaType.APPLICATION_JSON) .accept("application/json;version=2") - .basicAuth(runContext.render(this.apiKey), runContext.render(this.apiSecret)); + .basicAuth(runContext.render(this.apiKey).as(String.class).orElseThrow(), runContext.render(this.apiSecret).as(String.class).orElseThrow()); try (HttpClient client = this.client(runContext)) { return client.toBlocking().exchange(request, argument); diff --git a/src/main/java/io/kestra/plugin/fivetran/connectors/Sync.java b/src/main/java/io/kestra/plugin/fivetran/connectors/Sync.java index ce7d191..6f5ca08 100644 --- a/src/main/java/io/kestra/plugin/fivetran/connectors/Sync.java +++ b/src/main/java/io/kestra/plugin/fivetran/connectors/Sync.java @@ -4,6 +4,7 @@ import io.kestra.core.models.annotations.Example; import io.kestra.core.models.annotations.Plugin; import io.kestra.core.models.annotations.PluginProperty; +import io.kestra.core.models.property.Property; import io.kestra.core.models.tasks.RunnableTask; import io.kestra.core.models.tasks.VoidOutput; import io.kestra.core.runners.RunContext; @@ -59,33 +60,29 @@ public class Sync extends AbstractFivetranConnection implements RunnableTask connectorId; @Schema( title = "Force with running sync.", description = "If `force` is true and the connector is currently syncing, it will stop the sync and re-run it. " + "If force is `false`, the connector will sync only if it isn't currently syncing." ) - @PluginProperty(dynamic = false) @Builder.Default - Boolean force = false; + Property force = Property.of(false); @Schema( title = "Wait for the end of the job.", description = "Allowing to capture job status & logs." ) - @PluginProperty(dynamic = false) @Builder.Default - Boolean wait = true; + Property wait = Property.of(true); @Schema( title = "The max total wait duration." ) - @PluginProperty(dynamic = false) @Builder.Default - Duration maxDuration = Duration.ofMinutes(60); + Property maxDuration = Property.of(Duration.ofMinutes(60)); @Builder.Default @Getter(AccessLevel.NONE) @@ -94,7 +91,7 @@ public class Sync extends AbstractFivetranConnection implements RunnableTask