diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2cba5f8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Java + id: setup-jre + uses: actions/setup-java@v1 + with: + java-version: "11" + architecture: x64 + + - name: Compile + run: ./gradlew compileJava + + test: + needs: [ compile ] + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Java + id: setup-jre + uses: actions/setup-java@v1 + with: + java-version: "11" + architecture: x64 + + - name: Test + run: ./gradlew test + publish: + needs: [ compile, test ] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Java + id: setup-jre + uses: actions/setup-java@v1 + with: + java-version: "11" + architecture: x64 + + - name: Publish to maven + run: | + ./gradlew sonatypeCentralUpload + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + MAVEN_PUBLISH_REGISTRY_URL: "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + MAVEN_SIGNATURE_KID: ${{ secrets.MAVEN_SIGNATURE_KID }} + MAVEN_SIGNATURE_SECRET_KEY: ${{ secrets.MAVEN_SIGNATURE_SECRET_KEY }} + MAVEN_SIGNATURE_PASSWORD: ${{ secrets.MAVEN_SIGNATURE_PASSWORD }} diff --git a/.gitignore b/.gitignore index 524f096..d4199ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,24 @@ -# Compiled class file *.class +.project +.gradle +? +.classpath +.checkstyle +.settings +.node +build -# Log file -*.log +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ +out/ -# BlueJ files -*.ctxt +# Eclipse/IntelliJ APT +generated_src/ +generated_testSrc/ +generated/ -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -replay_pid* +bin +build \ No newline at end of file diff --git a/.gradle/8.14.3/checksums/checksums.lock b/.gradle/8.14.3/checksums/checksums.lock deleted file mode 100644 index 9ceb0c7..0000000 Binary files a/.gradle/8.14.3/checksums/checksums.lock and /dev/null differ diff --git a/.gradle/8.14.3/checksums/md5-checksums.bin b/.gradle/8.14.3/checksums/md5-checksums.bin deleted file mode 100644 index dd1be82..0000000 Binary files a/.gradle/8.14.3/checksums/md5-checksums.bin and /dev/null differ diff --git a/.gradle/8.14.3/checksums/sha1-checksums.bin b/.gradle/8.14.3/checksums/sha1-checksums.bin deleted file mode 100644 index 06a58af..0000000 Binary files a/.gradle/8.14.3/checksums/sha1-checksums.bin and /dev/null differ diff --git a/.gradle/8.14.3/executionHistory/executionHistory.bin b/.gradle/8.14.3/executionHistory/executionHistory.bin deleted file mode 100644 index 263bf28..0000000 Binary files a/.gradle/8.14.3/executionHistory/executionHistory.bin and /dev/null differ diff --git a/.gradle/8.14.3/executionHistory/executionHistory.lock b/.gradle/8.14.3/executionHistory/executionHistory.lock deleted file mode 100644 index f66eeec..0000000 Binary files a/.gradle/8.14.3/executionHistory/executionHistory.lock and /dev/null differ diff --git a/.gradle/8.14.3/fileChanges/last-build.bin b/.gradle/8.14.3/fileChanges/last-build.bin deleted file mode 100644 index f76dd23..0000000 Binary files a/.gradle/8.14.3/fileChanges/last-build.bin and /dev/null differ diff --git a/.gradle/8.14.3/fileHashes/fileHashes.bin b/.gradle/8.14.3/fileHashes/fileHashes.bin deleted file mode 100644 index 82e18eb..0000000 Binary files a/.gradle/8.14.3/fileHashes/fileHashes.bin and /dev/null differ diff --git a/.gradle/8.14.3/fileHashes/fileHashes.lock b/.gradle/8.14.3/fileHashes/fileHashes.lock deleted file mode 100644 index 0c78229..0000000 Binary files a/.gradle/8.14.3/fileHashes/fileHashes.lock and /dev/null differ diff --git a/.gradle/8.14.3/gc.properties b/.gradle/8.14.3/gc.properties deleted file mode 100644 index e69de29..0000000 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock deleted file mode 100644 index 77ff04a..0000000 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and /dev/null differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties deleted file mode 100644 index 72f11b3..0000000 --- a/.gradle/buildOutputCleanup/cache.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Wed Jul 30 23:02:57 UTC 2025 -gradle.version=8.14.3 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin deleted file mode 100644 index d8ba933..0000000 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and /dev/null differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index a3de71a..9d4aea9 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Add the dependency in your `pom.xml` file: com.pipedream pipedream - 0.0.255 + 0.0.256 ``` diff --git a/build.gradle b/build.gradle index 2a09691..def2d8c 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ java { group = 'com.pipedream' -version = '0.0.255' +version = '0.0.256' jar { dependsOn(":generatePomFileForMavenPublication") @@ -79,7 +79,7 @@ publishing { maven(MavenPublication) { groupId = 'com.pipedream' artifactId = 'pipedream' - version = '0.0.255' + version = '0.0.256' from components.java pom { name = 'pipedream' diff --git a/build/reports/problems/problems-report.html b/build/reports/problems/problems-report.html deleted file mode 100644 index bea792b..0000000 --- a/build/reports/problems/problems-report.html +++ /dev/null @@ -1,663 +0,0 @@ - - - - - - - - - - - - - Gradle Configuration Cache - - - -
- -
- Loading... -
- - - - - - diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClient.java deleted file mode 100644 index 39ecdab..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClient.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.Suppliers; -import com.pipedream.api.resources.accounts.AsyncAccountsClient; -import com.pipedream.api.resources.actions.AsyncActionsClient; -import com.pipedream.api.resources.appcategories.AsyncAppCategoriesClient; -import com.pipedream.api.resources.apps.AsyncAppsClient; -import com.pipedream.api.resources.components.AsyncComponentsClient; -import com.pipedream.api.resources.deployedtriggers.AsyncDeployedTriggersClient; -import com.pipedream.api.resources.oauthtokens.AsyncOauthTokensClient; -import com.pipedream.api.resources.projects.AsyncProjectsClient; -import com.pipedream.api.resources.proxy.AsyncProxyClient; -import com.pipedream.api.resources.tokens.AsyncTokensClient; -import com.pipedream.api.resources.triggers.AsyncTriggersClient; -import com.pipedream.api.resources.users.AsyncUsersClient; -import java.util.function.Supplier; - -public class AsyncBaseClient { - protected final ClientOptions clientOptions; - - protected final Supplier appCategoriesClient; - - protected final Supplier appsClient; - - protected final Supplier accountsClient; - - protected final Supplier usersClient; - - protected final Supplier componentsClient; - - protected final Supplier actionsClient; - - protected final Supplier triggersClient; - - protected final Supplier deployedTriggersClient; - - protected final Supplier projectsClient; - - protected final Supplier proxyClient; - - protected final Supplier tokensClient; - - protected final Supplier oauthTokensClient; - - public AsyncBaseClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.appCategoriesClient = Suppliers.memoize(() -> new AsyncAppCategoriesClient(clientOptions)); - this.appsClient = Suppliers.memoize(() -> new AsyncAppsClient(clientOptions)); - this.accountsClient = Suppliers.memoize(() -> new AsyncAccountsClient(clientOptions)); - this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); - this.componentsClient = Suppliers.memoize(() -> new AsyncComponentsClient(clientOptions)); - this.actionsClient = Suppliers.memoize(() -> new AsyncActionsClient(clientOptions)); - this.triggersClient = Suppliers.memoize(() -> new AsyncTriggersClient(clientOptions)); - this.deployedTriggersClient = Suppliers.memoize(() -> new AsyncDeployedTriggersClient(clientOptions)); - this.projectsClient = Suppliers.memoize(() -> new AsyncProjectsClient(clientOptions)); - this.proxyClient = Suppliers.memoize(() -> new AsyncProxyClient(clientOptions)); - this.tokensClient = Suppliers.memoize(() -> new AsyncTokensClient(clientOptions)); - this.oauthTokensClient = Suppliers.memoize(() -> new AsyncOauthTokensClient(clientOptions)); - } - - public AsyncAppCategoriesClient appCategories() { - return this.appCategoriesClient.get(); - } - - public AsyncAppsClient apps() { - return this.appsClient.get(); - } - - public AsyncAccountsClient accounts() { - return this.accountsClient.get(); - } - - public AsyncUsersClient users() { - return this.usersClient.get(); - } - - public AsyncComponentsClient components() { - return this.componentsClient.get(); - } - - public AsyncActionsClient actions() { - return this.actionsClient.get(); - } - - public AsyncTriggersClient triggers() { - return this.triggersClient.get(); - } - - public AsyncDeployedTriggersClient deployedTriggers() { - return this.deployedTriggersClient.get(); - } - - public AsyncProjectsClient projects() { - return this.projectsClient.get(); - } - - public AsyncProxyClient proxy() { - return this.proxyClient.get(); - } - - public AsyncTokensClient tokens() { - return this.tokensClient.get(); - } - - public AsyncOauthTokensClient oauthTokens() { - return this.oauthTokensClient.get(); - } - - public static AsyncBaseClientBuilder builder() { - return new AsyncBaseClientBuilder(); - } -} 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 deleted file mode 100644 index 9361d1d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java +++ /dev/null @@ -1,246 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api; - -import com.pipedream.api.core.ClientOptions; -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 Optional timeout = Optional.empty(); - - private Optional maxRetries = Optional.empty(); - - private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); - - private String clientSecret = System.getenv("PIPEDREAM_CLIENT_SECRET"); - - private String projectEnvironment = null; - - private Environment environment = Environment.PROD; - - private OkHttpClient httpClient; - - /** - * Sets clientId. - * Defaults to the PIPEDREAM_CLIENT_ID environment variable. - */ - public AsyncBaseClientBuilder clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Sets clientSecret. - * Defaults to the PIPEDREAM_CLIENT_SECRET environment variable. - */ - public AsyncBaseClientBuilder clientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Sets projectEnvironment - */ - public AsyncBaseClientBuilder projectEnvironment(String projectEnvironment) { - this.projectEnvironment = projectEnvironment; - return this; - } - - public AsyncBaseClientBuilder environment(Environment environment) { - this.environment = environment; - return this; - } - - public AsyncBaseClientBuilder url(String url) { - this.environment = Environment.custom(url); - return this; - } - - /** - * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. - */ - public AsyncBaseClientBuilder timeout(int timeout) { - this.timeout = Optional.of(timeout); - return this; - } - - /** - * Sets the maximum number of retries for the client. Defaults to 2 retries. - */ - public AsyncBaseClientBuilder maxRetries(int maxRetries) { - this.maxRetries = Optional.of(maxRetries); - return this; - } - - /** - * Sets the underlying OkHttp client - */ - public AsyncBaseClientBuilder httpClient(OkHttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - public AsyncBaseClientBuilder projectId(String projectId) { - clientOptionsBuilder.projectId(projectId); - return this; - } - - protected ClientOptions buildClientOptions() { - ClientOptions.Builder builder = ClientOptions.builder(); - setEnvironment(builder); - setAuthentication(builder); - setCustomHeaders(builder); - setVariables(builder); - setHttpClient(builder); - setTimeouts(builder); - setRetries(builder); - setAdditional(builder); - return builder.build(); - } - - /** - * 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/BaseClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClient.java deleted file mode 100644 index 69e5677..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClient.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.Suppliers; -import com.pipedream.api.resources.accounts.AccountsClient; -import com.pipedream.api.resources.actions.ActionsClient; -import com.pipedream.api.resources.appcategories.AppCategoriesClient; -import com.pipedream.api.resources.apps.AppsClient; -import com.pipedream.api.resources.components.ComponentsClient; -import com.pipedream.api.resources.deployedtriggers.DeployedTriggersClient; -import com.pipedream.api.resources.oauthtokens.OauthTokensClient; -import com.pipedream.api.resources.projects.ProjectsClient; -import com.pipedream.api.resources.proxy.ProxyClient; -import com.pipedream.api.resources.tokens.TokensClient; -import com.pipedream.api.resources.triggers.TriggersClient; -import com.pipedream.api.resources.users.UsersClient; -import java.util.function.Supplier; - -public class BaseClient { - protected final ClientOptions clientOptions; - - protected final Supplier appCategoriesClient; - - protected final Supplier appsClient; - - protected final Supplier accountsClient; - - protected final Supplier usersClient; - - protected final Supplier componentsClient; - - protected final Supplier actionsClient; - - protected final Supplier triggersClient; - - protected final Supplier deployedTriggersClient; - - protected final Supplier projectsClient; - - protected final Supplier proxyClient; - - protected final Supplier tokensClient; - - protected final Supplier oauthTokensClient; - - public BaseClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.appCategoriesClient = Suppliers.memoize(() -> new AppCategoriesClient(clientOptions)); - this.appsClient = Suppliers.memoize(() -> new AppsClient(clientOptions)); - this.accountsClient = Suppliers.memoize(() -> new AccountsClient(clientOptions)); - this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); - this.componentsClient = Suppliers.memoize(() -> new ComponentsClient(clientOptions)); - this.actionsClient = Suppliers.memoize(() -> new ActionsClient(clientOptions)); - this.triggersClient = Suppliers.memoize(() -> new TriggersClient(clientOptions)); - this.deployedTriggersClient = Suppliers.memoize(() -> new DeployedTriggersClient(clientOptions)); - this.projectsClient = Suppliers.memoize(() -> new ProjectsClient(clientOptions)); - this.proxyClient = Suppliers.memoize(() -> new ProxyClient(clientOptions)); - this.tokensClient = Suppliers.memoize(() -> new TokensClient(clientOptions)); - this.oauthTokensClient = Suppliers.memoize(() -> new OauthTokensClient(clientOptions)); - } - - public AppCategoriesClient appCategories() { - return this.appCategoriesClient.get(); - } - - public AppsClient apps() { - return this.appsClient.get(); - } - - public AccountsClient accounts() { - return this.accountsClient.get(); - } - - public UsersClient users() { - return this.usersClient.get(); - } - - public ComponentsClient components() { - return this.componentsClient.get(); - } - - public ActionsClient actions() { - return this.actionsClient.get(); - } - - public TriggersClient triggers() { - return this.triggersClient.get(); - } - - public DeployedTriggersClient deployedTriggers() { - return this.deployedTriggersClient.get(); - } - - public ProjectsClient projects() { - return this.projectsClient.get(); - } - - public ProxyClient proxy() { - return this.proxyClient.get(); - } - - public TokensClient tokens() { - return this.tokensClient.get(); - } - - public OauthTokensClient oauthTokens() { - return this.oauthTokensClient.get(); - } - - public static BaseClientBuilder builder() { - return new BaseClientBuilder(); - } -} 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 deleted file mode 100644 index 13318cd..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java +++ /dev/null @@ -1,246 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api; - -import com.pipedream.api.core.ClientOptions; -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 Optional timeout = Optional.empty(); - - private Optional maxRetries = Optional.empty(); - - private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); - - private String clientSecret = System.getenv("PIPEDREAM_CLIENT_SECRET"); - - private String projectEnvironment = null; - - private Environment environment = Environment.PROD; - - private OkHttpClient httpClient; - - /** - * Sets clientId. - * Defaults to the PIPEDREAM_CLIENT_ID environment variable. - */ - public BaseClientBuilder clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Sets clientSecret. - * Defaults to the PIPEDREAM_CLIENT_SECRET environment variable. - */ - public BaseClientBuilder clientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Sets projectEnvironment - */ - public BaseClientBuilder projectEnvironment(String projectEnvironment) { - this.projectEnvironment = projectEnvironment; - return this; - } - - public BaseClientBuilder environment(Environment environment) { - this.environment = environment; - return this; - } - - public BaseClientBuilder url(String url) { - this.environment = Environment.custom(url); - return this; - } - - /** - * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. - */ - public BaseClientBuilder timeout(int timeout) { - this.timeout = Optional.of(timeout); - return this; - } - - /** - * Sets the maximum number of retries for the client. Defaults to 2 retries. - */ - public BaseClientBuilder maxRetries(int maxRetries) { - this.maxRetries = Optional.of(maxRetries); - return this; - } - - /** - * Sets the underlying OkHttp client - */ - public BaseClientBuilder httpClient(OkHttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - public BaseClientBuilder projectId(String projectId) { - clientOptionsBuilder.projectId(projectId); - return this; - } - - protected ClientOptions buildClientOptions() { - ClientOptions.Builder builder = ClientOptions.builder(); - setEnvironment(builder); - setAuthentication(builder); - setCustomHeaders(builder); - setVariables(builder); - setHttpClient(builder); - setTimeouts(builder); - setRetries(builder); - setAdditional(builder); - return builder.build(); - } - - /** - * 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/BaseClientApiException.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientApiException.java deleted file mode 100644 index a2680b0..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientApiException.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import okhttp3.Response; - -/** - * This exception type will be thrown for any non-2XX API responses. - */ -public class BaseClientApiException extends BaseClientException { - /** - * The error code of the response that triggered the exception. - */ - private final int statusCode; - - /** - * The body of the response that triggered the exception. - */ - private final Object body; - - private final Map> headers; - - public BaseClientApiException(String message, int statusCode, Object body) { - super(message); - this.statusCode = statusCode; - this.body = body; - this.headers = new HashMap<>(); - } - - public BaseClientApiException(String message, int statusCode, Object body, Response rawResponse) { - super(message); - this.statusCode = statusCode; - this.body = body; - this.headers = new HashMap<>(); - rawResponse.headers().forEach(header -> { - String key = header.component1(); - String value = header.component2(); - this.headers.computeIfAbsent(key, _str -> new ArrayList<>()).add(value); - }); - } - - /** - * @return the statusCode - */ - public int statusCode() { - return this.statusCode; - } - - /** - * @return the body - */ - public Object body() { - return this.body; - } - - /** - * @return the headers - */ - public Map> headers() { - return this.headers; - } - - @java.lang.Override - public String toString() { - return "BaseClientApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " - + body + "}"; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientException.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientException.java deleted file mode 100644 index e034e68..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientException.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -/** - * This class serves as the base exception for all errors in the SDK. - */ -public class BaseClientException extends RuntimeException { - public BaseClientException(String message) { - super(message); - } - - public BaseClientException(String message, Exception e) { - super(message, e); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java deleted file mode 100644 index 68376ae..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import okhttp3.Response; - -public final class BaseClientHttpResponse { - - private final T body; - - private final Map> headers; - - public BaseClientHttpResponse(T body, Response rawResponse) { - this.body = body; - - Map> headers = new HashMap<>(); - rawResponse.headers().forEach(header -> { - String key = header.component1(); - String value = header.component2(); - headers.computeIfAbsent(key, _str -> new ArrayList<>()).add(value); - }); - this.headers = headers; - } - - public T body() { - return this.body; - } - - public Map> headers() { - return headers; - } -} 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 deleted file mode 100644 index bd94c5e..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java +++ /dev/null @@ -1,198 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; -import okhttp3.OkHttpClient; - -public final class ClientOptions { - private final Environment environment; - - private final Map headers; - - private final Map> headerSuppliers; - - private final OkHttpClient httpClient; - - private final int timeout; - - private String projectId; - - private ClientOptions( - Environment environment, - Map headers, - Map> headerSuppliers, - OkHttpClient httpClient, - int timeout, - String projectId) { - this.environment = environment; - this.headers = new HashMap<>(); - this.headers.putAll(headers); - this.headers.putAll(new HashMap() { - { - put("X-Fern-Language", "JAVA"); - put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk"); - put("X-Fern-SDK-Version", "0.0.255"); - } - }); - this.headerSuppliers = headerSuppliers; - this.httpClient = httpClient; - this.timeout = timeout; - this.projectId = projectId; - } - - public Environment environment() { - return this.environment; - } - - public Map headers(RequestOptions requestOptions) { - Map values = new HashMap<>(this.headers); - headerSuppliers.forEach((key, supplier) -> { - values.put(key, supplier.get()); - }); - if (requestOptions != null) { - values.putAll(requestOptions.getHeaders()); - } - return values; - } - - public int timeout(RequestOptions requestOptions) { - if (requestOptions == null) { - return this.timeout; - } - return requestOptions.getTimeout().orElse(this.timeout); - } - - public OkHttpClient httpClient() { - return this.httpClient; - } - - public OkHttpClient httpClientWithTimeout(RequestOptions requestOptions) { - if (requestOptions == null) { - return this.httpClient; - } - return this.httpClient - .newBuilder() - .callTimeout(requestOptions.getTimeout().get(), requestOptions.getTimeoutTimeUnit()) - .connectTimeout(0, TimeUnit.SECONDS) - .writeTimeout(0, TimeUnit.SECONDS) - .readTimeout(0, TimeUnit.SECONDS) - .build(); - } - - public String projectId() { - return this.projectId; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Environment environment; - - private final Map headers = new HashMap<>(); - - private final Map> headerSuppliers = new HashMap<>(); - - private int maxRetries = 2; - - private Optional timeout = Optional.empty(); - - private OkHttpClient httpClient = null; - - private String projectId; - - public Builder environment(Environment environment) { - this.environment = environment; - return this; - } - - public Builder addHeader(String key, String value) { - this.headers.put(key, value); - return this; - } - - public Builder addHeader(String key, Supplier value) { - this.headerSuppliers.put(key, value); - return this; - } - - /** - * Override the timeout in seconds. Defaults to 60 seconds. - */ - public Builder timeout(int timeout) { - this.timeout = Optional.of(timeout); - return this; - } - - /** - * Override the timeout in seconds. Defaults to 60 seconds. - */ - public Builder timeout(Optional timeout) { - this.timeout = timeout; - return this; - } - - /** - * Override the maximum number of retries. Defaults to 2 retries. - */ - public Builder maxRetries(int maxRetries) { - this.maxRetries = maxRetries; - return this; - } - - public Builder httpClient(OkHttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - public Builder projectId(String projectId) { - this.projectId = projectId; - return this; - } - - public ClientOptions build() { - OkHttpClient.Builder httpClientBuilder = - this.httpClient != null ? this.httpClient.newBuilder() : new OkHttpClient.Builder(); - - if (this.httpClient != null) { - timeout.ifPresent(timeout -> httpClientBuilder - .callTimeout(timeout, TimeUnit.SECONDS) - .connectTimeout(0, TimeUnit.SECONDS) - .writeTimeout(0, TimeUnit.SECONDS) - .readTimeout(0, TimeUnit.SECONDS)); - } else { - httpClientBuilder - .callTimeout(this.timeout.orElse(60), TimeUnit.SECONDS) - .connectTimeout(0, TimeUnit.SECONDS) - .writeTimeout(0, TimeUnit.SECONDS) - .readTimeout(0, TimeUnit.SECONDS) - .addInterceptor(new RetryInterceptor(this.maxRetries)); - } - - this.httpClient = httpClientBuilder.build(); - this.timeout = Optional.of(httpClient.callTimeoutMillis() / 1000); - - return new ClientOptions( - environment, headers, headerSuppliers, httpClient, this.timeout.get(), this.projectId); - } - - /** - * Create a new Builder initialized with values from an existing ClientOptions - */ - public static Builder from(ClientOptions clientOptions) { - Builder builder = new Builder(); - builder.environment = clientOptions.environment(); - builder.timeout = Optional.of(clientOptions.timeout(null)); - builder.httpClient = clientOptions.httpClient(); - builder.projectId = clientOptions.projectId(); - return builder; - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/DateTimeDeserializer.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/DateTimeDeserializer.java deleted file mode 100644 index e9083a3..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/DateTimeDeserializer.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.module.SimpleModule; -import java.io.IOException; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQueries; - -/** - * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects. - */ -class DateTimeDeserializer extends JsonDeserializer { - private static final SimpleModule MODULE; - - static { - MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer()); - } - - /** - * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper. - * - * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. - */ - public static SimpleModule getModule() { - return MODULE; - } - - @Override - public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { - JsonToken token = parser.currentToken(); - if (token == JsonToken.VALUE_NUMBER_INT) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC); - } else { - TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest( - parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from); - - if (temporal.query(TemporalQueries.offset()) == null) { - return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC); - } else { - return OffsetDateTime.from(temporal); - } - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Environment.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Environment.java deleted file mode 100644 index def399b..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Environment.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -public final class Environment { - public static final Environment CANARY = new Environment("https://api2.pipedream.com"); - - public static final Environment DEV = new Environment("https://api.${DEV_NAMESPACE}.gkes.pipedream.net"); - - public static final Environment PROD = new Environment("https://api.pipedream.com"); - - private final String url; - - private Environment(String url) { - this.url = url; - } - - public String getUrl() { - return this.url; - } - - public static Environment custom(String url) { - return new Environment(url); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/FileStream.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/FileStream.java deleted file mode 100644 index d5500e2..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/FileStream.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.io.InputStream; -import java.util.Objects; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import org.jetbrains.annotations.Nullable; - -/** - * Represents a file stream with associated metadata for file uploads. - */ -public class FileStream { - private final InputStream inputStream; - private final String fileName; - private final MediaType contentType; - - /** - * Constructs a FileStream with the given input stream and optional metadata. - * - * @param inputStream The input stream of the file content. Must not be null. - * @param fileName The name of the file, or null if unknown. - * @param contentType The MIME type of the file content, or null if unknown. - * @throws NullPointerException if inputStream is null - */ - public FileStream(InputStream inputStream, @Nullable String fileName, @Nullable MediaType contentType) { - this.inputStream = Objects.requireNonNull(inputStream, "Input stream cannot be null"); - this.fileName = fileName; - this.contentType = contentType; - } - - public FileStream(InputStream inputStream) { - this(inputStream, null, null); - } - - public InputStream getInputStream() { - return inputStream; - } - - @Nullable - public String getFileName() { - return fileName; - } - - @Nullable - public MediaType getContentType() { - return contentType; - } - - /** - * Creates a RequestBody suitable for use with OkHttp client. - * - * @return A RequestBody instance representing this file stream. - */ - public RequestBody toRequestBody() { - return new InputStreamRequestBody(contentType, inputStream); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/InputStreamRequestBody.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/InputStreamRequestBody.java deleted file mode 100644 index 82c8f4f..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/InputStreamRequestBody.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Objects; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import okio.BufferedSink; -import okio.Okio; -import okio.Source; -import org.jetbrains.annotations.Nullable; - -/** - * A custom implementation of OkHttp's RequestBody that wraps an InputStream. - * This class allows streaming of data from an InputStream directly to an HTTP request body, - * which is useful for file uploads or sending large amounts of data without loading it all into memory. - */ -public class InputStreamRequestBody extends RequestBody { - private final InputStream inputStream; - private final MediaType contentType; - - /** - * Constructs an InputStreamRequestBody with the specified content type and input stream. - * - * @param contentType the MediaType of the content, or null if not known - * @param inputStream the InputStream containing the data to be sent - * @throws NullPointerException if inputStream is null - */ - public InputStreamRequestBody(@Nullable MediaType contentType, InputStream inputStream) { - this.contentType = contentType; - this.inputStream = Objects.requireNonNull(inputStream, "inputStream == null"); - } - - /** - * Returns the content type of this request body. - * - * @return the MediaType of the content, or null if not specified - */ - @Nullable - @Override - public MediaType contentType() { - return contentType; - } - - /** - * Returns the content length of this request body, if known. - * This method attempts to determine the length using the InputStream's available() method, - * which may not always accurately reflect the total length of the stream. - * - * @return the content length, or -1 if the length is unknown - * @throws IOException if an I/O error occurs - */ - @Override - public long contentLength() throws IOException { - return inputStream.available() == 0 ? -1 : inputStream.available(); - } - - /** - * Writes the content of the InputStream to the given BufferedSink. - * This method is responsible for transferring the data from the InputStream to the network request. - * - * @param sink the BufferedSink to write the content to - * @throws IOException if an I/O error occurs during writing - */ - @Override - public void writeTo(BufferedSink sink) throws IOException { - try (Source source = Okio.source(inputStream)) { - sink.writeAll(source); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/MediaTypes.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/MediaTypes.java deleted file mode 100644 index 6b6288f..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/MediaTypes.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import okhttp3.MediaType; - -public final class MediaTypes { - - public static final MediaType APPLICATION_JSON = MediaType.parse("application/json"); - - private MediaTypes() {} -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Nullable.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Nullable.java deleted file mode 100644 index 2b6af74..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Nullable.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.util.Optional; -import java.util.function.Function; - -public final class Nullable { - - private final Either, Null> value; - - private Nullable() { - this.value = Either.left(Optional.empty()); - } - - private Nullable(T value) { - if (value == null) { - this.value = Either.right(Null.INSTANCE); - } else { - this.value = Either.left(Optional.of(value)); - } - } - - public static Nullable ofNull() { - return new Nullable<>(null); - } - - public static Nullable of(T value) { - return new Nullable<>(value); - } - - public static Nullable empty() { - return new Nullable<>(); - } - - public static Nullable ofOptional(Optional value) { - if (value.isPresent()) { - return of(value.get()); - } else { - return empty(); - } - } - - public boolean isNull() { - return this.value.isRight(); - } - - public boolean isEmpty() { - return this.value.isLeft() && !this.value.getLeft().isPresent(); - } - - public T get() { - if (this.isNull()) { - return null; - } - - return this.value.getLeft().get(); - } - - public Nullable map(Function mapper) { - if (this.isNull()) { - return Nullable.ofNull(); - } - - return Nullable.ofOptional(this.value.getLeft().map(mapper)); - } - - @Override - public boolean equals(Object other) { - if (!(other instanceof Nullable)) { - return false; - } - - if (((Nullable) other).isNull() && this.isNull()) { - return true; - } - - return this.value.getLeft().equals(((Nullable) other).value.getLeft()); - } - - private static final class Either { - private L left = null; - private R right = null; - - private Either(L left, R right) { - if (left != null && right != null) { - throw new IllegalArgumentException("Left and right argument cannot both be non-null."); - } - - if (left == null && right == null) { - throw new IllegalArgumentException("Left and right argument cannot both be null."); - } - - if (left != null) { - this.left = left; - } - - if (right != null) { - this.right = right; - } - } - - public static Either left(L left) { - return new Either<>(left, null); - } - - public static Either right(R right) { - return new Either<>(null, right); - } - - public boolean isLeft() { - return this.left != null; - } - - public boolean isRight() { - return this.right != null; - } - - public L getLeft() { - if (!this.isLeft()) { - throw new IllegalArgumentException("Cannot get left from right Either."); - } - return this.left; - } - - public R getRight() { - if (!this.isRight()) { - throw new IllegalArgumentException("Cannot get right from left Either."); - } - return this.right; - } - } - - private static final class Null { - private static final Null INSTANCE = new Null(); - - private Null() {} - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/NullableNonemptyFilter.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/NullableNonemptyFilter.java deleted file mode 100644 index afad6eb..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/NullableNonemptyFilter.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.util.Optional; - -public final class NullableNonemptyFilter { - @Override - public boolean equals(Object o) { - boolean isOptionalEmpty = isOptionalEmpty(o); - - return isOptionalEmpty; - } - - private boolean isOptionalEmpty(Object o) { - return o instanceof Optional && !((Optional) o).isPresent(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/OAuthTokenSupplier.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/OAuthTokenSupplier.java deleted file mode 100644 index ddbde79..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/OAuthTokenSupplier.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import com.pipedream.api.resources.oauthtokens.OauthTokensClient; -import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; -import com.pipedream.api.types.CreateOAuthTokenResponse; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.function.Supplier; - -public final class OAuthTokenSupplier implements Supplier { - private static final long BUFFER_IN_MINUTES = 2; - - private final String clientId; - - private final String clientSecret; - - private final OauthTokensClient authClient; - - private String accessToken; - - private Instant expiresAt; - - public OAuthTokenSupplier(String clientId, String clientSecret, OauthTokensClient authClient) { - this.clientId = clientId; - this.clientSecret = clientSecret; - this.authClient = authClient; - this.expiresAt = Instant.now(); - } - - public CreateOAuthTokenResponse fetchToken() { - CreateOAuthTokenOpts getTokenRequest = CreateOAuthTokenOpts.builder() - .clientId(clientId) - .clientSecret(clientSecret) - .build(); - return authClient.create(getTokenRequest); - } - - @java.lang.Override - public String get() { - if (accessToken == null || expiresAt.isBefore(Instant.now())) { - CreateOAuthTokenResponse authResponse = fetchToken(); - this.accessToken = authResponse.getAccessToken(); - this.expiresAt = getExpiresAt(authResponse.getExpiresIn()); - } - return "Bearer " + accessToken; - } - - private Instant getExpiresAt(long expiresInSeconds) { - return Instant.now().plus(expiresInSeconds, ChronoUnit.SECONDS).minus(BUFFER_IN_MINUTES, ChronoUnit.MINUTES); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ObjectMappers.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ObjectMappers.java deleted file mode 100644 index 6dd6c3c..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ObjectMappers.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import java.io.IOException; - -public final class ObjectMappers { - public static final ObjectMapper JSON_MAPPER = JsonMapper.builder() - .addModule(new Jdk8Module()) - .addModule(new JavaTimeModule()) - .addModule(DateTimeDeserializer.getModule()) - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .build(); - - private ObjectMappers() {} - - public static String stringify(Object o) { - try { - return JSON_MAPPER - .setSerializationInclusion(JsonInclude.Include.ALWAYS) - .writerWithDefaultPrettyPrinter() - .writeValueAsString(o); - } catch (IOException e) { - return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/QueryStringMapper.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/QueryStringMapper.java deleted file mode 100644 index 70723d0..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/QueryStringMapper.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import okhttp3.HttpUrl; -import okhttp3.MultipartBody; - -public class QueryStringMapper { - - private static final ObjectMapper MAPPER = ObjectMappers.JSON_MAPPER; - - public static void addQueryParameter(HttpUrl.Builder httpUrl, String key, Object value, boolean arraysAsRepeats) { - JsonNode valueNode = MAPPER.valueToTree(value); - - List> flat; - if (valueNode.isObject()) { - flat = flattenObject((ObjectNode) valueNode, arraysAsRepeats); - } else if (valueNode.isArray()) { - flat = flattenArray((ArrayNode) valueNode, "", arraysAsRepeats); - } else { - if (valueNode.isTextual()) { - httpUrl.addQueryParameter(key, valueNode.textValue()); - } else { - httpUrl.addQueryParameter(key, valueNode.toString()); - } - return; - } - - for (Map.Entry field : flat) { - if (field.getValue().isTextual()) { - httpUrl.addQueryParameter(key + field.getKey(), field.getValue().textValue()); - } else { - httpUrl.addQueryParameter(key + field.getKey(), field.getValue().toString()); - } - } - } - - public static void addFormDataPart( - MultipartBody.Builder multipartBody, String key, Object value, boolean arraysAsRepeats) { - JsonNode valueNode = MAPPER.valueToTree(value); - - List> flat; - if (valueNode.isObject()) { - flat = flattenObject((ObjectNode) valueNode, arraysAsRepeats); - } else if (valueNode.isArray()) { - flat = flattenArray((ArrayNode) valueNode, "", arraysAsRepeats); - } else { - if (valueNode.isTextual()) { - multipartBody.addFormDataPart(key, valueNode.textValue()); - } else { - multipartBody.addFormDataPart(key, valueNode.toString()); - } - return; - } - - for (Map.Entry field : flat) { - if (field.getValue().isTextual()) { - multipartBody.addFormDataPart( - key + field.getKey(), field.getValue().textValue()); - } else { - multipartBody.addFormDataPart( - key + field.getKey(), field.getValue().toString()); - } - } - } - - public static List> flattenObject(ObjectNode object, boolean arraysAsRepeats) { - List> flat = new ArrayList<>(); - - Iterator> fields = object.fields(); - while (fields.hasNext()) { - Map.Entry field = fields.next(); - - String key = "[" + field.getKey() + "]"; - - if (field.getValue().isObject()) { - List> flatField = - flattenObject((ObjectNode) field.getValue(), arraysAsRepeats); - addAll(flat, flatField, key); - } else if (field.getValue().isArray()) { - List> flatField = - flattenArray((ArrayNode) field.getValue(), key, arraysAsRepeats); - addAll(flat, flatField, ""); - } else { - flat.add(new AbstractMap.SimpleEntry<>(key, field.getValue())); - } - } - - return flat; - } - - private static List> flattenArray( - ArrayNode array, String key, boolean arraysAsRepeats) { - List> flat = new ArrayList<>(); - - Iterator elements = array.elements(); - - int index = 0; - while (elements.hasNext()) { - JsonNode element = elements.next(); - - String indexKey = key + "[" + index + "]"; - - if (arraysAsRepeats) { - indexKey = key; - } - - if (element.isObject()) { - List> flatField = flattenObject((ObjectNode) element, arraysAsRepeats); - addAll(flat, flatField, indexKey); - } else if (element.isArray()) { - List> flatField = flattenArray((ArrayNode) element, "", arraysAsRepeats); - addAll(flat, flatField, indexKey); - } else { - flat.add(new AbstractMap.SimpleEntry<>(indexKey, element)); - } - - index++; - } - - return flat; - } - - private static void addAll( - List> target, List> source, String prefix) { - for (Map.Entry entry : source) { - Map.Entry entryToAdd = - new AbstractMap.SimpleEntry<>(prefix + entry.getKey(), entry.getValue()); - target.add(entryToAdd); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/RequestOptions.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/RequestOptions.java deleted file mode 100644 index e3419b4..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/RequestOptions.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; - -public final class RequestOptions { - private final String projectEnvironment; - - private final Optional timeout; - - private final TimeUnit timeoutTimeUnit; - - private final Map headers; - - private final Map> headerSuppliers; - - private RequestOptions( - String projectEnvironment, - Optional timeout, - TimeUnit timeoutTimeUnit, - Map headers, - Map> headerSuppliers) { - this.projectEnvironment = projectEnvironment; - this.timeout = timeout; - this.timeoutTimeUnit = timeoutTimeUnit; - this.headers = headers; - this.headerSuppliers = headerSuppliers; - } - - public Optional getTimeout() { - return timeout; - } - - public TimeUnit getTimeoutTimeUnit() { - return timeoutTimeUnit; - } - - public Map getHeaders() { - Map headers = new HashMap<>(); - if (this.projectEnvironment != null) { - headers.put("x-pd-environment", this.projectEnvironment); - } - headers.putAll(this.headers); - this.headerSuppliers.forEach((key, supplier) -> { - headers.put(key, supplier.get()); - }); - return headers; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String projectEnvironment = null; - - private Optional timeout = Optional.empty(); - - private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS; - - private final Map headers = new HashMap<>(); - - private final Map> headerSuppliers = new HashMap<>(); - - public Builder projectEnvironment(String projectEnvironment) { - this.projectEnvironment = projectEnvironment; - return this; - } - - public Builder timeout(Integer timeout) { - this.timeout = Optional.of(timeout); - return this; - } - - public Builder timeout(Integer timeout, TimeUnit timeoutTimeUnit) { - this.timeout = Optional.of(timeout); - this.timeoutTimeUnit = timeoutTimeUnit; - return this; - } - - public Builder addHeader(String key, String value) { - this.headers.put(key, value); - return this; - } - - public Builder addHeader(String key, Supplier value) { - this.headerSuppliers.put(key, value); - return this; - } - - public RequestOptions build() { - return new RequestOptions(projectEnvironment, timeout, timeoutTimeUnit, headers, headerSuppliers); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ResponseBodyInputStream.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ResponseBodyInputStream.java deleted file mode 100644 index 56b0fb5..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ResponseBodyInputStream.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.io.FilterInputStream; -import java.io.IOException; -import okhttp3.Response; - -/** - * A custom InputStream that wraps the InputStream from the OkHttp Response and ensures that the - * OkHttp Response object is properly closed when the stream is closed. - * - * This class extends FilterInputStream and takes an OkHttp Response object as a parameter. - * It retrieves the InputStream from the Response and overrides the close method to close - * both the InputStream and the Response object, ensuring proper resource management and preventing - * premature closure of the underlying HTTP connection. - */ -public class ResponseBodyInputStream extends FilterInputStream { - private final Response response; - - /** - * Constructs a ResponseBodyInputStream that wraps the InputStream from the given OkHttp - * Response object. - * - * @param response the OkHttp Response object from which the InputStream is retrieved - * @throws IOException if an I/O error occurs while retrieving the InputStream - */ - public ResponseBodyInputStream(Response response) throws IOException { - super(response.body().byteStream()); - this.response = response; - } - - /** - * Closes the InputStream and the associated OkHttp Response object. This ensures that the - * underlying HTTP connection is properly closed after the stream is no longer needed. - * - * @throws IOException if an I/O error occurs - */ - @Override - public void close() throws IOException { - super.close(); - response.close(); // Ensure the response is closed when the stream is closed - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ResponseBodyReader.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ResponseBodyReader.java deleted file mode 100644 index 54dff9f..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ResponseBodyReader.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.io.FilterReader; -import java.io.IOException; -import okhttp3.Response; - -/** - * A custom Reader that wraps the Reader from the OkHttp Response and ensures that the - * OkHttp Response object is properly closed when the reader is closed. - * - * This class extends FilterReader and takes an OkHttp Response object as a parameter. - * It retrieves the Reader from the Response and overrides the close method to close - * both the Reader and the Response object, ensuring proper resource management and preventing - * premature closure of the underlying HTTP connection. - */ -public class ResponseBodyReader extends FilterReader { - private final Response response; - - /** - * Constructs a ResponseBodyReader that wraps the Reader from the given OkHttp Response object. - * - * @param response the OkHttp Response object from which the Reader is retrieved - * @throws IOException if an I/O error occurs while retrieving the Reader - */ - public ResponseBodyReader(Response response) throws IOException { - super(response.body().charStream()); - this.response = response; - } - - /** - * Closes the Reader and the associated OkHttp Response object. This ensures that the - * underlying HTTP connection is properly closed after the reader is no longer needed. - * - * @throws IOException if an I/O error occurs - */ - @Override - public void close() throws IOException { - super.close(); - response.close(); // Ensure the response is closed when the reader is closed - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/RetryInterceptor.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/RetryInterceptor.java deleted file mode 100644 index 66b6be4..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/RetryInterceptor.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.io.IOException; -import java.time.Duration; -import java.util.Optional; -import java.util.Random; -import okhttp3.Interceptor; -import okhttp3.Response; - -public class RetryInterceptor implements Interceptor { - - private static final Duration ONE_SECOND = Duration.ofSeconds(1); - private final ExponentialBackoff backoff; - private final Random random = new Random(); - - public RetryInterceptor(int maxRetries) { - this.backoff = new ExponentialBackoff(maxRetries); - } - - @Override - public Response intercept(Chain chain) throws IOException { - Response response = chain.proceed(chain.request()); - - if (shouldRetry(response.code())) { - return retryChain(response, chain); - } - - return response; - } - - private Response retryChain(Response response, Chain chain) throws IOException { - Optional nextBackoff = this.backoff.nextBackoff(); - while (nextBackoff.isPresent()) { - try { - Thread.sleep(nextBackoff.get().toMillis()); - } catch (InterruptedException e) { - throw new IOException("Interrupted while trying request", e); - } - response.close(); - response = chain.proceed(chain.request()); - if (shouldRetry(response.code())) { - nextBackoff = this.backoff.nextBackoff(); - } else { - return response; - } - } - - return response; - } - - private static boolean shouldRetry(int statusCode) { - return statusCode == 408 || statusCode == 429 || statusCode >= 500; - } - - private final class ExponentialBackoff { - - private final int maxNumRetries; - - private int retryNumber = 0; - - ExponentialBackoff(int maxNumRetries) { - this.maxNumRetries = maxNumRetries; - } - - public Optional nextBackoff() { - retryNumber += 1; - if (retryNumber > maxNumRetries) { - return Optional.empty(); - } - - int upperBound = (int) Math.pow(2, retryNumber); - return Optional.of(ONE_SECOND.multipliedBy(random.nextInt(upperBound))); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Stream.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Stream.java deleted file mode 100644 index 3781dcc..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Stream.java +++ /dev/null @@ -1,272 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.io.Closeable; -import java.io.IOException; -import java.io.Reader; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Scanner; - -/** - * The {@code Stream} class implements {@link Iterable} to provide a simple mechanism for reading and parsing - * objects of a given type from data streamed via a {@link Reader} using a specified delimiter. - *

- * {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a - * {@code Scanner} to block during iteration if the next object is not available. - * Iterable stream for parsing JSON and Server-Sent Events (SSE) data. - * Supports both newline-delimited JSON and SSE with optional stream termination. - * - * @param The type of objects in the stream. - */ -public final class Stream implements Iterable, Closeable { - - private static final String NEWLINE = "\n"; - private static final String DATA_PREFIX = "data:"; - - public enum StreamType { - JSON, - SSE - } - - private final Class valueType; - private final Scanner scanner; - private final StreamType streamType; - private final String messageTerminator; - private final String streamTerminator; - private final Reader sseReader; - private boolean isClosed = false; - - /** - * Constructs a new {@code Stream} with the specified value type, reader, and delimiter. - * - * @param valueType The class of the objects in the stream. - * @param reader The reader that provides the streamed data. - * @param delimiter The delimiter used to separate elements in the stream. - */ - public Stream(Class valueType, Reader reader, String delimiter) { - this.valueType = valueType; - this.scanner = new Scanner(reader).useDelimiter(delimiter); - this.streamType = StreamType.JSON; - this.messageTerminator = delimiter; - this.streamTerminator = null; - this.sseReader = null; - } - - private Stream(Class valueType, StreamType type, Reader reader, String terminator) { - this.valueType = valueType; - this.streamType = type; - if (type == StreamType.JSON) { - this.scanner = new Scanner(reader).useDelimiter(terminator); - this.messageTerminator = terminator; - this.streamTerminator = null; - this.sseReader = null; - } else { - this.scanner = null; - this.messageTerminator = NEWLINE; - this.streamTerminator = terminator; - this.sseReader = reader; - } - } - - public static Stream fromJson(Class valueType, Reader reader, String delimiter) { - return new Stream<>(valueType, reader, delimiter); - } - - public static Stream fromJson(Class valueType, Reader reader) { - return new Stream<>(valueType, reader, NEWLINE); - } - - public static Stream fromSse(Class valueType, Reader sseReader) { - return new Stream<>(valueType, StreamType.SSE, sseReader, null); - } - - public static Stream fromSse(Class valueType, Reader sseReader, String streamTerminator) { - return new Stream<>(valueType, StreamType.SSE, sseReader, streamTerminator); - } - - @Override - public void close() throws IOException { - if (!isClosed) { - isClosed = true; - if (scanner != null) { - scanner.close(); - } - if (sseReader != null) { - sseReader.close(); - } - } - } - - private boolean isStreamClosed() { - return isClosed; - } - - /** - * Returns an iterator over the elements in this stream that blocks during iteration when the next object is - * not yet available. - * - * @return An iterator that can be used to traverse the elements in the stream. - */ - @Override - public Iterator iterator() { - if (streamType == StreamType.SSE) { - return new SSEIterator(); - } else { - return new JsonIterator(); - } - } - - private final class JsonIterator implements Iterator { - - /** - * Returns {@code true} if there are more elements in the stream. - *

- * Will block and wait for input if the stream has not ended and the next object is not yet available. - * - * @return {@code true} if there are more elements, {@code false} otherwise. - */ - @Override - public boolean hasNext() { - if (isStreamClosed()) { - return false; - } - return scanner.hasNext(); - } - - /** - * Returns the next element in the stream. - *

- * Will block and wait for input if the stream has not ended and the next object is not yet available. - * - * @return The next element in the stream. - * @throws NoSuchElementException If there are no more elements in the stream. - */ - @Override - public T next() { - if (isStreamClosed()) { - throw new NoSuchElementException("Stream is closed"); - } - - if (!scanner.hasNext()) { - throw new NoSuchElementException(); - } else { - try { - T parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(scanner.next().trim(), valueType); - return parsedResponse; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - } - - private final class SSEIterator implements Iterator { - private Scanner sseScanner; - private T nextItem; - private boolean hasNextItem = false; - private boolean endOfStream = false; - private StringBuilder buffer = new StringBuilder(); - private boolean prefixSeen = false; - - private SSEIterator() { - if (sseReader != null && !isStreamClosed()) { - this.sseScanner = new Scanner(sseReader); - } else { - this.endOfStream = true; - } - } - - @Override - public boolean hasNext() { - if (isStreamClosed() || endOfStream) { - return false; - } - - if (hasNextItem) { - return true; - } - - return readNextMessage(); - } - - @Override - public T next() { - if (!hasNext()) { - throw new NoSuchElementException("No more elements in stream"); - } - - T result = nextItem; - nextItem = null; - hasNextItem = false; - return result; - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - private boolean readNextMessage() { - if (sseScanner == null || isStreamClosed()) { - endOfStream = true; - return false; - } - - try { - while (sseScanner.hasNextLine()) { - String chunk = sseScanner.nextLine(); - buffer.append(chunk).append(NEWLINE); - - int terminatorIndex; - while ((terminatorIndex = buffer.indexOf(messageTerminator)) >= 0) { - String line = buffer.substring(0, terminatorIndex + messageTerminator.length()); - buffer.delete(0, terminatorIndex + messageTerminator.length()); - - line = line.trim(); - if (line.isEmpty()) { - continue; - } - - if (!prefixSeen && line.startsWith(DATA_PREFIX)) { - prefixSeen = true; - line = line.substring(DATA_PREFIX.length()).trim(); - } else if (!prefixSeen) { - continue; - } - - if (streamTerminator != null && line.contains(streamTerminator)) { - endOfStream = true; - return false; - } - - try { - nextItem = ObjectMappers.JSON_MAPPER.readValue(line, valueType); - hasNextItem = true; - prefixSeen = false; - return true; - } catch (Exception parseEx) { - continue; - } - } - } - - endOfStream = true; - return false; - - } catch (Exception e) { - System.err.println("Failed to parse SSE stream: " + e.getMessage()); - endOfStream = true; - return false; - } - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Suppliers.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Suppliers.java deleted file mode 100644 index b907552..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/Suppliers.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.util.Objects; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Supplier; - -public final class Suppliers { - private Suppliers() {} - - public static Supplier memoize(Supplier delegate) { - AtomicReference value = new AtomicReference<>(); - return () -> { - T val = value.get(); - if (val == null) { - val = value.updateAndGet(cur -> cur == null ? Objects.requireNonNull(delegate.get()) : cur); - } - return val; - }; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/BasePage.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/BasePage.java deleted file mode 100644 index ca83fe4..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/BasePage.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core.pagination; - -import java.util.List; - -public abstract class BasePage { - private final boolean hasNext; - private final List items; - - public BasePage(boolean hasNext, List items) { - this.hasNext = hasNext; - this.items = items; - } - - public boolean hasNext() { - return !items.isEmpty() && hasNext; - } - - public List getItems() { - return items; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/SyncPage.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/SyncPage.java deleted file mode 100644 index 86fc5b7..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/SyncPage.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core.pagination; - -import java.util.List; -import java.util.NoSuchElementException; -import java.util.function.Supplier; - -public class SyncPage extends BasePage { - protected final Supplier> nextSupplier; - - public SyncPage(boolean hasNext, List items, Supplier> nextSupplier) { - super(hasNext, items); - this.nextSupplier = nextSupplier; - } - - public SyncPage nextPage() { - if (!hasNext()) { - throw new NoSuchElementException(); - } - return nextSupplier.get(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/SyncPagingIterable.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/SyncPagingIterable.java deleted file mode 100644 index fd5fca3..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/pagination/SyncPagingIterable.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core.pagination; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Optional; -import java.util.function.Supplier; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - -public class SyncPagingIterable extends SyncPage implements Iterable { - - public SyncPagingIterable(boolean hasNext, List items, Supplier> getNext) { - super(hasNext, items, getNext); - } - - public SyncPagingIterable(boolean hasNext, Optional> items, Supplier> getNext) { - super(hasNext, items.orElse(new ArrayList<>()), getNext); - } - - public Stream streamItems() { - return StreamSupport.stream(this.spliterator(), false); - } - - @Override - public Iterator iterator() { - return new Iterator() { - private Iterator itemsIterator = getItems().iterator(); - private SyncPage currentPage = SyncPagingIterable.this; - - @Override - public boolean hasNext() { - if (itemsIterator.hasNext()) { - return true; - } - if (currentPage.hasNext()) { - advancePage(); - return itemsIterator.hasNext(); - } - return false; - } - - @Override - public T next() { - if (!hasNext()) { - throw new NoSuchElementException(); - } - return itemsIterator.next(); - } - - private void advancePage() { - currentPage = currentPage.nextPage(); - itemsIterator = currentPage.getItems().iterator(); - } - }; - } -} 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 deleted file mode 100644 index 4e8b110..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.accounts; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -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.CreateAccountOpts; -import com.pipedream.api.types.Account; - -public class AccountsClient { - protected final ClientOptions clientOptions; - - private final RawAccountsClient rawClient; - - public AccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawAccountsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawAccountsClient withRawResponse() { - return this.rawClient; - } - - public SyncPagingIterable list() { - return this.rawClient.list().body(); - } - - public SyncPagingIterable list(AccountsListRequest request) { - return this.rawClient.list(request).body(); - } - - public SyncPagingIterable list(AccountsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); - } - - public Account create(CreateAccountOpts request) { - return this.rawClient.create(request).body(); - } - - public Account create(CreateAccountOpts request, RequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).body(); - } - - public Account retrieve(String accountId) { - return this.rawClient.retrieve(accountId).body(); - } - - public Account retrieve(String accountId, AccountsRetrieveRequest request) { - return this.rawClient.retrieve(accountId, request).body(); - } - - public Account retrieve(String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { - return this.rawClient.retrieve(accountId, request, requestOptions).body(); - } - - public void delete(String accountId) { - this.rawClient.delete(accountId).body(); - } - - public void delete(String accountId, RequestOptions requestOptions) { - this.rawClient.delete(accountId, requestOptions).body(); - } - - public void deleteByApp(String appId) { - this.rawClient.deleteByApp(appId).body(); - } - - public void deleteByApp(String appId, RequestOptions requestOptions) { - this.rawClient.deleteByApp(appId, 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 deleted file mode 100644 index 34158ac..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.accounts; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -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.CreateAccountOpts; -import com.pipedream.api.types.Account; -import java.util.concurrent.CompletableFuture; - -public class AsyncAccountsClient { - protected final ClientOptions clientOptions; - - private final AsyncRawAccountsClient rawClient; - - public AsyncAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawAccountsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawAccountsClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture> list() { - return this.rawClient.list().thenApply(response -> response.body()); - } - - public CompletableFuture> list(AccountsListRequest request) { - return this.rawClient.list(request).thenApply(response -> response.body()); - } - - public CompletableFuture> list( - AccountsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture create(CreateAccountOpts request) { - return this.rawClient.create(request).thenApply(response -> response.body()); - } - - public CompletableFuture create(CreateAccountOpts request, RequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String accountId) { - return this.rawClient.retrieve(accountId).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String accountId, AccountsRetrieveRequest request) { - return this.rawClient.retrieve(accountId, request).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve( - String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { - return this.rawClient.retrieve(accountId, request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture delete(String accountId) { - return this.rawClient.delete(accountId).thenApply(response -> response.body()); - } - - public CompletableFuture delete(String accountId, RequestOptions requestOptions) { - return this.rawClient.delete(accountId, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture deleteByApp(String appId) { - return this.rawClient.deleteByApp(appId).thenApply(response -> response.body()); - } - - public CompletableFuture deleteByApp(String appId, RequestOptions requestOptions) { - return this.rawClient.deleteByApp(appId, 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 deleted file mode 100644 index ea4f83a..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java +++ /dev/null @@ -1,391 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.accounts; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -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.CreateAccountOpts; -import com.pipedream.api.types.Account; -import com.pipedream.api.types.ListAccountsResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawAccountsClient { - protected final ClientOptions clientOptions; - - public AsyncRawAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture>> list() { - return list(AccountsListRequest.builder().build()); - } - - public CompletableFuture>> list(AccountsListRequest request) { - return list(request, null); - } - - public CompletableFuture>> list( - AccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("accounts"); - if (request.getAppId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "app_id", request.getAppId().get(), false); - } - if (request.getExternalUserId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "external_user_id", request.getExternalUserId().get(), false); - } - if (request.getOauthAppId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "oauth_app_id", request.getOauthAppId().get(), false); - } - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getIncludeCredentials().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, - "include_credentials", - request.getIncludeCredentials().get(), - false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - ListAccountsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListAccountsResponse.class); - Optional startingAfter = - parsedResponse.getPageInfo().getEndCursor(); - AccountsListRequest nextRequest = AccountsListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - future.complete(new BaseClientHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> create(CreateAccountOpts request) { - return create(request, null); - } - - public CompletableFuture> create( - CreateAccountOpts request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("accounts"); - if (request.getAppId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "app_id", request.getAppId().get(), false); - } - if (request.getExternalUserId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "external_user_id", request.getExternalUserId().get(), false); - } - if (request.getOauthAppId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "oauth_app_id", request.getOauthAppId().get(), false); - } - Map properties = new HashMap<>(); - properties.put("app_slug", request.getAppSlug()); - properties.put("cfmap_json", request.getCfmapJson()); - properties.put("connect_token", request.getConnectToken()); - if (request.getName().isPresent()) { - properties.put("name", request.getName()); - } - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), Account.class), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> retrieve(String accountId) { - return retrieve(accountId, AccountsRetrieveRequest.builder().build()); - } - - public CompletableFuture> retrieve( - String accountId, AccountsRetrieveRequest request) { - return retrieve(accountId, request, null); - } - - public CompletableFuture> retrieve( - String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("accounts") - .addPathSegment(accountId); - if (request.getIncludeCredentials().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, - "include_credentials", - request.getIncludeCredentials().get(), - false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), Account.class), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> delete(String accountId) { - return delete(accountId, null); - } - - public CompletableFuture> delete(String accountId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("accounts") - .addPathSegment(accountId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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<>(null, response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> deleteByApp(String appId) { - return deleteByApp(appId, null); - } - - public CompletableFuture> deleteByApp(String appId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("apps") - .addPathSegment(appId) - .addPathSegments("accounts") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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<>(null, response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} 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 deleted file mode 100644 index 5fb30da..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java +++ /dev/null @@ -1,312 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.accounts; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -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.CreateAccountOpts; -import com.pipedream.api.types.Account; -import com.pipedream.api.types.ListAccountsResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawAccountsClient { - protected final ClientOptions clientOptions; - - public RawAccountsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse> list() { - return list(AccountsListRequest.builder().build()); - } - - public BaseClientHttpResponse> list(AccountsListRequest request) { - return list(request, null); - } - - public BaseClientHttpResponse> list( - AccountsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("accounts"); - if (request.getAppId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "app_id", request.getAppId().get(), false); - } - if (request.getExternalUserId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "external_user_id", request.getExternalUserId().get(), false); - } - if (request.getOauthAppId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "oauth_app_id", request.getOauthAppId().get(), false); - } - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getIncludeCredentials().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, - "include_credentials", - request.getIncludeCredentials().get(), - false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - ListAccountsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListAccountsResponse.class); - Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - AccountsListRequest nextRequest = AccountsListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - return new BaseClientHttpResponse<>( - new SyncPagingIterable( - startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) - .body()), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse create(CreateAccountOpts request) { - return create(request, null); - } - - public BaseClientHttpResponse create(CreateAccountOpts request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("accounts"); - if (request.getAppId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "app_id", request.getAppId().get(), false); - } - if (request.getExternalUserId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "external_user_id", request.getExternalUserId().get(), false); - } - if (request.getOauthAppId().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "oauth_app_id", request.getOauthAppId().get(), false); - } - Map properties = new HashMap<>(); - properties.put("app_slug", request.getAppSlug()); - properties.put("cfmap_json", request.getCfmapJson()); - properties.put("connect_token", request.getConnectToken()); - if (request.getName().isPresent()) { - properties.put("name", request.getName()); - } - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse retrieve(String accountId) { - return retrieve(accountId, AccountsRetrieveRequest.builder().build()); - } - - public BaseClientHttpResponse retrieve(String accountId, AccountsRetrieveRequest request) { - return retrieve(accountId, request, null); - } - - public BaseClientHttpResponse retrieve( - String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("accounts") - .addPathSegment(accountId); - if (request.getIncludeCredentials().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, - "include_credentials", - request.getIncludeCredentials().get(), - false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse delete(String accountId) { - return delete(accountId, null); - } - - public BaseClientHttpResponse delete(String accountId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("accounts") - .addPathSegment(accountId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>(null, response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse deleteByApp(String appId) { - return deleteByApp(appId, null); - } - - public BaseClientHttpResponse deleteByApp(String appId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("apps") - .addPathSegment(appId) - .addPathSegments("accounts") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>(null, response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsListRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsListRequest.java deleted file mode 100644 index 2d67f6d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsListRequest.java +++ /dev/null @@ -1,285 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.accounts.requests; - -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 = AccountsListRequest.Builder.class) -public final class AccountsListRequest { - private final Optional appId; - - private final Optional externalUserId; - - private final Optional oauthAppId; - - private final Optional after; - - private final Optional before; - - private final Optional limit; - - private final Optional includeCredentials; - - private final Map additionalProperties; - - private AccountsListRequest( - Optional appId, - Optional externalUserId, - Optional oauthAppId, - Optional after, - Optional before, - Optional limit, - Optional includeCredentials, - Map additionalProperties) { - this.appId = appId; - this.externalUserId = externalUserId; - this.oauthAppId = oauthAppId; - this.after = after; - this.before = before; - this.limit = limit; - this.includeCredentials = includeCredentials; - this.additionalProperties = additionalProperties; - } - - /** - * @return The app slug or ID to filter accounts by. - */ - @JsonProperty("app_id") - public Optional getAppId() { - return appId; - } - - @JsonProperty("external_user_id") - public Optional getExternalUserId() { - return externalUserId; - } - - /** - * @return The OAuth app ID to filter by, if applicable - */ - @JsonProperty("oauth_app_id") - public Optional getOauthAppId() { - return oauthAppId; - } - - /** - * @return The cursor to start from for pagination - */ - @JsonProperty("after") - public Optional getAfter() { - return after; - } - - /** - * @return The cursor to end before for pagination - */ - @JsonProperty("before") - public Optional getBefore() { - return before; - } - - /** - * @return The maximum number of results to return - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return Whether to retrieve the account's credentials or not - */ - @JsonProperty("include_credentials") - public Optional getIncludeCredentials() { - return includeCredentials; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountsListRequest && equalTo((AccountsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountsListRequest other) { - return appId.equals(other.appId) - && externalUserId.equals(other.externalUserId) - && oauthAppId.equals(other.oauthAppId) - && after.equals(other.after) - && before.equals(other.before) - && limit.equals(other.limit) - && includeCredentials.equals(other.includeCredentials); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.appId, - this.externalUserId, - this.oauthAppId, - this.after, - this.before, - this.limit, - this.includeCredentials); - } - - @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 appId = Optional.empty(); - - private Optional externalUserId = Optional.empty(); - - private Optional oauthAppId = Optional.empty(); - - private Optional after = Optional.empty(); - - private Optional before = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional includeCredentials = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountsListRequest other) { - appId(other.getAppId()); - externalUserId(other.getExternalUserId()); - oauthAppId(other.getOauthAppId()); - after(other.getAfter()); - before(other.getBefore()); - limit(other.getLimit()); - includeCredentials(other.getIncludeCredentials()); - return this; - } - - /** - *

The app slug or ID to filter accounts by.

- */ - @JsonSetter(value = "app_id", nulls = Nulls.SKIP) - public Builder appId(Optional appId) { - this.appId = appId; - return this; - } - - public Builder appId(String appId) { - this.appId = Optional.ofNullable(appId); - return this; - } - - @JsonSetter(value = "external_user_id", nulls = Nulls.SKIP) - public Builder externalUserId(Optional externalUserId) { - this.externalUserId = externalUserId; - return this; - } - - public Builder externalUserId(String externalUserId) { - this.externalUserId = Optional.ofNullable(externalUserId); - return this; - } - - /** - *

The OAuth app ID to filter by, if applicable

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

The cursor to start from for pagination

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

The cursor to end before for pagination

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

The maximum number of results to return

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

Whether to retrieve the account's credentials or not

- */ - @JsonSetter(value = "include_credentials", nulls = Nulls.SKIP) - public Builder includeCredentials(Optional includeCredentials) { - this.includeCredentials = includeCredentials; - return this; - } - - public Builder includeCredentials(Boolean includeCredentials) { - this.includeCredentials = Optional.ofNullable(includeCredentials); - return this; - } - - public AccountsListRequest build() { - return new AccountsListRequest( - appId, externalUserId, oauthAppId, after, before, limit, includeCredentials, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsRetrieveRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsRetrieveRequest.java deleted file mode 100644 index 3844f9d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsRetrieveRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.accounts.requests; - -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 = AccountsRetrieveRequest.Builder.class) -public final class AccountsRetrieveRequest { - private final Optional includeCredentials; - - private final Map additionalProperties; - - private AccountsRetrieveRequest(Optional includeCredentials, Map additionalProperties) { - this.includeCredentials = includeCredentials; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to retrieve the account's credentials or not - */ - @JsonProperty("include_credentials") - public Optional getIncludeCredentials() { - return includeCredentials; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AccountsRetrieveRequest && equalTo((AccountsRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AccountsRetrieveRequest other) { - return includeCredentials.equals(other.includeCredentials); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.includeCredentials); - } - - @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 includeCredentials = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AccountsRetrieveRequest other) { - includeCredentials(other.getIncludeCredentials()); - return this; - } - - /** - *

Whether to retrieve the account's credentials or not

- */ - @JsonSetter(value = "include_credentials", nulls = Nulls.SKIP) - public Builder includeCredentials(Optional includeCredentials) { - this.includeCredentials = includeCredentials; - return this; - } - - public Builder includeCredentials(Boolean includeCredentials) { - this.includeCredentials = Optional.ofNullable(includeCredentials); - return this; - } - - public AccountsRetrieveRequest build() { - return new AccountsRetrieveRequest(includeCredentials, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java deleted file mode 100644 index 79cef5e..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountOpts.java +++ /dev/null @@ -1,354 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.accounts.requests; - -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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateAccountOpts.Builder.class) -public final class CreateAccountOpts { - private final Optional appId; - - private final Optional externalUserId; - - private final Optional oauthAppId; - - private final String appSlug; - - private final String cfmapJson; - - private final String connectToken; - - private final Optional name; - - private final Map additionalProperties; - - private CreateAccountOpts( - Optional appId, - Optional externalUserId, - Optional oauthAppId, - String appSlug, - String cfmapJson, - String connectToken, - Optional name, - Map additionalProperties) { - this.appId = appId; - this.externalUserId = externalUserId; - this.oauthAppId = oauthAppId; - this.appSlug = appSlug; - this.cfmapJson = cfmapJson; - this.connectToken = connectToken; - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The app slug or ID to filter accounts by. - */ - @JsonProperty("app_id") - public Optional getAppId() { - return appId; - } - - @JsonProperty("external_user_id") - public Optional getExternalUserId() { - return externalUserId; - } - - /** - * @return The OAuth app ID to filter by, if applicable - */ - @JsonProperty("oauth_app_id") - public Optional getOauthAppId() { - return oauthAppId; - } - - /** - * @return The app slug for the account - */ - @JsonProperty("app_slug") - public String getAppSlug() { - return appSlug; - } - - /** - * @return JSON string containing the custom fields mapping - */ - @JsonProperty("cfmap_json") - public String getCfmapJson() { - return cfmapJson; - } - - /** - * @return The connect token for authentication - */ - @JsonProperty("connect_token") - public String getConnectToken() { - return connectToken; - } - - /** - * @return Optional name for the account - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateAccountOpts && equalTo((CreateAccountOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateAccountOpts other) { - return appId.equals(other.appId) - && externalUserId.equals(other.externalUserId) - && oauthAppId.equals(other.oauthAppId) - && appSlug.equals(other.appSlug) - && cfmapJson.equals(other.cfmapJson) - && connectToken.equals(other.connectToken) - && name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.appId, - this.externalUserId, - this.oauthAppId, - this.appSlug, - this.cfmapJson, - this.connectToken, - this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AppSlugStage builder() { - return new Builder(); - } - - public interface AppSlugStage { - /** - *

The app slug for the account

- */ - CfmapJsonStage appSlug(@NotNull String appSlug); - - Builder from(CreateAccountOpts other); - } - - public interface CfmapJsonStage { - /** - *

JSON string containing the custom fields mapping

- */ - ConnectTokenStage cfmapJson(@NotNull String cfmapJson); - } - - public interface ConnectTokenStage { - /** - *

The connect token for authentication

- */ - _FinalStage connectToken(@NotNull String connectToken); - } - - public interface _FinalStage { - CreateAccountOpts build(); - - /** - *

The app slug or ID to filter accounts by.

- */ - _FinalStage appId(Optional appId); - - _FinalStage appId(String appId); - - _FinalStage externalUserId(Optional externalUserId); - - _FinalStage externalUserId(String externalUserId); - - /** - *

The OAuth app ID to filter by, if applicable

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

Optional name for the account

- */ - _FinalStage name(Optional name); - - _FinalStage name(String name); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AppSlugStage, CfmapJsonStage, ConnectTokenStage, _FinalStage { - private String appSlug; - - private String cfmapJson; - - private String connectToken; - - private Optional name = Optional.empty(); - - private Optional oauthAppId = Optional.empty(); - - private Optional externalUserId = Optional.empty(); - - private Optional appId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateAccountOpts other) { - appId(other.getAppId()); - externalUserId(other.getExternalUserId()); - oauthAppId(other.getOauthAppId()); - appSlug(other.getAppSlug()); - cfmapJson(other.getCfmapJson()); - connectToken(other.getConnectToken()); - name(other.getName()); - return this; - } - - /** - *

The app slug for the account

- *

The app slug for the account

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

JSON string containing the custom fields mapping

- *

JSON string containing the custom fields mapping

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

The connect token for authentication

- *

The connect token for authentication

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

Optional name for the account

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

Optional name for the account

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

The OAuth app ID to filter by, if applicable

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

The OAuth app ID to filter by, if applicable

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

The app slug or ID to filter accounts by.

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

The app slug or ID to filter accounts by.

- */ - @java.lang.Override - @JsonSetter(value = "app_id", nulls = Nulls.SKIP) - public _FinalStage appId(Optional appId) { - this.appId = appId; - return this; - } - - @java.lang.Override - 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/actions/ActionsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/ActionsClient.java deleted file mode 100644 index 52efedb..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/ActionsClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.actions; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.actions.requests.ActionsConfigurePropRequest; -import com.pipedream.api.resources.actions.requests.ActionsListRequest; -import com.pipedream.api.resources.actions.requests.ActionsReloadPropsRequest; -import com.pipedream.api.resources.actions.requests.RunActionOpts; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import com.pipedream.api.types.RunActionResponse; - -public class ActionsClient { - protected final ClientOptions clientOptions; - - private final RawActionsClient rawClient; - - public ActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawActionsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawActionsClient withRawResponse() { - return this.rawClient; - } - - public SyncPagingIterable list() { - return this.rawClient.list().body(); - } - - public SyncPagingIterable list(ActionsListRequest request) { - return this.rawClient.list(request).body(); - } - - public SyncPagingIterable list(ActionsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); - } - - public Component retrieve(String componentId) { - return this.rawClient.retrieve(componentId).body(); - } - - public Component retrieve(String componentId, RequestOptions requestOptions) { - return this.rawClient.retrieve(componentId, requestOptions).body(); - } - - public ConfigurePropResponse configureProp(ActionsConfigurePropRequest request) { - return this.rawClient.configureProp(request).body(); - } - - public ConfigurePropResponse configureProp(ActionsConfigurePropRequest request, RequestOptions requestOptions) { - return this.rawClient.configureProp(request, requestOptions).body(); - } - - public ReloadPropsResponse reloadProps(ActionsReloadPropsRequest request) { - return this.rawClient.reloadProps(request).body(); - } - - public ReloadPropsResponse reloadProps(ActionsReloadPropsRequest request, RequestOptions requestOptions) { - return this.rawClient.reloadProps(request, requestOptions).body(); - } - - public RunActionResponse run(RunActionOpts request) { - return this.rawClient.run(request).body(); - } - - public RunActionResponse run(RunActionOpts request, RequestOptions requestOptions) { - return this.rawClient.run(request, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncActionsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncActionsClient.java deleted file mode 100644 index 19ff8e7..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncActionsClient.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.actions; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.actions.requests.ActionsConfigurePropRequest; -import com.pipedream.api.resources.actions.requests.ActionsListRequest; -import com.pipedream.api.resources.actions.requests.ActionsReloadPropsRequest; -import com.pipedream.api.resources.actions.requests.RunActionOpts; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import com.pipedream.api.types.RunActionResponse; -import java.util.concurrent.CompletableFuture; - -public class AsyncActionsClient { - protected final ClientOptions clientOptions; - - private final AsyncRawActionsClient rawClient; - - public AsyncActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawActionsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawActionsClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture> list() { - return this.rawClient.list().thenApply(response -> response.body()); - } - - public CompletableFuture> list(ActionsListRequest request) { - return this.rawClient.list(request).thenApply(response -> response.body()); - } - - public CompletableFuture> list( - ActionsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String componentId) { - return this.rawClient.retrieve(componentId).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String componentId, RequestOptions requestOptions) { - return this.rawClient.retrieve(componentId, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture configureProp(ActionsConfigurePropRequest request) { - return this.rawClient.configureProp(request).thenApply(response -> response.body()); - } - - public CompletableFuture configureProp( - ActionsConfigurePropRequest request, RequestOptions requestOptions) { - return this.rawClient.configureProp(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture reloadProps(ActionsReloadPropsRequest request) { - return this.rawClient.reloadProps(request).thenApply(response -> response.body()); - } - - public CompletableFuture reloadProps( - ActionsReloadPropsRequest request, RequestOptions requestOptions) { - return this.rawClient.reloadProps(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture run(RunActionOpts request) { - return this.rawClient.run(request).thenApply(response -> response.body()); - } - - public CompletableFuture run(RunActionOpts request, RequestOptions requestOptions) { - return this.rawClient.run(request, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java deleted file mode 100644 index 8b1ab94..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java +++ /dev/null @@ -1,397 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.actions; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.actions.requests.ActionsConfigurePropRequest; -import com.pipedream.api.resources.actions.requests.ActionsListRequest; -import com.pipedream.api.resources.actions.requests.ActionsReloadPropsRequest; -import com.pipedream.api.resources.actions.requests.RunActionOpts; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.GetComponentResponse; -import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import com.pipedream.api.types.RunActionResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawActionsClient { - protected final ClientOptions clientOptions; - - public AsyncRawActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture>> list() { - return list(ActionsListRequest.builder().build()); - } - - public CompletableFuture>> list(ActionsListRequest request) { - return list(request, null); - } - - public CompletableFuture>> list( - ActionsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); - } - if (request.getApp().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "app", request.getApp().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); - Optional startingAfter = - parsedResponse.getPageInfo().getEndCursor(); - ActionsListRequest nextRequest = ActionsListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - future.complete(new BaseClientHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> retrieve(String componentId) { - return retrieve(componentId, null); - } - - public CompletableFuture> retrieve( - String componentId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions") - .addPathSegment(componentId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> configureProp( - ActionsConfigurePropRequest request) { - return configureProp(request, null); - } - - public CompletableFuture> configureProp( - ActionsConfigurePropRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/configure") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), ConfigurePropResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> reloadProps( - ActionsReloadPropsRequest request) { - return reloadProps(request, null); - } - - public CompletableFuture> reloadProps( - ActionsReloadPropsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/props") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), ReloadPropsResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> run(RunActionOpts request) { - return run(request, null); - } - - public CompletableFuture> run( - RunActionOpts request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/run") - .build(); - Map properties = new HashMap<>(); - properties.put("id", request.getId()); - properties.put("external_user_id", request.getExternalUserId()); - if (request.getConfiguredProps().isPresent()) { - properties.put("configured_props", request.getConfiguredProps()); - } - if (request.getDynamicPropsId().isPresent()) { - properties.put("dynamic_props_id", request.getDynamicPropsId()); - } - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), RunActionResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java deleted file mode 100644 index 1dbf30b..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java +++ /dev/null @@ -1,315 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.actions; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.actions.requests.ActionsConfigurePropRequest; -import com.pipedream.api.resources.actions.requests.ActionsListRequest; -import com.pipedream.api.resources.actions.requests.ActionsReloadPropsRequest; -import com.pipedream.api.resources.actions.requests.RunActionOpts; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.GetComponentResponse; -import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import com.pipedream.api.types.RunActionResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawActionsClient { - protected final ClientOptions clientOptions; - - public RawActionsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse> list() { - return list(ActionsListRequest.builder().build()); - } - - public BaseClientHttpResponse> list(ActionsListRequest request) { - return list(request, null); - } - - public BaseClientHttpResponse> list( - ActionsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); - } - if (request.getApp().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "app", request.getApp().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); - Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - ActionsListRequest nextRequest = ActionsListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - return new BaseClientHttpResponse<>( - new SyncPagingIterable( - startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) - .body()), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse retrieve(String componentId) { - return retrieve(componentId, null); - } - - public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions") - .addPathSegment(componentId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new BaseClientHttpResponse<>(parsedResponse.getData(), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse configureProp(ActionsConfigurePropRequest request) { - return configureProp(request, null); - } - - public BaseClientHttpResponse configureProp( - ActionsConfigurePropRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/configure") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse reloadProps(ActionsReloadPropsRequest request) { - return reloadProps(request, null); - } - - public BaseClientHttpResponse reloadProps( - ActionsReloadPropsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/props") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse run(RunActionOpts request) { - return run(request, null); - } - - public BaseClientHttpResponse run(RunActionOpts request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/run") - .build(); - Map properties = new HashMap<>(); - properties.put("id", request.getId()); - properties.put("external_user_id", request.getExternalUserId()); - if (request.getConfiguredProps().isPresent()) { - properties.put("configured_props", request.getConfiguredProps()); - } - if (request.getDynamicPropsId().isPresent()) { - properties.put("dynamic_props_id", request.getDynamicPropsId()); - } - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RunActionResponse.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsConfigurePropRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsConfigurePropRequest.java deleted file mode 100644 index 5da951b..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsConfigurePropRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.actions.requests; - -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 com.pipedream.api.types.ConfigurePropOpts; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ActionsConfigurePropRequest.Builder.class) -public final class ActionsConfigurePropRequest { - private final Optional asyncHandle; - - private final ConfigurePropOpts body; - - private final Map additionalProperties; - - private ActionsConfigurePropRequest( - Optional asyncHandle, ConfigurePropOpts body, Map additionalProperties) { - this.asyncHandle = asyncHandle; - this.body = body; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("x-async-handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - @JsonProperty("body") - public ConfigurePropOpts getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ActionsConfigurePropRequest && equalTo((ActionsConfigurePropRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ActionsConfigurePropRequest other) { - return asyncHandle.equals(other.asyncHandle) && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncHandle, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BodyStage builder() { - return new Builder(); - } - - public interface BodyStage { - _FinalStage body(@NotNull ConfigurePropOpts body); - - Builder from(ActionsConfigurePropRequest other); - } - - public interface _FinalStage { - ActionsConfigurePropRequest build(); - - _FinalStage asyncHandle(Optional asyncHandle); - - _FinalStage asyncHandle(String asyncHandle); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BodyStage, _FinalStage { - private ConfigurePropOpts body; - - private Optional asyncHandle = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ActionsConfigurePropRequest other) { - asyncHandle(other.getAsyncHandle()); - body(other.getBody()); - return this; - } - - @java.lang.Override - @JsonSetter("body") - public _FinalStage body(@NotNull ConfigurePropOpts body) { - this.body = Objects.requireNonNull(body, "body must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage asyncHandle(String asyncHandle) { - this.asyncHandle = Optional.ofNullable(asyncHandle); - return this; - } - - @java.lang.Override - @JsonSetter(value = "x-async-handle", nulls = Nulls.SKIP) - public _FinalStage asyncHandle(Optional asyncHandle) { - this.asyncHandle = asyncHandle; - return this; - } - - @java.lang.Override - public ActionsConfigurePropRequest build() { - return new ActionsConfigurePropRequest(asyncHandle, body, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsListRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsListRequest.java deleted file mode 100644 index 60f1e37..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsListRequest.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.actions.requests; - -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 = ActionsListRequest.Builder.class) -public final class ActionsListRequest { - private final Optional after; - - private final Optional before; - - private final Optional limit; - - private final Optional q; - - private final Optional app; - - private final Map additionalProperties; - - private ActionsListRequest( - Optional after, - Optional before, - Optional limit, - Optional q, - Optional app, - Map additionalProperties) { - this.after = after; - this.before = before; - this.limit = limit; - this.q = q; - this.app = app; - this.additionalProperties = additionalProperties; - } - - /** - * @return The cursor to start from for pagination - */ - @JsonProperty("after") - public Optional getAfter() { - return after; - } - - /** - * @return The cursor to end before for pagination - */ - @JsonProperty("before") - public Optional getBefore() { - return before; - } - - /** - * @return The maximum number of results to return - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return A search query to filter the actions - */ - @JsonProperty("q") - public Optional getQ() { - return q; - } - - /** - * @return The ID or name slug of the app to filter the actions - */ - @JsonProperty("app") - public Optional getApp() { - return app; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ActionsListRequest && equalTo((ActionsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ActionsListRequest other) { - return after.equals(other.after) - && before.equals(other.before) - && limit.equals(other.limit) - && q.equals(other.q) - && app.equals(other.app); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.after, this.before, this.limit, this.q, this.app); - } - - @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 after = Optional.empty(); - - private Optional before = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional q = Optional.empty(); - - private Optional app = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ActionsListRequest other) { - after(other.getAfter()); - before(other.getBefore()); - limit(other.getLimit()); - q(other.getQ()); - app(other.getApp()); - return this; - } - - /** - *

The cursor to start from for pagination

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

The cursor to end before for pagination

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

The maximum number of results to return

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

A search query to filter the actions

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

The ID or name slug of the app to filter the actions

- */ - @JsonSetter(value = "app", nulls = Nulls.SKIP) - public Builder app(Optional app) { - this.app = app; - return this; - } - - public Builder app(String app) { - this.app = Optional.ofNullable(app); - return this; - } - - public ActionsListRequest build() { - return new ActionsListRequest(after, before, limit, q, app, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsReloadPropsRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsReloadPropsRequest.java deleted file mode 100644 index afefa8a..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/ActionsReloadPropsRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.actions.requests; - -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 com.pipedream.api.types.ReloadPropsOpts; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ActionsReloadPropsRequest.Builder.class) -public final class ActionsReloadPropsRequest { - private final Optional asyncHandle; - - private final ReloadPropsOpts body; - - private final Map additionalProperties; - - private ActionsReloadPropsRequest( - Optional asyncHandle, ReloadPropsOpts body, Map additionalProperties) { - this.asyncHandle = asyncHandle; - this.body = body; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("x-async-handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - @JsonProperty("body") - public ReloadPropsOpts getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ActionsReloadPropsRequest && equalTo((ActionsReloadPropsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ActionsReloadPropsRequest other) { - return asyncHandle.equals(other.asyncHandle) && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncHandle, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BodyStage builder() { - return new Builder(); - } - - public interface BodyStage { - _FinalStage body(@NotNull ReloadPropsOpts body); - - Builder from(ActionsReloadPropsRequest other); - } - - public interface _FinalStage { - ActionsReloadPropsRequest build(); - - _FinalStage asyncHandle(Optional asyncHandle); - - _FinalStage asyncHandle(String asyncHandle); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BodyStage, _FinalStage { - private ReloadPropsOpts body; - - private Optional asyncHandle = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ActionsReloadPropsRequest other) { - asyncHandle(other.getAsyncHandle()); - body(other.getBody()); - return this; - } - - @java.lang.Override - @JsonSetter("body") - public _FinalStage body(@NotNull ReloadPropsOpts body) { - this.body = Objects.requireNonNull(body, "body must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage asyncHandle(String asyncHandle) { - this.asyncHandle = Optional.ofNullable(asyncHandle); - return this; - } - - @java.lang.Override - @JsonSetter(value = "x-async-handle", nulls = Nulls.SKIP) - public _FinalStage asyncHandle(Optional asyncHandle) { - this.asyncHandle = asyncHandle; - return this; - } - - @java.lang.Override - public ActionsReloadPropsRequest build() { - return new ActionsReloadPropsRequest(asyncHandle, body, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java deleted file mode 100644 index 6a16af8..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java +++ /dev/null @@ -1,269 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.actions.requests; - -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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RunActionOpts.Builder.class) -public final class RunActionOpts { - private final Optional asyncHandle; - - private final String id; - - private final String externalUserId; - - private final Optional> configuredProps; - - private final Optional dynamicPropsId; - - private final Map additionalProperties; - - private RunActionOpts( - Optional asyncHandle, - String id, - String externalUserId, - Optional> configuredProps, - Optional dynamicPropsId, - Map additionalProperties) { - this.asyncHandle = asyncHandle; - this.id = id; - this.externalUserId = externalUserId; - this.configuredProps = configuredProps; - this.dynamicPropsId = dynamicPropsId; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("x-async-handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - /** - * @return The action component ID - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return The external user ID - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The configured properties for the action - */ - @JsonProperty("configured_props") - public Optional> getConfiguredProps() { - return configuredProps; - } - - /** - * @return The ID for dynamic props - */ - @JsonProperty("dynamic_props_id") - public Optional getDynamicPropsId() { - return dynamicPropsId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RunActionOpts && equalTo((RunActionOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RunActionOpts other) { - return asyncHandle.equals(other.asyncHandle) - && id.equals(other.id) - && externalUserId.equals(other.externalUserId) - && configuredProps.equals(other.configuredProps) - && dynamicPropsId.equals(other.dynamicPropsId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncHandle, this.id, this.externalUserId, this.configuredProps, this.dynamicPropsId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

The action component ID

- */ - ExternalUserIdStage id(@NotNull String id); - - Builder from(RunActionOpts other); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - } - - public interface _FinalStage { - RunActionOpts build(); - - _FinalStage asyncHandle(Optional asyncHandle); - - _FinalStage asyncHandle(String asyncHandle); - - /** - *

The configured properties for the action

- */ - _FinalStage configuredProps(Optional> configuredProps); - - _FinalStage configuredProps(Map configuredProps); - - /** - *

The ID for dynamic props

- */ - _FinalStage dynamicPropsId(Optional dynamicPropsId); - - _FinalStage dynamicPropsId(String dynamicPropsId); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, ExternalUserIdStage, _FinalStage { - private String id; - - private String externalUserId; - - private Optional dynamicPropsId = Optional.empty(); - - private Optional> configuredProps = Optional.empty(); - - private Optional asyncHandle = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RunActionOpts other) { - asyncHandle(other.getAsyncHandle()); - id(other.getId()); - externalUserId(other.getExternalUserId()); - configuredProps(other.getConfiguredProps()); - dynamicPropsId(other.getDynamicPropsId()); - return this; - } - - /** - *

The action component ID

- *

The action component ID

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

The external user ID

- *

The external user ID

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

The ID for dynamic props

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

The ID for dynamic props

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

The configured properties for the action

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

The configured properties for the action

- */ - @java.lang.Override - @JsonSetter(value = "configured_props", nulls = Nulls.SKIP) - public _FinalStage configuredProps(Optional> configuredProps) { - this.configuredProps = configuredProps; - return this; - } - - @java.lang.Override - public _FinalStage asyncHandle(String asyncHandle) { - this.asyncHandle = Optional.ofNullable(asyncHandle); - return this; - } - - @java.lang.Override - @JsonSetter(value = "x-async-handle", nulls = Nulls.SKIP) - public _FinalStage asyncHandle(Optional asyncHandle) { - this.asyncHandle = asyncHandle; - return this; - } - - @java.lang.Override - public RunActionOpts build() { - return new RunActionOpts( - asyncHandle, id, externalUserId, configuredProps, dynamicPropsId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AppCategoriesClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AppCategoriesClient.java deleted file mode 100644 index 357d245..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AppCategoriesClient.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.appcategories; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.types.AppCategory; -import java.util.List; - -public class AppCategoriesClient { - protected final ClientOptions clientOptions; - - private final RawAppCategoriesClient rawClient; - - public AppCategoriesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawAppCategoriesClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawAppCategoriesClient withRawResponse() { - return this.rawClient; - } - - public List list() { - return this.rawClient.list().body(); - } - - public List list(RequestOptions requestOptions) { - return this.rawClient.list(requestOptions).body(); - } - - public AppCategory retrieve(String id) { - return this.rawClient.retrieve(id).body(); - } - - public AppCategory retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncAppCategoriesClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncAppCategoriesClient.java deleted file mode 100644 index d374614..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncAppCategoriesClient.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.appcategories; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.types.AppCategory; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -public class AsyncAppCategoriesClient { - protected final ClientOptions clientOptions; - - private final AsyncRawAppCategoriesClient rawClient; - - public AsyncAppCategoriesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawAppCategoriesClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawAppCategoriesClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture> list() { - return this.rawClient.list().thenApply(response -> response.body()); - } - - public CompletableFuture> list(RequestOptions requestOptions) { - return this.rawClient.list(requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String id) { - return this.rawClient.retrieve(id).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java deleted file mode 100644 index ebaf619..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.appcategories; - -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; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.types.AppCategory; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawAppCategoriesClient { - protected final ClientOptions clientOptions; - - public AsyncRawAppCategoriesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture>> list() { - return list(null); - } - - public CompletableFuture>> list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect/app_categories") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> retrieve(String id) { - return retrieve(id, null); - } - - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect/app_categories") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), AppCategory.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java deleted file mode 100644 index 9fb1c24..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.appcategories; - -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; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.types.AppCategory; -import java.io.IOException; -import java.util.List; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawAppCategoriesClient { - protected final ClientOptions clientOptions; - - public RawAppCategoriesClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse> list() { - return list(null); - } - - public BaseClientHttpResponse> list(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect/app_categories") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse retrieve(String id) { - return retrieve(id, null); - } - - public BaseClientHttpResponse retrieve(String id, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect/app_categories") - .addPathSegment(id) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AppCategory.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AppsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AppsClient.java deleted file mode 100644 index 39bcb35..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AppsClient.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.apps.requests.AppsListRequest; -import com.pipedream.api.types.App; -import com.pipedream.api.types.GetAppResponse; - -public class AppsClient { - protected final ClientOptions clientOptions; - - private final RawAppsClient rawClient; - - public AppsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawAppsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawAppsClient withRawResponse() { - return this.rawClient; - } - - public SyncPagingIterable list() { - return this.rawClient.list().body(); - } - - public SyncPagingIterable list(AppsListRequest request) { - return this.rawClient.list(request).body(); - } - - public SyncPagingIterable list(AppsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); - } - - public GetAppResponse retrieve(String appId) { - return this.rawClient.retrieve(appId).body(); - } - - public GetAppResponse retrieve(String appId, RequestOptions requestOptions) { - return this.rawClient.retrieve(appId, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java deleted file mode 100644 index fbe87f5..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.apps.requests.AppsListRequest; -import com.pipedream.api.types.App; -import com.pipedream.api.types.GetAppResponse; -import java.util.concurrent.CompletableFuture; - -public class AsyncAppsClient { - protected final ClientOptions clientOptions; - - private final AsyncRawAppsClient rawClient; - - public AsyncAppsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawAppsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawAppsClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture> list() { - return this.rawClient.list().thenApply(response -> response.body()); - } - - public CompletableFuture> list(AppsListRequest request) { - return this.rawClient.list(request).thenApply(response -> response.body()); - } - - public CompletableFuture> list(AppsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String appId) { - return this.rawClient.retrieve(appId).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String appId, RequestOptions requestOptions) { - return this.rawClient.retrieve(appId, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java deleted file mode 100644 index bd53d7d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java +++ /dev/null @@ -1,189 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.apps.requests.AppsListRequest; -import com.pipedream.api.types.App; -import com.pipedream.api.types.GetAppResponse; -import com.pipedream.api.types.ListAppsResponse; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawAppsClient { - protected final ClientOptions clientOptions; - - public AsyncRawAppsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture>> list() { - return list(AppsListRequest.builder().build()); - } - - public CompletableFuture>> list(AppsListRequest request) { - return list(request, null); - } - - public CompletableFuture>> list( - AppsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect/apps"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); - } - if (request.getSortKey().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "sort_key", request.getSortKey().get(), false); - } - if (request.getSortDirection().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "sort_direction", request.getSortDirection().get(), false); - } - if (request.getCategoryIds().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "category_ids", request.getCategoryIds().get(), true); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - ListAppsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListAppsResponse.class); - Optional startingAfter = - parsedResponse.getPageInfo().getEndCursor(); - AppsListRequest nextRequest = AppsListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - future.complete(new BaseClientHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> retrieve(String appId) { - return retrieve(appId, null); - } - - public CompletableFuture> retrieve( - String appId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect/apps") - .addPathSegment(appId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), GetAppResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java deleted file mode 100644 index 8b4a892..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.apps.requests.AppsListRequest; -import com.pipedream.api.types.App; -import com.pipedream.api.types.GetAppResponse; -import com.pipedream.api.types.ListAppsResponse; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawAppsClient { - protected final ClientOptions clientOptions; - - public RawAppsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse> list() { - return list(AppsListRequest.builder().build()); - } - - public BaseClientHttpResponse> list(AppsListRequest request) { - return list(request, null); - } - - public BaseClientHttpResponse> list( - AppsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect/apps"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); - } - if (request.getSortKey().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "sort_key", request.getSortKey().get(), false); - } - if (request.getSortDirection().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "sort_direction", request.getSortDirection().get(), false); - } - if (request.getCategoryIds().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "category_ids", request.getCategoryIds().get(), true); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - ListAppsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListAppsResponse.class); - Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - AppsListRequest nextRequest = AppsListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - return new BaseClientHttpResponse<>( - new SyncPagingIterable( - startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) - .body()), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse retrieve(String appId) { - return retrieve(appId, null); - } - - public BaseClientHttpResponse retrieve(String appId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect/apps") - .addPathSegment(appId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetAppResponse.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java deleted file mode 100644 index 5e13f36..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps.requests; - -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 com.pipedream.api.resources.apps.types.AppsListRequestSortDirection; -import com.pipedream.api.resources.apps.types.AppsListRequestSortKey; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AppsListRequest.Builder.class) -public final class AppsListRequest { - private final Optional> categoryIds; - - private final Optional after; - - private final Optional before; - - private final Optional limit; - - private final Optional q; - - private final Optional sortKey; - - private final Optional sortDirection; - - private final Map additionalProperties; - - private AppsListRequest( - Optional> categoryIds, - Optional after, - Optional before, - Optional limit, - Optional q, - Optional sortKey, - Optional sortDirection, - Map additionalProperties) { - this.categoryIds = categoryIds; - this.after = after; - this.before = before; - this.limit = limit; - this.q = q; - this.sortKey = sortKey; - this.sortDirection = sortDirection; - this.additionalProperties = additionalProperties; - } - - /** - * @return Only return apps in these categories - */ - @JsonProperty("category_ids") - public Optional> getCategoryIds() { - return categoryIds; - } - - /** - * @return The cursor to start from for pagination - */ - @JsonProperty("after") - public Optional getAfter() { - return after; - } - - /** - * @return The cursor to end before for pagination - */ - @JsonProperty("before") - public Optional getBefore() { - return before; - } - - /** - * @return The maximum number of results to return - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return A search query to filter the apps - */ - @JsonProperty("q") - public Optional getQ() { - return q; - } - - /** - * @return The key to sort the apps by - */ - @JsonProperty("sort_key") - public Optional getSortKey() { - return sortKey; - } - - /** - * @return The direction to sort the apps - */ - @JsonProperty("sort_direction") - public Optional getSortDirection() { - return sortDirection; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AppsListRequest && equalTo((AppsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AppsListRequest other) { - return categoryIds.equals(other.categoryIds) - && after.equals(other.after) - && before.equals(other.before) - && limit.equals(other.limit) - && q.equals(other.q) - && sortKey.equals(other.sortKey) - && sortDirection.equals(other.sortDirection); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.categoryIds, this.after, this.before, this.limit, this.q, this.sortKey, this.sortDirection); - } - - @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> categoryIds = Optional.empty(); - - private Optional after = Optional.empty(); - - private Optional before = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional q = Optional.empty(); - - private Optional sortKey = Optional.empty(); - - private Optional sortDirection = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AppsListRequest other) { - categoryIds(other.getCategoryIds()); - after(other.getAfter()); - before(other.getBefore()); - limit(other.getLimit()); - q(other.getQ()); - sortKey(other.getSortKey()); - sortDirection(other.getSortDirection()); - return this; - } - - /** - *

Only return apps in these categories

- */ - @JsonSetter(value = "category_ids", nulls = Nulls.SKIP) - public Builder categoryIds(Optional> categoryIds) { - this.categoryIds = categoryIds; - return this; - } - - public Builder categoryIds(List categoryIds) { - this.categoryIds = Optional.ofNullable(categoryIds); - return this; - } - - public Builder categoryIds(String categoryIds) { - this.categoryIds = Optional.of(Collections.singletonList(categoryIds)); - return this; - } - - /** - *

The cursor to start from for pagination

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

The cursor to end before for pagination

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

The maximum number of results to return

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

A search query to filter the apps

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

The key to sort the apps by

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

The direction to sort the apps

- */ - @JsonSetter(value = "sort_direction", nulls = Nulls.SKIP) - public Builder sortDirection(Optional sortDirection) { - this.sortDirection = sortDirection; - return this; - } - - public Builder sortDirection(AppsListRequestSortDirection sortDirection) { - this.sortDirection = Optional.ofNullable(sortDirection); - return this; - } - - public AppsListRequest build() { - return new AppsListRequest( - categoryIds, after, before, limit, q, sortKey, sortDirection, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortDirection.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortDirection.java deleted file mode 100644 index 18cc793..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortDirection.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AppsListRequestSortDirection { - ASC("asc"), - - DESC("desc"); - - private final String value; - - AppsListRequestSortDirection(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java deleted file mode 100644 index 7260231..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AppsListRequestSortKey { - NAME("name"), - - NAME_SLUG("name_slug"), - - FEATURED_WEIGHT("featured_weight"); - - private final String value; - - AppsListRequestSortKey(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncComponentsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncComponentsClient.java deleted file mode 100644 index c5934f3..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncComponentsClient.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.components; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.components.requests.ComponentsConfigurePropRequest; -import com.pipedream.api.resources.components.requests.ComponentsListRequest; -import com.pipedream.api.resources.components.requests.ComponentsReloadPropsRequest; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import java.util.concurrent.CompletableFuture; - -public class AsyncComponentsClient { - protected final ClientOptions clientOptions; - - private final AsyncRawComponentsClient rawClient; - - public AsyncComponentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawComponentsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawComponentsClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture> list() { - return this.rawClient.list().thenApply(response -> response.body()); - } - - public CompletableFuture> list(ComponentsListRequest request) { - return this.rawClient.list(request).thenApply(response -> response.body()); - } - - public CompletableFuture> list( - ComponentsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String componentId) { - return this.rawClient.retrieve(componentId).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String componentId, RequestOptions requestOptions) { - return this.rawClient.retrieve(componentId, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture configureProp(ComponentsConfigurePropRequest request) { - return this.rawClient.configureProp(request).thenApply(response -> response.body()); - } - - public CompletableFuture configureProp( - ComponentsConfigurePropRequest request, RequestOptions requestOptions) { - return this.rawClient.configureProp(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture reloadProps(ComponentsReloadPropsRequest request) { - return this.rawClient.reloadProps(request).thenApply(response -> response.body()); - } - - public CompletableFuture reloadProps( - ComponentsReloadPropsRequest request, RequestOptions requestOptions) { - return this.rawClient.reloadProps(request, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java deleted file mode 100644 index f0e05a6..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java +++ /dev/null @@ -1,321 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.components; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.components.requests.ComponentsConfigurePropRequest; -import com.pipedream.api.resources.components.requests.ComponentsListRequest; -import com.pipedream.api.resources.components.requests.ComponentsReloadPropsRequest; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.GetComponentResponse; -import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawComponentsClient { - protected final ClientOptions clientOptions; - - public AsyncRawComponentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture>> list() { - return list(ComponentsListRequest.builder().build()); - } - - public CompletableFuture>> list( - ComponentsListRequest request) { - return list(request, null); - } - - public CompletableFuture>> list( - ComponentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("components"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); - } - if (request.getApp().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "app", request.getApp().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); - Optional startingAfter = - parsedResponse.getPageInfo().getEndCursor(); - ComponentsListRequest nextRequest = ComponentsListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - future.complete(new BaseClientHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> retrieve(String componentId) { - return retrieve(componentId, null); - } - - public CompletableFuture> retrieve( - String componentId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("components") - .addPathSegment(componentId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> configureProp( - ComponentsConfigurePropRequest request) { - return configureProp(request, null); - } - - public CompletableFuture> configureProp( - ComponentsConfigurePropRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("components/configure") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), ConfigurePropResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> reloadProps( - ComponentsReloadPropsRequest request) { - return reloadProps(request, null); - } - - public CompletableFuture> reloadProps( - ComponentsReloadPropsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("components/props") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), ReloadPropsResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/ComponentsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/ComponentsClient.java deleted file mode 100644 index f273dcb..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/ComponentsClient.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.components; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.components.requests.ComponentsConfigurePropRequest; -import com.pipedream.api.resources.components.requests.ComponentsListRequest; -import com.pipedream.api.resources.components.requests.ComponentsReloadPropsRequest; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.ReloadPropsResponse; - -public class ComponentsClient { - protected final ClientOptions clientOptions; - - private final RawComponentsClient rawClient; - - public ComponentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawComponentsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawComponentsClient withRawResponse() { - return this.rawClient; - } - - public SyncPagingIterable list() { - return this.rawClient.list().body(); - } - - public SyncPagingIterable list(ComponentsListRequest request) { - return this.rawClient.list(request).body(); - } - - public SyncPagingIterable list(ComponentsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); - } - - public Component retrieve(String componentId) { - return this.rawClient.retrieve(componentId).body(); - } - - public Component retrieve(String componentId, RequestOptions requestOptions) { - return this.rawClient.retrieve(componentId, requestOptions).body(); - } - - public ConfigurePropResponse configureProp(ComponentsConfigurePropRequest request) { - return this.rawClient.configureProp(request).body(); - } - - public ConfigurePropResponse configureProp(ComponentsConfigurePropRequest request, RequestOptions requestOptions) { - return this.rawClient.configureProp(request, requestOptions).body(); - } - - public ReloadPropsResponse reloadProps(ComponentsReloadPropsRequest request) { - return this.rawClient.reloadProps(request).body(); - } - - public ReloadPropsResponse reloadProps(ComponentsReloadPropsRequest request, RequestOptions requestOptions) { - return this.rawClient.reloadProps(request, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java deleted file mode 100644 index 9cd5a6f..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java +++ /dev/null @@ -1,253 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.components; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.components.requests.ComponentsConfigurePropRequest; -import com.pipedream.api.resources.components.requests.ComponentsListRequest; -import com.pipedream.api.resources.components.requests.ComponentsReloadPropsRequest; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.GetComponentResponse; -import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawComponentsClient { - protected final ClientOptions clientOptions; - - public RawComponentsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse> list() { - return list(ComponentsListRequest.builder().build()); - } - - public BaseClientHttpResponse> list(ComponentsListRequest request) { - return list(request, null); - } - - public BaseClientHttpResponse> list( - ComponentsListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("components"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); - } - if (request.getApp().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "app", request.getApp().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); - Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - ComponentsListRequest nextRequest = ComponentsListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - return new BaseClientHttpResponse<>( - new SyncPagingIterable( - startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) - .body()), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse retrieve(String componentId) { - return retrieve(componentId, null); - } - - public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("components") - .addPathSegment(componentId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new BaseClientHttpResponse<>(parsedResponse.getData(), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse configureProp(ComponentsConfigurePropRequest request) { - return configureProp(request, null); - } - - public BaseClientHttpResponse configureProp( - ComponentsConfigurePropRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("components/configure") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse reloadProps(ComponentsReloadPropsRequest request) { - return reloadProps(request, null); - } - - public BaseClientHttpResponse reloadProps( - ComponentsReloadPropsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("components/props") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsConfigurePropRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsConfigurePropRequest.java deleted file mode 100644 index 541a93e..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsConfigurePropRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.components.requests; - -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 com.pipedream.api.types.ConfigurePropOpts; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ComponentsConfigurePropRequest.Builder.class) -public final class ComponentsConfigurePropRequest { - private final Optional asyncHandle; - - private final ConfigurePropOpts body; - - private final Map additionalProperties; - - private ComponentsConfigurePropRequest( - Optional asyncHandle, ConfigurePropOpts body, Map additionalProperties) { - this.asyncHandle = asyncHandle; - this.body = body; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("x-async-handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - @JsonProperty("body") - public ConfigurePropOpts getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ComponentsConfigurePropRequest && equalTo((ComponentsConfigurePropRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ComponentsConfigurePropRequest other) { - return asyncHandle.equals(other.asyncHandle) && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncHandle, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BodyStage builder() { - return new Builder(); - } - - public interface BodyStage { - _FinalStage body(@NotNull ConfigurePropOpts body); - - Builder from(ComponentsConfigurePropRequest other); - } - - public interface _FinalStage { - ComponentsConfigurePropRequest build(); - - _FinalStage asyncHandle(Optional asyncHandle); - - _FinalStage asyncHandle(String asyncHandle); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BodyStage, _FinalStage { - private ConfigurePropOpts body; - - private Optional asyncHandle = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ComponentsConfigurePropRequest other) { - asyncHandle(other.getAsyncHandle()); - body(other.getBody()); - return this; - } - - @java.lang.Override - @JsonSetter("body") - public _FinalStage body(@NotNull ConfigurePropOpts body) { - this.body = Objects.requireNonNull(body, "body must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage asyncHandle(String asyncHandle) { - this.asyncHandle = Optional.ofNullable(asyncHandle); - return this; - } - - @java.lang.Override - @JsonSetter(value = "x-async-handle", nulls = Nulls.SKIP) - public _FinalStage asyncHandle(Optional asyncHandle) { - this.asyncHandle = asyncHandle; - return this; - } - - @java.lang.Override - public ComponentsConfigurePropRequest build() { - return new ComponentsConfigurePropRequest(asyncHandle, body, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsListRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsListRequest.java deleted file mode 100644 index 8d5b23b..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsListRequest.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.components.requests; - -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 = ComponentsListRequest.Builder.class) -public final class ComponentsListRequest { - private final Optional after; - - private final Optional before; - - private final Optional limit; - - private final Optional q; - - private final Optional app; - - private final Map additionalProperties; - - private ComponentsListRequest( - Optional after, - Optional before, - Optional limit, - Optional q, - Optional app, - Map additionalProperties) { - this.after = after; - this.before = before; - this.limit = limit; - this.q = q; - this.app = app; - this.additionalProperties = additionalProperties; - } - - /** - * @return The cursor to start from for pagination - */ - @JsonProperty("after") - public Optional getAfter() { - return after; - } - - /** - * @return The cursor to end before for pagination - */ - @JsonProperty("before") - public Optional getBefore() { - return before; - } - - /** - * @return The maximum number of results to return - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return A search query to filter the components - */ - @JsonProperty("q") - public Optional getQ() { - return q; - } - - /** - * @return The ID or name slug of the app to filter the components - */ - @JsonProperty("app") - public Optional getApp() { - return app; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ComponentsListRequest && equalTo((ComponentsListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ComponentsListRequest other) { - return after.equals(other.after) - && before.equals(other.before) - && limit.equals(other.limit) - && q.equals(other.q) - && app.equals(other.app); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.after, this.before, this.limit, this.q, this.app); - } - - @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 after = Optional.empty(); - - private Optional before = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional q = Optional.empty(); - - private Optional app = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ComponentsListRequest other) { - after(other.getAfter()); - before(other.getBefore()); - limit(other.getLimit()); - q(other.getQ()); - app(other.getApp()); - return this; - } - - /** - *

The cursor to start from for pagination

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

The cursor to end before for pagination

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

The maximum number of results to return

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

A search query to filter the components

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

The ID or name slug of the app to filter the components

- */ - @JsonSetter(value = "app", nulls = Nulls.SKIP) - public Builder app(Optional app) { - this.app = app; - return this; - } - - public Builder app(String app) { - this.app = Optional.ofNullable(app); - return this; - } - - public ComponentsListRequest build() { - return new ComponentsListRequest(after, before, limit, q, app, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsReloadPropsRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsReloadPropsRequest.java deleted file mode 100644 index 960dc66..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/requests/ComponentsReloadPropsRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.components.requests; - -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 com.pipedream.api.types.ReloadPropsOpts; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ComponentsReloadPropsRequest.Builder.class) -public final class ComponentsReloadPropsRequest { - private final Optional asyncHandle; - - private final ReloadPropsOpts body; - - private final Map additionalProperties; - - private ComponentsReloadPropsRequest( - Optional asyncHandle, ReloadPropsOpts body, Map additionalProperties) { - this.asyncHandle = asyncHandle; - this.body = body; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("x-async-handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - @JsonProperty("body") - public ReloadPropsOpts getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ComponentsReloadPropsRequest && equalTo((ComponentsReloadPropsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ComponentsReloadPropsRequest other) { - return asyncHandle.equals(other.asyncHandle) && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncHandle, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BodyStage builder() { - return new Builder(); - } - - public interface BodyStage { - _FinalStage body(@NotNull ReloadPropsOpts body); - - Builder from(ComponentsReloadPropsRequest other); - } - - public interface _FinalStage { - ComponentsReloadPropsRequest build(); - - _FinalStage asyncHandle(Optional asyncHandle); - - _FinalStage asyncHandle(String asyncHandle); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BodyStage, _FinalStage { - private ReloadPropsOpts body; - - private Optional asyncHandle = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ComponentsReloadPropsRequest other) { - asyncHandle(other.getAsyncHandle()); - body(other.getBody()); - return this; - } - - @java.lang.Override - @JsonSetter("body") - public _FinalStage body(@NotNull ReloadPropsOpts body) { - this.body = Objects.requireNonNull(body, "body must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage asyncHandle(String asyncHandle) { - this.asyncHandle = Optional.ofNullable(asyncHandle); - return this; - } - - @java.lang.Override - @JsonSetter(value = "x-async-handle", nulls = Nulls.SKIP) - public _FinalStage asyncHandle(Optional asyncHandle) { - this.asyncHandle = asyncHandle; - return this; - } - - @java.lang.Override - public ComponentsReloadPropsRequest build() { - return new ComponentsReloadPropsRequest(asyncHandle, body, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncDeployedTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncDeployedTriggersClient.java deleted file mode 100644 index bc6b458..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncDeployedTriggersClient.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersDeleteRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListEventsRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWebhooksRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWorkflowsRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveRequest; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWebhooksOpts; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWorkflowsOpts; -import com.pipedream.api.types.DeployedComponent; -import com.pipedream.api.types.EmittedEvent; -import com.pipedream.api.types.GetTriggerWebhooksResponse; -import com.pipedream.api.types.GetTriggerWorkflowsResponse; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -public class AsyncDeployedTriggersClient { - protected final ClientOptions clientOptions; - - private final AsyncRawDeployedTriggersClient rawClient; - - public AsyncDeployedTriggersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawDeployedTriggersClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawDeployedTriggersClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture> list(DeployedTriggersListRequest request) { - return this.rawClient.list(request).thenApply(response -> response.body()); - } - - public CompletableFuture> list( - DeployedTriggersListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String triggerId, DeployedTriggersRetrieveRequest request) { - return this.rawClient.retrieve(triggerId, request).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve( - String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { - return this.rawClient.retrieve(triggerId, request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture update(String triggerId, UpdateTriggerOpts request) { - return this.rawClient.update(triggerId, request).thenApply(response -> response.body()); - } - - public CompletableFuture update( - String triggerId, UpdateTriggerOpts request, RequestOptions requestOptions) { - return this.rawClient.update(triggerId, request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture delete(String triggerId, DeployedTriggersDeleteRequest request) { - return this.rawClient.delete(triggerId, request).thenApply(response -> response.body()); - } - - public CompletableFuture delete( - String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { - return this.rawClient.delete(triggerId, request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture> listEvents( - String triggerId, DeployedTriggersListEventsRequest request) { - return this.rawClient.listEvents(triggerId, request).thenApply(response -> response.body()); - } - - public CompletableFuture> listEvents( - String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { - return this.rawClient.listEvents(triggerId, request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request) { - return this.rawClient.listWorkflows(triggerId, request).thenApply(response -> response.body()); - } - - public CompletableFuture listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { - return this.rawClient.listWorkflows(triggerId, request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture updateWorkflows( - String triggerId, UpdateTriggerWorkflowsOpts request) { - return this.rawClient.updateWorkflows(triggerId, request).thenApply(response -> response.body()); - } - - public CompletableFuture updateWorkflows( - String triggerId, UpdateTriggerWorkflowsOpts request, RequestOptions requestOptions) { - return this.rawClient - .updateWorkflows(triggerId, request, requestOptions) - .thenApply(response -> response.body()); - } - - public CompletableFuture listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request) { - return this.rawClient.listWebhooks(triggerId, request).thenApply(response -> response.body()); - } - - public CompletableFuture listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { - return this.rawClient.listWebhooks(triggerId, request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture updateWebhooks( - String triggerId, UpdateTriggerWebhooksOpts request) { - return this.rawClient.updateWebhooks(triggerId, request).thenApply(response -> response.body()); - } - - public CompletableFuture updateWebhooks( - String triggerId, UpdateTriggerWebhooksOpts request, RequestOptions requestOptions) { - return this.rawClient.updateWebhooks(triggerId, request, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java deleted file mode 100644 index e91dca3..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java +++ /dev/null @@ -1,630 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersDeleteRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListEventsRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWebhooksRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWorkflowsRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveRequest; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWebhooksOpts; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWorkflowsOpts; -import com.pipedream.api.types.DeployedComponent; -import com.pipedream.api.types.EmittedEvent; -import com.pipedream.api.types.GetTriggerEventsResponse; -import com.pipedream.api.types.GetTriggerResponse; -import com.pipedream.api.types.GetTriggerWebhooksResponse; -import com.pipedream.api.types.GetTriggerWorkflowsResponse; -import com.pipedream.api.types.GetTriggersResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawDeployedTriggersClient { - protected final ClientOptions clientOptions; - - public AsyncRawDeployedTriggersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture>> list( - DeployedTriggersListRequest request) { - return list(request, null); - } - - public CompletableFuture>> list( - DeployedTriggersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetTriggersResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggersResponse.class); - Optional startingAfter = - parsedResponse.getPageInfo().getEndCursor(); - DeployedTriggersListRequest nextRequest = DeployedTriggersListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - future.complete(new BaseClientHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> retrieve( - String triggerId, DeployedTriggersRetrieveRequest request) { - return retrieve(triggerId, request, null); - } - - public CompletableFuture> retrieve( - String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> update( - String triggerId, UpdateTriggerOpts request) { - return update(triggerId, request, null); - } - - public CompletableFuture> update( - String triggerId, UpdateTriggerOpts request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Map properties = new HashMap<>(); - if (request.getActive().isPresent()) { - properties.put("active", request.getActive()); - } - if (request.getConfiguredProps().isPresent()) { - properties.put("configured_props", request.getConfiguredProps()); - } - if (request.getName().isPresent()) { - properties.put("name", request.getName()); - } - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> delete( - String triggerId, DeployedTriggersDeleteRequest request) { - return delete(triggerId, request, null); - } - - public CompletableFuture> delete( - String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - if (request.getIgnoreHookErrors().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "ignore_hook_errors", request.getIgnoreHookErrors().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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<>(null, response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture>> listEvents( - String triggerId, DeployedTriggersListEventsRequest request) { - return listEvents(triggerId, request, null); - } - - public CompletableFuture>> listEvents( - String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("events"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - if (request.getN().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "n", request.getN().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetTriggerEventsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), GetTriggerEventsResponse.class); - future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request) { - return listWorkflows(triggerId, request, null); - } - - public CompletableFuture> listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("pipelines"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), GetTriggerWorkflowsResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> updateWorkflows( - String triggerId, UpdateTriggerWorkflowsOpts request) { - return updateWorkflows(triggerId, request, null); - } - - public CompletableFuture> updateWorkflows( - String triggerId, UpdateTriggerWorkflowsOpts request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("pipelines"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Map properties = new HashMap<>(); - properties.put("workflow_ids", request.getWorkflowIds()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), GetTriggerWorkflowsResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request) { - return listWebhooks(triggerId, request, null); - } - - public CompletableFuture> listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("webhooks"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), GetTriggerWebhooksResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> updateWebhooks( - String triggerId, UpdateTriggerWebhooksOpts request) { - return updateWebhooks(triggerId, request, null); - } - - public CompletableFuture> updateWebhooks( - String triggerId, UpdateTriggerWebhooksOpts request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("webhooks"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Map properties = new HashMap<>(); - properties.put("webhook_urls", request.getWebhookUrls()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), GetTriggerWebhooksResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/DeployedTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/DeployedTriggersClient.java deleted file mode 100644 index 891ce12..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/DeployedTriggersClient.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersDeleteRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListEventsRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWebhooksRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWorkflowsRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveRequest; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWebhooksOpts; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWorkflowsOpts; -import com.pipedream.api.types.DeployedComponent; -import com.pipedream.api.types.EmittedEvent; -import com.pipedream.api.types.GetTriggerWebhooksResponse; -import com.pipedream.api.types.GetTriggerWorkflowsResponse; -import java.util.List; - -public class DeployedTriggersClient { - protected final ClientOptions clientOptions; - - private final RawDeployedTriggersClient rawClient; - - public DeployedTriggersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawDeployedTriggersClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawDeployedTriggersClient withRawResponse() { - return this.rawClient; - } - - public SyncPagingIterable list(DeployedTriggersListRequest request) { - return this.rawClient.list(request).body(); - } - - public SyncPagingIterable list( - DeployedTriggersListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); - } - - public DeployedComponent retrieve(String triggerId, DeployedTriggersRetrieveRequest request) { - return this.rawClient.retrieve(triggerId, request).body(); - } - - public DeployedComponent retrieve( - String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { - return this.rawClient.retrieve(triggerId, request, requestOptions).body(); - } - - public DeployedComponent update(String triggerId, UpdateTriggerOpts request) { - return this.rawClient.update(triggerId, request).body(); - } - - public DeployedComponent update(String triggerId, UpdateTriggerOpts request, RequestOptions requestOptions) { - return this.rawClient.update(triggerId, request, requestOptions).body(); - } - - public void delete(String triggerId, DeployedTriggersDeleteRequest request) { - this.rawClient.delete(triggerId, request).body(); - } - - public void delete(String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { - this.rawClient.delete(triggerId, request, requestOptions).body(); - } - - public List listEvents(String triggerId, DeployedTriggersListEventsRequest request) { - return this.rawClient.listEvents(triggerId, request).body(); - } - - public List listEvents( - String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { - return this.rawClient.listEvents(triggerId, request, requestOptions).body(); - } - - public GetTriggerWorkflowsResponse listWorkflows(String triggerId, DeployedTriggersListWorkflowsRequest request) { - return this.rawClient.listWorkflows(triggerId, request).body(); - } - - public GetTriggerWorkflowsResponse listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { - return this.rawClient.listWorkflows(triggerId, request, requestOptions).body(); - } - - public GetTriggerWorkflowsResponse updateWorkflows(String triggerId, UpdateTriggerWorkflowsOpts request) { - return this.rawClient.updateWorkflows(triggerId, request).body(); - } - - public GetTriggerWorkflowsResponse updateWorkflows( - String triggerId, UpdateTriggerWorkflowsOpts request, RequestOptions requestOptions) { - return this.rawClient - .updateWorkflows(triggerId, request, requestOptions) - .body(); - } - - public GetTriggerWebhooksResponse listWebhooks(String triggerId, DeployedTriggersListWebhooksRequest request) { - return this.rawClient.listWebhooks(triggerId, request).body(); - } - - public GetTriggerWebhooksResponse listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { - return this.rawClient.listWebhooks(triggerId, request, requestOptions).body(); - } - - public GetTriggerWebhooksResponse updateWebhooks(String triggerId, UpdateTriggerWebhooksOpts request) { - return this.rawClient.updateWebhooks(triggerId, request).body(); - } - - public GetTriggerWebhooksResponse updateWebhooks( - String triggerId, UpdateTriggerWebhooksOpts request, RequestOptions requestOptions) { - return this.rawClient.updateWebhooks(triggerId, request, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java deleted file mode 100644 index 837d672..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java +++ /dev/null @@ -1,493 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersDeleteRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListEventsRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWebhooksRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWorkflowsRequest; -import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveRequest; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWebhooksOpts; -import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWorkflowsOpts; -import com.pipedream.api.types.DeployedComponent; -import com.pipedream.api.types.EmittedEvent; -import com.pipedream.api.types.GetTriggerEventsResponse; -import com.pipedream.api.types.GetTriggerResponse; -import com.pipedream.api.types.GetTriggerWebhooksResponse; -import com.pipedream.api.types.GetTriggerWorkflowsResponse; -import com.pipedream.api.types.GetTriggersResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawDeployedTriggersClient { - protected final ClientOptions clientOptions; - - public RawDeployedTriggersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse> list(DeployedTriggersListRequest request) { - return list(request, null); - } - - public BaseClientHttpResponse> list( - DeployedTriggersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetTriggersResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggersResponse.class); - Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - DeployedTriggersListRequest nextRequest = DeployedTriggersListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - return new BaseClientHttpResponse<>( - new SyncPagingIterable( - startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) - .body()), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse retrieve( - String triggerId, DeployedTriggersRetrieveRequest request) { - return retrieve(triggerId, request, null); - } - - public BaseClientHttpResponse retrieve( - String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - return new BaseClientHttpResponse<>(parsedResponse.getData(), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse update(String triggerId, UpdateTriggerOpts request) { - return update(triggerId, request, null); - } - - public BaseClientHttpResponse update( - String triggerId, UpdateTriggerOpts request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Map properties = new HashMap<>(); - if (request.getActive().isPresent()) { - properties.put("active", request.getActive()); - } - if (request.getConfiguredProps().isPresent()) { - properties.put("configured_props", request.getConfiguredProps()); - } - if (request.getName().isPresent()) { - properties.put("name", request.getName()); - } - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - return new BaseClientHttpResponse<>(parsedResponse.getData(), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse delete(String triggerId, DeployedTriggersDeleteRequest request) { - return delete(triggerId, request, null); - } - - public BaseClientHttpResponse delete( - String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - if (request.getIgnoreHookErrors().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "ignore_hook_errors", request.getIgnoreHookErrors().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>(null, response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse> listEvents( - String triggerId, DeployedTriggersListEventsRequest request) { - return listEvents(triggerId, request, null); - } - - public BaseClientHttpResponse> listEvents( - String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("events"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - if (request.getN().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "n", request.getN().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetTriggerEventsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerEventsResponse.class); - return new BaseClientHttpResponse<>(parsedResponse.getData(), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request) { - return listWorkflows(triggerId, request, null); - } - - public BaseClientHttpResponse listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("pipelines"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWorkflowsResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse updateWorkflows( - String triggerId, UpdateTriggerWorkflowsOpts request) { - return updateWorkflows(triggerId, request, null); - } - - public BaseClientHttpResponse updateWorkflows( - String triggerId, UpdateTriggerWorkflowsOpts request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("pipelines"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Map properties = new HashMap<>(); - properties.put("workflow_ids", request.getWorkflowIds()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWorkflowsResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request) { - return listWebhooks(triggerId, request, null); - } - - public BaseClientHttpResponse listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("webhooks"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWebhooksResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse updateWebhooks( - String triggerId, UpdateTriggerWebhooksOpts request) { - return updateWebhooks(triggerId, request, null); - } - - public BaseClientHttpResponse updateWebhooks( - String triggerId, UpdateTriggerWebhooksOpts request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("deployed-triggers") - .addPathSegment(triggerId) - .addPathSegments("webhooks"); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - Map properties = new HashMap<>(); - properties.put("webhook_urls", request.getWebhookUrls()); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWebhooksResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersDeleteRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersDeleteRequest.java deleted file mode 100644 index 3989d6e..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersDeleteRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersDeleteRequest.Builder.class) -public final class DeployedTriggersDeleteRequest { - private final String externalUserId; - - private final Optional ignoreHookErrors; - - private final Map additionalProperties; - - private DeployedTriggersDeleteRequest( - String externalUserId, Optional ignoreHookErrors, Map additionalProperties) { - this.externalUserId = externalUserId; - this.ignoreHookErrors = ignoreHookErrors; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID who owns the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return Whether to ignore errors during deactivation hook - */ - @JsonProperty("ignore_hook_errors") - public Optional getIgnoreHookErrors() { - return ignoreHookErrors; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployedTriggersDeleteRequest && equalTo((DeployedTriggersDeleteRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployedTriggersDeleteRequest other) { - return externalUserId.equals(other.externalUserId) && ignoreHookErrors.equals(other.ignoreHookErrors); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.ignoreHookErrors); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID who owns the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(DeployedTriggersDeleteRequest other); - } - - public interface _FinalStage { - DeployedTriggersDeleteRequest build(); - - /** - *

Whether to ignore errors during deactivation hook

- */ - _FinalStage ignoreHookErrors(Optional ignoreHookErrors); - - _FinalStage ignoreHookErrors(Boolean ignoreHookErrors); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - private Optional ignoreHookErrors = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployedTriggersDeleteRequest other) { - externalUserId(other.getExternalUserId()); - ignoreHookErrors(other.getIgnoreHookErrors()); - return this; - } - - /** - *

The external user ID who owns the trigger

- *

The external user ID who owns the trigger

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

Whether to ignore errors during deactivation hook

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

Whether to ignore errors during deactivation hook

- */ - @java.lang.Override - @JsonSetter(value = "ignore_hook_errors", nulls = Nulls.SKIP) - public _FinalStage ignoreHookErrors(Optional ignoreHookErrors) { - this.ignoreHookErrors = ignoreHookErrors; - return this; - } - - @java.lang.Override - public DeployedTriggersDeleteRequest build() { - return new DeployedTriggersDeleteRequest(externalUserId, ignoreHookErrors, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListEventsRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListEventsRequest.java deleted file mode 100644 index e3015b2..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListEventsRequest.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersListEventsRequest.Builder.class) -public final class DeployedTriggersListEventsRequest { - private final String externalUserId; - - private final Optional n; - - private final Map additionalProperties; - - private DeployedTriggersListEventsRequest( - String externalUserId, Optional n, Map additionalProperties) { - this.externalUserId = externalUserId; - this.n = n; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user ID, for whom you deployed the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The number of events to retrieve (defaults to 20 if not provided) - */ - @JsonProperty("n") - public Optional getN() { - return n; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployedTriggersListEventsRequest && equalTo((DeployedTriggersListEventsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployedTriggersListEventsRequest other) { - return externalUserId.equals(other.externalUserId) && n.equals(other.n); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.n); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

Your end user ID, for whom you deployed the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(DeployedTriggersListEventsRequest other); - } - - public interface _FinalStage { - DeployedTriggersListEventsRequest build(); - - /** - *

The number of events to retrieve (defaults to 20 if not provided)

- */ - _FinalStage n(Optional n); - - _FinalStage n(Integer n); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - private Optional n = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployedTriggersListEventsRequest other) { - externalUserId(other.getExternalUserId()); - n(other.getN()); - return this; - } - - /** - *

Your end user ID, for whom you deployed the trigger

- *

Your end user ID, for whom you deployed the trigger

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

The number of events to retrieve (defaults to 20 if not provided)

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

The number of events to retrieve (defaults to 20 if not provided)

- */ - @java.lang.Override - @JsonSetter(value = "n", nulls = Nulls.SKIP) - public _FinalStage n(Optional n) { - this.n = n; - return this; - } - - @java.lang.Override - public DeployedTriggersListEventsRequest build() { - return new DeployedTriggersListEventsRequest(externalUserId, n, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListRequest.java deleted file mode 100644 index 556c4f0..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListRequest.java +++ /dev/null @@ -1,246 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersListRequest.Builder.class) -public final class DeployedTriggersListRequest { - private final Optional after; - - private final Optional before; - - private final Optional limit; - - private final String externalUserId; - - private final Map additionalProperties; - - private DeployedTriggersListRequest( - Optional after, - Optional before, - Optional limit, - String externalUserId, - Map additionalProperties) { - this.after = after; - this.before = before; - this.limit = limit; - this.externalUserId = externalUserId; - this.additionalProperties = additionalProperties; - } - - /** - * @return The cursor to start from for pagination - */ - @JsonProperty("after") - public Optional getAfter() { - return after; - } - - /** - * @return The cursor to end before for pagination - */ - @JsonProperty("before") - public Optional getBefore() { - return before; - } - - /** - * @return The maximum number of results to return - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return Your end user ID, for whom you deployed the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployedTriggersListRequest && equalTo((DeployedTriggersListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployedTriggersListRequest other) { - return after.equals(other.after) - && before.equals(other.before) - && limit.equals(other.limit) - && externalUserId.equals(other.externalUserId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.after, this.before, this.limit, this.externalUserId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

Your end user ID, for whom you deployed the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(DeployedTriggersListRequest other); - } - - public interface _FinalStage { - DeployedTriggersListRequest build(); - - /** - *

The cursor to start from for pagination

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

The cursor to end before for pagination

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

The maximum number of results to return

- */ - _FinalStage limit(Optional limit); - - _FinalStage limit(Integer limit); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - private Optional limit = Optional.empty(); - - private Optional before = Optional.empty(); - - private Optional after = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployedTriggersListRequest other) { - after(other.getAfter()); - before(other.getBefore()); - limit(other.getLimit()); - externalUserId(other.getExternalUserId()); - return this; - } - - /** - *

Your end user ID, for whom you deployed the trigger

- *

Your end user ID, for whom you deployed the trigger

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

The maximum number of results to return

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

The maximum number of results to return

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

The cursor to end before for pagination

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

The cursor to end before for pagination

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

The cursor to start from for pagination

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

The cursor to start from for pagination

- */ - @java.lang.Override - @JsonSetter(value = "after", nulls = Nulls.SKIP) - public _FinalStage after(Optional after) { - this.after = after; - return this; - } - - @java.lang.Override - public DeployedTriggersListRequest build() { - return new DeployedTriggersListRequest(after, before, limit, externalUserId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWebhooksRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWebhooksRequest.java deleted file mode 100644 index 62cf4dd..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWebhooksRequest.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersListWebhooksRequest.Builder.class) -public final class DeployedTriggersListWebhooksRequest { - private final String externalUserId; - - private final Map additionalProperties; - - private DeployedTriggersListWebhooksRequest(String externalUserId, Map additionalProperties) { - this.externalUserId = externalUserId; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID who owns the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployedTriggersListWebhooksRequest - && equalTo((DeployedTriggersListWebhooksRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployedTriggersListWebhooksRequest other) { - return externalUserId.equals(other.externalUserId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID who owns the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(DeployedTriggersListWebhooksRequest other); - } - - public interface _FinalStage { - DeployedTriggersListWebhooksRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployedTriggersListWebhooksRequest other) { - externalUserId(other.getExternalUserId()); - return this; - } - - /** - *

The external user ID who owns the trigger

- *

The external user ID who owns the trigger

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("external_user_id") - public _FinalStage externalUserId(@NotNull String externalUserId) { - this.externalUserId = Objects.requireNonNull(externalUserId, "externalUserId must not be null"); - return this; - } - - @java.lang.Override - public DeployedTriggersListWebhooksRequest build() { - return new DeployedTriggersListWebhooksRequest(externalUserId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWorkflowsRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWorkflowsRequest.java deleted file mode 100644 index 95979ed..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWorkflowsRequest.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersListWorkflowsRequest.Builder.class) -public final class DeployedTriggersListWorkflowsRequest { - private final String externalUserId; - - private final Map additionalProperties; - - private DeployedTriggersListWorkflowsRequest(String externalUserId, Map additionalProperties) { - this.externalUserId = externalUserId; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID who owns the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployedTriggersListWorkflowsRequest - && equalTo((DeployedTriggersListWorkflowsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployedTriggersListWorkflowsRequest other) { - return externalUserId.equals(other.externalUserId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID who owns the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(DeployedTriggersListWorkflowsRequest other); - } - - public interface _FinalStage { - DeployedTriggersListWorkflowsRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployedTriggersListWorkflowsRequest other) { - externalUserId(other.getExternalUserId()); - return this; - } - - /** - *

The external user ID who owns the trigger

- *

The external user ID who owns the trigger

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("external_user_id") - public _FinalStage externalUserId(@NotNull String externalUserId) { - this.externalUserId = Objects.requireNonNull(externalUserId, "externalUserId must not be null"); - return this; - } - - @java.lang.Override - public DeployedTriggersListWorkflowsRequest build() { - return new DeployedTriggersListWorkflowsRequest(externalUserId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersRetrieveRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersRetrieveRequest.java deleted file mode 100644 index 4aab165..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersRetrieveRequest.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersRetrieveRequest.Builder.class) -public final class DeployedTriggersRetrieveRequest { - private final String externalUserId; - - private final Map additionalProperties; - - private DeployedTriggersRetrieveRequest(String externalUserId, Map additionalProperties) { - this.externalUserId = externalUserId; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user ID, for whom you deployed the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployedTriggersRetrieveRequest && equalTo((DeployedTriggersRetrieveRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployedTriggersRetrieveRequest other) { - return externalUserId.equals(other.externalUserId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

Your end user ID, for whom you deployed the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(DeployedTriggersRetrieveRequest other); - } - - public interface _FinalStage { - DeployedTriggersRetrieveRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployedTriggersRetrieveRequest other) { - externalUserId(other.getExternalUserId()); - return this; - } - - /** - *

Your end user ID, for whom you deployed the trigger

- *

Your end user ID, for whom you deployed the trigger

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("external_user_id") - public _FinalStage externalUserId(@NotNull String externalUserId) { - this.externalUserId = Objects.requireNonNull(externalUserId, "externalUserId must not be null"); - return this; - } - - @java.lang.Override - public DeployedTriggersRetrieveRequest build() { - return new DeployedTriggersRetrieveRequest(externalUserId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerOpts.java deleted file mode 100644 index 735cf4a..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerOpts.java +++ /dev/null @@ -1,246 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UpdateTriggerOpts.Builder.class) -public final class UpdateTriggerOpts { - private final String externalUserId; - - private final Optional active; - - private final Optional> configuredProps; - - private final Optional name; - - private final Map additionalProperties; - - private UpdateTriggerOpts( - String externalUserId, - Optional active, - Optional> configuredProps, - Optional name, - Map additionalProperties) { - this.externalUserId = externalUserId; - this.active = active; - this.configuredProps = configuredProps; - this.name = name; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID who owns the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return Whether the trigger should be active - */ - @JsonProperty("active") - public Optional getActive() { - return active; - } - - /** - * @return The configured properties for the trigger - */ - @JsonProperty("configured_props") - public Optional> getConfiguredProps() { - return configuredProps; - } - - /** - * @return The name of the trigger - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UpdateTriggerOpts && equalTo((UpdateTriggerOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UpdateTriggerOpts other) { - return externalUserId.equals(other.externalUserId) - && active.equals(other.active) - && configuredProps.equals(other.configuredProps) - && name.equals(other.name); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.active, this.configuredProps, this.name); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID who owns the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(UpdateTriggerOpts other); - } - - public interface _FinalStage { - UpdateTriggerOpts build(); - - /** - *

Whether the trigger should be active

- */ - _FinalStage active(Optional active); - - _FinalStage active(Boolean active); - - /** - *

The configured properties for the trigger

- */ - _FinalStage configuredProps(Optional> configuredProps); - - _FinalStage configuredProps(Map configuredProps); - - /** - *

The name of the trigger

- */ - _FinalStage name(Optional name); - - _FinalStage name(String name); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - private Optional name = Optional.empty(); - - private Optional> configuredProps = Optional.empty(); - - private Optional active = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(UpdateTriggerOpts other) { - externalUserId(other.getExternalUserId()); - active(other.getActive()); - configuredProps(other.getConfiguredProps()); - name(other.getName()); - return this; - } - - /** - *

The external user ID who owns the trigger

- *

The external user ID who owns the trigger

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

The name of the trigger

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

The name of the trigger

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

The configured properties for the trigger

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

The configured properties for the trigger

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

Whether the trigger should be active

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

Whether the trigger should be active

- */ - @java.lang.Override - @JsonSetter(value = "active", nulls = Nulls.SKIP) - public _FinalStage active(Optional active) { - this.active = active; - return this; - } - - @java.lang.Override - public UpdateTriggerOpts build() { - return new UpdateTriggerOpts(externalUserId, active, configuredProps, name, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerWebhooksOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerWebhooksOpts.java deleted file mode 100644 index d00d5fb..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerWebhooksOpts.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UpdateTriggerWebhooksOpts.Builder.class) -public final class UpdateTriggerWebhooksOpts { - private final String externalUserId; - - private final List webhookUrls; - - private final Map additionalProperties; - - private UpdateTriggerWebhooksOpts( - String externalUserId, List webhookUrls, Map additionalProperties) { - this.externalUserId = externalUserId; - this.webhookUrls = webhookUrls; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID who owns the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return Array of webhook URLs to set - */ - @JsonProperty("webhook_urls") - public List getWebhookUrls() { - return webhookUrls; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UpdateTriggerWebhooksOpts && equalTo((UpdateTriggerWebhooksOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UpdateTriggerWebhooksOpts other) { - return externalUserId.equals(other.externalUserId) && webhookUrls.equals(other.webhookUrls); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.webhookUrls); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID who owns the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(UpdateTriggerWebhooksOpts other); - } - - public interface _FinalStage { - UpdateTriggerWebhooksOpts build(); - - /** - *

Array of webhook URLs to set

- */ - _FinalStage webhookUrls(List webhookUrls); - - _FinalStage addWebhookUrls(String webhookUrls); - - _FinalStage addAllWebhookUrls(List webhookUrls); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - private List webhookUrls = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(UpdateTriggerWebhooksOpts other) { - externalUserId(other.getExternalUserId()); - webhookUrls(other.getWebhookUrls()); - return this; - } - - /** - *

The external user ID who owns the trigger

- *

The external user ID who owns the trigger

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

Array of webhook URLs to set

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllWebhookUrls(List webhookUrls) { - this.webhookUrls.addAll(webhookUrls); - return this; - } - - /** - *

Array of webhook URLs to set

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addWebhookUrls(String webhookUrls) { - this.webhookUrls.add(webhookUrls); - return this; - } - - /** - *

Array of webhook URLs to set

- */ - @java.lang.Override - @JsonSetter(value = "webhook_urls", nulls = Nulls.SKIP) - public _FinalStage webhookUrls(List webhookUrls) { - this.webhookUrls.clear(); - this.webhookUrls.addAll(webhookUrls); - return this; - } - - @java.lang.Override - public UpdateTriggerWebhooksOpts build() { - return new UpdateTriggerWebhooksOpts(externalUserId, webhookUrls, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerWorkflowsOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerWorkflowsOpts.java deleted file mode 100644 index 7022dd6..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/UpdateTriggerWorkflowsOpts.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.deployedtriggers.requests; - -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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = UpdateTriggerWorkflowsOpts.Builder.class) -public final class UpdateTriggerWorkflowsOpts { - private final String externalUserId; - - private final List workflowIds; - - private final Map additionalProperties; - - private UpdateTriggerWorkflowsOpts( - String externalUserId, List workflowIds, Map additionalProperties) { - this.externalUserId = externalUserId; - this.workflowIds = workflowIds; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID who owns the trigger - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return Array of workflow IDs to set - */ - @JsonProperty("workflow_ids") - public List getWorkflowIds() { - return workflowIds; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UpdateTriggerWorkflowsOpts && equalTo((UpdateTriggerWorkflowsOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(UpdateTriggerWorkflowsOpts other) { - return externalUserId.equals(other.externalUserId) && workflowIds.equals(other.workflowIds); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.workflowIds); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID who owns the trigger

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - - Builder from(UpdateTriggerWorkflowsOpts other); - } - - public interface _FinalStage { - UpdateTriggerWorkflowsOpts build(); - - /** - *

Array of workflow IDs to set

- */ - _FinalStage workflowIds(List workflowIds); - - _FinalStage addWorkflowIds(String workflowIds); - - _FinalStage addAllWorkflowIds(List workflowIds); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - private List workflowIds = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(UpdateTriggerWorkflowsOpts other) { - externalUserId(other.getExternalUserId()); - workflowIds(other.getWorkflowIds()); - return this; - } - - /** - *

The external user ID who owns the trigger

- *

The external user ID who owns the trigger

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

Array of workflow IDs to set

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllWorkflowIds(List workflowIds) { - this.workflowIds.addAll(workflowIds); - return this; - } - - /** - *

Array of workflow IDs to set

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addWorkflowIds(String workflowIds) { - this.workflowIds.add(workflowIds); - return this; - } - - /** - *

Array of workflow IDs to set

- */ - @java.lang.Override - @JsonSetter(value = "workflow_ids", nulls = Nulls.SKIP) - public _FinalStage workflowIds(List workflowIds) { - this.workflowIds.clear(); - this.workflowIds.addAll(workflowIds); - return this; - } - - @java.lang.Override - public UpdateTriggerWorkflowsOpts build() { - return new UpdateTriggerWorkflowsOpts(externalUserId, workflowIds, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncOauthTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncOauthTokensClient.java deleted file mode 100644 index 87556e3..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncOauthTokensClient.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.oauthtokens; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; -import com.pipedream.api.types.CreateOAuthTokenResponse; -import java.util.concurrent.CompletableFuture; - -public class AsyncOauthTokensClient { - protected final ClientOptions clientOptions; - - private final AsyncRawOauthTokensClient rawClient; - - public AsyncOauthTokensClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawOauthTokensClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawOauthTokensClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture create(CreateOAuthTokenOpts request) { - return this.rawClient.create(request).thenApply(response -> response.body()); - } - - public CompletableFuture create( - CreateOAuthTokenOpts 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/oauthtokens/AsyncRawOauthTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java deleted file mode 100644 index 1e0479b..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.oauthtokens; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; -import com.pipedream.api.types.CreateOAuthTokenResponse; -import java.io.IOException; -import java.util.concurrent.CompletableFuture; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawOauthTokensClient { - protected final ClientOptions clientOptions; - - public AsyncRawOauthTokensClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture> create(CreateOAuthTokenOpts request) { - return create(request, null); - } - - public CompletableFuture> create( - CreateOAuthTokenOpts request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/oauth/token") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new BaseClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), CreateOAuthTokenResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/OauthTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/OauthTokensClient.java deleted file mode 100644 index 1ae2bf1..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/OauthTokensClient.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.oauthtokens; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; -import com.pipedream.api.types.CreateOAuthTokenResponse; - -public class OauthTokensClient { - protected final ClientOptions clientOptions; - - private final RawOauthTokensClient rawClient; - - public OauthTokensClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawOauthTokensClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawOauthTokensClient withRawResponse() { - return this.rawClient; - } - - public CreateOAuthTokenResponse create(CreateOAuthTokenOpts request) { - return this.rawClient.create(request).body(); - } - - public CreateOAuthTokenResponse create(CreateOAuthTokenOpts request, RequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java deleted file mode 100644 index 6dd34fb..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.oauthtokens; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; -import com.pipedream.api.types.CreateOAuthTokenResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawOauthTokensClient { - protected final ClientOptions clientOptions; - - public RawOauthTokensClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse create(CreateOAuthTokenOpts request) { - return create(request, null); - } - - public BaseClientHttpResponse create( - CreateOAuthTokenOpts request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/oauth/token") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new BaseClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateOAuthTokenResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/requests/CreateOAuthTokenOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/requests/CreateOAuthTokenOpts.java deleted file mode 100644 index 50ab4b2..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/requests/CreateOAuthTokenOpts.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.oauthtokens.requests; - -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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateOAuthTokenOpts.Builder.class) -public final class CreateOAuthTokenOpts { - private final String clientId; - - private final String clientSecret; - - private final Map additionalProperties; - - private CreateOAuthTokenOpts(String clientId, String clientSecret, Map additionalProperties) { - this.clientId = clientId; - this.clientSecret = clientSecret; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("grant_type") - public String getGrantType() { - return "client_credentials"; - } - - @JsonProperty("client_id") - public String getClientId() { - return clientId; - } - - @JsonProperty("client_secret") - public String getClientSecret() { - return clientSecret; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateOAuthTokenOpts && equalTo((CreateOAuthTokenOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateOAuthTokenOpts other) { - return clientId.equals(other.clientId) && clientSecret.equals(other.clientSecret); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.clientId, this.clientSecret); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ClientIdStage builder() { - return new Builder(); - } - - public interface ClientIdStage { - ClientSecretStage clientId(@NotNull String clientId); - - Builder from(CreateOAuthTokenOpts other); - } - - public interface ClientSecretStage { - _FinalStage clientSecret(@NotNull String clientSecret); - } - - public interface _FinalStage { - CreateOAuthTokenOpts build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ClientIdStage, ClientSecretStage, _FinalStage { - private String clientId; - - private String clientSecret; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateOAuthTokenOpts other) { - clientId(other.getClientId()); - clientSecret(other.getClientSecret()); - return this; - } - - @java.lang.Override - @JsonSetter("client_id") - public ClientSecretStage clientId(@NotNull String clientId) { - this.clientId = Objects.requireNonNull(clientId, "clientId must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("client_secret") - public _FinalStage clientSecret(@NotNull String clientSecret) { - this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null"); - return this; - } - - @java.lang.Override - public CreateOAuthTokenOpts build() { - return new CreateOAuthTokenOpts(clientId, clientSecret, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncProjectsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncProjectsClient.java deleted file mode 100644 index 1d75dd6..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncProjectsClient.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.projects; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.types.ProjectInfoResponse; -import java.util.concurrent.CompletableFuture; - -public class AsyncProjectsClient { - protected final ClientOptions clientOptions; - - private final AsyncRawProjectsClient rawClient; - - public AsyncProjectsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawProjectsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawProjectsClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture retrieveInfo() { - return this.rawClient.retrieveInfo().thenApply(response -> response.body()); - } - - public CompletableFuture retrieveInfo(RequestOptions requestOptions) { - return this.rawClient.retrieveInfo(requestOptions).thenApply(response -> response.body()); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java deleted file mode 100644 index 89c9ec3..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.projects; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.types.ProjectInfoResponse; -import java.io.IOException; -import java.util.concurrent.CompletableFuture; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawProjectsClient { - protected final ClientOptions clientOptions; - - public AsyncRawProjectsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture> retrieveInfo() { - return retrieveInfo(null); - } - - public CompletableFuture> retrieveInfo(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("projects/info") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), ProjectInfoResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/ProjectsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/ProjectsClient.java deleted file mode 100644 index b09fc87..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/ProjectsClient.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.projects; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.types.ProjectInfoResponse; - -public class ProjectsClient { - protected final ClientOptions clientOptions; - - private final RawProjectsClient rawClient; - - public ProjectsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawProjectsClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawProjectsClient withRawResponse() { - return this.rawClient; - } - - public ProjectInfoResponse retrieveInfo() { - return this.rawClient.retrieveInfo().body(); - } - - public ProjectInfoResponse retrieveInfo(RequestOptions requestOptions) { - return this.rawClient.retrieveInfo(requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java deleted file mode 100644 index c927bf5..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.projects; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.types.ProjectInfoResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawProjectsClient { - protected final ClientOptions clientOptions; - - public RawProjectsClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse retrieveInfo() { - return retrieveInfo(null); - } - - public BaseClientHttpResponse retrieveInfo(RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("projects/info") - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ProjectInfoResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} 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 deleted file mode 100644 index fd06a93..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncProxyClient.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.proxy.requests.ProxyDeleteRequest; -import com.pipedream.api.resources.proxy.requests.ProxyGetRequest; -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.concurrent.CompletableFuture; - -public class AsyncProxyClient { - protected final ClientOptions clientOptions; - - private final AsyncRawProxyClient rawClient; - - public AsyncProxyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawProxyClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawProxyClient withRawResponse() { - return this.rawClient; - } - - 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) { - return this.rawClient.get(url64, request, requestOptions).thenApply(response -> response.body()); - } - - 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) { - return this.rawClient.post(url64, request, requestOptions).thenApply(response -> response.body()); - } - - 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) { - return this.rawClient.put(url64, request, requestOptions).thenApply(response -> response.body()); - } - - 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) { - return this.rawClient.delete(url64, request, requestOptions).thenApply(response -> response.body()); - } - - 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) { - 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 deleted file mode 100644 index 24f27f3..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java +++ /dev/null @@ -1,332 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.proxy.requests.ProxyDeleteRequest; -import com.pipedream.api.resources.proxy.requests.ProxyGetRequest; -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.io.IOException; -import java.util.concurrent.CompletableFuture; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawProxyClient { - protected final ClientOptions clientOptions; - - public AsyncRawProxyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture> get(String url64, ProxyGetRequest request) { - return get(url64, request, null); - } - - public CompletableFuture> get( - String url64, ProxyGetRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), Object.class), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> post(String url64, ProxyPostRequest request) { - return post(url64, request, null); - } - - public CompletableFuture> post( - String url64, ProxyPostRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), Object.class), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> put(String url64, ProxyPutRequest request) { - return put(url64, request, null); - } - - public CompletableFuture> put( - String url64, ProxyPutRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), Object.class), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> delete(String url64, ProxyDeleteRequest request) { - return delete(url64, request, null); - } - - public CompletableFuture> delete( - String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), Object.class), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> patch(String url64, ProxyPatchRequest request) { - return patch(url64, request, null); - } - - public CompletableFuture> patch( - String url64, ProxyPatchRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), Object.class), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} 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 deleted file mode 100644 index a7e22d7..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/ProxyClient.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.proxy.requests.ProxyDeleteRequest; -import com.pipedream.api.resources.proxy.requests.ProxyGetRequest; -import com.pipedream.api.resources.proxy.requests.ProxyPatchRequest; -import com.pipedream.api.resources.proxy.requests.ProxyPostRequest; -import com.pipedream.api.resources.proxy.requests.ProxyPutRequest; - -public class ProxyClient { - protected final ClientOptions clientOptions; - - private final RawProxyClient rawClient; - - public ProxyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawProxyClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawProxyClient withRawResponse() { - return this.rawClient; - } - - public Object get(String url64, ProxyGetRequest request) { - return this.rawClient.get(url64, request).body(); - } - - public Object get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { - return this.rawClient.get(url64, request, requestOptions).body(); - } - - public Object post(String url64, ProxyPostRequest request) { - return this.rawClient.post(url64, request).body(); - } - - public Object post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { - return this.rawClient.post(url64, request, requestOptions).body(); - } - - public Object put(String url64, ProxyPutRequest request) { - return this.rawClient.put(url64, request).body(); - } - - public Object put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { - return this.rawClient.put(url64, request, requestOptions).body(); - } - - public Object delete(String url64, ProxyDeleteRequest request) { - return this.rawClient.delete(url64, request).body(); - } - - public Object delete(String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { - return this.rawClient.delete(url64, request, requestOptions).body(); - } - - public Object patch(String url64, ProxyPatchRequest request) { - return this.rawClient.patch(url64, request).body(); - } - - 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 deleted file mode 100644 index 8bfb9ec..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java +++ /dev/null @@ -1,260 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.proxy.requests.ProxyDeleteRequest; -import com.pipedream.api.resources.proxy.requests.ProxyGetRequest; -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.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawProxyClient { - protected final ClientOptions clientOptions; - - public RawProxyClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse get(String url64, ProxyGetRequest request) { - return get(url64, request, null); - } - - public BaseClientHttpResponse get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse post(String url64, ProxyPostRequest request) { - return post(url64, request, null); - } - - public BaseClientHttpResponse post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse put(String url64, ProxyPutRequest request) { - return put(url64, request, null); - } - - public BaseClientHttpResponse put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PUT", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse delete(String url64, ProxyDeleteRequest request) { - return delete(url64, request, null); - } - - public BaseClientHttpResponse delete( - String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse patch(String url64, ProxyPatchRequest request) { - return patch(url64, request, null); - } - - public BaseClientHttpResponse patch( - String url64, ProxyPatchRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("proxy") - .addPathSegment(url64); - QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("PATCH", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyDeleteRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyDeleteRequest.java deleted file mode 100644 index f956f17..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyDeleteRequest.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy.requests; - -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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyDeleteRequest.Builder.class) -public final class ProxyDeleteRequest { - private final String externalUserId; - - private final String accountId; - - private final Map additionalProperties; - - private ProxyDeleteRequest(String externalUserId, String accountId, Map additionalProperties) { - this.externalUserId = externalUserId; - this.accountId = accountId; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID for the proxy request - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The account ID to use for authentication - */ - @JsonProperty("account_id") - public String getAccountId() { - return accountId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProxyDeleteRequest && equalTo((ProxyDeleteRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProxyDeleteRequest other) { - return externalUserId.equals(other.externalUserId) && accountId.equals(other.accountId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.accountId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID for the proxy request

- */ - AccountIdStage externalUserId(@NotNull String externalUserId); - - Builder from(ProxyDeleteRequest other); - } - - public interface AccountIdStage { - /** - *

The account ID to use for authentication

- */ - _FinalStage accountId(@NotNull String accountId); - } - - public interface _FinalStage { - ProxyDeleteRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, AccountIdStage, _FinalStage { - private String externalUserId; - - private String accountId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ProxyDeleteRequest other) { - externalUserId(other.getExternalUserId()); - accountId(other.getAccountId()); - return this; - } - - /** - *

The external user ID for the proxy request

- *

The external user ID for the proxy request

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

The account ID to use for authentication

- *

The account ID to use for authentication

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("account_id") - public _FinalStage accountId(@NotNull String accountId) { - this.accountId = Objects.requireNonNull(accountId, "accountId must not be null"); - return this; - } - - @java.lang.Override - public ProxyDeleteRequest build() { - return new ProxyDeleteRequest(externalUserId, accountId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyGetRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyGetRequest.java deleted file mode 100644 index bf09229..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyGetRequest.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy.requests; - -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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyGetRequest.Builder.class) -public final class ProxyGetRequest { - private final String externalUserId; - - private final String accountId; - - private final Map additionalProperties; - - private ProxyGetRequest(String externalUserId, String accountId, Map additionalProperties) { - this.externalUserId = externalUserId; - this.accountId = accountId; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID for the proxy request - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The account ID to use for authentication - */ - @JsonProperty("account_id") - public String getAccountId() { - return accountId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProxyGetRequest && equalTo((ProxyGetRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProxyGetRequest other) { - return externalUserId.equals(other.externalUserId) && accountId.equals(other.accountId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.accountId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID for the proxy request

- */ - AccountIdStage externalUserId(@NotNull String externalUserId); - - Builder from(ProxyGetRequest other); - } - - public interface AccountIdStage { - /** - *

The account ID to use for authentication

- */ - _FinalStage accountId(@NotNull String accountId); - } - - public interface _FinalStage { - ProxyGetRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, AccountIdStage, _FinalStage { - private String externalUserId; - - private String accountId; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ProxyGetRequest other) { - externalUserId(other.getExternalUserId()); - accountId(other.getAccountId()); - return this; - } - - /** - *

The external user ID for the proxy request

- *

The external user ID for the proxy request

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

The account ID to use for authentication

- *

The account ID to use for authentication

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("account_id") - public _FinalStage accountId(@NotNull String accountId) { - this.accountId = Objects.requireNonNull(accountId, "accountId must not be null"); - return this; - } - - @java.lang.Override - public ProxyGetRequest build() { - return new ProxyGetRequest(externalUserId, accountId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPatchRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPatchRequest.java deleted file mode 100644 index fe68355..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPatchRequest.java +++ /dev/null @@ -1,208 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy.requests; - -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.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyPatchRequest.Builder.class) -public final class ProxyPatchRequest { - private final String externalUserId; - - private final String accountId; - - private final Map body; - - private final Map additionalProperties; - - private ProxyPatchRequest( - String externalUserId, - String accountId, - Map body, - Map additionalProperties) { - this.externalUserId = externalUserId; - this.accountId = accountId; - this.body = body; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID for the proxy request - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The account ID to use for authentication - */ - @JsonProperty("account_id") - public String getAccountId() { - return accountId; - } - - /** - * @return Request body to forward to the target API - */ - @JsonProperty("body") - public Map getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProxyPatchRequest && equalTo((ProxyPatchRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProxyPatchRequest other) { - return externalUserId.equals(other.externalUserId) - && accountId.equals(other.accountId) - && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.accountId, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID for the proxy request

- */ - AccountIdStage externalUserId(@NotNull String externalUserId); - - Builder from(ProxyPatchRequest other); - } - - public interface AccountIdStage { - /** - *

The account ID to use for authentication

- */ - _FinalStage accountId(@NotNull String accountId); - } - - public interface _FinalStage { - ProxyPatchRequest build(); - - /** - *

Request body to forward to the target API

- */ - _FinalStage body(Map body); - - _FinalStage putAllBody(Map body); - - _FinalStage body(String key, Object value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, AccountIdStage, _FinalStage { - private String externalUserId; - - private String accountId; - - private Map body = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ProxyPatchRequest other) { - externalUserId(other.getExternalUserId()); - accountId(other.getAccountId()); - body(other.getBody()); - return this; - } - - /** - *

The external user ID for the proxy request

- *

The external user ID for the proxy request

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

The account ID to use for authentication

- *

The account ID to use for authentication

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

Request body to forward to the target API

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage body(String key, Object value) { - this.body.put(key, value); - return this; - } - - /** - *

Request body to forward to the target API

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage putAllBody(Map body) { - this.body.putAll(body); - return this; - } - - /** - *

Request body to forward to the target API

- */ - @java.lang.Override - @JsonSetter(value = "body", nulls = Nulls.SKIP) - public _FinalStage body(Map body) { - this.body.clear(); - this.body.putAll(body); - return this; - } - - @java.lang.Override - public ProxyPatchRequest build() { - return new ProxyPatchRequest(externalUserId, accountId, body, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPostRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPostRequest.java deleted file mode 100644 index d648ab4..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPostRequest.java +++ /dev/null @@ -1,208 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy.requests; - -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.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyPostRequest.Builder.class) -public final class ProxyPostRequest { - private final String externalUserId; - - private final String accountId; - - private final Map body; - - private final Map additionalProperties; - - private ProxyPostRequest( - String externalUserId, - String accountId, - Map body, - Map additionalProperties) { - this.externalUserId = externalUserId; - this.accountId = accountId; - this.body = body; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID for the proxy request - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The account ID to use for authentication - */ - @JsonProperty("account_id") - public String getAccountId() { - return accountId; - } - - /** - * @return Request body to forward to the target API - */ - @JsonProperty("body") - public Map getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProxyPostRequest && equalTo((ProxyPostRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProxyPostRequest other) { - return externalUserId.equals(other.externalUserId) - && accountId.equals(other.accountId) - && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.accountId, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID for the proxy request

- */ - AccountIdStage externalUserId(@NotNull String externalUserId); - - Builder from(ProxyPostRequest other); - } - - public interface AccountIdStage { - /** - *

The account ID to use for authentication

- */ - _FinalStage accountId(@NotNull String accountId); - } - - public interface _FinalStage { - ProxyPostRequest build(); - - /** - *

Request body to forward to the target API

- */ - _FinalStage body(Map body); - - _FinalStage putAllBody(Map body); - - _FinalStage body(String key, Object value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, AccountIdStage, _FinalStage { - private String externalUserId; - - private String accountId; - - private Map body = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ProxyPostRequest other) { - externalUserId(other.getExternalUserId()); - accountId(other.getAccountId()); - body(other.getBody()); - return this; - } - - /** - *

The external user ID for the proxy request

- *

The external user ID for the proxy request

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

The account ID to use for authentication

- *

The account ID to use for authentication

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

Request body to forward to the target API

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage body(String key, Object value) { - this.body.put(key, value); - return this; - } - - /** - *

Request body to forward to the target API

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage putAllBody(Map body) { - this.body.putAll(body); - return this; - } - - /** - *

Request body to forward to the target API

- */ - @java.lang.Override - @JsonSetter(value = "body", nulls = Nulls.SKIP) - public _FinalStage body(Map body) { - this.body.clear(); - this.body.putAll(body); - return this; - } - - @java.lang.Override - public ProxyPostRequest build() { - return new ProxyPostRequest(externalUserId, accountId, body, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPutRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPutRequest.java deleted file mode 100644 index d4aaeba..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPutRequest.java +++ /dev/null @@ -1,208 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.proxy.requests; - -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.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyPutRequest.Builder.class) -public final class ProxyPutRequest { - private final String externalUserId; - - private final String accountId; - - private final Map body; - - private final Map additionalProperties; - - private ProxyPutRequest( - String externalUserId, - String accountId, - Map body, - Map additionalProperties) { - this.externalUserId = externalUserId; - this.accountId = accountId; - this.body = body; - this.additionalProperties = additionalProperties; - } - - /** - * @return The external user ID for the proxy request - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The account ID to use for authentication - */ - @JsonProperty("account_id") - public String getAccountId() { - return accountId; - } - - /** - * @return Request body to forward to the target API - */ - @JsonProperty("body") - public Map getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProxyPutRequest && equalTo((ProxyPutRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProxyPutRequest other) { - return externalUserId.equals(other.externalUserId) - && accountId.equals(other.accountId) - && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.externalUserId, this.accountId, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID for the proxy request

- */ - AccountIdStage externalUserId(@NotNull String externalUserId); - - Builder from(ProxyPutRequest other); - } - - public interface AccountIdStage { - /** - *

The account ID to use for authentication

- */ - _FinalStage accountId(@NotNull String accountId); - } - - public interface _FinalStage { - ProxyPutRequest build(); - - /** - *

Request body to forward to the target API

- */ - _FinalStage body(Map body); - - _FinalStage putAllBody(Map body); - - _FinalStage body(String key, Object value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, AccountIdStage, _FinalStage { - private String externalUserId; - - private String accountId; - - private Map body = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ProxyPutRequest other) { - externalUserId(other.getExternalUserId()); - accountId(other.getAccountId()); - body(other.getBody()); - return this; - } - - /** - *

The external user ID for the proxy request

- *

The external user ID for the proxy request

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

The account ID to use for authentication

- *

The account ID to use for authentication

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

Request body to forward to the target API

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage body(String key, Object value) { - this.body.put(key, value); - return this; - } - - /** - *

Request body to forward to the target API

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage putAllBody(Map body) { - this.body.putAll(body); - return this; - } - - /** - *

Request body to forward to the target API

- */ - @java.lang.Override - @JsonSetter(value = "body", nulls = Nulls.SKIP) - public _FinalStage body(Map body) { - this.body.clear(); - this.body.putAll(body); - return this; - } - - @java.lang.Override - public ProxyPutRequest build() { - return new ProxyPutRequest(externalUserId, accountId, body, additionalProperties); - } - } -} 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 deleted file mode 100644 index e6f7c8c..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.tokens; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -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.CreateTokenOpts; -import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; -import com.pipedream.api.types.CreateTokenResponse; -import com.pipedream.api.types.ValidateTokenResponse; -import java.io.IOException; -import java.util.concurrent.CompletableFuture; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawTokensClient { - protected final ClientOptions clientOptions; - - public AsyncRawTokensClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture> create(CreateTokenOpts request) { - return create(request, null); - } - - public CompletableFuture> create( - CreateTokenOpts request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("tokens") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new BaseClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), CreateTokenResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> validate(String ctok) { - return validate(ctok, TokensValidateRequest.builder().build()); - } - - public CompletableFuture> validate( - String ctok, TokensValidateRequest request) { - return validate(ctok, request, null); - } - - public CompletableFuture> validate( - String ctok, TokensValidateRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("tokens") - .addPathSegment(ctok) - .addPathSegments("validate"); - if (request.getParams().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "params", request.getParams().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), ValidateTokenResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} 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 deleted file mode 100644 index e918132..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.tokens; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -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; -import java.util.concurrent.CompletableFuture; - -public class AsyncTokensClient { - protected final ClientOptions clientOptions; - - private final AsyncRawTokensClient rawClient; - - public AsyncTokensClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawTokensClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawTokensClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture create(CreateTokenOpts request) { - return this.rawClient.create(request).thenApply(response -> response.body()); - } - - public CompletableFuture create(CreateTokenOpts request, RequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture validate(String ctok) { - return this.rawClient.validate(ctok).thenApply(response -> response.body()); - } - - public CompletableFuture validate(String ctok, TokensValidateRequest request) { - return this.rawClient.validate(ctok, request).thenApply(response -> response.body()); - } - - public CompletableFuture validate( - String ctok, TokensValidateRequest request, RequestOptions requestOptions) { - return this.rawClient.validate(ctok, 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 deleted file mode 100644 index 7b0a9de..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.tokens; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -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.CreateTokenOpts; -import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; -import com.pipedream.api.types.CreateTokenResponse; -import com.pipedream.api.types.ValidateTokenResponse; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawTokensClient { - protected final ClientOptions clientOptions; - - public RawTokensClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse create(CreateTokenOpts request) { - return create(request, null); - } - - public BaseClientHttpResponse create(CreateTokenOpts request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("tokens") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new BaseClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateTokenResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse validate(String ctok) { - return validate(ctok, TokensValidateRequest.builder().build()); - } - - public BaseClientHttpResponse validate(String ctok, TokensValidateRequest request) { - return validate(ctok, request, null); - } - - public BaseClientHttpResponse validate( - String ctok, TokensValidateRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("tokens") - .addPathSegment(ctok) - .addPathSegments("validate"); - if (request.getParams().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "params", request.getParams().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ValidateTokenResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} 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 deleted file mode 100644 index 39c90ad..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.tokens; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -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; - -public class TokensClient { - protected final ClientOptions clientOptions; - - private final RawTokensClient rawClient; - - public TokensClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawTokensClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawTokensClient withRawResponse() { - return this.rawClient; - } - - public CreateTokenResponse create(CreateTokenOpts request) { - return this.rawClient.create(request).body(); - } - - public CreateTokenResponse create(CreateTokenOpts request, RequestOptions requestOptions) { - return this.rawClient.create(request, requestOptions).body(); - } - - public ValidateTokenResponse validate(String ctok) { - return this.rawClient.validate(ctok).body(); - } - - public ValidateTokenResponse validate(String ctok, TokensValidateRequest request) { - return this.rawClient.validate(ctok, request).body(); - } - - public ValidateTokenResponse validate(String ctok, TokensValidateRequest request, RequestOptions requestOptions) { - return this.rawClient.validate(ctok, request, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java deleted file mode 100644 index c781251..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/CreateTokenOpts.java +++ /dev/null @@ -1,301 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.tokens.requests; - -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.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateTokenOpts.Builder.class) -public final class CreateTokenOpts { - private final Optional> allowedOrigins; - - private final Optional errorRedirectUri; - - private final String externalUserId; - - private final Optional successRedirectUri; - - private final Optional webhookUri; - - private final Map additionalProperties; - - private CreateTokenOpts( - Optional> allowedOrigins, - Optional errorRedirectUri, - String externalUserId, - Optional successRedirectUri, - Optional webhookUri, - Map additionalProperties) { - this.allowedOrigins = allowedOrigins; - this.errorRedirectUri = errorRedirectUri; - this.externalUserId = externalUserId; - this.successRedirectUri = successRedirectUri; - this.webhookUri = webhookUri; - this.additionalProperties = additionalProperties; - } - - /** - * @return List of allowed origins for CORS - */ - @JsonProperty("allowed_origins") - public Optional> getAllowedOrigins() { - return allowedOrigins; - } - - /** - * @return URI to redirect to on error - */ - @JsonProperty("error_redirect_uri") - public Optional getErrorRedirectUri() { - return errorRedirectUri; - } - - /** - * @return Your end user ID, for whom you're creating the token - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return URI to redirect to on success - */ - @JsonProperty("success_redirect_uri") - public Optional getSuccessRedirectUri() { - return successRedirectUri; - } - - /** - * @return Webhook URI for notifications - */ - @JsonProperty("webhook_uri") - public Optional getWebhookUri() { - return webhookUri; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateTokenOpts && equalTo((CreateTokenOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateTokenOpts other) { - return allowedOrigins.equals(other.allowedOrigins) - && errorRedirectUri.equals(other.errorRedirectUri) - && externalUserId.equals(other.externalUserId) - && successRedirectUri.equals(other.successRedirectUri) - && webhookUri.equals(other.webhookUri); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.allowedOrigins, - this.errorRedirectUri, - this.externalUserId, - this.successRedirectUri, - this.webhookUri); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

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

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

List of allowed origins for CORS

- */ - _FinalStage allowedOrigins(Optional> allowedOrigins); - - _FinalStage allowedOrigins(List allowedOrigins); - - /** - *

URI to redirect to on error

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

URI to redirect to on success

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

Webhook URI for notifications

- */ - _FinalStage webhookUri(Optional webhookUri); - - _FinalStage webhookUri(String webhookUri); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - private Optional webhookUri = Optional.empty(); - - private Optional successRedirectUri = Optional.empty(); - - private Optional errorRedirectUri = Optional.empty(); - - private Optional> allowedOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateTokenOpts other) { - allowedOrigins(other.getAllowedOrigins()); - errorRedirectUri(other.getErrorRedirectUri()); - externalUserId(other.getExternalUserId()); - successRedirectUri(other.getSuccessRedirectUri()); - webhookUri(other.getWebhookUri()); - return this; - } - - /** - *

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

- *

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

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

Webhook URI for notifications

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

Webhook URI for notifications

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

URI to redirect to on success

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

URI to redirect to on success

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

URI to redirect to on error

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

URI to redirect to on error

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

List of allowed origins for CORS

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

List of allowed origins for CORS

- */ - @java.lang.Override - @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) - public _FinalStage allowedOrigins(Optional> allowedOrigins) { - this.allowedOrigins = allowedOrigins; - return this; - } - - @java.lang.Override - public CreateTokenOpts build() { - return new CreateTokenOpts( - allowedOrigins, - errorRedirectUri, - externalUserId, - successRedirectUri, - webhookUri, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java deleted file mode 100644 index 1479f3c..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.tokens.requests; - -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 com.pipedream.api.types.ValidateTokenParams; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TokensValidateRequest.Builder.class) -public final class TokensValidateRequest { - private final Optional params; - - private final Map additionalProperties; - - private TokensValidateRequest(Optional params, Map additionalProperties) { - this.params = params; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("params") - public Optional getParams() { - return params; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TokensValidateRequest && equalTo((TokensValidateRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TokensValidateRequest other) { - return params.equals(other.params); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.params); - } - - @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 params = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TokensValidateRequest other) { - params(other.getParams()); - return this; - } - - @JsonSetter(value = "params", nulls = Nulls.SKIP) - public Builder params(Optional params) { - this.params = params; - return this; - } - - public Builder params(ValidateTokenParams params) { - this.params = Optional.ofNullable(params); - return this; - } - - public TokensValidateRequest build() { - return new TokensValidateRequest(params, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java deleted file mode 100644 index ddc9aff..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java +++ /dev/null @@ -1,385 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.triggers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.triggers.requests.DeployTriggerOpts; -import com.pipedream.api.resources.triggers.requests.TriggersConfigurePropRequest; -import com.pipedream.api.resources.triggers.requests.TriggersListRequest; -import com.pipedream.api.resources.triggers.requests.TriggersReloadPropsRequest; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.DeployTriggerResponse; -import com.pipedream.api.types.DeployedComponent; -import com.pipedream.api.types.GetComponentResponse; -import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawTriggersClient { - protected final ClientOptions clientOptions; - - public AsyncRawTriggersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture>> list() { - return list(TriggersListRequest.builder().build()); - } - - public CompletableFuture>> list(TriggersListRequest request) { - return list(request, null); - } - - public CompletableFuture>> list( - TriggersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); - } - if (request.getApp().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "app", request.getApp().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); - Optional startingAfter = - parsedResponse.getPageInfo().getEndCursor(); - TriggersListRequest nextRequest = TriggersListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - future.complete(new BaseClientHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> retrieve(String componentId) { - return retrieve(componentId, null); - } - - public CompletableFuture> retrieve( - String componentId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers") - .addPathSegment(componentId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> configureProp( - TriggersConfigurePropRequest request) { - return configureProp(request, null); - } - - public CompletableFuture> configureProp( - TriggersConfigurePropRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/configure") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), ConfigurePropResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> reloadProps( - TriggersReloadPropsRequest request) { - return reloadProps(request, null); - } - - public CompletableFuture> reloadProps( - TriggersReloadPropsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/props") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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(), ReloadPropsResponse.class), - response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } - - public CompletableFuture> deploy(DeployTriggerOpts request) { - return deploy(request, null); - } - - public CompletableFuture> deploy( - DeployTriggerOpts request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/deploy") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new BaseClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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()) { - DeployTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeployTriggerResponse.class); - future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncTriggersClient.java deleted file mode 100644 index 2f3361f..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncTriggersClient.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.triggers; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.triggers.requests.DeployTriggerOpts; -import com.pipedream.api.resources.triggers.requests.TriggersConfigurePropRequest; -import com.pipedream.api.resources.triggers.requests.TriggersListRequest; -import com.pipedream.api.resources.triggers.requests.TriggersReloadPropsRequest; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.DeployedComponent; -import com.pipedream.api.types.ReloadPropsResponse; -import java.util.concurrent.CompletableFuture; - -public class AsyncTriggersClient { - protected final ClientOptions clientOptions; - - private final AsyncRawTriggersClient rawClient; - - public AsyncTriggersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawTriggersClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawTriggersClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture> list() { - return this.rawClient.list().thenApply(response -> response.body()); - } - - public CompletableFuture> list(TriggersListRequest request) { - return this.rawClient.list(request).thenApply(response -> response.body()); - } - - public CompletableFuture> list( - TriggersListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String componentId) { - return this.rawClient.retrieve(componentId).thenApply(response -> response.body()); - } - - public CompletableFuture retrieve(String componentId, RequestOptions requestOptions) { - return this.rawClient.retrieve(componentId, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture configureProp(TriggersConfigurePropRequest request) { - return this.rawClient.configureProp(request).thenApply(response -> response.body()); - } - - public CompletableFuture configureProp( - TriggersConfigurePropRequest request, RequestOptions requestOptions) { - return this.rawClient.configureProp(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture reloadProps(TriggersReloadPropsRequest request) { - return this.rawClient.reloadProps(request).thenApply(response -> response.body()); - } - - public CompletableFuture reloadProps( - TriggersReloadPropsRequest request, RequestOptions requestOptions) { - return this.rawClient.reloadProps(request, requestOptions).thenApply(response -> response.body()); - } - - public CompletableFuture deploy(DeployTriggerOpts request) { - return this.rawClient.deploy(request).thenApply(response -> response.body()); - } - - public CompletableFuture deploy(DeployTriggerOpts request, RequestOptions requestOptions) { - return this.rawClient.deploy(request, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java deleted file mode 100644 index 192686d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java +++ /dev/null @@ -1,304 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.triggers; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.MediaTypes; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.QueryStringMapper; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.triggers.requests.DeployTriggerOpts; -import com.pipedream.api.resources.triggers.requests.TriggersConfigurePropRequest; -import com.pipedream.api.resources.triggers.requests.TriggersListRequest; -import com.pipedream.api.resources.triggers.requests.TriggersReloadPropsRequest; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.DeployTriggerResponse; -import com.pipedream.api.types.DeployedComponent; -import com.pipedream.api.types.GetComponentResponse; -import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsResponse; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawTriggersClient { - protected final ClientOptions clientOptions; - - public RawTriggersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse> list() { - return list(TriggersListRequest.builder().build()); - } - - public BaseClientHttpResponse> list(TriggersListRequest request) { - return list(request, null); - } - - public BaseClientHttpResponse> list( - TriggersListRequest request, RequestOptions requestOptions) { - HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers"); - if (request.getAfter().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "after", request.getAfter().get(), false); - } - if (request.getBefore().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "before", request.getBefore().get(), false); - } - if (request.getLimit().isPresent()) { - QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); - } - if (request.getApp().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "app", request.getApp().get(), false); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl.build()) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json"); - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); - Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - TriggersListRequest nextRequest = TriggersListRequest.builder() - .from(request) - .after(startingAfter) - .build(); - List result = parsedResponse.getData(); - return new BaseClientHttpResponse<>( - new SyncPagingIterable( - startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) - .body()), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse retrieve(String componentId) { - return retrieve(componentId, null); - } - - public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers") - .addPathSegment(componentId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("GET", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new BaseClientHttpResponse<>(parsedResponse.getData(), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse configureProp(TriggersConfigurePropRequest request) { - return configureProp(request, null); - } - - public BaseClientHttpResponse configureProp( - TriggersConfigurePropRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/configure") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse reloadProps(TriggersReloadPropsRequest request) { - return reloadProps(request, null); - } - - public BaseClientHttpResponse reloadProps( - TriggersReloadPropsRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/props") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); - } catch (Exception e) { - throw new RuntimeException(e); - } - Request.Builder _requestBuilder = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json"); - if (request.getAsyncHandle().isPresent()) { - _requestBuilder.addHeader("x-async-handle", request.getAsyncHandle().get()); - } - Request okhttpRequest = _requestBuilder.build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), - response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } - - public BaseClientHttpResponse deploy(DeployTriggerOpts request) { - return deploy(request, null); - } - - public BaseClientHttpResponse deploy(DeployTriggerOpts request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/deploy") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new BaseClientException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - DeployTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeployTriggerResponse.class); - return new BaseClientHttpResponse<>(parsedResponse.getData(), response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/TriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/TriggersClient.java deleted file mode 100644 index d16a37b..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/TriggersClient.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.triggers; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.core.pagination.SyncPagingIterable; -import com.pipedream.api.resources.triggers.requests.DeployTriggerOpts; -import com.pipedream.api.resources.triggers.requests.TriggersConfigurePropRequest; -import com.pipedream.api.resources.triggers.requests.TriggersListRequest; -import com.pipedream.api.resources.triggers.requests.TriggersReloadPropsRequest; -import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.DeployedComponent; -import com.pipedream.api.types.ReloadPropsResponse; - -public class TriggersClient { - protected final ClientOptions clientOptions; - - private final RawTriggersClient rawClient; - - public TriggersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawTriggersClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawTriggersClient withRawResponse() { - return this.rawClient; - } - - public SyncPagingIterable list() { - return this.rawClient.list().body(); - } - - public SyncPagingIterable list(TriggersListRequest request) { - return this.rawClient.list(request).body(); - } - - public SyncPagingIterable list(TriggersListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); - } - - public Component retrieve(String componentId) { - return this.rawClient.retrieve(componentId).body(); - } - - public Component retrieve(String componentId, RequestOptions requestOptions) { - return this.rawClient.retrieve(componentId, requestOptions).body(); - } - - public ConfigurePropResponse configureProp(TriggersConfigurePropRequest request) { - return this.rawClient.configureProp(request).body(); - } - - public ConfigurePropResponse configureProp(TriggersConfigurePropRequest request, RequestOptions requestOptions) { - return this.rawClient.configureProp(request, requestOptions).body(); - } - - public ReloadPropsResponse reloadProps(TriggersReloadPropsRequest request) { - return this.rawClient.reloadProps(request).body(); - } - - public ReloadPropsResponse reloadProps(TriggersReloadPropsRequest request, RequestOptions requestOptions) { - return this.rawClient.reloadProps(request, requestOptions).body(); - } - - public DeployedComponent deploy(DeployTriggerOpts request) { - return this.rawClient.deploy(request).body(); - } - - public DeployedComponent deploy(DeployTriggerOpts request, RequestOptions requestOptions) { - return this.rawClient.deploy(request, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/DeployTriggerOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/DeployTriggerOpts.java deleted file mode 100644 index b45a651..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/DeployTriggerOpts.java +++ /dev/null @@ -1,282 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.triggers.requests; - -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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployTriggerOpts.Builder.class) -public final class DeployTriggerOpts { - private final String id; - - private final String externalUserId; - - private final Optional> configuredProps; - - private final Optional dynamicPropsId; - - private final Optional webhookUrl; - - private final Map additionalProperties; - - private DeployTriggerOpts( - String id, - String externalUserId, - Optional> configuredProps, - Optional dynamicPropsId, - Optional webhookUrl, - Map additionalProperties) { - this.id = id; - this.externalUserId = externalUserId; - this.configuredProps = configuredProps; - this.dynamicPropsId = dynamicPropsId; - this.webhookUrl = webhookUrl; - this.additionalProperties = additionalProperties; - } - - /** - * @return The trigger component ID - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return The external user ID - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The configured properties for the trigger - */ - @JsonProperty("configured_props") - public Optional> getConfiguredProps() { - return configuredProps; - } - - /** - * @return The ID for dynamic props - */ - @JsonProperty("dynamic_props_id") - public Optional getDynamicPropsId() { - return dynamicPropsId; - } - - /** - * @return Optional webhook URL to receive trigger events - */ - @JsonProperty("webhook_url") - public Optional getWebhookUrl() { - return webhookUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployTriggerOpts && equalTo((DeployTriggerOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployTriggerOpts other) { - return id.equals(other.id) - && externalUserId.equals(other.externalUserId) - && configuredProps.equals(other.configuredProps) - && dynamicPropsId.equals(other.dynamicPropsId) - && webhookUrl.equals(other.webhookUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.externalUserId, this.configuredProps, this.dynamicPropsId, this.webhookUrl); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

The trigger component ID

- */ - ExternalUserIdStage id(@NotNull String id); - - Builder from(DeployTriggerOpts other); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - } - - public interface _FinalStage { - DeployTriggerOpts build(); - - /** - *

The configured properties for the trigger

- */ - _FinalStage configuredProps(Optional> configuredProps); - - _FinalStage configuredProps(Map configuredProps); - - /** - *

The ID for dynamic props

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

Optional webhook URL to receive trigger events

- */ - _FinalStage webhookUrl(Optional webhookUrl); - - _FinalStage webhookUrl(String webhookUrl); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, ExternalUserIdStage, _FinalStage { - private String id; - - private String externalUserId; - - private Optional webhookUrl = Optional.empty(); - - private Optional dynamicPropsId = Optional.empty(); - - private Optional> configuredProps = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployTriggerOpts other) { - id(other.getId()); - externalUserId(other.getExternalUserId()); - configuredProps(other.getConfiguredProps()); - dynamicPropsId(other.getDynamicPropsId()); - webhookUrl(other.getWebhookUrl()); - return this; - } - - /** - *

The trigger component ID

- *

The trigger component ID

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

The external user ID

- *

The external user ID

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

Optional webhook URL to receive trigger events

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

Optional webhook URL to receive trigger events

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

The ID for dynamic props

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

The ID for dynamic props

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

The configured properties for the trigger

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

The configured properties for the trigger

- */ - @java.lang.Override - @JsonSetter(value = "configured_props", nulls = Nulls.SKIP) - public _FinalStage configuredProps(Optional> configuredProps) { - this.configuredProps = configuredProps; - return this; - } - - @java.lang.Override - public DeployTriggerOpts build() { - return new DeployTriggerOpts( - id, externalUserId, configuredProps, dynamicPropsId, webhookUrl, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersConfigurePropRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersConfigurePropRequest.java deleted file mode 100644 index dda960b..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersConfigurePropRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.triggers.requests; - -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 com.pipedream.api.types.ConfigurePropOpts; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TriggersConfigurePropRequest.Builder.class) -public final class TriggersConfigurePropRequest { - private final Optional asyncHandle; - - private final ConfigurePropOpts body; - - private final Map additionalProperties; - - private TriggersConfigurePropRequest( - Optional asyncHandle, ConfigurePropOpts body, Map additionalProperties) { - this.asyncHandle = asyncHandle; - this.body = body; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("x-async-handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - @JsonProperty("body") - public ConfigurePropOpts getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TriggersConfigurePropRequest && equalTo((TriggersConfigurePropRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TriggersConfigurePropRequest other) { - return asyncHandle.equals(other.asyncHandle) && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncHandle, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BodyStage builder() { - return new Builder(); - } - - public interface BodyStage { - _FinalStage body(@NotNull ConfigurePropOpts body); - - Builder from(TriggersConfigurePropRequest other); - } - - public interface _FinalStage { - TriggersConfigurePropRequest build(); - - _FinalStage asyncHandle(Optional asyncHandle); - - _FinalStage asyncHandle(String asyncHandle); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BodyStage, _FinalStage { - private ConfigurePropOpts body; - - private Optional asyncHandle = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(TriggersConfigurePropRequest other) { - asyncHandle(other.getAsyncHandle()); - body(other.getBody()); - return this; - } - - @java.lang.Override - @JsonSetter("body") - public _FinalStage body(@NotNull ConfigurePropOpts body) { - this.body = Objects.requireNonNull(body, "body must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage asyncHandle(String asyncHandle) { - this.asyncHandle = Optional.ofNullable(asyncHandle); - return this; - } - - @java.lang.Override - @JsonSetter(value = "x-async-handle", nulls = Nulls.SKIP) - public _FinalStage asyncHandle(Optional asyncHandle) { - this.asyncHandle = asyncHandle; - return this; - } - - @java.lang.Override - public TriggersConfigurePropRequest build() { - return new TriggersConfigurePropRequest(asyncHandle, body, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersListRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersListRequest.java deleted file mode 100644 index 833a738..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersListRequest.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.triggers.requests; - -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 = TriggersListRequest.Builder.class) -public final class TriggersListRequest { - private final Optional after; - - private final Optional before; - - private final Optional limit; - - private final Optional q; - - private final Optional app; - - private final Map additionalProperties; - - private TriggersListRequest( - Optional after, - Optional before, - Optional limit, - Optional q, - Optional app, - Map additionalProperties) { - this.after = after; - this.before = before; - this.limit = limit; - this.q = q; - this.app = app; - this.additionalProperties = additionalProperties; - } - - /** - * @return The cursor to start from for pagination - */ - @JsonProperty("after") - public Optional getAfter() { - return after; - } - - /** - * @return The cursor to end before for pagination - */ - @JsonProperty("before") - public Optional getBefore() { - return before; - } - - /** - * @return The maximum number of results to return - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return A search query to filter the triggers - */ - @JsonProperty("q") - public Optional getQ() { - return q; - } - - /** - * @return The ID or name slug of the app to filter the triggers - */ - @JsonProperty("app") - public Optional getApp() { - return app; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TriggersListRequest && equalTo((TriggersListRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TriggersListRequest other) { - return after.equals(other.after) - && before.equals(other.before) - && limit.equals(other.limit) - && q.equals(other.q) - && app.equals(other.app); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.after, this.before, this.limit, this.q, this.app); - } - - @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 after = Optional.empty(); - - private Optional before = Optional.empty(); - - private Optional limit = Optional.empty(); - - private Optional q = Optional.empty(); - - private Optional app = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(TriggersListRequest other) { - after(other.getAfter()); - before(other.getBefore()); - limit(other.getLimit()); - q(other.getQ()); - app(other.getApp()); - return this; - } - - /** - *

The cursor to start from for pagination

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

The cursor to end before for pagination

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

The maximum number of results to return

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

A search query to filter the triggers

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

The ID or name slug of the app to filter the triggers

- */ - @JsonSetter(value = "app", nulls = Nulls.SKIP) - public Builder app(Optional app) { - this.app = app; - return this; - } - - public Builder app(String app) { - this.app = Optional.ofNullable(app); - return this; - } - - public TriggersListRequest build() { - return new TriggersListRequest(after, before, limit, q, app, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersReloadPropsRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersReloadPropsRequest.java deleted file mode 100644 index b40b8ca..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersReloadPropsRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.triggers.requests; - -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 com.pipedream.api.types.ReloadPropsOpts; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TriggersReloadPropsRequest.Builder.class) -public final class TriggersReloadPropsRequest { - private final Optional asyncHandle; - - private final ReloadPropsOpts body; - - private final Map additionalProperties; - - private TriggersReloadPropsRequest( - Optional asyncHandle, ReloadPropsOpts body, Map additionalProperties) { - this.asyncHandle = asyncHandle; - this.body = body; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("x-async-handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - @JsonProperty("body") - public ReloadPropsOpts getBody() { - return body; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TriggersReloadPropsRequest && equalTo((TriggersReloadPropsRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TriggersReloadPropsRequest other) { - return asyncHandle.equals(other.asyncHandle) && body.equals(other.body); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.asyncHandle, this.body); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BodyStage builder() { - return new Builder(); - } - - public interface BodyStage { - _FinalStage body(@NotNull ReloadPropsOpts body); - - Builder from(TriggersReloadPropsRequest other); - } - - public interface _FinalStage { - TriggersReloadPropsRequest build(); - - _FinalStage asyncHandle(Optional asyncHandle); - - _FinalStage asyncHandle(String asyncHandle); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BodyStage, _FinalStage { - private ReloadPropsOpts body; - - private Optional asyncHandle = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(TriggersReloadPropsRequest other) { - asyncHandle(other.getAsyncHandle()); - body(other.getBody()); - return this; - } - - @java.lang.Override - @JsonSetter("body") - public _FinalStage body(@NotNull ReloadPropsOpts body) { - this.body = Objects.requireNonNull(body, "body must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage asyncHandle(String asyncHandle) { - this.asyncHandle = Optional.ofNullable(asyncHandle); - return this; - } - - @java.lang.Override - @JsonSetter(value = "x-async-handle", nulls = Nulls.SKIP) - public _FinalStage asyncHandle(Optional asyncHandle) { - this.asyncHandle = asyncHandle; - return this; - } - - @java.lang.Override - public TriggersReloadPropsRequest build() { - return new TriggersReloadPropsRequest(asyncHandle, body, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java deleted file mode 100644 index 53d886e..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.users; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.RequestOptions; -import java.io.IOException; -import java.util.concurrent.CompletableFuture; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.jetbrains.annotations.NotNull; - -public class AsyncRawUsersClient { - protected final ClientOptions clientOptions; - - public AsyncRawUsersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public CompletableFuture> deleteExternalUser(String externalUserId) { - return deleteExternalUser(externalUserId, null); - } - - public CompletableFuture> deleteExternalUser( - String externalUserId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("users") - .addPathSegment(externalUserId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - 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<>(null, response)); - return; - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - } catch (IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); - } - }); - return future; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncUsersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncUsersClient.java deleted file mode 100644 index 97dafe2..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncUsersClient.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.users; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; -import java.util.concurrent.CompletableFuture; - -public class AsyncUsersClient { - protected final ClientOptions clientOptions; - - private final AsyncRawUsersClient rawClient; - - public AsyncUsersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new AsyncRawUsersClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public AsyncRawUsersClient withRawResponse() { - return this.rawClient; - } - - public CompletableFuture deleteExternalUser(String externalUserId) { - return this.rawClient.deleteExternalUser(externalUserId).thenApply(response -> response.body()); - } - - public CompletableFuture deleteExternalUser(String externalUserId, RequestOptions requestOptions) { - return this.rawClient.deleteExternalUser(externalUserId, requestOptions).thenApply(response -> response.body()); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java deleted file mode 100644 index 69011b7..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.users; - -import com.pipedream.api.core.BaseClientApiException; -import com.pipedream.api.core.BaseClientException; -import com.pipedream.api.core.BaseClientHttpResponse; -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.RequestOptions; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class RawUsersClient { - protected final ClientOptions clientOptions; - - public RawUsersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public BaseClientHttpResponse deleteExternalUser(String externalUserId) { - return deleteExternalUser(externalUserId, null); - } - - public BaseClientHttpResponse deleteExternalUser(String externalUserId, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("v1/connect") - .addPathSegment(clientOptions.projectId()) - .addPathSegments("users") - .addPathSegment(externalUserId) - .build(); - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("DELETE", null) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return new BaseClientHttpResponse<>(null, response); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); - } catch (IOException e) { - throw new BaseClientException("Network error executing HTTP request", e); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/UsersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/UsersClient.java deleted file mode 100644 index a00362d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/UsersClient.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.users; - -import com.pipedream.api.core.ClientOptions; -import com.pipedream.api.core.RequestOptions; - -public class UsersClient { - protected final ClientOptions clientOptions; - - private final RawUsersClient rawClient; - - public UsersClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - this.rawClient = new RawUsersClient(clientOptions); - } - - /** - * Get responses with HTTP metadata like headers - */ - public RawUsersClient withRawResponse() { - return this.rawClient; - } - - public void deleteExternalUser(String externalUserId) { - this.rawClient.deleteExternalUser(externalUserId).body(); - } - - public void deleteExternalUser(String externalUserId, RequestOptions requestOptions) { - this.rawClient.deleteExternalUser(externalUserId, requestOptions).body(); - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/Account.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/Account.java deleted file mode 100644 index 30c5157..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/Account.java +++ /dev/null @@ -1,485 +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.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Account.Builder.class) -public final class Account { - private final Optional id; - - private final Optional name; - - private final Optional externalId; - - private final Optional healthy; - - private final Optional dead; - - private final Optional app; - - private final Optional createdAt; - - private final Optional updatedAt; - - private final Optional> credentials; - - private final Optional expiresAt; - - private final Optional error; - - private final Optional lastRefreshedAt; - - private final Optional nextRefreshAt; - - private final Map additionalProperties; - - private Account( - Optional id, - Optional name, - Optional externalId, - Optional healthy, - Optional dead, - Optional app, - Optional createdAt, - Optional updatedAt, - Optional> credentials, - Optional expiresAt, - Optional error, - Optional lastRefreshedAt, - Optional nextRefreshAt, - Map additionalProperties) { - this.id = id; - this.name = name; - this.externalId = externalId; - this.healthy = healthy; - this.dead = dead; - this.app = app; - this.createdAt = createdAt; - this.updatedAt = updatedAt; - this.credentials = credentials; - this.expiresAt = expiresAt; - this.error = error; - this.lastRefreshedAt = lastRefreshedAt; - this.nextRefreshAt = nextRefreshAt; - this.additionalProperties = additionalProperties; - } - - /** - * @return The unique ID of the account. - */ - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The custom name of the account if set. - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return The external ID associated with the account. - */ - @JsonProperty("external_id") - public Optional getExternalId() { - return externalId; - } - - /** - * @return Indicates if the account is healthy. Pipedream will periodically retry token refresh and test requests for unhealthy accounts - */ - @JsonProperty("healthy") - public Optional getHealthy() { - return healthy; - } - - /** - * @return Indicates if the account is no longer active - */ - @JsonProperty("dead") - public Optional getDead() { - return dead; - } - - @JsonProperty("app") - public Optional getApp() { - return app; - } - - /** - * @return The date and time the account was created, an ISO 8601 formatted string - */ - @JsonProperty("created_at") - public Optional getCreatedAt() { - return createdAt; - } - - /** - * @return The date and time the account was last updated, an ISO 8601 formatted string - */ - @JsonProperty("updated_at") - public Optional getUpdatedAt() { - return updatedAt; - } - - /** - * @return The credentials associated with the account, if the include_credentials parameter was set to true in the request - */ - @JsonProperty("credentials") - public Optional> getCredentials() { - return credentials; - } - - /** - * @return The date and time the account's credentials expiration, an ISO 8601 formatted string - */ - @JsonProperty("expires_at") - public Optional getExpiresAt() { - return expiresAt; - } - - /** - * @return The error message if the account is unhealthy or dead, null otherwise - */ - @JsonProperty("error") - public Optional getError() { - return error; - } - - /** - * @return The date and time the account was last refreshed, an ISO 8601 formatted string - */ - @JsonProperty("last_refreshed_at") - public Optional getLastRefreshedAt() { - return lastRefreshedAt; - } - - /** - * @return The date and time the account will next be refreshed, an ISO 8601 formatted string - */ - @JsonProperty("next_refresh_at") - public Optional getNextRefreshAt() { - return nextRefreshAt; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Account && equalTo((Account) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Account other) { - return id.equals(other.id) - && name.equals(other.name) - && externalId.equals(other.externalId) - && healthy.equals(other.healthy) - && dead.equals(other.dead) - && app.equals(other.app) - && createdAt.equals(other.createdAt) - && updatedAt.equals(other.updatedAt) - && credentials.equals(other.credentials) - && expiresAt.equals(other.expiresAt) - && error.equals(other.error) - && lastRefreshedAt.equals(other.lastRefreshedAt) - && nextRefreshAt.equals(other.nextRefreshAt); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.name, - this.externalId, - this.healthy, - this.dead, - this.app, - this.createdAt, - this.updatedAt, - this.credentials, - this.expiresAt, - this.error, - this.lastRefreshedAt, - this.nextRefreshAt); - } - - @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 id = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional externalId = Optional.empty(); - - private Optional healthy = Optional.empty(); - - private Optional dead = Optional.empty(); - - private Optional app = Optional.empty(); - - private Optional createdAt = Optional.empty(); - - private Optional updatedAt = Optional.empty(); - - private Optional> credentials = Optional.empty(); - - private Optional expiresAt = Optional.empty(); - - private Optional error = Optional.empty(); - - private Optional lastRefreshedAt = Optional.empty(); - - private Optional nextRefreshAt = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Account other) { - id(other.getId()); - name(other.getName()); - externalId(other.getExternalId()); - healthy(other.getHealthy()); - dead(other.getDead()); - app(other.getApp()); - createdAt(other.getCreatedAt()); - updatedAt(other.getUpdatedAt()); - credentials(other.getCredentials()); - expiresAt(other.getExpiresAt()); - error(other.getError()); - lastRefreshedAt(other.getLastRefreshedAt()); - nextRefreshAt(other.getNextRefreshAt()); - return this; - } - - /** - *

The unique ID of the account.

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

The custom name of the account if set.

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

The external ID associated with the account.

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

Indicates if the account is healthy. Pipedream will periodically retry token refresh and test requests for unhealthy accounts

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

Indicates if the account is no longer active

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

The date and time the account was created, an ISO 8601 formatted string

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

The date and time the account was last updated, an ISO 8601 formatted string

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

The credentials associated with the account, if the include_credentials parameter was set to true in the request

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

The date and time the account's credentials expiration, an ISO 8601 formatted string

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

The error message if the account is unhealthy or dead, null otherwise

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

The date and time the account was last refreshed, an ISO 8601 formatted string

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

The date and time the account will next be refreshed, an ISO 8601 formatted string

- */ - @JsonSetter(value = "next_refresh_at", nulls = Nulls.SKIP) - public Builder nextRefreshAt(Optional nextRefreshAt) { - this.nextRefreshAt = nextRefreshAt; - return this; - } - - public Builder nextRefreshAt(OffsetDateTime nextRefreshAt) { - this.nextRefreshAt = Optional.ofNullable(nextRefreshAt); - return this; - } - - public Account build() { - return new Account( - id, - name, - externalId, - healthy, - dead, - app, - createdAt, - updatedAt, - credentials, - expiresAt, - error, - lastRefreshedAt, - nextRefreshAt, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/App.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/App.java deleted file mode 100644 index 2983820..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/App.java +++ /dev/null @@ -1,472 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = App.Builder.class) -public final class App { - private final Optional id; - - private final String nameSlug; - - private final String name; - - private final Optional authType; - - private final Optional description; - - private final String imgSrc; - - private final Optional customFieldsJson; - - private final List categories; - - private final double featuredWeight; - - private final Map additionalProperties; - - private App( - Optional id, - String nameSlug, - String name, - Optional authType, - Optional description, - String imgSrc, - Optional customFieldsJson, - List categories, - double featuredWeight, - Map additionalProperties) { - this.id = id; - this.nameSlug = nameSlug; - this.name = name; - this.authType = authType; - this.description = description; - this.imgSrc = imgSrc; - this.customFieldsJson = customFieldsJson; - this.categories = categories; - this.featuredWeight = featuredWeight; - this.additionalProperties = additionalProperties; - } - - /** - * @return ID of the app. Only applies for OAuth apps. - */ - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The name slug of the target app (see https://pipedream.com/docs/connect/quickstart#find-your-apps-name-slug) - */ - @JsonProperty("name_slug") - public String getNameSlug() { - return nameSlug; - } - - /** - * @return The human-readable name of the app - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The authentication type used by the app - */ - @JsonProperty("auth_type") - public Optional getAuthType() { - return authType; - } - - /** - * @return A short description of the app - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return The URL to the app's logo - */ - @JsonProperty("img_src") - public String getImgSrc() { - return imgSrc; - } - - /** - * @return A JSON string representing the custom fields for the app - */ - @JsonProperty("custom_fields_json") - public Optional getCustomFieldsJson() { - return customFieldsJson; - } - - /** - * @return Categories associated with the app - */ - @JsonProperty("categories") - public List getCategories() { - return categories; - } - - /** - * @return A rough directional ordering of app popularity, subject to changes by Pipedream - */ - @JsonProperty("featured_weight") - public double getFeaturedWeight() { - return featuredWeight; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof App && equalTo((App) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(App other) { - return id.equals(other.id) - && nameSlug.equals(other.nameSlug) - && name.equals(other.name) - && authType.equals(other.authType) - && description.equals(other.description) - && imgSrc.equals(other.imgSrc) - && customFieldsJson.equals(other.customFieldsJson) - && categories.equals(other.categories) - && featuredWeight == other.featuredWeight; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.nameSlug, - this.name, - this.authType, - this.description, - this.imgSrc, - this.customFieldsJson, - this.categories, - this.featuredWeight); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameSlugStage builder() { - return new Builder(); - } - - public interface NameSlugStage { - /** - *

The name slug of the target app (see https://pipedream.com/docs/connect/quickstart#find-your-apps-name-slug)

- */ - NameStage nameSlug(@NotNull String nameSlug); - - Builder from(App other); - } - - public interface NameStage { - /** - *

The human-readable name of the app

- */ - ImgSrcStage name(@NotNull String name); - } - - public interface ImgSrcStage { - /** - *

The URL to the app's logo

- */ - FeaturedWeightStage imgSrc(@NotNull String imgSrc); - } - - public interface FeaturedWeightStage { - /** - *

A rough directional ordering of app popularity, subject to changes by Pipedream

- */ - _FinalStage featuredWeight(double featuredWeight); - } - - public interface _FinalStage { - App build(); - - /** - *

ID of the app. Only applies for OAuth apps.

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

The authentication type used by the app

- */ - _FinalStage authType(Optional authType); - - _FinalStage authType(AppAuthType authType); - - /** - *

A short description of the app

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

A JSON string representing the custom fields for the app

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

Categories associated with the app

- */ - _FinalStage categories(List categories); - - _FinalStage addCategories(String categories); - - _FinalStage addAllCategories(List categories); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements NameSlugStage, NameStage, ImgSrcStage, FeaturedWeightStage, _FinalStage { - private String nameSlug; - - private String name; - - private String imgSrc; - - private double featuredWeight; - - private List categories = new ArrayList<>(); - - private Optional customFieldsJson = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional authType = Optional.empty(); - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(App other) { - id(other.getId()); - nameSlug(other.getNameSlug()); - name(other.getName()); - authType(other.getAuthType()); - description(other.getDescription()); - imgSrc(other.getImgSrc()); - customFieldsJson(other.getCustomFieldsJson()); - categories(other.getCategories()); - featuredWeight(other.getFeaturedWeight()); - return this; - } - - /** - *

The name slug of the target app (see https://pipedream.com/docs/connect/quickstart#find-your-apps-name-slug)

- *

The name slug of the target app (see https://pipedream.com/docs/connect/quickstart#find-your-apps-name-slug)

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

The human-readable name of the app

- *

The human-readable name of the app

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

The URL to the app's logo

- *

The URL to the app's logo

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

A rough directional ordering of app popularity, subject to changes by Pipedream

- *

A rough directional ordering of app popularity, subject to changes by Pipedream

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("featured_weight") - public _FinalStage featuredWeight(double featuredWeight) { - this.featuredWeight = featuredWeight; - return this; - } - - /** - *

Categories associated with the app

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllCategories(List categories) { - this.categories.addAll(categories); - return this; - } - - /** - *

Categories associated with the app

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addCategories(String categories) { - this.categories.add(categories); - return this; - } - - /** - *

Categories associated with the app

- */ - @java.lang.Override - @JsonSetter(value = "categories", nulls = Nulls.SKIP) - public _FinalStage categories(List categories) { - this.categories.clear(); - this.categories.addAll(categories); - return this; - } - - /** - *

A JSON string representing the custom fields for the app

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

A JSON string representing the custom fields for the app

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

A short description of the app

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

A short description of the app

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

The authentication type used by the app

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

The authentication type used by the app

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

ID of the app. Only applies for OAuth apps.

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

ID of the app. Only applies for OAuth apps.

- */ - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public App build() { - return new App( - id, - nameSlug, - name, - authType, - description, - imgSrc, - customFieldsJson, - categories, - featuredWeight, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/AppAuthType.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/AppAuthType.java deleted file mode 100644 index e795709..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/AppAuthType.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum AppAuthType { - KEYS("keys"), - - OAUTH("oauth"), - - NONE("none"); - - private final String value; - - AppAuthType(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/AppCategory.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/AppCategory.java deleted file mode 100644 index 12799ff..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/AppCategory.java +++ /dev/null @@ -1,161 +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 = AppCategory.Builder.class) -public final class AppCategory { - private final Optional id; - - private final Optional name; - - private final Optional description; - - private final Map additionalProperties; - - private AppCategory( - Optional id, - Optional name, - Optional description, - Map additionalProperties) { - this.id = id; - this.name = name; - this.description = description; - this.additionalProperties = additionalProperties; - } - - /** - * @return ID of the app category - */ - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The human-readable name of the app category - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return A short description of the app category - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AppCategory && equalTo((AppCategory) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AppCategory other) { - return id.equals(other.id) && name.equals(other.name) && description.equals(other.description); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.name, this.description); - } - - @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 id = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional description = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AppCategory other) { - id(other.getId()); - name(other.getName()); - description(other.getDescription()); - return this; - } - - /** - *

ID of the app category

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

The human-readable name of the app category

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

A short description of the app category

- */ - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public Builder description(Optional description) { - this.description = description; - return this; - } - - public Builder description(String description) { - this.description = Optional.ofNullable(description); - return this; - } - - public AppCategory build() { - return new AppCategory(id, name, description, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/BackendClientOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/BackendClientOpts.java deleted file mode 100644 index cdf9287..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/BackendClientOpts.java +++ /dev/null @@ -1,163 +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 = BackendClientOpts.Builder.class) -public final class BackendClientOpts { - private final Optional clientId; - - private final Optional clientSecret; - - private final Optional apiUrl; - - private final Map additionalProperties; - - private BackendClientOpts( - Optional clientId, - Optional clientSecret, - Optional apiUrl, - Map additionalProperties) { - this.clientId = clientId; - this.clientSecret = clientSecret; - this.apiUrl = apiUrl; - this.additionalProperties = additionalProperties; - } - - /** - * @return The client ID for authentication - */ - @JsonProperty("client_id") - public Optional getClientId() { - return clientId; - } - - /** - * @return The client secret for authentication - */ - @JsonProperty("client_secret") - public Optional getClientSecret() { - return clientSecret; - } - - /** - * @return The API URL to use - */ - @JsonProperty("api_url") - public Optional getApiUrl() { - return apiUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof BackendClientOpts && equalTo((BackendClientOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(BackendClientOpts other) { - return clientId.equals(other.clientId) - && clientSecret.equals(other.clientSecret) - && apiUrl.equals(other.apiUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.clientId, this.clientSecret, this.apiUrl); - } - - @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 clientId = Optional.empty(); - - private Optional clientSecret = Optional.empty(); - - private Optional apiUrl = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(BackendClientOpts other) { - clientId(other.getClientId()); - clientSecret(other.getClientSecret()); - apiUrl(other.getApiUrl()); - return this; - } - - /** - *

The client ID for authentication

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

The client secret for authentication

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

The API URL to use

- */ - @JsonSetter(value = "api_url", nulls = Nulls.SKIP) - public Builder apiUrl(Optional apiUrl) { - this.apiUrl = apiUrl; - return this; - } - - public Builder apiUrl(String apiUrl) { - this.apiUrl = Optional.ofNullable(apiUrl); - return this; - } - - public BackendClientOpts build() { - return new BackendClientOpts(clientId, clientSecret, apiUrl, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ClientOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ClientOpts.java deleted file mode 100644 index 70aa6e6..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ClientOpts.java +++ /dev/null @@ -1,163 +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 = ClientOpts.Builder.class) -public final class ClientOpts { - private final Optional clientId; - - private final Optional clientSecret; - - private final Optional apiUrl; - - private final Map additionalProperties; - - private ClientOpts( - Optional clientId, - Optional clientSecret, - Optional apiUrl, - Map additionalProperties) { - this.clientId = clientId; - this.clientSecret = clientSecret; - this.apiUrl = apiUrl; - this.additionalProperties = additionalProperties; - } - - /** - * @return The client ID for authentication - */ - @JsonProperty("client_id") - public Optional getClientId() { - return clientId; - } - - /** - * @return The client secret for authentication - */ - @JsonProperty("client_secret") - public Optional getClientSecret() { - return clientSecret; - } - - /** - * @return The API URL to use (defaults to https://api.pipedream.com/) - */ - @JsonProperty("api_url") - public Optional getApiUrl() { - return apiUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ClientOpts && equalTo((ClientOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ClientOpts other) { - return clientId.equals(other.clientId) - && clientSecret.equals(other.clientSecret) - && apiUrl.equals(other.apiUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.clientId, this.clientSecret, this.apiUrl); - } - - @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 clientId = Optional.empty(); - - private Optional clientSecret = Optional.empty(); - - private Optional apiUrl = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ClientOpts other) { - clientId(other.getClientId()); - clientSecret(other.getClientSecret()); - apiUrl(other.getApiUrl()); - return this; - } - - /** - *

The client ID for authentication

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

The client secret for authentication

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

The API URL to use (defaults to https://api.pipedream.com/)

- */ - @JsonSetter(value = "api_url", nulls = Nulls.SKIP) - public Builder apiUrl(Optional apiUrl) { - this.apiUrl = apiUrl; - return this; - } - - public Builder apiUrl(String apiUrl) { - this.apiUrl = Optional.ofNullable(apiUrl); - return this; - } - - public ClientOpts build() { - return new ClientOpts(clientId, clientSecret, apiUrl, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/Component.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/Component.java deleted file mode 100644 index 95cbe86..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/Component.java +++ /dev/null @@ -1,365 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Component.Builder.class) -public final class Component { - private final String key; - - private final String name; - - private final String version; - - private final List configurableProps; - - private final Optional description; - - private final Optional componentType; - - private final Optional stash; - - private final Map additionalProperties; - - private Component( - String key, - String name, - String version, - List configurableProps, - Optional description, - Optional componentType, - Optional stash, - Map additionalProperties) { - this.key = key; - this.name = name; - this.version = version; - this.configurableProps = configurableProps; - this.description = description; - this.componentType = componentType; - this.stash = stash; - this.additionalProperties = additionalProperties; - } - - /** - * @return The key that uniquely identifies the component. - */ - @JsonProperty("key") - public String getKey() { - return key; - } - - /** - * @return The human-readable name of the component, e.g. 'GitLab: List Commits' - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The latest version of the component, in SemVer format. - */ - @JsonProperty("version") - public String getVersion() { - return version; - } - - @JsonProperty("configurable_props") - public List getConfigurableProps() { - return configurableProps; - } - - /** - * @return A description of the component - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return The type of component (trigger or action) - */ - @JsonProperty("component_type") - public Optional getComponentType() { - return componentType; - } - - /** - * @return Indicates if a File Stash ID is optional or required to run the component - */ - @JsonProperty("stash") - public Optional getStash() { - return stash; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Component && equalTo((Component) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Component other) { - return key.equals(other.key) - && name.equals(other.name) - && version.equals(other.version) - && configurableProps.equals(other.configurableProps) - && description.equals(other.description) - && componentType.equals(other.componentType) - && stash.equals(other.stash); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.key, - this.name, - this.version, - this.configurableProps, - this.description, - this.componentType, - this.stash); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static KeyStage builder() { - return new Builder(); - } - - public interface KeyStage { - /** - *

The key that uniquely identifies the component.

- */ - NameStage key(@NotNull String key); - - Builder from(Component other); - } - - public interface NameStage { - /** - *

The human-readable name of the component, e.g. 'GitLab: List Commits'

- */ - VersionStage name(@NotNull String name); - } - - public interface VersionStage { - /** - *

The latest version of the component, in SemVer format.

- */ - _FinalStage version(@NotNull String version); - } - - public interface _FinalStage { - Component build(); - - _FinalStage configurableProps(List configurableProps); - - _FinalStage addConfigurableProps(ConfigurableProp configurableProps); - - _FinalStage addAllConfigurableProps(List configurableProps); - - /** - *

A description of the component

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

The type of component (trigger or action)

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

Indicates if a File Stash ID is optional or required to run the component

- */ - _FinalStage stash(Optional stash); - - _FinalStage stash(ComponentStash stash); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements KeyStage, NameStage, VersionStage, _FinalStage { - private String key; - - private String name; - - private String version; - - private Optional stash = Optional.empty(); - - private Optional componentType = Optional.empty(); - - private Optional description = Optional.empty(); - - private List configurableProps = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(Component other) { - key(other.getKey()); - name(other.getName()); - version(other.getVersion()); - configurableProps(other.getConfigurableProps()); - description(other.getDescription()); - componentType(other.getComponentType()); - stash(other.getStash()); - return this; - } - - /** - *

The key that uniquely identifies the component.

- *

The key that uniquely identifies the component.

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

The human-readable name of the component, e.g. 'GitLab: List Commits'

- *

The human-readable name of the component, e.g. 'GitLab: List Commits'

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

The latest version of the component, in SemVer format.

- *

The latest version of the component, in SemVer format.

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

Indicates if a File Stash ID is optional or required to run the component

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

Indicates if a File Stash ID is optional or required to run the component

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

The type of component (trigger or action)

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

The type of component (trigger or action)

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

A description of the component

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

A description of the component

- */ - @java.lang.Override - @JsonSetter(value = "description", nulls = Nulls.SKIP) - public _FinalStage description(Optional description) { - this.description = description; - return this; - } - - @java.lang.Override - public _FinalStage addAllConfigurableProps(List configurableProps) { - this.configurableProps.addAll(configurableProps); - return this; - } - - @java.lang.Override - public _FinalStage addConfigurableProps(ConfigurableProp configurableProps) { - this.configurableProps.add(configurableProps); - return this; - } - - @java.lang.Override - @JsonSetter(value = "configurable_props", nulls = Nulls.SKIP) - public _FinalStage configurableProps(List configurableProps) { - this.configurableProps.clear(); - this.configurableProps.addAll(configurableProps); - return this; - } - - @java.lang.Override - public Component build() { - return new Component( - key, name, version, configurableProps, description, componentType, stash, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ComponentStash.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ComponentStash.java deleted file mode 100644 index ffbda73..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ComponentStash.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ComponentStash { - OPTIONAL("optional"), - - REQUIRED("required"); - - private final String value; - - ComponentStash(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurableProp.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurableProp.java deleted file mode 100644 index 9b27278..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurableProp.java +++ /dev/null @@ -1,420 +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 = ConfigurableProp.Builder.class) -public final class ConfigurableProp { - private final Optional name; - - private final Optional type; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurableProp( - Optional name, - Optional type, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.name = name; - this.type = type; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurableProp && equalTo((ConfigurableProp) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurableProp other) { - return name.equals(other.name) - && type.equals(other.type) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.name, - this.type, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 name = Optional.empty(); - - private Optional type = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurableProp other) { - name(other.getName()); - type(other.getType()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - /** - *

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurableProp build() { - return new ConfigurableProp( - name, - type, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAlert.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAlert.java deleted file mode 100644 index 782303c..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAlert.java +++ /dev/null @@ -1,484 +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 = ConfigurablePropAlert.Builder.class) -public final class ConfigurablePropAlert { - private final Optional type; - - private final Optional alertType; - - private final Optional content; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropAlert( - Optional type, - Optional alertType, - Optional content, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.alertType = alertType; - this.content = content; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return The severity level of the alert. - */ - @JsonProperty("alertType") - public Optional getAlertType() { - return alertType; - } - - /** - * @return The content of the alert, which can include HTML or plain text. - */ - @JsonProperty("content") - public Optional getContent() { - return content; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropAlert && equalTo((ConfigurablePropAlert) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropAlert other) { - return type.equals(other.type) - && alertType.equals(other.alertType) - && content.equals(other.content) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.alertType, - this.content, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional alertType = Optional.empty(); - - private Optional content = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropAlert other) { - type(other.getType()); - alertType(other.getAlertType()); - content(other.getContent()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

The severity level of the alert.

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

The content of the alert, which can include HTML or plain text.

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

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropAlert build() { - return new ConfigurablePropAlert( - type, - alertType, - content, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAlertAlertType.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAlertAlertType.java deleted file mode 100644 index 539ca52..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAlertAlertType.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ConfigurablePropAlertAlertType { - INFO("info"), - - NEUTRAL("neutral"), - - WARNING("warning"), - - ERROR("error"); - - private final String value; - - ConfigurablePropAlertAlertType(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAny.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAny.java deleted file mode 100644 index 87824c9..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropAny.java +++ /dev/null @@ -1,420 +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 = ConfigurablePropAny.Builder.class) -public final class ConfigurablePropAny { - private final Optional type; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropAny( - Optional type, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropAny && equalTo((ConfigurablePropAny) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropAny other) { - return type.equals(other.type) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropAny other) { - type(other.getType()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropAny build() { - return new ConfigurablePropAny( - type, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropApp.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropApp.java deleted file mode 100644 index f6e4246..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropApp.java +++ /dev/null @@ -1,452 +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 = ConfigurablePropApp.Builder.class) -public final class ConfigurablePropApp { - private final Optional type; - - private final Optional app; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropApp( - Optional type, - Optional app, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.app = app; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return The name slug of the app, e.g. 'github', 'slack', etc. This is used to identify the app for which the account is being configured. - */ - @JsonProperty("app") - public Optional getApp() { - return app; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropApp && equalTo((ConfigurablePropApp) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropApp other) { - return type.equals(other.type) - && app.equals(other.app) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.app, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional app = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropApp other) { - type(other.getType()); - app(other.getApp()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

The name slug of the app, e.g. 'github', 'slack', etc. This is used to identify the app for which the account is being configured.

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

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropApp build() { - return new ConfigurablePropApp( - type, - app, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropBoolean.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropBoolean.java deleted file mode 100644 index ad596d0..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropBoolean.java +++ /dev/null @@ -1,420 +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 = ConfigurablePropBoolean.Builder.class) -public final class ConfigurablePropBoolean { - private final Optional type; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropBoolean( - Optional type, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropBoolean && equalTo((ConfigurablePropBoolean) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropBoolean other) { - return type.equals(other.type) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropBoolean other) { - type(other.getType()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropBoolean build() { - return new ConfigurablePropBoolean( - type, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropDiscord.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropDiscord.java deleted file mode 100644 index 91fffbf..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropDiscord.java +++ /dev/null @@ -1,420 +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 = ConfigurablePropDiscord.Builder.class) -public final class ConfigurablePropDiscord { - private final Optional type; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropDiscord( - Optional type, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropDiscord && equalTo((ConfigurablePropDiscord) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropDiscord other) { - return type.equals(other.type) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropDiscord other) { - type(other.getType()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropDiscord build() { - return new ConfigurablePropDiscord( - type, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropInteger.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropInteger.java deleted file mode 100644 index ddbdf76..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropInteger.java +++ /dev/null @@ -1,484 +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 = ConfigurablePropInteger.Builder.class) -public final class ConfigurablePropInteger { - private final Optional type; - - private final Optional min; - - private final Optional max; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropInteger( - Optional type, - Optional min, - Optional max, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.min = min; - this.max = max; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return The minimum value for this integer prop. - */ - @JsonProperty("min") - public Optional getMin() { - return min; - } - - /** - * @return The maximum value for this integer prop. - */ - @JsonProperty("max") - public Optional getMax() { - return max; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropInteger && equalTo((ConfigurablePropInteger) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropInteger other) { - return type.equals(other.type) - && min.equals(other.min) - && max.equals(other.max) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.min, - this.max, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional min = Optional.empty(); - - private Optional max = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropInteger other) { - type(other.getType()); - min(other.getMin()); - max(other.getMax()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

The minimum value for this integer prop.

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

The maximum value for this integer prop.

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

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropInteger build() { - return new ConfigurablePropInteger( - type, - min, - max, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropObject.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropObject.java deleted file mode 100644 index 0cd6fa0..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropObject.java +++ /dev/null @@ -1,420 +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 = ConfigurablePropObject.Builder.class) -public final class ConfigurablePropObject { - private final Optional type; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropObject( - Optional type, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropObject && equalTo((ConfigurablePropObject) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropObject other) { - return type.equals(other.type) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropObject other) { - type(other.getType()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropObject build() { - return new ConfigurablePropObject( - type, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropString.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropString.java deleted file mode 100644 index c85dcf4..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropString.java +++ /dev/null @@ -1,452 +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 = ConfigurablePropString.Builder.class) -public final class ConfigurablePropString { - private final Optional type; - - private final Optional secret; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropString( - Optional type, - Optional secret, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.secret = secret; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return If true, this prop is a secret and should not be displayed in plain text. - */ - @JsonProperty("secret") - public Optional getSecret() { - return secret; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropString && equalTo((ConfigurablePropString) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropString other) { - return type.equals(other.type) - && secret.equals(other.secret) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.secret, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional secret = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropString other) { - type(other.getType()); - secret(other.getSecret()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

If true, this prop is a secret and should not be displayed in plain text.

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

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropString build() { - return new ConfigurablePropString( - type, - secret, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropStringArray.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropStringArray.java deleted file mode 100644 index 664fc6a..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurablePropStringArray.java +++ /dev/null @@ -1,452 +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 = ConfigurablePropStringArray.Builder.class) -public final class ConfigurablePropStringArray { - private final Optional type; - - private final Optional secret; - - private final Optional name; - - private final Optional label; - - private final Optional description; - - private final Optional optional; - - private final Optional disabled; - - private final Optional hidden; - - private final Optional remoteOptions; - - private final Optional useQuery; - - private final Optional reloadProps; - - private final Optional withLabel; - - private final Map additionalProperties; - - private ConfigurablePropStringArray( - Optional type, - Optional secret, - Optional name, - Optional label, - Optional description, - Optional optional, - Optional disabled, - Optional hidden, - Optional remoteOptions, - Optional useQuery, - Optional reloadProps, - Optional withLabel, - Map additionalProperties) { - this.type = type; - this.secret = secret; - this.name = name; - this.label = label; - this.description = description; - this.optional = optional; - this.disabled = disabled; - this.hidden = hidden; - this.remoteOptions = remoteOptions; - this.useQuery = useQuery; - this.reloadProps = reloadProps; - this.withLabel = withLabel; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("type") - public Optional getType() { - return type; - } - - /** - * @return If true, this prop is a secret and should not be displayed in plain text. - */ - @JsonProperty("secret") - public Optional getSecret() { - return secret; - } - - /** - * @return When building configuredProps, make sure to use this field as the key when setting the prop value - */ - @JsonProperty("name") - public Optional getName() { - return name; - } - - /** - * @return Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead. - */ - @JsonProperty("label") - public Optional getLabel() { - return label; - } - - /** - * @return A description of the prop, shown to the user when configuring the component. - */ - @JsonProperty("description") - public Optional getDescription() { - return description; - } - - /** - * @return If true, this prop does not need to be specified. - */ - @JsonProperty("optional") - public Optional getOptional() { - return optional; - } - - /** - * @return If true, this prop will be ignored. - */ - @JsonProperty("disabled") - public Optional getDisabled() { - return disabled; - } - - /** - * @return If true, should not expose this prop to the user - */ - @JsonProperty("hidden") - public Optional getHidden() { - return hidden; - } - - /** - * @return If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options - */ - @JsonProperty("remoteOptions") - public Optional getRemoteOptions() { - return remoteOptions; - } - - /** - * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options - */ - @JsonProperty("useQuery") - public Optional getUseQuery() { - return useQuery; - } - - /** - * @return If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one - */ - @JsonProperty("reloadProps") - public Optional getReloadProps() { - return reloadProps; - } - - /** - * @return If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label - */ - @JsonProperty("withLabel") - public Optional getWithLabel() { - return withLabel; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurablePropStringArray && equalTo((ConfigurablePropStringArray) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurablePropStringArray other) { - return type.equals(other.type) - && secret.equals(other.secret) - && name.equals(other.name) - && label.equals(other.label) - && description.equals(other.description) - && optional.equals(other.optional) - && disabled.equals(other.disabled) - && hidden.equals(other.hidden) - && remoteOptions.equals(other.remoteOptions) - && useQuery.equals(other.useQuery) - && reloadProps.equals(other.reloadProps) - && withLabel.equals(other.withLabel); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.type, - this.secret, - this.name, - this.label, - this.description, - this.optional, - this.disabled, - this.hidden, - this.remoteOptions, - this.useQuery, - this.reloadProps, - this.withLabel); - } - - @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 type = Optional.empty(); - - private Optional secret = Optional.empty(); - - private Optional name = Optional.empty(); - - private Optional label = Optional.empty(); - - private Optional description = Optional.empty(); - - private Optional optional = Optional.empty(); - - private Optional disabled = Optional.empty(); - - private Optional hidden = Optional.empty(); - - private Optional remoteOptions = Optional.empty(); - - private Optional useQuery = Optional.empty(); - - private Optional reloadProps = Optional.empty(); - - private Optional withLabel = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurablePropStringArray other) { - type(other.getType()); - secret(other.getSecret()); - name(other.getName()); - label(other.getLabel()); - description(other.getDescription()); - optional(other.getOptional()); - disabled(other.getDisabled()); - hidden(other.getHidden()); - remoteOptions(other.getRemoteOptions()); - useQuery(other.getUseQuery()); - reloadProps(other.getReloadProps()); - withLabel(other.getWithLabel()); - return this; - } - - @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { - this.type = type; - return this; - } - - public Builder type(String type) { - this.type = Optional.ofNullable(type); - return this; - } - - /** - *

If true, this prop is a secret and should not be displayed in plain text.

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

When building configuredProps, make sure to use this field as the key when setting the prop value

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

Value to use as an input label. In cases where type is "app", should load the app via getApp, etc. and show app.name instead.

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

A description of the prop, shown to the user when configuring the component.

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

If true, this prop does not need to be specified.

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

If true, this prop will be ignored.

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

If true, should not expose this prop to the user

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

If true, call configureComponent for this prop to load remote options. It is safe, and preferred, given a returned list of { label: string; value: any } objects to set the prop value to { __lv: { label: string; value: any } }. This way, on load, you can access label for the value without necessarily reloading these options

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

If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options

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

If true, after setting a value for this prop, a call to reloadComponentProps is required as the component has dynamic configurable props dependent on this one

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

If true, you must save the configured prop value as a "label-value" object which should look like: { __lv: { label: string; value: any } } because the execution needs to access the label

- */ - @JsonSetter(value = "withLabel", nulls = Nulls.SKIP) - public Builder withLabel(Optional withLabel) { - this.withLabel = withLabel; - return this; - } - - public Builder withLabel(Boolean withLabel) { - this.withLabel = Optional.ofNullable(withLabel); - return this; - } - - public ConfigurablePropStringArray build() { - return new ConfigurablePropStringArray( - type, - secret, - name, - label, - description, - optional, - disabled, - hidden, - remoteOptions, - useQuery, - reloadProps, - withLabel, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurePropOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurePropOpts.java deleted file mode 100644 index 86455a5..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurePropOpts.java +++ /dev/null @@ -1,509 +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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ConfigurePropOpts.Builder.class) -public final class ConfigurePropOpts { - private final String id; - - private final String externalUserId; - - private final String propName; - - private final Optional blocking; - - private final Optional> configuredProps; - - private final Optional dynamicPropsId; - - private final Optional asyncHandle; - - private final Optional page; - - private final Optional> prevContext; - - private final Optional query; - - private final Map additionalProperties; - - private ConfigurePropOpts( - String id, - String externalUserId, - String propName, - Optional blocking, - Optional> configuredProps, - Optional dynamicPropsId, - Optional asyncHandle, - Optional page, - Optional> prevContext, - Optional query, - Map additionalProperties) { - this.id = id; - this.externalUserId = externalUserId; - this.propName = propName; - this.blocking = blocking; - this.configuredProps = configuredProps; - this.dynamicPropsId = dynamicPropsId; - this.asyncHandle = asyncHandle; - this.page = page; - this.prevContext = prevContext; - this.query = query; - this.additionalProperties = additionalProperties; - } - - /** - * @return The component ID - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return The external user ID - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return The name of the prop to configure - */ - @JsonProperty("prop_name") - public String getPropName() { - return propName; - } - - /** - * @return Whether this operation should block until completion - */ - @JsonProperty("blocking") - public Optional getBlocking() { - return blocking; - } - - /** - * @return The configured properties for the component - */ - @JsonProperty("configured_props") - public Optional> getConfiguredProps() { - return configuredProps; - } - - /** - * @return The ID for dynamic props - */ - @JsonProperty("dynamic_props_id") - public Optional getDynamicPropsId() { - return dynamicPropsId; - } - - /** - * @return Handle for async operations - */ - @JsonProperty("async_handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - /** - * @return Page number for paginated results - */ - @JsonProperty("page") - public Optional getPage() { - return page; - } - - /** - * @return Previous context for pagination - */ - @JsonProperty("prev_context") - public Optional> getPrevContext() { - return prevContext; - } - - /** - * @return Search query for filtering options - */ - @JsonProperty("query") - public Optional getQuery() { - return query; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurePropOpts && equalTo((ConfigurePropOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurePropOpts other) { - return id.equals(other.id) - && externalUserId.equals(other.externalUserId) - && propName.equals(other.propName) - && blocking.equals(other.blocking) - && configuredProps.equals(other.configuredProps) - && dynamicPropsId.equals(other.dynamicPropsId) - && asyncHandle.equals(other.asyncHandle) - && page.equals(other.page) - && prevContext.equals(other.prevContext) - && query.equals(other.query); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.externalUserId, - this.propName, - this.blocking, - this.configuredProps, - this.dynamicPropsId, - this.asyncHandle, - this.page, - this.prevContext, - this.query); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

The component ID

- */ - ExternalUserIdStage id(@NotNull String id); - - Builder from(ConfigurePropOpts other); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID

- */ - PropNameStage externalUserId(@NotNull String externalUserId); - } - - public interface PropNameStage { - /** - *

The name of the prop to configure

- */ - _FinalStage propName(@NotNull String propName); - } - - public interface _FinalStage { - ConfigurePropOpts build(); - - /** - *

Whether this operation should block until completion

- */ - _FinalStage blocking(Optional blocking); - - _FinalStage blocking(Boolean blocking); - - /** - *

The configured properties for the component

- */ - _FinalStage configuredProps(Optional> configuredProps); - - _FinalStage configuredProps(Map configuredProps); - - /** - *

The ID for dynamic props

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

Handle for async operations

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

Page number for paginated results

- */ - _FinalStage page(Optional page); - - _FinalStage page(Double page); - - /** - *

Previous context for pagination

- */ - _FinalStage prevContext(Optional> prevContext); - - _FinalStage prevContext(Map prevContext); - - /** - *

Search query for filtering options

- */ - _FinalStage query(Optional query); - - _FinalStage query(String query); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, ExternalUserIdStage, PropNameStage, _FinalStage { - private String id; - - private String externalUserId; - - private String propName; - - private Optional query = Optional.empty(); - - private Optional> prevContext = Optional.empty(); - - private Optional page = Optional.empty(); - - private Optional asyncHandle = Optional.empty(); - - private Optional dynamicPropsId = Optional.empty(); - - private Optional> configuredProps = Optional.empty(); - - private Optional blocking = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ConfigurePropOpts other) { - id(other.getId()); - externalUserId(other.getExternalUserId()); - propName(other.getPropName()); - blocking(other.getBlocking()); - configuredProps(other.getConfiguredProps()); - dynamicPropsId(other.getDynamicPropsId()); - asyncHandle(other.getAsyncHandle()); - page(other.getPage()); - prevContext(other.getPrevContext()); - query(other.getQuery()); - return this; - } - - /** - *

The component ID

- *

The component ID

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

The external user ID

- *

The external user ID

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

The name of the prop to configure

- *

The name of the prop to configure

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

Search query for filtering options

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

Search query for filtering options

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

Previous context for pagination

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

Previous context for pagination

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

Page number for paginated results

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

Page number for paginated results

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

Handle for async operations

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

Handle for async operations

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

The ID for dynamic props

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

The ID for dynamic props

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

The configured properties for the component

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

The configured properties for the component

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

Whether this operation should block until completion

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

Whether this operation should block until completion

- */ - @java.lang.Override - @JsonSetter(value = "blocking", nulls = Nulls.SKIP) - public _FinalStage blocking(Optional blocking) { - this.blocking = blocking; - return this; - } - - @java.lang.Override - public ConfigurePropOpts build() { - return new ConfigurePropOpts( - id, - externalUserId, - propName, - blocking, - configuredProps, - dynamicPropsId, - asyncHandle, - page, - prevContext, - query, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurePropResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurePropResponse.java deleted file mode 100644 index 6c1a6af..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConfigurePropResponse.java +++ /dev/null @@ -1,133 +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.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ConfigurePropResponse.Builder.class) -public final class ConfigurePropResponse { - private final Optional> options; - - private final Optional> errors; - - private final Map additionalProperties; - - private ConfigurePropResponse( - Optional> options, - Optional> errors, - Map additionalProperties) { - this.options = options; - this.errors = errors; - this.additionalProperties = additionalProperties; - } - - /** - * @return Available options for the configured prop - */ - @JsonProperty("options") - public Optional> getOptions() { - return options; - } - - /** - * @return Any errors that occurred during configuration - */ - @JsonProperty("errors") - public Optional> getErrors() { - return errors; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConfigurePropResponse && equalTo((ConfigurePropResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConfigurePropResponse other) { - return options.equals(other.options) && errors.equals(other.errors); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.options, this.errors); - } - - @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> options = Optional.empty(); - - private Optional> errors = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ConfigurePropResponse other) { - options(other.getOptions()); - errors(other.getErrors()); - return this; - } - - /** - *

Available options for the configured prop

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

Any errors that occurred during configuration

- */ - @JsonSetter(value = "errors", nulls = Nulls.SKIP) - public Builder errors(Optional> errors) { - this.errors = errors; - return this; - } - - public Builder errors(List errors) { - this.errors = Optional.ofNullable(errors); - return this; - } - - public ConfigurePropResponse build() { - return new ConfigurePropResponse(options, errors, 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 deleted file mode 100644 index fa61409..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConnectTokenCreateOpts.java +++ /dev/null @@ -1,301 +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.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ConnectTokenCreateOpts.Builder.class) -public final class ConnectTokenCreateOpts { - private final String externalUserId; - - private final Optional> allowedOrigins; - - private final Optional errorRedirectUri; - - private final Optional successRedirectUri; - - private final Optional webhookUri; - - private final Map additionalProperties; - - private ConnectTokenCreateOpts( - String externalUserId, - Optional> allowedOrigins, - Optional errorRedirectUri, - Optional successRedirectUri, - Optional webhookUri, - Map additionalProperties) { - this.externalUserId = externalUserId; - this.allowedOrigins = allowedOrigins; - this.errorRedirectUri = errorRedirectUri; - this.successRedirectUri = successRedirectUri; - this.webhookUri = webhookUri; - this.additionalProperties = additionalProperties; - } - - /** - * @return Your end user ID, for whom you're creating the token - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return List of allowed origins for CORS - */ - @JsonProperty("allowed_origins") - public Optional> getAllowedOrigins() { - return allowedOrigins; - } - - /** - * @return URI to redirect to on error - */ - @JsonProperty("error_redirect_uri") - public Optional getErrorRedirectUri() { - return errorRedirectUri; - } - - /** - * @return URI to redirect to on success - */ - @JsonProperty("success_redirect_uri") - public Optional getSuccessRedirectUri() { - return successRedirectUri; - } - - /** - * @return Webhook URI for notifications - */ - @JsonProperty("webhook_uri") - public Optional getWebhookUri() { - return webhookUri; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConnectTokenCreateOpts && equalTo((ConnectTokenCreateOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConnectTokenCreateOpts other) { - return externalUserId.equals(other.externalUserId) - && allowedOrigins.equals(other.allowedOrigins) - && errorRedirectUri.equals(other.errorRedirectUri) - && successRedirectUri.equals(other.successRedirectUri) - && webhookUri.equals(other.webhookUri); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.externalUserId, - this.allowedOrigins, - this.errorRedirectUri, - this.successRedirectUri, - this.webhookUri); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ExternalUserIdStage builder() { - return new Builder(); - } - - public interface ExternalUserIdStage { - /** - *

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

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

List of allowed origins for CORS

- */ - _FinalStage allowedOrigins(Optional> allowedOrigins); - - _FinalStage allowedOrigins(List allowedOrigins); - - /** - *

URI to redirect to on error

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

URI to redirect to on success

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

Webhook URI for notifications

- */ - _FinalStage webhookUri(Optional webhookUri); - - _FinalStage webhookUri(String webhookUri); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ExternalUserIdStage, _FinalStage { - private String externalUserId; - - private Optional webhookUri = Optional.empty(); - - private Optional successRedirectUri = Optional.empty(); - - private Optional errorRedirectUri = Optional.empty(); - - private Optional> allowedOrigins = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ConnectTokenCreateOpts other) { - externalUserId(other.getExternalUserId()); - allowedOrigins(other.getAllowedOrigins()); - errorRedirectUri(other.getErrorRedirectUri()); - successRedirectUri(other.getSuccessRedirectUri()); - webhookUri(other.getWebhookUri()); - return this; - } - - /** - *

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

- *

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

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

Webhook URI for notifications

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

Webhook URI for notifications

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

URI to redirect to on success

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

URI to redirect to on success

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

URI to redirect to on error

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

URI to redirect to on error

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

List of allowed origins for CORS

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

List of allowed origins for CORS

- */ - @java.lang.Override - @JsonSetter(value = "allowed_origins", nulls = Nulls.SKIP) - public _FinalStage allowedOrigins(Optional> allowedOrigins) { - this.allowedOrigins = allowedOrigins; - return this; - } - - @java.lang.Override - public ConnectTokenCreateOpts build() { - return new ConnectTokenCreateOpts( - externalUserId, - allowedOrigins, - errorRedirectUri, - successRedirectUri, - webhookUri, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConnectTokenResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConnectTokenResponse.java deleted file mode 100644 index 76aac12..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ConnectTokenResponse.java +++ /dev/null @@ -1,183 +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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ConnectTokenResponse.Builder.class) -public final class ConnectTokenResponse { - private final String connectLinkUrl; - - private final OffsetDateTime expiresAt; - - private final String token; - - private final Map additionalProperties; - - private ConnectTokenResponse( - String connectLinkUrl, OffsetDateTime expiresAt, String token, Map additionalProperties) { - this.connectLinkUrl = connectLinkUrl; - this.expiresAt = expiresAt; - this.token = token; - this.additionalProperties = additionalProperties; - } - - /** - * @return The Connect Link URL - */ - @JsonProperty("connect_link_url") - public String getConnectLinkUrl() { - return connectLinkUrl; - } - - /** - * @return The expiration time of the token in ISO 8601 format - */ - @JsonProperty("expires_at") - public OffsetDateTime getExpiresAt() { - return expiresAt; - } - - /** - * @return The generated token - */ - @JsonProperty("token") - public String getToken() { - return token; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ConnectTokenResponse && equalTo((ConnectTokenResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ConnectTokenResponse other) { - return connectLinkUrl.equals(other.connectLinkUrl) - && expiresAt.equals(other.expiresAt) - && token.equals(other.token); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.connectLinkUrl, this.expiresAt, this.token); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ConnectLinkUrlStage builder() { - return new Builder(); - } - - public interface ConnectLinkUrlStage { - /** - *

The Connect Link URL

- */ - ExpiresAtStage connectLinkUrl(@NotNull String connectLinkUrl); - - Builder from(ConnectTokenResponse other); - } - - public interface ExpiresAtStage { - /** - *

The expiration time of the token in ISO 8601 format

- */ - TokenStage expiresAt(@NotNull OffsetDateTime expiresAt); - } - - public interface TokenStage { - /** - *

The generated token

- */ - _FinalStage token(@NotNull String token); - } - - public interface _FinalStage { - ConnectTokenResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ConnectLinkUrlStage, ExpiresAtStage, TokenStage, _FinalStage { - private String connectLinkUrl; - - private OffsetDateTime expiresAt; - - private String token; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ConnectTokenResponse other) { - connectLinkUrl(other.getConnectLinkUrl()); - expiresAt(other.getExpiresAt()); - token(other.getToken()); - return this; - } - - /** - *

The Connect Link URL

- *

The Connect Link URL

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

The expiration time of the token in ISO 8601 format

- *

The expiration time of the token in ISO 8601 format

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

The generated token

- *

The generated token

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("token") - public _FinalStage token(@NotNull String token) { - this.token = Objects.requireNonNull(token, "token must not be null"); - return this; - } - - @java.lang.Override - public ConnectTokenResponse build() { - return new ConnectTokenResponse(connectLinkUrl, expiresAt, token, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateBrowserClientOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateBrowserClientOpts.java deleted file mode 100644 index 96af1a4..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateBrowserClientOpts.java +++ /dev/null @@ -1,101 +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 = CreateBrowserClientOpts.Builder.class) -public final class CreateBrowserClientOpts { - private final Optional apiUrl; - - private final Map additionalProperties; - - private CreateBrowserClientOpts(Optional apiUrl, Map additionalProperties) { - this.apiUrl = apiUrl; - this.additionalProperties = additionalProperties; - } - - /** - * @return The API URL to use - */ - @JsonProperty("api_url") - public Optional getApiUrl() { - return apiUrl; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateBrowserClientOpts && equalTo((CreateBrowserClientOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateBrowserClientOpts other) { - return apiUrl.equals(other.apiUrl); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.apiUrl); - } - - @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 apiUrl = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(CreateBrowserClientOpts other) { - apiUrl(other.getApiUrl()); - return this; - } - - /** - *

The API URL to use

- */ - @JsonSetter(value = "api_url", nulls = Nulls.SKIP) - public Builder apiUrl(Optional apiUrl) { - this.apiUrl = apiUrl; - return this; - } - - public Builder apiUrl(String apiUrl) { - this.apiUrl = Optional.ofNullable(apiUrl); - return this; - } - - public CreateBrowserClientOpts build() { - return new CreateBrowserClientOpts(apiUrl, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateOAuthTokenResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateOAuthTokenResponse.java deleted file mode 100644 index 3f50fd1..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateOAuthTokenResponse.java +++ /dev/null @@ -1,149 +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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateOAuthTokenResponse.Builder.class) -public final class CreateOAuthTokenResponse { - private final String accessToken; - - private final String tokenType; - - private final int expiresIn; - - private final Map additionalProperties; - - private CreateOAuthTokenResponse( - String accessToken, String tokenType, int expiresIn, Map additionalProperties) { - this.accessToken = accessToken; - this.tokenType = tokenType; - this.expiresIn = expiresIn; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("access_token") - public String getAccessToken() { - return accessToken; - } - - @JsonProperty("token_type") - public String getTokenType() { - return tokenType; - } - - @JsonProperty("expires_in") - public int getExpiresIn() { - return expiresIn; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateOAuthTokenResponse && equalTo((CreateOAuthTokenResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateOAuthTokenResponse other) { - return accessToken.equals(other.accessToken) - && tokenType.equals(other.tokenType) - && expiresIn == other.expiresIn; - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.accessToken, this.tokenType, this.expiresIn); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AccessTokenStage builder() { - return new Builder(); - } - - public interface AccessTokenStage { - TokenTypeStage accessToken(@NotNull String accessToken); - - Builder from(CreateOAuthTokenResponse other); - } - - public interface TokenTypeStage { - ExpiresInStage tokenType(@NotNull String tokenType); - } - - public interface ExpiresInStage { - _FinalStage expiresIn(int expiresIn); - } - - public interface _FinalStage { - CreateOAuthTokenResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccessTokenStage, TokenTypeStage, ExpiresInStage, _FinalStage { - private String accessToken; - - private String tokenType; - - private int expiresIn; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateOAuthTokenResponse other) { - accessToken(other.getAccessToken()); - tokenType(other.getTokenType()); - expiresIn(other.getExpiresIn()); - return this; - } - - @java.lang.Override - @JsonSetter("access_token") - public TokenTypeStage accessToken(@NotNull String accessToken) { - this.accessToken = Objects.requireNonNull(accessToken, "accessToken must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("token_type") - public ExpiresInStage tokenType(@NotNull String tokenType) { - this.tokenType = Objects.requireNonNull(tokenType, "tokenType must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("expires_in") - public _FinalStage expiresIn(int expiresIn) { - this.expiresIn = expiresIn; - return this; - } - - @java.lang.Override - public CreateOAuthTokenResponse build() { - return new CreateOAuthTokenResponse(accessToken, tokenType, expiresIn, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateTokenResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateTokenResponse.java deleted file mode 100644 index 4ce6161..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/CreateTokenResponse.java +++ /dev/null @@ -1,183 +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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateTokenResponse.Builder.class) -public final class CreateTokenResponse { - private final String connectLinkUrl; - - private final OffsetDateTime expiresAt; - - private final String token; - - private final Map additionalProperties; - - private CreateTokenResponse( - String connectLinkUrl, OffsetDateTime expiresAt, String token, Map additionalProperties) { - this.connectLinkUrl = connectLinkUrl; - this.expiresAt = expiresAt; - this.token = token; - this.additionalProperties = additionalProperties; - } - - /** - * @return The Connect Link URL - */ - @JsonProperty("connect_link_url") - public String getConnectLinkUrl() { - return connectLinkUrl; - } - - /** - * @return The expiration time of the token in ISO 8601 format - */ - @JsonProperty("expires_at") - public OffsetDateTime getExpiresAt() { - return expiresAt; - } - - /** - * @return The generated token - */ - @JsonProperty("token") - public String getToken() { - return token; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateTokenResponse && equalTo((CreateTokenResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateTokenResponse other) { - return connectLinkUrl.equals(other.connectLinkUrl) - && expiresAt.equals(other.expiresAt) - && token.equals(other.token); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.connectLinkUrl, this.expiresAt, this.token); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ConnectLinkUrlStage builder() { - return new Builder(); - } - - public interface ConnectLinkUrlStage { - /** - *

The Connect Link URL

- */ - ExpiresAtStage connectLinkUrl(@NotNull String connectLinkUrl); - - Builder from(CreateTokenResponse other); - } - - public interface ExpiresAtStage { - /** - *

The expiration time of the token in ISO 8601 format

- */ - TokenStage expiresAt(@NotNull OffsetDateTime expiresAt); - } - - public interface TokenStage { - /** - *

The generated token

- */ - _FinalStage token(@NotNull String token); - } - - public interface _FinalStage { - CreateTokenResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ConnectLinkUrlStage, ExpiresAtStage, TokenStage, _FinalStage { - private String connectLinkUrl; - - private OffsetDateTime expiresAt; - - private String token; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateTokenResponse other) { - connectLinkUrl(other.getConnectLinkUrl()); - expiresAt(other.getExpiresAt()); - token(other.getToken()); - return this; - } - - /** - *

The Connect Link URL

- *

The Connect Link URL

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

The expiration time of the token in ISO 8601 format

- *

The expiration time of the token in ISO 8601 format

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

The generated token

- *

The generated token

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("token") - public _FinalStage token(@NotNull String token) { - this.token = Objects.requireNonNull(token, "token must not be null"); - return this; - } - - @java.lang.Override - public CreateTokenResponse build() { - return new CreateTokenResponse(connectLinkUrl, expiresAt, token, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeleteTriggerOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeleteTriggerOpts.java deleted file mode 100644 index 70b04b4..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeleteTriggerOpts.java +++ /dev/null @@ -1,101 +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 = DeleteTriggerOpts.Builder.class) -public final class DeleteTriggerOpts { - private final Optional ignoreHookErrors; - - private final Map additionalProperties; - - private DeleteTriggerOpts(Optional ignoreHookErrors, Map additionalProperties) { - this.ignoreHookErrors = ignoreHookErrors; - this.additionalProperties = additionalProperties; - } - - /** - * @return Whether to ignore errors during deactivation hook - */ - @JsonProperty("ignore_hook_errors") - public Optional getIgnoreHookErrors() { - return ignoreHookErrors; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeleteTriggerOpts && equalTo((DeleteTriggerOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeleteTriggerOpts other) { - return ignoreHookErrors.equals(other.ignoreHookErrors); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.ignoreHookErrors); - } - - @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 ignoreHookErrors = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(DeleteTriggerOpts other) { - ignoreHookErrors(other.getIgnoreHookErrors()); - return this; - } - - /** - *

Whether to ignore errors during deactivation hook

- */ - @JsonSetter(value = "ignore_hook_errors", nulls = Nulls.SKIP) - public Builder ignoreHookErrors(Optional ignoreHookErrors) { - this.ignoreHookErrors = ignoreHookErrors; - return this; - } - - public Builder ignoreHookErrors(Boolean ignoreHookErrors) { - this.ignoreHookErrors = Optional.ofNullable(ignoreHookErrors); - return this; - } - - public DeleteTriggerOpts build() { - return new DeleteTriggerOpts(ignoreHookErrors, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeployTriggerResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeployTriggerResponse.java deleted file mode 100644 index 09aac9d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeployTriggerResponse.java +++ /dev/null @@ -1,102 +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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployTriggerResponse.Builder.class) -public final class DeployTriggerResponse { - private final DeployedComponent data; - - private final Map additionalProperties; - - private DeployTriggerResponse(DeployedComponent data, Map additionalProperties) { - this.data = data; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public DeployedComponent getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployTriggerResponse && equalTo((DeployTriggerResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployTriggerResponse other) { - return data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static DataStage builder() { - return new Builder(); - } - - public interface DataStage { - _FinalStage data(@NotNull DeployedComponent data); - - Builder from(DeployTriggerResponse other); - } - - public interface _FinalStage { - DeployTriggerResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DataStage, _FinalStage { - private DeployedComponent data; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployTriggerResponse other) { - data(other.getData()); - return this; - } - - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull DeployedComponent data) { - this.data = Objects.requireNonNull(data, "data must not be null"); - return this; - } - - @java.lang.Override - public DeployTriggerResponse build() { - return new DeployTriggerResponse(data, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeployedComponent.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeployedComponent.java deleted file mode 100644 index 8a6e6b9..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/DeployedComponent.java +++ /dev/null @@ -1,539 +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.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedComponent.Builder.class) -public final class DeployedComponent { - private final String id; - - private final String ownerId; - - private final String componentId; - - private final List configurableProps; - - private final Map configuredProps; - - private final boolean active; - - private final int createdAt; - - private final int updatedAt; - - private final String name; - - private final String nameSlug; - - private final Optional callbackObservations; - - private final Map additionalProperties; - - private DeployedComponent( - String id, - String ownerId, - String componentId, - List configurableProps, - Map configuredProps, - boolean active, - int createdAt, - int updatedAt, - String name, - String nameSlug, - Optional callbackObservations, - Map additionalProperties) { - this.id = id; - this.ownerId = ownerId; - this.componentId = componentId; - this.configurableProps = configurableProps; - this.configuredProps = configuredProps; - this.active = active; - this.createdAt = createdAt; - this.updatedAt = updatedAt; - this.name = name; - this.nameSlug = nameSlug; - this.callbackObservations = callbackObservations; - this.additionalProperties = additionalProperties; - } - - /** - * @return The unique ID of the deployed component - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return The ID of the owner - */ - @JsonProperty("owner_id") - public String getOwnerId() { - return ownerId; - } - - /** - * @return The ID of the component that was deployed - */ - @JsonProperty("component_id") - public String getComponentId() { - return componentId; - } - - /** - * @return The configurable properties of the component - */ - @JsonProperty("configurable_props") - public List getConfigurableProps() { - return configurableProps; - } - - /** - * @return The configured properties of the component - */ - @JsonProperty("configured_props") - public Map getConfiguredProps() { - return configuredProps; - } - - /** - * @return Whether the deployed component is active - */ - @JsonProperty("active") - public boolean getActive() { - return active; - } - - /** - * @return The timestamp when the component was deployed (epoch milliseconds) - */ - @JsonProperty("created_at") - public int getCreatedAt() { - return createdAt; - } - - /** - * @return The timestamp when the component was last updated (epoch milliseconds) - */ - @JsonProperty("updated_at") - public int getUpdatedAt() { - return updatedAt; - } - - /** - * @return The name of the deployed component - */ - @JsonProperty("name") - public String getName() { - return name; - } - - /** - * @return The name slug of the deployed component - */ - @JsonProperty("name_slug") - public String getNameSlug() { - return nameSlug; - } - - @JsonProperty("callback_observations") - public Optional getCallbackObservations() { - return callbackObservations; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof DeployedComponent && equalTo((DeployedComponent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(DeployedComponent other) { - return id.equals(other.id) - && ownerId.equals(other.ownerId) - && componentId.equals(other.componentId) - && configurableProps.equals(other.configurableProps) - && configuredProps.equals(other.configuredProps) - && active == other.active - && createdAt == other.createdAt - && updatedAt == other.updatedAt - && name.equals(other.name) - && nameSlug.equals(other.nameSlug) - && callbackObservations.equals(other.callbackObservations); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.ownerId, - this.componentId, - this.configurableProps, - this.configuredProps, - this.active, - this.createdAt, - this.updatedAt, - this.name, - this.nameSlug, - this.callbackObservations); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

The unique ID of the deployed component

- */ - OwnerIdStage id(@NotNull String id); - - Builder from(DeployedComponent other); - } - - public interface OwnerIdStage { - /** - *

The ID of the owner

- */ - ComponentIdStage ownerId(@NotNull String ownerId); - } - - public interface ComponentIdStage { - /** - *

The ID of the component that was deployed

- */ - ActiveStage componentId(@NotNull String componentId); - } - - public interface ActiveStage { - /** - *

Whether the deployed component is active

- */ - CreatedAtStage active(boolean active); - } - - public interface CreatedAtStage { - /** - *

The timestamp when the component was deployed (epoch milliseconds)

- */ - UpdatedAtStage createdAt(int createdAt); - } - - public interface UpdatedAtStage { - /** - *

The timestamp when the component was last updated (epoch milliseconds)

- */ - NameStage updatedAt(int updatedAt); - } - - public interface NameStage { - /** - *

The name of the deployed component

- */ - NameSlugStage name(@NotNull String name); - } - - public interface NameSlugStage { - /** - *

The name slug of the deployed component

- */ - _FinalStage nameSlug(@NotNull String nameSlug); - } - - public interface _FinalStage { - DeployedComponent build(); - - /** - *

The configurable properties of the component

- */ - _FinalStage configurableProps(List configurableProps); - - _FinalStage addConfigurableProps(ConfigurableProp configurableProps); - - _FinalStage addAllConfigurableProps(List configurableProps); - - /** - *

The configured properties of the component

- */ - _FinalStage configuredProps(Map configuredProps); - - _FinalStage putAllConfiguredProps(Map configuredProps); - - _FinalStage configuredProps(String key, Object value); - - _FinalStage callbackObservations(Optional callbackObservations); - - _FinalStage callbackObservations(Object callbackObservations); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder - implements IdStage, - OwnerIdStage, - ComponentIdStage, - ActiveStage, - CreatedAtStage, - UpdatedAtStage, - NameStage, - NameSlugStage, - _FinalStage { - private String id; - - private String ownerId; - - private String componentId; - - private boolean active; - - private int createdAt; - - private int updatedAt; - - private String name; - - private String nameSlug; - - private Optional callbackObservations = Optional.empty(); - - private Map configuredProps = new LinkedHashMap<>(); - - private List configurableProps = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(DeployedComponent other) { - id(other.getId()); - ownerId(other.getOwnerId()); - componentId(other.getComponentId()); - configurableProps(other.getConfigurableProps()); - configuredProps(other.getConfiguredProps()); - active(other.getActive()); - createdAt(other.getCreatedAt()); - updatedAt(other.getUpdatedAt()); - name(other.getName()); - nameSlug(other.getNameSlug()); - callbackObservations(other.getCallbackObservations()); - return this; - } - - /** - *

The unique ID of the deployed component

- *

The unique ID of the deployed component

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

The ID of the owner

- *

The ID of the owner

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

The ID of the component that was deployed

- *

The ID of the component that was deployed

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

Whether the deployed component is active

- *

Whether the deployed component is active

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("active") - public CreatedAtStage active(boolean active) { - this.active = active; - return this; - } - - /** - *

The timestamp when the component was deployed (epoch milliseconds)

- *

The timestamp when the component was deployed (epoch milliseconds)

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("created_at") - public UpdatedAtStage createdAt(int createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - *

The timestamp when the component was last updated (epoch milliseconds)

- *

The timestamp when the component was last updated (epoch milliseconds)

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("updated_at") - public NameStage updatedAt(int updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - *

The name of the deployed component

- *

The name of the deployed component

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

The name slug of the deployed component

- *

The name slug of the deployed component

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("name_slug") - public _FinalStage nameSlug(@NotNull String nameSlug) { - this.nameSlug = Objects.requireNonNull(nameSlug, "nameSlug must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage callbackObservations(Object callbackObservations) { - this.callbackObservations = Optional.ofNullable(callbackObservations); - return this; - } - - @java.lang.Override - @JsonSetter(value = "callback_observations", nulls = Nulls.SKIP) - public _FinalStage callbackObservations(Optional callbackObservations) { - this.callbackObservations = callbackObservations; - return this; - } - - /** - *

The configured properties of the component

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage configuredProps(String key, Object value) { - this.configuredProps.put(key, value); - return this; - } - - /** - *

The configured properties of the component

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage putAllConfiguredProps(Map configuredProps) { - this.configuredProps.putAll(configuredProps); - return this; - } - - /** - *

The configured properties of the component

- */ - @java.lang.Override - @JsonSetter(value = "configured_props", nulls = Nulls.SKIP) - public _FinalStage configuredProps(Map configuredProps) { - this.configuredProps.clear(); - this.configuredProps.putAll(configuredProps); - return this; - } - - /** - *

The configurable properties of the component

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addAllConfigurableProps(List configurableProps) { - this.configurableProps.addAll(configurableProps); - return this; - } - - /** - *

The configurable properties of the component

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage addConfigurableProps(ConfigurableProp configurableProps) { - this.configurableProps.add(configurableProps); - return this; - } - - /** - *

The configurable properties of the component

- */ - @java.lang.Override - @JsonSetter(value = "configurable_props", nulls = Nulls.SKIP) - public _FinalStage configurableProps(List configurableProps) { - this.configurableProps.clear(); - this.configurableProps.addAll(configurableProps); - return this; - } - - @java.lang.Override - public DeployedComponent build() { - return new DeployedComponent( - id, - ownerId, - componentId, - configurableProps, - configuredProps, - active, - createdAt, - updatedAt, - name, - nameSlug, - callbackObservations, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/EmittedEvent.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/EmittedEvent.java deleted file mode 100644 index 21eebab..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/EmittedEvent.java +++ /dev/null @@ -1,235 +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.LinkedHashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = EmittedEvent.Builder.class) -public final class EmittedEvent { - private final Map e; - - private final String k; - - private final int ts; - - private final String id; - - private final Map additionalProperties; - - private EmittedEvent(Map e, String k, int ts, String id, Map additionalProperties) { - this.e = e; - this.k = k; - this.ts = ts; - this.id = id; - this.additionalProperties = additionalProperties; - } - - /** - * @return The event's payload - */ - @JsonProperty("e") - public Map getE() { - return e; - } - - /** - * @return The event's type (set to 'emit' currently) - */ - @JsonProperty("k") - public String getK() { - return k; - } - - /** - * @return The event's timestamp in epoch milliseconds - */ - @JsonProperty("ts") - public int getTs() { - return ts; - } - - /** - * @return The event's unique ID - */ - @JsonProperty("id") - public String getId() { - return id; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof EmittedEvent && equalTo((EmittedEvent) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(EmittedEvent other) { - return e.equals(other.e) && k.equals(other.k) && ts == other.ts && id.equals(other.id); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.e, this.k, this.ts, this.id); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static KStage builder() { - return new Builder(); - } - - public interface KStage { - /** - *

The event's type (set to 'emit' currently)

- */ - TsStage k(@NotNull String k); - - Builder from(EmittedEvent other); - } - - public interface TsStage { - /** - *

The event's timestamp in epoch milliseconds

- */ - IdStage ts(int ts); - } - - public interface IdStage { - /** - *

The event's unique ID

- */ - _FinalStage id(@NotNull String id); - } - - public interface _FinalStage { - EmittedEvent build(); - - /** - *

The event's payload

- */ - _FinalStage e(Map e); - - _FinalStage putAllE(Map e); - - _FinalStage e(String key, Object value); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements KStage, TsStage, IdStage, _FinalStage { - private String k; - - private int ts; - - private String id; - - private Map e = new LinkedHashMap<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(EmittedEvent other) { - e(other.getE()); - k(other.getK()); - ts(other.getTs()); - id(other.getId()); - return this; - } - - /** - *

The event's type (set to 'emit' currently)

- *

The event's type (set to 'emit' currently)

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

The event's timestamp in epoch milliseconds

- *

The event's timestamp in epoch milliseconds

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("ts") - public IdStage ts(int ts) { - this.ts = ts; - return this; - } - - /** - *

The event's unique ID

- *

The event's unique ID

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

The event's payload

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage e(String key, Object value) { - this.e.put(key, value); - return this; - } - - /** - *

The event's payload

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage putAllE(Map e) { - this.e.putAll(e); - return this; - } - - /** - *

The event's payload

- */ - @java.lang.Override - @JsonSetter(value = "e", nulls = Nulls.SKIP) - public _FinalStage e(Map e) { - this.e.clear(); - this.e.putAll(e); - return this; - } - - @java.lang.Override - public EmittedEvent build() { - return new EmittedEvent(e, k, ts, id, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ErrorResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ErrorResponse.java deleted file mode 100644 index 38b2481..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ErrorResponse.java +++ /dev/null @@ -1,201 +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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ErrorResponse.Builder.class) -public final class ErrorResponse { - private final String error; - - private final Optional code; - - private final Optional> details; - - private final Map additionalProperties; - - private ErrorResponse( - String error, - Optional code, - Optional> details, - Map additionalProperties) { - this.error = error; - this.code = code; - this.details = details; - this.additionalProperties = additionalProperties; - } - - /** - * @return The error message - */ - @JsonProperty("error") - public String getError() { - return error; - } - - /** - * @return The error code - */ - @JsonProperty("code") - public Optional getCode() { - return code; - } - - /** - * @return Additional error details - */ - @JsonProperty("details") - public Optional> getDetails() { - return details; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ErrorResponse && equalTo((ErrorResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ErrorResponse other) { - return error.equals(other.error) && code.equals(other.code) && details.equals(other.details); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.error, this.code, this.details); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static ErrorStage builder() { - return new Builder(); - } - - public interface ErrorStage { - /** - *

The error message

- */ - _FinalStage error(@NotNull String error); - - Builder from(ErrorResponse other); - } - - public interface _FinalStage { - ErrorResponse build(); - - /** - *

The error code

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

Additional error details

- */ - _FinalStage details(Optional> details); - - _FinalStage details(Map details); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements ErrorStage, _FinalStage { - private String error; - - private Optional> details = Optional.empty(); - - private Optional code = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ErrorResponse other) { - error(other.getError()); - code(other.getCode()); - details(other.getDetails()); - return this; - } - - /** - *

The error message

- *

The error message

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

Additional error details

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

Additional error details

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

The error code

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

The error code

- */ - @java.lang.Override - @JsonSetter(value = "code", nulls = Nulls.SKIP) - public _FinalStage code(Optional code) { - this.code = code; - return this; - } - - @java.lang.Override - public ErrorResponse build() { - return new ErrorResponse(error, code, details, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAccountsResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAccountsResponse.java deleted file mode 100644 index 27141c1..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAccountsResponse.java +++ /dev/null @@ -1,142 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetAccountsResponse.Builder.class) -public final class GetAccountsResponse { - private final List data; - - private final PageInfo pageInfo; - - private final Map additionalProperties; - - private GetAccountsResponse(List data, PageInfo pageInfo, Map additionalProperties) { - this.data = data; - this.pageInfo = pageInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public List getData() { - return data; - } - - @JsonProperty("page_info") - public PageInfo getPageInfo() { - return pageInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetAccountsResponse && equalTo((GetAccountsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetAccountsResponse other) { - return data.equals(other.data) && pageInfo.equals(other.pageInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data, this.pageInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PageInfoStage builder() { - return new Builder(); - } - - public interface PageInfoStage { - _FinalStage pageInfo(@NotNull PageInfo pageInfo); - - Builder from(GetAccountsResponse other); - } - - public interface _FinalStage { - GetAccountsResponse build(); - - _FinalStage data(List data); - - _FinalStage addData(Account data); - - _FinalStage addAllData(List data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PageInfoStage, _FinalStage { - private PageInfo pageInfo; - - private List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetAccountsResponse other) { - data(other.getData()); - pageInfo(other.getPageInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("page_info") - public _FinalStage pageInfo(@NotNull PageInfo pageInfo) { - this.pageInfo = Objects.requireNonNull(pageInfo, "pageInfo must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage addAllData(List data) { - this.data.addAll(data); - return this; - } - - @java.lang.Override - public _FinalStage addData(Account data) { - this.data.add(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(List data) { - this.data.clear(); - this.data.addAll(data); - return this; - } - - @java.lang.Override - public GetAccountsResponse build() { - return new GetAccountsResponse(data, pageInfo, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAppResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAppResponse.java deleted file mode 100644 index b8d680d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAppResponse.java +++ /dev/null @@ -1,102 +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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetAppResponse.Builder.class) -public final class GetAppResponse { - private final App data; - - private final Map additionalProperties; - - private GetAppResponse(App data, Map additionalProperties) { - this.data = data; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public App getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetAppResponse && equalTo((GetAppResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetAppResponse other) { - return data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static DataStage builder() { - return new Builder(); - } - - public interface DataStage { - _FinalStage data(@NotNull App data); - - Builder from(GetAppResponse other); - } - - public interface _FinalStage { - GetAppResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DataStage, _FinalStage { - private App data; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetAppResponse other) { - data(other.getData()); - return this; - } - - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull App data) { - this.data = Objects.requireNonNull(data, "data must not be null"); - return this; - } - - @java.lang.Override - public GetAppResponse build() { - return new GetAppResponse(data, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAppsResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAppsResponse.java deleted file mode 100644 index 9f69b14..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetAppsResponse.java +++ /dev/null @@ -1,142 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetAppsResponse.Builder.class) -public final class GetAppsResponse { - private final List data; - - private final PageInfo pageInfo; - - private final Map additionalProperties; - - private GetAppsResponse(List data, PageInfo pageInfo, Map additionalProperties) { - this.data = data; - this.pageInfo = pageInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public List getData() { - return data; - } - - @JsonProperty("page_info") - public PageInfo getPageInfo() { - return pageInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetAppsResponse && equalTo((GetAppsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetAppsResponse other) { - return data.equals(other.data) && pageInfo.equals(other.pageInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data, this.pageInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PageInfoStage builder() { - return new Builder(); - } - - public interface PageInfoStage { - _FinalStage pageInfo(@NotNull PageInfo pageInfo); - - Builder from(GetAppsResponse other); - } - - public interface _FinalStage { - GetAppsResponse build(); - - _FinalStage data(List data); - - _FinalStage addData(App data); - - _FinalStage addAllData(List data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PageInfoStage, _FinalStage { - private PageInfo pageInfo; - - private List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetAppsResponse other) { - data(other.getData()); - pageInfo(other.getPageInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("page_info") - public _FinalStage pageInfo(@NotNull PageInfo pageInfo) { - this.pageInfo = Objects.requireNonNull(pageInfo, "pageInfo must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage addAllData(List data) { - this.data.addAll(data); - return this; - } - - @java.lang.Override - public _FinalStage addData(App data) { - this.data.add(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(List data) { - this.data.clear(); - this.data.addAll(data); - return this; - } - - @java.lang.Override - public GetAppsResponse build() { - return new GetAppsResponse(data, pageInfo, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetComponentResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetComponentResponse.java deleted file mode 100644 index f2a0631..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetComponentResponse.java +++ /dev/null @@ -1,102 +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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetComponentResponse.Builder.class) -public final class GetComponentResponse { - private final Component data; - - private final Map additionalProperties; - - private GetComponentResponse(Component data, Map additionalProperties) { - this.data = data; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public Component getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetComponentResponse && equalTo((GetComponentResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetComponentResponse other) { - return data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static DataStage builder() { - return new Builder(); - } - - public interface DataStage { - _FinalStage data(@NotNull Component data); - - Builder from(GetComponentResponse other); - } - - public interface _FinalStage { - GetComponentResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DataStage, _FinalStage { - private Component data; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetComponentResponse other) { - data(other.getData()); - return this; - } - - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull Component data) { - this.data = Objects.requireNonNull(data, "data must not be null"); - return this; - } - - @java.lang.Override - public GetComponentResponse build() { - return new GetComponentResponse(data, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetComponentsResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetComponentsResponse.java deleted file mode 100644 index 9768dbf..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetComponentsResponse.java +++ /dev/null @@ -1,142 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetComponentsResponse.Builder.class) -public final class GetComponentsResponse { - private final List data; - - private final PageInfo pageInfo; - - private final Map additionalProperties; - - private GetComponentsResponse(List data, PageInfo pageInfo, Map additionalProperties) { - this.data = data; - this.pageInfo = pageInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public List getData() { - return data; - } - - @JsonProperty("page_info") - public PageInfo getPageInfo() { - return pageInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetComponentsResponse && equalTo((GetComponentsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetComponentsResponse other) { - return data.equals(other.data) && pageInfo.equals(other.pageInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data, this.pageInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PageInfoStage builder() { - return new Builder(); - } - - public interface PageInfoStage { - _FinalStage pageInfo(@NotNull PageInfo pageInfo); - - Builder from(GetComponentsResponse other); - } - - public interface _FinalStage { - GetComponentsResponse build(); - - _FinalStage data(List data); - - _FinalStage addData(Component data); - - _FinalStage addAllData(List data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PageInfoStage, _FinalStage { - private PageInfo pageInfo; - - private List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetComponentsResponse other) { - data(other.getData()); - pageInfo(other.getPageInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("page_info") - public _FinalStage pageInfo(@NotNull PageInfo pageInfo) { - this.pageInfo = Objects.requireNonNull(pageInfo, "pageInfo must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage addAllData(List data) { - this.data.addAll(data); - return this; - } - - @java.lang.Override - public _FinalStage addData(Component data) { - this.data.add(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(List data) { - this.data.clear(); - this.data.addAll(data); - return this; - } - - @java.lang.Override - public GetComponentsResponse build() { - return new GetComponentsResponse(data, pageInfo, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerEventsResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerEventsResponse.java deleted file mode 100644 index 87d47ab..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerEventsResponse.java +++ /dev/null @@ -1,102 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetTriggerEventsResponse.Builder.class) -public final class GetTriggerEventsResponse { - private final List data; - - private final Map additionalProperties; - - private GetTriggerEventsResponse(List data, Map additionalProperties) { - this.data = data; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public List getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetTriggerEventsResponse && equalTo((GetTriggerEventsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetTriggerEventsResponse other) { - return data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data); - } - - @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 List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GetTriggerEventsResponse other) { - data(other.getData()); - return this; - } - - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public Builder data(List data) { - this.data.clear(); - this.data.addAll(data); - return this; - } - - public Builder addData(EmittedEvent data) { - this.data.add(data); - return this; - } - - public Builder addAllData(List data) { - this.data.addAll(data); - return this; - } - - public GetTriggerEventsResponse build() { - return new GetTriggerEventsResponse(data, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerResponse.java deleted file mode 100644 index 697147e..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerResponse.java +++ /dev/null @@ -1,102 +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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetTriggerResponse.Builder.class) -public final class GetTriggerResponse { - private final DeployedComponent data; - - private final Map additionalProperties; - - private GetTriggerResponse(DeployedComponent data, Map additionalProperties) { - this.data = data; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public DeployedComponent getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetTriggerResponse && equalTo((GetTriggerResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetTriggerResponse other) { - return data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static DataStage builder() { - return new Builder(); - } - - public interface DataStage { - _FinalStage data(@NotNull DeployedComponent data); - - Builder from(GetTriggerResponse other); - } - - public interface _FinalStage { - GetTriggerResponse build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DataStage, _FinalStage { - private DeployedComponent data; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetTriggerResponse other) { - data(other.getData()); - return this; - } - - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull DeployedComponent data) { - this.data = Objects.requireNonNull(data, "data must not be null"); - return this; - } - - @java.lang.Override - public GetTriggerResponse build() { - return new GetTriggerResponse(data, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerWebhooksResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerWebhooksResponse.java deleted file mode 100644 index 1d86176..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerWebhooksResponse.java +++ /dev/null @@ -1,102 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetTriggerWebhooksResponse.Builder.class) -public final class GetTriggerWebhooksResponse { - private final List webhookUrls; - - private final Map additionalProperties; - - private GetTriggerWebhooksResponse(List webhookUrls, Map additionalProperties) { - this.webhookUrls = webhookUrls; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("webhook_urls") - public List getWebhookUrls() { - return webhookUrls; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetTriggerWebhooksResponse && equalTo((GetTriggerWebhooksResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetTriggerWebhooksResponse other) { - return webhookUrls.equals(other.webhookUrls); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.webhookUrls); - } - - @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 List webhookUrls = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GetTriggerWebhooksResponse other) { - webhookUrls(other.getWebhookUrls()); - return this; - } - - @JsonSetter(value = "webhook_urls", nulls = Nulls.SKIP) - public Builder webhookUrls(List webhookUrls) { - this.webhookUrls.clear(); - this.webhookUrls.addAll(webhookUrls); - return this; - } - - public Builder addWebhookUrls(String webhookUrls) { - this.webhookUrls.add(webhookUrls); - return this; - } - - public Builder addAllWebhookUrls(List webhookUrls) { - this.webhookUrls.addAll(webhookUrls); - return this; - } - - public GetTriggerWebhooksResponse build() { - return new GetTriggerWebhooksResponse(webhookUrls, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerWorkflowsResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerWorkflowsResponse.java deleted file mode 100644 index e14ed35..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggerWorkflowsResponse.java +++ /dev/null @@ -1,102 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetTriggerWorkflowsResponse.Builder.class) -public final class GetTriggerWorkflowsResponse { - private final List workflowIds; - - private final Map additionalProperties; - - private GetTriggerWorkflowsResponse(List workflowIds, Map additionalProperties) { - this.workflowIds = workflowIds; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("workflow_ids") - public List getWorkflowIds() { - return workflowIds; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetTriggerWorkflowsResponse && equalTo((GetTriggerWorkflowsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetTriggerWorkflowsResponse other) { - return workflowIds.equals(other.workflowIds); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.workflowIds); - } - - @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 List workflowIds = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(GetTriggerWorkflowsResponse other) { - workflowIds(other.getWorkflowIds()); - return this; - } - - @JsonSetter(value = "workflow_ids", nulls = Nulls.SKIP) - public Builder workflowIds(List workflowIds) { - this.workflowIds.clear(); - this.workflowIds.addAll(workflowIds); - return this; - } - - public Builder addWorkflowIds(String workflowIds) { - this.workflowIds.add(workflowIds); - return this; - } - - public Builder addAllWorkflowIds(List workflowIds) { - this.workflowIds.addAll(workflowIds); - return this; - } - - public GetTriggerWorkflowsResponse build() { - return new GetTriggerWorkflowsResponse(workflowIds, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggersResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggersResponse.java deleted file mode 100644 index 0c6a070..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/GetTriggersResponse.java +++ /dev/null @@ -1,143 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = GetTriggersResponse.Builder.class) -public final class GetTriggersResponse { - private final List data; - - private final PageInfo pageInfo; - - private final Map additionalProperties; - - private GetTriggersResponse( - List data, PageInfo pageInfo, Map additionalProperties) { - this.data = data; - this.pageInfo = pageInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public List getData() { - return data; - } - - @JsonProperty("page_info") - public PageInfo getPageInfo() { - return pageInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof GetTriggersResponse && equalTo((GetTriggersResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(GetTriggersResponse other) { - return data.equals(other.data) && pageInfo.equals(other.pageInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data, this.pageInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PageInfoStage builder() { - return new Builder(); - } - - public interface PageInfoStage { - _FinalStage pageInfo(@NotNull PageInfo pageInfo); - - Builder from(GetTriggersResponse other); - } - - public interface _FinalStage { - GetTriggersResponse build(); - - _FinalStage data(List data); - - _FinalStage addData(DeployedComponent data); - - _FinalStage addAllData(List data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PageInfoStage, _FinalStage { - private PageInfo pageInfo; - - private List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(GetTriggersResponse other) { - data(other.getData()); - pageInfo(other.getPageInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("page_info") - public _FinalStage pageInfo(@NotNull PageInfo pageInfo) { - this.pageInfo = Objects.requireNonNull(pageInfo, "pageInfo must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage addAllData(List data) { - this.data.addAll(data); - return this; - } - - @java.lang.Override - public _FinalStage addData(DeployedComponent data) { - this.data.add(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(List data) { - this.data.clear(); - this.data.addAll(data); - return this; - } - - @java.lang.Override - public GetTriggersResponse build() { - return new GetTriggersResponse(data, pageInfo, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ListAccountsResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ListAccountsResponse.java deleted file mode 100644 index f474727..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ListAccountsResponse.java +++ /dev/null @@ -1,142 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ListAccountsResponse.Builder.class) -public final class ListAccountsResponse { - private final List data; - - private final PageInfo pageInfo; - - private final Map additionalProperties; - - private ListAccountsResponse(List data, PageInfo pageInfo, Map additionalProperties) { - this.data = data; - this.pageInfo = pageInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public List getData() { - return data; - } - - @JsonProperty("page_info") - public PageInfo getPageInfo() { - return pageInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ListAccountsResponse && equalTo((ListAccountsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ListAccountsResponse other) { - return data.equals(other.data) && pageInfo.equals(other.pageInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data, this.pageInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PageInfoStage builder() { - return new Builder(); - } - - public interface PageInfoStage { - _FinalStage pageInfo(@NotNull PageInfo pageInfo); - - Builder from(ListAccountsResponse other); - } - - public interface _FinalStage { - ListAccountsResponse build(); - - _FinalStage data(List data); - - _FinalStage addData(Account data); - - _FinalStage addAllData(List data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PageInfoStage, _FinalStage { - private PageInfo pageInfo; - - private List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ListAccountsResponse other) { - data(other.getData()); - pageInfo(other.getPageInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("page_info") - public _FinalStage pageInfo(@NotNull PageInfo pageInfo) { - this.pageInfo = Objects.requireNonNull(pageInfo, "pageInfo must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage addAllData(List data) { - this.data.addAll(data); - return this; - } - - @java.lang.Override - public _FinalStage addData(Account data) { - this.data.add(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(List data) { - this.data.clear(); - this.data.addAll(data); - return this; - } - - @java.lang.Override - public ListAccountsResponse build() { - return new ListAccountsResponse(data, pageInfo, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ListAppsResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ListAppsResponse.java deleted file mode 100644 index 85fab80..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ListAppsResponse.java +++ /dev/null @@ -1,142 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ListAppsResponse.Builder.class) -public final class ListAppsResponse { - private final List data; - - private final PageInfo pageInfo; - - private final Map additionalProperties; - - private ListAppsResponse(List data, PageInfo pageInfo, Map additionalProperties) { - this.data = data; - this.pageInfo = pageInfo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("data") - public List getData() { - return data; - } - - @JsonProperty("page_info") - public PageInfo getPageInfo() { - return pageInfo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ListAppsResponse && equalTo((ListAppsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ListAppsResponse other) { - return data.equals(other.data) && pageInfo.equals(other.pageInfo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.data, this.pageInfo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static PageInfoStage builder() { - return new Builder(); - } - - public interface PageInfoStage { - _FinalStage pageInfo(@NotNull PageInfo pageInfo); - - Builder from(ListAppsResponse other); - } - - public interface _FinalStage { - ListAppsResponse build(); - - _FinalStage data(List data); - - _FinalStage addData(App data); - - _FinalStage addAllData(List data); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements PageInfoStage, _FinalStage { - private PageInfo pageInfo; - - private List data = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ListAppsResponse other) { - data(other.getData()); - pageInfo(other.getPageInfo()); - return this; - } - - @java.lang.Override - @JsonSetter("page_info") - public _FinalStage pageInfo(@NotNull PageInfo pageInfo) { - this.pageInfo = Objects.requireNonNull(pageInfo, "pageInfo must not be null"); - return this; - } - - @java.lang.Override - public _FinalStage addAllData(List data) { - this.data.addAll(data); - return this; - } - - @java.lang.Override - public _FinalStage addData(App data) { - this.data.add(data); - return this; - } - - @java.lang.Override - @JsonSetter(value = "data", nulls = Nulls.SKIP) - public _FinalStage data(List data) { - this.data.clear(); - this.data.addAll(data); - return this; - } - - @java.lang.Override - public ListAppsResponse build() { - return new ListAppsResponse(data, pageInfo, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/PageInfo.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/PageInfo.java deleted file mode 100644 index 8fbda9e..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/PageInfo.java +++ /dev/null @@ -1,169 +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 = PageInfo.Builder.class) -public final class PageInfo { - private final Optional count; - - private final Optional totalCount; - - private final Optional startCursor; - - private final Optional endCursor; - - private final Map additionalProperties; - - private PageInfo( - Optional count, - Optional totalCount, - Optional startCursor, - Optional endCursor, - Map additionalProperties) { - this.count = count; - this.totalCount = totalCount; - this.startCursor = startCursor; - this.endCursor = endCursor; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("count") - public Optional getCount() { - return count; - } - - @JsonProperty("total_count") - public Optional getTotalCount() { - return totalCount; - } - - @JsonProperty("start_cursor") - public Optional getStartCursor() { - return startCursor; - } - - @JsonProperty("end_cursor") - public Optional getEndCursor() { - return endCursor; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PageInfo && equalTo((PageInfo) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PageInfo other) { - return count.equals(other.count) - && totalCount.equals(other.totalCount) - && startCursor.equals(other.startCursor) - && endCursor.equals(other.endCursor); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.count, this.totalCount, this.startCursor, this.endCursor); - } - - @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 count = Optional.empty(); - - private Optional totalCount = Optional.empty(); - - private Optional startCursor = Optional.empty(); - - private Optional endCursor = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(PageInfo other) { - count(other.getCount()); - totalCount(other.getTotalCount()); - startCursor(other.getStartCursor()); - endCursor(other.getEndCursor()); - return this; - } - - @JsonSetter(value = "count", nulls = Nulls.SKIP) - public Builder count(Optional count) { - this.count = count; - return this; - } - - public Builder count(Integer count) { - this.count = Optional.ofNullable(count); - return this; - } - - @JsonSetter(value = "total_count", nulls = Nulls.SKIP) - public Builder totalCount(Optional totalCount) { - this.totalCount = totalCount; - return this; - } - - public Builder totalCount(Integer totalCount) { - this.totalCount = Optional.ofNullable(totalCount); - return this; - } - - @JsonSetter(value = "start_cursor", nulls = Nulls.SKIP) - public Builder startCursor(Optional startCursor) { - this.startCursor = startCursor; - return this; - } - - public Builder startCursor(String startCursor) { - this.startCursor = Optional.ofNullable(startCursor); - return this; - } - - @JsonSetter(value = "end_cursor", nulls = Nulls.SKIP) - public Builder endCursor(Optional endCursor) { - this.endCursor = endCursor; - return this; - } - - public Builder endCursor(String endCursor) { - this.endCursor = Optional.ofNullable(endCursor); - return this; - } - - public PageInfo build() { - return new PageInfo(count, totalCount, startCursor, endCursor, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectEnvironment.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectEnvironment.java deleted file mode 100644 index aceb02c..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectEnvironment.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ProjectEnvironment { - DEVELOPMENT("development"), - - PRODUCTION("production"); - - private final String value; - - ProjectEnvironment(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectInfoResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectInfoResponse.java deleted file mode 100644 index c3f66ca..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectInfoResponse.java +++ /dev/null @@ -1,102 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProjectInfoResponse.Builder.class) -public final class ProjectInfoResponse { - private final List apps; - - private final Map additionalProperties; - - private ProjectInfoResponse(List apps, Map additionalProperties) { - this.apps = apps; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("apps") - public List getApps() { - return apps; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProjectInfoResponse && equalTo((ProjectInfoResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProjectInfoResponse other) { - return apps.equals(other.apps); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.apps); - } - - @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 List apps = new ArrayList<>(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ProjectInfoResponse other) { - apps(other.getApps()); - return this; - } - - @JsonSetter(value = "apps", nulls = Nulls.SKIP) - public Builder apps(List apps) { - this.apps.clear(); - this.apps.addAll(apps); - return this; - } - - public Builder addApps(ProjectInfoResponseAppsItem apps) { - this.apps.add(apps); - return this; - } - - public Builder addAllApps(List apps) { - this.apps.addAll(apps); - return this; - } - - public ProjectInfoResponse build() { - return new ProjectInfoResponse(apps, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectInfoResponseAppsItem.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectInfoResponseAppsItem.java deleted file mode 100644 index 1b6412a..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ProjectInfoResponseAppsItem.java +++ /dev/null @@ -1,157 +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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProjectInfoResponseAppsItem.Builder.class) -public final class ProjectInfoResponseAppsItem { - private final Optional id; - - private final String nameSlug; - - private final Map additionalProperties; - - private ProjectInfoResponseAppsItem( - Optional id, String nameSlug, Map additionalProperties) { - this.id = id; - this.nameSlug = nameSlug; - this.additionalProperties = additionalProperties; - } - - /** - * @return ID of the app. Only applies for OAuth apps. - */ - @JsonProperty("id") - public Optional getId() { - return id; - } - - /** - * @return The name slug of the target app - */ - @JsonProperty("name_slug") - public String getNameSlug() { - return nameSlug; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ProjectInfoResponseAppsItem && equalTo((ProjectInfoResponseAppsItem) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ProjectInfoResponseAppsItem other) { - return id.equals(other.id) && nameSlug.equals(other.nameSlug); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.nameSlug); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static NameSlugStage builder() { - return new Builder(); - } - - public interface NameSlugStage { - /** - *

The name slug of the target app

- */ - _FinalStage nameSlug(@NotNull String nameSlug); - - Builder from(ProjectInfoResponseAppsItem other); - } - - public interface _FinalStage { - ProjectInfoResponseAppsItem build(); - - /** - *

ID of the app. Only applies for OAuth apps.

- */ - _FinalStage id(Optional id); - - _FinalStage id(String id); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements NameSlugStage, _FinalStage { - private String nameSlug; - - private Optional id = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ProjectInfoResponseAppsItem other) { - id(other.getId()); - nameSlug(other.getNameSlug()); - return this; - } - - /** - *

The name slug of the target app

- *

The name slug of the target app

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

ID of the app. Only applies for OAuth apps.

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

ID of the app. Only applies for OAuth apps.

- */ - @java.lang.Override - @JsonSetter(value = "id", nulls = Nulls.SKIP) - public _FinalStage id(Optional id) { - this.id = id; - return this; - } - - @java.lang.Override - public ProjectInfoResponseAppsItem build() { - return new ProjectInfoResponseAppsItem(id, nameSlug, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/PropOption.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/PropOption.java deleted file mode 100644 index f3fd389..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/PropOption.java +++ /dev/null @@ -1,135 +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.databind.annotation.JsonDeserialize; -import com.pipedream.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PropOption.Builder.class) -public final class PropOption { - private final String label; - - private final Object value; - - private final Map additionalProperties; - - private PropOption(String label, Object value, Map additionalProperties) { - this.label = label; - this.value = value; - this.additionalProperties = additionalProperties; - } - - /** - * @return The human-readable label for the option - */ - @JsonProperty("label") - public String getLabel() { - return label; - } - - @JsonProperty("value") - public Object getValue() { - return value; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PropOption && equalTo((PropOption) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PropOption other) { - return label.equals(other.label) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.label, this.value); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static LabelStage builder() { - return new Builder(); - } - - public interface LabelStage { - /** - *

The human-readable label for the option

- */ - ValueStage label(@NotNull String label); - - Builder from(PropOption other); - } - - public interface ValueStage { - _FinalStage value(Object value); - } - - public interface _FinalStage { - PropOption build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements LabelStage, ValueStage, _FinalStage { - private String label; - - private Object value; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(PropOption other) { - label(other.getLabel()); - value(other.getValue()); - return this; - } - - /** - *

The human-readable label for the option

- *

The human-readable label for the option

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("label") - public ValueStage label(@NotNull String label) { - this.label = Objects.requireNonNull(label, "label must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("value") - public _FinalStage value(Object value) { - this.value = value; - return this; - } - - @java.lang.Override - public PropOption build() { - return new PropOption(label, value, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ReloadPropsOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ReloadPropsOpts.java deleted file mode 100644 index c10ebce..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ReloadPropsOpts.java +++ /dev/null @@ -1,331 +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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ReloadPropsOpts.Builder.class) -public final class ReloadPropsOpts { - private final String id; - - private final String externalUserId; - - private final Optional blocking; - - private final Optional> configuredProps; - - private final Optional dynamicPropsId; - - private final Optional asyncHandle; - - private final Map additionalProperties; - - private ReloadPropsOpts( - String id, - String externalUserId, - Optional blocking, - Optional> configuredProps, - Optional dynamicPropsId, - Optional asyncHandle, - Map additionalProperties) { - this.id = id; - this.externalUserId = externalUserId; - this.blocking = blocking; - this.configuredProps = configuredProps; - this.dynamicPropsId = dynamicPropsId; - this.asyncHandle = asyncHandle; - this.additionalProperties = additionalProperties; - } - - /** - * @return The component ID - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return The external user ID - */ - @JsonProperty("external_user_id") - public String getExternalUserId() { - return externalUserId; - } - - /** - * @return Whether this operation should block until completion - */ - @JsonProperty("blocking") - public Optional getBlocking() { - return blocking; - } - - /** - * @return The configured properties for the component - */ - @JsonProperty("configured_props") - public Optional> getConfiguredProps() { - return configuredProps; - } - - /** - * @return The ID for dynamic props - */ - @JsonProperty("dynamic_props_id") - public Optional getDynamicPropsId() { - return dynamicPropsId; - } - - /** - * @return Handle for async operations - */ - @JsonProperty("async_handle") - public Optional getAsyncHandle() { - return asyncHandle; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ReloadPropsOpts && equalTo((ReloadPropsOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ReloadPropsOpts other) { - return id.equals(other.id) - && externalUserId.equals(other.externalUserId) - && blocking.equals(other.blocking) - && configuredProps.equals(other.configuredProps) - && dynamicPropsId.equals(other.dynamicPropsId) - && asyncHandle.equals(other.asyncHandle); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.id, - this.externalUserId, - this.blocking, - this.configuredProps, - this.dynamicPropsId, - this.asyncHandle); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

The component ID

- */ - ExternalUserIdStage id(@NotNull String id); - - Builder from(ReloadPropsOpts other); - } - - public interface ExternalUserIdStage { - /** - *

The external user ID

- */ - _FinalStage externalUserId(@NotNull String externalUserId); - } - - public interface _FinalStage { - ReloadPropsOpts build(); - - /** - *

Whether this operation should block until completion

- */ - _FinalStage blocking(Optional blocking); - - _FinalStage blocking(Boolean blocking); - - /** - *

The configured properties for the component

- */ - _FinalStage configuredProps(Optional> configuredProps); - - _FinalStage configuredProps(Map configuredProps); - - /** - *

The ID for dynamic props

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

Handle for async operations

- */ - _FinalStage asyncHandle(Optional asyncHandle); - - _FinalStage asyncHandle(String asyncHandle); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, ExternalUserIdStage, _FinalStage { - private String id; - - private String externalUserId; - - private Optional asyncHandle = Optional.empty(); - - private Optional dynamicPropsId = Optional.empty(); - - private Optional> configuredProps = Optional.empty(); - - private Optional blocking = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ReloadPropsOpts other) { - id(other.getId()); - externalUserId(other.getExternalUserId()); - blocking(other.getBlocking()); - configuredProps(other.getConfiguredProps()); - dynamicPropsId(other.getDynamicPropsId()); - asyncHandle(other.getAsyncHandle()); - return this; - } - - /** - *

The component ID

- *

The component ID

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

The external user ID

- *

The external user ID

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

Handle for async operations

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

Handle for async operations

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

The ID for dynamic props

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

The ID for dynamic props

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

The configured properties for the component

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

The configured properties for the component

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

Whether this operation should block until completion

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

Whether this operation should block until completion

- */ - @java.lang.Override - @JsonSetter(value = "blocking", nulls = Nulls.SKIP) - public _FinalStage blocking(Optional blocking) { - this.blocking = blocking; - return this; - } - - @java.lang.Override - public ReloadPropsOpts build() { - return new ReloadPropsOpts( - id, externalUserId, blocking, configuredProps, dynamicPropsId, asyncHandle, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ReloadPropsResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ReloadPropsResponse.java deleted file mode 100644 index 56e3dae..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ReloadPropsResponse.java +++ /dev/null @@ -1,103 +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.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ReloadPropsResponse.Builder.class) -public final class ReloadPropsResponse { - private final Optional> configurableProps; - - private final Map additionalProperties; - - private ReloadPropsResponse( - Optional> configurableProps, Map additionalProperties) { - this.configurableProps = configurableProps; - this.additionalProperties = additionalProperties; - } - - /** - * @return The updated configurable properties - */ - @JsonProperty("configurable_props") - public Optional> getConfigurableProps() { - return configurableProps; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ReloadPropsResponse && equalTo((ReloadPropsResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ReloadPropsResponse other) { - return configurableProps.equals(other.configurableProps); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.configurableProps); - } - - @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> configurableProps = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(ReloadPropsResponse other) { - configurableProps(other.getConfigurableProps()); - return this; - } - - /** - *

The updated configurable properties

- */ - @JsonSetter(value = "configurable_props", nulls = Nulls.SKIP) - public Builder configurableProps(Optional> configurableProps) { - this.configurableProps = configurableProps; - return this; - } - - public Builder configurableProps(List configurableProps) { - this.configurableProps = Optional.ofNullable(configurableProps); - return this; - } - - public ReloadPropsResponse build() { - return new ReloadPropsResponse(configurableProps, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/RunActionResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/RunActionResponse.java deleted file mode 100644 index 585a35a..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/RunActionResponse.java +++ /dev/null @@ -1,175 +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 = RunActionResponse.Builder.class) -public final class RunActionResponse { - private final Optional exports; - - private final Optional os; - - private final Optional ret; - - private final Optional stashId; - - private final Map additionalProperties; - - private RunActionResponse( - Optional exports, - Optional os, - Optional ret, - Optional stashId, - Map additionalProperties) { - this.exports = exports; - this.os = os; - this.ret = ret; - this.stashId = stashId; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("exports") - public Optional getExports() { - return exports; - } - - @JsonProperty("os") - public Optional getOs() { - return os; - } - - @JsonProperty("ret") - public Optional getRet() { - return ret; - } - - /** - * @return The ID of the File Stash that was used to sync the action's /tmp directory - */ - @JsonProperty("stash_id") - public Optional getStashId() { - return stashId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RunActionResponse && equalTo((RunActionResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RunActionResponse other) { - return exports.equals(other.exports) - && os.equals(other.os) - && ret.equals(other.ret) - && stashId.equals(other.stashId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.exports, this.os, this.ret, this.stashId); - } - - @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 exports = Optional.empty(); - - private Optional os = Optional.empty(); - - private Optional ret = Optional.empty(); - - private Optional stashId = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(RunActionResponse other) { - exports(other.getExports()); - os(other.getOs()); - ret(other.getRet()); - stashId(other.getStashId()); - return this; - } - - @JsonSetter(value = "exports", nulls = Nulls.SKIP) - public Builder exports(Optional exports) { - this.exports = exports; - return this; - } - - public Builder exports(Object exports) { - this.exports = Optional.ofNullable(exports); - return this; - } - - @JsonSetter(value = "os", nulls = Nulls.SKIP) - public Builder os(Optional os) { - this.os = os; - return this; - } - - public Builder os(Object os) { - this.os = Optional.ofNullable(os); - return this; - } - - @JsonSetter(value = "ret", nulls = Nulls.SKIP) - public Builder ret(Optional ret) { - this.ret = ret; - return this; - } - - public Builder ret(Object ret) { - this.ret = Optional.ofNullable(ret); - return this; - } - - /** - *

The ID of the File Stash that was used to sync the action's /tmp directory

- */ - @JsonSetter(value = "stash_id", nulls = Nulls.SKIP) - public Builder stashId(Optional stashId) { - this.stashId = stashId; - return this; - } - - public Builder stashId(String stashId) { - this.stashId = Optional.ofNullable(stashId); - return this; - } - - public RunActionResponse build() { - return new RunActionResponse(exports, os, ret, stashId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/StartConnectOpts.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/StartConnectOpts.java deleted file mode 100644 index 74e494d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/StartConnectOpts.java +++ /dev/null @@ -1,101 +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 = StartConnectOpts.Builder.class) -public final class StartConnectOpts { - private final Optional iframe; - - private final Map additionalProperties; - - private StartConnectOpts(Optional iframe, Map additionalProperties) { - this.iframe = iframe; - this.additionalProperties = additionalProperties; - } - - /** - * @return ID of the iframe element to use - */ - @JsonProperty("iframe") - public Optional getIframe() { - return iframe; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof StartConnectOpts && equalTo((StartConnectOpts) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(StartConnectOpts other) { - return iframe.equals(other.iframe); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.iframe); - } - - @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 iframe = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(StartConnectOpts other) { - iframe(other.getIframe()); - return this; - } - - /** - *

ID of the iframe element to use

- */ - @JsonSetter(value = "iframe", nulls = Nulls.SKIP) - public Builder iframe(Optional iframe) { - this.iframe = iframe; - return this; - } - - public Builder iframe(String iframe) { - this.iframe = Optional.ofNullable(iframe); - return this; - } - - public StartConnectOpts build() { - return new StartConnectOpts(iframe, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ValidateTokenParams.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ValidateTokenParams.java deleted file mode 100644 index 26f43cb..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ValidateTokenParams.java +++ /dev/null @@ -1,156 +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; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ValidateTokenParams.Builder.class) -public final class ValidateTokenParams { - private final String appId; - - private final Optional oauthAppId; - - private final Map additionalProperties; - - private ValidateTokenParams(String appId, Optional oauthAppId, Map additionalProperties) { - this.appId = appId; - this.oauthAppId = oauthAppId; - this.additionalProperties = additionalProperties; - } - - /** - * @return The app ID to validate against - */ - @JsonProperty("app_id") - public String getAppId() { - return appId; - } - - /** - * @return The OAuth app ID - */ - @JsonProperty("oauth_app_id") - public Optional getOauthAppId() { - return oauthAppId; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ValidateTokenParams && equalTo((ValidateTokenParams) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ValidateTokenParams other) { - return appId.equals(other.appId) && oauthAppId.equals(other.oauthAppId); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.appId, this.oauthAppId); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static AppIdStage builder() { - return new Builder(); - } - - public interface AppIdStage { - /** - *

The app ID to validate against

- */ - _FinalStage appId(@NotNull String appId); - - Builder from(ValidateTokenParams other); - } - - public interface _FinalStage { - ValidateTokenParams build(); - - /** - *

The OAuth app ID

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

The app ID to validate against

- *

The app ID to validate against

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

The OAuth app ID

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

The OAuth app ID

- */ - @java.lang.Override - @JsonSetter(value = "oauth_app_id", nulls = Nulls.SKIP) - public _FinalStage oauthAppId(Optional oauthAppId) { - this.oauthAppId = oauthAppId; - return this; - } - - @java.lang.Override - public ValidateTokenParams build() { - return new ValidateTokenParams(appId, oauthAppId, additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java deleted file mode 100644 index 5691d9d..0000000 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java +++ /dev/null @@ -1,511 +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 = ValidateTokenResponse.Builder.class) -public final class ValidateTokenResponse { - private final Optional app; - - private final Optional error; - - private final Optional errorRedirectUri; - - private final Optional oauthAppId; - - private final Optional projectAppName; - - private final Optional projectEnvironment; - - private final Optional projectId; - - private final Optional projectSupportEmail; - - private final boolean success; - - private final Optional successRedirectUri; - - private final Map additionalProperties; - - private ValidateTokenResponse( - Optional app, - Optional error, - Optional errorRedirectUri, - Optional oauthAppId, - Optional projectAppName, - Optional projectEnvironment, - Optional projectId, - Optional projectSupportEmail, - boolean success, - Optional successRedirectUri, - Map additionalProperties) { - this.app = app; - this.error = error; - this.errorRedirectUri = errorRedirectUri; - this.oauthAppId = oauthAppId; - this.projectAppName = projectAppName; - this.projectEnvironment = projectEnvironment; - this.projectId = projectId; - this.projectSupportEmail = projectSupportEmail; - this.success = success; - this.successRedirectUri = successRedirectUri; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("app") - public Optional getApp() { - return app; - } - - /** - * @return Error message if validation failed - */ - @JsonProperty("error") - public Optional getError() { - return error; - } - - /** - * @return URI to redirect to on error - */ - @JsonProperty("error_redirect_uri") - public Optional getErrorRedirectUri() { - return errorRedirectUri; - } - - /** - * @return OAuth app ID if applicable - */ - @JsonProperty("oauth_app_id") - public Optional getOauthAppId() { - return oauthAppId; - } - - /** - * @return Name of the project app - */ - @JsonProperty("project_app_name") - public Optional getProjectAppName() { - return projectAppName; - } - - /** - * @return Environment of the project - */ - @JsonProperty("project_environment") - public Optional getProjectEnvironment() { - return projectEnvironment; - } - - /** - * @return ID of the project - */ - @JsonProperty("project_id") - public Optional getProjectId() { - return projectId; - } - - /** - * @return Support email for the project - */ - @JsonProperty("project_support_email") - public Optional getProjectSupportEmail() { - return projectSupportEmail; - } - - /** - * @return Whether the token validation was successful - */ - @JsonProperty("success") - public boolean getSuccess() { - return success; - } - - /** - * @return URI to redirect to on success - */ - @JsonProperty("success_redirect_uri") - public Optional getSuccessRedirectUri() { - return successRedirectUri; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof ValidateTokenResponse && equalTo((ValidateTokenResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(ValidateTokenResponse other) { - return app.equals(other.app) - && error.equals(other.error) - && errorRedirectUri.equals(other.errorRedirectUri) - && oauthAppId.equals(other.oauthAppId) - && projectAppName.equals(other.projectAppName) - && projectEnvironment.equals(other.projectEnvironment) - && projectId.equals(other.projectId) - && projectSupportEmail.equals(other.projectSupportEmail) - && success == other.success - && successRedirectUri.equals(other.successRedirectUri); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.app, - this.error, - this.errorRedirectUri, - this.oauthAppId, - this.projectAppName, - this.projectEnvironment, - this.projectId, - this.projectSupportEmail, - this.success, - this.successRedirectUri); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static SuccessStage builder() { - return new Builder(); - } - - public interface SuccessStage { - /** - *

Whether the token validation was successful

- */ - _FinalStage success(boolean success); - - Builder from(ValidateTokenResponse other); - } - - public interface _FinalStage { - ValidateTokenResponse build(); - - _FinalStage app(Optional app); - - _FinalStage app(App app); - - /** - *

Error message if validation failed

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

URI to redirect to on error

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

OAuth app ID if applicable

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

Name of the project app

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

Environment of the project

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

ID of the project

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

Support email for the project

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

URI to redirect to on success

- */ - _FinalStage successRedirectUri(Optional successRedirectUri); - - _FinalStage successRedirectUri(String successRedirectUri); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements SuccessStage, _FinalStage { - private boolean success; - - private Optional successRedirectUri = Optional.empty(); - - private Optional projectSupportEmail = Optional.empty(); - - private Optional projectId = Optional.empty(); - - private Optional projectEnvironment = Optional.empty(); - - private Optional projectAppName = Optional.empty(); - - private Optional oauthAppId = Optional.empty(); - - private Optional errorRedirectUri = Optional.empty(); - - private Optional error = Optional.empty(); - - private Optional app = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(ValidateTokenResponse other) { - app(other.getApp()); - error(other.getError()); - errorRedirectUri(other.getErrorRedirectUri()); - oauthAppId(other.getOauthAppId()); - projectAppName(other.getProjectAppName()); - projectEnvironment(other.getProjectEnvironment()); - projectId(other.getProjectId()); - projectSupportEmail(other.getProjectSupportEmail()); - success(other.getSuccess()); - successRedirectUri(other.getSuccessRedirectUri()); - return this; - } - - /** - *

Whether the token validation was successful

- *

Whether the token validation was successful

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("success") - public _FinalStage success(boolean success) { - this.success = success; - return this; - } - - /** - *

URI to redirect to on success

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

URI to redirect to on success

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

Support email for the project

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

Support email for the project

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

ID of the project

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

ID of the project

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

Environment of the project

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

Environment of the project

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

Name of the project app

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

Name of the project app

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

OAuth app ID if applicable

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

OAuth app ID if applicable

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

URI to redirect to on error

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

URI to redirect to on error

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

Error message if validation failed

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

Error message if validation failed

- */ - @java.lang.Override - @JsonSetter(value = "error", nulls = Nulls.SKIP) - public _FinalStage error(Optional error) { - this.error = error; - return this; - } - - @java.lang.Override - public _FinalStage app(App app) { - this.app = Optional.ofNullable(app); - return this; - } - - @java.lang.Override - @JsonSetter(value = "app", nulls = Nulls.SKIP) - public _FinalStage app(Optional app) { - this.app = app; - return this; - } - - @java.lang.Override - public ValidateTokenResponse build() { - return new ValidateTokenResponse( - app, - error, - errorRedirectUri, - oauthAppId, - projectAppName, - projectEnvironment, - projectId, - projectSupportEmail, - success, - successRedirectUri, - additionalProperties); - } - } -} diff --git a/build/spotless/spotlessJava/src/test/java/com/pipedream/api/StreamTest.java b/build/spotless/spotlessJava/src/test/java/com/pipedream/api/StreamTest.java deleted file mode 100644 index 57130cb..0000000 --- a/build/spotless/spotlessJava/src/test/java/com/pipedream/api/StreamTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api; - -import static org.junit.jupiter.api.Assertions.*; - -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.Stream; -import java.io.IOException; -import java.io.StringReader; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import org.junit.jupiter.api.Test; - -public final class StreamTest { - @Test - public void testJsonStream() { - List messages = List.of(Map.of("message", "hello"), Map.of("message", "world")); - List jsonStrings = messages.stream().map(StreamTest::mapToJson).collect(Collectors.toList()); - String input = String.join("\n", jsonStrings); - StringReader jsonInput = new StringReader(input); - Stream jsonStream = Stream.fromJson(Map.class, jsonInput); - int expectedMessages = 2; - int actualMessages = 0; - for (Map jsonObject : jsonStream) { - actualMessages++; - assertTrue(jsonObject.containsKey("message")); - } - assertEquals(expectedMessages, actualMessages); - } - - @Test - public void testSseStream() { - List events = List.of(Map.of("event", "start"), Map.of("event", "end")); - List sseStrings = events.stream().map(StreamTest::mapToSse).collect(Collectors.toList()); - String input = String.join("\n" + "\n", sseStrings); - StringReader sseInput = new StringReader(input); - Stream sseStream = Stream.fromSse(Map.class, sseInput); - int expectedEvents = 2; - int actualEvents = 0; - for (Map eventData : sseStream) { - actualEvents++; - assertTrue(eventData.containsKey("event")); - } - assertEquals(expectedEvents, actualEvents); - } - - @Test - public void testSseStreamWithTerminator() { - List events = List.of(Map.of("message", "first"), Map.of("message", "second")); - List sseStrings = events.stream().map(StreamTest::mapToSse).collect(Collectors.toList()); - sseStrings.add("data: [DONE]"); - String input = String.join("\n" + "\n", sseStrings); - StringReader sseInput = new StringReader(input); - Stream sseStream = Stream.fromSse(Map.class, sseInput, "[DONE]"); - int expectedEvents = 2; - int actualEvents = 0; - for (Map eventData : sseStream) { - actualEvents++; - assertTrue(eventData.containsKey("message")); - } - assertEquals(expectedEvents, actualEvents); - } - - @Test - public void testStreamResourceManagement() throws IOException { - StringReader testInput = new StringReader("{\"test\":\"data\"}"); - Stream testStream = Stream.fromJson(Map.class, testInput); - testStream.close(); - assertFalse(testStream.iterator().hasNext()); - } - - private static String mapToJson(Map map) { - try { - return ObjectMappers.JSON_MAPPER.writeValueAsString(map); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private static String mapToSse(Map map) { - return "data: " + mapToJson(map); - } -} diff --git a/build/spotless/spotlessJava/src/test/java/com/pipedream/api/TestClient.java b/build/spotless/spotlessJava/src/test/java/com/pipedream/api/TestClient.java deleted file mode 100644 index 157ade0..0000000 --- a/build/spotless/spotlessJava/src/test/java/com/pipedream/api/TestClient.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api; - -public final class TestClient { - public void test() { - // Add tests here and mark this file in .fernignore - assert true; - } -} diff --git a/build/spotless/spotlessJava/src/test/java/com/pipedream/api/core/QueryStringMapperTest.java b/build/spotless/spotlessJava/src/test/java/com/pipedream/api/core/QueryStringMapperTest.java deleted file mode 100644 index d8eac81..0000000 --- a/build/spotless/spotlessJava/src/test/java/com/pipedream/api/core/QueryStringMapperTest.java +++ /dev/null @@ -1,339 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.core; - -import java.time.Instant; -import java.time.OffsetDateTime; -import java.time.ZoneId; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import okhttp3.HttpUrl; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class QueryStringMapperTest { - @Test - public void testObjectWithQuotedString_indexedArrays() { - Map map = new HashMap() { - { - put("hello", "\"world\""); - } - }; - - String expectedQueryString = "withquoted%5Bhello%5D=%22world%22"; - - String actualQueryString = queryString( - new HashMap() { - { - put("withquoted", map); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectWithQuotedString_arraysAsRepeats() { - Map map = new HashMap() { - { - put("hello", "\"world\""); - } - }; - - String expectedQueryString = "withquoted%5Bhello%5D=%22world%22"; - - String actualQueryString = queryString( - new HashMap() { - { - put("withquoted", map); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObject_indexedArrays() { - Map map = new HashMap() { - { - put("foo", "bar"); - put("baz", "qux"); - } - }; - - String expectedQueryString = "metadata%5Bfoo%5D=bar&metadata%5Bbaz%5D=qux"; - - String actualQueryString = queryString( - new HashMap() { - { - put("metadata", map); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObject_arraysAsRepeats() { - Map map = new HashMap() { - { - put("foo", "bar"); - put("baz", "qux"); - } - }; - - String expectedQueryString = "metadata%5Bfoo%5D=bar&metadata%5Bbaz%5D=qux"; - - String actualQueryString = queryString( - new HashMap() { - { - put("metadata", map); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testNestedObject_indexedArrays() { - Map> nestedMap = new HashMap>() { - { - put("mapkey1", new HashMap() { - { - put("mapkey1mapkey1", "mapkey1mapkey1value"); - put("mapkey1mapkey2", "mapkey1mapkey2value"); - } - }); - put("mapkey2", new HashMap() { - { - put("mapkey2mapkey1", "mapkey2mapkey1value"); - } - }); - } - }; - - String expectedQueryString = - "nested%5Bmapkey2%5D%5Bmapkey2mapkey1%5D=mapkey2mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey1" - + "%5D=mapkey1mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey2%5D=mapkey1mapkey2value"; - - String actualQueryString = queryString( - new HashMap() { - { - put("nested", nestedMap); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testNestedObject_arraysAsRepeats() { - Map> nestedMap = new HashMap>() { - { - put("mapkey1", new HashMap() { - { - put("mapkey1mapkey1", "mapkey1mapkey1value"); - put("mapkey1mapkey2", "mapkey1mapkey2value"); - } - }); - put("mapkey2", new HashMap() { - { - put("mapkey2mapkey1", "mapkey2mapkey1value"); - } - }); - } - }; - - String expectedQueryString = - "nested%5Bmapkey2%5D%5Bmapkey2mapkey1%5D=mapkey2mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey1" - + "%5D=mapkey1mapkey1value&nested%5Bmapkey1%5D%5Bmapkey1mapkey2%5D=mapkey1mapkey2value"; - - String actualQueryString = queryString( - new HashMap() { - { - put("nested", nestedMap); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testDateTime_indexedArrays() { - OffsetDateTime dateTime = - OffsetDateTime.ofInstant(Instant.ofEpochSecond(1740412107L), ZoneId.of("America/New_York")); - - String expectedQueryString = "datetime=2025-02-24T10%3A48%3A27-05%3A00"; - - String actualQueryString = queryString( - new HashMap() { - { - put("datetime", dateTime); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testDateTime_arraysAsRepeats() { - OffsetDateTime dateTime = - OffsetDateTime.ofInstant(Instant.ofEpochSecond(1740412107L), ZoneId.of("America/New_York")); - - String expectedQueryString = "datetime=2025-02-24T10%3A48%3A27-05%3A00"; - - String actualQueryString = queryString( - new HashMap() { - { - put("datetime", dateTime); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectArray_indexedArrays() { - List> mapArray = new ArrayList>() { - { - add(new HashMap() { - { - put("key", "hello"); - put("value", "world"); - } - }); - add(new HashMap() { - { - put("key", "foo"); - put("value", "bar"); - } - }); - add(new HashMap<>()); - } - }; - - String expectedQueryString = "objects%5B0%5D%5Bvalue%5D=world&objects%5B0%5D%5Bkey%5D=hello&objects%5B1%5D" - + "%5Bvalue%5D=bar&objects%5B1%5D%5Bkey%5D=foo"; - - String actualQueryString = queryString( - new HashMap() { - { - put("objects", mapArray); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectArray_arraysAsRepeats() { - List> mapArray = new ArrayList>() { - { - add(new HashMap() { - { - put("key", "hello"); - put("value", "world"); - } - }); - add(new HashMap() { - { - put("key", "foo"); - put("value", "bar"); - } - }); - add(new HashMap<>()); - } - }; - - String expectedQueryString = - "objects%5Bvalue%5D=world&objects%5Bkey%5D=hello&objects%5Bvalue" + "%5D=bar&objects%5Bkey%5D=foo"; - - String actualQueryString = queryString( - new HashMap() { - { - put("objects", mapArray); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectWithArray_indexedArrays() { - Map objectWithArray = new HashMap() { - { - put("id", "abc123"); - put("contactIds", new ArrayList() { - { - add("id1"); - add("id2"); - add("id3"); - } - }); - } - }; - - String expectedQueryString = - "objectwitharray%5Bid%5D=abc123&objectwitharray%5BcontactIds%5D%5B0%5D=id1&objectwitharray" - + "%5BcontactIds%5D%5B1%5D=id2&objectwitharray%5BcontactIds%5D%5B2%5D=id3"; - - String actualQueryString = queryString( - new HashMap() { - { - put("objectwitharray", objectWithArray); - } - }, - false); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - @Test - public void testObjectWithArray_arraysAsRepeats() { - Map objectWithArray = new HashMap() { - { - put("id", "abc123"); - put("contactIds", new ArrayList() { - { - add("id1"); - add("id2"); - add("id3"); - } - }); - } - }; - - String expectedQueryString = "objectwitharray%5Bid%5D=abc123&objectwitharray%5BcontactIds" - + "%5D=id1&objectwitharray%5BcontactIds%5D=id2&objectwitharray%5BcontactIds%5D=id3"; - - String actualQueryString = queryString( - new HashMap() { - { - put("objectwitharray", objectWithArray); - } - }, - true); - - Assertions.assertEquals(expectedQueryString, actualQueryString); - } - - private static String queryString(Map params, boolean arraysAsRepeats) { - HttpUrl.Builder httpUrl = HttpUrl.parse("http://www.fakewebsite.com/").newBuilder(); - params.forEach((paramName, paramValue) -> - QueryStringMapper.addQueryParameter(httpUrl, paramName, paramValue, arraysAsRepeats)); - return httpUrl.build().encodedQuery(); - } -} diff --git a/build/tmp/spotless-register-dependencies b/build/tmp/spotless-register-dependencies deleted file mode 100644 index 56a6051..0000000 --- a/build/tmp/spotless-register-dependencies +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..1b33c55 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/src/main/java/com/pipedream/api/core/ClientOptions.java b/src/main/java/com/pipedream/api/core/ClientOptions.java index bd94c5e..2e7459a 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.255"); + put("X-Fern-SDK-Version", "0.0.256"); } }); this.headerSuppliers = headerSuppliers;