From a9649bf1b5c545769aab8a714699a6a86b096714 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 23:03:57 +0000 Subject: [PATCH] SDK regeneration --- .gradle/8.14.3/checksums/checksums.lock | Bin 17 -> 17 bytes .gradle/8.14.3/checksums/md5-checksums.bin | Bin 21897 -> 21897 bytes .gradle/8.14.3/checksums/sha1-checksums.bin | Bin 25679 -> 25679 bytes .../executionHistory/executionHistory.bin | Bin 64148 -> 63951 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/8.14.3/fileHashes/fileHashes.bin | Bin 35447 -> 35347 bytes .gradle/8.14.3/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/buildOutputCleanup/cache.properties | 2 +- README.md | 6 +- build.gradle | 4 +- .../pipedream/api/AsyncBaseClientBuilder.java | 169 ++++++++++++++++-- .../com/pipedream/api/BaseClientBuilder.java | 169 ++++++++++++++++-- .../com/pipedream/api/core/ClientOptions.java | 2 +- .../resources/accounts/AccountsClient.java | 6 +- .../accounts/AsyncAccountsClient.java | 6 +- .../accounts/AsyncRawAccountsClient.java | 6 +- .../resources/accounts/RawAccountsClient.java | 6 +- ...untRequest.java => CreateAccountOpts.java} | 20 +-- .../api/resources/proxy/AsyncProxyClient.java | 26 ++- .../resources/proxy/AsyncRawProxyClient.java | 54 +++--- .../api/resources/proxy/ProxyClient.java | 21 ++- .../api/resources/proxy/RawProxyClient.java | 45 ++--- .../tokens/AsyncRawTokensClient.java | 14 +- .../resources/tokens/AsyncTokensClient.java | 6 +- .../api/resources/tokens/RawTokensClient.java | 15 +- .../api/resources/tokens/TokensClient.java | 6 +- ...TokenRequest.java => CreateTokenOpts.java} | 63 ++----- .../api/types/ConnectTokenCreateOpts.java | 43 +---- .../pipedream/api/types/ProxyResponse.java | 155 ---------------- reference.md | 37 ++-- .../pipedream/api/AsyncBaseClientBuilder.java | 169 ++++++++++++++++-- .../com/pipedream/api/BaseClientBuilder.java | 169 ++++++++++++++++-- .../com/pipedream/api/core/ClientOptions.java | 2 +- .../resources/accounts/AccountsClient.java | 6 +- .../accounts/AsyncAccountsClient.java | 6 +- .../accounts/AsyncRawAccountsClient.java | 6 +- .../resources/accounts/RawAccountsClient.java | 6 +- ...untRequest.java => CreateAccountOpts.java} | 20 +-- .../api/resources/proxy/AsyncProxyClient.java | 26 ++- .../resources/proxy/AsyncRawProxyClient.java | 54 +++--- .../api/resources/proxy/ProxyClient.java | 21 ++- .../api/resources/proxy/RawProxyClient.java | 45 ++--- .../tokens/AsyncRawTokensClient.java | 14 +- .../resources/tokens/AsyncTokensClient.java | 6 +- .../api/resources/tokens/RawTokensClient.java | 15 +- .../api/resources/tokens/TokensClient.java | 6 +- ...TokenRequest.java => CreateTokenOpts.java} | 63 ++----- .../api/types/ConnectTokenCreateOpts.java | 43 +---- .../pipedream/api/types/ProxyResponse.java | 155 ---------------- 50 files changed, 889 insertions(+), 824 deletions(-) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/{CreateAccountRequest.java => CreateAccountOpts.java} (95%) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/{CreateTokenRequest.java => CreateTokenOpts.java} (83%) delete mode 100644 build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProxyResponse.java rename src/main/java/com/pipedream/api/resources/accounts/requests/{CreateAccountRequest.java => CreateAccountOpts.java} (95%) rename src/main/java/com/pipedream/api/resources/tokens/requests/{CreateTokenRequest.java => CreateTokenOpts.java} (83%) delete mode 100644 src/main/java/com/pipedream/api/types/ProxyResponse.java diff --git a/.gradle/8.14.3/checksums/checksums.lock b/.gradle/8.14.3/checksums/checksums.lock index 9e16ed75a5dfecd0e03b936eb43226967ae55432..9ceb0c717b65b7b5324d1b25af2835d44c7a8cbf 100644 GIT binary patch literal 17 UcmZS9zQ^{XTJJ>x0|ZF|9LIa&W~Gw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!mVHn$ggDJUKT)|tcrkHMdU;uI)ErV(0^QNs%gw*Cp`StPi~6uc*=^yAqW)4VmNbuI7;6g!BE+kQ~>oqhYsD*nJl%51h zE(tD8g*mxoHcPqxY8Vv)?yeHpmP;nC)E??+*lq>!Byc8AGLt2*AvuPI04g2>t^fc4 diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties index 2fb7ba3..72f11b3 100644 --- a/.gradle/buildOutputCleanup/cache.properties +++ b/.gradle/buildOutputCleanup/cache.properties @@ -1,2 +1,2 @@ -#Thu Jul 24 19:20:25 UTC 2025 +#Wed Jul 30 23:02:57 UTC 2025 gradle.version=8.14.3 diff --git a/README.md b/README.md index e2ade52..a3de71a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Add the dependency in your `pom.xml` file: com.pipedream pipedream - 0.0.237 + 0.0.255 ``` @@ -37,7 +37,7 @@ Instantiate and use the client with the following: package com.example.usage; import com.pipedream.api.BaseClient; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; public class Example { public static void main(String[] args) { @@ -49,7 +49,7 @@ public class Example { client.accounts().create( "project_id", - CreateAccountRequest + CreateAccountOpts .builder() .appSlug("app_slug") .cfmapJson("cfmap_json") diff --git a/build.gradle b/build.gradle index fd420e0..2a09691 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ java { group = 'com.pipedream' -version = '0.0.237' +version = '0.0.255' jar { dependsOn(":generatePomFileForMavenPublication") @@ -79,7 +79,7 @@ publishing { maven(MavenPublication) { groupId = 'com.pipedream' artifactId = 'pipedream' - version = '0.0.237' + version = '0.0.255' from components.java pom { name = 'pipedream' diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java index e6b8839..9361d1d 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java @@ -7,10 +7,13 @@ import com.pipedream.api.core.Environment; import com.pipedream.api.core.OAuthTokenSupplier; import com.pipedream.api.resources.oauthtokens.OauthTokensClient; +import java.util.Optional; import okhttp3.OkHttpClient; public class AsyncBaseClientBuilder { - private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); + private Optional timeout = Optional.empty(); + + private Optional maxRetries = Optional.empty(); private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); @@ -20,6 +23,8 @@ public class AsyncBaseClientBuilder { private Environment environment = Environment.PROD; + private OkHttpClient httpClient; + /** * Sets clientId. * Defaults to the PIPEDREAM_CLIENT_ID environment variable. @@ -60,7 +65,7 @@ public AsyncBaseClientBuilder url(String url) { * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ public AsyncBaseClientBuilder timeout(int timeout) { - this.clientOptionsBuilder.timeout(timeout); + this.timeout = Optional.of(timeout); return this; } @@ -68,7 +73,7 @@ public AsyncBaseClientBuilder timeout(int timeout) { * Sets the maximum number of retries for the client. Defaults to 2 retries. */ public AsyncBaseClientBuilder maxRetries(int maxRetries) { - this.clientOptionsBuilder.maxRetries(maxRetries); + this.maxRetries = Optional.of(maxRetries); return this; } @@ -76,7 +81,7 @@ public AsyncBaseClientBuilder maxRetries(int maxRetries) { * Sets the underlying OkHttp client */ public AsyncBaseClientBuilder httpClient(OkHttpClient httpClient) { - this.clientOptionsBuilder.httpClient(httpClient); + this.httpClient = httpClient; return this; } @@ -86,18 +91,156 @@ public AsyncBaseClientBuilder projectId(String projectId) { } protected ClientOptions buildClientOptions() { - clientOptionsBuilder.environment(this.environment); - return clientOptionsBuilder.build(); + ClientOptions.Builder builder = ClientOptions.builder(); + setEnvironment(builder); + setAuthentication(builder); + setCustomHeaders(builder); + setVariables(builder); + setHttpClient(builder); + setTimeouts(builder); + setRetries(builder); + setAdditional(builder); + return builder.build(); } - public AsyncBaseClient build() { - OauthTokensClient authClient = new OauthTokensClient( - ClientOptions.builder().environment(this.environment).build()); - OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient); - this.clientOptionsBuilder.addHeader("Authorization", oAuthTokenSupplier); - if (projectEnvironment != null) { - this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment); + /** + * Sets the environment configuration for the client. + * Override this method to modify URLs or add environment-specific logic. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setEnvironment(ClientOptions.Builder builder) { + builder.environment(this.environment); + } + + /** + * Override this method to customize authentication. + * This method is called during client options construction to set up authentication headers. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAuthentication(ClientOptions.Builder builder) {
+     *     super.setAuthentication(builder); // Keep existing auth
+     *     builder.addHeader("X-API-Key", this.apiKey);
+     * }
+     * }
+ */ + protected void setAuthentication(ClientOptions.Builder builder) { + if (this.clientId != null && this.clientSecret != null) { + OauthTokensClient authClient = new OauthTokensClient( + ClientOptions.builder().environment(this.environment).build()); + OAuthTokenSupplier oAuthTokenSupplier = + new OAuthTokenSupplier(this.clientId, this.clientSecret, authClient); + builder.addHeader("Authorization", oAuthTokenSupplier); } + } + + /** + * Override this method to add or modify custom headers. + * This method is called during client options construction to set up custom headers defined in the API. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setCustomHeaders(ClientOptions.Builder builder) {
+     *     super.setCustomHeaders(builder); // Keep existing headers
+     *     builder.addHeader("X-Trace-ID", generateTraceId());
+     * }
+     * }
+ */ + protected void setCustomHeaders(ClientOptions.Builder builder) { + if (this.projectEnvironment != null) { + builder.addHeader("x-pd-environment", this.projectEnvironment); + } + } + + /** + * Override this method to configure API variables defined in the specification. + * Available variables: projectId + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setVariables(ClientOptions.Builder builder) {} + + /** + * Sets the request timeout configuration. + * Override this method to customize timeout behavior. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setTimeouts(ClientOptions.Builder builder) { + if (this.timeout.isPresent()) { + builder.timeout(this.timeout.get()); + } + } + + /** + * Sets the retry configuration for failed requests. + * Override this method to implement custom retry strategies. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setRetries(ClientOptions.Builder builder) { + if (this.maxRetries.isPresent()) { + builder.maxRetries(this.maxRetries.get()); + } + } + + /** + * Sets the OkHttp client configuration. + * Override this method to customize HTTP client behavior (interceptors, connection pools, etc). + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setHttpClient(ClientOptions.Builder builder) { + if (this.httpClient != null) { + builder.httpClient(this.httpClient); + } + } + + /** + * Override this method to add any additional configuration to the client. + * This method is called at the end of the configuration chain, allowing you to add + * custom headers, modify settings, or perform any other client customization. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAdditional(ClientOptions.Builder builder) {
+     *     builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
+     *     builder.addHeader("X-Client-Version", "1.0.0");
+     * }
+     * }
+ */ + protected void setAdditional(ClientOptions.Builder builder) {} + + /** + * Override this method to add custom validation logic before the client is built. + * This method is called at the beginning of the build() method to ensure the configuration is valid. + * Throw an exception to prevent client creation if validation fails. + * + * Example: + *
{@code
+     * @Override
+     * protected void validateConfiguration() {
+     *     super.validateConfiguration(); // Run parent validations
+     *     if (tenantId == null || tenantId.isEmpty()) {
+     *         throw new IllegalStateException("tenantId is required");
+     *     }
+     * }
+     * }
+ */ + protected void validateConfiguration() {} + + public AsyncBaseClient build() { + validateConfiguration(); return new AsyncBaseClient(buildClientOptions()); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java index 000caa1..13318cd 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java @@ -7,10 +7,13 @@ import com.pipedream.api.core.Environment; import com.pipedream.api.core.OAuthTokenSupplier; import com.pipedream.api.resources.oauthtokens.OauthTokensClient; +import java.util.Optional; import okhttp3.OkHttpClient; public class BaseClientBuilder { - private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); + private Optional timeout = Optional.empty(); + + private Optional maxRetries = Optional.empty(); private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); @@ -20,6 +23,8 @@ public class BaseClientBuilder { private Environment environment = Environment.PROD; + private OkHttpClient httpClient; + /** * Sets clientId. * Defaults to the PIPEDREAM_CLIENT_ID environment variable. @@ -60,7 +65,7 @@ public BaseClientBuilder url(String url) { * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ public BaseClientBuilder timeout(int timeout) { - this.clientOptionsBuilder.timeout(timeout); + this.timeout = Optional.of(timeout); return this; } @@ -68,7 +73,7 @@ public BaseClientBuilder timeout(int timeout) { * Sets the maximum number of retries for the client. Defaults to 2 retries. */ public BaseClientBuilder maxRetries(int maxRetries) { - this.clientOptionsBuilder.maxRetries(maxRetries); + this.maxRetries = Optional.of(maxRetries); return this; } @@ -76,7 +81,7 @@ public BaseClientBuilder maxRetries(int maxRetries) { * Sets the underlying OkHttp client */ public BaseClientBuilder httpClient(OkHttpClient httpClient) { - this.clientOptionsBuilder.httpClient(httpClient); + this.httpClient = httpClient; return this; } @@ -86,18 +91,156 @@ public BaseClientBuilder projectId(String projectId) { } protected ClientOptions buildClientOptions() { - clientOptionsBuilder.environment(this.environment); - return clientOptionsBuilder.build(); + ClientOptions.Builder builder = ClientOptions.builder(); + setEnvironment(builder); + setAuthentication(builder); + setCustomHeaders(builder); + setVariables(builder); + setHttpClient(builder); + setTimeouts(builder); + setRetries(builder); + setAdditional(builder); + return builder.build(); } - public BaseClient build() { - OauthTokensClient authClient = new OauthTokensClient( - ClientOptions.builder().environment(this.environment).build()); - OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient); - this.clientOptionsBuilder.addHeader("Authorization", oAuthTokenSupplier); - if (projectEnvironment != null) { - this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment); + /** + * Sets the environment configuration for the client. + * Override this method to modify URLs or add environment-specific logic. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setEnvironment(ClientOptions.Builder builder) { + builder.environment(this.environment); + } + + /** + * Override this method to customize authentication. + * This method is called during client options construction to set up authentication headers. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAuthentication(ClientOptions.Builder builder) {
+     *     super.setAuthentication(builder); // Keep existing auth
+     *     builder.addHeader("X-API-Key", this.apiKey);
+     * }
+     * }
+ */ + protected void setAuthentication(ClientOptions.Builder builder) { + if (this.clientId != null && this.clientSecret != null) { + OauthTokensClient authClient = new OauthTokensClient( + ClientOptions.builder().environment(this.environment).build()); + OAuthTokenSupplier oAuthTokenSupplier = + new OAuthTokenSupplier(this.clientId, this.clientSecret, authClient); + builder.addHeader("Authorization", oAuthTokenSupplier); } + } + + /** + * Override this method to add or modify custom headers. + * This method is called during client options construction to set up custom headers defined in the API. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setCustomHeaders(ClientOptions.Builder builder) {
+     *     super.setCustomHeaders(builder); // Keep existing headers
+     *     builder.addHeader("X-Trace-ID", generateTraceId());
+     * }
+     * }
+ */ + protected void setCustomHeaders(ClientOptions.Builder builder) { + if (this.projectEnvironment != null) { + builder.addHeader("x-pd-environment", this.projectEnvironment); + } + } + + /** + * Override this method to configure API variables defined in the specification. + * Available variables: projectId + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setVariables(ClientOptions.Builder builder) {} + + /** + * Sets the request timeout configuration. + * Override this method to customize timeout behavior. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setTimeouts(ClientOptions.Builder builder) { + if (this.timeout.isPresent()) { + builder.timeout(this.timeout.get()); + } + } + + /** + * Sets the retry configuration for failed requests. + * Override this method to implement custom retry strategies. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setRetries(ClientOptions.Builder builder) { + if (this.maxRetries.isPresent()) { + builder.maxRetries(this.maxRetries.get()); + } + } + + /** + * Sets the OkHttp client configuration. + * Override this method to customize HTTP client behavior (interceptors, connection pools, etc). + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setHttpClient(ClientOptions.Builder builder) { + if (this.httpClient != null) { + builder.httpClient(this.httpClient); + } + } + + /** + * Override this method to add any additional configuration to the client. + * This method is called at the end of the configuration chain, allowing you to add + * custom headers, modify settings, or perform any other client customization. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAdditional(ClientOptions.Builder builder) {
+     *     builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
+     *     builder.addHeader("X-Client-Version", "1.0.0");
+     * }
+     * }
+ */ + protected void setAdditional(ClientOptions.Builder builder) {} + + /** + * Override this method to add custom validation logic before the client is built. + * This method is called at the beginning of the build() method to ensure the configuration is valid. + * Throw an exception to prevent client creation if validation fails. + * + * Example: + *
{@code
+     * @Override
+     * protected void validateConfiguration() {
+     *     super.validateConfiguration(); // Run parent validations
+     *     if (tenantId == null || tenantId.isEmpty()) {
+     *         throw new IllegalStateException("tenantId is required");
+     *     }
+     * }
+     * }
+ */ + protected void validateConfiguration() {} + + public BaseClient build() { + validateConfiguration(); return new BaseClient(buildClientOptions()); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java index 524ee4e..bd94c5e 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java @@ -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.237"); + put("X-Fern-SDK-Version", "0.0.255"); } }); this.headerSuppliers = headerSuppliers; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java index 81f9441..4e8b110 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java @@ -8,7 +8,7 @@ import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.accounts.requests.AccountsListRequest; import com.pipedream.api.resources.accounts.requests.AccountsRetrieveRequest; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; import com.pipedream.api.types.Account; public class AccountsClient { @@ -40,11 +40,11 @@ public SyncPagingIterable list(AccountsListRequest request, RequestOpti return this.rawClient.list(request, requestOptions).body(); } - public Account create(CreateAccountRequest request) { + public Account create(CreateAccountOpts request) { return this.rawClient.create(request).body(); } - public Account create(CreateAccountRequest request, RequestOptions requestOptions) { + public Account create(CreateAccountOpts request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java index 761a206..34158ac 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java @@ -8,7 +8,7 @@ import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.accounts.requests.AccountsListRequest; import com.pipedream.api.resources.accounts.requests.AccountsRetrieveRequest; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; import com.pipedream.api.types.Account; import java.util.concurrent.CompletableFuture; @@ -42,11 +42,11 @@ public CompletableFuture> list( return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture create(CreateAccountRequest request) { + public CompletableFuture create(CreateAccountOpts request) { return this.rawClient.create(request).thenApply(response -> response.body()); } - public CompletableFuture create(CreateAccountRequest request, RequestOptions requestOptions) { + public CompletableFuture create(CreateAccountOpts request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java index 59601c1..ea4f83a 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java @@ -14,7 +14,7 @@ import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.accounts.requests.AccountsListRequest; import com.pipedream.api.resources.accounts.requests.AccountsRetrieveRequest; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; import com.pipedream.api.types.Account; import com.pipedream.api.types.ListAccountsResponse; import java.io.IOException; @@ -146,12 +146,12 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> create(CreateAccountRequest request) { + public CompletableFuture> create(CreateAccountOpts request) { return create(request, null); } public CompletableFuture> create( - CreateAccountRequest request, RequestOptions requestOptions) { + CreateAccountOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java index e90fe31..5fb30da 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java @@ -14,7 +14,7 @@ import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.accounts.requests.AccountsListRequest; import com.pipedream.api.resources.accounts.requests.AccountsRetrieveRequest; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; import com.pipedream.api.types.Account; import com.pipedream.api.types.ListAccountsResponse; import java.io.IOException; @@ -121,11 +121,11 @@ public BaseClientHttpResponse> list( } } - public BaseClientHttpResponse create(CreateAccountRequest request) { + public BaseClientHttpResponse create(CreateAccountOpts request) { return create(request, null); } - public BaseClientHttpResponse create(CreateAccountRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse create(CreateAccountOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java similarity index 95% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java index aeec52a..79cef5e 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java @@ -19,8 +19,8 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateAccountRequest.Builder.class) -public final class CreateAccountRequest { +@JsonDeserialize(builder = CreateAccountOpts.Builder.class) +public final class CreateAccountOpts { private final Optional appId; private final Optional externalUserId; @@ -37,7 +37,7 @@ public final class CreateAccountRequest { private final Map additionalProperties; - private CreateAccountRequest( + private CreateAccountOpts( Optional appId, Optional externalUserId, Optional oauthAppId, @@ -112,7 +112,7 @@ public Optional getName() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof CreateAccountRequest && equalTo((CreateAccountRequest) other); + return other instanceof CreateAccountOpts && equalTo((CreateAccountOpts) other); } @JsonAnyGetter @@ -120,7 +120,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(CreateAccountRequest other) { + private boolean equalTo(CreateAccountOpts other) { return appId.equals(other.appId) && externalUserId.equals(other.externalUserId) && oauthAppId.equals(other.oauthAppId) @@ -157,7 +157,7 @@ public interface AppSlugStage { */ CfmapJsonStage appSlug(@NotNull String appSlug); - Builder from(CreateAccountRequest other); + Builder from(CreateAccountOpts other); } public interface CfmapJsonStage { @@ -175,7 +175,7 @@ public interface ConnectTokenStage { } public interface _FinalStage { - CreateAccountRequest build(); + CreateAccountOpts build(); /** *

The app slug or ID to filter accounts by.

@@ -225,7 +225,7 @@ public static final class Builder implements AppSlugStage, CfmapJsonStage, Conne private Builder() {} @java.lang.Override - public Builder from(CreateAccountRequest other) { + public Builder from(CreateAccountOpts other) { appId(other.getAppId()); externalUserId(other.getExternalUserId()); oauthAppId(other.getOauthAppId()); @@ -346,8 +346,8 @@ public _FinalStage appId(Optional appId) { } @java.lang.Override - public CreateAccountRequest build() { - return new CreateAccountRequest( + public CreateAccountOpts build() { + return new CreateAccountOpts( appId, externalUserId, oauthAppId, appSlug, cfmapJson, connectToken, name, additionalProperties); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java index 61bcd21..fd06a93 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java @@ -10,7 +10,6 @@ import com.pipedream.api.resources.proxy.requests.ProxyPatchRequest; import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; -import java.util.Map; import java.util.concurrent.CompletableFuture; public class AsyncProxyClient { @@ -30,48 +29,43 @@ public AsyncRawProxyClient withRawResponse() { return this.rawClient; } - public CompletableFuture> get(String url64, ProxyGetRequest request) { + public CompletableFuture get(String url64, ProxyGetRequest request) { return this.rawClient.get(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> get( - String url64, ProxyGetRequest request, RequestOptions requestOptions) { + public CompletableFuture get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { return this.rawClient.get(url64, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> post(String url64, ProxyPostRequest request) { + public CompletableFuture post(String url64, ProxyPostRequest request) { return this.rawClient.post(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> post( - String url64, ProxyPostRequest request, RequestOptions requestOptions) { + public CompletableFuture post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { return this.rawClient.post(url64, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> put(String url64, ProxyPutRequest request) { + public CompletableFuture put(String url64, ProxyPutRequest request) { return this.rawClient.put(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> put( - String url64, ProxyPutRequest request, RequestOptions requestOptions) { + public CompletableFuture put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { return this.rawClient.put(url64, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> delete(String url64, ProxyDeleteRequest request) { + public CompletableFuture delete(String url64, ProxyDeleteRequest request) { return this.rawClient.delete(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> delete( - String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { + public CompletableFuture delete(String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { return this.rawClient.delete(url64, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> patch(String url64, ProxyPatchRequest request) { + public CompletableFuture patch(String url64, ProxyPatchRequest request) { return this.rawClient.patch(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> patch( - String url64, ProxyPatchRequest request, RequestOptions requestOptions) { + public CompletableFuture patch(String url64, ProxyPatchRequest request, RequestOptions requestOptions) { return this.rawClient.patch(url64, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java index 30ca813..24f27f3 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java @@ -3,7 +3,6 @@ */ package com.pipedream.api.resources.proxy; -import com.fasterxml.jackson.core.type.TypeReference; import com.pipedream.api.core.BaseClientApiException; import com.pipedream.api.core.BaseClientException; import com.pipedream.api.core.BaseClientHttpResponse; @@ -18,7 +17,6 @@ import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; import java.io.IOException; -import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -38,11 +36,11 @@ public AsyncRawProxyClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> get(String url64, ProxyGetRequest request) { + public CompletableFuture> get(String url64, ProxyGetRequest request) { return get(url64, request, null); } - public CompletableFuture>> get( + public CompletableFuture> get( String url64, ProxyGetRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -62,16 +60,14 @@ public CompletableFuture>> get( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -94,11 +90,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> post(String url64, ProxyPostRequest request) { + public CompletableFuture> post(String url64, ProxyPostRequest request) { return post(url64, request, null); } - public CompletableFuture>> post( + public CompletableFuture> post( String url64, ProxyPostRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -126,16 +122,14 @@ public CompletableFuture>> post( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -158,11 +152,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> put(String url64, ProxyPutRequest request) { + public CompletableFuture> put(String url64, ProxyPutRequest request) { return put(url64, request, null); } - public CompletableFuture>> put( + public CompletableFuture> put( String url64, ProxyPutRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -190,16 +184,14 @@ public CompletableFuture>> put( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -222,12 +214,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> delete( - String url64, ProxyDeleteRequest request) { + public CompletableFuture> delete(String url64, ProxyDeleteRequest request) { return delete(url64, request, null); } - public CompletableFuture>> delete( + public CompletableFuture> delete( String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -247,16 +238,14 @@ public CompletableFuture>> delete( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -279,12 +268,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> patch( - String url64, ProxyPatchRequest request) { + public CompletableFuture> patch(String url64, ProxyPatchRequest request) { return patch(url64, request, null); } - public CompletableFuture>> patch( + public CompletableFuture> patch( String url64, ProxyPatchRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -312,16 +300,14 @@ public CompletableFuture>> patch( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java index aa27dba..a7e22d7 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java @@ -10,7 +10,6 @@ import com.pipedream.api.resources.proxy.requests.ProxyPatchRequest; import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; -import java.util.Map; public class ProxyClient { protected final ClientOptions clientOptions; @@ -29,43 +28,43 @@ public RawProxyClient withRawResponse() { return this.rawClient; } - public Map get(String url64, ProxyGetRequest request) { + public Object get(String url64, ProxyGetRequest request) { return this.rawClient.get(url64, request).body(); } - public Map get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { + public Object get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { return this.rawClient.get(url64, request, requestOptions).body(); } - public Map post(String url64, ProxyPostRequest request) { + public Object post(String url64, ProxyPostRequest request) { return this.rawClient.post(url64, request).body(); } - public Map post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { + public Object post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { return this.rawClient.post(url64, request, requestOptions).body(); } - public Map put(String url64, ProxyPutRequest request) { + public Object put(String url64, ProxyPutRequest request) { return this.rawClient.put(url64, request).body(); } - public Map put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { + public Object put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { return this.rawClient.put(url64, request, requestOptions).body(); } - public Map delete(String url64, ProxyDeleteRequest request) { + public Object delete(String url64, ProxyDeleteRequest request) { return this.rawClient.delete(url64, request).body(); } - public Map delete(String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { + public Object delete(String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { return this.rawClient.delete(url64, request, requestOptions).body(); } - public Map patch(String url64, ProxyPatchRequest request) { + public Object patch(String url64, ProxyPatchRequest request) { return this.rawClient.patch(url64, request).body(); } - public Map patch(String url64, ProxyPatchRequest request, RequestOptions requestOptions) { + public Object patch(String url64, ProxyPatchRequest request, RequestOptions requestOptions) { return this.rawClient.patch(url64, request, requestOptions).body(); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java index fb9c5bf..8bfb9ec 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java @@ -3,7 +3,6 @@ */ package com.pipedream.api.resources.proxy; -import com.fasterxml.jackson.core.type.TypeReference; import com.pipedream.api.core.BaseClientApiException; import com.pipedream.api.core.BaseClientException; import com.pipedream.api.core.BaseClientHttpResponse; @@ -18,7 +17,6 @@ import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; import java.io.IOException; -import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -34,12 +32,11 @@ public RawProxyClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public BaseClientHttpResponse> get(String url64, ProxyGetRequest request) { + public BaseClientHttpResponse get(String url64, ProxyGetRequest request) { return get(url64, request, null); } - public BaseClientHttpResponse> get( - String url64, ProxyGetRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -62,9 +59,7 @@ public BaseClientHttpResponse> get( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( @@ -77,12 +72,11 @@ public BaseClientHttpResponse> get( } } - public BaseClientHttpResponse> post(String url64, ProxyPostRequest request) { + public BaseClientHttpResponse post(String url64, ProxyPostRequest request) { return post(url64, request, null); } - public BaseClientHttpResponse> post( - String url64, ProxyPostRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -113,9 +107,7 @@ public BaseClientHttpResponse> post( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( @@ -128,12 +120,11 @@ public BaseClientHttpResponse> post( } } - public BaseClientHttpResponse> put(String url64, ProxyPutRequest request) { + public BaseClientHttpResponse put(String url64, ProxyPutRequest request) { return put(url64, request, null); } - public BaseClientHttpResponse> put( - String url64, ProxyPutRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -164,9 +155,7 @@ public BaseClientHttpResponse> put( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( @@ -179,11 +168,11 @@ public BaseClientHttpResponse> put( } } - public BaseClientHttpResponse> delete(String url64, ProxyDeleteRequest request) { + public BaseClientHttpResponse delete(String url64, ProxyDeleteRequest request) { return delete(url64, request, null); } - public BaseClientHttpResponse> delete( + public BaseClientHttpResponse delete( String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -207,9 +196,7 @@ public BaseClientHttpResponse> delete( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( @@ -222,11 +209,11 @@ public BaseClientHttpResponse> delete( } } - public BaseClientHttpResponse> patch(String url64, ProxyPatchRequest request) { + public BaseClientHttpResponse patch(String url64, ProxyPatchRequest request) { return patch(url64, request, null); } - public BaseClientHttpResponse> patch( + public BaseClientHttpResponse patch( String url64, ProxyPatchRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -258,9 +245,7 @@ public BaseClientHttpResponse> patch( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java index 84570a9..e6f7c8c 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java @@ -12,7 +12,7 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; +import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -36,15 +36,17 @@ public AsyncRawTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> create(CreateTokenRequest request) { + public CompletableFuture> create(CreateTokenOpts request) { return create(request, null); } public CompletableFuture> create( - CreateTokenRequest request, RequestOptions requestOptions) { + CreateTokenOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/connect/tokens") + .addPathSegments("v1/connect") + .addPathSegment(clientOptions.projectId()) + .addPathSegments("tokens") .build(); RequestBody body; try { @@ -108,7 +110,9 @@ public CompletableFuture> validate String ctok, TokensValidateRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/connect/tokens") + .addPathSegments("v1/connect") + .addPathSegment(clientOptions.projectId()) + .addPathSegments("tokens") .addPathSegment(ctok) .addPathSegments("validate"); if (request.getParams().isPresent()) { diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java index eef98a0..e918132 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java @@ -5,7 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; +import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -28,11 +28,11 @@ public AsyncRawTokensClient withRawResponse() { return this.rawClient; } - public CompletableFuture create(CreateTokenRequest request) { + public CompletableFuture create(CreateTokenOpts request) { return this.rawClient.create(request).thenApply(response -> response.body()); } - public CompletableFuture create(CreateTokenRequest request, RequestOptions requestOptions) { + public CompletableFuture create(CreateTokenOpts request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java index b18022c..7b0a9de 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java @@ -12,7 +12,7 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; +import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -32,15 +32,16 @@ public RawTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public BaseClientHttpResponse create(CreateTokenRequest request) { + public BaseClientHttpResponse create(CreateTokenOpts request) { return create(request, null); } - public BaseClientHttpResponse create( - CreateTokenRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse create(CreateTokenOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/connect/tokens") + .addPathSegments("v1/connect") + .addPathSegment(clientOptions.projectId()) + .addPathSegments("tokens") .build(); RequestBody body; try { @@ -90,7 +91,9 @@ public BaseClientHttpResponse validate( String ctok, TokensValidateRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/connect/tokens") + .addPathSegments("v1/connect") + .addPathSegment(clientOptions.projectId()) + .addPathSegments("tokens") .addPathSegment(ctok) .addPathSegments("validate"); if (request.getParams().isPresent()) { diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java index 98801f4..39c90ad 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java @@ -5,7 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; +import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -27,11 +27,11 @@ public RawTokensClient withRawResponse() { return this.rawClient; } - public CreateTokenResponse create(CreateTokenRequest request) { + public CreateTokenResponse create(CreateTokenOpts request) { return this.rawClient.create(request).body(); } - public CreateTokenResponse create(CreateTokenRequest request, RequestOptions requestOptions) { + public CreateTokenResponse create(CreateTokenOpts request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java similarity index 83% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenRequest.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java index 9ec9c19..c781251 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenRequest.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java @@ -20,34 +20,30 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateTokenRequest.Builder.class) -public final class CreateTokenRequest { +@JsonDeserialize(builder = CreateTokenOpts.Builder.class) +public final class CreateTokenOpts { private final Optional> allowedOrigins; private final Optional errorRedirectUri; private final String externalUserId; - private final String projectId; - private final Optional successRedirectUri; private final Optional webhookUri; private final Map additionalProperties; - private CreateTokenRequest( + private CreateTokenOpts( Optional> allowedOrigins, Optional errorRedirectUri, String externalUserId, - String projectId, Optional successRedirectUri, Optional webhookUri, Map additionalProperties) { this.allowedOrigins = allowedOrigins; this.errorRedirectUri = errorRedirectUri; this.externalUserId = externalUserId; - this.projectId = projectId; this.successRedirectUri = successRedirectUri; this.webhookUri = webhookUri; this.additionalProperties = additionalProperties; @@ -77,14 +73,6 @@ public String getExternalUserId() { return externalUserId; } - /** - * @return The ID of the project - */ - @JsonProperty("project_id") - public String getProjectId() { - return projectId; - } - /** * @return URI to redirect to on success */ @@ -104,7 +92,7 @@ public Optional getWebhookUri() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof CreateTokenRequest && equalTo((CreateTokenRequest) other); + return other instanceof CreateTokenOpts && equalTo((CreateTokenOpts) other); } @JsonAnyGetter @@ -112,11 +100,10 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(CreateTokenRequest other) { + private boolean equalTo(CreateTokenOpts other) { return allowedOrigins.equals(other.allowedOrigins) && errorRedirectUri.equals(other.errorRedirectUri) && externalUserId.equals(other.externalUserId) - && projectId.equals(other.projectId) && successRedirectUri.equals(other.successRedirectUri) && webhookUri.equals(other.webhookUri); } @@ -127,7 +114,6 @@ public int hashCode() { this.allowedOrigins, this.errorRedirectUri, this.externalUserId, - this.projectId, this.successRedirectUri, this.webhookUri); } @@ -145,20 +131,13 @@ public interface ExternalUserIdStage { /** *

Your end user ID, for whom you're creating the token

*/ - ProjectIdStage externalUserId(@NotNull String externalUserId); + _FinalStage externalUserId(@NotNull String externalUserId); - Builder from(CreateTokenRequest other); - } - - public interface ProjectIdStage { - /** - *

The ID of the project

- */ - _FinalStage projectId(@NotNull String projectId); + Builder from(CreateTokenOpts other); } public interface _FinalStage { - CreateTokenRequest build(); + CreateTokenOpts build(); /** *

List of allowed origins for CORS

@@ -190,11 +169,9 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, ProjectIdStage, _FinalStage { + public static final class Builder implements ExternalUserIdStage, _FinalStage { private String externalUserId; - private String projectId; - private Optional webhookUri = Optional.empty(); private Optional successRedirectUri = Optional.empty(); @@ -209,11 +186,10 @@ public static final class Builder implements ExternalUserIdStage, ProjectIdStage private Builder() {} @java.lang.Override - public Builder from(CreateTokenRequest other) { + public Builder from(CreateTokenOpts other) { allowedOrigins(other.getAllowedOrigins()); errorRedirectUri(other.getErrorRedirectUri()); externalUserId(other.getExternalUserId()); - projectId(other.getProjectId()); successRedirectUri(other.getSuccessRedirectUri()); webhookUri(other.getWebhookUri()); return this; @@ -226,23 +202,11 @@ public Builder from(CreateTokenRequest other) { */ @java.lang.Override @JsonSetter("external_user_id") - public ProjectIdStage externalUserId(@NotNull String externalUserId) { + public _FinalStage externalUserId(@NotNull String externalUserId) { this.externalUserId = Objects.requireNonNull(externalUserId, "externalUserId must not be null"); return this; } - /** - *

The ID of the project

- *

The ID of the project

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("project_id") - public _FinalStage projectId(@NotNull String projectId) { - this.projectId = Objects.requireNonNull(projectId, "projectId must not be null"); - return this; - } - /** *

Webhook URI for notifications

* @return Reference to {@code this} so that method calls can be chained together. @@ -324,12 +288,11 @@ public _FinalStage allowedOrigins(Optional> allowedOrigins) { } @java.lang.Override - public CreateTokenRequest build() { - return new CreateTokenRequest( + public CreateTokenOpts build() { + return new CreateTokenOpts( allowedOrigins, errorRedirectUri, externalUserId, - projectId, successRedirectUri, webhookUri, additionalProperties); diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java index 212cb99..fa61409 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java @@ -24,8 +24,6 @@ public final class ConnectTokenCreateOpts { private final String externalUserId; - private final String projectId; - private final Optional> allowedOrigins; private final Optional errorRedirectUri; @@ -38,14 +36,12 @@ public final class ConnectTokenCreateOpts { private ConnectTokenCreateOpts( String externalUserId, - String projectId, Optional> allowedOrigins, Optional errorRedirectUri, Optional successRedirectUri, Optional webhookUri, Map additionalProperties) { this.externalUserId = externalUserId; - this.projectId = projectId; this.allowedOrigins = allowedOrigins; this.errorRedirectUri = errorRedirectUri; this.successRedirectUri = successRedirectUri; @@ -61,14 +57,6 @@ public String getExternalUserId() { return externalUserId; } - /** - * @return The ID of the project - */ - @JsonProperty("project_id") - public String getProjectId() { - return projectId; - } - /** * @return List of allowed origins for CORS */ @@ -114,7 +102,6 @@ public Map getAdditionalProperties() { private boolean equalTo(ConnectTokenCreateOpts other) { return externalUserId.equals(other.externalUserId) - && projectId.equals(other.projectId) && allowedOrigins.equals(other.allowedOrigins) && errorRedirectUri.equals(other.errorRedirectUri) && successRedirectUri.equals(other.successRedirectUri) @@ -125,7 +112,6 @@ private boolean equalTo(ConnectTokenCreateOpts other) { public int hashCode() { return Objects.hash( this.externalUserId, - this.projectId, this.allowedOrigins, this.errorRedirectUri, this.successRedirectUri, @@ -145,18 +131,11 @@ public interface ExternalUserIdStage { /** *

Your end user ID, for whom you're creating the token

*/ - ProjectIdStage externalUserId(@NotNull String externalUserId); + _FinalStage externalUserId(@NotNull String externalUserId); Builder from(ConnectTokenCreateOpts other); } - public interface ProjectIdStage { - /** - *

The ID of the project

- */ - _FinalStage projectId(@NotNull String projectId); - } - public interface _FinalStage { ConnectTokenCreateOpts build(); @@ -190,11 +169,9 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, ProjectIdStage, _FinalStage { + public static final class Builder implements ExternalUserIdStage, _FinalStage { private String externalUserId; - private String projectId; - private Optional webhookUri = Optional.empty(); private Optional successRedirectUri = Optional.empty(); @@ -211,7 +188,6 @@ private Builder() {} @java.lang.Override public Builder from(ConnectTokenCreateOpts other) { externalUserId(other.getExternalUserId()); - projectId(other.getProjectId()); allowedOrigins(other.getAllowedOrigins()); errorRedirectUri(other.getErrorRedirectUri()); successRedirectUri(other.getSuccessRedirectUri()); @@ -226,23 +202,11 @@ public Builder from(ConnectTokenCreateOpts other) { */ @java.lang.Override @JsonSetter("external_user_id") - public ProjectIdStage externalUserId(@NotNull String externalUserId) { + public _FinalStage externalUserId(@NotNull String externalUserId) { this.externalUserId = Objects.requireNonNull(externalUserId, "externalUserId must not be null"); return this; } - /** - *

The ID of the project

- *

The ID of the project

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("project_id") - public _FinalStage projectId(@NotNull String projectId) { - this.projectId = Objects.requireNonNull(projectId, "projectId must not be null"); - return this; - } - /** *

Webhook URI for notifications

* @return Reference to {@code this} so that method calls can be chained together. @@ -327,7 +291,6 @@ public _FinalStage allowedOrigins(Optional> allowedOrigins) { public ConnectTokenCreateOpts build() { return new ConnectTokenCreateOpts( externalUserId, - projectId, allowedOrigins, errorRedirectUri, successRedirectUri, diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProxyResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProxyResponse.java deleted file mode 100644 index 60a46ab..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProxyResponse.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyResponse.Builder.class) -public final class ProxyResponse { - private final Optional status; - - private final Optional> headers; - - private final Optional body; - - private final Map additionalProperties; - - private ProxyResponse( - Optional status, - Optional> headers, - Optional body, - Map additionalProperties) { - this.status = status; - this.headers = headers; - this.body = body; - this.additionalProperties = additionalProperties; - } - - /** - * @return HTTP status code - */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - /** - * @return Response headers - */ - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @JsonProperty("body") - public Optional getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProxyResponse && equalTo((ProxyResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProxyResponse other) { - return status.equals(other.status) && headers.equals(other.headers) && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.status, this.headers, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional status = Optional.empty(); - - private Optional> headers = Optional.empty(); - - private Optional body = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ProxyResponse other) { - status(other.getStatus()); - headers(other.getHeaders()); - body(other.getBody()); - return this; - } - - /** - *

HTTP status code

- */ - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(Integer status) { - this.status = Optional.ofNullable(status); - return this; - } - - /** - *

Response headers

- */ - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public Builder headers(Optional> headers) { - this.headers = headers; - return this; - } - - public Builder headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @JsonSetter(value = "body", nulls = Nulls.SKIP) - public Builder body(Optional body) { - this.body = body; - return this; - } - - public Builder body(Object body) { - this.body = Optional.ofNullable(body); - return this; - } - - public ProxyResponse build() { - return new ProxyResponse(status, headers, body, additionalProperties); - } - } -} diff --git a/reference.md b/reference.md index 4569eb0..65ccf59 100644 --- a/reference.md +++ b/reference.md @@ -315,7 +315,7 @@ client.accounts().list( ```java client.accounts().create( "project_id", - CreateAccountRequest + CreateAccountOpts .builder() .appSlug("app_slug") .cfmapJson("cfmap_json") @@ -2289,7 +2289,7 @@ client.projects().retrieveInfo("project_id"); ## Proxy -
client.proxy.get(projectId, url64) -> Map<String, Object> +
client.proxy.get(projectId, url64) -> Object
@@ -2361,7 +2361,7 @@ client.proxy().get(
-
client.proxy.post(projectId, url64, request) -> Map<String, Object> +
client.proxy.post(projectId, url64, request) -> Object
@@ -2446,7 +2446,7 @@ client.proxy().post(
-
client.proxy.put(projectId, url64, request) -> Map<String, Object> +
client.proxy.put(projectId, url64, request) -> Object
@@ -2531,7 +2531,7 @@ client.proxy().put(
-
client.proxy.delete(projectId, url64) -> Map<String, Object> +
client.proxy.delete(projectId, url64) -> Object
@@ -2603,7 +2603,7 @@ client.proxy().delete(
-
client.proxy.patch(projectId, url64, request) -> Map<String, Object> +
client.proxy.patch(projectId, url64, request) -> Object
@@ -2689,7 +2689,7 @@ client.proxy().patch(
## Tokens -
client.tokens.create(request) -> CreateTokenResponse +
client.tokens.create(projectId, request) -> CreateTokenResponse
@@ -2703,10 +2703,10 @@ client.proxy().patch( ```java client.tokens().create( - CreateTokenRequest + "project_id", + CreateTokenOpts .builder() .externalUserId("external_user_id") - .projectId("project_id") .build() ); ``` @@ -2723,7 +2723,7 @@ client.tokens().create(
-**allowedOrigins:** `Optional>` — List of allowed origins for CORS +**projectId:** `String` — The project ID, which starts with 'proj_'.
@@ -2731,7 +2731,7 @@ client.tokens().create(
-**errorRedirectUri:** `Optional` — URI to redirect to on error +**allowedOrigins:** `Optional>` — List of allowed origins for CORS
@@ -2739,7 +2739,7 @@ client.tokens().create(
-**externalUserId:** `String` — Your end user ID, for whom you're creating the token +**errorRedirectUri:** `Optional` — URI to redirect to on error
@@ -2747,7 +2747,7 @@ client.tokens().create(
-**projectId:** `String` — The ID of the project +**externalUserId:** `String` — Your end user ID, for whom you're creating the token
@@ -2775,7 +2775,7 @@ client.tokens().create(
-
client.tokens.validate(ctok) -> ValidateTokenResponse +
client.tokens.validate(projectId, ctok) -> ValidateTokenResponse
@@ -2789,6 +2789,7 @@ client.tokens().create( ```java client.tokens().validate( + "project_id", "ctok", TokensValidateRequest .builder() @@ -2808,6 +2809,14 @@ client.tokens().validate(
+**projectId:** `String` — The project ID, which starts with 'proj_'. + +
+
+ +
+
+ **ctok:** `String`
diff --git a/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java b/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java index e6b8839..9361d1d 100644 --- a/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java +++ b/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java @@ -7,10 +7,13 @@ import com.pipedream.api.core.Environment; import com.pipedream.api.core.OAuthTokenSupplier; import com.pipedream.api.resources.oauthtokens.OauthTokensClient; +import java.util.Optional; import okhttp3.OkHttpClient; public class AsyncBaseClientBuilder { - private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); + private Optional timeout = Optional.empty(); + + private Optional maxRetries = Optional.empty(); private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); @@ -20,6 +23,8 @@ public class AsyncBaseClientBuilder { private Environment environment = Environment.PROD; + private OkHttpClient httpClient; + /** * Sets clientId. * Defaults to the PIPEDREAM_CLIENT_ID environment variable. @@ -60,7 +65,7 @@ public AsyncBaseClientBuilder url(String url) { * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ public AsyncBaseClientBuilder timeout(int timeout) { - this.clientOptionsBuilder.timeout(timeout); + this.timeout = Optional.of(timeout); return this; } @@ -68,7 +73,7 @@ public AsyncBaseClientBuilder timeout(int timeout) { * Sets the maximum number of retries for the client. Defaults to 2 retries. */ public AsyncBaseClientBuilder maxRetries(int maxRetries) { - this.clientOptionsBuilder.maxRetries(maxRetries); + this.maxRetries = Optional.of(maxRetries); return this; } @@ -76,7 +81,7 @@ public AsyncBaseClientBuilder maxRetries(int maxRetries) { * Sets the underlying OkHttp client */ public AsyncBaseClientBuilder httpClient(OkHttpClient httpClient) { - this.clientOptionsBuilder.httpClient(httpClient); + this.httpClient = httpClient; return this; } @@ -86,18 +91,156 @@ public AsyncBaseClientBuilder projectId(String projectId) { } protected ClientOptions buildClientOptions() { - clientOptionsBuilder.environment(this.environment); - return clientOptionsBuilder.build(); + ClientOptions.Builder builder = ClientOptions.builder(); + setEnvironment(builder); + setAuthentication(builder); + setCustomHeaders(builder); + setVariables(builder); + setHttpClient(builder); + setTimeouts(builder); + setRetries(builder); + setAdditional(builder); + return builder.build(); } - public AsyncBaseClient build() { - OauthTokensClient authClient = new OauthTokensClient( - ClientOptions.builder().environment(this.environment).build()); - OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient); - this.clientOptionsBuilder.addHeader("Authorization", oAuthTokenSupplier); - if (projectEnvironment != null) { - this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment); + /** + * Sets the environment configuration for the client. + * Override this method to modify URLs or add environment-specific logic. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setEnvironment(ClientOptions.Builder builder) { + builder.environment(this.environment); + } + + /** + * Override this method to customize authentication. + * This method is called during client options construction to set up authentication headers. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAuthentication(ClientOptions.Builder builder) {
+     *     super.setAuthentication(builder); // Keep existing auth
+     *     builder.addHeader("X-API-Key", this.apiKey);
+     * }
+     * }
+ */ + protected void setAuthentication(ClientOptions.Builder builder) { + if (this.clientId != null && this.clientSecret != null) { + OauthTokensClient authClient = new OauthTokensClient( + ClientOptions.builder().environment(this.environment).build()); + OAuthTokenSupplier oAuthTokenSupplier = + new OAuthTokenSupplier(this.clientId, this.clientSecret, authClient); + builder.addHeader("Authorization", oAuthTokenSupplier); } + } + + /** + * Override this method to add or modify custom headers. + * This method is called during client options construction to set up custom headers defined in the API. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setCustomHeaders(ClientOptions.Builder builder) {
+     *     super.setCustomHeaders(builder); // Keep existing headers
+     *     builder.addHeader("X-Trace-ID", generateTraceId());
+     * }
+     * }
+ */ + protected void setCustomHeaders(ClientOptions.Builder builder) { + if (this.projectEnvironment != null) { + builder.addHeader("x-pd-environment", this.projectEnvironment); + } + } + + /** + * Override this method to configure API variables defined in the specification. + * Available variables: projectId + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setVariables(ClientOptions.Builder builder) {} + + /** + * Sets the request timeout configuration. + * Override this method to customize timeout behavior. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setTimeouts(ClientOptions.Builder builder) { + if (this.timeout.isPresent()) { + builder.timeout(this.timeout.get()); + } + } + + /** + * Sets the retry configuration for failed requests. + * Override this method to implement custom retry strategies. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setRetries(ClientOptions.Builder builder) { + if (this.maxRetries.isPresent()) { + builder.maxRetries(this.maxRetries.get()); + } + } + + /** + * Sets the OkHttp client configuration. + * Override this method to customize HTTP client behavior (interceptors, connection pools, etc). + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setHttpClient(ClientOptions.Builder builder) { + if (this.httpClient != null) { + builder.httpClient(this.httpClient); + } + } + + /** + * Override this method to add any additional configuration to the client. + * This method is called at the end of the configuration chain, allowing you to add + * custom headers, modify settings, or perform any other client customization. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAdditional(ClientOptions.Builder builder) {
+     *     builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
+     *     builder.addHeader("X-Client-Version", "1.0.0");
+     * }
+     * }
+ */ + protected void setAdditional(ClientOptions.Builder builder) {} + + /** + * Override this method to add custom validation logic before the client is built. + * This method is called at the beginning of the build() method to ensure the configuration is valid. + * Throw an exception to prevent client creation if validation fails. + * + * Example: + *
{@code
+     * @Override
+     * protected void validateConfiguration() {
+     *     super.validateConfiguration(); // Run parent validations
+     *     if (tenantId == null || tenantId.isEmpty()) {
+     *         throw new IllegalStateException("tenantId is required");
+     *     }
+     * }
+     * }
+ */ + protected void validateConfiguration() {} + + public AsyncBaseClient build() { + validateConfiguration(); return new AsyncBaseClient(buildClientOptions()); } } diff --git a/src/main/java/com/pipedream/api/BaseClientBuilder.java b/src/main/java/com/pipedream/api/BaseClientBuilder.java index 000caa1..13318cd 100644 --- a/src/main/java/com/pipedream/api/BaseClientBuilder.java +++ b/src/main/java/com/pipedream/api/BaseClientBuilder.java @@ -7,10 +7,13 @@ import com.pipedream.api.core.Environment; import com.pipedream.api.core.OAuthTokenSupplier; import com.pipedream.api.resources.oauthtokens.OauthTokensClient; +import java.util.Optional; import okhttp3.OkHttpClient; public class BaseClientBuilder { - private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); + private Optional timeout = Optional.empty(); + + private Optional maxRetries = Optional.empty(); private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); @@ -20,6 +23,8 @@ public class BaseClientBuilder { private Environment environment = Environment.PROD; + private OkHttpClient httpClient; + /** * Sets clientId. * Defaults to the PIPEDREAM_CLIENT_ID environment variable. @@ -60,7 +65,7 @@ public BaseClientBuilder url(String url) { * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ public BaseClientBuilder timeout(int timeout) { - this.clientOptionsBuilder.timeout(timeout); + this.timeout = Optional.of(timeout); return this; } @@ -68,7 +73,7 @@ public BaseClientBuilder timeout(int timeout) { * Sets the maximum number of retries for the client. Defaults to 2 retries. */ public BaseClientBuilder maxRetries(int maxRetries) { - this.clientOptionsBuilder.maxRetries(maxRetries); + this.maxRetries = Optional.of(maxRetries); return this; } @@ -76,7 +81,7 @@ public BaseClientBuilder maxRetries(int maxRetries) { * Sets the underlying OkHttp client */ public BaseClientBuilder httpClient(OkHttpClient httpClient) { - this.clientOptionsBuilder.httpClient(httpClient); + this.httpClient = httpClient; return this; } @@ -86,18 +91,156 @@ public BaseClientBuilder projectId(String projectId) { } protected ClientOptions buildClientOptions() { - clientOptionsBuilder.environment(this.environment); - return clientOptionsBuilder.build(); + ClientOptions.Builder builder = ClientOptions.builder(); + setEnvironment(builder); + setAuthentication(builder); + setCustomHeaders(builder); + setVariables(builder); + setHttpClient(builder); + setTimeouts(builder); + setRetries(builder); + setAdditional(builder); + return builder.build(); } - public BaseClient build() { - OauthTokensClient authClient = new OauthTokensClient( - ClientOptions.builder().environment(this.environment).build()); - OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient); - this.clientOptionsBuilder.addHeader("Authorization", oAuthTokenSupplier); - if (projectEnvironment != null) { - this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment); + /** + * Sets the environment configuration for the client. + * Override this method to modify URLs or add environment-specific logic. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setEnvironment(ClientOptions.Builder builder) { + builder.environment(this.environment); + } + + /** + * Override this method to customize authentication. + * This method is called during client options construction to set up authentication headers. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAuthentication(ClientOptions.Builder builder) {
+     *     super.setAuthentication(builder); // Keep existing auth
+     *     builder.addHeader("X-API-Key", this.apiKey);
+     * }
+     * }
+ */ + protected void setAuthentication(ClientOptions.Builder builder) { + if (this.clientId != null && this.clientSecret != null) { + OauthTokensClient authClient = new OauthTokensClient( + ClientOptions.builder().environment(this.environment).build()); + OAuthTokenSupplier oAuthTokenSupplier = + new OAuthTokenSupplier(this.clientId, this.clientSecret, authClient); + builder.addHeader("Authorization", oAuthTokenSupplier); } + } + + /** + * Override this method to add or modify custom headers. + * This method is called during client options construction to set up custom headers defined in the API. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setCustomHeaders(ClientOptions.Builder builder) {
+     *     super.setCustomHeaders(builder); // Keep existing headers
+     *     builder.addHeader("X-Trace-ID", generateTraceId());
+     * }
+     * }
+ */ + protected void setCustomHeaders(ClientOptions.Builder builder) { + if (this.projectEnvironment != null) { + builder.addHeader("x-pd-environment", this.projectEnvironment); + } + } + + /** + * Override this method to configure API variables defined in the specification. + * Available variables: projectId + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setVariables(ClientOptions.Builder builder) {} + + /** + * Sets the request timeout configuration. + * Override this method to customize timeout behavior. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setTimeouts(ClientOptions.Builder builder) { + if (this.timeout.isPresent()) { + builder.timeout(this.timeout.get()); + } + } + + /** + * Sets the retry configuration for failed requests. + * Override this method to implement custom retry strategies. + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setRetries(ClientOptions.Builder builder) { + if (this.maxRetries.isPresent()) { + builder.maxRetries(this.maxRetries.get()); + } + } + + /** + * Sets the OkHttp client configuration. + * Override this method to customize HTTP client behavior (interceptors, connection pools, etc). + * + * @param builder The ClientOptions.Builder to configure + */ + protected void setHttpClient(ClientOptions.Builder builder) { + if (this.httpClient != null) { + builder.httpClient(this.httpClient); + } + } + + /** + * Override this method to add any additional configuration to the client. + * This method is called at the end of the configuration chain, allowing you to add + * custom headers, modify settings, or perform any other client customization. + * + * @param builder The ClientOptions.Builder to configure + * + * Example: + *
{@code
+     * @Override
+     * protected void setAdditional(ClientOptions.Builder builder) {
+     *     builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
+     *     builder.addHeader("X-Client-Version", "1.0.0");
+     * }
+     * }
+ */ + protected void setAdditional(ClientOptions.Builder builder) {} + + /** + * Override this method to add custom validation logic before the client is built. + * This method is called at the beginning of the build() method to ensure the configuration is valid. + * Throw an exception to prevent client creation if validation fails. + * + * Example: + *
{@code
+     * @Override
+     * protected void validateConfiguration() {
+     *     super.validateConfiguration(); // Run parent validations
+     *     if (tenantId == null || tenantId.isEmpty()) {
+     *         throw new IllegalStateException("tenantId is required");
+     *     }
+     * }
+     * }
+ */ + protected void validateConfiguration() {} + + public BaseClient build() { + validateConfiguration(); return new BaseClient(buildClientOptions()); } } diff --git a/src/main/java/com/pipedream/api/core/ClientOptions.java b/src/main/java/com/pipedream/api/core/ClientOptions.java index 524ee4e..bd94c5e 100644 --- a/src/main/java/com/pipedream/api/core/ClientOptions.java +++ b/src/main/java/com/pipedream/api/core/ClientOptions.java @@ -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.237"); + put("X-Fern-SDK-Version", "0.0.255"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java index 81f9441..4e8b110 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java @@ -8,7 +8,7 @@ import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.accounts.requests.AccountsListRequest; import com.pipedream.api.resources.accounts.requests.AccountsRetrieveRequest; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; import com.pipedream.api.types.Account; public class AccountsClient { @@ -40,11 +40,11 @@ public SyncPagingIterable list(AccountsListRequest request, RequestOpti return this.rawClient.list(request, requestOptions).body(); } - public Account create(CreateAccountRequest request) { + public Account create(CreateAccountOpts request) { return this.rawClient.create(request).body(); } - public Account create(CreateAccountRequest request, RequestOptions requestOptions) { + public Account create(CreateAccountOpts request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); } diff --git a/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java index 761a206..34158ac 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java @@ -8,7 +8,7 @@ import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.accounts.requests.AccountsListRequest; import com.pipedream.api.resources.accounts.requests.AccountsRetrieveRequest; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; import com.pipedream.api.types.Account; import java.util.concurrent.CompletableFuture; @@ -42,11 +42,11 @@ public CompletableFuture> list( return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture create(CreateAccountRequest request) { + public CompletableFuture create(CreateAccountOpts request) { return this.rawClient.create(request).thenApply(response -> response.body()); } - public CompletableFuture create(CreateAccountRequest request, RequestOptions requestOptions) { + public CompletableFuture create(CreateAccountOpts request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java index 59601c1..ea4f83a 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java @@ -14,7 +14,7 @@ import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.accounts.requests.AccountsListRequest; import com.pipedream.api.resources.accounts.requests.AccountsRetrieveRequest; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; import com.pipedream.api.types.Account; import com.pipedream.api.types.ListAccountsResponse; import java.io.IOException; @@ -146,12 +146,12 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> create(CreateAccountRequest request) { + public CompletableFuture> create(CreateAccountOpts request) { return create(request, null); } public CompletableFuture> create( - CreateAccountRequest request, RequestOptions requestOptions) { + CreateAccountOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") diff --git a/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java index e90fe31..5fb30da 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java @@ -14,7 +14,7 @@ import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.accounts.requests.AccountsListRequest; import com.pipedream.api.resources.accounts.requests.AccountsRetrieveRequest; -import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; +import com.pipedream.api.resources.accounts.requests.CreateAccountOpts; import com.pipedream.api.types.Account; import com.pipedream.api.types.ListAccountsResponse; import java.io.IOException; @@ -121,11 +121,11 @@ public BaseClientHttpResponse> list( } } - public BaseClientHttpResponse create(CreateAccountRequest request) { + public BaseClientHttpResponse create(CreateAccountOpts request) { return create(request, null); } - public BaseClientHttpResponse create(CreateAccountRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse create(CreateAccountOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") diff --git a/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java b/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java similarity index 95% rename from src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java rename to src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java index aeec52a..79cef5e 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java +++ b/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java @@ -19,8 +19,8 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateAccountRequest.Builder.class) -public final class CreateAccountRequest { +@JsonDeserialize(builder = CreateAccountOpts.Builder.class) +public final class CreateAccountOpts { private final Optional appId; private final Optional externalUserId; @@ -37,7 +37,7 @@ public final class CreateAccountRequest { private final Map additionalProperties; - private CreateAccountRequest( + private CreateAccountOpts( Optional appId, Optional externalUserId, Optional oauthAppId, @@ -112,7 +112,7 @@ public Optional getName() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof CreateAccountRequest && equalTo((CreateAccountRequest) other); + return other instanceof CreateAccountOpts && equalTo((CreateAccountOpts) other); } @JsonAnyGetter @@ -120,7 +120,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(CreateAccountRequest other) { + private boolean equalTo(CreateAccountOpts other) { return appId.equals(other.appId) && externalUserId.equals(other.externalUserId) && oauthAppId.equals(other.oauthAppId) @@ -157,7 +157,7 @@ public interface AppSlugStage { */ CfmapJsonStage appSlug(@NotNull String appSlug); - Builder from(CreateAccountRequest other); + Builder from(CreateAccountOpts other); } public interface CfmapJsonStage { @@ -175,7 +175,7 @@ public interface ConnectTokenStage { } public interface _FinalStage { - CreateAccountRequest build(); + CreateAccountOpts build(); /** *

The app slug or ID to filter accounts by.

@@ -225,7 +225,7 @@ public static final class Builder implements AppSlugStage, CfmapJsonStage, Conne private Builder() {} @java.lang.Override - public Builder from(CreateAccountRequest other) { + public Builder from(CreateAccountOpts other) { appId(other.getAppId()); externalUserId(other.getExternalUserId()); oauthAppId(other.getOauthAppId()); @@ -346,8 +346,8 @@ public _FinalStage appId(Optional appId) { } @java.lang.Override - public CreateAccountRequest build() { - return new CreateAccountRequest( + public CreateAccountOpts build() { + return new CreateAccountOpts( appId, externalUserId, oauthAppId, appSlug, cfmapJson, connectToken, name, additionalProperties); } } diff --git a/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java b/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java index 61bcd21..fd06a93 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java +++ b/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java @@ -10,7 +10,6 @@ import com.pipedream.api.resources.proxy.requests.ProxyPatchRequest; import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; -import java.util.Map; import java.util.concurrent.CompletableFuture; public class AsyncProxyClient { @@ -30,48 +29,43 @@ public AsyncRawProxyClient withRawResponse() { return this.rawClient; } - public CompletableFuture> get(String url64, ProxyGetRequest request) { + public CompletableFuture get(String url64, ProxyGetRequest request) { return this.rawClient.get(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> get( - String url64, ProxyGetRequest request, RequestOptions requestOptions) { + public CompletableFuture get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { return this.rawClient.get(url64, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> post(String url64, ProxyPostRequest request) { + public CompletableFuture post(String url64, ProxyPostRequest request) { return this.rawClient.post(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> post( - String url64, ProxyPostRequest request, RequestOptions requestOptions) { + public CompletableFuture post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { return this.rawClient.post(url64, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> put(String url64, ProxyPutRequest request) { + public CompletableFuture put(String url64, ProxyPutRequest request) { return this.rawClient.put(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> put( - String url64, ProxyPutRequest request, RequestOptions requestOptions) { + public CompletableFuture put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { return this.rawClient.put(url64, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> delete(String url64, ProxyDeleteRequest request) { + public CompletableFuture delete(String url64, ProxyDeleteRequest request) { return this.rawClient.delete(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> delete( - String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { + public CompletableFuture delete(String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { return this.rawClient.delete(url64, request, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture> patch(String url64, ProxyPatchRequest request) { + public CompletableFuture patch(String url64, ProxyPatchRequest request) { return this.rawClient.patch(url64, request).thenApply(response -> response.body()); } - public CompletableFuture> patch( - String url64, ProxyPatchRequest request, RequestOptions requestOptions) { + public CompletableFuture patch(String url64, ProxyPatchRequest request, RequestOptions requestOptions) { return this.rawClient.patch(url64, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java b/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java index 30ca813..24f27f3 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java +++ b/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java @@ -3,7 +3,6 @@ */ package com.pipedream.api.resources.proxy; -import com.fasterxml.jackson.core.type.TypeReference; import com.pipedream.api.core.BaseClientApiException; import com.pipedream.api.core.BaseClientException; import com.pipedream.api.core.BaseClientHttpResponse; @@ -18,7 +17,6 @@ import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; import java.io.IOException; -import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -38,11 +36,11 @@ public AsyncRawProxyClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> get(String url64, ProxyGetRequest request) { + public CompletableFuture> get(String url64, ProxyGetRequest request) { return get(url64, request, null); } - public CompletableFuture>> get( + public CompletableFuture> get( String url64, ProxyGetRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -62,16 +60,14 @@ public CompletableFuture>> get( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -94,11 +90,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> post(String url64, ProxyPostRequest request) { + public CompletableFuture> post(String url64, ProxyPostRequest request) { return post(url64, request, null); } - public CompletableFuture>> post( + public CompletableFuture> post( String url64, ProxyPostRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -126,16 +122,14 @@ public CompletableFuture>> post( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -158,11 +152,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> put(String url64, ProxyPutRequest request) { + public CompletableFuture> put(String url64, ProxyPutRequest request) { return put(url64, request, null); } - public CompletableFuture>> put( + public CompletableFuture> put( String url64, ProxyPutRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -190,16 +184,14 @@ public CompletableFuture>> put( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -222,12 +214,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> delete( - String url64, ProxyDeleteRequest request) { + public CompletableFuture> delete(String url64, ProxyDeleteRequest request) { return delete(url64, request, null); } - public CompletableFuture>> delete( + public CompletableFuture> delete( String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -247,16 +238,14 @@ public CompletableFuture>> delete( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -279,12 +268,11 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture>> patch( - String url64, ProxyPatchRequest request) { + public CompletableFuture> patch(String url64, ProxyPatchRequest request) { return patch(url64, request, null); } - public CompletableFuture>> patch( + public CompletableFuture> patch( String url64, ProxyPatchRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -312,16 +300,14 @@ public CompletableFuture>> patch( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; diff --git a/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java b/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java index aa27dba..a7e22d7 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java +++ b/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java @@ -10,7 +10,6 @@ import com.pipedream.api.resources.proxy.requests.ProxyPatchRequest; import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; -import java.util.Map; public class ProxyClient { protected final ClientOptions clientOptions; @@ -29,43 +28,43 @@ public RawProxyClient withRawResponse() { return this.rawClient; } - public Map get(String url64, ProxyGetRequest request) { + public Object get(String url64, ProxyGetRequest request) { return this.rawClient.get(url64, request).body(); } - public Map get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { + public Object get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { return this.rawClient.get(url64, request, requestOptions).body(); } - public Map post(String url64, ProxyPostRequest request) { + public Object post(String url64, ProxyPostRequest request) { return this.rawClient.post(url64, request).body(); } - public Map post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { + public Object post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { return this.rawClient.post(url64, request, requestOptions).body(); } - public Map put(String url64, ProxyPutRequest request) { + public Object put(String url64, ProxyPutRequest request) { return this.rawClient.put(url64, request).body(); } - public Map put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { + public Object put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { return this.rawClient.put(url64, request, requestOptions).body(); } - public Map delete(String url64, ProxyDeleteRequest request) { + public Object delete(String url64, ProxyDeleteRequest request) { return this.rawClient.delete(url64, request).body(); } - public Map delete(String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { + public Object delete(String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { return this.rawClient.delete(url64, request, requestOptions).body(); } - public Map patch(String url64, ProxyPatchRequest request) { + public Object patch(String url64, ProxyPatchRequest request) { return this.rawClient.patch(url64, request).body(); } - public Map patch(String url64, ProxyPatchRequest request, RequestOptions requestOptions) { + public Object patch(String url64, ProxyPatchRequest request, RequestOptions requestOptions) { return this.rawClient.patch(url64, request, requestOptions).body(); } } diff --git a/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java b/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java index fb9c5bf..8bfb9ec 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java +++ b/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java @@ -3,7 +3,6 @@ */ package com.pipedream.api.resources.proxy; -import com.fasterxml.jackson.core.type.TypeReference; import com.pipedream.api.core.BaseClientApiException; import com.pipedream.api.core.BaseClientException; import com.pipedream.api.core.BaseClientHttpResponse; @@ -18,7 +17,6 @@ import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; import java.io.IOException; -import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -34,12 +32,11 @@ public RawProxyClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public BaseClientHttpResponse> get(String url64, ProxyGetRequest request) { + public BaseClientHttpResponse get(String url64, ProxyGetRequest request) { return get(url64, request, null); } - public BaseClientHttpResponse> get( - String url64, ProxyGetRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -62,9 +59,7 @@ public BaseClientHttpResponse> get( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( @@ -77,12 +72,11 @@ public BaseClientHttpResponse> get( } } - public BaseClientHttpResponse> post(String url64, ProxyPostRequest request) { + public BaseClientHttpResponse post(String url64, ProxyPostRequest request) { return post(url64, request, null); } - public BaseClientHttpResponse> post( - String url64, ProxyPostRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -113,9 +107,7 @@ public BaseClientHttpResponse> post( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( @@ -128,12 +120,11 @@ public BaseClientHttpResponse> post( } } - public BaseClientHttpResponse> put(String url64, ProxyPutRequest request) { + public BaseClientHttpResponse put(String url64, ProxyPutRequest request) { return put(url64, request, null); } - public BaseClientHttpResponse> put( - String url64, ProxyPutRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -164,9 +155,7 @@ public BaseClientHttpResponse> put( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( @@ -179,11 +168,11 @@ public BaseClientHttpResponse> put( } } - public BaseClientHttpResponse> delete(String url64, ProxyDeleteRequest request) { + public BaseClientHttpResponse delete(String url64, ProxyDeleteRequest request) { return delete(url64, request, null); } - public BaseClientHttpResponse> delete( + public BaseClientHttpResponse delete( String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -207,9 +196,7 @@ public BaseClientHttpResponse> delete( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( @@ -222,11 +209,11 @@ public BaseClientHttpResponse> delete( } } - public BaseClientHttpResponse> patch(String url64, ProxyPatchRequest request) { + public BaseClientHttpResponse patch(String url64, ProxyPatchRequest request) { return patch(url64, request, null); } - public BaseClientHttpResponse> patch( + public BaseClientHttpResponse patch( String url64, ProxyPatchRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -258,9 +245,7 @@ public BaseClientHttpResponse> patch( ResponseBody responseBody = response.body(); if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; throw new BaseClientApiException( 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 84570a9..e6f7c8c 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java @@ -12,7 +12,7 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; +import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -36,15 +36,17 @@ public AsyncRawTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> create(CreateTokenRequest request) { + public CompletableFuture> create(CreateTokenOpts request) { return create(request, null); } public CompletableFuture> create( - CreateTokenRequest request, RequestOptions requestOptions) { + CreateTokenOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/connect/tokens") + .addPathSegments("v1/connect") + .addPathSegment(clientOptions.projectId()) + .addPathSegments("tokens") .build(); RequestBody body; try { @@ -108,7 +110,9 @@ public CompletableFuture> validate String ctok, TokensValidateRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/connect/tokens") + .addPathSegments("v1/connect") + .addPathSegment(clientOptions.projectId()) + .addPathSegments("tokens") .addPathSegment(ctok) .addPathSegments("validate"); if (request.getParams().isPresent()) { 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 eef98a0..e918132 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java @@ -5,7 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; +import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -28,11 +28,11 @@ public AsyncRawTokensClient withRawResponse() { return this.rawClient; } - public CompletableFuture create(CreateTokenRequest request) { + public CompletableFuture create(CreateTokenOpts request) { return this.rawClient.create(request).thenApply(response -> response.body()); } - public CompletableFuture create(CreateTokenRequest request, RequestOptions requestOptions) { + public CompletableFuture create(CreateTokenOpts request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); } 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 b18022c..7b0a9de 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java @@ -12,7 +12,7 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; +import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -32,15 +32,16 @@ public RawTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public BaseClientHttpResponse create(CreateTokenRequest request) { + public BaseClientHttpResponse create(CreateTokenOpts request) { return create(request, null); } - public BaseClientHttpResponse create( - CreateTokenRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse create(CreateTokenOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/connect/tokens") + .addPathSegments("v1/connect") + .addPathSegment(clientOptions.projectId()) + .addPathSegments("tokens") .build(); RequestBody body; try { @@ -90,7 +91,9 @@ public BaseClientHttpResponse validate( String ctok, TokensValidateRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("v1/connect/tokens") + .addPathSegments("v1/connect") + .addPathSegment(clientOptions.projectId()) + .addPathSegments("tokens") .addPathSegment(ctok) .addPathSegments("validate"); if (request.getParams().isPresent()) { 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 98801f4..39c90ad 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java @@ -5,7 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; +import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -27,11 +27,11 @@ public RawTokensClient withRawResponse() { return this.rawClient; } - public CreateTokenResponse create(CreateTokenRequest request) { + public CreateTokenResponse create(CreateTokenOpts request) { return this.rawClient.create(request).body(); } - public CreateTokenResponse create(CreateTokenRequest request, RequestOptions requestOptions) { + public CreateTokenResponse create(CreateTokenOpts request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); } diff --git a/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenRequest.java b/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java similarity index 83% rename from src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenRequest.java rename to src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java index 9ec9c19..c781251 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenRequest.java +++ b/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java @@ -20,34 +20,30 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateTokenRequest.Builder.class) -public final class CreateTokenRequest { +@JsonDeserialize(builder = CreateTokenOpts.Builder.class) +public final class CreateTokenOpts { private final Optional> allowedOrigins; private final Optional errorRedirectUri; private final String externalUserId; - private final String projectId; - private final Optional successRedirectUri; private final Optional webhookUri; private final Map additionalProperties; - private CreateTokenRequest( + private CreateTokenOpts( Optional> allowedOrigins, Optional errorRedirectUri, String externalUserId, - String projectId, Optional successRedirectUri, Optional webhookUri, Map additionalProperties) { this.allowedOrigins = allowedOrigins; this.errorRedirectUri = errorRedirectUri; this.externalUserId = externalUserId; - this.projectId = projectId; this.successRedirectUri = successRedirectUri; this.webhookUri = webhookUri; this.additionalProperties = additionalProperties; @@ -77,14 +73,6 @@ public String getExternalUserId() { return externalUserId; } - /** - * @return The ID of the project - */ - @JsonProperty("project_id") - public String getProjectId() { - return projectId; - } - /** * @return URI to redirect to on success */ @@ -104,7 +92,7 @@ public Optional getWebhookUri() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof CreateTokenRequest && equalTo((CreateTokenRequest) other); + return other instanceof CreateTokenOpts && equalTo((CreateTokenOpts) other); } @JsonAnyGetter @@ -112,11 +100,10 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(CreateTokenRequest other) { + private boolean equalTo(CreateTokenOpts other) { return allowedOrigins.equals(other.allowedOrigins) && errorRedirectUri.equals(other.errorRedirectUri) && externalUserId.equals(other.externalUserId) - && projectId.equals(other.projectId) && successRedirectUri.equals(other.successRedirectUri) && webhookUri.equals(other.webhookUri); } @@ -127,7 +114,6 @@ public int hashCode() { this.allowedOrigins, this.errorRedirectUri, this.externalUserId, - this.projectId, this.successRedirectUri, this.webhookUri); } @@ -145,20 +131,13 @@ public interface ExternalUserIdStage { /** *

Your end user ID, for whom you're creating the token

*/ - ProjectIdStage externalUserId(@NotNull String externalUserId); + _FinalStage externalUserId(@NotNull String externalUserId); - Builder from(CreateTokenRequest other); - } - - public interface ProjectIdStage { - /** - *

The ID of the project

- */ - _FinalStage projectId(@NotNull String projectId); + Builder from(CreateTokenOpts other); } public interface _FinalStage { - CreateTokenRequest build(); + CreateTokenOpts build(); /** *

List of allowed origins for CORS

@@ -190,11 +169,9 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, ProjectIdStage, _FinalStage { + public static final class Builder implements ExternalUserIdStage, _FinalStage { private String externalUserId; - private String projectId; - private Optional webhookUri = Optional.empty(); private Optional successRedirectUri = Optional.empty(); @@ -209,11 +186,10 @@ public static final class Builder implements ExternalUserIdStage, ProjectIdStage private Builder() {} @java.lang.Override - public Builder from(CreateTokenRequest other) { + public Builder from(CreateTokenOpts other) { allowedOrigins(other.getAllowedOrigins()); errorRedirectUri(other.getErrorRedirectUri()); externalUserId(other.getExternalUserId()); - projectId(other.getProjectId()); successRedirectUri(other.getSuccessRedirectUri()); webhookUri(other.getWebhookUri()); return this; @@ -226,23 +202,11 @@ public Builder from(CreateTokenRequest other) { */ @java.lang.Override @JsonSetter("external_user_id") - public ProjectIdStage externalUserId(@NotNull String externalUserId) { + public _FinalStage externalUserId(@NotNull String externalUserId) { this.externalUserId = Objects.requireNonNull(externalUserId, "externalUserId must not be null"); return this; } - /** - *

The ID of the project

- *

The ID of the project

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("project_id") - public _FinalStage projectId(@NotNull String projectId) { - this.projectId = Objects.requireNonNull(projectId, "projectId must not be null"); - return this; - } - /** *

Webhook URI for notifications

* @return Reference to {@code this} so that method calls can be chained together. @@ -324,12 +288,11 @@ public _FinalStage allowedOrigins(Optional> allowedOrigins) { } @java.lang.Override - public CreateTokenRequest build() { - return new CreateTokenRequest( + public CreateTokenOpts build() { + return new CreateTokenOpts( allowedOrigins, errorRedirectUri, externalUserId, - projectId, successRedirectUri, webhookUri, additionalProperties); diff --git a/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java b/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java index 212cb99..fa61409 100644 --- a/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java +++ b/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java @@ -24,8 +24,6 @@ public final class ConnectTokenCreateOpts { private final String externalUserId; - private final String projectId; - private final Optional> allowedOrigins; private final Optional errorRedirectUri; @@ -38,14 +36,12 @@ public final class ConnectTokenCreateOpts { private ConnectTokenCreateOpts( String externalUserId, - String projectId, Optional> allowedOrigins, Optional errorRedirectUri, Optional successRedirectUri, Optional webhookUri, Map additionalProperties) { this.externalUserId = externalUserId; - this.projectId = projectId; this.allowedOrigins = allowedOrigins; this.errorRedirectUri = errorRedirectUri; this.successRedirectUri = successRedirectUri; @@ -61,14 +57,6 @@ public String getExternalUserId() { return externalUserId; } - /** - * @return The ID of the project - */ - @JsonProperty("project_id") - public String getProjectId() { - return projectId; - } - /** * @return List of allowed origins for CORS */ @@ -114,7 +102,6 @@ public Map getAdditionalProperties() { private boolean equalTo(ConnectTokenCreateOpts other) { return externalUserId.equals(other.externalUserId) - && projectId.equals(other.projectId) && allowedOrigins.equals(other.allowedOrigins) && errorRedirectUri.equals(other.errorRedirectUri) && successRedirectUri.equals(other.successRedirectUri) @@ -125,7 +112,6 @@ private boolean equalTo(ConnectTokenCreateOpts other) { public int hashCode() { return Objects.hash( this.externalUserId, - this.projectId, this.allowedOrigins, this.errorRedirectUri, this.successRedirectUri, @@ -145,18 +131,11 @@ public interface ExternalUserIdStage { /** *

Your end user ID, for whom you're creating the token

*/ - ProjectIdStage externalUserId(@NotNull String externalUserId); + _FinalStage externalUserId(@NotNull String externalUserId); Builder from(ConnectTokenCreateOpts other); } - public interface ProjectIdStage { - /** - *

The ID of the project

- */ - _FinalStage projectId(@NotNull String projectId); - } - public interface _FinalStage { ConnectTokenCreateOpts build(); @@ -190,11 +169,9 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, ProjectIdStage, _FinalStage { + public static final class Builder implements ExternalUserIdStage, _FinalStage { private String externalUserId; - private String projectId; - private Optional webhookUri = Optional.empty(); private Optional successRedirectUri = Optional.empty(); @@ -211,7 +188,6 @@ private Builder() {} @java.lang.Override public Builder from(ConnectTokenCreateOpts other) { externalUserId(other.getExternalUserId()); - projectId(other.getProjectId()); allowedOrigins(other.getAllowedOrigins()); errorRedirectUri(other.getErrorRedirectUri()); successRedirectUri(other.getSuccessRedirectUri()); @@ -226,23 +202,11 @@ public Builder from(ConnectTokenCreateOpts other) { */ @java.lang.Override @JsonSetter("external_user_id") - public ProjectIdStage externalUserId(@NotNull String externalUserId) { + public _FinalStage externalUserId(@NotNull String externalUserId) { this.externalUserId = Objects.requireNonNull(externalUserId, "externalUserId must not be null"); return this; } - /** - *

The ID of the project

- *

The ID of the project

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("project_id") - public _FinalStage projectId(@NotNull String projectId) { - this.projectId = Objects.requireNonNull(projectId, "projectId must not be null"); - return this; - } - /** *

Webhook URI for notifications

* @return Reference to {@code this} so that method calls can be chained together. @@ -327,7 +291,6 @@ public _FinalStage allowedOrigins(Optional> allowedOrigins) { public ConnectTokenCreateOpts build() { return new ConnectTokenCreateOpts( externalUserId, - projectId, allowedOrigins, errorRedirectUri, successRedirectUri, diff --git a/src/main/java/com/pipedream/api/types/ProxyResponse.java b/src/main/java/com/pipedream/api/types/ProxyResponse.java deleted file mode 100644 index 60a46ab..0000000 --- a/src/main/java/com/pipedream/api/types/ProxyResponse.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyResponse.Builder.class) -public final class ProxyResponse { - private final Optional status; - - private final Optional> headers; - - private final Optional body; - - private final Map additionalProperties; - - private ProxyResponse( - Optional status, - Optional> headers, - Optional body, - Map additionalProperties) { - this.status = status; - this.headers = headers; - this.body = body; - this.additionalProperties = additionalProperties; - } - - /** - * @return HTTP status code - */ - @JsonProperty("status") - public Optional getStatus() { - return status; - } - - /** - * @return Response headers - */ - @JsonProperty("headers") - public Optional> getHeaders() { - return headers; - } - - @JsonProperty("body") - public Optional getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProxyResponse && equalTo((ProxyResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProxyResponse other) { - return status.equals(other.status) && headers.equals(other.headers) && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.status, this.headers, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional status = Optional.empty(); - - private Optional> headers = Optional.empty(); - - private Optional body = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ProxyResponse other) { - status(other.getStatus()); - headers(other.getHeaders()); - body(other.getBody()); - return this; - } - - /** - *

HTTP status code

- */ - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public Builder status(Optional status) { - this.status = status; - return this; - } - - public Builder status(Integer status) { - this.status = Optional.ofNullable(status); - return this; - } - - /** - *

Response headers

- */ - @JsonSetter(value = "headers", nulls = Nulls.SKIP) - public Builder headers(Optional> headers) { - this.headers = headers; - return this; - } - - public Builder headers(Map headers) { - this.headers = Optional.ofNullable(headers); - return this; - } - - @JsonSetter(value = "body", nulls = Nulls.SKIP) - public Builder body(Optional body) { - this.body = body; - return this; - } - - public Builder body(Object body) { - this.body = Optional.ofNullable(body); - return this; - } - - public ProxyResponse build() { - return new ProxyResponse(status, headers, body, additionalProperties); - } - } -}