Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .gradle/8.14.3/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/8.14.3/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/8.14.3/checksums/sha1-checksums.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .gradle/8.14.3/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/8.14.3/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/8.14.3/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/8.14.3/gc.properties
Empty file.
Binary file added .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 2 additions & 0 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Thu Jul 17 20:22:15 UTC 2025
gradle.version=8.14.3
Binary file added .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Empty file added .gradle/vcs-1/gc.properties
Empty file.
8 changes: 8 additions & 0 deletions .publish/prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Write key ring file
echo "$MAVEN_SIGNATURE_SECRET_KEY" > armored_key.asc
gpg -o publish_key.gpg --dearmor armored_key.asc

# Generate gradle.properties file
echo "signing.keyId=$MAVEN_SIGNATURE_KID" > gradle.properties
echo "signing.secretKeyRingFile=publish_key.gpg" >> gradle.properties
echo "signing.password=$MAVEN_SIGNATURE_PASSWORD" >> gradle.properties
178 changes: 178 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Pipedream Java Library

[![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.

## Installation

### Gradle

Add the dependency in your `build.gradle` file:

```groovy
dependencies {
implementation 'com.pipedream:pipedream'
}
```

### Maven

Add the dependency in your `pom.xml` file:

```xml
<dependency>
<groupId>com.pipedream</groupId>
<artifactId>pipedream</artifactId>
<version>0.0.190</version>
</dependency>
```

## Usage

Instantiate and use the client with the following:

```java
package com.example.usage;

import com.pipedream.api.PipedreamApiClient;
import com.pipedream.api.resources.accounts.requests.CreateAccountRequest;

public class Example {
public static void main(String[] args) {
PipedreamApiClient client = PipedreamApiClient
.builder()
.clientId("<clientId>")
.clientSecret("<clientSecret>")
.build();

client.accounts().create(
"project_id",
CreateAccountRequest
.builder()
.appSlug("app_slug")
.cfmapJson("cfmap_json")
.connectToken("connect_token")
.build()
);
}
}
```

## Environments

This SDK allows you to configure different environments for API requests.

```java
import com.pipedream.api.PipedreamApiClient;
import com.pipedream.api.core.Environment;

PipedreamApiClient client = PipedreamApiClient
.builder()
.environment(Environment.Prod)
.build();
```

## Base Url

You can set a custom base URL when constructing the client.

```java
import com.pipedream.api.PipedreamApiClient;

PipedreamApiClient client = PipedreamApiClient
.builder()
.url("https://example.com")
.build();
```

## Exception Handling

When the API returns a non-success status code (4xx or 5xx response), an API exception will be thrown.

```java
import com.pipedream.api.core.PipedreamApiApiException;

try {
client.accounts().create(...);
} catch (PipedreamApiApiException e) {
// Do something with the API exception...
}
```

## Advanced

### Custom Client

This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one.
However, you can pass your own client like so:

```java
import com.pipedream.api.PipedreamApiClient;
import okhttp3.OkHttpClient;

OkHttpClient customClient = ...;

PipedreamApiClient client = PipedreamApiClient
.builder()
.httpClient(customClient)
.build();
```

### Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
retry limit (default: 2).

A request is deemed retryable when any of the following HTTP status codes is returned:

- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)

Use the `maxRetries` client option to configure this behavior.

```java
import com.pipedream.api.PipedreamApiClient;

PipedreamApiClient client = PipedreamApiClient
.builder()
.maxRetries(1)
.build();
```

### Timeouts

The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.

```java
import com.pipedream.api.PipedreamApiClient;
import com.pipedream.api.core.RequestOptions;

// Client level
PipedreamApiClient client = PipedreamApiClient
.builder()
.timeout(10)
.build();

// Request level
client.accounts().create(
...,
RequestOptions
.builder()
.timeout(10)
.build()
);
```

## Contributing

While we value open-source contributions to this SDK, this library is generated programmatically.
Additions made directly to this library would have to be moved over to our generation code,
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!
130 changes: 130 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.11.0'
id 'signing'
id 'cl.franciscosolis.sonatype-central-upload' version '1.0.3'
}

repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
}
}

dependencies {
api 'com.squareup.okhttp3:okhttp:4.12.0'
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'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}


sourceCompatibility = 1.8
targetCompatibility = 1.8

tasks.withType(Javadoc) {
failOnError false
options.addStringOption('Xdoclint:none', '-quiet')
}

spotless {
java {
palantirJavaFormat()
}
}


java {
withSourcesJar()
withJavadocJar()
}


group = 'com.pipedream'

version = '0.0.190'

jar {
dependsOn(":generatePomFileForMavenPublication")
archiveBaseName = "pipedream"
}

sourcesJar {
archiveBaseName = "pipedream"
}

javadocJar {
archiveBaseName = "pipedream"
}

signing {
sign(publishing.publications)
}

test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}

publishing {
publications {
maven(MavenPublication) {
groupId = 'com.pipedream'
artifactId = 'pipedream'
version = '0.0.190'
from components.java
pom {
name = 'pipedream'
description = 'The official SDK of pipedream'
url = 'https://buildwithfern.com'
licenses {
license {
name = 'The MIT License (MIT)'
url = 'https://mit-license.org/'
}
}
developers {
developer {
name = 'pipedream'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/PipedreamHQ/pipedream-sdk-java.git'
developerConnection = 'scm:git:git://github.com/PipedreamHQ/pipedream-sdk-java.git'
url = 'https://github.com/PipedreamHQ/pipedream-sdk-java'
}
}
}
}
}

sonatypeCentralUpload {
username = "$System.env.MAVEN_USERNAME"
password = "$System.env.MAVEN_PASSWORD"

archives = files(
"$buildDir/libs/pipedream-" + version + ".jar",
"$buildDir/libs/pipedream-" + version + "-sources.jar",
"$buildDir/libs/pipedream-" + version + "-javadoc.jar"
)

pom = file("$buildDir/publications/maven/pom-default.xml")
signingKey = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
signingKeyPassphrase = "$System.env.MAVEN_SIGNATURE_PASSWORD"
}

signing {
def signingKeyId = "$System.env.MAVEN_SIGNATURE_SECRET_KEY"
def signingPassword = "$System.env.MAVEN_SIGNATURE_PASSWORD"
useInMemoryPgpKeys(signingKeyId, signingPassword)
sign publishing.publications.maven
}

sonatypeCentralUpload.dependsOn build
Loading