Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Add the dependency in your `pom.xml` file:
<dependency>
<groupId>com.pipedream</groupId>
<artifactId>pipedream</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ java {

group = 'com.pipedream'

version = '1.0.1'
version = '1.0.2'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -78,7 +78,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.pipedream'
artifactId = 'pipedream'
version = '1.0.1'
version = '1.0.2'
from components.java
pom {
name = 'pipedream'
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pipedream/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "com.pipedream:pipedream/1.0.1");
put("User-Agent", "com.pipedream:pipedream/1.0.2");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk");
put("X-Fern-SDK-Version", "1.0.1");
put("X-Fern-SDK-Version", "1.0.2");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
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;
import java.util.Optional;

@JsonDeserialize(using = RunActionOptsStashId.Deserializer.class)
public final class RunActionOptsStashId {
Expand All @@ -32,8 +34,10 @@ public Object get() {
@SuppressWarnings("unchecked")
public <T> T visit(Visitor<T> visitor) {
if (this.type == 0) {
return visitor.visit((String) this.value);
return visitor.visit((Optional<String>) this.value);
} else if (this.type == 1) {
return visitor.visit((String) this.value);
} else if (this.type == 2) {
return visitor.visit((boolean) this.value);
}
throw new IllegalStateException("Failed to visit value. This should never happen.");
Expand All @@ -59,15 +63,33 @@ public String toString() {
return this.value.toString();
}

public static RunActionOptsStashId of(String value) {
public static RunActionOptsStashId of(Optional<String> value) {
return new RunActionOptsStashId(value, 0);
}

public static RunActionOptsStashId of(boolean value) {
/**
* @param value must be one of the following:
* <ul>
* <li>"NEW"</li>
* </ul>
*/
public static RunActionOptsStashId of(String value) {
return new RunActionOptsStashId(value, 1);
}

public static RunActionOptsStashId of(boolean value) {
return new RunActionOptsStashId(value, 2);
}

public interface Visitor<T> {
T visit(Optional<String> value);

/**
* @param value must be one of the following:
* <ul>
* <li>"NEW"</li>
* </ul>
*/
T visit(String value);

T visit(boolean value);
Expand All @@ -81,6 +103,10 @@ static final class Deserializer extends StdDeserializer<RunActionOptsStashId> {
@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, new TypeReference<Optional<String>>() {}));
} catch (IllegalArgumentException e) {
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class));
} catch (IllegalArgumentException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ public CompletableFuture<BaseClientHttpResponse<ValidateTokenResponse>> validate
String ctok, TokensValidateRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v1/connect")
.addPathSegment(clientOptions.projectId())
.addPathSegments("tokens")
.addPathSegments("v1/connect/tokens")
.addPathSegment(ctok)
.addPathSegments("validate");
if (request.getParams().isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ public BaseClientHttpResponse<ValidateTokenResponse> validate(
String ctok, TokensValidateRequest request, RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v1/connect")
.addPathSegment(clientOptions.projectId())
.addPathSegments("tokens")
.addPathSegments("v1/connect/tokens")
.addPathSegment(ctok)
.addPathSegments("validate");
if (request.getParams().isPresent()) {
Expand Down
13 changes: 0 additions & 13 deletions src/main/java/com/pipedream/api/types/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ public String getName() {
return name;
}

/**
* @return The authentication type used by the app
*/
@JsonProperty("auth_type")
public Optional<AppAuthType> getAuthType() {
return authType;
Expand Down Expand Up @@ -224,9 +221,6 @@ public interface _FinalStage {

_FinalStage id(String id);

/**
* <p>The authentication type used by the app</p>
*/
_FinalStage authType(Optional<AppAuthType> authType);

_FinalStage authType(AppAuthType authType);
Expand Down Expand Up @@ -414,19 +408,12 @@ public _FinalStage description(Optional<String> description) {
return this;
}

/**
* <p>The authentication type used by the app</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage authType(AppAuthType authType) {
this.authType = Optional.ofNullable(authType);
return this;
}

/**
* <p>The authentication type used by the app</p>
*/
@java.lang.Override
@JsonSetter(value = "auth_type", nulls = Nulls.SKIP)
public _FinalStage authType(Optional<AppAuthType> authType) {
Expand Down
13 changes: 0 additions & 13 deletions src/main/java/com/pipedream/api/types/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ public Optional<String> getComponentType() {
return componentType;
}

/**
* @return Indicates if a File Stash ID is optional or required to run the component
*/
@JsonProperty("stash")
public Optional<ComponentStash> getStash() {
return stash;
Expand Down Expand Up @@ -199,9 +196,6 @@ public interface _FinalStage {

_FinalStage componentType(String componentType);

/**
* <p>Indicates if a File Stash ID is optional or required to run the component</p>
*/
_FinalStage stash(Optional<ComponentStash> stash);

_FinalStage stash(ComponentStash stash);
Expand Down Expand Up @@ -276,19 +270,12 @@ public _FinalStage version(@NotNull String version) {
return this;
}

/**
* <p>Indicates if a File Stash ID is optional or required to run the component</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage stash(ComponentStash stash) {
this.stash = Optional.ofNullable(stash);
return this;
}

/**
* <p>Indicates if a File Stash ID is optional or required to run the component</p>
*/
@java.lang.Override
@JsonSetter(value = "stash", nulls = Nulls.SKIP)
public _FinalStage stash(Optional<ComponentStash> stash) {
Expand Down
29 changes: 8 additions & 21 deletions src/main/java/com/pipedream/api/types/ConfigurablePropAlert.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public final class ConfigurablePropAlert {
private final Optional<String> type;

private final Optional<ConfigurablePropAlertAlertType> alertType;
private final Optional<ConfigurablePropAlertType> alertType;

private final Optional<String> content;

Expand Down Expand Up @@ -51,7 +51,7 @@ public final class ConfigurablePropAlert {

private ConfigurablePropAlert(
Optional<String> type,
Optional<ConfigurablePropAlertAlertType> alertType,
Optional<ConfigurablePropAlertType> alertType,
Optional<String> content,
String name,
Optional<String> label,
Expand Down Expand Up @@ -85,11 +85,8 @@ public Optional<String> getType() {
return type;
}

/**
* @return The severity level of the alert.
*/
@JsonProperty("alertType")
public Optional<ConfigurablePropAlertAlertType> getAlertType() {
public Optional<ConfigurablePropAlertType> getAlertType() {
return alertType;
}

Expand Down Expand Up @@ -251,12 +248,9 @@ public interface _FinalStage {

_FinalStage type(String type);

/**
* <p>The severity level of the alert.</p>
*/
_FinalStage alertType(Optional<ConfigurablePropAlertAlertType> alertType);
_FinalStage alertType(Optional<ConfigurablePropAlertType> alertType);

_FinalStage alertType(ConfigurablePropAlertAlertType alertType);
_FinalStage alertType(ConfigurablePropAlertType alertType);

/**
* <p>The content of the alert, which can include HTML or plain text.</p>
Expand Down Expand Up @@ -353,7 +347,7 @@ public static final class Builder implements NameStage, _FinalStage {

private Optional<String> content = Optional.empty();

private Optional<ConfigurablePropAlertAlertType> alertType = Optional.empty();
private Optional<ConfigurablePropAlertType> alertType = Optional.empty();

private Optional<String> type = Optional.empty();

Expand Down Expand Up @@ -592,22 +586,15 @@ public _FinalStage content(Optional<String> content) {
return this;
}

/**
* <p>The severity level of the alert.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage alertType(ConfigurablePropAlertAlertType alertType) {
public _FinalStage alertType(ConfigurablePropAlertType alertType) {
this.alertType = Optional.ofNullable(alertType);
return this;
}

/**
* <p>The severity level of the alert.</p>
*/
@java.lang.Override
@JsonSetter(value = "alertType", nulls = Nulls.SKIP)
public _FinalStage alertType(Optional<ConfigurablePropAlertAlertType> alertType) {
public _FinalStage alertType(Optional<ConfigurablePropAlertType> alertType) {
this.alertType = alertType;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import com.fasterxml.jackson.annotation.JsonValue;

public enum ConfigurablePropAlertAlertType {
public enum ConfigurablePropAlertType {
INFO("info"),

NEUTRAL("neutral"),
Expand All @@ -16,7 +16,7 @@ public enum ConfigurablePropAlertAlertType {

private final String value;

ConfigurablePropAlertAlertType(String value) {
ConfigurablePropAlertType(String value) {
this.value = value;
}

Expand Down
Loading