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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 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 Expand Up @@ -166,6 +166,32 @@ client.actions().run(
);
```

### Custom Headers

The SDK allows you to add custom headers to requests. You can configure headers at the client level or at the request level.

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

// Client level
BaseClient client = BaseClient
.builder()
.addHeader("X-Custom-Header", "custom-value")
.addHeader("X-Request-Id", "abc-123")
.build();
;

// Request level
client.actions().run(
...,
RequestOptions
.builder()
.addHeader("X-Request-Header", "request-value")
.build()
);
```

## Contributing

While we value open-source contributions to this SDK, this library is generated programmatically.
Expand All @@ -174,4 +200,7 @@ otherwise they would be overwritten upon the next generated release. Feel free t
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!
On the other hand, contributions to the README are always very welcome!
## Reference

A full reference for this library is available [here](https://github.com/PipedreamHQ/pipedream-sdk-java/blob/HEAD/./reference.md).
9 changes: 5 additions & 4 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 Expand Up @@ -123,9 +123,10 @@ sonatypeCentralUpload {
}

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

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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.pipedream.api.core.ObjectMappers;
import com.pipedream.api.types.ConfiguredPropValue;
import com.pipedream.api.types.RunActionOptsStashId;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -26,7 +27,7 @@ public final class RunActionOpts {

private final String externalUserId;

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

private final Optional<String> dynamicPropsId;

Expand All @@ -37,7 +38,7 @@ public final class RunActionOpts {
private RunActionOpts(
String id,
String externalUserId,
Optional<Map<String, Object>> configuredProps,
Optional<Map<String, ConfiguredPropValue>> configuredProps,
Optional<String> dynamicPropsId,
Optional<RunActionOptsStashId> stashId,
Map<String, Object> additionalProperties) {
Expand Down Expand Up @@ -65,11 +66,8 @@ public String getExternalUserId() {
return externalUserId;
}

/**
* @return The configured properties for the action
*/
@JsonProperty("configured_props")
public Optional<Map<String, Object>> getConfiguredProps() {
public Optional<Map<String, ConfiguredPropValue>> getConfiguredProps() {
return configuredProps;
}

Expand Down Expand Up @@ -138,12 +136,9 @@ public interface ExternalUserIdStage {
public interface _FinalStage {
RunActionOpts build();

/**
* <p>The configured properties for the action</p>
*/
_FinalStage configuredProps(Optional<Map<String, Object>> configuredProps);
_FinalStage configuredProps(Optional<Map<String, ConfiguredPropValue>> configuredProps);

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

/**
* <p>The ID for dynamic props</p>
Expand All @@ -167,7 +162,7 @@ public static final class Builder implements IdStage, ExternalUserIdStage, _Fina

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

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

@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();
Expand Down Expand Up @@ -241,22 +236,15 @@ public _FinalStage dynamicPropsId(Optional<String> dynamicPropsId) {
return this;
}

/**
* <p>The configured properties for the action</p>
* @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, ConfiguredPropValue> configuredProps) {
this.configuredProps = Optional.ofNullable(configuredProps);
return this;
}

/**
* <p>The configured properties for the action</p>
*/
@java.lang.Override
@JsonSetter(value = "configured_props", nulls = Nulls.SKIP)
public _FinalStage configuredProps(Optional<Map<String, Object>> configuredProps) {
public _FinalStage configuredProps(Optional<Map<String, ConfiguredPropValue>> configuredProps) {
this.configuredProps = configuredProps;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public CompletableFuture<BaseClientHttpResponse<SyncPagingIterable<Component>>>
if (request.getApp().isPresent()) {
QueryStringMapper.addQueryParameter(httpUrl, "app", request.getApp().get(), false);
}
if (request.getComponentType().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "component_type", request.getComponentType().get(), false);
}
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public BaseClientHttpResponse<SyncPagingIterable<Component>> list(
if (request.getApp().isPresent()) {
QueryStringMapper.addQueryParameter(httpUrl, "app", request.getApp().get(), false);
}
if (request.getComponentType().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "component_type", request.getComponentType().get(), false);
}
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.pipedream.api.core.ObjectMappers;
import com.pipedream.api.types.ComponentType;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
Expand All @@ -30,6 +31,8 @@ public final class ComponentsListRequest {

private final Optional<String> app;

private final Optional<ComponentType> componentType;

private final Map<String, Object> additionalProperties;

private ComponentsListRequest(
Expand All @@ -38,12 +41,14 @@ private ComponentsListRequest(
Optional<Integer> limit,
Optional<String> q,
Optional<String> app,
Optional<ComponentType> componentType,
Map<String, Object> additionalProperties) {
this.after = after;
this.before = before;
this.limit = limit;
this.q = q;
this.app = app;
this.componentType = componentType;
this.additionalProperties = additionalProperties;
}

Expand Down Expand Up @@ -87,6 +92,14 @@ public Optional<String> getApp() {
return app;
}

/**
* @return The type of the component to filter the components
*/
@JsonProperty("component_type")
public Optional<ComponentType> getComponentType() {
return componentType;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand All @@ -103,12 +116,13 @@ private boolean equalTo(ComponentsListRequest other) {
&& before.equals(other.before)
&& limit.equals(other.limit)
&& q.equals(other.q)
&& app.equals(other.app);
&& app.equals(other.app)
&& componentType.equals(other.componentType);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.after, this.before, this.limit, this.q, this.app);
return Objects.hash(this.after, this.before, this.limit, this.q, this.app, this.componentType);
}

@java.lang.Override
Expand All @@ -132,6 +146,8 @@ public static final class Builder {

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

private Optional<ComponentType> componentType = Optional.empty();

@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();

Expand All @@ -143,6 +159,7 @@ public Builder from(ComponentsListRequest other) {
limit(other.getLimit());
q(other.getQ());
app(other.getApp());
componentType(other.getComponentType());
return this;
}

Expand Down Expand Up @@ -216,8 +233,22 @@ public Builder app(String app) {
return this;
}

/**
* <p>The type of the component to filter the components</p>
*/
@JsonSetter(value = "component_type", nulls = Nulls.SKIP)
public Builder componentType(Optional<ComponentType> componentType) {
this.componentType = componentType;
return this;
}

public Builder componentType(ComponentType componentType) {
this.componentType = Optional.ofNullable(componentType);
return this;
}

public ComponentsListRequest build() {
return new ComponentsListRequest(after, before, limit, q, app, additionalProperties);
return new ComponentsListRequest(after, before, limit, q, app, componentType, additionalProperties);
}
}
}
Loading