workflowId = Optional.empty();
@@ -234,6 +257,7 @@ public Builder from(DeployTriggerOpts other) {
dynamicPropsId(other.getDynamicPropsId());
workflowId(other.getWorkflowId());
webhookUrl(other.getWebhookUrl());
+ emitOnDeploy(other.getEmitOnDeploy());
return this;
}
@@ -261,6 +285,26 @@ public _FinalStage externalUserId(@NotNull String externalUserId) {
return this;
}
+ /**
+ * Whether the trigger should emit events during the deploy hook execution. Defaults to true if not specified.
+ * @return Reference to {@code this} so that method calls can be chained together.
+ */
+ @java.lang.Override
+ public _FinalStage emitOnDeploy(Boolean emitOnDeploy) {
+ this.emitOnDeploy = Optional.ofNullable(emitOnDeploy);
+ return this;
+ }
+
+ /**
+ * Whether the trigger should emit events during the deploy hook execution. Defaults to true if not specified.
+ */
+ @java.lang.Override
+ @JsonSetter(value = "emit_on_deploy", nulls = Nulls.SKIP)
+ public _FinalStage emitOnDeploy(Optional emitOnDeploy) {
+ this.emitOnDeploy = emitOnDeploy;
+ return this;
+ }
+
/**
* Optional webhook URL to receive trigger events
* @return Reference to {@code this} so that method calls can be chained together.
@@ -364,6 +408,7 @@ public DeployTriggerOpts build() {
dynamicPropsId,
workflowId,
webhookUrl,
+ emitOnDeploy,
additionalProperties);
}
}
diff --git a/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java b/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java
index c41f6f1..a1ad961 100644
--- a/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java
+++ b/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java
@@ -78,11 +78,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
} catch (JsonProcessingException ignored) {
// unable to map error response, throwing generic error
}
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
future.completeExceptionally(new BaseClientApiException(
- "Error with status code " + response.code(),
- response.code(),
- ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
- response));
+ "Error with status code " + response.code(), response.code(), errorBody, response));
return;
} catch (IOException e) {
future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e));
diff --git a/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java b/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java
index 097eaaf..15600a5 100644
--- a/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java
+++ b/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java
@@ -68,11 +68,9 @@ public BaseClientHttpResponse deleteExternalUser(String externalUserId, Re
} catch (JsonProcessingException ignored) {
// unable to map error response, throwing generic error
}
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new BaseClientApiException(
- "Error with status code " + response.code(),
- response.code(),
- ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
- response);
+ "Error with status code " + response.code(), response.code(), errorBody, response);
} catch (IOException e) {
throw new BaseClientException("Network error executing HTTP request", e);
}
diff --git a/src/main/java/com/pipedream/api/types/ConfigurableProp.java b/src/main/java/com/pipedream/api/types/ConfigurableProp.java
index 4c5213e..886d241 100644
--- a/src/main/java/com/pipedream/api/types/ConfigurableProp.java
+++ b/src/main/java/com/pipedream/api/types/ConfigurableProp.java
@@ -3,549 +3,1230 @@
*/
package com.pipedream.api.types;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonSetter;
-import com.fasterxml.jackson.annotation.Nulls;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.pipedream.api.core.ObjectMappers;
-import java.util.HashMap;
-import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonUnwrapped;
+import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;
import java.util.Optional;
-import org.jetbrains.annotations.NotNull;
-@JsonInclude(JsonInclude.Include.NON_ABSENT)
-@JsonDeserialize(builder = ConfigurableProp.Builder.class)
public final class ConfigurableProp {
- private final String name;
+ private final Value value;
- private final ConfigurablePropType type;
+ @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
+ private ConfigurableProp(Value value) {
+ this.value = value;
+ }
+
+ public T visit(Visitor visitor) {
+ return value.visit(visitor);
+ }
+
+ public static ConfigurableProp alert(ConfigurablePropAlert value) {
+ return new ConfigurableProp(new AlertValue(value));
+ }
+
+ public static ConfigurableProp any(ConfigurablePropAny value) {
+ return new ConfigurableProp(new AnyValue(value));
+ }
+
+ public static ConfigurableProp app(ConfigurablePropApp value) {
+ return new ConfigurableProp(new AppValue(value));
+ }
+
+ public static ConfigurableProp boolean_(ConfigurablePropBoolean value) {
+ return new ConfigurableProp(new BooleanValue(value));
+ }
+
+ public static ConfigurableProp interfaceTimer(ConfigurablePropTimer value) {
+ return new ConfigurableProp(new InterfaceTimerValue(value));
+ }
+
+ public static ConfigurableProp interfaceApphook(ConfigurablePropApphook value) {
+ return new ConfigurableProp(new InterfaceApphookValue(value));
+ }
+
+ public static ConfigurableProp integer(ConfigurablePropIntegerArray value) {
+ return new ConfigurableProp(new IntegerValue(value));
+ }
+
+ public static ConfigurableProp interfaceHttp(ConfigurablePropHttp value) {
+ return new ConfigurableProp(new InterfaceHttpValue(value));
+ }
+
+ public static ConfigurableProp serviceDb(ConfigurablePropDb value) {
+ return new ConfigurableProp(new ServiceDbValue(value));
+ }
+
+ public static ConfigurableProp sql(ConfigurablePropSql value) {
+ return new ConfigurableProp(new SqlValue(value));
+ }
+
+ public static ConfigurableProp airtableBaseId(ConfigurablePropAirtableBaseId value) {
+ return new ConfigurableProp(new AirtableBaseIdValue(value));
+ }
+
+ public static ConfigurableProp airtableTableId(ConfigurablePropAirtableTableId value) {
+ return new ConfigurableProp(new AirtableTableIdValue(value));
+ }
- private final Optional label;
+ public static ConfigurableProp airtableViewId(ConfigurablePropAirtableViewId value) {
+ return new ConfigurableProp(new AirtableViewIdValue(value));
+ }
- private final Optional description;
+ public static ConfigurableProp airtableFieldId(ConfigurablePropAirtableFieldId value) {
+ return new ConfigurableProp(new AirtableFieldIdValue(value));
+ }
- private final Optional optional;
+ public static ConfigurableProp discordChannel(ConfigurablePropDiscordChannel value) {
+ return new ConfigurableProp(new DiscordChannelValue(value));
+ }
- private final Optional disabled;
+ public static ConfigurableProp discordChannel(ConfigurablePropDiscordChannelArray value) {
+ return new ConfigurableProp(new DiscordChannelValue(value));
+ }
- private final Optional hidden;
+ public static ConfigurableProp integer(ConfigurablePropInteger value) {
+ return new ConfigurableProp(new IntegerValue(value));
+ }
- private final Optional remoteOptions;
+ public static ConfigurableProp object(ConfigurablePropObject value) {
+ return new ConfigurableProp(new ObjectValue(value));
+ }
- private final Optional useQuery;
+ public static ConfigurableProp string(ConfigurablePropString value) {
+ return new ConfigurableProp(new StringValue(value));
+ }
- private final Optional reloadProps;
+ public static ConfigurableProp string(ConfigurablePropStringArray value) {
+ return new ConfigurableProp(new StringValue(value));
+ }
- private final Optional withLabel;
+ public boolean isAlert() {
+ return value instanceof AlertValue;
+ }
- private final Map additionalProperties;
+ public boolean isAny() {
+ return value instanceof AnyValue;
+ }
- private ConfigurableProp(
- String name,
- ConfigurablePropType type,
- Optional label,
- Optional description,
- Optional optional,
- Optional disabled,
- Optional hidden,
- Optional remoteOptions,
- Optional useQuery,
- Optional reloadProps,
- Optional withLabel,
- Map additionalProperties) {
- this.name = name;
- this.type = type;
- this.label = label;
- this.description = description;
- this.optional = optional;
- this.disabled = disabled;
- this.hidden = hidden;
- this.remoteOptions = remoteOptions;
- this.useQuery = useQuery;
- this.reloadProps = reloadProps;
- this.withLabel = withLabel;
- this.additionalProperties = additionalProperties;
+ public boolean isApp() {
+ return value instanceof AppValue;
}
- /**
- * @return When building configuredProps, make sure to use this field as the key when setting the prop value
- */
- @JsonProperty("name")
- public String getName() {
- return name;
+ public boolean isBoolean() {
+ return value instanceof BooleanValue;
}
- @JsonProperty("type")
- public ConfigurablePropType getType() {
- return type;
+ public boolean isInterfaceTimer() {
+ return value instanceof InterfaceTimerValue;
}
- /**
- * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.
- */
- @JsonProperty("label")
- public Optional getLabel() {
- return label;
+ public boolean isInterfaceApphook() {
+ return value instanceof InterfaceApphookValue;
}
-
- /**
- * @return A description of the prop, shown to the user when configuring the component.
- */
- @JsonProperty("description")
- public Optional getDescription() {
- return description;
+
+ public boolean isInteger() {
+ return value instanceof IntegerValue;
}
-
- /**
- * @return If true, this prop does not need to be specified.
- */
- @JsonProperty("optional")
- public Optional getOptional() {
- return optional;
+
+ public boolean isInterfaceHttp() {
+ return value instanceof InterfaceHttpValue;
}
- /**
- * @return If true, this prop will be ignored.
- */
- @JsonProperty("disabled")
- public Optional getDisabled() {
- return disabled;
+ public boolean isServiceDb() {
+ return value instanceof ServiceDbValue;
}
- /**
- * @return If true, should not expose this prop to the user
- */
- @JsonProperty("hidden")
- public Optional getHidden() {
- return hidden;
+ public boolean isSql() {
+ return value instanceof SqlValue;
}
- /**
- * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options
- */
- @JsonProperty("remoteOptions")
- public Optional getRemoteOptions() {
- return remoteOptions;
+ public boolean isAirtableBaseId() {
+ return value instanceof AirtableBaseIdValue;
}
- /**
- * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options
- */
- @JsonProperty("useQuery")
- public Optional getUseQuery() {
- return useQuery;
- }
-
- /**
- * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one
- */
- @JsonProperty("reloadProps")
- public Optional getReloadProps() {
- return reloadProps;
- }
-
- /**
- * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label
- */
- @JsonProperty("withLabel")
- public Optional getWithLabel() {
- return withLabel;
+ public boolean isAirtableTableId() {
+ return value instanceof AirtableTableIdValue;
}
- @java.lang.Override
- public boolean equals(Object other) {
- if (this == other) return true;
- return other instanceof ConfigurableProp && equalTo((ConfigurableProp) other);
+ public boolean isAirtableViewId() {
+ return value instanceof AirtableViewIdValue;
}
- @JsonAnyGetter
- public Map getAdditionalProperties() {
- return this.additionalProperties;
+ public boolean isAirtableFieldId() {
+ return value instanceof AirtableFieldIdValue;
}
- private boolean equalTo(ConfigurableProp other) {
- return name.equals(other.name)
- && type.equals(other.type)
- && label.equals(other.label)
- && description.equals(other.description)
- && optional.equals(other.optional)
- && disabled.equals(other.disabled)
- && hidden.equals(other.hidden)
- && remoteOptions.equals(other.remoteOptions)
- && useQuery.equals(other.useQuery)
- && reloadProps.equals(other.reloadProps)
- && withLabel.equals(other.withLabel);
+ public boolean isDiscordChannel() {
+ return value instanceof DiscordChannelValue;
}
- @java.lang.Override
- public int hashCode() {
- return Objects.hash(
- this.name,
- this.type,
- this.label,
- this.description,
- this.optional,
- this.disabled,
- this.hidden,
- this.remoteOptions,
- this.useQuery,
- this.reloadProps,
- this.withLabel);
+ public boolean isDiscordChannel() {
+ return value instanceof DiscordChannelValue;
}
- @java.lang.Override
- public String toString() {
- return ObjectMappers.stringify(this);
+ public boolean isInteger() {
+ return value instanceof IntegerValue;
}
- public static NameStage builder() {
- return new Builder();
+ public boolean isObject() {
+ return value instanceof ObjectValue;
}
- public interface NameStage {
- /**
- * When building configuredProps, make sure to use this field as the key when setting the prop value
- */
- TypeStage name(@NotNull String name);
+ public boolean isString() {
+ return value instanceof StringValue;
+ }
- Builder from(ConfigurableProp other);
+ public boolean isString() {
+ return value instanceof StringValue;
}
- public interface TypeStage {
- _FinalStage type(@NotNull ConfigurablePropType type);
+ public boolean _isUnknown() {
+ return value instanceof _UnknownValue;
}
- public interface _FinalStage {
- ConfigurableProp build();
+ public Optional getAlert() {
+ if (isAlert()) {
+ return Optional.of(((AlertValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getAny() {
+ if (isAny()) {
+ return Optional.of(((AnyValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getApp() {
+ if (isApp()) {
+ return Optional.of(((AppValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getBoolean() {
+ if (isBoolean()) {
+ return Optional.of(((BooleanValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getInterfaceTimer() {
+ if (isInterfaceTimer()) {
+ return Optional.of(((InterfaceTimerValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getInterfaceApphook() {
+ if (isInterfaceApphook()) {
+ return Optional.of(((InterfaceApphookValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getInteger() {
+ if (isInteger()) {
+ return Optional.of(((IntegerValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getInterfaceHttp() {
+ if (isInterfaceHttp()) {
+ return Optional.of(((InterfaceHttpValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getServiceDb() {
+ if (isServiceDb()) {
+ return Optional.of(((ServiceDbValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getSql() {
+ if (isSql()) {
+ return Optional.of(((SqlValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getAirtableBaseId() {
+ if (isAirtableBaseId()) {
+ return Optional.of(((AirtableBaseIdValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getAirtableTableId() {
+ if (isAirtableTableId()) {
+ return Optional.of(((AirtableTableIdValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getAirtableViewId() {
+ if (isAirtableViewId()) {
+ return Optional.of(((AirtableViewIdValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getAirtableFieldId() {
+ if (isAirtableFieldId()) {
+ return Optional.of(((AirtableFieldIdValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getDiscordChannel() {
+ if (isDiscordChannel()) {
+ return Optional.of(((DiscordChannelValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getDiscordChannel() {
+ if (isDiscordChannel()) {
+ return Optional.of(((DiscordChannelValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getInteger() {
+ if (isInteger()) {
+ return Optional.of(((IntegerValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getObject() {
+ if (isObject()) {
+ return Optional.of(((ObjectValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getString() {
+ if (isString()) {
+ return Optional.of(((StringValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional getString() {
+ if (isString()) {
+ return Optional.of(((StringValue) value).value);
+ }
+ return Optional.empty();
+ }
+
+ public Optional