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>0.0.256</version>
<version>0.0.264</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 = '0.0.256'
version = '0.0.264'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.pipedream'
artifactId = 'pipedream'
version = '0.0.256'
version = '0.0.264'
from components.java
pom {
name = 'pipedream'
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/pipedream/api/AsyncBaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.pipedream.api.resources.tokens.AsyncTokensClient;
import com.pipedream.api.resources.triggers.AsyncTriggersClient;
import com.pipedream.api.resources.users.AsyncUsersClient;

import java.util.function.Supplier;

public class AsyncBaseClient {
Expand Down
59 changes: 29 additions & 30 deletions src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.Optional;
import okhttp3.OkHttpClient;

public class AsyncBaseClientBuilder<T extends AsyncBaseClientBuilder<T>> {
public class AsyncBaseClientBuilder {
private Optional<Integer> timeout = Optional.empty();

private Optional<Integer> maxRetries = Optional.empty();
Expand All @@ -23,74 +23,73 @@ public class AsyncBaseClientBuilder<T extends AsyncBaseClientBuilder<T>> {

private Environment environment = Environment.PROD;

private String projectId;

private OkHttpClient httpClient;

/**
* Sets clientId.
* Defaults to the PIPEDREAM_CLIENT_ID environment variable.
*/
@SuppressWarnings("unchecked")
public T clientId(String clientId) {
public AsyncBaseClientBuilder clientId(String clientId) {
this.clientId = clientId;
return (T) this;
return this;
}

/**
* Sets clientSecret.
* Defaults to the PIPEDREAM_CLIENT_SECRET environment variable.
*/
@SuppressWarnings("unchecked")
public T clientSecret(String clientSecret) {
public AsyncBaseClientBuilder clientSecret(String clientSecret) {
this.clientSecret = clientSecret;
return (T) this;
return this;
}

/**
* Sets projectEnvironment
*/
@SuppressWarnings("unchecked")
public T projectEnvironment(String projectEnvironment) {
public AsyncBaseClientBuilder projectEnvironment(String projectEnvironment) {
this.projectEnvironment = projectEnvironment;
return (T) this;
return this;
}

@SuppressWarnings("unchecked")
public T environment(Environment environment) {
public AsyncBaseClientBuilder environment(Environment environment) {
this.environment = environment;
return (T) this;
return this;
}

@SuppressWarnings("unchecked")
public T url(String url) {
public AsyncBaseClientBuilder url(String url) {
this.environment = Environment.custom(url);
return (T) this;
return this;
}

/**
* Sets the timeout (in seconds) for the client. Defaults to 60 seconds.
*/
@SuppressWarnings("unchecked")
public T timeout(int timeout) {
public AsyncBaseClientBuilder timeout(int timeout) {
this.timeout = Optional.of(timeout);
return (T) this;
return this;
}

/**
* Sets the maximum number of retries for the client. Defaults to 2 retries.
*/
@SuppressWarnings("unchecked")
public T maxRetries(int maxRetries) {
public AsyncBaseClientBuilder maxRetries(int maxRetries) {
this.maxRetries = Optional.of(maxRetries);
return (T) this;
return this;
}

/**
* Sets the underlying OkHttp client
*/
@SuppressWarnings("unchecked")
public T httpClient(OkHttpClient httpClient) {
public AsyncBaseClientBuilder httpClient(OkHttpClient httpClient) {
this.httpClient = httpClient;
return (T) this;
return this;
}

public AsyncBaseClientBuilder projectId(String projectId) {
this.projectId = projectId;
return this;
}

protected ClientOptions buildClientOptions() {
Expand Down Expand Up @@ -124,7 +123,7 @@ protected void setEnvironment(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setAuthentication(ClientOptions.Builder builder) {
* super.setAuthentication(builder); // Keep existing auth
* builder.addHeader("X-API-Key", this.apiKey);
Expand All @@ -149,7 +148,7 @@ protected void setAuthentication(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setCustomHeaders(ClientOptions.Builder builder) {
* super.setCustomHeaders(builder); // Keep existing headers
* builder.addHeader("X-Trace-ID", generateTraceId());
Expand Down Expand Up @@ -215,9 +214,9 @@ protected void setHttpClient(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setAdditional(ClientOptions.Builder builder) {
* builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
* builder.addHeader("X-Request-ID", () -&gt; UUID.randomUUID().toString());
* builder.addHeader("X-Client-Version", "1.0.0");
* }
* }</pre>
Expand All @@ -231,7 +230,7 @@ protected void setAdditional(ClientOptions.Builder builder) {}
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void validateConfiguration() {
* super.validateConfiguration(); // Run parent validations
* if (tenantId == null || tenantId.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Builder for creating AsyncPipedreamClient instances.
*/
public final class AsyncPipedreamClientBuilder extends AsyncBaseClientBuilder<AsyncPipedreamClientBuilder> {
public final class AsyncPipedreamClientBuilder extends AsyncBaseClientBuilder {
private String projectId;

public AsyncPipedreamClient build() {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/pipedream/api/BaseClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.pipedream.api.resources.tokens.TokensClient;
import com.pipedream.api.resources.triggers.TriggersClient;
import com.pipedream.api.resources.users.UsersClient;

import java.util.function.Supplier;

public class BaseClient {
Expand Down
59 changes: 29 additions & 30 deletions src/main/java/com/pipedream/api/BaseClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.Optional;
import okhttp3.OkHttpClient;

public class BaseClientBuilder<T extends BaseClientBuilder<T>> {
public class BaseClientBuilder {
private Optional<Integer> timeout = Optional.empty();

private Optional<Integer> maxRetries = Optional.empty();
Expand All @@ -23,74 +23,73 @@ public class BaseClientBuilder<T extends BaseClientBuilder<T>> {

private Environment environment = Environment.PROD;

private String projectId;

private OkHttpClient httpClient;

/**
* Sets clientId.
* Defaults to the PIPEDREAM_CLIENT_ID environment variable.
*/
@SuppressWarnings("unchecked")
public T clientId(String clientId) {
public BaseClientBuilder clientId(String clientId) {
this.clientId = clientId;
return (T) this;
return this;
}

/**
* Sets clientSecret.
* Defaults to the PIPEDREAM_CLIENT_SECRET environment variable.
*/
@SuppressWarnings("unchecked")
public T clientSecret(String clientSecret) {
public BaseClientBuilder clientSecret(String clientSecret) {
this.clientSecret = clientSecret;
return (T) this;
return this;
}

/**
* Sets projectEnvironment
*/
@SuppressWarnings("unchecked")
public T projectEnvironment(String projectEnvironment) {
public BaseClientBuilder projectEnvironment(String projectEnvironment) {
this.projectEnvironment = projectEnvironment;
return (T) this;
return this;
}

@SuppressWarnings("unchecked")
public T environment(Environment environment) {
public BaseClientBuilder environment(Environment environment) {
this.environment = environment;
return (T) this;
return this;
}

@SuppressWarnings("unchecked")
public T url(String url) {
public BaseClientBuilder url(String url) {
this.environment = Environment.custom(url);
return (T) this;
return this;
}

/**
* Sets the timeout (in seconds) for the client. Defaults to 60 seconds.
*/
@SuppressWarnings("unchecked")
public T timeout(int timeout) {
public BaseClientBuilder timeout(int timeout) {
this.timeout = Optional.of(timeout);
return (T) this;
return this;
}

/**
* Sets the maximum number of retries for the client. Defaults to 2 retries.
*/
@SuppressWarnings("unchecked")
public T maxRetries(int maxRetries) {
public BaseClientBuilder maxRetries(int maxRetries) {
this.maxRetries = Optional.of(maxRetries);
return (T) this;
return this;
}

/**
* Sets the underlying OkHttp client
*/
@SuppressWarnings("unchecked")
public T httpClient(OkHttpClient httpClient) {
public BaseClientBuilder httpClient(OkHttpClient httpClient) {
this.httpClient = httpClient;
return (T) this;
return this;
}

public BaseClientBuilder projectId(String projectId) {
this.projectId = projectId;
return this;
}

protected ClientOptions buildClientOptions() {
Expand Down Expand Up @@ -124,7 +123,7 @@ protected void setEnvironment(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setAuthentication(ClientOptions.Builder builder) {
* super.setAuthentication(builder); // Keep existing auth
* builder.addHeader("X-API-Key", this.apiKey);
Expand All @@ -149,7 +148,7 @@ protected void setAuthentication(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setCustomHeaders(ClientOptions.Builder builder) {
* super.setCustomHeaders(builder); // Keep existing headers
* builder.addHeader("X-Trace-ID", generateTraceId());
Expand Down Expand Up @@ -215,9 +214,9 @@ protected void setHttpClient(ClientOptions.Builder builder) {
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void setAdditional(ClientOptions.Builder builder) {
* builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
* builder.addHeader("X-Request-ID", () -&gt; UUID.randomUUID().toString());
* builder.addHeader("X-Client-Version", "1.0.0");
* }
* }</pre>
Expand All @@ -231,7 +230,7 @@ protected void setAdditional(ClientOptions.Builder builder) {}
*
* Example:
* <pre>{@code
* @Override
* &#64;Override
* protected void validateConfiguration() {
* super.validateConfiguration(); // Run parent validations
* if (tenantId == null || tenantId.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Builder for creating PipedreamClient instances.
*/
public final class PipedreamClientBuilder extends BaseClientBuilder<PipedreamClientBuilder> {
public final class PipedreamClientBuilder extends BaseClientBuilder {
private String projectId;

public PipedreamClient build() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pipedream/api/core/ClientOptions.java
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.256");
put("X-Fern-SDK-Version", "0.0.264");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Loading