diff --git a/.fern/metadata.json b/.fern/metadata.json index 3abe440..4d20afc 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -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" +} \ No newline at end of file diff --git a/.fern/replay.lock b/.fern/replay.lock index 2fc172b..60be37c 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -12,5 +12,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-java-sdk: 4.8.4 -current_generation: d9d1ea8e33820dc82ac6241ea80ca1aa60d5eca0 + - commit_sha: e296916f2e3ace45c8c47dc725cbb525c94a22b7 + tree_hash: 7a43c1e06e9f46a06057277b3f8d2726ad679f12 + timestamp: 2026-08-31T20:30:35.434Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 4.8.4 +current_generation: e296916f2e3ace45c8c47dc725cbb525c94a22b7 patches: [] diff --git a/README.md b/README.md index 0b40a18..d09c55c 100644 --- a/README.md +++ b/README.md @@ -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' } ``` @@ -42,7 +42,7 @@ Add the dependency in your `pom.xml` file: com.pipedream pipedream - 2.1.3 + 2.1.4 ``` @@ -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) @@ -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; @@ -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). + diff --git a/build.gradle b/build.gradle index 0db90a7..11350e3 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ java { group = 'com.pipedream' -version = '2.1.3' +version = '2.1.4' jar { dependsOn(":generatePomFileForMavenPublication") @@ -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' diff --git a/src/main/java/com/pipedream/api/core/ClientOptions.java b/src/main/java/com/pipedream/api/core/ClientOptions.java index 80c5c43..438ec5a 100644 --- a/src/main/java/com/pipedream/api/core/ClientOptions.java +++ b/src/main/java/com/pipedream/api/core/ClientOptions.java @@ -41,10 +41,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - 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; diff --git a/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java b/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java index 3e85b73..acc2a6a 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java +++ b/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java @@ -36,6 +36,8 @@ public final class CreateAccountOpts { private final Optional accountId; + private final Optional appOverrideId; + private final Map additionalProperties; private CreateAccountOpts( @@ -46,6 +48,7 @@ private CreateAccountOpts( String connectToken, Optional name, Optional accountId, + Optional appOverrideId, Map additionalProperties) { this.externalUserId = externalUserId; this.oauthAppId = oauthAppId; @@ -54,6 +57,7 @@ private CreateAccountOpts( this.connectToken = connectToken; this.name = name; this.accountId = accountId; + this.appOverrideId = appOverrideId; this.additionalProperties = additionalProperties; } @@ -110,6 +114,14 @@ public Optional 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 getAppOverrideId() { + return appOverrideId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -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 @@ -140,7 +153,8 @@ public int hashCode() { this.cfmapJson, this.connectToken, this.name, - this.accountId); + this.accountId, + this.appOverrideId); } @java.lang.Override @@ -206,6 +220,13 @@ public interface _FinalStage { _FinalStage accountId(Optional accountId); _FinalStage accountId(String accountId); + + /** + *

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.

+ */ + _FinalStage appOverrideId(Optional appOverrideId); + + _FinalStage appOverrideId(String appOverrideId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -216,6 +237,8 @@ public static final class Builder implements AppSlugStage, CfmapJsonStage, Conne private String connectToken; + private Optional appOverrideId = Optional.empty(); + private Optional accountId = Optional.empty(); private Optional name = Optional.empty(); @@ -238,6 +261,7 @@ public Builder from(CreateAccountOpts other) { connectToken(other.getConnectToken()); name(other.getName()); accountId(other.getAccountId()); + appOverrideId(other.getAppOverrideId()); return this; } @@ -277,6 +301,26 @@ public _FinalStage connectToken(@NotNull String connectToken) { return this; } + /** + *

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.

+ * @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; + } + + /** + *

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.

+ */ + @java.lang.Override + @JsonSetter(value = "app_override_id", nulls = Nulls.SKIP) + public _FinalStage appOverrideId(Optional appOverrideId) { + this.appOverrideId = appOverrideId; + return this; + } + /** *

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.

* @return Reference to {@code this} so that method calls can be chained together. @@ -360,6 +404,7 @@ public CreateAccountOpts build() { connectToken, name, accountId, + appOverrideId, additionalProperties); } diff --git a/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java index e2130b3..157267a 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java @@ -115,6 +115,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + /** + * Confirm the validity of a Connect token + */ + public CompletableFuture> validate(String ctok) { + return validate(ctok, TokensValidateRequest.builder().build()); + } + + /** + * Confirm the validity of a Connect token + */ + public CompletableFuture> validate( + String ctok, RequestOptions requestOptions) { + return validate(ctok, TokensValidateRequest.builder().build(), requestOptions); + } + /** * Confirm the validity of a Connect token */ @@ -133,7 +148,10 @@ public CompletableFuture> 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); @@ -142,6 +160,10 @@ public CompletableFuture> 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); diff --git a/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java index 4e3f3ff..8a1da3a 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java @@ -42,6 +42,20 @@ public CompletableFuture create(CreateTokenOpts request, Re return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); } + /** + * Confirm the validity of a Connect token + */ + public CompletableFuture validate(String ctok) { + return this.rawClient.validate(ctok).thenApply(response -> response.body()); + } + + /** + * Confirm the validity of a Connect token + */ + public CompletableFuture validate(String ctok, RequestOptions requestOptions) { + return this.rawClient.validate(ctok, requestOptions).thenApply(response -> response.body()); + } + /** * Confirm the validity of a Connect token */ diff --git a/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java index f10c34b..b39a685 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java @@ -95,6 +95,20 @@ public BaseClientHttpResponse create(CreateTokenOpts reques } } + /** + * Confirm the validity of a Connect token + */ + public BaseClientHttpResponse validate(String ctok) { + return validate(ctok, TokensValidateRequest.builder().build()); + } + + /** + * Confirm the validity of a Connect token + */ + public BaseClientHttpResponse validate(String ctok, RequestOptions requestOptions) { + return validate(ctok, TokensValidateRequest.builder().build(), requestOptions); + } + /** * Confirm the validity of a Connect token */ @@ -112,7 +126,10 @@ public BaseClientHttpResponse 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); @@ -121,6 +138,10 @@ public BaseClientHttpResponse 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); diff --git a/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java index 661e9d2..98f3494 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java @@ -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 */ diff --git a/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java b/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java index a31b6bf..ab0482a 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java +++ b/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java @@ -38,6 +38,10 @@ public final class CreateTokenOpts { private final Optional allowProgressiveScopes; + private final Optional appId; + + private final Optional oauthAppId; + private final Map additionalProperties; private CreateTokenOpts( @@ -49,6 +53,8 @@ private CreateTokenOpts( Optional successRedirectUri, Optional webhookUri, Optional allowProgressiveScopes, + Optional appId, + Optional oauthAppId, Map additionalProperties) { this.allowedOrigins = allowedOrigins; this.errorRedirectUri = errorRedirectUri; @@ -58,6 +64,8 @@ private CreateTokenOpts( this.successRedirectUri = successRedirectUri; this.webhookUri = webhookUri; this.allowProgressiveScopes = allowProgressiveScopes; + this.appId = appId; + this.oauthAppId = oauthAppId; this.additionalProperties = additionalProperties; } @@ -125,6 +133,22 @@ public Optional getAllowProgressiveScopes() { return allowProgressiveScopes; } + /** + * @return Scope the Connect Link to this app, identified by app ID or name slug: resolves the app's official OAuth client for your workspace (when it has one) and pins the link to the host serving that client's OAuth flow pages. Optional. + */ + @JsonProperty("app_id") + public Optional getAppId() { + return appId; + } + + /** + * @return Scope the Connect Link to a specific OAuth client (overrides app_id's resolution). Optional. + */ + @JsonProperty("oauth_app_id") + public Optional getOauthAppId() { + return oauthAppId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -144,7 +168,9 @@ private boolean equalTo(CreateTokenOpts other) { && scope.equals(other.scope) && successRedirectUri.equals(other.successRedirectUri) && webhookUri.equals(other.webhookUri) - && allowProgressiveScopes.equals(other.allowProgressiveScopes); + && allowProgressiveScopes.equals(other.allowProgressiveScopes) + && appId.equals(other.appId) + && oauthAppId.equals(other.oauthAppId); } @java.lang.Override @@ -157,7 +183,9 @@ public int hashCode() { this.scope, this.successRedirectUri, this.webhookUri, - this.allowProgressiveScopes); + this.allowProgressiveScopes, + this.appId, + this.oauthAppId); } @java.lang.Override @@ -233,12 +261,30 @@ public interface _FinalStage { _FinalStage allowProgressiveScopes(Optional allowProgressiveScopes); _FinalStage allowProgressiveScopes(Boolean allowProgressiveScopes); + + /** + *

Scope the Connect Link to this app, identified by app ID or name slug: resolves the app's official OAuth client for your workspace (when it has one) and pins the link to the host serving that client's OAuth flow pages. Optional.

+ */ + _FinalStage appId(Optional appId); + + _FinalStage appId(String appId); + + /** + *

Scope the Connect Link to a specific OAuth client (overrides app_id's resolution). Optional.

+ */ + _FinalStage oauthAppId(Optional oauthAppId); + + _FinalStage oauthAppId(String oauthAppId); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ExternalUserIdStage, _FinalStage { private String externalUserId; + private Optional oauthAppId = Optional.empty(); + + private Optional appId = Optional.empty(); + private Optional allowProgressiveScopes = Optional.empty(); private Optional webhookUri = Optional.empty(); @@ -268,6 +314,8 @@ public Builder from(CreateTokenOpts other) { successRedirectUri(other.getSuccessRedirectUri()); webhookUri(other.getWebhookUri()); allowProgressiveScopes(other.getAllowProgressiveScopes()); + appId(other.getAppId()); + oauthAppId(other.getOauthAppId()); return this; } @@ -283,6 +331,46 @@ public _FinalStage externalUserId(@NotNull String externalUserId) { return this; } + /** + *

Scope the Connect Link to a specific OAuth client (overrides app_id's resolution). Optional.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage oauthAppId(String oauthAppId) { + this.oauthAppId = Optional.ofNullable(oauthAppId); + return this; + } + + /** + *

Scope the Connect Link to a specific OAuth client (overrides app_id's resolution). Optional.

+ */ + @java.lang.Override + @JsonSetter(value = "oauth_app_id", nulls = Nulls.SKIP) + public _FinalStage oauthAppId(Optional oauthAppId) { + this.oauthAppId = oauthAppId; + return this; + } + + /** + *

Scope the Connect Link to this app, identified by app ID or name slug: resolves the app's official OAuth client for your workspace (when it has one) and pins the link to the host serving that client's OAuth flow pages. Optional.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage appId(String appId) { + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + *

Scope the Connect Link to this app, identified by app ID or name slug: resolves the app's official OAuth client for your workspace (when it has one) and pins the link to the host serving that client's OAuth flow pages. Optional.

+ */ + @java.lang.Override + @JsonSetter(value = "app_id", nulls = Nulls.SKIP) + public _FinalStage appId(Optional appId) { + this.appId = appId; + return this; + } + /** *

When true, end users may authorize a subset of the app's OAuth scopes; only the app's functional scopes (needed for the post-OAuth test request) are enforced. Defaults to false.

* @return Reference to {@code this} so that method calls can be chained together. @@ -434,6 +522,8 @@ public CreateTokenOpts build() { successRedirectUri, webhookUri, allowProgressiveScopes, + appId, + oauthAppId, additionalProperties); } diff --git a/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java b/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java index cff00a1..bc39af0 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java +++ b/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java @@ -16,35 +16,38 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TokensValidateRequest.Builder.class) public final class TokensValidateRequest { - private final String appId; + private final Optional appId; private final Optional accountId; private final Optional oauthAppId; + private final Optional appOverrideId; + private final Map additionalProperties; private TokensValidateRequest( - String appId, + Optional appId, Optional accountId, Optional oauthAppId, + Optional appOverrideId, Map additionalProperties) { this.appId = appId; this.accountId = accountId; this.oauthAppId = oauthAppId; + this.appOverrideId = appOverrideId; this.additionalProperties = additionalProperties; } /** - * @return The app ID to validate against + * @return The app ID to validate against. Required unless account_id or app_override_id identifies the app. */ @JsonProperty("app_id") - public String getAppId() { + public Optional getAppId() { return appId; } @@ -64,6 +67,14 @@ public Optional getOauthAppId() { return oauthAppId; } + /** + * @return An app override ID. Selects the override's app, pre-defined custom fields, and OAuth client. With account_id, re-links the account to this override; it must belong to the account's app, and an override that pins a different OAuth client switches the account to that client when the reconnect flow completes. A conflicting app_id or oauth_app_id is an error. To resolve an override by name, list them with GET /v1/connect/{project_id}/app_overrides and match on name. + */ + @JsonProperty("app_override_id") + public Optional getAppOverrideId() { + return appOverrideId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -76,12 +87,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(TokensValidateRequest other) { - return appId.equals(other.appId) && accountId.equals(other.accountId) && oauthAppId.equals(other.oauthAppId); + return appId.equals(other.appId) + && accountId.equals(other.accountId) + && oauthAppId.equals(other.oauthAppId) + && appOverrideId.equals(other.appOverrideId); } @java.lang.Override public int hashCode() { - return Objects.hash(this.appId, this.accountId, this.oauthAppId); + return Objects.hash(this.appId, this.accountId, this.oauthAppId, this.appOverrideId); } @java.lang.Override @@ -89,126 +103,98 @@ public String toString() { return ObjectMappers.stringify(this); } - public static AppIdStage builder() { + public static Builder builder() { return new Builder(); } - public interface AppIdStage { - /** - *

The app ID to validate against

- */ - _FinalStage appId(@NotNull String appId); - - Builder from(TokensValidateRequest other); - } - - public interface _FinalStage { - TokensValidateRequest build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - /** - *

An existing account ID to reconnect. Must belong to the app identified by app_id.

- */ - _FinalStage accountId(Optional accountId); - - _FinalStage accountId(String accountId); - - /** - *

The OAuth app ID to validate against (if the token is for an OAuth app)

- */ - _FinalStage oauthAppId(Optional oauthAppId); - - _FinalStage oauthAppId(String oauthAppId); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AppIdStage, _FinalStage { - private String appId; + public static final class Builder { + private Optional appId = Optional.empty(); + + private Optional accountId = Optional.empty(); private Optional oauthAppId = Optional.empty(); - private Optional accountId = Optional.empty(); + private Optional appOverrideId = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(TokensValidateRequest other) { appId(other.getAppId()); accountId(other.getAccountId()); oauthAppId(other.getOauthAppId()); + appOverrideId(other.getAppOverrideId()); return this; } /** - *

The app ID to validate against

- *

The app ID to validate against

- * @return Reference to {@code this} so that method calls can be chained together. + *

The app ID to validate against. Required unless account_id or app_override_id identifies the app.

*/ - @java.lang.Override - @JsonSetter("app_id") - public _FinalStage appId(@NotNull String appId) { - this.appId = Objects.requireNonNull(appId, "appId must not be null"); + @JsonSetter(value = "app_id", nulls = Nulls.SKIP) + public Builder appId(Optional appId) { + this.appId = appId; + return this; + } + + public Builder appId(String appId) { + this.appId = Optional.ofNullable(appId); return this; } /** - *

The OAuth app ID to validate against (if the token is for an OAuth app)

- * @return Reference to {@code this} so that method calls can be chained together. + *

An existing account ID to reconnect. Must belong to the app identified by app_id.

*/ - @java.lang.Override - public _FinalStage oauthAppId(String oauthAppId) { - this.oauthAppId = Optional.ofNullable(oauthAppId); + @JsonSetter(value = "account_id", nulls = Nulls.SKIP) + public Builder accountId(Optional accountId) { + this.accountId = accountId; + return this; + } + + public Builder accountId(String accountId) { + this.accountId = Optional.ofNullable(accountId); return this; } /** *

The OAuth app ID to validate against (if the token is for an OAuth app)

*/ - @java.lang.Override @JsonSetter(value = "oauth_app_id", nulls = Nulls.SKIP) - public _FinalStage oauthAppId(Optional oauthAppId) { + public Builder oauthAppId(Optional oauthAppId) { this.oauthAppId = oauthAppId; return this; } - /** - *

An existing account ID to reconnect. Must belong to the app identified by app_id.

- * @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); + public Builder oauthAppId(String oauthAppId) { + this.oauthAppId = Optional.ofNullable(oauthAppId); return this; } /** - *

An existing account ID to reconnect. Must belong to the app identified by app_id.

+ *

An app override ID. Selects the override's app, pre-defined custom fields, and OAuth client. With account_id, re-links the account to this override; it must belong to the account's app, and an override that pins a different OAuth client switches the account to that client when the reconnect flow completes. A conflicting app_id or oauth_app_id is an error. To resolve an override by name, list them with GET /v1/connect/{project_id}/app_overrides and match on name.

*/ - @java.lang.Override - @JsonSetter(value = "account_id", nulls = Nulls.SKIP) - public _FinalStage accountId(Optional accountId) { - this.accountId = accountId; + @JsonSetter(value = "app_override_id", nulls = Nulls.SKIP) + public Builder appOverrideId(Optional appOverrideId) { + this.appOverrideId = appOverrideId; + return this; + } + + public Builder appOverrideId(String appOverrideId) { + this.appOverrideId = Optional.ofNullable(appOverrideId); return this; } - @java.lang.Override public TokensValidateRequest build() { - return new TokensValidateRequest(appId, accountId, oauthAppId, additionalProperties); + return new TokensValidateRequest(appId, accountId, oauthAppId, appOverrideId, additionalProperties); } - @java.lang.Override public Builder additionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; } - @java.lang.Override public Builder additionalProperties(Map additionalProperties) { this.additionalProperties.putAll(additionalProperties); return this; diff --git a/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java b/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java index 2fda3df..2e9e82a 100644 --- a/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java +++ b/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -22,6 +23,10 @@ public final class ValidateTokenResponse { private final Optional app; + private final Optional appOverrideId; + + private final Optional> appOverrideFieldNames; + private final Optional error; private final Optional errorRedirectUri; @@ -30,6 +35,8 @@ public final class ValidateTokenResponse { private final Optional oauthAppWorkdayOfficial; + private final Optional oauthAppConnectBaseUrl; + private final Optional projectAppName; private final Optional projectEnvironment; @@ -46,10 +53,13 @@ public final class ValidateTokenResponse { private ValidateTokenResponse( Optional app, + Optional appOverrideId, + Optional> appOverrideFieldNames, Optional error, Optional errorRedirectUri, Optional oauthAppId, Optional oauthAppWorkdayOfficial, + Optional oauthAppConnectBaseUrl, Optional projectAppName, Optional projectEnvironment, Optional projectId, @@ -58,10 +68,13 @@ private ValidateTokenResponse( Optional successRedirectUri, Map additionalProperties) { this.app = app; + this.appOverrideId = appOverrideId; + this.appOverrideFieldNames = appOverrideFieldNames; this.error = error; this.errorRedirectUri = errorRedirectUri; this.oauthAppId = oauthAppId; this.oauthAppWorkdayOfficial = oauthAppWorkdayOfficial; + this.oauthAppConnectBaseUrl = oauthAppConnectBaseUrl; this.projectAppName = projectAppName; this.projectEnvironment = projectEnvironment; this.projectId = projectId; @@ -76,6 +89,22 @@ public Optional getApp() { return app; } + /** + * @return ID of the resolved app override, echoed from the request + */ + @JsonProperty("app_override_id") + public Optional getAppOverrideId() { + return appOverrideId; + } + + /** + * @return Names of the custom fields the resolved app override pre-defines + */ + @JsonProperty("app_override_field_names") + public Optional> getAppOverrideFieldNames() { + return appOverrideFieldNames; + } + /** * @return Error message if validation failed */ @@ -108,6 +137,14 @@ public Optional getOauthAppWorkdayOfficial() { return oauthAppWorkdayOfficial; } + /** + * @return Base URL the Connect UI must run this client's OAuth flow on; null means the default API URL + */ + @JsonProperty("oauth_app_connect_base_url") + public Optional getOauthAppConnectBaseUrl() { + return oauthAppConnectBaseUrl; + } + /** * @return Name of the project app */ @@ -169,10 +206,13 @@ public Map getAdditionalProperties() { private boolean equalTo(ValidateTokenResponse other) { return app.equals(other.app) + && appOverrideId.equals(other.appOverrideId) + && appOverrideFieldNames.equals(other.appOverrideFieldNames) && error.equals(other.error) && errorRedirectUri.equals(other.errorRedirectUri) && oauthAppId.equals(other.oauthAppId) && oauthAppWorkdayOfficial.equals(other.oauthAppWorkdayOfficial) + && oauthAppConnectBaseUrl.equals(other.oauthAppConnectBaseUrl) && projectAppName.equals(other.projectAppName) && projectEnvironment.equals(other.projectEnvironment) && projectId.equals(other.projectId) @@ -185,10 +225,13 @@ private boolean equalTo(ValidateTokenResponse other) { public int hashCode() { return Objects.hash( this.app, + this.appOverrideId, + this.appOverrideFieldNames, this.error, this.errorRedirectUri, this.oauthAppId, this.oauthAppWorkdayOfficial, + this.oauthAppConnectBaseUrl, this.projectAppName, this.projectEnvironment, this.projectId, @@ -226,6 +269,20 @@ public interface _FinalStage { _FinalStage app(App app); + /** + *

ID of the resolved app override, echoed from the request

+ */ + _FinalStage appOverrideId(Optional appOverrideId); + + _FinalStage appOverrideId(String appOverrideId); + + /** + *

Names of the custom fields the resolved app override pre-defines

+ */ + _FinalStage appOverrideFieldNames(Optional> appOverrideFieldNames); + + _FinalStage appOverrideFieldNames(List appOverrideFieldNames); + /** *

Error message if validation failed

*/ @@ -254,6 +311,13 @@ public interface _FinalStage { _FinalStage oauthAppWorkdayOfficial(Boolean oauthAppWorkdayOfficial); + /** + *

Base URL the Connect UI must run this client's OAuth flow on; null means the default API URL

+ */ + _FinalStage oauthAppConnectBaseUrl(Optional oauthAppConnectBaseUrl); + + _FinalStage oauthAppConnectBaseUrl(String oauthAppConnectBaseUrl); + /** *

Name of the project app

*/ @@ -304,6 +368,8 @@ public static final class Builder implements SuccessStage, _FinalStage { private Optional projectAppName = Optional.empty(); + private Optional oauthAppConnectBaseUrl = Optional.empty(); + private Optional oauthAppWorkdayOfficial = Optional.empty(); private Optional oauthAppId = Optional.empty(); @@ -312,6 +378,10 @@ public static final class Builder implements SuccessStage, _FinalStage { private Optional error = Optional.empty(); + private Optional> appOverrideFieldNames = Optional.empty(); + + private Optional appOverrideId = Optional.empty(); + private Optional app = Optional.empty(); @JsonAnySetter @@ -322,10 +392,13 @@ private Builder() {} @java.lang.Override public Builder from(ValidateTokenResponse other) { app(other.getApp()); + appOverrideId(other.getAppOverrideId()); + appOverrideFieldNames(other.getAppOverrideFieldNames()); error(other.getError()); errorRedirectUri(other.getErrorRedirectUri()); oauthAppId(other.getOauthAppId()); oauthAppWorkdayOfficial(other.getOauthAppWorkdayOfficial()); + oauthAppConnectBaseUrl(other.getOauthAppConnectBaseUrl()); projectAppName(other.getProjectAppName()); projectEnvironment(other.getProjectEnvironment()); projectId(other.getProjectId()); @@ -447,6 +520,26 @@ public _FinalStage projectAppName(Optional projectAppName) { return this; } + /** + *

Base URL the Connect UI must run this client's OAuth flow on; null means the default API URL

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage oauthAppConnectBaseUrl(String oauthAppConnectBaseUrl) { + this.oauthAppConnectBaseUrl = Optional.ofNullable(oauthAppConnectBaseUrl); + return this; + } + + /** + *

Base URL the Connect UI must run this client's OAuth flow on; null means the default API URL

+ */ + @java.lang.Override + @JsonSetter(value = "oauth_app_connect_base_url", nulls = Nulls.SKIP) + public _FinalStage oauthAppConnectBaseUrl(Optional oauthAppConnectBaseUrl) { + this.oauthAppConnectBaseUrl = oauthAppConnectBaseUrl; + return this; + } + /** *

True when the resolved OAuth client is the app's Workday-official client

* @return Reference to {@code this} so that method calls can be chained together. @@ -527,6 +620,46 @@ public _FinalStage error(Optional error) { return this; } + /** + *

Names of the custom fields the resolved app override pre-defines

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage appOverrideFieldNames(List appOverrideFieldNames) { + this.appOverrideFieldNames = Optional.ofNullable(appOverrideFieldNames); + return this; + } + + /** + *

Names of the custom fields the resolved app override pre-defines

+ */ + @java.lang.Override + @JsonSetter(value = "app_override_field_names", nulls = Nulls.SKIP) + public _FinalStage appOverrideFieldNames(Optional> appOverrideFieldNames) { + this.appOverrideFieldNames = appOverrideFieldNames; + return this; + } + + /** + *

ID of the resolved app override, echoed from the request

+ * @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; + } + + /** + *

ID of the resolved app override, echoed from the request

+ */ + @java.lang.Override + @JsonSetter(value = "app_override_id", nulls = Nulls.SKIP) + public _FinalStage appOverrideId(Optional appOverrideId) { + this.appOverrideId = appOverrideId; + return this; + } + @java.lang.Override public _FinalStage app(App app) { this.app = Optional.ofNullable(app); @@ -544,10 +677,13 @@ public _FinalStage app(Optional app) { public ValidateTokenResponse build() { return new ValidateTokenResponse( app, + appOverrideId, + appOverrideFieldNames, error, errorRedirectUri, oauthAppId, oauthAppWorkdayOfficial, + oauthAppConnectBaseUrl, projectAppName, projectEnvironment, projectId,