diff --git a/build.gradle b/build.gradle index a619a39..f7196f0 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ java { group = 'com.pipedream' -version = '0.0.2' +version = '1.0.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'com.pipedream' artifactId = 'pipedream' - version = '0.0.2' + version = '1.0.0' from components.java pom { name = 'pipedream' diff --git a/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java b/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java index 8b1ab94..d285454 100644 --- a/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java +++ b/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java @@ -343,6 +343,9 @@ public CompletableFuture> run( if (request.getDynamicPropsId().isPresent()) { properties.put("dynamic_props_id", request.getDynamicPropsId()); } + if (request.getStashId().isPresent()) { + properties.put("stash_id", request.getStashId()); + } RequestBody body; try { body = RequestBody.create( diff --git a/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java b/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java index 1dbf30b..d36c7d2 100644 --- a/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java +++ b/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java @@ -275,6 +275,9 @@ public BaseClientHttpResponse run(RunActionOpts request, Requ if (request.getDynamicPropsId().isPresent()) { properties.put("dynamic_props_id", request.getDynamicPropsId()); } + if (request.getStashId().isPresent()) { + properties.put("stash_id", request.getStashId()); + } RequestBody body; try { body = RequestBody.create( diff --git a/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java b/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java index 6a16af8..8f6cf9a 100644 --- a/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java +++ b/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.pipedream.api.core.ObjectMappers; +import com.pipedream.api.resources.actions.types.RunActionOptsStashId; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -31,6 +32,8 @@ public final class RunActionOpts { private final Optional dynamicPropsId; + private final Optional stashId; + private final Map additionalProperties; private RunActionOpts( @@ -39,12 +42,14 @@ private RunActionOpts( String externalUserId, Optional> configuredProps, Optional dynamicPropsId, + Optional stashId, Map additionalProperties) { this.asyncHandle = asyncHandle; this.id = id; this.externalUserId = externalUserId; this.configuredProps = configuredProps; this.dynamicPropsId = dynamicPropsId; + this.stashId = stashId; this.additionalProperties = additionalProperties; } @@ -85,6 +90,14 @@ public Optional getDynamicPropsId() { return dynamicPropsId; } + /** + * @return The ID of the File Stash to use for syncing the action's /tmp directory + */ + @JsonProperty("stash_id") + public Optional getStashId() { + return stashId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -101,12 +114,19 @@ private boolean equalTo(RunActionOpts other) { && id.equals(other.id) && externalUserId.equals(other.externalUserId) && configuredProps.equals(other.configuredProps) - && dynamicPropsId.equals(other.dynamicPropsId); + && dynamicPropsId.equals(other.dynamicPropsId) + && stashId.equals(other.stashId); } @java.lang.Override public int hashCode() { - return Objects.hash(this.asyncHandle, this.id, this.externalUserId, this.configuredProps, this.dynamicPropsId); + return Objects.hash( + this.asyncHandle, + this.id, + this.externalUserId, + this.configuredProps, + this.dynamicPropsId, + this.stashId); } @java.lang.Override @@ -154,6 +174,13 @@ public interface _FinalStage { _FinalStage dynamicPropsId(Optional dynamicPropsId); _FinalStage dynamicPropsId(String dynamicPropsId); + + /** + *

The ID of the File Stash to use for syncing the action's /tmp directory

+ */ + _FinalStage stashId(Optional stashId); + + _FinalStage stashId(RunActionOptsStashId stashId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -162,6 +189,8 @@ public static final class Builder implements IdStage, ExternalUserIdStage, _Fina private String externalUserId; + private Optional stashId = Optional.empty(); + private Optional dynamicPropsId = Optional.empty(); private Optional> configuredProps = Optional.empty(); @@ -180,6 +209,7 @@ public Builder from(RunActionOpts other) { externalUserId(other.getExternalUserId()); configuredProps(other.getConfiguredProps()); dynamicPropsId(other.getDynamicPropsId()); + stashId(other.getStashId()); return this; } @@ -207,6 +237,26 @@ public _FinalStage externalUserId(@NotNull String externalUserId) { return this; } + /** + *

The ID of the File Stash to use for syncing the action's /tmp directory

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage stashId(RunActionOptsStashId stashId) { + this.stashId = Optional.ofNullable(stashId); + return this; + } + + /** + *

The ID of the File Stash to use for syncing the action's /tmp directory

+ */ + @java.lang.Override + @JsonSetter(value = "stash_id", nulls = Nulls.SKIP) + public _FinalStage stashId(Optional stashId) { + this.stashId = stashId; + return this; + } + /** *

The ID for dynamic props

* @return Reference to {@code this} so that method calls can be chained together. @@ -263,7 +313,7 @@ public _FinalStage asyncHandle(Optional asyncHandle) { @java.lang.Override public RunActionOpts build() { return new RunActionOpts( - asyncHandle, id, externalUserId, configuredProps, dynamicPropsId, additionalProperties); + asyncHandle, id, externalUserId, configuredProps, dynamicPropsId, stashId, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/actions/types/RunActionOptsStashId.java b/src/main/java/com/pipedream/api/resources/actions/types/RunActionOptsStashId.java new file mode 100644 index 0000000..9da7ae6 --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/actions/types/RunActionOptsStashId.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.resources.actions.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.pipedream.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RunActionOptsStashId.Deserializer.class) +public final class RunActionOptsStashId { + private final Object value; + + private final int type; + + private RunActionOptsStashId(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((boolean) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RunActionOptsStashId && equalTo((RunActionOptsStashId) other); + } + + private boolean equalTo(RunActionOptsStashId other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RunActionOptsStashId of(String value) { + return new RunActionOptsStashId(value, 0); + } + + public static RunActionOptsStashId of(boolean value) { + return new RunActionOptsStashId(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(boolean value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RunActionOptsStashId.class); + } + + @java.lang.Override + public RunActionOptsStashId deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (IllegalArgumentException e) { + } + if (value instanceof Boolean) { + return of((Boolean) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +}