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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Add the dependency in your `build.gradle` file:

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

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

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ java {

group = 'com.pipedream'

version = '1.1.13'
version = '1.1.14'

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

private final Optional<String> name;

private final Optional<String> accountId;

private final Map<String, Object> additionalProperties;

private CreateAccountOpts(
Expand All @@ -42,13 +44,15 @@ private CreateAccountOpts(
String cfmapJson,
String connectToken,
Optional<String> name,
Optional<String> accountId,
Map<String, Object> additionalProperties) {
this.externalUserId = externalUserId;
this.oauthAppId = oauthAppId;
this.appSlug = appSlug;
this.cfmapJson = cfmapJson;
this.connectToken = connectToken;
this.name = name;
this.accountId = accountId;
this.additionalProperties = additionalProperties;
}

Expand Down Expand Up @@ -97,6 +101,14 @@ public Optional<String> getName() {
return name;
}

/**
* @return 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.
*/
@JsonProperty("account_id")
public Optional<String> getAccountId() {
return accountId;
}

@java.lang.Override
public boolean equals(Object other) {
if (this == other) return true;
Expand All @@ -114,13 +126,20 @@ private boolean equalTo(CreateAccountOpts other) {
&& appSlug.equals(other.appSlug)
&& cfmapJson.equals(other.cfmapJson)
&& connectToken.equals(other.connectToken)
&& name.equals(other.name);
&& name.equals(other.name)
&& accountId.equals(other.accountId);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(
this.externalUserId, this.oauthAppId, this.appSlug, this.cfmapJson, this.connectToken, this.name);
this.externalUserId,
this.oauthAppId,
this.appSlug,
this.cfmapJson,
this.connectToken,
this.name,
this.accountId);
}

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

_FinalStage name(String name);

/**
* <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>
*/
_FinalStage accountId(Optional<String> accountId);

_FinalStage accountId(String accountId);
}

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

private String connectToken;

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

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

private Optional<String> oauthAppId = Optional.empty();
Expand All @@ -204,6 +232,7 @@ public Builder from(CreateAccountOpts other) {
cfmapJson(other.getCfmapJson());
connectToken(other.getConnectToken());
name(other.getName());
accountId(other.getAccountId());
return this;
}

Expand Down Expand Up @@ -243,6 +272,26 @@ public _FinalStage connectToken(@NotNull String connectToken) {
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.
*/
@java.lang.Override
public _FinalStage accountId(String accountId) {
this.accountId = Optional.ofNullable(accountId);
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>
*/
@java.lang.Override
@JsonSetter(value = "account_id", nulls = Nulls.SKIP)
public _FinalStage accountId(Optional<String> accountId) {
this.accountId = accountId;
return this;
}

/**
* <p>Optional name for the account</p>
* @return Reference to {@code this} so that method calls can be chained together.
Expand Down Expand Up @@ -299,7 +348,14 @@ public _FinalStage externalUserId(Optional<String> externalUserId) {
@java.lang.Override
public CreateAccountOpts build() {
return new CreateAccountOpts(
externalUserId, oauthAppId, appSlug, cfmapJson, connectToken, name, additionalProperties);
externalUserId,
oauthAppId,
appSlug,
cfmapJson,
connectToken,
name,
accountId,
additionalProperties);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ public CompletableFuture<BaseClientHttpResponse<ValidateTokenResponse>> validate
.addPathSegment(ctok)
.addPathSegments("validate");
QueryStringMapper.addQueryParameter(httpUrl, "app_id", request.getAppId(), false);
if (request.getAccountId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "account_id", request.getAccountId().get(), false);
}
if (request.getOauthAppId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "oauth_app_id", request.getOauthAppId().get(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ public BaseClientHttpResponse<ValidateTokenResponse> validate(
.addPathSegment(ctok)
.addPathSegments("validate");
QueryStringMapper.addQueryParameter(httpUrl, "app_id", request.getAppId(), false);
if (request.getAccountId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "account_id", request.getAccountId().get(), false);
}
if (request.getOauthAppId().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "oauth_app_id", request.getOauthAppId().get(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@
public final class TokensValidateRequest {
private final String appId;

private final Optional<String> accountId;

private final Optional<String> oauthAppId;

private final Map<String, Object> additionalProperties;

private TokensValidateRequest(String appId, Optional<String> oauthAppId, Map<String, Object> additionalProperties) {
private TokensValidateRequest(
String appId,
Optional<String> accountId,
Optional<String> oauthAppId,
Map<String, Object> additionalProperties) {
this.appId = appId;
this.accountId = accountId;
this.oauthAppId = oauthAppId;
this.additionalProperties = additionalProperties;
}
Expand All @@ -41,6 +48,14 @@ public String getAppId() {
return appId;
}

/**
* @return An existing account ID to reconnect. Must belong to the app identified by app_id.
*/
@JsonProperty("account_id")
public Optional<String> getAccountId() {
return accountId;
}

/**
* @return The OAuth app ID to validate against (if the token is for an OAuth app)
*/
Expand All @@ -61,12 +76,12 @@ public Map<String, Object> getAdditionalProperties() {
}

private boolean equalTo(TokensValidateRequest other) {
return appId.equals(other.appId) && oauthAppId.equals(other.oauthAppId);
return appId.equals(other.appId) && accountId.equals(other.accountId) && oauthAppId.equals(other.oauthAppId);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.appId, this.oauthAppId);
return Objects.hash(this.appId, this.accountId, this.oauthAppId);
}

@java.lang.Override
Expand All @@ -90,6 +105,13 @@ public interface AppIdStage {
public interface _FinalStage {
TokensValidateRequest build();

/**
* <p>An existing account ID to reconnect. Must belong to the app identified by app_id.</p>
*/
_FinalStage accountId(Optional<String> accountId);

_FinalStage accountId(String accountId);

/**
* <p>The OAuth app ID to validate against (if the token is for an OAuth app)</p>
*/
Expand All @@ -104,6 +126,8 @@ public static final class Builder implements AppIdStage, _FinalStage {

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

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

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

Expand All @@ -112,6 +136,7 @@ private Builder() {}
@java.lang.Override
public Builder from(TokensValidateRequest other) {
appId(other.getAppId());
accountId(other.getAccountId());
oauthAppId(other.getOauthAppId());
return this;
}
Expand Down Expand Up @@ -148,9 +173,29 @@ public _FinalStage oauthAppId(Optional<String> oauthAppId) {
return this;
}

/**
* <p>An existing account ID to reconnect. Must belong to the app identified by app_id.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage accountId(String accountId) {
this.accountId = Optional.ofNullable(accountId);
return this;
}

/**
* <p>An existing account ID to reconnect. Must belong to the app identified by app_id.</p>
*/
@java.lang.Override
@JsonSetter(value = "account_id", nulls = Nulls.SKIP)
public _FinalStage accountId(Optional<String> accountId) {
this.accountId = accountId;
return this;
}

@java.lang.Override
public TokensValidateRequest build() {
return new TokensValidateRequest(appId, oauthAppId, additionalProperties);
return new TokensValidateRequest(appId, accountId, oauthAppId, additionalProperties);
}
}
}
Loading