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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
],
"retry-status-codes": "legacy"
},
"originGitCommit": "729a65c6931057ef726cbf54bc9603b5d93c752a",
"originGitCommit": "4ec89179f0cd7c09cc536f40a9c42a089d9cd425",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"ciProvider": "github",
"sdkVersion": "2.1.2"
}
"sdkVersion": "2.1.4"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add the dependency in your `build.gradle` file:

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

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

Expand Down Expand Up @@ -171,13 +171,11 @@ the `Retry-After` header (as either in seconds or as an HTTP date), and then the
Which status codes are retried depends on the `retry-status-codes` generator configuration:

**`legacy`** (current default): retries on

- [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#server_error_responses) (All server errors, including 500)

**`recommended`**: retries on

- [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)
- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
Expand All @@ -198,7 +196,6 @@ BaseClient client = BaseClient
### 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.BaseClient;
import com.pipedream.api.core.RequestOptions;
Expand Down Expand Up @@ -267,7 +264,7 @@ a proof of concept, but know that we will not be able to merge it as-is. We sugg
an issue first to discuss with us!

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).

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 = '2.1.3'
version = '2.1.4'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.pipedream'
artifactId = 'pipedream'
version = '2.1.3'
version = '2.1.4'
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 @@ -41,10 +41,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "com.pipedream:pipedream/2.1.3");
put("User-Agent", "com.pipedream:pipedream/2.1.4");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk");
put("X-Fern-SDK-Version", "2.1.3");
put("X-Fern-SDK-Version", "2.1.4");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public final class CreateAccountOpts {

private final Optional<String> accountId;

private final Optional<String> appOverrideId;

private final Map<String, Object> additionalProperties;

private CreateAccountOpts(
Expand All @@ -46,6 +48,7 @@ private CreateAccountOpts(
String connectToken,
Optional<String> name,
Optional<String> accountId,
Optional<String> appOverrideId,
Map<String, Object> additionalProperties) {
this.externalUserId = externalUserId;
this.oauthAppId = oauthAppId;
Expand All @@ -54,6 +57,7 @@ private CreateAccountOpts(
this.connectToken = connectToken;
this.name = name;
this.accountId = accountId;
this.appOverrideId = appOverrideId;
this.additionalProperties = additionalProperties;
}

Expand Down Expand Up @@ -110,6 +114,14 @@ public Optional<String> getAccountId() {
return accountId;
}

/**
* @return An app override ID. The account is linked to the override and the override's pre-defined custom field values are merged over cfmap_json; with account_id, the account is re-linked to this override. Must belong to the app identified by app_slug, and must not select an OAuth client — overrides that do can only connect through the OAuth flow.
*/
@JsonProperty("app_override_id")
public Optional<String> getAppOverrideId() {
return appOverrideId;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand All @@ -128,7 +140,8 @@ private boolean equalTo(CreateAccountOpts other) {
&& cfmapJson.equals(other.cfmapJson)
&& connectToken.equals(other.connectToken)
&& name.equals(other.name)
&& accountId.equals(other.accountId);
&& accountId.equals(other.accountId)
&& appOverrideId.equals(other.appOverrideId);
}

@java.lang.Override
Expand All @@ -140,7 +153,8 @@ public int hashCode() {
this.cfmapJson,
this.connectToken,
this.name,
this.accountId);
this.accountId,
this.appOverrideId);
}

@java.lang.Override
Expand Down Expand Up @@ -206,6 +220,13 @@ public interface _FinalStage {
_FinalStage accountId(Optional<String> accountId);

_FinalStage accountId(String accountId);

/**
* <p>An app override ID. The account is linked to the override and the override's pre-defined custom field values are merged over cfmap_json; with account_id, the account is re-linked to this override. Must belong to the app identified by app_slug, and must not select an OAuth client — overrides that do can only connect through the OAuth flow.</p>
*/
_FinalStage appOverrideId(Optional<String> appOverrideId);

_FinalStage appOverrideId(String appOverrideId);
}

@JsonIgnoreProperties(ignoreUnknown = true)
Expand All @@ -216,6 +237,8 @@ public static final class Builder implements AppSlugStage, CfmapJsonStage, Conne

private String connectToken;

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

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

private Optional<String> name = Optional.empty();
Expand All @@ -238,6 +261,7 @@ public Builder from(CreateAccountOpts other) {
connectToken(other.getConnectToken());
name(other.getName());
accountId(other.getAccountId());
appOverrideId(other.getAppOverrideId());
return this;
}

Expand Down Expand Up @@ -277,6 +301,26 @@ public _FinalStage connectToken(@NotNull String connectToken) {
return this;
}

/**
* <p>An app override ID. The account is linked to the override and the override's pre-defined custom field values are merged over cfmap_json; with account_id, the account is re-linked to this override. Must belong to the app identified by app_slug, and must not select an OAuth client — overrides that do can only connect through the OAuth flow.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage appOverrideId(String appOverrideId) {
this.appOverrideId = Optional.ofNullable(appOverrideId);
return this;
}

/**
* <p>An app override ID. The account is linked to the override and the override's pre-defined custom field values are merged over cfmap_json; with account_id, the account is re-linked to this override. Must belong to the app identified by app_slug, and must not select an OAuth client — overrides that do can only connect through the OAuth flow.</p>
*/
@java.lang.Override
@JsonSetter(value = "app_override_id", nulls = Nulls.SKIP)
public _FinalStage appOverrideId(Optional<String> appOverrideId) {
this.appOverrideId = appOverrideId;
return this;
}

/**
* <p>An existing account ID to reconnect. When provided, the account's credentials are updated instead of creating a new account. Must belong to the same external user and project environment as the connect token, and match the app identified by app_slug.</p>
* @return Reference to {@code this} so that method calls can be chained together.
Expand Down Expand Up @@ -360,6 +404,7 @@ public CreateAccountOpts build() {
connectToken,
name,
accountId,
appOverrideId,
additionalProperties);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
return future;
}

/**
* Confirm the validity of a Connect token
*/
public CompletableFuture<BaseClientHttpResponse<ValidateTokenResponse>> validate(String ctok) {
return validate(ctok, TokensValidateRequest.builder().build());
}

/**
* Confirm the validity of a Connect token
*/
public CompletableFuture<BaseClientHttpResponse<ValidateTokenResponse>> validate(
String ctok, RequestOptions requestOptions) {
return validate(ctok, TokensValidateRequest.builder().build(), requestOptions);
}

/**
* Confirm the validity of a Connect token
*/
Expand All @@ -133,7 +148,10 @@ public CompletableFuture<BaseClientHttpResponse<ValidateTokenResponse>> validate
.addPathSegments("v1/connect/tokens")
.addPathSegment(ctok)
.addPathSegments("validate");
QueryStringMapper.addQueryParameter(httpUrl, "app_id", request.getAppId(), false);
if (request.getAppId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "app_id", request.getAppId().get(), false);
}
if (request.getAccountId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "account_id", request.getAccountId().get(), false);
Expand All @@ -142,6 +160,10 @@ public CompletableFuture<BaseClientHttpResponse<ValidateTokenResponse>> validate
QueryStringMapper.addQueryParameter(
httpUrl, "oauth_app_id", request.getOauthAppId().get(), false);
}
if (request.getAppOverrideId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "app_override_id", request.getAppOverrideId().get(), false);
}
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ public CompletableFuture<CreateTokenResponse> create(CreateTokenOpts request, Re
return this.rawClient.create(request, requestOptions).thenApply(response -> response.body());
}

/**
* Confirm the validity of a Connect token
*/
public CompletableFuture<ValidateTokenResponse> validate(String ctok) {
return this.rawClient.validate(ctok).thenApply(response -> response.body());
}

/**
* Confirm the validity of a Connect token
*/
public CompletableFuture<ValidateTokenResponse> validate(String ctok, RequestOptions requestOptions) {
return this.rawClient.validate(ctok, requestOptions).thenApply(response -> response.body());
}

/**
* Confirm the validity of a Connect token
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ public BaseClientHttpResponse<CreateTokenResponse> create(CreateTokenOpts reques
}
}

/**
* Confirm the validity of a Connect token
*/
public BaseClientHttpResponse<ValidateTokenResponse> validate(String ctok) {
return validate(ctok, TokensValidateRequest.builder().build());
}

/**
* Confirm the validity of a Connect token
*/
public BaseClientHttpResponse<ValidateTokenResponse> validate(String ctok, RequestOptions requestOptions) {
return validate(ctok, TokensValidateRequest.builder().build(), requestOptions);
}

/**
* Confirm the validity of a Connect token
*/
Expand All @@ -112,7 +126,10 @@ public BaseClientHttpResponse<ValidateTokenResponse> validate(
.addPathSegments("v1/connect/tokens")
.addPathSegment(ctok)
.addPathSegments("validate");
QueryStringMapper.addQueryParameter(httpUrl, "app_id", request.getAppId(), false);
if (request.getAppId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "app_id", request.getAppId().get(), false);
}
if (request.getAccountId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "account_id", request.getAccountId().get(), false);
Expand All @@ -121,6 +138,10 @@ public BaseClientHttpResponse<ValidateTokenResponse> validate(
QueryStringMapper.addQueryParameter(
httpUrl, "oauth_app_id", request.getOauthAppId().get(), false);
}
if (request.getAppOverrideId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "app_override_id", request.getAppOverrideId().get(), false);
}
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/pipedream/api/resources/tokens/TokensClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ public CreateTokenResponse create(CreateTokenOpts request, RequestOptions reques
return this.rawClient.create(request, requestOptions).body();
}

/**
* Confirm the validity of a Connect token
*/
public ValidateTokenResponse validate(String ctok) {
return this.rawClient.validate(ctok).body();
}

/**
* Confirm the validity of a Connect token
*/
public ValidateTokenResponse validate(String ctok, RequestOptions requestOptions) {
return this.rawClient.validate(ctok, requestOptions).body();
}

/**
* Confirm the validity of a Connect token
*/
Expand Down
Loading
Loading