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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPipedreamHQ%2Fpipedream-sdk-java)
[![Maven Central](https://img.shields.io/maven-central/v/com.pipedream/pipedream)](https://central.sonatype.com/artifact/com.pipedream/pipedream)

The Pipedream Java library provides convenient access to the Pipedream API from Java.
The Pipedream Java library provides convenient access to the Pipedream APIs from Java.

## Installation

Expand All @@ -25,7 +25,7 @@ Add the dependency in your `pom.xml` file:
<dependency>
<groupId>com.pipedream</groupId>
<artifactId>pipedream</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
```

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

group = 'com.pipedream'

version = '1.0.2'
version = '1.0.3'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.pipedream'
artifactId = 'pipedream'
version = '1.0.2'
version = '1.0.3'
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.2");
put("User-Agent", "com.pipedream:pipedream/1.0.3");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk");
put("X-Fern-SDK-Version", "1.0.2");
put("X-Fern-SDK-Version", "1.0.3");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/com/pipedream/api/types/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ private Account(
this.additionalProperties = additionalProperties;
}

/**
* @return The unique ID of the account.
*/
@JsonProperty("id")
public String getId() {
return id;
Expand Down Expand Up @@ -237,9 +234,6 @@ public static IdStage builder() {
}

public interface IdStage {
/**
* <p>The unique ID of the account.</p>
*/
_FinalStage id(@NotNull String id);

Builder from(Account other);
Expand Down Expand Up @@ -381,11 +375,6 @@ public Builder from(Account other) {
return this;
}

/**
* <p>The unique ID of the account.</p>
* <p>The unique ID of the account.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("id")
public _FinalStage id(@NotNull String id) {
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/com/pipedream/api/types/ConfigurePropOpts.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final class ConfigurePropOpts {

private final Optional<Boolean> blocking;

private final Optional<Map<String, Object>> configuredProps;
private final Optional<Map<String, ConfigurePropOptsConfiguredPropsValue>> configuredProps;

private final Optional<String> dynamicPropsId;

Expand All @@ -46,7 +46,7 @@ private ConfigurePropOpts(
String externalUserId,
String propName,
Optional<Boolean> blocking,
Optional<Map<String, Object>> configuredProps,
Optional<Map<String, ConfigurePropOptsConfiguredPropsValue>> configuredProps,
Optional<String> dynamicPropsId,
Optional<Double> page,
Optional<Map<String, Object>> prevContext,
Expand Down Expand Up @@ -100,7 +100,7 @@ public Optional<Boolean> getBlocking() {
* @return The configured properties for the component
*/
@JsonProperty("configured_props")
public Optional<Map<String, Object>> getConfiguredProps() {
public Optional<Map<String, ConfigurePropOptsConfiguredPropsValue>> getConfiguredProps() {
return configuredProps;
}

Expand Down Expand Up @@ -218,9 +218,9 @@ public interface _FinalStage {
/**
* <p>The configured properties for the component</p>
*/
_FinalStage configuredProps(Optional<Map<String, Object>> configuredProps);
_FinalStage configuredProps(Optional<Map<String, ConfigurePropOptsConfiguredPropsValue>> configuredProps);

_FinalStage configuredProps(Map<String, Object> configuredProps);
_FinalStage configuredProps(Map<String, ConfigurePropOptsConfiguredPropsValue> configuredProps);

/**
* <p>The ID for dynamic props</p>
Expand Down Expand Up @@ -267,7 +267,7 @@ public static final class Builder implements IdStage, ExternalUserIdStage, PropN

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

private Optional<Map<String, Object>> configuredProps = Optional.empty();
private Optional<Map<String, ConfigurePropOptsConfiguredPropsValue>> configuredProps = Optional.empty();

private Optional<Boolean> blocking = Optional.empty();

Expand Down Expand Up @@ -411,7 +411,7 @@ public _FinalStage dynamicPropsId(Optional<String> dynamicPropsId) {
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage configuredProps(Map<String, Object> configuredProps) {
public _FinalStage configuredProps(Map<String, ConfigurePropOptsConfiguredPropsValue> configuredProps) {
this.configuredProps = Optional.ofNullable(configuredProps);
return this;
}
Expand All @@ -421,7 +421,8 @@ public _FinalStage configuredProps(Map<String, Object> configuredProps) {
*/
@java.lang.Override
@JsonSetter(value = "configured_props", nulls = Nulls.SKIP)
public _FinalStage configuredProps(Optional<Map<String, Object>> configuredProps) {
public _FinalStage configuredProps(
Optional<Map<String, ConfigurePropOptsConfiguredPropsValue>> configuredProps) {
this.configuredProps = configuredProps;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.pipedream.api.types;

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.List;
import java.util.Map;
import java.util.Objects;

@JsonDeserialize(using = ConfigurePropOptsConfiguredPropsValue.Deserializer.class)
public final class ConfigurePropOptsConfiguredPropsValue {
private final Object value;

private final int type;

private ConfigurePropOptsConfiguredPropsValue(Object value, int type) {
this.value = value;
this.type = type;
}

@JsonValue
public Object get() {
return this.value;
}

@SuppressWarnings("unchecked")
public <T> T visit(Visitor<T> visitor) {
if (this.type == 0) {
return visitor.visit((Object) this.value);
} else if (this.type == 1) {
return visitor.visit((ConfiguredPropApp) this.value);
} else if (this.type == 2) {
return visitor.visit((ConfiguredPropSql) this.value);
} else if (this.type == 3) {
return visitor.visit((boolean) this.value);
} else if (this.type == 4) {
return visitor.visit((double) this.value);
} else if (this.type == 5) {
return visitor.visit((Map<String, Object>) this.value);
} else if (this.type == 6) {
return visitor.visit((String) this.value);
} else if (this.type == 7) {
return visitor.visit((List<String>) 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 ConfigurePropOptsConfiguredPropsValue
&& equalTo((ConfigurePropOptsConfiguredPropsValue) other);
}

private boolean equalTo(ConfigurePropOptsConfiguredPropsValue 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 ConfigurePropOptsConfiguredPropsValue of(Object value) {
return new ConfigurePropOptsConfiguredPropsValue(value, 0);
}

public static ConfigurePropOptsConfiguredPropsValue of(ConfiguredPropApp value) {
return new ConfigurePropOptsConfiguredPropsValue(value, 1);
}

public static ConfigurePropOptsConfiguredPropsValue of(ConfiguredPropSql value) {
return new ConfigurePropOptsConfiguredPropsValue(value, 2);
}

public static ConfigurePropOptsConfiguredPropsValue of(boolean value) {
return new ConfigurePropOptsConfiguredPropsValue(value, 3);
}

public static ConfigurePropOptsConfiguredPropsValue of(double value) {
return new ConfigurePropOptsConfiguredPropsValue(value, 4);
}

public static ConfigurePropOptsConfiguredPropsValue of(Map<String, Object> value) {
return new ConfigurePropOptsConfiguredPropsValue(value, 5);
}

public static ConfigurePropOptsConfiguredPropsValue of(String value) {
return new ConfigurePropOptsConfiguredPropsValue(value, 6);
}

public static ConfigurePropOptsConfiguredPropsValue of(List<String> value) {
return new ConfigurePropOptsConfiguredPropsValue(value, 7);
}

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

T visit(ConfiguredPropApp value);

T visit(ConfiguredPropSql value);

T visit(boolean value);

T visit(double value);

T visit(Map<String, Object> value);

T visit(String value);

T visit(List<String> value);
}

static final class Deserializer extends StdDeserializer<ConfigurePropOptsConfiguredPropsValue> {
Deserializer() {
super(ConfigurePropOptsConfiguredPropsValue.class);
}

@java.lang.Override
public ConfigurePropOptsConfiguredPropsValue deserialize(JsonParser p, DeserializationContext context)
throws IOException {
Object value = p.readValueAs(Object.class);
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, Object.class));
} catch (RuntimeException e) {
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, ConfiguredPropApp.class));
} catch (RuntimeException e) {
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, ConfiguredPropSql.class));
} catch (RuntimeException e) {
}
if (value instanceof Boolean) {
return of((Boolean) value);
}
if (value instanceof Double) {
return of((Double) value);
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference<Map<String, Object>>() {}));
} catch (RuntimeException e) {
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class));
} catch (RuntimeException e) {
}
try {
return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference<List<String>>() {}));
} catch (RuntimeException e) {
}
throw new JsonParseException(p, "Failed to deserialize");
}
}
}
Loading