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
Binary file modified .gradle/8.14.3/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/8.14.3/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified .gradle/8.14.3/checksums/sha1-checksums.bin
Binary file not shown.
Binary file modified .gradle/8.14.3/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/8.14.3/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/8.14.3/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/8.14.3/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 1 addition & 1 deletion .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Thu Jul 17 23:24:55 UTC 2025
#Fri Jul 18 18:17:02 UTC 2025
gradle.version=8.14.3
7 changes: 4 additions & 3 deletions 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>0.0.202</version>
<version>0.0.216</version>
</dependency>
```

Expand All @@ -43,15 +43,16 @@ public class Example {
public static void main(String[] args) {
PipedreamApiClient client = PipedreamApiClient
.builder()
.clientId("<clientId>")
.clientSecret("<clientSecret>")
.accessToken("<token>")
.build();

client.accounts().create(
"project_id",
CreateAccountRequest
.builder()
.appSlug("app_slug")
.cfmapJson("cfmap_json")
.connectToken("connect_token")
.build()
);
}
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {
api 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2'
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
api 'org.apache.commons:commons-text:1.11.0'
api 'org.apache.commons:commons-text:1.13.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
Expand Down Expand Up @@ -47,7 +47,7 @@ java {

group = 'com.pipedream'

version = '0.0.202'
version = '0.0.216'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -78,7 +78,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.pipedream'
artifactId = 'pipedream'
version = '0.0.202'
version = '0.0.216'
from components.java
pom {
name = 'pipedream'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,23 @@

import com.pipedream.api.core.ClientOptions;
import com.pipedream.api.core.Environment;
import com.pipedream.api.core.OAuthTokenSupplier;
import com.pipedream.api.resources.oauthtokens.OauthTokensClient;
import okhttp3.OkHttpClient;

public final class AsyncPipedreamApiClientBuilder {
private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder();

private String clientId = System.getenv("PIPEDREAM_CLIENT_ID");

private String clientSecret = System.getenv("PIPEDREAM_CLIENT_SECRET");
private String accessToken = System.getenv("PIPEDREAM_ACCESS_TOKEN");

private String projectEnvironment = null;

private Environment environment = Environment.PROD;

/**
* Sets clientId.
* Defaults to the PIPEDREAM_CLIENT_ID environment variable.
*/
public AsyncPipedreamApiClientBuilder clientId(String clientId) {
this.clientId = clientId;
return this;
}

/**
* Sets clientSecret.
* Defaults to the PIPEDREAM_CLIENT_SECRET environment variable.
* Sets accessToken.
* Defaults to the PIPEDREAM_ACCESS_TOKEN environment variable.
*/
public AsyncPipedreamApiClientBuilder clientSecret(String clientSecret) {
this.clientSecret = clientSecret;
public AsyncPipedreamApiClientBuilder accessToken(String accessToken) {
this.accessToken = accessToken;
return this;
}

Expand Down Expand Up @@ -86,10 +73,7 @@ public AsyncPipedreamApiClientBuilder projectId(String projectId) {
}

public AsyncPipedreamApiClient build() {
OauthTokensClient authClient = new OauthTokensClient(
ClientOptions.builder().environment(this.environment).build());
OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient);
this.clientOptionsBuilder.addHeader("Authorization", oAuthTokenSupplier);
this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.accessToken);
if (projectEnvironment != null) {
this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,23 @@

import com.pipedream.api.core.ClientOptions;
import com.pipedream.api.core.Environment;
import com.pipedream.api.core.OAuthTokenSupplier;
import com.pipedream.api.resources.oauthtokens.OauthTokensClient;
import okhttp3.OkHttpClient;

public final class PipedreamApiClientBuilder {
private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder();

private String clientId = System.getenv("PIPEDREAM_CLIENT_ID");

private String clientSecret = System.getenv("PIPEDREAM_CLIENT_SECRET");
private String accessToken = System.getenv("PIPEDREAM_ACCESS_TOKEN");

private String projectEnvironment = null;

private Environment environment = Environment.PROD;

/**
* Sets clientId.
* Defaults to the PIPEDREAM_CLIENT_ID environment variable.
*/
public PipedreamApiClientBuilder clientId(String clientId) {
this.clientId = clientId;
return this;
}

/**
* Sets clientSecret.
* Defaults to the PIPEDREAM_CLIENT_SECRET environment variable.
* Sets accessToken.
* Defaults to the PIPEDREAM_ACCESS_TOKEN environment variable.
*/
public PipedreamApiClientBuilder clientSecret(String clientSecret) {
this.clientSecret = clientSecret;
public PipedreamApiClientBuilder accessToken(String accessToken) {
this.accessToken = accessToken;
return this;
}

Expand Down Expand Up @@ -86,10 +73,7 @@ public PipedreamApiClientBuilder projectId(String projectId) {
}

public PipedreamApiClient build() {
OauthTokensClient authClient = new OauthTokensClient(
ClientOptions.builder().environment(this.environment).build());
OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient);
this.clientOptionsBuilder.addHeader("Authorization", oAuthTokenSupplier);
this.clientOptionsBuilder.addHeader("Authorization", "Bearer " + this.accessToken);
if (projectEnvironment != null) {
this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private ClientOptions(
{
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk");
put("X-Fern-SDK-Version", "0.0.202");
put("X-Fern-SDK-Version", "0.0.216");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* This exception type will be thrown for any non-2XX API responses.
*/
public class PipedreamApiApiException extends PipedreamApiException {
public class PipedreamApiClientApiException extends PipedreamApiClientException {
/**
* The error code of the response that triggered the exception.
*/
Expand All @@ -25,14 +25,14 @@ public class PipedreamApiApiException extends PipedreamApiException {

private final Map<String, List<String>> headers;

public PipedreamApiApiException(String message, int statusCode, Object body) {
public PipedreamApiClientApiException(String message, int statusCode, Object body) {
super(message);
this.statusCode = statusCode;
this.body = body;
this.headers = new HashMap<>();
}

public PipedreamApiApiException(String message, int statusCode, Object body, Response rawResponse) {
public PipedreamApiClientApiException(String message, int statusCode, Object body, Response rawResponse) {
super(message);
this.statusCode = statusCode;
this.body = body;
Expand Down Expand Up @@ -67,7 +67,7 @@ public Map<String, List<String>> headers() {

@java.lang.Override
public String toString() {
return "PipedreamApiApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: "
+ body + "}";
return "PipedreamApiClientApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode
+ ", body: " + body + "}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
/**
* This class serves as the base exception for all errors in the SDK.
*/
public class PipedreamApiException extends RuntimeException {
public PipedreamApiException(String message) {
public class PipedreamApiClientException extends RuntimeException {
public PipedreamApiClientException(String message) {
super(message);
}

public PipedreamApiException(String message, Exception e) {
public PipedreamApiClientException(String message, Exception e) {
super(message, e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import java.util.Map;
import okhttp3.Response;

public final class PipedreamApiHttpResponse<T> {
public final class PipedreamApiClientHttpResponse<T> {

private final T body;

private final Map<String, List<String>> headers;

public PipedreamApiHttpResponse(T body, Response rawResponse) {
public PipedreamApiClientHttpResponse(T body, Response rawResponse) {
this.body = body;

Map<String, List<String>> headers = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.function.Supplier;

public final class RequestOptions {
private final String accessToken;

private final String projectEnvironment;

private final Optional<Integer> timeout;
Expand All @@ -21,11 +23,13 @@ public final class RequestOptions {
private final Map<String, Supplier<String>> headerSuppliers;

private RequestOptions(
String accessToken,
String projectEnvironment,
Optional<Integer> timeout,
TimeUnit timeoutTimeUnit,
Map<String, String> headers,
Map<String, Supplier<String>> headerSuppliers) {
this.accessToken = accessToken;
this.projectEnvironment = projectEnvironment;
this.timeout = timeout;
this.timeoutTimeUnit = timeoutTimeUnit;
Expand All @@ -43,6 +47,9 @@ public TimeUnit getTimeoutTimeUnit() {

public Map<String, String> getHeaders() {
Map<String, String> headers = new HashMap<>();
if (this.accessToken != null) {
headers.put("Authorization", "Bearer " + this.accessToken);
}
if (this.projectEnvironment != null) {
headers.put("x-pd-environment", this.projectEnvironment);
}
Expand All @@ -58,6 +65,8 @@ public static Builder builder() {
}

public static final class Builder {
private String accessToken = null;

private String projectEnvironment = null;

private Optional<Integer> timeout = Optional.empty();
Expand All @@ -68,6 +77,11 @@ public static final class Builder {

private final Map<String, Supplier<String>> headerSuppliers = new HashMap<>();

public Builder accessToken(String accessToken) {
this.accessToken = accessToken;
return this;
}

public Builder projectEnvironment(String projectEnvironment) {
this.projectEnvironment = projectEnvironment;
return this;
Expand Down Expand Up @@ -95,7 +109,8 @@ public Builder addHeader(String key, Supplier<String> value) {
}

public RequestOptions build() {
return new RequestOptions(projectEnvironment, timeout, timeoutTimeUnit, headers, headerSuppliers);
return new RequestOptions(
accessToken, projectEnvironment, timeout, timeoutTimeUnit, headers, headerSuppliers);
}
}
}
Loading