From 7ad86c978f78339a175f6c4259360b61660ef9e7 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 19:07:06 +0000 Subject: [PATCH] SDK regeneration --- .fern/metadata.json | 12 + README.md | 37 +- build.gradle | 13 +- .../api/core/BaseClientApiException.java | 4 +- .../com/pipedream/api/core/ClientOptions.java | 20 +- .../api/core/NullableNonemptyFilter.java | 5 +- .../com/pipedream/api/core/ObjectMappers.java | 9 + .../pipedream/api/core/RetryInterceptor.java | 118 +++++- .../resources/accounts/AccountsClient.java | 36 +- .../accounts/AsyncAccountsClient.java | 38 +- .../accounts/AsyncRawAccountsClient.java | 99 ++--- .../resources/accounts/RawAccountsClient.java | 98 ++--- .../requests/DeleteAccountsRequest.java | 59 +++ .../requests/DeleteByAppAccountsRequest.java | 59 +++ ...tRequest.java => ListAccountsRequest.java} | 16 +- ...uest.java => RetrieveAccountsRequest.java} | 16 +- .../api/resources/actions/ActionsClient.java | 24 +- .../resources/actions/AsyncActionsClient.java | 25 +- .../actions/AsyncRawActionsClient.java | 95 +++-- .../resources/actions/RawActionsClient.java | 95 ++--- .../requests/ConfigurePropActionsRequest.java | 103 +++++ ...stRequest.java => ListActionsRequest.java} | 16 +- .../requests/ReloadPropsActionsRequest.java | 103 +++++ ...quest.java => RetrieveActionsRequest.java} | 16 +- .../actions/requests/RunActionOpts.java | 57 ++- .../appcategories/AppCategoriesClient.java | 12 +- .../AsyncAppCategoriesClient.java | 13 +- .../AsyncRawAppCategoriesClient.java | 41 +- .../appcategories/RawAppCategoriesClient.java | 39 +- .../RetrieveAppCategoriesRequest.java | 59 +++ .../api/resources/apps/AppsClient.java | 18 +- .../api/resources/apps/AsyncAppsClient.java | 19 +- .../resources/apps/AsyncRawAppsClient.java | 49 ++- .../api/resources/apps/RawAppsClient.java | 49 ++- ...sListRequest.java => ListAppsRequest.java} | 44 +- .../apps/requests/RetrieveAppsRequest.java | 59 +++ ...java => ListAppsRequestSortDirection.java} | 16 +- ...rtKey.java => ListAppsRequestSortKey.java} | 20 +- .../components/AsyncComponentsClient.java | 25 +- .../components/AsyncRawComponentsClient.java | 82 ++-- .../components/ComponentsClient.java | 24 +- .../components/RawComponentsClient.java | 82 ++-- .../ConfigurePropComponentsRequest.java | 103 +++++ ...equest.java => ListComponentsRequest.java} | 16 +- .../ReloadPropsComponentsRequest.java | 103 +++++ ...st.java => RetrieveComponentsRequest.java} | 16 +- .../AsyncDeployedTriggersClient.java | 36 +- .../AsyncRawDeployedTriggersClient.java | 126 +++--- .../DeployedTriggersClient.java | 36 +- .../RawDeployedTriggersClient.java | 124 +++--- ...ava => DeleteDeployedTriggersRequest.java} | 20 +- ....java => ListDeployedTriggersRequest.java} | 20 +- ...=> ListEventsDeployedTriggersRequest.java} | 20 +- ... ListWebhooksDeployedTriggersRequest.java} | 22 +- ...ListWorkflowsDeployedTriggersRequest.java} | 22 +- ...a => RetrieveDeployedTriggersRequest.java} | 20 +- .../filestash/AsyncFileStashClient.java | 6 +- .../filestash/AsyncRawFileStashClient.java | 15 +- .../resources/filestash/FileStashClient.java | 6 +- .../filestash/RawFileStashClient.java | 15 +- ...java => DownloadFileFileStashRequest.java} | 20 +- .../AsyncRawOauthTokensClient.java | 11 +- .../oauthtokens/RawOauthTokensClient.java | 10 +- .../projects/AsyncProjectsClient.java | 13 +- .../projects/AsyncRawProjectsClient.java | 33 +- .../resources/projects/ProjectsClient.java | 12 +- .../resources/projects/RawProjectsClient.java | 33 +- .../requests/RetrieveInfoProjectsRequest.java | 59 +++ .../resources/proxy/AsyncRawProxyClient.java | 112 +++--- .../api/resources/proxy/RawProxyClient.java | 99 +++-- ...teRequest.java => DeleteProxyRequest.java} | 20 +- ...xyGetRequest.java => GetProxyRequest.java} | 20 +- ...tchRequest.java => PatchProxyRequest.java} | 20 +- ...PostRequest.java => PostProxyRequest.java} | 20 +- ...xyPutRequest.java => PutProxyRequest.java} | 20 +- .../tokens/AsyncRawTokensClient.java | 26 +- .../resources/tokens/AsyncTokensClient.java | 6 +- .../api/resources/tokens/RawTokensClient.java | 28 +- .../api/resources/tokens/TokensClient.java | 6 +- ...equest.java => ValidateTokensRequest.java} | 20 +- .../triggers/AsyncRawTriggersClient.java | 95 +++-- .../triggers/AsyncTriggersClient.java | 25 +- .../resources/triggers/RawTriggersClient.java | 95 ++--- .../resources/triggers/TriggersClient.java | 24 +- .../ConfigurePropTriggersRequest.java | 103 +++++ .../triggers/requests/DeployTriggerOpts.java | 32 +- ...tRequest.java => ListTriggersRequest.java} | 16 +- .../requests/ReloadPropsTriggersRequest.java | 103 +++++ ...uest.java => RetrieveTriggersRequest.java} | 16 +- .../resources/users/AsyncRawUsersClient.java | 26 +- .../api/resources/users/AsyncUsersClient.java | 15 +- .../api/resources/users/RawUsersClient.java | 27 +- .../api/resources/users/UsersClient.java | 15 +- .../DeleteExternalUserUsersRequest.java | 59 +++ .../java/com/pipedream/api/types/Account.java | 148 ++++++- .../java/com/pipedream/api/types/App.java | 115 +++++- .../com/pipedream/api/types/AppCategory.java | 25 +- .../com/pipedream/api/types/Component.java | 111 ++++- .../pipedream/api/types/ConfigurableProp.java | 264 +++++++++++- .../types/ConfigurablePropAirtableBaseId.java | 264 +++++++++++- .../ConfigurablePropAirtableFieldId.java | 264 +++++++++++- .../ConfigurablePropAirtableTableId.java | 264 +++++++++++- .../types/ConfigurablePropAirtableViewId.java | 264 +++++++++++- .../api/types/ConfigurablePropAlert.java | 264 +++++++++++- .../api/types/ConfigurablePropAny.java | 264 +++++++++++- .../api/types/ConfigurablePropApp.java | 264 +++++++++++- .../api/types/ConfigurablePropApphook.java | 351 +++++++++++++++- .../api/types/ConfigurablePropBoolean.java | 264 +++++++++++- .../api/types/ConfigurablePropDb.java | 264 +++++++++++- .../api/types/ConfigurablePropDiscord.java | 264 +++++++++++- .../types/ConfigurablePropDiscordChannel.java | 264 +++++++++++- .../ConfigurablePropDiscordChannelArray.java | 264 +++++++++++- .../api/types/ConfigurablePropHttp.java | 293 +++++++++++++- .../api/types/ConfigurablePropInteger.java | 351 +++++++++++++++- .../types/ConfigurablePropIntegerArray.java | 380 +++++++++++++++++- .../api/types/ConfigurablePropObject.java | 264 +++++++++++- .../api/types/ConfigurablePropSql.java | 289 ++++++++++++- .../api/types/ConfigurablePropString.java | 293 +++++++++++++- .../types/ConfigurablePropStringArray.java | 322 ++++++++++++++- .../api/types/ConfigurablePropTimer.java | 343 +++++++++++++++- .../api/types/ConfigurePropOpts.java | 32 +- .../api/types/ConfigurePropResponse.java | 91 ++++- .../api/types/DeployedComponent.java | 61 ++- .../api/types/ProjectInfoResponseApp.java | 25 +- .../com/pipedream/api/types/PropOption.java | 28 +- .../pipedream/api/types/ReloadPropsOpts.java | 32 +- .../api/types/RunActionResponse.java | 25 +- .../pipedream/api/types/ToolAnnotations.java | 113 +++++- .../api/types/ValidateTokenResponse.java | 260 +++++++++++- .../pipedream/api/OauthTokensWireTest.java | 119 ------ .../com/pipedream/api/TokensWireTest.java | 108 ----- 131 files changed, 9673 insertions(+), 1727 deletions(-) create mode 100644 .fern/metadata.json create mode 100644 src/main/java/com/pipedream/api/resources/accounts/requests/DeleteAccountsRequest.java create mode 100644 src/main/java/com/pipedream/api/resources/accounts/requests/DeleteByAppAccountsRequest.java rename src/main/java/com/pipedream/api/resources/accounts/requests/{AccountsListRequest.java => ListAccountsRequest.java} (95%) rename src/main/java/com/pipedream/api/resources/accounts/requests/{AccountsRetrieveRequest.java => RetrieveAccountsRequest.java} (84%) create mode 100644 src/main/java/com/pipedream/api/resources/actions/requests/ConfigurePropActionsRequest.java rename src/main/java/com/pipedream/api/resources/actions/requests/{ActionsListRequest.java => ListActionsRequest.java} (92%) create mode 100644 src/main/java/com/pipedream/api/resources/actions/requests/ReloadPropsActionsRequest.java rename src/main/java/com/pipedream/api/resources/actions/requests/{ActionsRetrieveRequest.java => RetrieveActionsRequest.java} (83%) create mode 100644 src/main/java/com/pipedream/api/resources/appcategories/requests/RetrieveAppCategoriesRequest.java rename src/main/java/com/pipedream/api/resources/apps/requests/{AppsListRequest.java => ListAppsRequest.java} (85%) create mode 100644 src/main/java/com/pipedream/api/resources/apps/requests/RetrieveAppsRequest.java rename src/main/java/com/pipedream/api/resources/apps/types/{AppsListRequestSortDirection.java => ListAppsRequestSortDirection.java} (72%) rename src/main/java/com/pipedream/api/resources/apps/types/{AppsListRequestSortKey.java => ListAppsRequestSortKey.java} (71%) create mode 100644 src/main/java/com/pipedream/api/resources/components/requests/ConfigurePropComponentsRequest.java rename src/main/java/com/pipedream/api/resources/components/requests/{ComponentsListRequest.java => ListComponentsRequest.java} (93%) create mode 100644 src/main/java/com/pipedream/api/resources/components/requests/ReloadPropsComponentsRequest.java rename src/main/java/com/pipedream/api/resources/components/requests/{ComponentsRetrieveRequest.java => RetrieveComponentsRequest.java} (83%) rename src/main/java/com/pipedream/api/resources/deployedtriggers/requests/{DeployedTriggersDeleteRequest.java => DeleteDeployedTriggersRequest.java} (88%) rename src/main/java/com/pipedream/api/resources/deployedtriggers/requests/{DeployedTriggersListRequest.java => ListDeployedTriggersRequest.java} (93%) rename src/main/java/com/pipedream/api/resources/deployedtriggers/requests/{DeployedTriggersListEventsRequest.java => ListEventsDeployedTriggersRequest.java} (87%) rename src/main/java/com/pipedream/api/resources/deployedtriggers/requests/{DeployedTriggersListWebhooksRequest.java => ListWebhooksDeployedTriggersRequest.java} (82%) rename src/main/java/com/pipedream/api/resources/deployedtriggers/requests/{DeployedTriggersListWorkflowsRequest.java => ListWorkflowsDeployedTriggersRequest.java} (82%) rename src/main/java/com/pipedream/api/resources/deployedtriggers/requests/{DeployedTriggersRetrieveRequest.java => RetrieveDeployedTriggersRequest.java} (82%) rename src/main/java/com/pipedream/api/resources/filestash/requests/{FileStashDownloadFileRequest.java => DownloadFileFileStashRequest.java} (79%) create mode 100644 src/main/java/com/pipedream/api/resources/projects/requests/RetrieveInfoProjectsRequest.java rename src/main/java/com/pipedream/api/resources/proxy/requests/{ProxyDeleteRequest.java => DeleteProxyRequest.java} (88%) rename src/main/java/com/pipedream/api/resources/proxy/requests/{ProxyGetRequest.java => GetProxyRequest.java} (88%) rename src/main/java/com/pipedream/api/resources/proxy/requests/{ProxyPatchRequest.java => PatchProxyRequest.java} (92%) rename src/main/java/com/pipedream/api/resources/proxy/requests/{ProxyPostRequest.java => PostProxyRequest.java} (92%) rename src/main/java/com/pipedream/api/resources/proxy/requests/{ProxyPutRequest.java => PutProxyRequest.java} (92%) rename src/main/java/com/pipedream/api/resources/tokens/requests/{TokensValidateRequest.java => ValidateTokensRequest.java} (88%) create mode 100644 src/main/java/com/pipedream/api/resources/triggers/requests/ConfigurePropTriggersRequest.java rename src/main/java/com/pipedream/api/resources/triggers/requests/{TriggersListRequest.java => ListTriggersRequest.java} (92%) create mode 100644 src/main/java/com/pipedream/api/resources/triggers/requests/ReloadPropsTriggersRequest.java rename src/main/java/com/pipedream/api/resources/triggers/requests/{TriggersRetrieveRequest.java => RetrieveTriggersRequest.java} (83%) create mode 100644 src/main/java/com/pipedream/api/resources/users/requests/DeleteExternalUserUsersRequest.java delete mode 100644 src/test/java/com/pipedream/api/OauthTokensWireTest.java delete mode 100644 src/test/java/com/pipedream/api/TokensWireTest.java diff --git a/.fern/metadata.json b/.fern/metadata.json new file mode 100644 index 0000000..2d412e6 --- /dev/null +++ b/.fern/metadata.json @@ -0,0 +1,12 @@ +{ + "cliVersion": "1.0.4", + "generatorName": "fernapi/fern-java-sdk", + "generatorVersion": "3.15.1", + "generatorConfig": { + "publish-to": "central", + "client-class-name": "BaseClient", + "custom-dependencies": [ + "api org.apache.commons:commons-text:1.13.1" + ] + } +} \ No newline at end of file diff --git a/README.md b/README.md index 06d55b9..63e12c9 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,22 @@ The Pipedream Java library provides convenient access to the Pipedream APIs from Java. +## Table of Contents + +- [Installation](#installation) +- [Usage](#usage) +- [Environments](#environments) +- [Base Url](#base-url) +- [Exception Handling](#exception-handling) +- [Advanced](#advanced) + - [Custom Client](#custom-client) + - [Retries](#retries) + - [Timeouts](#timeouts) + - [Custom Headers](#custom-headers) + - [Access Raw Response Data](#access-raw-response-data) +- [Contributing](#contributing) +- [Reference](#reference) + ## Installation ### Gradle @@ -25,7 +41,7 @@ Add the dependency in your `pom.xml` file: com.pipedream pipedream - 1.1.0 + 1.1.1 ``` @@ -104,7 +120,7 @@ try{ ### Custom Client -This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one. +This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one. However, you can pass your own client like so: ```java @@ -123,7 +139,9 @@ BaseClient client = BaseClient The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured -retry limit (default: 2). +retry limit (default: 2). Before defaulting to exponential backoff, the SDK will first attempt to respect +the `Retry-After` header (as either in seconds or as an HTTP date), and then the `X-RateLimit-Reset` header +(as a Unix timestamp in epoch seconds); failing both of those, it will fall back to exponential backoff. A request is deemed retryable when any of the following HTTP status codes is returned: @@ -192,6 +210,19 @@ client.actions().run( ); ``` +### Access Raw Response Data + +The SDK provides access to raw response data, including headers, through the `withRawResponse()` method. +The `withRawResponse()` method returns a raw client that wraps all responses with `body()` and `headers()` methods. +(A normal client's `response` is identical to a raw client's `response.body()`.) + +```java +RunHttpResponse response = client.actions().withRawResponse().run(...); + +System.out.println(response.body()); +System.out.println(response.headers().get("X-My-Header")); +``` + ## Contributing While we value open-source contributions to this SDK, this library is generated programmatically. diff --git a/build.gradle b/build.gradle index 0db3646..8c962d4 100644 --- a/build.gradle +++ b/build.gradle @@ -14,15 +14,14 @@ repositories { } dependencies { - api 'com.squareup.okhttp3:okhttp:4.12.0' - api 'com.fasterxml.jackson.core:jackson-databind:2.17.2' - api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2' - api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2' + api 'com.squareup.okhttp3:okhttp:5.2.1' + api 'com.fasterxml.jackson.core:jackson-databind:2.18.2' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' api 'org.apache.commons:commons-text:1.13.1' - testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0' } @@ -49,7 +48,7 @@ java { group = 'com.pipedream' -version = '1.1.0' +version = '1.1.1' jar { dependsOn(":generatePomFileForMavenPublication") @@ -80,7 +79,7 @@ publishing { maven(MavenPublication) { groupId = 'com.pipedream' artifactId = 'pipedream' - version = '1.1.0' + version = '1.1.1' from components.java pom { name = 'pipedream' diff --git a/src/main/java/com/pipedream/api/core/BaseClientApiException.java b/src/main/java/com/pipedream/api/core/BaseClientApiException.java index a2680b0..f0e59f6 100644 --- a/src/main/java/com/pipedream/api/core/BaseClientApiException.java +++ b/src/main/java/com/pipedream/api/core/BaseClientApiException.java @@ -65,9 +65,9 @@ public Map> headers() { return this.headers; } - @java.lang.Override + @Override public String toString() { return "BaseClientApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " - + body + "}"; + + ObjectMappers.stringify(body) + "}"; } } diff --git a/src/main/java/com/pipedream/api/core/ClientOptions.java b/src/main/java/com/pipedream/api/core/ClientOptions.java index 8132d65..7c9c07c 100644 --- a/src/main/java/com/pipedream/api/core/ClientOptions.java +++ b/src/main/java/com/pipedream/api/core/ClientOptions.java @@ -21,6 +21,8 @@ public final class ClientOptions { private final int timeout; + private final int maxRetries; + private String projectId; private ClientOptions( @@ -29,21 +31,23 @@ private ClientOptions( Map> headerSuppliers, OkHttpClient httpClient, int timeout, + int maxRetries, String projectId) { this.environment = environment; this.headers = new HashMap<>(); this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.pipedream:pipedream/1.1.0"); + put("User-Agent", "com.pipedream:pipedream/1.1.1"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.1.0"); + put("X-Fern-SDK-Version", "1.1.1"); } }); this.headerSuppliers = headerSuppliers; this.httpClient = httpClient; this.timeout = timeout; + this.maxRetries = maxRetries; this.projectId = projectId; } @@ -86,6 +90,10 @@ public OkHttpClient httpClientWithTimeout(RequestOptions requestOptions) { .build(); } + public int maxRetries() { + return this.maxRetries; + } + public String projectId() { return this.projectId; } @@ -181,7 +189,13 @@ public ClientOptions build() { this.timeout = Optional.of(httpClient.callTimeoutMillis() / 1000); return new ClientOptions( - environment, headers, headerSuppliers, httpClient, this.timeout.get(), this.projectId); + environment, + headers, + headerSuppliers, + httpClient, + this.timeout.get(), + this.maxRetries, + this.projectId); } /** diff --git a/src/main/java/com/pipedream/api/core/NullableNonemptyFilter.java b/src/main/java/com/pipedream/api/core/NullableNonemptyFilter.java index afad6eb..c268e6e 100644 --- a/src/main/java/com/pipedream/api/core/NullableNonemptyFilter.java +++ b/src/main/java/com/pipedream/api/core/NullableNonemptyFilter.java @@ -14,6 +14,9 @@ public boolean equals(Object o) { } private boolean isOptionalEmpty(Object o) { - return o instanceof Optional && !((Optional) o).isPresent(); + if (o instanceof Optional) { + return !((Optional) o).isPresent(); + } + return false; } } diff --git a/src/main/java/com/pipedream/api/core/ObjectMappers.java b/src/main/java/com/pipedream/api/core/ObjectMappers.java index 6dd6c3c..aa3ba10 100644 --- a/src/main/java/com/pipedream/api/core/ObjectMappers.java +++ b/src/main/java/com/pipedream/api/core/ObjectMappers.java @@ -4,6 +4,7 @@ package com.pipedream.api.core; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; @@ -33,4 +34,12 @@ public static String stringify(Object o) { return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); } } + + public static Object parseErrorBody(String responseBodyString) { + try { + return JSON_MAPPER.readValue(responseBodyString, Object.class); + } catch (JsonProcessingException ignored) { + return responseBodyString; + } + } } diff --git a/src/main/java/com/pipedream/api/core/RetryInterceptor.java b/src/main/java/com/pipedream/api/core/RetryInterceptor.java index 66b6be4..da07beb 100644 --- a/src/main/java/com/pipedream/api/core/RetryInterceptor.java +++ b/src/main/java/com/pipedream/api/core/RetryInterceptor.java @@ -5,6 +5,9 @@ import java.io.IOException; import java.time.Duration; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.Optional; import java.util.Random; import okhttp3.Interceptor; @@ -12,7 +15,10 @@ public class RetryInterceptor implements Interceptor { - private static final Duration ONE_SECOND = Duration.ofSeconds(1); + private static final Duration INITIAL_RETRY_DELAY = Duration.ofMillis(1000); + private static final Duration MAX_RETRY_DELAY = Duration.ofMillis(60000); + private static final double JITTER_FACTOR = 0.2; + private final ExponentialBackoff backoff; private final Random random = new Random(); @@ -32,7 +38,7 @@ public Response intercept(Chain chain) throws IOException { } private Response retryChain(Response response, Chain chain) throws IOException { - Optional nextBackoff = this.backoff.nextBackoff(); + Optional nextBackoff = this.backoff.nextBackoff(response); while (nextBackoff.isPresent()) { try { Thread.sleep(nextBackoff.get().toMillis()); @@ -42,7 +48,7 @@ private Response retryChain(Response response, Chain chain) throws IOException { response.close(); response = chain.proceed(chain.request()); if (shouldRetry(response.code())) { - nextBackoff = this.backoff.nextBackoff(); + nextBackoff = this.backoff.nextBackoff(response); } else { return response; } @@ -51,6 +57,102 @@ private Response retryChain(Response response, Chain chain) throws IOException { return response; } + /** + * Calculates the retry delay from response headers, with fallback to exponential backoff. + * Priority: Retry-After > X-RateLimit-Reset > Exponential Backoff + */ + private Duration getRetryDelayFromHeaders(Response response, int retryAttempt) { + // Check for Retry-After header first (RFC 7231), with no jitter + String retryAfter = response.header("Retry-After"); + if (retryAfter != null) { + // Parse as number of seconds... + Optional secondsDelay = tryParseLong(retryAfter) + .map(seconds -> seconds * 1000) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(Duration::ofMillis); + if (secondsDelay.isPresent()) { + return secondsDelay.get(); + } + + // ...or as an HTTP date; both are valid + Optional dateDelay = tryParseHttpDate(retryAfter) + .map(resetTime -> resetTime.toInstant().toEpochMilli() - System.currentTimeMillis()) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(Duration::ofMillis); + if (dateDelay.isPresent()) { + return dateDelay.get(); + } + } + + // Then check for industry-standard X-RateLimit-Reset header, with positive jitter + String rateLimitReset = response.header("X-RateLimit-Reset"); + if (rateLimitReset != null) { + // Assume Unix timestamp in epoch seconds + Optional rateLimitDelay = tryParseLong(rateLimitReset) + .map(resetTimeSeconds -> (resetTimeSeconds * 1000) - System.currentTimeMillis()) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(this::addPositiveJitter) + .map(Duration::ofMillis); + if (rateLimitDelay.isPresent()) { + return rateLimitDelay.get(); + } + } + + // Fall back to exponential backoff, with symmetric jitter + long baseDelay = INITIAL_RETRY_DELAY.toMillis() * (1L << retryAttempt); // 2^retryAttempt + long cappedDelay = Math.min(baseDelay, MAX_RETRY_DELAY.toMillis()); + return Duration.ofMillis(addSymmetricJitter(cappedDelay)); + } + + /** + * Attempts to parse a string as a long, returning empty Optional on failure. + */ + private Optional tryParseLong(String value) { + if (value == null) { + return Optional.empty(); + } + try { + return Optional.of(Long.parseLong(value)); + } catch (NumberFormatException e) { + return Optional.empty(); + } + } + + /** + * Attempts to parse a string as an HTTP date (RFC 1123), returning empty Optional on failure. + */ + private Optional tryParseHttpDate(String value) { + if (value == null) { + return Optional.empty(); + } + try { + return Optional.of(ZonedDateTime.parse(value, DateTimeFormatter.RFC_1123_DATE_TIME)); + } catch (DateTimeParseException e) { + return Optional.empty(); + } + } + + /** + * Adds positive jitter (100-120% of original value) to prevent thundering herd. + * Used for X-RateLimit-Reset header delays. + */ + private long addPositiveJitter(long delayMs) { + double jitterMultiplier = 1.0 + (random.nextDouble() * JITTER_FACTOR); + return (long) (delayMs * jitterMultiplier); + } + + /** + * Adds symmetric jitter (90-110% of original value) to prevent thundering herd. + * Used for exponential backoff delays. + */ + private long addSymmetricJitter(long delayMs) { + double jitterMultiplier = 1.0 + ((random.nextDouble() - 0.5) * JITTER_FACTOR); + return (long) (delayMs * jitterMultiplier); + } + private static boolean shouldRetry(int statusCode) { return statusCode == 408 || statusCode == 429 || statusCode >= 500; } @@ -65,14 +167,14 @@ private final class ExponentialBackoff { this.maxNumRetries = maxNumRetries; } - public Optional nextBackoff() { - retryNumber += 1; - if (retryNumber > maxNumRetries) { + public Optional nextBackoff(Response response) { + if (retryNumber >= maxNumRetries) { return Optional.empty(); } - int upperBound = (int) Math.pow(2, retryNumber); - return Optional.of(ONE_SECOND.multipliedBy(random.nextInt(upperBound))); + Duration delay = getRetryDelayFromHeaders(response, retryNumber); + retryNumber += 1; + return Optional.of(delay); } } } diff --git a/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java index 328225d..12cecc4 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/AccountsClient.java @@ -6,9 +6,11 @@ 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.resources.accounts.requests.DeleteAccountsRequest; +import com.pipedream.api.resources.accounts.requests.DeleteByAppAccountsRequest; +import com.pipedream.api.resources.accounts.requests.ListAccountsRequest; +import com.pipedream.api.resources.accounts.requests.RetrieveAccountsRequest; import com.pipedream.api.types.Account; public class AccountsClient { @@ -38,14 +40,14 @@ public SyncPagingIterable list() { /** * Retrieve all connected accounts for the project with optional filtering */ - public SyncPagingIterable list(AccountsListRequest request) { + public SyncPagingIterable list(ListAccountsRequest request) { return this.rawClient.list(request).body(); } /** * Retrieve all connected accounts for the project with optional filtering */ - public SyncPagingIterable list(AccountsListRequest request, RequestOptions requestOptions) { + public SyncPagingIterable list(ListAccountsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } @@ -73,14 +75,14 @@ public Account retrieve(String accountId) { /** * Get the details for a specific connected account */ - public Account retrieve(String accountId, AccountsRetrieveRequest request) { + public Account retrieve(String accountId, RetrieveAccountsRequest request) { return this.rawClient.retrieve(accountId, request).body(); } /** * Get the details for a specific connected account */ - public Account retrieve(String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { + public Account retrieve(String accountId, RetrieveAccountsRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(accountId, request, requestOptions).body(); } @@ -94,8 +96,15 @@ public void delete(String accountId) { /** * Remove a connected account and its associated credentials */ - public void delete(String accountId, RequestOptions requestOptions) { - this.rawClient.delete(accountId, requestOptions).body(); + public void delete(String accountId, DeleteAccountsRequest request) { + this.rawClient.delete(accountId, request).body(); + } + + /** + * Remove a connected account and its associated credentials + */ + public void delete(String accountId, DeleteAccountsRequest request, RequestOptions requestOptions) { + this.rawClient.delete(accountId, request, requestOptions).body(); } /** @@ -108,7 +117,14 @@ public void deleteByApp(String appId) { /** * Remove all connected accounts for a specific app */ - public void deleteByApp(String appId, RequestOptions requestOptions) { - this.rawClient.deleteByApp(appId, requestOptions).body(); + public void deleteByApp(String appId, DeleteByAppAccountsRequest request) { + this.rawClient.deleteByApp(appId, request).body(); + } + + /** + * Remove all connected accounts for a specific app + */ + public void deleteByApp(String appId, DeleteByAppAccountsRequest request, RequestOptions requestOptions) { + this.rawClient.deleteByApp(appId, request, requestOptions).body(); } } diff --git a/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java index da3e9be..24e3574 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/AsyncAccountsClient.java @@ -6,9 +6,11 @@ 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.resources.accounts.requests.DeleteAccountsRequest; +import com.pipedream.api.resources.accounts.requests.DeleteByAppAccountsRequest; +import com.pipedream.api.resources.accounts.requests.ListAccountsRequest; +import com.pipedream.api.resources.accounts.requests.RetrieveAccountsRequest; import com.pipedream.api.types.Account; import java.util.concurrent.CompletableFuture; @@ -39,7 +41,7 @@ public CompletableFuture> list() { /** * Retrieve all connected accounts for the project with optional filtering */ - public CompletableFuture> list(AccountsListRequest request) { + public CompletableFuture> list(ListAccountsRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } @@ -47,7 +49,7 @@ public CompletableFuture> list(AccountsListRequest r * Retrieve all connected accounts for the project with optional filtering */ public CompletableFuture> list( - AccountsListRequest request, RequestOptions requestOptions) { + ListAccountsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } @@ -75,7 +77,7 @@ public CompletableFuture retrieve(String accountId) { /** * Get the details for a specific connected account */ - public CompletableFuture retrieve(String accountId, AccountsRetrieveRequest request) { + public CompletableFuture retrieve(String accountId, RetrieveAccountsRequest request) { return this.rawClient.retrieve(accountId, request).thenApply(response -> response.body()); } @@ -83,7 +85,7 @@ public CompletableFuture retrieve(String accountId, AccountsRetrieveReq * Get the details for a specific connected account */ public CompletableFuture retrieve( - String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { + String accountId, RetrieveAccountsRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(accountId, request, requestOptions).thenApply(response -> response.body()); } @@ -97,8 +99,16 @@ public CompletableFuture delete(String accountId) { /** * Remove a connected account and its associated credentials */ - public CompletableFuture delete(String accountId, RequestOptions requestOptions) { - return this.rawClient.delete(accountId, requestOptions).thenApply(response -> response.body()); + public CompletableFuture delete(String accountId, DeleteAccountsRequest request) { + return this.rawClient.delete(accountId, request).thenApply(response -> response.body()); + } + + /** + * Remove a connected account and its associated credentials + */ + public CompletableFuture delete( + String accountId, DeleteAccountsRequest request, RequestOptions requestOptions) { + return this.rawClient.delete(accountId, request, requestOptions).thenApply(response -> response.body()); } /** @@ -111,7 +121,15 @@ public CompletableFuture deleteByApp(String appId) { /** * Remove all connected accounts for a specific app */ - public CompletableFuture deleteByApp(String appId, RequestOptions requestOptions) { - return this.rawClient.deleteByApp(appId, requestOptions).thenApply(response -> response.body()); + public CompletableFuture deleteByApp(String appId, DeleteByAppAccountsRequest request) { + return this.rawClient.deleteByApp(appId, request).thenApply(response -> response.body()); + } + + /** + * Remove all connected accounts for a specific app + */ + public CompletableFuture deleteByApp( + String appId, DeleteByAppAccountsRequest request, RequestOptions requestOptions) { + return this.rawClient.deleteByApp(appId, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java index dd95b5f..0646c18 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java @@ -14,9 +14,11 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; -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.resources.accounts.requests.DeleteAccountsRequest; +import com.pipedream.api.resources.accounts.requests.DeleteByAppAccountsRequest; +import com.pipedream.api.resources.accounts.requests.ListAccountsRequest; +import com.pipedream.api.resources.accounts.requests.RetrieveAccountsRequest; import com.pipedream.api.types.Account; import com.pipedream.api.types.ListAccountsResponse; import java.io.IOException; @@ -46,13 +48,13 @@ public AsyncRawAccountsClient(ClientOptions clientOptions) { * Retrieve all connected accounts for the project with optional filtering */ public CompletableFuture>> list() { - return list(AccountsListRequest.builder().build()); + return list(ListAccountsRequest.builder().build()); } /** * Retrieve all connected accounts for the project with optional filtering */ - public CompletableFuture>> list(AccountsListRequest request) { + public CompletableFuture>> list(ListAccountsRequest request) { return list(request, null); } @@ -60,7 +62,7 @@ public CompletableFuture>> li * Retrieve all connected accounts for the project with optional filtering */ public CompletableFuture>> list( - AccountsListRequest request, RequestOptions requestOptions) { + ListAccountsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -111,12 +113,13 @@ public CompletableFuture>> li @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { ListAccountsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListAccountsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListAccountsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - AccountsListRequest nextRequest = AccountsListRequest.builder() + ListAccountsRequest nextRequest = ListAccountsRequest.builder() .from(request) .after(startingAfter) .build(); @@ -135,7 +138,6 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -145,11 +147,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -212,12 +212,12 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -227,11 +227,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -250,14 +248,14 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get the details for a specific connected account */ public CompletableFuture> retrieve(String accountId) { - return retrieve(accountId, AccountsRetrieveRequest.builder().build()); + return retrieve(accountId, RetrieveAccountsRequest.builder().build()); } /** * Get the details for a specific connected account */ public CompletableFuture> retrieve( - String accountId, AccountsRetrieveRequest request) { + String accountId, RetrieveAccountsRequest request) { return retrieve(accountId, request, null); } @@ -265,7 +263,7 @@ public CompletableFuture> retrieve( * Get the details for a specific connected account */ public CompletableFuture> retrieve( - String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { + String accountId, RetrieveAccountsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -294,12 +292,12 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -309,11 +307,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -332,13 +328,21 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Remove a connected account and its associated credentials */ public CompletableFuture> delete(String accountId) { - return delete(accountId, null); + return delete(accountId, DeleteAccountsRequest.builder().build()); } /** * Remove a connected account and its associated credentials */ - public CompletableFuture> delete(String accountId, RequestOptions requestOptions) { + public CompletableFuture> delete(String accountId, DeleteAccountsRequest request) { + return delete(accountId, request, null); + } + + /** + * Remove a connected account and its associated credentials + */ + public CompletableFuture> delete( + String accountId, DeleteAccountsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -346,12 +350,12 @@ public CompletableFuture> delete(String accountId, .addPathSegments("accounts") .addPathSegment(accountId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -375,11 +379,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -398,13 +400,22 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Remove all connected accounts for a specific app */ public CompletableFuture> deleteByApp(String appId) { - return deleteByApp(appId, null); + return deleteByApp(appId, DeleteByAppAccountsRequest.builder().build()); + } + + /** + * Remove all connected accounts for a specific app + */ + public CompletableFuture> deleteByApp( + String appId, DeleteByAppAccountsRequest request) { + return deleteByApp(appId, request, null); } /** * Remove all connected accounts for a specific app */ - public CompletableFuture> deleteByApp(String appId, RequestOptions requestOptions) { + public CompletableFuture> deleteByApp( + String appId, DeleteByAppAccountsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -413,12 +424,12 @@ public CompletableFuture> deleteByApp(String appId, .addPathSegment(appId) .addPathSegments("accounts") .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -442,11 +453,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java index 777be36..c6aa61d 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java @@ -14,9 +14,11 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; -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.resources.accounts.requests.DeleteAccountsRequest; +import com.pipedream.api.resources.accounts.requests.DeleteByAppAccountsRequest; +import com.pipedream.api.resources.accounts.requests.ListAccountsRequest; +import com.pipedream.api.resources.accounts.requests.RetrieveAccountsRequest; import com.pipedream.api.types.Account; import com.pipedream.api.types.ListAccountsResponse; import java.io.IOException; @@ -41,13 +43,13 @@ public RawAccountsClient(ClientOptions clientOptions) { * Retrieve all connected accounts for the project with optional filtering */ public BaseClientHttpResponse> list() { - return list(AccountsListRequest.builder().build()); + return list(ListAccountsRequest.builder().build()); } /** * Retrieve all connected accounts for the project with optional filtering */ - public BaseClientHttpResponse> list(AccountsListRequest request) { + public BaseClientHttpResponse> list(ListAccountsRequest request) { return list(request, null); } @@ -55,7 +57,7 @@ public BaseClientHttpResponse> list(AccountsListRequ * Retrieve all connected accounts for the project with optional filtering */ public BaseClientHttpResponse> list( - AccountsListRequest request, RequestOptions requestOptions) { + ListAccountsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -103,11 +105,12 @@ public BaseClientHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { ListAccountsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListAccountsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListAccountsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - AccountsListRequest nextRequest = AccountsListRequest.builder() + ListAccountsRequest nextRequest = ListAccountsRequest.builder() .from(request) .after(startingAfter) .build(); @@ -118,7 +121,6 @@ public BaseClientHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -127,11 +129,9 @@ public BaseClientHttpResponse> list( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -181,11 +181,11 @@ public BaseClientHttpResponse create(CreateAccountOpts request, Request } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -194,11 +194,9 @@ public BaseClientHttpResponse create(CreateAccountOpts request, Request } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -208,13 +206,13 @@ public BaseClientHttpResponse create(CreateAccountOpts request, Request * Get the details for a specific connected account */ public BaseClientHttpResponse retrieve(String accountId) { - return retrieve(accountId, AccountsRetrieveRequest.builder().build()); + return retrieve(accountId, RetrieveAccountsRequest.builder().build()); } /** * Get the details for a specific connected account */ - public BaseClientHttpResponse retrieve(String accountId, AccountsRetrieveRequest request) { + public BaseClientHttpResponse retrieve(String accountId, RetrieveAccountsRequest request) { return retrieve(accountId, request, null); } @@ -222,7 +220,7 @@ public BaseClientHttpResponse retrieve(String accountId, AccountsRetrie * Get the details for a specific connected account */ public BaseClientHttpResponse retrieve( - String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { + String accountId, RetrieveAccountsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -248,11 +246,11 @@ public BaseClientHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -261,11 +259,9 @@ public BaseClientHttpResponse retrieve( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -275,13 +271,21 @@ public BaseClientHttpResponse retrieve( * Remove a connected account and its associated credentials */ public BaseClientHttpResponse delete(String accountId) { - return delete(accountId, null); + return delete(accountId, DeleteAccountsRequest.builder().build()); } /** * Remove a connected account and its associated credentials */ - public BaseClientHttpResponse delete(String accountId, RequestOptions requestOptions) { + public BaseClientHttpResponse delete(String accountId, DeleteAccountsRequest request) { + return delete(accountId, request, null); + } + + /** + * Remove a connected account and its associated credentials + */ + public BaseClientHttpResponse delete( + String accountId, DeleteAccountsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -289,12 +293,12 @@ public BaseClientHttpResponse delete(String accountId, RequestOptions requ .addPathSegments("accounts") .addPathSegment(accountId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -313,11 +317,9 @@ public BaseClientHttpResponse delete(String accountId, RequestOptions requ } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -327,13 +329,21 @@ public BaseClientHttpResponse delete(String accountId, RequestOptions requ * Remove all connected accounts for a specific app */ public BaseClientHttpResponse deleteByApp(String appId) { - return deleteByApp(appId, null); + return deleteByApp(appId, DeleteByAppAccountsRequest.builder().build()); + } + + /** + * Remove all connected accounts for a specific app + */ + public BaseClientHttpResponse deleteByApp(String appId, DeleteByAppAccountsRequest request) { + return deleteByApp(appId, request, null); } /** * Remove all connected accounts for a specific app */ - public BaseClientHttpResponse deleteByApp(String appId, RequestOptions requestOptions) { + public BaseClientHttpResponse deleteByApp( + String appId, DeleteByAppAccountsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -342,12 +352,12 @@ public BaseClientHttpResponse deleteByApp(String appId, RequestOptions req .addPathSegment(appId) .addPathSegments("accounts") .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -366,11 +376,9 @@ public BaseClientHttpResponse deleteByApp(String appId, RequestOptions req } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/accounts/requests/DeleteAccountsRequest.java b/src/main/java/com/pipedream/api/resources/accounts/requests/DeleteAccountsRequest.java new file mode 100644 index 0000000..bac3f70 --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/accounts/requests/DeleteAccountsRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteAccountsRequest.Builder.class) +public final class DeleteAccountsRequest { + private final Map additionalProperties; + + private DeleteAccountsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteAccountsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteAccountsRequest other) { + return this; + } + + public DeleteAccountsRequest build() { + return new DeleteAccountsRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/accounts/requests/DeleteByAppAccountsRequest.java b/src/main/java/com/pipedream/api/resources/accounts/requests/DeleteByAppAccountsRequest.java new file mode 100644 index 0000000..f5d326e --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/accounts/requests/DeleteByAppAccountsRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteByAppAccountsRequest.Builder.class) +public final class DeleteByAppAccountsRequest { + private final Map additionalProperties; + + private DeleteByAppAccountsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteByAppAccountsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteByAppAccountsRequest other) { + return this; + } + + public DeleteByAppAccountsRequest build() { + return new DeleteByAppAccountsRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsListRequest.java b/src/main/java/com/pipedream/api/resources/accounts/requests/ListAccountsRequest.java similarity index 95% rename from src/main/java/com/pipedream/api/resources/accounts/requests/AccountsListRequest.java rename to src/main/java/com/pipedream/api/resources/accounts/requests/ListAccountsRequest.java index bfba211..6d5412e 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsListRequest.java +++ b/src/main/java/com/pipedream/api/resources/accounts/requests/ListAccountsRequest.java @@ -18,8 +18,8 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountsListRequest.Builder.class) -public final class AccountsListRequest { +@JsonDeserialize(builder = ListAccountsRequest.Builder.class) +public final class ListAccountsRequest { private final Optional externalUserId; private final Optional oauthAppId; @@ -36,7 +36,7 @@ public final class AccountsListRequest { private final Map additionalProperties; - private AccountsListRequest( + private ListAccountsRequest( Optional externalUserId, Optional oauthAppId, Optional after, @@ -111,7 +111,7 @@ public Optional getIncludeCredentials() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof AccountsListRequest && equalTo((AccountsListRequest) other); + return other instanceof ListAccountsRequest && equalTo((ListAccountsRequest) other); } @JsonAnyGetter @@ -119,7 +119,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(AccountsListRequest other) { + private boolean equalTo(ListAccountsRequest other) { return externalUserId.equals(other.externalUserId) && oauthAppId.equals(other.oauthAppId) && after.equals(other.after) @@ -171,7 +171,7 @@ public static final class Builder { private Builder() {} - public Builder from(AccountsListRequest other) { + public Builder from(ListAccountsRequest other) { externalUserId(other.getExternalUserId()); oauthAppId(other.getOauthAppId()); after(other.getAfter()); @@ -277,8 +277,8 @@ public Builder includeCredentials(Boolean includeCredentials) { return this; } - public AccountsListRequest build() { - return new AccountsListRequest( + public ListAccountsRequest build() { + return new ListAccountsRequest( externalUserId, oauthAppId, after, before, limit, app, includeCredentials, additionalProperties); } } diff --git a/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsRetrieveRequest.java b/src/main/java/com/pipedream/api/resources/accounts/requests/RetrieveAccountsRequest.java similarity index 84% rename from src/main/java/com/pipedream/api/resources/accounts/requests/AccountsRetrieveRequest.java rename to src/main/java/com/pipedream/api/resources/accounts/requests/RetrieveAccountsRequest.java index 3844f9d..0f603bc 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/requests/AccountsRetrieveRequest.java +++ b/src/main/java/com/pipedream/api/resources/accounts/requests/RetrieveAccountsRequest.java @@ -18,13 +18,13 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) -public final class AccountsRetrieveRequest { +@JsonDeserialize(builder = RetrieveAccountsRequest.Builder.class) +public final class RetrieveAccountsRequest { private final Optional includeCredentials; private final Map additionalProperties; - private AccountsRetrieveRequest(Optional includeCredentials, Map additionalProperties) { + private RetrieveAccountsRequest(Optional includeCredentials, Map additionalProperties) { this.includeCredentials = includeCredentials; this.additionalProperties = additionalProperties; } @@ -40,7 +40,7 @@ public Optional getIncludeCredentials() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof AccountsRetrieveRequest && equalTo((AccountsRetrieveRequest) other); + return other instanceof RetrieveAccountsRequest && equalTo((RetrieveAccountsRequest) other); } @JsonAnyGetter @@ -48,7 +48,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(AccountsRetrieveRequest other) { + private boolean equalTo(RetrieveAccountsRequest other) { return includeCredentials.equals(other.includeCredentials); } @@ -75,7 +75,7 @@ public static final class Builder { private Builder() {} - public Builder from(AccountsRetrieveRequest other) { + public Builder from(RetrieveAccountsRequest other) { includeCredentials(other.getIncludeCredentials()); return this; } @@ -94,8 +94,8 @@ public Builder includeCredentials(Boolean includeCredentials) { return this; } - public AccountsRetrieveRequest build() { - return new AccountsRetrieveRequest(includeCredentials, additionalProperties); + public RetrieveAccountsRequest build() { + return new RetrieveAccountsRequest(includeCredentials, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/actions/ActionsClient.java b/src/main/java/com/pipedream/api/resources/actions/ActionsClient.java index 18b750a..7839cc6 100644 --- a/src/main/java/com/pipedream/api/resources/actions/ActionsClient.java +++ b/src/main/java/com/pipedream/api/resources/actions/ActionsClient.java @@ -6,13 +6,13 @@ 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.ActionsListRequest; -import com.pipedream.api.resources.actions.requests.ActionsRetrieveRequest; +import com.pipedream.api.resources.actions.requests.ConfigurePropActionsRequest; +import com.pipedream.api.resources.actions.requests.ListActionsRequest; +import com.pipedream.api.resources.actions.requests.ReloadPropsActionsRequest; +import com.pipedream.api.resources.actions.requests.RetrieveActionsRequest; import com.pipedream.api.resources.actions.requests.RunActionOpts; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import com.pipedream.api.types.RunActionResponse; @@ -43,14 +43,14 @@ public SyncPagingIterable list() { /** * Retrieve available actions with optional search and app filtering */ - public SyncPagingIterable list(ActionsListRequest request) { + public SyncPagingIterable list(ListActionsRequest request) { return this.rawClient.list(request).body(); } /** * Retrieve available actions with optional search and app filtering */ - public SyncPagingIterable list(ActionsListRequest request, RequestOptions requestOptions) { + public SyncPagingIterable list(ListActionsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } @@ -64,42 +64,42 @@ public Component retrieve(String componentId) { /** * Get detailed configuration for a specific action by its key */ - public Component retrieve(String componentId, ActionsRetrieveRequest request) { + public Component retrieve(String componentId, RetrieveActionsRequest request) { return this.rawClient.retrieve(componentId, request).body(); } /** * Get detailed configuration for a specific action by its key */ - public Component retrieve(String componentId, ActionsRetrieveRequest request, RequestOptions requestOptions) { + public Component retrieve(String componentId, RetrieveActionsRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(componentId, request, requestOptions).body(); } /** * Retrieve remote options for a given prop for a action */ - public ConfigurePropResponse configureProp(ConfigurePropOpts request) { + public ConfigurePropResponse configureProp(ConfigurePropActionsRequest request) { return this.rawClient.configureProp(request).body(); } /** * Retrieve remote options for a given prop for a action */ - public ConfigurePropResponse configureProp(ConfigurePropOpts request, RequestOptions requestOptions) { + public ConfigurePropResponse configureProp(ConfigurePropActionsRequest request, RequestOptions requestOptions) { return this.rawClient.configureProp(request, requestOptions).body(); } /** * Reload the prop definition based on the currently configured props */ - public ReloadPropsResponse reloadProps(ReloadPropsOpts request) { + public ReloadPropsResponse reloadProps(ReloadPropsActionsRequest request) { return this.rawClient.reloadProps(request).body(); } /** * Reload the prop definition based on the currently configured props */ - public ReloadPropsResponse reloadProps(ReloadPropsOpts request, RequestOptions requestOptions) { + public ReloadPropsResponse reloadProps(ReloadPropsActionsRequest request, RequestOptions requestOptions) { return this.rawClient.reloadProps(request, requestOptions).body(); } diff --git a/src/main/java/com/pipedream/api/resources/actions/AsyncActionsClient.java b/src/main/java/com/pipedream/api/resources/actions/AsyncActionsClient.java index 442f0b5..db89ee5 100644 --- a/src/main/java/com/pipedream/api/resources/actions/AsyncActionsClient.java +++ b/src/main/java/com/pipedream/api/resources/actions/AsyncActionsClient.java @@ -6,13 +6,13 @@ 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.ActionsListRequest; -import com.pipedream.api.resources.actions.requests.ActionsRetrieveRequest; +import com.pipedream.api.resources.actions.requests.ConfigurePropActionsRequest; +import com.pipedream.api.resources.actions.requests.ListActionsRequest; +import com.pipedream.api.resources.actions.requests.ReloadPropsActionsRequest; +import com.pipedream.api.resources.actions.requests.RetrieveActionsRequest; import com.pipedream.api.resources.actions.requests.RunActionOpts; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import com.pipedream.api.types.RunActionResponse; import java.util.concurrent.CompletableFuture; @@ -44,7 +44,7 @@ public CompletableFuture> list() { /** * Retrieve available actions with optional search and app filtering */ - public CompletableFuture> list(ActionsListRequest request) { + public CompletableFuture> list(ListActionsRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } @@ -52,7 +52,7 @@ public CompletableFuture> list(ActionsListRequest * Retrieve available actions with optional search and app filtering */ public CompletableFuture> list( - ActionsListRequest request, RequestOptions requestOptions) { + ListActionsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } @@ -66,7 +66,7 @@ public CompletableFuture retrieve(String componentId) { /** * Get detailed configuration for a specific action by its key */ - public CompletableFuture retrieve(String componentId, ActionsRetrieveRequest request) { + public CompletableFuture retrieve(String componentId, RetrieveActionsRequest request) { return this.rawClient.retrieve(componentId, request).thenApply(response -> response.body()); } @@ -74,14 +74,14 @@ public CompletableFuture retrieve(String componentId, ActionsRetrieve * Get detailed configuration for a specific action by its key */ public CompletableFuture retrieve( - String componentId, ActionsRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveActionsRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(componentId, request, requestOptions).thenApply(response -> response.body()); } /** * Retrieve remote options for a given prop for a action */ - public CompletableFuture configureProp(ConfigurePropOpts request) { + public CompletableFuture configureProp(ConfigurePropActionsRequest request) { return this.rawClient.configureProp(request).thenApply(response -> response.body()); } @@ -89,21 +89,22 @@ public CompletableFuture configureProp(ConfigurePropOpts * Retrieve remote options for a given prop for a action */ public CompletableFuture configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropActionsRequest request, RequestOptions requestOptions) { return this.rawClient.configureProp(request, requestOptions).thenApply(response -> response.body()); } /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture reloadProps(ReloadPropsOpts request) { + public CompletableFuture reloadProps(ReloadPropsActionsRequest request) { return this.rawClient.reloadProps(request).thenApply(response -> response.body()); } /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture reloadProps(ReloadPropsOpts request, RequestOptions requestOptions) { + public CompletableFuture reloadProps( + ReloadPropsActionsRequest request, RequestOptions requestOptions) { return this.rawClient.reloadProps(request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java b/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java index 72dfcab..dd075fa 100644 --- a/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java +++ b/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java @@ -14,15 +14,15 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; -import com.pipedream.api.resources.actions.requests.ActionsListRequest; -import com.pipedream.api.resources.actions.requests.ActionsRetrieveRequest; +import com.pipedream.api.resources.actions.requests.ConfigurePropActionsRequest; +import com.pipedream.api.resources.actions.requests.ListActionsRequest; +import com.pipedream.api.resources.actions.requests.ReloadPropsActionsRequest; +import com.pipedream.api.resources.actions.requests.RetrieveActionsRequest; import com.pipedream.api.resources.actions.requests.RunActionOpts; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; import com.pipedream.api.types.GetComponentResponse; import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import com.pipedream.api.types.RunActionResponse; import java.io.IOException; @@ -52,13 +52,13 @@ public AsyncRawActionsClient(ClientOptions clientOptions) { * Retrieve available actions with optional search and app filtering */ public CompletableFuture>> list() { - return list(ActionsListRequest.builder().build()); + return list(ListActionsRequest.builder().build()); } /** * Retrieve available actions with optional search and app filtering */ - public CompletableFuture>> list(ActionsListRequest request) { + public CompletableFuture>> list(ListActionsRequest request) { return list(request, null); } @@ -66,7 +66,7 @@ public CompletableFuture>> * Retrieve available actions with optional search and app filtering */ public CompletableFuture>> list( - ActionsListRequest request, RequestOptions requestOptions) { + ListActionsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -105,12 +105,13 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - ActionsListRequest nextRequest = ActionsListRequest.builder() + ListActionsRequest nextRequest = ListActionsRequest.builder() .from(request) .after(startingAfter) .build(); @@ -129,7 +130,6 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -139,11 +139,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -162,14 +160,14 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get detailed configuration for a specific action by its key */ public CompletableFuture> retrieve(String componentId) { - return retrieve(componentId, ActionsRetrieveRequest.builder().build()); + return retrieve(componentId, RetrieveActionsRequest.builder().build()); } /** * Get detailed configuration for a specific action by its key */ public CompletableFuture> retrieve( - String componentId, ActionsRetrieveRequest request) { + String componentId, RetrieveActionsRequest request) { return retrieve(componentId, request, null); } @@ -177,7 +175,7 @@ public CompletableFuture> retrieve( * Get detailed configuration for a specific action by its key */ public CompletableFuture> retrieve( - String componentId, ActionsRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveActionsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -203,13 +201,13 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentResponse.class); future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -219,11 +217,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -241,7 +237,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Retrieve remote options for a given prop for a action */ - public CompletableFuture> configureProp(ConfigurePropOpts request) { + public CompletableFuture> configureProp( + ConfigurePropActionsRequest request) { return configureProp(request, null); } @@ -249,17 +246,18 @@ public CompletableFuture> configur * Retrieve remote options for a given prop for a action */ public CompletableFuture> configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropActionsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/configure") + .addPathSegments("actions") + .addPathSegments("configure") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -279,13 +277,13 @@ public CompletableFuture> configur @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ConfigurePropResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -295,11 +293,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -317,7 +313,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture> reloadProps(ReloadPropsOpts request) { + public CompletableFuture> reloadProps( + ReloadPropsActionsRequest request) { return reloadProps(request, null); } @@ -325,17 +322,18 @@ public CompletableFuture> reloadProp * Reload the prop definition based on the currently configured props */ public CompletableFuture> reloadProps( - ReloadPropsOpts request, RequestOptions requestOptions) { + ReloadPropsActionsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/props") + .addPathSegments("actions") + .addPathSegments("props") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -355,13 +353,13 @@ public CompletableFuture> reloadProp @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ReloadPropsResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -371,11 +369,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -406,7 +402,8 @@ public CompletableFuture> run( .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/run") + .addPathSegments("actions") + .addPathSegments("run") .build(); RequestBody body; try { @@ -431,13 +428,13 @@ public CompletableFuture> run( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RunActionResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RunActionResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -447,11 +444,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java b/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java index 249368b..821b8cf 100644 --- a/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java +++ b/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java @@ -14,15 +14,15 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; -import com.pipedream.api.resources.actions.requests.ActionsListRequest; -import com.pipedream.api.resources.actions.requests.ActionsRetrieveRequest; +import com.pipedream.api.resources.actions.requests.ConfigurePropActionsRequest; +import com.pipedream.api.resources.actions.requests.ListActionsRequest; +import com.pipedream.api.resources.actions.requests.ReloadPropsActionsRequest; +import com.pipedream.api.resources.actions.requests.RetrieveActionsRequest; import com.pipedream.api.resources.actions.requests.RunActionOpts; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; import com.pipedream.api.types.GetComponentResponse; import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import com.pipedream.api.types.RunActionResponse; import java.io.IOException; @@ -47,13 +47,13 @@ public RawActionsClient(ClientOptions clientOptions) { * Retrieve available actions with optional search and app filtering */ public BaseClientHttpResponse> list() { - return list(ActionsListRequest.builder().build()); + return list(ListActionsRequest.builder().build()); } /** * Retrieve available actions with optional search and app filtering */ - public BaseClientHttpResponse> list(ActionsListRequest request) { + public BaseClientHttpResponse> list(ListActionsRequest request) { return list(request, null); } @@ -61,7 +61,7 @@ public BaseClientHttpResponse> list(ActionsListReq * Retrieve available actions with optional search and app filtering */ public BaseClientHttpResponse> list( - ActionsListRequest request, RequestOptions requestOptions) { + ListActionsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -97,11 +97,12 @@ public BaseClientHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - ActionsListRequest nextRequest = ActionsListRequest.builder() + ListActionsRequest nextRequest = ListActionsRequest.builder() .from(request) .after(startingAfter) .build(); @@ -112,7 +113,6 @@ public BaseClientHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -121,11 +121,9 @@ public BaseClientHttpResponse> list( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -135,13 +133,13 @@ public BaseClientHttpResponse> list( * Get detailed configuration for a specific action by its key */ public BaseClientHttpResponse retrieve(String componentId) { - return retrieve(componentId, ActionsRetrieveRequest.builder().build()); + return retrieve(componentId, RetrieveActionsRequest.builder().build()); } /** * Get detailed configuration for a specific action by its key */ - public BaseClientHttpResponse retrieve(String componentId, ActionsRetrieveRequest request) { + public BaseClientHttpResponse retrieve(String componentId, RetrieveActionsRequest request) { return retrieve(componentId, request, null); } @@ -149,7 +147,7 @@ public BaseClientHttpResponse retrieve(String componentId, ActionsRet * Get detailed configuration for a specific action by its key */ public BaseClientHttpResponse retrieve( - String componentId, ActionsRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveActionsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -172,12 +170,12 @@ public BaseClientHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentResponse.class); return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -186,11 +184,9 @@ public BaseClientHttpResponse retrieve( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -199,7 +195,7 @@ public BaseClientHttpResponse retrieve( /** * Retrieve remote options for a given prop for a action */ - public BaseClientHttpResponse configureProp(ConfigurePropOpts request) { + public BaseClientHttpResponse configureProp(ConfigurePropActionsRequest request) { return configureProp(request, null); } @@ -207,17 +203,18 @@ public BaseClientHttpResponse configureProp(ConfigureProp * Retrieve remote options for a given prop for a action */ public BaseClientHttpResponse configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropActionsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/configure") + .addPathSegments("actions") + .addPathSegments("configure") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -234,12 +231,11 @@ public BaseClientHttpResponse configureProp( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ConfigurePropResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -248,11 +244,9 @@ public BaseClientHttpResponse configureProp( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -261,7 +255,7 @@ public BaseClientHttpResponse configureProp( /** * Reload the prop definition based on the currently configured props */ - public BaseClientHttpResponse reloadProps(ReloadPropsOpts request) { + public BaseClientHttpResponse reloadProps(ReloadPropsActionsRequest request) { return reloadProps(request, null); } @@ -269,17 +263,18 @@ public BaseClientHttpResponse reloadProps(ReloadPropsOpts r * Reload the prop definition based on the currently configured props */ public BaseClientHttpResponse reloadProps( - ReloadPropsOpts request, RequestOptions requestOptions) { + ReloadPropsActionsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/props") + .addPathSegments("actions") + .addPathSegments("props") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -296,12 +291,11 @@ public BaseClientHttpResponse reloadProps( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ReloadPropsResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -310,11 +304,9 @@ public BaseClientHttpResponse reloadProps( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -335,7 +327,8 @@ public BaseClientHttpResponse run(RunActionOpts request, Requ .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("actions/run") + .addPathSegments("actions") + .addPathSegments("run") .build(); RequestBody body; try { @@ -357,11 +350,11 @@ public BaseClientHttpResponse run(RunActionOpts request, Requ } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RunActionResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RunActionResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -370,11 +363,9 @@ public BaseClientHttpResponse run(RunActionOpts request, Requ } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/actions/requests/ConfigurePropActionsRequest.java b/src/main/java/com/pipedream/api/resources/actions/requests/ConfigurePropActionsRequest.java new file mode 100644 index 0000000..f79872b --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/actions/requests/ConfigurePropActionsRequest.java @@ -0,0 +1,103 @@ +/** + * 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.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 org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConfigurePropActionsRequest.Builder.class) +public final class ConfigurePropActionsRequest { + private final ConfigurePropOpts body; + + private final Map additionalProperties; + + private ConfigurePropActionsRequest(ConfigurePropOpts body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public ConfigurePropOpts getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConfigurePropActionsRequest && equalTo((ConfigurePropActionsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConfigurePropActionsRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(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(ConfigurePropActionsRequest other); + } + + public interface _FinalStage { + ConfigurePropActionsRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private ConfigurePropOpts body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConfigurePropActionsRequest other) { + 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 ConfigurePropActionsRequest build() { + return new ConfigurePropActionsRequest(body, additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/actions/requests/ActionsListRequest.java b/src/main/java/com/pipedream/api/resources/actions/requests/ListActionsRequest.java similarity index 92% rename from src/main/java/com/pipedream/api/resources/actions/requests/ActionsListRequest.java rename to src/main/java/com/pipedream/api/resources/actions/requests/ListActionsRequest.java index 60f1e37..5502181 100644 --- a/src/main/java/com/pipedream/api/resources/actions/requests/ActionsListRequest.java +++ b/src/main/java/com/pipedream/api/resources/actions/requests/ListActionsRequest.java @@ -18,8 +18,8 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ActionsListRequest.Builder.class) -public final class ActionsListRequest { +@JsonDeserialize(builder = ListActionsRequest.Builder.class) +public final class ListActionsRequest { private final Optional after; private final Optional before; @@ -32,7 +32,7 @@ public final class ActionsListRequest { private final Map additionalProperties; - private ActionsListRequest( + private ListActionsRequest( Optional after, Optional before, Optional limit, @@ -90,7 +90,7 @@ public Optional getApp() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ActionsListRequest && equalTo((ActionsListRequest) other); + return other instanceof ListActionsRequest && equalTo((ListActionsRequest) other); } @JsonAnyGetter @@ -98,7 +98,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ActionsListRequest other) { + private boolean equalTo(ListActionsRequest other) { return after.equals(other.after) && before.equals(other.before) && limit.equals(other.limit) @@ -137,7 +137,7 @@ public static final class Builder { private Builder() {} - public Builder from(ActionsListRequest other) { + public Builder from(ListActionsRequest other) { after(other.getAfter()); before(other.getBefore()); limit(other.getLimit()); @@ -216,8 +216,8 @@ public Builder app(String app) { return this; } - public ActionsListRequest build() { - return new ActionsListRequest(after, before, limit, q, app, additionalProperties); + public ListActionsRequest build() { + return new ListActionsRequest(after, before, limit, q, app, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/actions/requests/ReloadPropsActionsRequest.java b/src/main/java/com/pipedream/api/resources/actions/requests/ReloadPropsActionsRequest.java new file mode 100644 index 0000000..e1528ab --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/actions/requests/ReloadPropsActionsRequest.java @@ -0,0 +1,103 @@ +/** + * 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.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 org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReloadPropsActionsRequest.Builder.class) +public final class ReloadPropsActionsRequest { + private final ReloadPropsOpts body; + + private final Map additionalProperties; + + private ReloadPropsActionsRequest(ReloadPropsOpts body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public ReloadPropsOpts getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReloadPropsActionsRequest && equalTo((ReloadPropsActionsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReloadPropsActionsRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(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(ReloadPropsActionsRequest other); + } + + public interface _FinalStage { + ReloadPropsActionsRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private ReloadPropsOpts body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReloadPropsActionsRequest other) { + 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 ReloadPropsActionsRequest build() { + return new ReloadPropsActionsRequest(body, additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/actions/requests/ActionsRetrieveRequest.java b/src/main/java/com/pipedream/api/resources/actions/requests/RetrieveActionsRequest.java similarity index 83% rename from src/main/java/com/pipedream/api/resources/actions/requests/ActionsRetrieveRequest.java rename to src/main/java/com/pipedream/api/resources/actions/requests/RetrieveActionsRequest.java index b72eb6c..ebcca9c 100644 --- a/src/main/java/com/pipedream/api/resources/actions/requests/ActionsRetrieveRequest.java +++ b/src/main/java/com/pipedream/api/resources/actions/requests/RetrieveActionsRequest.java @@ -18,13 +18,13 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ActionsRetrieveRequest.Builder.class) -public final class ActionsRetrieveRequest { +@JsonDeserialize(builder = RetrieveActionsRequest.Builder.class) +public final class RetrieveActionsRequest { private final Optional version; private final Map additionalProperties; - private ActionsRetrieveRequest(Optional version, Map additionalProperties) { + private RetrieveActionsRequest(Optional version, Map additionalProperties) { this.version = version; this.additionalProperties = additionalProperties; } @@ -40,7 +40,7 @@ public Optional getVersion() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ActionsRetrieveRequest && equalTo((ActionsRetrieveRequest) other); + return other instanceof RetrieveActionsRequest && equalTo((RetrieveActionsRequest) other); } @JsonAnyGetter @@ -48,7 +48,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ActionsRetrieveRequest other) { + private boolean equalTo(RetrieveActionsRequest other) { return version.equals(other.version); } @@ -75,7 +75,7 @@ public static final class Builder { private Builder() {} - public Builder from(ActionsRetrieveRequest other) { + public Builder from(RetrieveActionsRequest other) { version(other.getVersion()); return this; } @@ -94,8 +94,8 @@ public Builder version(String version) { return this; } - public ActionsRetrieveRequest build() { - return new ActionsRetrieveRequest(version, additionalProperties); + public RetrieveActionsRequest build() { + return new RetrieveActionsRequest(version, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java b/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java index acc258b..9328a77 100644 --- a/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java +++ b/src/main/java/com/pipedream/api/resources/actions/requests/RunActionOpts.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.types.ConfiguredPropValue; import com.pipedream.api.types.RunActionOptsStashId; @@ -65,8 +68,11 @@ public String getId() { /** * @return Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest */ - @JsonProperty("version") + @JsonIgnore public Optional getVersion() { + if (version == null) { + return Optional.empty(); + } return version; } @@ -91,8 +97,23 @@ public Optional getDynamicPropsId() { return dynamicPropsId; } - @JsonProperty("stash_id") + @JsonIgnore public Optional getStashId() { + if (stashId == null) { + return Optional.empty(); + } + return stashId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("version") + private Optional _getVersion() { + return version; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("stash_id") + private Optional _getStashId() { return stashId; } @@ -157,6 +178,8 @@ public interface _FinalStage { _FinalStage version(String version); + _FinalStage version(Nullable version); + _FinalStage configuredProps(Optional> configuredProps); _FinalStage configuredProps(Map configuredProps); @@ -171,6 +194,8 @@ public interface _FinalStage { _FinalStage stashId(Optional stashId); _FinalStage stashId(RunActionOptsStashId stashId); + + _FinalStage stashId(Nullable stashId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -227,6 +252,18 @@ public _FinalStage externalUserId(@NotNull String externalUserId) { return this; } + @java.lang.Override + public _FinalStage stashId(Nullable stashId) { + if (stashId.isNull()) { + this.stashId = null; + } else if (stashId.isEmpty()) { + this.stashId = Optional.empty(); + } else { + this.stashId = Optional.of(stashId.get()); + } + return this; + } + @java.lang.Override public _FinalStage stashId(RunActionOptsStashId stashId) { this.stashId = Optional.ofNullable(stashId); @@ -273,6 +310,22 @@ public _FinalStage configuredProps(Optional> co return this; } + /** + *

Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage version(Nullable version) { + if (version.isNull()) { + this.version = null; + } else if (version.isEmpty()) { + this.version = Optional.empty(); + } else { + this.version = Optional.of(version.get()); + } + return this; + } + /** *

Optional action component version (in SemVer format, for example '1.0.0'), defaults to latest

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/resources/appcategories/AppCategoriesClient.java b/src/main/java/com/pipedream/api/resources/appcategories/AppCategoriesClient.java index c009b9b..a47c8c4 100644 --- a/src/main/java/com/pipedream/api/resources/appcategories/AppCategoriesClient.java +++ b/src/main/java/com/pipedream/api/resources/appcategories/AppCategoriesClient.java @@ -5,6 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.resources.appcategories.requests.RetrieveAppCategoriesRequest; import com.pipedream.api.types.AppCategory; import java.util.List; @@ -49,7 +50,14 @@ public AppCategory retrieve(String id) { /** * Get details of a specific app category by its ID */ - public AppCategory retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); + public AppCategory retrieve(String id, RetrieveAppCategoriesRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Get details of a specific app category by its ID + */ + public AppCategory retrieve(String id, RetrieveAppCategoriesRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); } } diff --git a/src/main/java/com/pipedream/api/resources/appcategories/AsyncAppCategoriesClient.java b/src/main/java/com/pipedream/api/resources/appcategories/AsyncAppCategoriesClient.java index 8540899..15356e8 100644 --- a/src/main/java/com/pipedream/api/resources/appcategories/AsyncAppCategoriesClient.java +++ b/src/main/java/com/pipedream/api/resources/appcategories/AsyncAppCategoriesClient.java @@ -5,6 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.resources.appcategories.requests.RetrieveAppCategoriesRequest; import com.pipedream.api.types.AppCategory; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -50,7 +51,15 @@ public CompletableFuture retrieve(String id) { /** * Get details of a specific app category by its ID */ - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String id, RetrieveAppCategoriesRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Get details of a specific app category by its ID + */ + public CompletableFuture retrieve( + String id, RetrieveAppCategoriesRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java b/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java index ea828f1..0ce405d 100644 --- a/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java +++ b/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java @@ -10,6 +10,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.resources.appcategories.requests.RetrieveAppCategoriesRequest; import com.pipedream.api.types.AppCategory; import java.io.IOException; import java.util.List; @@ -61,19 +62,17 @@ public CompletableFuture>> list(Request @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -92,24 +91,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get details of a specific app category by its ID */ public CompletableFuture> retrieve(String id) { - return retrieve(id, null); + return retrieve(id, RetrieveAppCategoriesRequest.builder().build()); + } + + /** + * Get details of a specific app category by its ID + */ + public CompletableFuture> retrieve( + String id, RetrieveAppCategoriesRequest request) { + return retrieve(id, request, null); } /** * Get details of a specific app category by its ID */ - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve( + String id, RetrieveAppCategoriesRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -119,18 +127,15 @@ public CompletableFuture> retrieve(String id @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AppCategory.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AppCategory.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java b/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java index 401fd49..93e1e58 100644 --- a/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java +++ b/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java @@ -10,6 +10,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.resources.appcategories.requests.RetrieveAppCategoriesRequest; import com.pipedream.api.types.AppCategory; import java.io.IOException; import java.util.List; @@ -54,18 +55,16 @@ public BaseClientHttpResponse> list(RequestOptions requestOpti } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -75,40 +74,46 @@ public BaseClientHttpResponse> list(RequestOptions requestOpti * Get details of a specific app category by its ID */ public BaseClientHttpResponse retrieve(String id) { - return retrieve(id, null); + return retrieve(id, RetrieveAppCategoriesRequest.builder().build()); + } + + /** + * Get details of a specific app category by its ID + */ + public BaseClientHttpResponse retrieve(String id, RetrieveAppCategoriesRequest request) { + return retrieve(id, request, null); } /** * Get details of a specific app category by its ID */ - public BaseClientHttpResponse retrieve(String id, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve( + String id, RetrieveAppCategoriesRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .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(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AppCategory.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AppCategory.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/appcategories/requests/RetrieveAppCategoriesRequest.java b/src/main/java/com/pipedream/api/resources/appcategories/requests/RetrieveAppCategoriesRequest.java new file mode 100644 index 0000000..33dce63 --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/appcategories/requests/RetrieveAppCategoriesRequest.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.resources.appcategories.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.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RetrieveAppCategoriesRequest.Builder.class) +public final class RetrieveAppCategoriesRequest { + private final Map additionalProperties; + + private RetrieveAppCategoriesRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RetrieveAppCategoriesRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RetrieveAppCategoriesRequest other) { + return this; + } + + public RetrieveAppCategoriesRequest build() { + return new RetrieveAppCategoriesRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/apps/AppsClient.java b/src/main/java/com/pipedream/api/resources/apps/AppsClient.java index 5e5fa6a..d44a8fd 100644 --- a/src/main/java/com/pipedream/api/resources/apps/AppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/AppsClient.java @@ -6,7 +6,8 @@ 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.resources.apps.requests.ListAppsRequest; +import com.pipedream.api.resources.apps.requests.RetrieveAppsRequest; import com.pipedream.api.types.App; import com.pipedream.api.types.GetAppResponse; @@ -37,14 +38,14 @@ public SyncPagingIterable list() { /** * Retrieve all available apps with optional filtering and sorting */ - public SyncPagingIterable list(AppsListRequest request) { + public SyncPagingIterable list(ListAppsRequest request) { return this.rawClient.list(request).body(); } /** * Retrieve all available apps with optional filtering and sorting */ - public SyncPagingIterable list(AppsListRequest request, RequestOptions requestOptions) { + public SyncPagingIterable list(ListAppsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } @@ -58,7 +59,14 @@ public GetAppResponse retrieve(String appId) { /** * Get detailed information about a specific app by ID or name slug */ - public GetAppResponse retrieve(String appId, RequestOptions requestOptions) { - return this.rawClient.retrieve(appId, requestOptions).body(); + public GetAppResponse retrieve(String appId, RetrieveAppsRequest request) { + return this.rawClient.retrieve(appId, request).body(); + } + + /** + * Get detailed information about a specific app by ID or name slug + */ + public GetAppResponse retrieve(String appId, RetrieveAppsRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(appId, request, requestOptions).body(); } } diff --git a/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java b/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java index a573411..9e026ca 100644 --- a/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java @@ -6,7 +6,8 @@ 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.resources.apps.requests.ListAppsRequest; +import com.pipedream.api.resources.apps.requests.RetrieveAppsRequest; import com.pipedream.api.types.App; import com.pipedream.api.types.GetAppResponse; import java.util.concurrent.CompletableFuture; @@ -38,14 +39,14 @@ public CompletableFuture> list() { /** * Retrieve all available apps with optional filtering and sorting */ - public CompletableFuture> list(AppsListRequest request) { + public CompletableFuture> list(ListAppsRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } /** * Retrieve all available apps with optional filtering and sorting */ - public CompletableFuture> list(AppsListRequest request, RequestOptions requestOptions) { + public CompletableFuture> list(ListAppsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } @@ -59,7 +60,15 @@ public CompletableFuture retrieve(String appId) { /** * Get detailed information about a specific app by ID or name slug */ - public CompletableFuture retrieve(String appId, RequestOptions requestOptions) { - return this.rawClient.retrieve(appId, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String appId, RetrieveAppsRequest request) { + return this.rawClient.retrieve(appId, request).thenApply(response -> response.body()); + } + + /** + * Get detailed information about a specific app by ID or name slug + */ + public CompletableFuture retrieve( + String appId, RetrieveAppsRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(appId, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java b/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java index bfc2fde..f6080f4 100644 --- a/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java @@ -11,7 +11,8 @@ 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.resources.apps.requests.ListAppsRequest; +import com.pipedream.api.resources.apps.requests.RetrieveAppsRequest; import com.pipedream.api.types.App; import com.pipedream.api.types.GetAppResponse; import com.pipedream.api.types.ListAppsResponse; @@ -41,13 +42,13 @@ public AsyncRawAppsClient(ClientOptions clientOptions) { * Retrieve all available apps with optional filtering and sorting */ public CompletableFuture>> list() { - return list(AppsListRequest.builder().build()); + return list(ListAppsRequest.builder().build()); } /** * Retrieve all available apps with optional filtering and sorting */ - public CompletableFuture>> list(AppsListRequest request) { + public CompletableFuture>> list(ListAppsRequest request) { return list(request, null); } @@ -55,7 +56,7 @@ public CompletableFuture>> list(A * Retrieve all available apps with optional filtering and sorting */ public CompletableFuture>> list( - AppsListRequest request, RequestOptions requestOptions) { + ListAppsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps"); @@ -101,12 +102,13 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { ListAppsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListAppsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListAppsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - AppsListRequest nextRequest = AppsListRequest.builder() + ListAppsRequest nextRequest = ListAppsRequest.builder() .from(request) .after(startingAfter) .build(); @@ -124,12 +126,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -148,25 +147,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get detailed information about a specific app by ID or name slug */ public CompletableFuture> retrieve(String appId) { - return retrieve(appId, null); + return retrieve(appId, RetrieveAppsRequest.builder().build()); + } + + /** + * Get detailed information about a specific app by ID or name slug + */ + public CompletableFuture> retrieve( + String appId, RetrieveAppsRequest request) { + return retrieve(appId, request, null); } /** * Get detailed information about a specific app by ID or name slug */ public CompletableFuture> retrieve( - String appId, RequestOptions requestOptions) { + String appId, RetrieveAppsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps") .addPathSegment(appId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -176,18 +183,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetAppResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetAppResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java b/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java index 1a8e637..47ee2f3 100644 --- a/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java @@ -11,7 +11,8 @@ 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.resources.apps.requests.ListAppsRequest; +import com.pipedream.api.resources.apps.requests.RetrieveAppsRequest; import com.pipedream.api.types.App; import com.pipedream.api.types.GetAppResponse; import com.pipedream.api.types.ListAppsResponse; @@ -36,13 +37,13 @@ public RawAppsClient(ClientOptions clientOptions) { * Retrieve all available apps with optional filtering and sorting */ public BaseClientHttpResponse> list() { - return list(AppsListRequest.builder().build()); + return list(ListAppsRequest.builder().build()); } /** * Retrieve all available apps with optional filtering and sorting */ - public BaseClientHttpResponse> list(AppsListRequest request) { + public BaseClientHttpResponse> list(ListAppsRequest request) { return list(request, null); } @@ -50,7 +51,7 @@ public BaseClientHttpResponse> list(AppsListRequest requ * Retrieve all available apps with optional filtering and sorting */ public BaseClientHttpResponse> list( - AppsListRequest request, RequestOptions requestOptions) { + ListAppsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps"); @@ -93,11 +94,12 @@ public BaseClientHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { ListAppsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListAppsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListAppsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - AppsListRequest nextRequest = AppsListRequest.builder() + ListAppsRequest nextRequest = ListAppsRequest.builder() .from(request) .after(startingAfter) .build(); @@ -108,12 +110,9 @@ public BaseClientHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -123,40 +122,46 @@ public BaseClientHttpResponse> list( * Get detailed information about a specific app by ID or name slug */ public BaseClientHttpResponse retrieve(String appId) { - return retrieve(appId, null); + return retrieve(appId, RetrieveAppsRequest.builder().build()); + } + + /** + * Get detailed information about a specific app by ID or name slug + */ + public BaseClientHttpResponse retrieve(String appId, RetrieveAppsRequest request) { + return retrieve(appId, request, null); } /** * Get detailed information about a specific app by ID or name slug */ - public BaseClientHttpResponse retrieve(String appId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve( + String appId, RetrieveAppsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps") .addPathSegment(appId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .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(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetAppResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetAppResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java b/src/main/java/com/pipedream/api/resources/apps/requests/ListAppsRequest.java similarity index 85% rename from src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java rename to src/main/java/com/pipedream/api/resources/apps/requests/ListAppsRequest.java index 5e13f36..5d9e948 100644 --- a/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java +++ b/src/main/java/com/pipedream/api/resources/apps/requests/ListAppsRequest.java @@ -12,8 +12,8 @@ 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 com.pipedream.api.resources.apps.types.ListAppsRequestSortDirection; +import com.pipedream.api.resources.apps.types.ListAppsRequestSortKey; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -22,8 +22,8 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AppsListRequest.Builder.class) -public final class AppsListRequest { +@JsonDeserialize(builder = ListAppsRequest.Builder.class) +public final class ListAppsRequest { private final Optional> categoryIds; private final Optional after; @@ -34,20 +34,20 @@ public final class AppsListRequest { private final Optional q; - private final Optional sortKey; + private final Optional sortKey; - private final Optional sortDirection; + private final Optional sortDirection; private final Map additionalProperties; - private AppsListRequest( + private ListAppsRequest( Optional> categoryIds, Optional after, Optional before, Optional limit, Optional q, - Optional sortKey, - Optional sortDirection, + Optional sortKey, + Optional sortDirection, Map additionalProperties) { this.categoryIds = categoryIds; this.after = after; @@ -103,7 +103,7 @@ public Optional getQ() { * @return The key to sort the apps by */ @JsonProperty("sort_key") - public Optional getSortKey() { + public Optional getSortKey() { return sortKey; } @@ -111,14 +111,14 @@ public Optional getSortKey() { * @return The direction to sort the apps */ @JsonProperty("sort_direction") - public Optional getSortDirection() { + 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); + return other instanceof ListAppsRequest && equalTo((ListAppsRequest) other); } @JsonAnyGetter @@ -126,7 +126,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(AppsListRequest other) { + private boolean equalTo(ListAppsRequest other) { return categoryIds.equals(other.categoryIds) && after.equals(other.after) && before.equals(other.before) @@ -163,16 +163,16 @@ public static final class Builder { private Optional q = Optional.empty(); - private Optional sortKey = Optional.empty(); + private Optional sortKey = Optional.empty(); - private Optional sortDirection = Optional.empty(); + private Optional sortDirection = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - public Builder from(AppsListRequest other) { + public Builder from(ListAppsRequest other) { categoryIds(other.getCategoryIds()); after(other.getAfter()); before(other.getBefore()); @@ -262,12 +262,12 @@ public Builder q(String q) { *

The key to sort the apps by

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

The direction to sort the apps

*/ @JsonSetter(value = "sort_direction", nulls = Nulls.SKIP) - public Builder sortDirection(Optional sortDirection) { + public Builder sortDirection(Optional sortDirection) { this.sortDirection = sortDirection; return this; } - public Builder sortDirection(AppsListRequestSortDirection sortDirection) { + public Builder sortDirection(ListAppsRequestSortDirection sortDirection) { this.sortDirection = Optional.ofNullable(sortDirection); return this; } - public AppsListRequest build() { - return new AppsListRequest( + public ListAppsRequest build() { + return new ListAppsRequest( categoryIds, after, before, limit, q, sortKey, sortDirection, additionalProperties); } } diff --git a/src/main/java/com/pipedream/api/resources/apps/requests/RetrieveAppsRequest.java b/src/main/java/com/pipedream/api/resources/apps/requests/RetrieveAppsRequest.java new file mode 100644 index 0000000..ed7819d --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/apps/requests/RetrieveAppsRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RetrieveAppsRequest.Builder.class) +public final class RetrieveAppsRequest { + private final Map additionalProperties; + + private RetrieveAppsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RetrieveAppsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RetrieveAppsRequest other) { + return this; + } + + public RetrieveAppsRequest build() { + return new RetrieveAppsRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortDirection.java b/src/main/java/com/pipedream/api/resources/apps/types/ListAppsRequestSortDirection.java similarity index 72% rename from src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortDirection.java rename to src/main/java/com/pipedream/api/resources/apps/types/ListAppsRequestSortDirection.java index 0e84e8f..a7700c3 100644 --- a/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortDirection.java +++ b/src/main/java/com/pipedream/api/resources/apps/types/ListAppsRequestSortDirection.java @@ -6,16 +6,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -public final class AppsListRequestSortDirection { - public static final AppsListRequestSortDirection ASC = new AppsListRequestSortDirection(Value.ASC, "asc"); +public final class ListAppsRequestSortDirection { + public static final ListAppsRequestSortDirection ASC = new ListAppsRequestSortDirection(Value.ASC, "asc"); - public static final AppsListRequestSortDirection DESC = new AppsListRequestSortDirection(Value.DESC, "desc"); + public static final ListAppsRequestSortDirection DESC = new ListAppsRequestSortDirection(Value.DESC, "desc"); private final Value value; private final String string; - AppsListRequestSortDirection(Value value, String string) { + ListAppsRequestSortDirection(Value value, String string) { this.value = value; this.string = string; } @@ -33,8 +33,8 @@ public String toString() { @java.lang.Override public boolean equals(Object other) { return (this == other) - || (other instanceof AppsListRequestSortDirection - && this.string.equals(((AppsListRequestSortDirection) other).string)); + || (other instanceof ListAppsRequestSortDirection + && this.string.equals(((ListAppsRequestSortDirection) other).string)); } @java.lang.Override @@ -55,14 +55,14 @@ public T visit(Visitor visitor) { } @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static AppsListRequestSortDirection valueOf(String value) { + public static ListAppsRequestSortDirection valueOf(String value) { switch (value) { case "asc": return ASC; case "desc": return DESC; default: - return new AppsListRequestSortDirection(Value.UNKNOWN, value); + return new ListAppsRequestSortDirection(Value.UNKNOWN, value); } } diff --git a/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java b/src/main/java/com/pipedream/api/resources/apps/types/ListAppsRequestSortKey.java similarity index 71% rename from src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java rename to src/main/java/com/pipedream/api/resources/apps/types/ListAppsRequestSortKey.java index 16800bb..25d8cf8 100644 --- a/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java +++ b/src/main/java/com/pipedream/api/resources/apps/types/ListAppsRequestSortKey.java @@ -6,19 +6,19 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -public final class AppsListRequestSortKey { - public static final AppsListRequestSortKey NAME_SLUG = new AppsListRequestSortKey(Value.NAME_SLUG, "name_slug"); +public final class ListAppsRequestSortKey { + public static final ListAppsRequestSortKey NAME_SLUG = new ListAppsRequestSortKey(Value.NAME_SLUG, "name_slug"); - public static final AppsListRequestSortKey FEATURED_WEIGHT = - new AppsListRequestSortKey(Value.FEATURED_WEIGHT, "featured_weight"); + public static final ListAppsRequestSortKey FEATURED_WEIGHT = + new ListAppsRequestSortKey(Value.FEATURED_WEIGHT, "featured_weight"); - public static final AppsListRequestSortKey NAME = new AppsListRequestSortKey(Value.NAME, "name"); + public static final ListAppsRequestSortKey NAME = new ListAppsRequestSortKey(Value.NAME, "name"); private final Value value; private final String string; - AppsListRequestSortKey(Value value, String string) { + ListAppsRequestSortKey(Value value, String string) { this.value = value; this.string = string; } @@ -36,8 +36,8 @@ public String toString() { @java.lang.Override public boolean equals(Object other) { return (this == other) - || (other instanceof AppsListRequestSortKey - && this.string.equals(((AppsListRequestSortKey) other).string)); + || (other instanceof ListAppsRequestSortKey + && this.string.equals(((ListAppsRequestSortKey) other).string)); } @java.lang.Override @@ -60,7 +60,7 @@ public T visit(Visitor visitor) { } @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static AppsListRequestSortKey valueOf(String value) { + public static ListAppsRequestSortKey valueOf(String value) { switch (value) { case "name_slug": return NAME_SLUG; @@ -69,7 +69,7 @@ public static AppsListRequestSortKey valueOf(String value) { case "name": return NAME; default: - return new AppsListRequestSortKey(Value.UNKNOWN, value); + return new ListAppsRequestSortKey(Value.UNKNOWN, value); } } diff --git a/src/main/java/com/pipedream/api/resources/components/AsyncComponentsClient.java b/src/main/java/com/pipedream/api/resources/components/AsyncComponentsClient.java index fabb8cc..f981e91 100644 --- a/src/main/java/com/pipedream/api/resources/components/AsyncComponentsClient.java +++ b/src/main/java/com/pipedream/api/resources/components/AsyncComponentsClient.java @@ -6,12 +6,12 @@ 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.ComponentsListRequest; -import com.pipedream.api.resources.components.requests.ComponentsRetrieveRequest; +import com.pipedream.api.resources.components.requests.ConfigurePropComponentsRequest; +import com.pipedream.api.resources.components.requests.ListComponentsRequest; +import com.pipedream.api.resources.components.requests.ReloadPropsComponentsRequest; +import com.pipedream.api.resources.components.requests.RetrieveComponentsRequest; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import java.util.concurrent.CompletableFuture; @@ -42,7 +42,7 @@ public CompletableFuture> list() { /** * Retrieve available components with optional search and app filtering */ - public CompletableFuture> list(ComponentsListRequest request) { + public CompletableFuture> list(ListComponentsRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } @@ -50,7 +50,7 @@ public CompletableFuture> list(ComponentsListReque * Retrieve available components with optional search and app filtering */ public CompletableFuture> list( - ComponentsListRequest request, RequestOptions requestOptions) { + ListComponentsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } @@ -64,7 +64,7 @@ public CompletableFuture retrieve(String componentId) { /** * Get detailed configuration for a specific component by its key */ - public CompletableFuture retrieve(String componentId, ComponentsRetrieveRequest request) { + public CompletableFuture retrieve(String componentId, RetrieveComponentsRequest request) { return this.rawClient.retrieve(componentId, request).thenApply(response -> response.body()); } @@ -72,14 +72,14 @@ public CompletableFuture retrieve(String componentId, ComponentsRetri * Get detailed configuration for a specific component by its key */ public CompletableFuture retrieve( - String componentId, ComponentsRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveComponentsRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(componentId, request, requestOptions).thenApply(response -> response.body()); } /** * Retrieve remote options for a given prop for a component */ - public CompletableFuture configureProp(ConfigurePropOpts request) { + public CompletableFuture configureProp(ConfigurePropComponentsRequest request) { return this.rawClient.configureProp(request).thenApply(response -> response.body()); } @@ -87,21 +87,22 @@ public CompletableFuture configureProp(ConfigurePropOpts * Retrieve remote options for a given prop for a component */ public CompletableFuture configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropComponentsRequest request, RequestOptions requestOptions) { return this.rawClient.configureProp(request, requestOptions).thenApply(response -> response.body()); } /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture reloadProps(ReloadPropsOpts request) { + public CompletableFuture reloadProps(ReloadPropsComponentsRequest request) { return this.rawClient.reloadProps(request).thenApply(response -> response.body()); } /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture reloadProps(ReloadPropsOpts request, RequestOptions requestOptions) { + public CompletableFuture reloadProps( + ReloadPropsComponentsRequest request, RequestOptions requestOptions) { return this.rawClient.reloadProps(request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java b/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java index 14f1c17..148ee27 100644 --- a/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java +++ b/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java @@ -14,14 +14,14 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; -import com.pipedream.api.resources.components.requests.ComponentsListRequest; -import com.pipedream.api.resources.components.requests.ComponentsRetrieveRequest; +import com.pipedream.api.resources.components.requests.ConfigurePropComponentsRequest; +import com.pipedream.api.resources.components.requests.ListComponentsRequest; +import com.pipedream.api.resources.components.requests.ReloadPropsComponentsRequest; +import com.pipedream.api.resources.components.requests.RetrieveComponentsRequest; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; import com.pipedream.api.types.GetComponentResponse; import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import java.io.IOException; import java.util.List; @@ -50,14 +50,14 @@ public AsyncRawComponentsClient(ClientOptions clientOptions) { * Retrieve available components with optional search and app filtering */ public CompletableFuture>> list() { - return list(ComponentsListRequest.builder().build()); + return list(ListComponentsRequest.builder().build()); } /** * Retrieve available components with optional search and app filtering */ public CompletableFuture>> list( - ComponentsListRequest request) { + ListComponentsRequest request) { return list(request, null); } @@ -65,7 +65,7 @@ public CompletableFuture>> * Retrieve available components with optional search and app filtering */ public CompletableFuture>> list( - ComponentsListRequest request, RequestOptions requestOptions) { + ListComponentsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -108,12 +108,13 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - ComponentsListRequest nextRequest = ComponentsListRequest.builder() + ListComponentsRequest nextRequest = ListComponentsRequest.builder() .from(request) .after(startingAfter) .build(); @@ -132,7 +133,6 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -142,11 +142,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -165,14 +163,14 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get detailed configuration for a specific component by its key */ public CompletableFuture> retrieve(String componentId) { - return retrieve(componentId, ComponentsRetrieveRequest.builder().build()); + return retrieve(componentId, RetrieveComponentsRequest.builder().build()); } /** * Get detailed configuration for a specific component by its key */ public CompletableFuture> retrieve( - String componentId, ComponentsRetrieveRequest request) { + String componentId, RetrieveComponentsRequest request) { return retrieve(componentId, request, null); } @@ -180,7 +178,7 @@ public CompletableFuture> retrieve( * Get detailed configuration for a specific component by its key */ public CompletableFuture> retrieve( - String componentId, ComponentsRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveComponentsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -206,13 +204,13 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentResponse.class); future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -222,11 +220,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -244,7 +240,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Retrieve remote options for a given prop for a component */ - public CompletableFuture> configureProp(ConfigurePropOpts request) { + public CompletableFuture> configureProp( + ConfigurePropComponentsRequest request) { return configureProp(request, null); } @@ -252,17 +249,18 @@ public CompletableFuture> configur * Retrieve remote options for a given prop for a component */ public CompletableFuture> configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropComponentsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("components/configure") + .addPathSegments("components") + .addPathSegments("configure") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -282,13 +280,13 @@ public CompletableFuture> configur @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ConfigurePropResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -298,11 +296,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -320,7 +316,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture> reloadProps(ReloadPropsOpts request) { + public CompletableFuture> reloadProps( + ReloadPropsComponentsRequest request) { return reloadProps(request, null); } @@ -328,17 +325,18 @@ public CompletableFuture> reloadProp * Reload the prop definition based on the currently configured props */ public CompletableFuture> reloadProps( - ReloadPropsOpts request, RequestOptions requestOptions) { + ReloadPropsComponentsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("components/props") + .addPathSegments("components") + .addPathSegments("props") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -358,13 +356,13 @@ public CompletableFuture> reloadProp @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ReloadPropsResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -374,11 +372,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/components/ComponentsClient.java b/src/main/java/com/pipedream/api/resources/components/ComponentsClient.java index 892f803..30760b1 100644 --- a/src/main/java/com/pipedream/api/resources/components/ComponentsClient.java +++ b/src/main/java/com/pipedream/api/resources/components/ComponentsClient.java @@ -6,12 +6,12 @@ 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.ComponentsListRequest; -import com.pipedream.api.resources.components.requests.ComponentsRetrieveRequest; +import com.pipedream.api.resources.components.requests.ConfigurePropComponentsRequest; +import com.pipedream.api.resources.components.requests.ListComponentsRequest; +import com.pipedream.api.resources.components.requests.ReloadPropsComponentsRequest; +import com.pipedream.api.resources.components.requests.RetrieveComponentsRequest; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; public class ComponentsClient { @@ -41,14 +41,14 @@ public SyncPagingIterable list() { /** * Retrieve available components with optional search and app filtering */ - public SyncPagingIterable list(ComponentsListRequest request) { + public SyncPagingIterable list(ListComponentsRequest request) { return this.rawClient.list(request).body(); } /** * Retrieve available components with optional search and app filtering */ - public SyncPagingIterable list(ComponentsListRequest request, RequestOptions requestOptions) { + public SyncPagingIterable list(ListComponentsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } @@ -62,42 +62,42 @@ public Component retrieve(String componentId) { /** * Get detailed configuration for a specific component by its key */ - public Component retrieve(String componentId, ComponentsRetrieveRequest request) { + public Component retrieve(String componentId, RetrieveComponentsRequest request) { return this.rawClient.retrieve(componentId, request).body(); } /** * Get detailed configuration for a specific component by its key */ - public Component retrieve(String componentId, ComponentsRetrieveRequest request, RequestOptions requestOptions) { + public Component retrieve(String componentId, RetrieveComponentsRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(componentId, request, requestOptions).body(); } /** * Retrieve remote options for a given prop for a component */ - public ConfigurePropResponse configureProp(ConfigurePropOpts request) { + public ConfigurePropResponse configureProp(ConfigurePropComponentsRequest request) { return this.rawClient.configureProp(request).body(); } /** * Retrieve remote options for a given prop for a component */ - public ConfigurePropResponse configureProp(ConfigurePropOpts request, RequestOptions requestOptions) { + public ConfigurePropResponse configureProp(ConfigurePropComponentsRequest request, RequestOptions requestOptions) { return this.rawClient.configureProp(request, requestOptions).body(); } /** * Reload the prop definition based on the currently configured props */ - public ReloadPropsResponse reloadProps(ReloadPropsOpts request) { + public ReloadPropsResponse reloadProps(ReloadPropsComponentsRequest request) { return this.rawClient.reloadProps(request).body(); } /** * Reload the prop definition based on the currently configured props */ - public ReloadPropsResponse reloadProps(ReloadPropsOpts request, RequestOptions requestOptions) { + public ReloadPropsResponse reloadProps(ReloadPropsComponentsRequest request, RequestOptions requestOptions) { return this.rawClient.reloadProps(request, requestOptions).body(); } } diff --git a/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java b/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java index a98c026..806c555 100644 --- a/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java +++ b/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java @@ -14,14 +14,14 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; -import com.pipedream.api.resources.components.requests.ComponentsListRequest; -import com.pipedream.api.resources.components.requests.ComponentsRetrieveRequest; +import com.pipedream.api.resources.components.requests.ConfigurePropComponentsRequest; +import com.pipedream.api.resources.components.requests.ListComponentsRequest; +import com.pipedream.api.resources.components.requests.ReloadPropsComponentsRequest; +import com.pipedream.api.resources.components.requests.RetrieveComponentsRequest; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; import com.pipedream.api.types.GetComponentResponse; import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import java.io.IOException; import java.util.List; @@ -45,13 +45,13 @@ public RawComponentsClient(ClientOptions clientOptions) { * Retrieve available components with optional search and app filtering */ public BaseClientHttpResponse> list() { - return list(ComponentsListRequest.builder().build()); + return list(ListComponentsRequest.builder().build()); } /** * Retrieve available components with optional search and app filtering */ - public BaseClientHttpResponse> list(ComponentsListRequest request) { + public BaseClientHttpResponse> list(ListComponentsRequest request) { return list(request, null); } @@ -59,7 +59,7 @@ public BaseClientHttpResponse> list(ComponentsList * Retrieve available components with optional search and app filtering */ public BaseClientHttpResponse> list( - ComponentsListRequest request, RequestOptions requestOptions) { + ListComponentsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -99,11 +99,12 @@ public BaseClientHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - ComponentsListRequest nextRequest = ComponentsListRequest.builder() + ListComponentsRequest nextRequest = ListComponentsRequest.builder() .from(request) .after(startingAfter) .build(); @@ -114,7 +115,6 @@ public BaseClientHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -123,11 +123,9 @@ public BaseClientHttpResponse> list( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -137,13 +135,13 @@ public BaseClientHttpResponse> list( * Get detailed configuration for a specific component by its key */ public BaseClientHttpResponse retrieve(String componentId) { - return retrieve(componentId, ComponentsRetrieveRequest.builder().build()); + return retrieve(componentId, RetrieveComponentsRequest.builder().build()); } /** * Get detailed configuration for a specific component by its key */ - public BaseClientHttpResponse retrieve(String componentId, ComponentsRetrieveRequest request) { + public BaseClientHttpResponse retrieve(String componentId, RetrieveComponentsRequest request) { return retrieve(componentId, request, null); } @@ -151,7 +149,7 @@ public BaseClientHttpResponse retrieve(String componentId, Components * Get detailed configuration for a specific component by its key */ public BaseClientHttpResponse retrieve( - String componentId, ComponentsRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveComponentsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -174,12 +172,12 @@ public BaseClientHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentResponse.class); return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -188,11 +186,9 @@ public BaseClientHttpResponse retrieve( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -201,7 +197,7 @@ public BaseClientHttpResponse retrieve( /** * Retrieve remote options for a given prop for a component */ - public BaseClientHttpResponse configureProp(ConfigurePropOpts request) { + public BaseClientHttpResponse configureProp(ConfigurePropComponentsRequest request) { return configureProp(request, null); } @@ -209,17 +205,18 @@ public BaseClientHttpResponse configureProp(ConfigureProp * Retrieve remote options for a given prop for a component */ public BaseClientHttpResponse configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropComponentsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("components/configure") + .addPathSegments("components") + .addPathSegments("configure") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -236,12 +233,11 @@ public BaseClientHttpResponse configureProp( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ConfigurePropResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -250,11 +246,9 @@ public BaseClientHttpResponse configureProp( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -263,7 +257,7 @@ public BaseClientHttpResponse configureProp( /** * Reload the prop definition based on the currently configured props */ - public BaseClientHttpResponse reloadProps(ReloadPropsOpts request) { + public BaseClientHttpResponse reloadProps(ReloadPropsComponentsRequest request) { return reloadProps(request, null); } @@ -271,17 +265,18 @@ public BaseClientHttpResponse reloadProps(ReloadPropsOpts r * Reload the prop definition based on the currently configured props */ public BaseClientHttpResponse reloadProps( - ReloadPropsOpts request, RequestOptions requestOptions) { + ReloadPropsComponentsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("components/props") + .addPathSegments("components") + .addPathSegments("props") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -298,12 +293,11 @@ public BaseClientHttpResponse reloadProps( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ReloadPropsResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -312,11 +306,9 @@ public BaseClientHttpResponse reloadProps( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/components/requests/ConfigurePropComponentsRequest.java b/src/main/java/com/pipedream/api/resources/components/requests/ConfigurePropComponentsRequest.java new file mode 100644 index 0000000..432d35b --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/components/requests/ConfigurePropComponentsRequest.java @@ -0,0 +1,103 @@ +/** + * 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.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 org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConfigurePropComponentsRequest.Builder.class) +public final class ConfigurePropComponentsRequest { + private final ConfigurePropOpts body; + + private final Map additionalProperties; + + private ConfigurePropComponentsRequest(ConfigurePropOpts body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public ConfigurePropOpts getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConfigurePropComponentsRequest && equalTo((ConfigurePropComponentsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConfigurePropComponentsRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(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(ConfigurePropComponentsRequest other); + } + + public interface _FinalStage { + ConfigurePropComponentsRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private ConfigurePropOpts body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConfigurePropComponentsRequest other) { + 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 ConfigurePropComponentsRequest build() { + return new ConfigurePropComponentsRequest(body, additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/components/requests/ComponentsListRequest.java b/src/main/java/com/pipedream/api/resources/components/requests/ListComponentsRequest.java similarity index 93% rename from src/main/java/com/pipedream/api/resources/components/requests/ComponentsListRequest.java rename to src/main/java/com/pipedream/api/resources/components/requests/ListComponentsRequest.java index f1e64a3..871f4be 100644 --- a/src/main/java/com/pipedream/api/resources/components/requests/ComponentsListRequest.java +++ b/src/main/java/com/pipedream/api/resources/components/requests/ListComponentsRequest.java @@ -19,8 +19,8 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ComponentsListRequest.Builder.class) -public final class ComponentsListRequest { +@JsonDeserialize(builder = ListComponentsRequest.Builder.class) +public final class ListComponentsRequest { private final Optional after; private final Optional before; @@ -35,7 +35,7 @@ public final class ComponentsListRequest { private final Map additionalProperties; - private ComponentsListRequest( + private ListComponentsRequest( Optional after, Optional before, Optional limit, @@ -103,7 +103,7 @@ public Optional getComponentType() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ComponentsListRequest && equalTo((ComponentsListRequest) other); + return other instanceof ListComponentsRequest && equalTo((ListComponentsRequest) other); } @JsonAnyGetter @@ -111,7 +111,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ComponentsListRequest other) { + private boolean equalTo(ListComponentsRequest other) { return after.equals(other.after) && before.equals(other.before) && limit.equals(other.limit) @@ -153,7 +153,7 @@ public static final class Builder { private Builder() {} - public Builder from(ComponentsListRequest other) { + public Builder from(ListComponentsRequest other) { after(other.getAfter()); before(other.getBefore()); limit(other.getLimit()); @@ -247,8 +247,8 @@ public Builder componentType(ComponentType componentType) { return this; } - public ComponentsListRequest build() { - return new ComponentsListRequest(after, before, limit, q, app, componentType, additionalProperties); + public ListComponentsRequest build() { + return new ListComponentsRequest(after, before, limit, q, app, componentType, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/components/requests/ReloadPropsComponentsRequest.java b/src/main/java/com/pipedream/api/resources/components/requests/ReloadPropsComponentsRequest.java new file mode 100644 index 0000000..671995c --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/components/requests/ReloadPropsComponentsRequest.java @@ -0,0 +1,103 @@ +/** + * 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.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 org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReloadPropsComponentsRequest.Builder.class) +public final class ReloadPropsComponentsRequest { + private final ReloadPropsOpts body; + + private final Map additionalProperties; + + private ReloadPropsComponentsRequest(ReloadPropsOpts body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public ReloadPropsOpts getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReloadPropsComponentsRequest && equalTo((ReloadPropsComponentsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReloadPropsComponentsRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(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(ReloadPropsComponentsRequest other); + } + + public interface _FinalStage { + ReloadPropsComponentsRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private ReloadPropsOpts body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReloadPropsComponentsRequest other) { + 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 ReloadPropsComponentsRequest build() { + return new ReloadPropsComponentsRequest(body, additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/components/requests/ComponentsRetrieveRequest.java b/src/main/java/com/pipedream/api/resources/components/requests/RetrieveComponentsRequest.java similarity index 83% rename from src/main/java/com/pipedream/api/resources/components/requests/ComponentsRetrieveRequest.java rename to src/main/java/com/pipedream/api/resources/components/requests/RetrieveComponentsRequest.java index 309c7dc..877ea56 100644 --- a/src/main/java/com/pipedream/api/resources/components/requests/ComponentsRetrieveRequest.java +++ b/src/main/java/com/pipedream/api/resources/components/requests/RetrieveComponentsRequest.java @@ -18,13 +18,13 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ComponentsRetrieveRequest.Builder.class) -public final class ComponentsRetrieveRequest { +@JsonDeserialize(builder = RetrieveComponentsRequest.Builder.class) +public final class RetrieveComponentsRequest { private final Optional version; private final Map additionalProperties; - private ComponentsRetrieveRequest(Optional version, Map additionalProperties) { + private RetrieveComponentsRequest(Optional version, Map additionalProperties) { this.version = version; this.additionalProperties = additionalProperties; } @@ -40,7 +40,7 @@ public Optional getVersion() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ComponentsRetrieveRequest && equalTo((ComponentsRetrieveRequest) other); + return other instanceof RetrieveComponentsRequest && equalTo((RetrieveComponentsRequest) other); } @JsonAnyGetter @@ -48,7 +48,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ComponentsRetrieveRequest other) { + private boolean equalTo(RetrieveComponentsRequest other) { return version.equals(other.version); } @@ -75,7 +75,7 @@ public static final class Builder { private Builder() {} - public Builder from(ComponentsRetrieveRequest other) { + public Builder from(RetrieveComponentsRequest other) { version(other.getVersion()); return this; } @@ -94,8 +94,8 @@ public Builder version(String version) { return this; } - public ComponentsRetrieveRequest build() { - return new ComponentsRetrieveRequest(version, additionalProperties); + public RetrieveComponentsRequest build() { + return new RetrieveComponentsRequest(version, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncDeployedTriggersClient.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncDeployedTriggersClient.java index 83cdbeb..973abe9 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncDeployedTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncDeployedTriggersClient.java @@ -6,12 +6,12 @@ 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.DeleteDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListEventsDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListWebhooksDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListWorkflowsDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.RetrieveDeployedTriggersRequest; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWebhooksOpts; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWorkflowsOpts; @@ -42,7 +42,7 @@ public AsyncRawDeployedTriggersClient withRawResponse() { /** * Retrieve all deployed triggers for a specific external user */ - public CompletableFuture> list(DeployedTriggersListRequest request) { + public CompletableFuture> list(ListDeployedTriggersRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } @@ -50,14 +50,14 @@ public CompletableFuture> list(DeployedTriggersListR * Retrieve all deployed triggers for a specific external user */ public CompletableFuture> list( - DeployedTriggersListRequest request, RequestOptions requestOptions) { + ListDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } /** * Get details of a specific deployed trigger by its ID */ - public CompletableFuture retrieve(String triggerId, DeployedTriggersRetrieveRequest request) { + public CompletableFuture retrieve(String triggerId, RetrieveDeployedTriggersRequest request) { return this.rawClient.retrieve(triggerId, request).thenApply(response -> response.body()); } @@ -65,7 +65,7 @@ public CompletableFuture retrieve(String triggerId, DeployedTriggersRet * Get details of a specific deployed trigger by its ID */ public CompletableFuture retrieve( - String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { + String triggerId, RetrieveDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(triggerId, request, requestOptions).thenApply(response -> response.body()); } @@ -87,7 +87,7 @@ public CompletableFuture update( /** * Remove a deployed trigger and stop receiving events */ - public CompletableFuture delete(String triggerId, DeployedTriggersDeleteRequest request) { + public CompletableFuture delete(String triggerId, DeleteDeployedTriggersRequest request) { return this.rawClient.delete(triggerId, request).thenApply(response -> response.body()); } @@ -95,7 +95,7 @@ public CompletableFuture delete(String triggerId, DeployedTriggersDeleteRe * Remove a deployed trigger and stop receiving events */ public CompletableFuture delete( - String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { + String triggerId, DeleteDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.delete(triggerId, request, requestOptions).thenApply(response -> response.body()); } @@ -103,7 +103,7 @@ public CompletableFuture delete( * Retrieve recent events emitted by a deployed trigger */ public CompletableFuture> listEvents( - String triggerId, DeployedTriggersListEventsRequest request) { + String triggerId, ListEventsDeployedTriggersRequest request) { return this.rawClient.listEvents(triggerId, request).thenApply(response -> response.body()); } @@ -111,7 +111,7 @@ public CompletableFuture> listEvents( * Retrieve recent events emitted by a deployed trigger */ public CompletableFuture> listEvents( - String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { + String triggerId, ListEventsDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.listEvents(triggerId, request, requestOptions).thenApply(response -> response.body()); } @@ -119,7 +119,7 @@ public CompletableFuture> listEvents( * Get workflows connected to receive events from this trigger */ public CompletableFuture listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request) { + String triggerId, ListWorkflowsDeployedTriggersRequest request) { return this.rawClient.listWorkflows(triggerId, request).thenApply(response -> response.body()); } @@ -127,7 +127,7 @@ public CompletableFuture listWorkflows( * Get workflows connected to receive events from this trigger */ public CompletableFuture listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { + String triggerId, ListWorkflowsDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.listWorkflows(triggerId, request, requestOptions).thenApply(response -> response.body()); } @@ -153,7 +153,7 @@ public CompletableFuture updateWorkflows( * Get webhook URLs configured to receive trigger events */ public CompletableFuture listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request) { + String triggerId, ListWebhooksDeployedTriggersRequest request) { return this.rawClient.listWebhooks(triggerId, request).thenApply(response -> response.body()); } @@ -161,7 +161,7 @@ public CompletableFuture listWebhooks( * Get webhook URLs configured to receive trigger events */ public CompletableFuture listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { + String triggerId, ListWebhooksDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.listWebhooks(triggerId, request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java index 0542a9c..0a07c26 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java @@ -14,12 +14,12 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; -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.DeleteDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListEventsDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListWebhooksDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListWorkflowsDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.RetrieveDeployedTriggersRequest; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWebhooksOpts; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWorkflowsOpts; @@ -57,7 +57,7 @@ public AsyncRawDeployedTriggersClient(ClientOptions clientOptions) { * Retrieve all deployed triggers for a specific external user */ public CompletableFuture>> list( - DeployedTriggersListRequest request) { + ListDeployedTriggersRequest request) { return list(request, null); } @@ -65,7 +65,7 @@ public CompletableFuture>> li * Retrieve all deployed triggers for a specific external user */ public CompletableFuture>> list( - DeployedTriggersListRequest request, RequestOptions requestOptions) { + ListDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -103,12 +103,13 @@ public CompletableFuture>> li @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetTriggersResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggersResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggersResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - DeployedTriggersListRequest nextRequest = DeployedTriggersListRequest.builder() + ListDeployedTriggersRequest nextRequest = ListDeployedTriggersRequest.builder() .from(request) .after(startingAfter) .build(); @@ -127,7 +128,6 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -137,11 +137,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -160,7 +158,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get details of a specific deployed trigger by its ID */ public CompletableFuture> retrieve( - String triggerId, DeployedTriggersRetrieveRequest request) { + String triggerId, RetrieveDeployedTriggersRequest request) { return retrieve(triggerId, request, null); } @@ -168,7 +166,7 @@ public CompletableFuture> retrieve( * Get details of a specific deployed trigger by its ID */ public CompletableFuture> retrieve( - String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { + String triggerId, RetrieveDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -191,13 +189,13 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerResponse.class); future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -207,11 +205,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -268,13 +264,13 @@ public CompletableFuture> update( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerResponse.class); future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -284,11 +280,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -307,7 +301,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Remove a deployed trigger and stop receiving events */ public CompletableFuture> delete( - String triggerId, DeployedTriggersDeleteRequest request) { + String triggerId, DeleteDeployedTriggersRequest request) { return delete(triggerId, request, null); } @@ -315,7 +309,7 @@ public CompletableFuture> delete( * Remove a deployed trigger and stop receiving events */ public CompletableFuture> delete( - String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { + String triggerId, DeleteDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -356,11 +350,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -379,7 +371,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Retrieve recent events emitted by a deployed trigger */ public CompletableFuture>> listEvents( - String triggerId, DeployedTriggersListEventsRequest request) { + String triggerId, ListEventsDeployedTriggersRequest request) { return listEvents(triggerId, request, null); } @@ -387,7 +379,7 @@ public CompletableFuture>> listEvents( * Retrieve recent events emitted by a deployed trigger */ public CompletableFuture>> listEvents( - String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { + String triggerId, ListEventsDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -414,13 +406,13 @@ public CompletableFuture>> listEvents( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - GetTriggerEventsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), GetTriggerEventsResponse.class); + GetTriggerEventsResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerEventsResponse.class); future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -430,11 +422,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -453,7 +443,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get workflows connected to receive events from this trigger */ public CompletableFuture> listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request) { + String triggerId, ListWorkflowsDeployedTriggersRequest request) { return listWorkflows(triggerId, request, null); } @@ -461,7 +451,7 @@ public CompletableFuture> li * Get workflows connected to receive events from this trigger */ public CompletableFuture> listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { + String triggerId, ListWorkflowsDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -485,14 +475,14 @@ public CompletableFuture> li @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), GetTriggerWorkflowsResponse.class), + responseBodyString, GetTriggerWorkflowsResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -502,11 +492,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -565,14 +553,14 @@ public CompletableFuture> up @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), GetTriggerWorkflowsResponse.class), + responseBodyString, GetTriggerWorkflowsResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -582,11 +570,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -605,7 +591,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get webhook URLs configured to receive trigger events */ public CompletableFuture> listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request) { + String triggerId, ListWebhooksDeployedTriggersRequest request) { return listWebhooks(triggerId, request, null); } @@ -613,7 +599,7 @@ public CompletableFuture> lis * Get webhook URLs configured to receive trigger events */ public CompletableFuture> listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { + String triggerId, ListWebhooksDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -637,14 +623,14 @@ public CompletableFuture> lis @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), GetTriggerWebhooksResponse.class), + responseBodyString, GetTriggerWebhooksResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -654,11 +640,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -717,14 +701,14 @@ public CompletableFuture> upd @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), GetTriggerWebhooksResponse.class), + responseBodyString, GetTriggerWebhooksResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -734,11 +718,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/DeployedTriggersClient.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/DeployedTriggersClient.java index 514556e..28c08e2 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/DeployedTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/DeployedTriggersClient.java @@ -6,12 +6,12 @@ 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.DeleteDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListEventsDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListWebhooksDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListWorkflowsDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.RetrieveDeployedTriggersRequest; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWebhooksOpts; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWorkflowsOpts; @@ -41,28 +41,28 @@ public RawDeployedTriggersClient withRawResponse() { /** * Retrieve all deployed triggers for a specific external user */ - public SyncPagingIterable list(DeployedTriggersListRequest request) { + public SyncPagingIterable list(ListDeployedTriggersRequest request) { return this.rawClient.list(request).body(); } /** * Retrieve all deployed triggers for a specific external user */ - public SyncPagingIterable list(DeployedTriggersListRequest request, RequestOptions requestOptions) { + public SyncPagingIterable list(ListDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } /** * Get details of a specific deployed trigger by its ID */ - public Emitter retrieve(String triggerId, DeployedTriggersRetrieveRequest request) { + public Emitter retrieve(String triggerId, RetrieveDeployedTriggersRequest request) { return this.rawClient.retrieve(triggerId, request).body(); } /** * Get details of a specific deployed trigger by its ID */ - public Emitter retrieve(String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { + public Emitter retrieve(String triggerId, RetrieveDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(triggerId, request, requestOptions).body(); } @@ -83,21 +83,21 @@ public Emitter update(String triggerId, UpdateTriggerOpts request, RequestOption /** * Remove a deployed trigger and stop receiving events */ - public void delete(String triggerId, DeployedTriggersDeleteRequest request) { + public void delete(String triggerId, DeleteDeployedTriggersRequest request) { this.rawClient.delete(triggerId, request).body(); } /** * Remove a deployed trigger and stop receiving events */ - public void delete(String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { + public void delete(String triggerId, DeleteDeployedTriggersRequest request, RequestOptions requestOptions) { this.rawClient.delete(triggerId, request, requestOptions).body(); } /** * Retrieve recent events emitted by a deployed trigger */ - public List listEvents(String triggerId, DeployedTriggersListEventsRequest request) { + public List listEvents(String triggerId, ListEventsDeployedTriggersRequest request) { return this.rawClient.listEvents(triggerId, request).body(); } @@ -105,14 +105,14 @@ public List listEvents(String triggerId, DeployedTriggersListEvent * Retrieve recent events emitted by a deployed trigger */ public List listEvents( - String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { + String triggerId, ListEventsDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.listEvents(triggerId, request, requestOptions).body(); } /** * Get workflows connected to receive events from this trigger */ - public GetTriggerWorkflowsResponse listWorkflows(String triggerId, DeployedTriggersListWorkflowsRequest request) { + public GetTriggerWorkflowsResponse listWorkflows(String triggerId, ListWorkflowsDeployedTriggersRequest request) { return this.rawClient.listWorkflows(triggerId, request).body(); } @@ -120,7 +120,7 @@ public GetTriggerWorkflowsResponse listWorkflows(String triggerId, DeployedTrigg * Get workflows connected to receive events from this trigger */ public GetTriggerWorkflowsResponse listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { + String triggerId, ListWorkflowsDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.listWorkflows(triggerId, request, requestOptions).body(); } @@ -144,7 +144,7 @@ public GetTriggerWorkflowsResponse updateWorkflows( /** * Get webhook URLs configured to receive trigger events */ - public GetTriggerWebhooksResponse listWebhooks(String triggerId, DeployedTriggersListWebhooksRequest request) { + public GetTriggerWebhooksResponse listWebhooks(String triggerId, ListWebhooksDeployedTriggersRequest request) { return this.rawClient.listWebhooks(triggerId, request).body(); } @@ -152,7 +152,7 @@ public GetTriggerWebhooksResponse listWebhooks(String triggerId, DeployedTrigger * Get webhook URLs configured to receive trigger events */ public GetTriggerWebhooksResponse listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { + String triggerId, ListWebhooksDeployedTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.listWebhooks(triggerId, request, requestOptions).body(); } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java index f5f5117..3b31675 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java @@ -14,12 +14,12 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; -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.DeleteDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListEventsDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListWebhooksDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.ListWorkflowsDeployedTriggersRequest; +import com.pipedream.api.resources.deployedtriggers.requests.RetrieveDeployedTriggersRequest; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWebhooksOpts; import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerWorkflowsOpts; @@ -51,7 +51,7 @@ public RawDeployedTriggersClient(ClientOptions clientOptions) { /** * Retrieve all deployed triggers for a specific external user */ - public BaseClientHttpResponse> list(DeployedTriggersListRequest request) { + public BaseClientHttpResponse> list(ListDeployedTriggersRequest request) { return list(request, null); } @@ -59,7 +59,7 @@ public BaseClientHttpResponse> list(DeployedTriggers * Retrieve all deployed triggers for a specific external user */ public BaseClientHttpResponse> list( - DeployedTriggersListRequest request, RequestOptions requestOptions) { + ListDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -94,11 +94,12 @@ public BaseClientHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetTriggersResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggersResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggersResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - DeployedTriggersListRequest nextRequest = DeployedTriggersListRequest.builder() + ListDeployedTriggersRequest nextRequest = ListDeployedTriggersRequest.builder() .from(request) .after(startingAfter) .build(); @@ -109,7 +110,6 @@ public BaseClientHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -118,11 +118,9 @@ public BaseClientHttpResponse> list( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -131,7 +129,7 @@ public BaseClientHttpResponse> list( /** * Get details of a specific deployed trigger by its ID */ - public BaseClientHttpResponse retrieve(String triggerId, DeployedTriggersRetrieveRequest request) { + public BaseClientHttpResponse retrieve(String triggerId, RetrieveDeployedTriggersRequest request) { return retrieve(triggerId, request, null); } @@ -139,7 +137,7 @@ public BaseClientHttpResponse retrieve(String triggerId, DeployedTrigge * Get details of a specific deployed trigger by its ID */ public BaseClientHttpResponse retrieve( - String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { + String triggerId, RetrieveDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -159,12 +157,12 @@ public BaseClientHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerResponse.class); return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -173,11 +171,9 @@ public BaseClientHttpResponse retrieve( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -222,12 +218,12 @@ public BaseClientHttpResponse update( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerResponse.class); return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -236,11 +232,9 @@ public BaseClientHttpResponse update( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -249,7 +243,7 @@ public BaseClientHttpResponse update( /** * Remove a deployed trigger and stop receiving events */ - public BaseClientHttpResponse delete(String triggerId, DeployedTriggersDeleteRequest request) { + public BaseClientHttpResponse delete(String triggerId, DeleteDeployedTriggersRequest request) { return delete(triggerId, request, null); } @@ -257,7 +251,7 @@ public BaseClientHttpResponse delete(String triggerId, DeployedTriggersDel * Remove a deployed trigger and stop receiving events */ public BaseClientHttpResponse delete( - String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { + String triggerId, DeleteDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -293,11 +287,9 @@ public BaseClientHttpResponse delete( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -307,7 +299,7 @@ public BaseClientHttpResponse delete( * Retrieve recent events emitted by a deployed trigger */ public BaseClientHttpResponse> listEvents( - String triggerId, DeployedTriggersListEventsRequest request) { + String triggerId, ListEventsDeployedTriggersRequest request) { return listEvents(triggerId, request, null); } @@ -315,7 +307,7 @@ public BaseClientHttpResponse> listEvents( * Retrieve recent events emitted by a deployed trigger */ public BaseClientHttpResponse> listEvents( - String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { + String triggerId, ListEventsDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -339,12 +331,12 @@ public BaseClientHttpResponse> listEvents( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetTriggerEventsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerEventsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerEventsResponse.class); return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -353,11 +345,9 @@ public BaseClientHttpResponse> listEvents( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -367,7 +357,7 @@ public BaseClientHttpResponse> listEvents( * Get workflows connected to receive events from this trigger */ public BaseClientHttpResponse listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request) { + String triggerId, ListWorkflowsDeployedTriggersRequest request) { return listWorkflows(triggerId, request, null); } @@ -375,7 +365,7 @@ public BaseClientHttpResponse listWorkflows( * Get workflows connected to receive events from this trigger */ public BaseClientHttpResponse listWorkflows( - String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { + String triggerId, ListWorkflowsDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -396,12 +386,12 @@ public BaseClientHttpResponse listWorkflows( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWorkflowsResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerWorkflowsResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -410,11 +400,9 @@ public BaseClientHttpResponse listWorkflows( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -461,12 +449,12 @@ public BaseClientHttpResponse updateWorkflows( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWorkflowsResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerWorkflowsResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -475,11 +463,9 @@ public BaseClientHttpResponse updateWorkflows( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -489,7 +475,7 @@ public BaseClientHttpResponse updateWorkflows( * Get webhook URLs configured to receive trigger events */ public BaseClientHttpResponse listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request) { + String triggerId, ListWebhooksDeployedTriggersRequest request) { return listWebhooks(triggerId, request, null); } @@ -497,7 +483,7 @@ public BaseClientHttpResponse listWebhooks( * Get webhook URLs configured to receive trigger events */ public BaseClientHttpResponse listWebhooks( - String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { + String triggerId, ListWebhooksDeployedTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -518,12 +504,12 @@ public BaseClientHttpResponse listWebhooks( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWebhooksResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerWebhooksResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -532,11 +518,9 @@ public BaseClientHttpResponse listWebhooks( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -583,12 +567,12 @@ public BaseClientHttpResponse updateWebhooks( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWebhooksResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetTriggerWebhooksResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -597,11 +581,9 @@ public BaseClientHttpResponse updateWebhooks( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersDeleteRequest.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeleteDeployedTriggersRequest.java similarity index 88% rename from src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersDeleteRequest.java rename to src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeleteDeployedTriggersRequest.java index 3989d6e..c73e51e 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersDeleteRequest.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeleteDeployedTriggersRequest.java @@ -19,15 +19,15 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersDeleteRequest.Builder.class) -public final class DeployedTriggersDeleteRequest { +@JsonDeserialize(builder = DeleteDeployedTriggersRequest.Builder.class) +public final class DeleteDeployedTriggersRequest { private final String externalUserId; private final Optional ignoreHookErrors; private final Map additionalProperties; - private DeployedTriggersDeleteRequest( + private DeleteDeployedTriggersRequest( String externalUserId, Optional ignoreHookErrors, Map additionalProperties) { this.externalUserId = externalUserId; this.ignoreHookErrors = ignoreHookErrors; @@ -53,7 +53,7 @@ public Optional getIgnoreHookErrors() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeployedTriggersDeleteRequest && equalTo((DeployedTriggersDeleteRequest) other); + return other instanceof DeleteDeployedTriggersRequest && equalTo((DeleteDeployedTriggersRequest) other); } @JsonAnyGetter @@ -61,7 +61,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeployedTriggersDeleteRequest other) { + private boolean equalTo(DeleteDeployedTriggersRequest other) { return externalUserId.equals(other.externalUserId) && ignoreHookErrors.equals(other.ignoreHookErrors); } @@ -85,11 +85,11 @@ public interface ExternalUserIdStage { */ _FinalStage externalUserId(@NotNull String externalUserId); - Builder from(DeployedTriggersDeleteRequest other); + Builder from(DeleteDeployedTriggersRequest other); } public interface _FinalStage { - DeployedTriggersDeleteRequest build(); + DeleteDeployedTriggersRequest build(); /** *

Whether to ignore errors during deactivation hook

@@ -111,7 +111,7 @@ public static final class Builder implements ExternalUserIdStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(DeployedTriggersDeleteRequest other) { + public Builder from(DeleteDeployedTriggersRequest other) { externalUserId(other.getExternalUserId()); ignoreHookErrors(other.getIgnoreHookErrors()); return this; @@ -150,8 +150,8 @@ public _FinalStage ignoreHookErrors(Optional ignoreHookErrors) { } @java.lang.Override - public DeployedTriggersDeleteRequest build() { - return new DeployedTriggersDeleteRequest(externalUserId, ignoreHookErrors, additionalProperties); + public DeleteDeployedTriggersRequest build() { + return new DeleteDeployedTriggersRequest(externalUserId, ignoreHookErrors, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListRequest.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListDeployedTriggersRequest.java similarity index 93% rename from src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListRequest.java rename to src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListDeployedTriggersRequest.java index 28d94a0..21555ff 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListRequest.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListDeployedTriggersRequest.java @@ -20,8 +20,8 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersListRequest.Builder.class) -public final class DeployedTriggersListRequest { +@JsonDeserialize(builder = ListDeployedTriggersRequest.Builder.class) +public final class ListDeployedTriggersRequest { private final Optional after; private final Optional before; @@ -34,7 +34,7 @@ public final class DeployedTriggersListRequest { private final Map additionalProperties; - private DeployedTriggersListRequest( + private ListDeployedTriggersRequest( Optional after, Optional before, Optional limit, @@ -92,7 +92,7 @@ public Optional getEmitterType() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeployedTriggersListRequest && equalTo((DeployedTriggersListRequest) other); + return other instanceof ListDeployedTriggersRequest && equalTo((ListDeployedTriggersRequest) other); } @JsonAnyGetter @@ -100,7 +100,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeployedTriggersListRequest other) { + private boolean equalTo(ListDeployedTriggersRequest other) { return after.equals(other.after) && before.equals(other.before) && limit.equals(other.limit) @@ -128,11 +128,11 @@ public interface ExternalUserIdStage { */ _FinalStage externalUserId(@NotNull String externalUserId); - Builder from(DeployedTriggersListRequest other); + Builder from(ListDeployedTriggersRequest other); } public interface _FinalStage { - DeployedTriggersListRequest build(); + ListDeployedTriggersRequest build(); /** *

The cursor to start from for pagination

@@ -181,7 +181,7 @@ public static final class Builder implements ExternalUserIdStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(DeployedTriggersListRequest other) { + public Builder from(ListDeployedTriggersRequest other) { after(other.getAfter()); before(other.getBefore()); limit(other.getLimit()); @@ -283,8 +283,8 @@ public _FinalStage after(Optional after) { } @java.lang.Override - public DeployedTriggersListRequest build() { - return new DeployedTriggersListRequest( + public ListDeployedTriggersRequest build() { + return new ListDeployedTriggersRequest( after, before, limit, externalUserId, emitterType, additionalProperties); } } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListEventsRequest.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListEventsDeployedTriggersRequest.java similarity index 87% rename from src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListEventsRequest.java rename to src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListEventsDeployedTriggersRequest.java index e3015b2..99b0010 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListEventsRequest.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListEventsDeployedTriggersRequest.java @@ -19,15 +19,15 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersListEventsRequest.Builder.class) -public final class DeployedTriggersListEventsRequest { +@JsonDeserialize(builder = ListEventsDeployedTriggersRequest.Builder.class) +public final class ListEventsDeployedTriggersRequest { private final String externalUserId; private final Optional n; private final Map additionalProperties; - private DeployedTriggersListEventsRequest( + private ListEventsDeployedTriggersRequest( String externalUserId, Optional n, Map additionalProperties) { this.externalUserId = externalUserId; this.n = n; @@ -53,7 +53,7 @@ public Optional getN() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeployedTriggersListEventsRequest && equalTo((DeployedTriggersListEventsRequest) other); + return other instanceof ListEventsDeployedTriggersRequest && equalTo((ListEventsDeployedTriggersRequest) other); } @JsonAnyGetter @@ -61,7 +61,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeployedTriggersListEventsRequest other) { + private boolean equalTo(ListEventsDeployedTriggersRequest other) { return externalUserId.equals(other.externalUserId) && n.equals(other.n); } @@ -85,11 +85,11 @@ public interface ExternalUserIdStage { */ _FinalStage externalUserId(@NotNull String externalUserId); - Builder from(DeployedTriggersListEventsRequest other); + Builder from(ListEventsDeployedTriggersRequest other); } public interface _FinalStage { - DeployedTriggersListEventsRequest build(); + ListEventsDeployedTriggersRequest build(); /** *

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

@@ -111,7 +111,7 @@ public static final class Builder implements ExternalUserIdStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(DeployedTriggersListEventsRequest other) { + public Builder from(ListEventsDeployedTriggersRequest other) { externalUserId(other.getExternalUserId()); n(other.getN()); return this; @@ -150,8 +150,8 @@ public _FinalStage n(Optional n) { } @java.lang.Override - public DeployedTriggersListEventsRequest build() { - return new DeployedTriggersListEventsRequest(externalUserId, n, additionalProperties); + public ListEventsDeployedTriggersRequest build() { + return new ListEventsDeployedTriggersRequest(externalUserId, n, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWebhooksRequest.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListWebhooksDeployedTriggersRequest.java similarity index 82% rename from src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWebhooksRequest.java rename to src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListWebhooksDeployedTriggersRequest.java index 62cf4dd..cf7d057 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWebhooksRequest.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListWebhooksDeployedTriggersRequest.java @@ -17,13 +17,13 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersListWebhooksRequest.Builder.class) -public final class DeployedTriggersListWebhooksRequest { +@JsonDeserialize(builder = ListWebhooksDeployedTriggersRequest.Builder.class) +public final class ListWebhooksDeployedTriggersRequest { private final String externalUserId; private final Map additionalProperties; - private DeployedTriggersListWebhooksRequest(String externalUserId, Map additionalProperties) { + private ListWebhooksDeployedTriggersRequest(String externalUserId, Map additionalProperties) { this.externalUserId = externalUserId; this.additionalProperties = additionalProperties; } @@ -39,8 +39,8 @@ public String getExternalUserId() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeployedTriggersListWebhooksRequest - && equalTo((DeployedTriggersListWebhooksRequest) other); + return other instanceof ListWebhooksDeployedTriggersRequest + && equalTo((ListWebhooksDeployedTriggersRequest) other); } @JsonAnyGetter @@ -48,7 +48,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeployedTriggersListWebhooksRequest other) { + private boolean equalTo(ListWebhooksDeployedTriggersRequest other) { return externalUserId.equals(other.externalUserId); } @@ -72,11 +72,11 @@ public interface ExternalUserIdStage { */ _FinalStage externalUserId(@NotNull String externalUserId); - Builder from(DeployedTriggersListWebhooksRequest other); + Builder from(ListWebhooksDeployedTriggersRequest other); } public interface _FinalStage { - DeployedTriggersListWebhooksRequest build(); + ListWebhooksDeployedTriggersRequest build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -89,7 +89,7 @@ public static final class Builder implements ExternalUserIdStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(DeployedTriggersListWebhooksRequest other) { + public Builder from(ListWebhooksDeployedTriggersRequest other) { externalUserId(other.getExternalUserId()); return this; } @@ -107,8 +107,8 @@ public _FinalStage externalUserId(@NotNull String externalUserId) { } @java.lang.Override - public DeployedTriggersListWebhooksRequest build() { - return new DeployedTriggersListWebhooksRequest(externalUserId, additionalProperties); + public ListWebhooksDeployedTriggersRequest build() { + return new ListWebhooksDeployedTriggersRequest(externalUserId, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWorkflowsRequest.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListWorkflowsDeployedTriggersRequest.java similarity index 82% rename from src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWorkflowsRequest.java rename to src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListWorkflowsDeployedTriggersRequest.java index 95979ed..081740c 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersListWorkflowsRequest.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/ListWorkflowsDeployedTriggersRequest.java @@ -17,13 +17,13 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersListWorkflowsRequest.Builder.class) -public final class DeployedTriggersListWorkflowsRequest { +@JsonDeserialize(builder = ListWorkflowsDeployedTriggersRequest.Builder.class) +public final class ListWorkflowsDeployedTriggersRequest { private final String externalUserId; private final Map additionalProperties; - private DeployedTriggersListWorkflowsRequest(String externalUserId, Map additionalProperties) { + private ListWorkflowsDeployedTriggersRequest(String externalUserId, Map additionalProperties) { this.externalUserId = externalUserId; this.additionalProperties = additionalProperties; } @@ -39,8 +39,8 @@ public String getExternalUserId() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeployedTriggersListWorkflowsRequest - && equalTo((DeployedTriggersListWorkflowsRequest) other); + return other instanceof ListWorkflowsDeployedTriggersRequest + && equalTo((ListWorkflowsDeployedTriggersRequest) other); } @JsonAnyGetter @@ -48,7 +48,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeployedTriggersListWorkflowsRequest other) { + private boolean equalTo(ListWorkflowsDeployedTriggersRequest other) { return externalUserId.equals(other.externalUserId); } @@ -72,11 +72,11 @@ public interface ExternalUserIdStage { */ _FinalStage externalUserId(@NotNull String externalUserId); - Builder from(DeployedTriggersListWorkflowsRequest other); + Builder from(ListWorkflowsDeployedTriggersRequest other); } public interface _FinalStage { - DeployedTriggersListWorkflowsRequest build(); + ListWorkflowsDeployedTriggersRequest build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -89,7 +89,7 @@ public static final class Builder implements ExternalUserIdStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(DeployedTriggersListWorkflowsRequest other) { + public Builder from(ListWorkflowsDeployedTriggersRequest other) { externalUserId(other.getExternalUserId()); return this; } @@ -107,8 +107,8 @@ public _FinalStage externalUserId(@NotNull String externalUserId) { } @java.lang.Override - public DeployedTriggersListWorkflowsRequest build() { - return new DeployedTriggersListWorkflowsRequest(externalUserId, additionalProperties); + public ListWorkflowsDeployedTriggersRequest build() { + return new ListWorkflowsDeployedTriggersRequest(externalUserId, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersRetrieveRequest.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/RetrieveDeployedTriggersRequest.java similarity index 82% rename from src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersRetrieveRequest.java rename to src/main/java/com/pipedream/api/resources/deployedtriggers/requests/RetrieveDeployedTriggersRequest.java index 4aab165..87731c0 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/DeployedTriggersRetrieveRequest.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/requests/RetrieveDeployedTriggersRequest.java @@ -17,13 +17,13 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = DeployedTriggersRetrieveRequest.Builder.class) -public final class DeployedTriggersRetrieveRequest { +@JsonDeserialize(builder = RetrieveDeployedTriggersRequest.Builder.class) +public final class RetrieveDeployedTriggersRequest { private final String externalUserId; private final Map additionalProperties; - private DeployedTriggersRetrieveRequest(String externalUserId, Map additionalProperties) { + private RetrieveDeployedTriggersRequest(String externalUserId, Map additionalProperties) { this.externalUserId = externalUserId; this.additionalProperties = additionalProperties; } @@ -39,7 +39,7 @@ public String getExternalUserId() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof DeployedTriggersRetrieveRequest && equalTo((DeployedTriggersRetrieveRequest) other); + return other instanceof RetrieveDeployedTriggersRequest && equalTo((RetrieveDeployedTriggersRequest) other); } @JsonAnyGetter @@ -47,7 +47,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(DeployedTriggersRetrieveRequest other) { + private boolean equalTo(RetrieveDeployedTriggersRequest other) { return externalUserId.equals(other.externalUserId); } @@ -71,11 +71,11 @@ public interface ExternalUserIdStage { */ _FinalStage externalUserId(@NotNull String externalUserId); - Builder from(DeployedTriggersRetrieveRequest other); + Builder from(RetrieveDeployedTriggersRequest other); } public interface _FinalStage { - DeployedTriggersRetrieveRequest build(); + RetrieveDeployedTriggersRequest build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -88,7 +88,7 @@ public static final class Builder implements ExternalUserIdStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(DeployedTriggersRetrieveRequest other) { + public Builder from(RetrieveDeployedTriggersRequest other) { externalUserId(other.getExternalUserId()); return this; } @@ -106,8 +106,8 @@ public _FinalStage externalUserId(@NotNull String externalUserId) { } @java.lang.Override - public DeployedTriggersRetrieveRequest build() { - return new DeployedTriggersRetrieveRequest(externalUserId, additionalProperties); + public RetrieveDeployedTriggersRequest build() { + return new RetrieveDeployedTriggersRequest(externalUserId, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/filestash/AsyncFileStashClient.java b/src/main/java/com/pipedream/api/resources/filestash/AsyncFileStashClient.java index 40ca561..5caf055 100644 --- a/src/main/java/com/pipedream/api/resources/filestash/AsyncFileStashClient.java +++ b/src/main/java/com/pipedream/api/resources/filestash/AsyncFileStashClient.java @@ -5,7 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.filestash.requests.FileStashDownloadFileRequest; +import com.pipedream.api.resources.filestash.requests.DownloadFileFileStashRequest; import java.io.InputStream; import java.util.concurrent.CompletableFuture; @@ -29,7 +29,7 @@ public AsyncRawFileStashClient withRawResponse() { /** * Download a file from File Stash */ - public CompletableFuture downloadFile(FileStashDownloadFileRequest request) { + public CompletableFuture downloadFile(DownloadFileFileStashRequest request) { return this.rawClient.downloadFile(request).thenApply(response -> response.body()); } @@ -37,7 +37,7 @@ public CompletableFuture downloadFile(FileStashDownloadFileRequest * Download a file from File Stash */ public CompletableFuture downloadFile( - FileStashDownloadFileRequest request, RequestOptions requestOptions) { + DownloadFileFileStashRequest request, RequestOptions requestOptions) { return this.rawClient.downloadFile(request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/filestash/AsyncRawFileStashClient.java b/src/main/java/com/pipedream/api/resources/filestash/AsyncRawFileStashClient.java index aa73f5d..b062e57 100644 --- a/src/main/java/com/pipedream/api/resources/filestash/AsyncRawFileStashClient.java +++ b/src/main/java/com/pipedream/api/resources/filestash/AsyncRawFileStashClient.java @@ -13,7 +13,7 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.ResponseBodyInputStream; import com.pipedream.api.errors.TooManyRequestsError; -import com.pipedream.api.resources.filestash.requests.FileStashDownloadFileRequest; +import com.pipedream.api.resources.filestash.requests.DownloadFileFileStashRequest; import java.io.IOException; import java.io.InputStream; import java.util.concurrent.CompletableFuture; @@ -37,7 +37,7 @@ public AsyncRawFileStashClient(ClientOptions clientOptions) { /** * Download a file from File Stash */ - public CompletableFuture> downloadFile(FileStashDownloadFileRequest request) { + public CompletableFuture> downloadFile(DownloadFileFileStashRequest request) { return downloadFile(request, null); } @@ -45,12 +45,13 @@ public CompletableFuture> downloadFile(FileS * Download a file from File Stash */ public CompletableFuture> downloadFile( - FileStashDownloadFileRequest request, RequestOptions requestOptions) { + DownloadFileFileStashRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("file_stash/download"); + .addPathSegments("file_stash") + .addPathSegments("download"); QueryStringMapper.addQueryParameter(httpUrl, "s3_key", request.getS3Key(), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) @@ -82,11 +83,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/filestash/FileStashClient.java b/src/main/java/com/pipedream/api/resources/filestash/FileStashClient.java index 3e08288..2197b28 100644 --- a/src/main/java/com/pipedream/api/resources/filestash/FileStashClient.java +++ b/src/main/java/com/pipedream/api/resources/filestash/FileStashClient.java @@ -5,7 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; -import com.pipedream.api.resources.filestash.requests.FileStashDownloadFileRequest; +import com.pipedream.api.resources.filestash.requests.DownloadFileFileStashRequest; import java.io.InputStream; public class FileStashClient { @@ -28,14 +28,14 @@ public RawFileStashClient withRawResponse() { /** * Download a file from File Stash */ - public InputStream downloadFile(FileStashDownloadFileRequest request) { + public InputStream downloadFile(DownloadFileFileStashRequest request) { return this.rawClient.downloadFile(request).body(); } /** * Download a file from File Stash */ - public InputStream downloadFile(FileStashDownloadFileRequest request, RequestOptions requestOptions) { + public InputStream downloadFile(DownloadFileFileStashRequest request, RequestOptions requestOptions) { return this.rawClient.downloadFile(request, requestOptions).body(); } } diff --git a/src/main/java/com/pipedream/api/resources/filestash/RawFileStashClient.java b/src/main/java/com/pipedream/api/resources/filestash/RawFileStashClient.java index 2bd5052..afad982 100644 --- a/src/main/java/com/pipedream/api/resources/filestash/RawFileStashClient.java +++ b/src/main/java/com/pipedream/api/resources/filestash/RawFileStashClient.java @@ -13,7 +13,7 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.ResponseBodyInputStream; import com.pipedream.api.errors.TooManyRequestsError; -import com.pipedream.api.resources.filestash.requests.FileStashDownloadFileRequest; +import com.pipedream.api.resources.filestash.requests.DownloadFileFileStashRequest; import java.io.IOException; import java.io.InputStream; import okhttp3.Headers; @@ -33,7 +33,7 @@ public RawFileStashClient(ClientOptions clientOptions) { /** * Download a file from File Stash */ - public BaseClientHttpResponse downloadFile(FileStashDownloadFileRequest request) { + public BaseClientHttpResponse downloadFile(DownloadFileFileStashRequest request) { return downloadFile(request, null); } @@ -41,12 +41,13 @@ public BaseClientHttpResponse downloadFile(FileStashDownloadFileReq * Download a file from File Stash */ public BaseClientHttpResponse downloadFile( - FileStashDownloadFileRequest request, RequestOptions requestOptions) { + DownloadFileFileStashRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("file_stash/download"); + .addPathSegments("file_stash") + .addPathSegments("download"); QueryStringMapper.addQueryParameter(httpUrl, "s3_key", request.getS3Key(), false); Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) @@ -73,11 +74,9 @@ public BaseClientHttpResponse downloadFile( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/filestash/requests/FileStashDownloadFileRequest.java b/src/main/java/com/pipedream/api/resources/filestash/requests/DownloadFileFileStashRequest.java similarity index 79% rename from src/main/java/com/pipedream/api/resources/filestash/requests/FileStashDownloadFileRequest.java rename to src/main/java/com/pipedream/api/resources/filestash/requests/DownloadFileFileStashRequest.java index f85c1ab..a79be23 100644 --- a/src/main/java/com/pipedream/api/resources/filestash/requests/FileStashDownloadFileRequest.java +++ b/src/main/java/com/pipedream/api/resources/filestash/requests/DownloadFileFileStashRequest.java @@ -17,13 +17,13 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = FileStashDownloadFileRequest.Builder.class) -public final class FileStashDownloadFileRequest { +@JsonDeserialize(builder = DownloadFileFileStashRequest.Builder.class) +public final class DownloadFileFileStashRequest { private final String s3Key; private final Map additionalProperties; - private FileStashDownloadFileRequest(String s3Key, Map additionalProperties) { + private DownloadFileFileStashRequest(String s3Key, Map additionalProperties) { this.s3Key = s3Key; this.additionalProperties = additionalProperties; } @@ -36,7 +36,7 @@ public String getS3Key() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof FileStashDownloadFileRequest && equalTo((FileStashDownloadFileRequest) other); + return other instanceof DownloadFileFileStashRequest && equalTo((DownloadFileFileStashRequest) other); } @JsonAnyGetter @@ -44,7 +44,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(FileStashDownloadFileRequest other) { + private boolean equalTo(DownloadFileFileStashRequest other) { return s3Key.equals(other.s3Key); } @@ -65,11 +65,11 @@ public static S3KeyStage builder() { public interface S3KeyStage { _FinalStage s3Key(@NotNull String s3Key); - Builder from(FileStashDownloadFileRequest other); + Builder from(DownloadFileFileStashRequest other); } public interface _FinalStage { - FileStashDownloadFileRequest build(); + DownloadFileFileStashRequest build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -82,7 +82,7 @@ public static final class Builder implements S3KeyStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(FileStashDownloadFileRequest other) { + public Builder from(DownloadFileFileStashRequest other) { s3Key(other.getS3Key()); return this; } @@ -95,8 +95,8 @@ public _FinalStage s3Key(@NotNull String s3Key) { } @java.lang.Override - public FileStashDownloadFileRequest build() { - return new FileStashDownloadFileRequest(s3Key, additionalProperties); + public DownloadFileFileStashRequest build() { + return new DownloadFileFileStashRequest(s3Key, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java b/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java index a922464..1632abd 100644 --- a/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java @@ -72,19 +72,16 @@ public CompletableFuture> creat @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), CreateOAuthTokenResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateOAuthTokenResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java b/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java index 23a1d85..9e8e254 100644 --- a/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java @@ -65,17 +65,15 @@ public BaseClientHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateOAuthTokenResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateOAuthTokenResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/projects/AsyncProjectsClient.java b/src/main/java/com/pipedream/api/resources/projects/AsyncProjectsClient.java index c1ad53f..bbe8604 100644 --- a/src/main/java/com/pipedream/api/resources/projects/AsyncProjectsClient.java +++ b/src/main/java/com/pipedream/api/resources/projects/AsyncProjectsClient.java @@ -5,6 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.resources.projects.requests.RetrieveInfoProjectsRequest; import com.pipedream.api.types.ProjectInfoResponse; import java.util.concurrent.CompletableFuture; @@ -35,7 +36,15 @@ public CompletableFuture retrieveInfo() { /** * Retrieve project configuration and environment details */ - public CompletableFuture retrieveInfo(RequestOptions requestOptions) { - return this.rawClient.retrieveInfo(requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieveInfo(RetrieveInfoProjectsRequest request) { + return this.rawClient.retrieveInfo(request).thenApply(response -> response.body()); + } + + /** + * Retrieve project configuration and environment details + */ + public CompletableFuture retrieveInfo( + RetrieveInfoProjectsRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieveInfo(request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java b/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java index f3e1636..92c8c4d 100644 --- a/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java +++ b/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java @@ -11,6 +11,7 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.errors.TooManyRequestsError; +import com.pipedream.api.resources.projects.requests.RetrieveInfoProjectsRequest; import com.pipedream.api.types.ProjectInfoResponse; import java.io.IOException; import java.util.concurrent.CompletableFuture; @@ -35,25 +36,35 @@ public AsyncRawProjectsClient(ClientOptions clientOptions) { * Retrieve project configuration and environment details */ public CompletableFuture> retrieveInfo() { - return retrieveInfo(null); + return retrieveInfo(RetrieveInfoProjectsRequest.builder().build()); } /** * Retrieve project configuration and environment details */ - public CompletableFuture> retrieveInfo(RequestOptions requestOptions) { + public CompletableFuture> retrieveInfo( + RetrieveInfoProjectsRequest request) { + return retrieveInfo(request, null); + } + + /** + * Retrieve project configuration and environment details + */ + public CompletableFuture> retrieveInfo( + RetrieveInfoProjectsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("projects/info") + .addPathSegments("projects") + .addPathSegments("info") .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -63,13 +74,13 @@ public CompletableFuture> retrieveIn @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ProjectInfoResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProjectInfoResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -79,11 +90,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/projects/ProjectsClient.java b/src/main/java/com/pipedream/api/resources/projects/ProjectsClient.java index 5eb85cb..52a9965 100644 --- a/src/main/java/com/pipedream/api/resources/projects/ProjectsClient.java +++ b/src/main/java/com/pipedream/api/resources/projects/ProjectsClient.java @@ -5,6 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.resources.projects.requests.RetrieveInfoProjectsRequest; import com.pipedream.api.types.ProjectInfoResponse; public class ProjectsClient { @@ -34,7 +35,14 @@ public ProjectInfoResponse retrieveInfo() { /** * Retrieve project configuration and environment details */ - public ProjectInfoResponse retrieveInfo(RequestOptions requestOptions) { - return this.rawClient.retrieveInfo(requestOptions).body(); + public ProjectInfoResponse retrieveInfo(RetrieveInfoProjectsRequest request) { + return this.rawClient.retrieveInfo(request).body(); + } + + /** + * Retrieve project configuration and environment details + */ + public ProjectInfoResponse retrieveInfo(RetrieveInfoProjectsRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieveInfo(request, requestOptions).body(); } } diff --git a/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java b/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java index d067eb7..60978c7 100644 --- a/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java +++ b/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java @@ -11,6 +11,7 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.errors.TooManyRequestsError; +import com.pipedream.api.resources.projects.requests.RetrieveInfoProjectsRequest; import com.pipedream.api.types.ProjectInfoResponse; import java.io.IOException; import okhttp3.Headers; @@ -31,37 +32,45 @@ public RawProjectsClient(ClientOptions clientOptions) { * Retrieve project configuration and environment details */ public BaseClientHttpResponse retrieveInfo() { - return retrieveInfo(null); + return retrieveInfo(RetrieveInfoProjectsRequest.builder().build()); } /** * Retrieve project configuration and environment details */ - public BaseClientHttpResponse retrieveInfo(RequestOptions requestOptions) { + public BaseClientHttpResponse retrieveInfo(RetrieveInfoProjectsRequest request) { + return retrieveInfo(request, null); + } + + /** + * Retrieve project configuration and environment details + */ + public BaseClientHttpResponse retrieveInfo( + RetrieveInfoProjectsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("projects/info") + .addPathSegments("projects") + .addPathSegments("info") .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .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(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ProjectInfoResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ProjectInfoResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -70,11 +79,9 @@ public BaseClientHttpResponse retrieveInfo(RequestOptions r } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/projects/requests/RetrieveInfoProjectsRequest.java b/src/main/java/com/pipedream/api/resources/projects/requests/RetrieveInfoProjectsRequest.java new file mode 100644 index 0000000..0baeba9 --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/projects/requests/RetrieveInfoProjectsRequest.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.resources.projects.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.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RetrieveInfoProjectsRequest.Builder.class) +public final class RetrieveInfoProjectsRequest { + private final Map additionalProperties; + + private RetrieveInfoProjectsRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RetrieveInfoProjectsRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RetrieveInfoProjectsRequest other) { + return this; + } + + public RetrieveInfoProjectsRequest build() { + return new RetrieveInfoProjectsRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java b/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java index 74bc677..9da3897 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java +++ b/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java @@ -12,13 +12,15 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.core.ResponseBodyInputStream; import com.pipedream.api.errors.TooManyRequestsError; -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 com.pipedream.api.resources.proxy.requests.DeleteProxyRequest; +import com.pipedream.api.resources.proxy.requests.GetProxyRequest; +import com.pipedream.api.resources.proxy.requests.PatchProxyRequest; +import com.pipedream.api.resources.proxy.requests.PostProxyRequest; +import com.pipedream.api.resources.proxy.requests.PutProxyRequest; import java.io.IOException; +import java.io.InputStream; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -41,15 +43,15 @@ public AsyncRawProxyClient(ClientOptions clientOptions) { /** * Forward an authenticated GET request to an external API using an external user's account credentials */ - public CompletableFuture> get(String url64, ProxyGetRequest request) { + public CompletableFuture> get(String url64, GetProxyRequest request) { return get(url64, request, null); } /** * Forward an authenticated GET request to an external API using an external user's account credentials */ - public CompletableFuture> get( - String url64, ProxyGetRequest request, RequestOptions requestOptions) { + public CompletableFuture> get( + String url64, GetProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -68,14 +70,14 @@ public CompletableFuture> get( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { + try { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); + future.complete(new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -88,11 +90,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -110,15 +110,15 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Forward an authenticated POST request to an external API using an external user's account credentials */ - public CompletableFuture> post(String url64, ProxyPostRequest request) { + public CompletableFuture> post(String url64, PostProxyRequest request) { return post(url64, request, null); } /** * Forward an authenticated POST request to an external API using an external user's account credentials */ - public CompletableFuture> post( - String url64, ProxyPostRequest request, RequestOptions requestOptions) { + public CompletableFuture> post( + String url64, PostProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -145,14 +145,14 @@ public CompletableFuture> post( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { + try { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); + future.complete(new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -165,11 +165,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -187,15 +185,15 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Forward an authenticated PUT request to an external API using an external user's account credentials */ - public CompletableFuture> put(String url64, ProxyPutRequest request) { + public CompletableFuture> put(String url64, PutProxyRequest request) { return put(url64, request, null); } /** * Forward an authenticated PUT request to an external API using an external user's account credentials */ - public CompletableFuture> put( - String url64, ProxyPutRequest request, RequestOptions requestOptions) { + public CompletableFuture> put( + String url64, PutProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -222,14 +220,14 @@ public CompletableFuture> put( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { + try { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); + future.complete(new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -242,11 +240,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -264,15 +260,15 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Forward an authenticated DELETE request to an external API using an external user's account credentials */ - public CompletableFuture> delete(String url64, ProxyDeleteRequest request) { + public CompletableFuture> delete(String url64, DeleteProxyRequest request) { return delete(url64, request, null); } /** * Forward an authenticated DELETE request to an external API using an external user's account credentials */ - public CompletableFuture> delete( - String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { + public CompletableFuture> delete( + String url64, DeleteProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -291,14 +287,14 @@ public CompletableFuture> delete( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { + try { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); + future.complete(new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -311,11 +307,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -333,15 +327,15 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Forward an authenticated PATCH request to an external API using an external user's account credentials */ - public CompletableFuture> patch(String url64, ProxyPatchRequest request) { + public CompletableFuture> patch(String url64, PatchProxyRequest request) { return patch(url64, request, null); } /** * Forward an authenticated PATCH request to an external API using an external user's account credentials */ - public CompletableFuture> patch( - String url64, ProxyPatchRequest request, RequestOptions requestOptions) { + public CompletableFuture> patch( + String url64, PatchProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -368,14 +362,14 @@ public CompletableFuture> patch( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { - try (ResponseBody responseBody = response.body()) { + try { + ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Object.class), response)); + future.complete(new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; @@ -388,11 +382,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java b/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java index 1388ed6..cc7212a 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java +++ b/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java @@ -12,13 +12,15 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.core.ResponseBodyInputStream; import com.pipedream.api.errors.TooManyRequestsError; -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 com.pipedream.api.resources.proxy.requests.DeleteProxyRequest; +import com.pipedream.api.resources.proxy.requests.GetProxyRequest; +import com.pipedream.api.resources.proxy.requests.PatchProxyRequest; +import com.pipedream.api.resources.proxy.requests.PostProxyRequest; +import com.pipedream.api.resources.proxy.requests.PutProxyRequest; import java.io.IOException; +import java.io.InputStream; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -37,14 +39,15 @@ public RawProxyClient(ClientOptions clientOptions) { /** * Forward an authenticated GET request to an external API using an external user's account credentials */ - public BaseClientHttpResponse get(String url64, ProxyGetRequest request) { + public BaseClientHttpResponse get(String url64, GetProxyRequest request) { return get(url64, request, null); } /** * Forward an authenticated GET request to an external API using an external user's account credentials */ - public BaseClientHttpResponse get(String url64, ProxyGetRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse get( + String url64, GetProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -63,11 +66,11 @@ public BaseClientHttpResponse get(String url64, ProxyGetRequest request, if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - try (Response response = client.newCall(okhttpRequest).execute()) { + 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); + return new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { @@ -78,11 +81,9 @@ public BaseClientHttpResponse get(String url64, ProxyGetRequest request, } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -91,14 +92,15 @@ public BaseClientHttpResponse get(String url64, ProxyGetRequest request, /** * Forward an authenticated POST request to an external API using an external user's account credentials */ - public BaseClientHttpResponse post(String url64, ProxyPostRequest request) { + public BaseClientHttpResponse post(String url64, PostProxyRequest request) { return post(url64, request, null); } /** * Forward an authenticated POST request to an external API using an external user's account credentials */ - public BaseClientHttpResponse post(String url64, ProxyPostRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse post( + String url64, PostProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -125,11 +127,11 @@ public BaseClientHttpResponse post(String url64, ProxyPostRequest reques if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - try (Response response = client.newCall(okhttpRequest).execute()) { + 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); + return new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { @@ -140,11 +142,9 @@ public BaseClientHttpResponse post(String url64, ProxyPostRequest reques } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -153,14 +153,15 @@ public BaseClientHttpResponse post(String url64, ProxyPostRequest reques /** * Forward an authenticated PUT request to an external API using an external user's account credentials */ - public BaseClientHttpResponse put(String url64, ProxyPutRequest request) { + public BaseClientHttpResponse put(String url64, PutProxyRequest request) { return put(url64, request, null); } /** * Forward an authenticated PUT request to an external API using an external user's account credentials */ - public BaseClientHttpResponse put(String url64, ProxyPutRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse put( + String url64, PutProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -187,11 +188,11 @@ public BaseClientHttpResponse put(String url64, ProxyPutRequest request, if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - try (Response response = client.newCall(okhttpRequest).execute()) { + 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); + return new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { @@ -202,11 +203,9 @@ public BaseClientHttpResponse put(String url64, ProxyPutRequest request, } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -215,15 +214,15 @@ public BaseClientHttpResponse put(String url64, ProxyPutRequest request, /** * Forward an authenticated DELETE request to an external API using an external user's account credentials */ - public BaseClientHttpResponse delete(String url64, ProxyDeleteRequest request) { + public BaseClientHttpResponse delete(String url64, DeleteProxyRequest request) { return delete(url64, request, null); } /** * Forward an authenticated DELETE request to an external API using an external user's account credentials */ - public BaseClientHttpResponse delete( - String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse delete( + String url64, DeleteProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -242,11 +241,11 @@ public BaseClientHttpResponse delete( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - try (Response response = client.newCall(okhttpRequest).execute()) { + 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); + return new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { @@ -257,11 +256,9 @@ public BaseClientHttpResponse delete( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -270,15 +267,15 @@ public BaseClientHttpResponse delete( /** * Forward an authenticated PATCH request to an external API using an external user's account credentials */ - public BaseClientHttpResponse patch(String url64, ProxyPatchRequest request) { + public BaseClientHttpResponse patch(String url64, PatchProxyRequest request) { return patch(url64, request, null); } /** * Forward an authenticated PATCH request to an external API using an external user's account credentials */ - public BaseClientHttpResponse patch( - String url64, ProxyPatchRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse patch( + String url64, PatchProxyRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -305,11 +302,11 @@ public BaseClientHttpResponse patch( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - try (Response response = client.newCall(okhttpRequest).execute()) { + 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); + return new BaseClientHttpResponse<>(new ResponseBodyInputStream(response), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { @@ -320,11 +317,9 @@ public BaseClientHttpResponse patch( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyDeleteRequest.java b/src/main/java/com/pipedream/api/resources/proxy/requests/DeleteProxyRequest.java similarity index 88% rename from src/main/java/com/pipedream/api/resources/proxy/requests/ProxyDeleteRequest.java rename to src/main/java/com/pipedream/api/resources/proxy/requests/DeleteProxyRequest.java index f956f17..413c5b9 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyDeleteRequest.java +++ b/src/main/java/com/pipedream/api/resources/proxy/requests/DeleteProxyRequest.java @@ -17,15 +17,15 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyDeleteRequest.Builder.class) -public final class ProxyDeleteRequest { +@JsonDeserialize(builder = DeleteProxyRequest.Builder.class) +public final class DeleteProxyRequest { private final String externalUserId; private final String accountId; private final Map additionalProperties; - private ProxyDeleteRequest(String externalUserId, String accountId, Map additionalProperties) { + private DeleteProxyRequest(String externalUserId, String accountId, Map additionalProperties) { this.externalUserId = externalUserId; this.accountId = accountId; this.additionalProperties = additionalProperties; @@ -50,7 +50,7 @@ public String getAccountId() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ProxyDeleteRequest && equalTo((ProxyDeleteRequest) other); + return other instanceof DeleteProxyRequest && equalTo((DeleteProxyRequest) other); } @JsonAnyGetter @@ -58,7 +58,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ProxyDeleteRequest other) { + private boolean equalTo(DeleteProxyRequest other) { return externalUserId.equals(other.externalUserId) && accountId.equals(other.accountId); } @@ -82,7 +82,7 @@ public interface ExternalUserIdStage { */ AccountIdStage externalUserId(@NotNull String externalUserId); - Builder from(ProxyDeleteRequest other); + Builder from(DeleteProxyRequest other); } public interface AccountIdStage { @@ -93,7 +93,7 @@ public interface AccountIdStage { } public interface _FinalStage { - ProxyDeleteRequest build(); + DeleteProxyRequest build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -108,7 +108,7 @@ public static final class Builder implements ExternalUserIdStage, AccountIdStage private Builder() {} @java.lang.Override - public Builder from(ProxyDeleteRequest other) { + public Builder from(DeleteProxyRequest other) { externalUserId(other.getExternalUserId()); accountId(other.getAccountId()); return this; @@ -139,8 +139,8 @@ public _FinalStage accountId(@NotNull String accountId) { } @java.lang.Override - public ProxyDeleteRequest build() { - return new ProxyDeleteRequest(externalUserId, accountId, additionalProperties); + public DeleteProxyRequest build() { + return new DeleteProxyRequest(externalUserId, accountId, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyGetRequest.java b/src/main/java/com/pipedream/api/resources/proxy/requests/GetProxyRequest.java similarity index 88% rename from src/main/java/com/pipedream/api/resources/proxy/requests/ProxyGetRequest.java rename to src/main/java/com/pipedream/api/resources/proxy/requests/GetProxyRequest.java index bf09229..70fc394 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyGetRequest.java +++ b/src/main/java/com/pipedream/api/resources/proxy/requests/GetProxyRequest.java @@ -17,15 +17,15 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyGetRequest.Builder.class) -public final class ProxyGetRequest { +@JsonDeserialize(builder = GetProxyRequest.Builder.class) +public final class GetProxyRequest { private final String externalUserId; private final String accountId; private final Map additionalProperties; - private ProxyGetRequest(String externalUserId, String accountId, Map additionalProperties) { + private GetProxyRequest(String externalUserId, String accountId, Map additionalProperties) { this.externalUserId = externalUserId; this.accountId = accountId; this.additionalProperties = additionalProperties; @@ -50,7 +50,7 @@ public String getAccountId() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ProxyGetRequest && equalTo((ProxyGetRequest) other); + return other instanceof GetProxyRequest && equalTo((GetProxyRequest) other); } @JsonAnyGetter @@ -58,7 +58,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ProxyGetRequest other) { + private boolean equalTo(GetProxyRequest other) { return externalUserId.equals(other.externalUserId) && accountId.equals(other.accountId); } @@ -82,7 +82,7 @@ public interface ExternalUserIdStage { */ AccountIdStage externalUserId(@NotNull String externalUserId); - Builder from(ProxyGetRequest other); + Builder from(GetProxyRequest other); } public interface AccountIdStage { @@ -93,7 +93,7 @@ public interface AccountIdStage { } public interface _FinalStage { - ProxyGetRequest build(); + GetProxyRequest build(); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -108,7 +108,7 @@ public static final class Builder implements ExternalUserIdStage, AccountIdStage private Builder() {} @java.lang.Override - public Builder from(ProxyGetRequest other) { + public Builder from(GetProxyRequest other) { externalUserId(other.getExternalUserId()); accountId(other.getAccountId()); return this; @@ -139,8 +139,8 @@ public _FinalStage accountId(@NotNull String accountId) { } @java.lang.Override - public ProxyGetRequest build() { - return new ProxyGetRequest(externalUserId, accountId, additionalProperties); + public GetProxyRequest build() { + return new GetProxyRequest(externalUserId, accountId, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPatchRequest.java b/src/main/java/com/pipedream/api/resources/proxy/requests/PatchProxyRequest.java similarity index 92% rename from src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPatchRequest.java rename to src/main/java/com/pipedream/api/resources/proxy/requests/PatchProxyRequest.java index c221032..afdda5d 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPatchRequest.java +++ b/src/main/java/com/pipedream/api/resources/proxy/requests/PatchProxyRequest.java @@ -19,8 +19,8 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyPatchRequest.Builder.class) -public final class ProxyPatchRequest { +@JsonDeserialize(builder = PatchProxyRequest.Builder.class) +public final class PatchProxyRequest { private final String externalUserId; private final String accountId; @@ -29,7 +29,7 @@ public final class ProxyPatchRequest { private final Map additionalProperties; - private ProxyPatchRequest( + private PatchProxyRequest( String externalUserId, String accountId, Map body, @@ -67,7 +67,7 @@ public Map getBody() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ProxyPatchRequest && equalTo((ProxyPatchRequest) other); + return other instanceof PatchProxyRequest && equalTo((PatchProxyRequest) other); } @JsonAnyGetter @@ -75,7 +75,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ProxyPatchRequest other) { + private boolean equalTo(PatchProxyRequest other) { return externalUserId.equals(other.externalUserId) && accountId.equals(other.accountId) && body.equals(other.body); @@ -101,7 +101,7 @@ public interface ExternalUserIdStage { */ AccountIdStage externalUserId(@NotNull String externalUserId); - Builder from(ProxyPatchRequest other); + Builder from(PatchProxyRequest other); } public interface AccountIdStage { @@ -112,7 +112,7 @@ public interface AccountIdStage { } public interface _FinalStage { - ProxyPatchRequest build(); + PatchProxyRequest build(); /** *

Request body to forward to the target API

@@ -138,7 +138,7 @@ public static final class Builder implements ExternalUserIdStage, AccountIdStage private Builder() {} @java.lang.Override - public Builder from(ProxyPatchRequest other) { + public Builder from(PatchProxyRequest other) { externalUserId(other.getExternalUserId()); accountId(other.getAccountId()); body(other.getBody()); @@ -205,8 +205,8 @@ public _FinalStage body(Map body) { } @java.lang.Override - public ProxyPatchRequest build() { - return new ProxyPatchRequest(externalUserId, accountId, body, additionalProperties); + public PatchProxyRequest build() { + return new PatchProxyRequest(externalUserId, accountId, body, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPostRequest.java b/src/main/java/com/pipedream/api/resources/proxy/requests/PostProxyRequest.java similarity index 92% rename from src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPostRequest.java rename to src/main/java/com/pipedream/api/resources/proxy/requests/PostProxyRequest.java index 3c052fd..2eff131 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPostRequest.java +++ b/src/main/java/com/pipedream/api/resources/proxy/requests/PostProxyRequest.java @@ -19,8 +19,8 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyPostRequest.Builder.class) -public final class ProxyPostRequest { +@JsonDeserialize(builder = PostProxyRequest.Builder.class) +public final class PostProxyRequest { private final String externalUserId; private final String accountId; @@ -29,7 +29,7 @@ public final class ProxyPostRequest { private final Map additionalProperties; - private ProxyPostRequest( + private PostProxyRequest( String externalUserId, String accountId, Map body, @@ -67,7 +67,7 @@ public Map getBody() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ProxyPostRequest && equalTo((ProxyPostRequest) other); + return other instanceof PostProxyRequest && equalTo((PostProxyRequest) other); } @JsonAnyGetter @@ -75,7 +75,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ProxyPostRequest other) { + private boolean equalTo(PostProxyRequest other) { return externalUserId.equals(other.externalUserId) && accountId.equals(other.accountId) && body.equals(other.body); @@ -101,7 +101,7 @@ public interface ExternalUserIdStage { */ AccountIdStage externalUserId(@NotNull String externalUserId); - Builder from(ProxyPostRequest other); + Builder from(PostProxyRequest other); } public interface AccountIdStage { @@ -112,7 +112,7 @@ public interface AccountIdStage { } public interface _FinalStage { - ProxyPostRequest build(); + PostProxyRequest build(); /** *

Request body to forward to the target API

@@ -138,7 +138,7 @@ public static final class Builder implements ExternalUserIdStage, AccountIdStage private Builder() {} @java.lang.Override - public Builder from(ProxyPostRequest other) { + public Builder from(PostProxyRequest other) { externalUserId(other.getExternalUserId()); accountId(other.getAccountId()); body(other.getBody()); @@ -205,8 +205,8 @@ public _FinalStage body(Map body) { } @java.lang.Override - public ProxyPostRequest build() { - return new ProxyPostRequest(externalUserId, accountId, body, additionalProperties); + public PostProxyRequest build() { + return new PostProxyRequest(externalUserId, accountId, body, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPutRequest.java b/src/main/java/com/pipedream/api/resources/proxy/requests/PutProxyRequest.java similarity index 92% rename from src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPutRequest.java rename to src/main/java/com/pipedream/api/resources/proxy/requests/PutProxyRequest.java index 9ba3dc8..54d62c6 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/requests/ProxyPutRequest.java +++ b/src/main/java/com/pipedream/api/resources/proxy/requests/PutProxyRequest.java @@ -19,8 +19,8 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = ProxyPutRequest.Builder.class) -public final class ProxyPutRequest { +@JsonDeserialize(builder = PutProxyRequest.Builder.class) +public final class PutProxyRequest { private final String externalUserId; private final String accountId; @@ -29,7 +29,7 @@ public final class ProxyPutRequest { private final Map additionalProperties; - private ProxyPutRequest( + private PutProxyRequest( String externalUserId, String accountId, Map body, @@ -67,7 +67,7 @@ public Map getBody() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof ProxyPutRequest && equalTo((ProxyPutRequest) other); + return other instanceof PutProxyRequest && equalTo((PutProxyRequest) other); } @JsonAnyGetter @@ -75,7 +75,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(ProxyPutRequest other) { + private boolean equalTo(PutProxyRequest other) { return externalUserId.equals(other.externalUserId) && accountId.equals(other.accountId) && body.equals(other.body); @@ -101,7 +101,7 @@ public interface ExternalUserIdStage { */ AccountIdStage externalUserId(@NotNull String externalUserId); - Builder from(ProxyPutRequest other); + Builder from(PutProxyRequest other); } public interface AccountIdStage { @@ -112,7 +112,7 @@ public interface AccountIdStage { } public interface _FinalStage { - ProxyPutRequest build(); + PutProxyRequest build(); /** *

Request body to forward to the target API

@@ -138,7 +138,7 @@ public static final class Builder implements ExternalUserIdStage, AccountIdStage private Builder() {} @java.lang.Override - public Builder from(ProxyPutRequest other) { + public Builder from(PutProxyRequest other) { externalUserId(other.getExternalUserId()); accountId(other.getAccountId()); body(other.getBody()); @@ -205,8 +205,8 @@ public _FinalStage body(Map body) { } @java.lang.Override - public ProxyPutRequest build() { - return new ProxyPutRequest(externalUserId, accountId, body, additionalProperties); + public PutProxyRequest build() { + return new PutProxyRequest(externalUserId, accountId, body, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java index 5ab836b..e7fbc44 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java @@ -14,7 +14,7 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.errors.TooManyRequestsError; import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; -import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; +import com.pipedream.api.resources.tokens.requests.ValidateTokensRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; import java.io.IOException; @@ -78,13 +78,13 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateTokenResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateTokenResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -94,11 +94,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -117,7 +115,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Confirm the validity of a Connect token */ public CompletableFuture> validate( - String ctok, TokensValidateRequest request) { + String ctok, ValidateTokensRequest request) { return validate(ctok, request, null); } @@ -125,7 +123,7 @@ public CompletableFuture> validate * Confirm the validity of a Connect token */ public CompletableFuture> validate( - String ctok, TokensValidateRequest request, RequestOptions requestOptions) { + String ctok, ValidateTokensRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/tokens") @@ -151,13 +149,13 @@ public CompletableFuture> validate @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ValidateTokenResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ValidateTokenResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -167,11 +165,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java index 4e3f3ff..42a4407 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/AsyncTokensClient.java @@ -6,7 +6,7 @@ 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.resources.tokens.requests.ValidateTokensRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; import java.util.concurrent.CompletableFuture; @@ -45,7 +45,7 @@ public CompletableFuture create(CreateTokenOpts request, Re /** * Confirm the validity of a Connect token */ - public CompletableFuture validate(String ctok, TokensValidateRequest request) { + public CompletableFuture validate(String ctok, ValidateTokensRequest request) { return this.rawClient.validate(ctok, request).thenApply(response -> response.body()); } @@ -53,7 +53,7 @@ public CompletableFuture validate(String ctok, TokensVali * Confirm the validity of a Connect token */ public CompletableFuture validate( - String ctok, TokensValidateRequest request, RequestOptions requestOptions) { + String ctok, ValidateTokensRequest request, RequestOptions requestOptions) { return this.rawClient.validate(ctok, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java index f9414f5..b2cd49d 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java @@ -14,7 +14,7 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.errors.TooManyRequestsError; import com.pipedream.api.resources.tokens.requests.CreateTokenOpts; -import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; +import com.pipedream.api.resources.tokens.requests.ValidateTokensRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; import java.io.IOException; @@ -70,12 +70,11 @@ public BaseClientHttpResponse create(CreateTokenOpts reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateTokenResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateTokenResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -84,11 +83,9 @@ public BaseClientHttpResponse create(CreateTokenOpts reques } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -97,7 +94,7 @@ public BaseClientHttpResponse create(CreateTokenOpts reques /** * Confirm the validity of a Connect token */ - public BaseClientHttpResponse validate(String ctok, TokensValidateRequest request) { + public BaseClientHttpResponse validate(String ctok, ValidateTokensRequest request) { return validate(ctok, request, null); } @@ -105,7 +102,7 @@ public BaseClientHttpResponse validate(String ctok, Token * Confirm the validity of a Connect token */ public BaseClientHttpResponse validate( - String ctok, TokensValidateRequest request, RequestOptions requestOptions) { + String ctok, ValidateTokensRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/tokens") @@ -128,12 +125,11 @@ public BaseClientHttpResponse validate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ValidateTokenResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ValidateTokenResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -142,11 +138,9 @@ public BaseClientHttpResponse validate( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java index 661e9d2..879553b 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/TokensClient.java @@ -6,7 +6,7 @@ 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.resources.tokens.requests.ValidateTokensRequest; import com.pipedream.api.types.CreateTokenResponse; import com.pipedream.api.types.ValidateTokenResponse; @@ -44,14 +44,14 @@ public CreateTokenResponse create(CreateTokenOpts request, RequestOptions reques /** * Confirm the validity of a Connect token */ - public ValidateTokenResponse validate(String ctok, TokensValidateRequest request) { + public ValidateTokenResponse validate(String ctok, ValidateTokensRequest request) { return this.rawClient.validate(ctok, request).body(); } /** * Confirm the validity of a Connect token */ - public ValidateTokenResponse validate(String ctok, TokensValidateRequest request, RequestOptions requestOptions) { + public ValidateTokenResponse validate(String ctok, ValidateTokensRequest request, RequestOptions requestOptions) { return this.rawClient.validate(ctok, request, requestOptions).body(); } } diff --git a/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java b/src/main/java/com/pipedream/api/resources/tokens/requests/ValidateTokensRequest.java similarity index 88% rename from src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java rename to src/main/java/com/pipedream/api/resources/tokens/requests/ValidateTokensRequest.java index dd18fed..5deee53 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/requests/TokensValidateRequest.java +++ b/src/main/java/com/pipedream/api/resources/tokens/requests/ValidateTokensRequest.java @@ -19,15 +19,15 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TokensValidateRequest.Builder.class) -public final class TokensValidateRequest { +@JsonDeserialize(builder = ValidateTokensRequest.Builder.class) +public final class ValidateTokensRequest { private final String appId; private final Optional oauthAppId; private final Map additionalProperties; - private TokensValidateRequest(String appId, Optional oauthAppId, Map additionalProperties) { + private ValidateTokensRequest(String appId, Optional oauthAppId, Map additionalProperties) { this.appId = appId; this.oauthAppId = oauthAppId; this.additionalProperties = additionalProperties; @@ -52,7 +52,7 @@ public Optional getOauthAppId() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TokensValidateRequest && equalTo((TokensValidateRequest) other); + return other instanceof ValidateTokensRequest && equalTo((ValidateTokensRequest) other); } @JsonAnyGetter @@ -60,7 +60,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(TokensValidateRequest other) { + private boolean equalTo(ValidateTokensRequest other) { return appId.equals(other.appId) && oauthAppId.equals(other.oauthAppId); } @@ -84,11 +84,11 @@ public interface AppIdStage { */ _FinalStage appId(@NotNull String appId); - Builder from(TokensValidateRequest other); + Builder from(ValidateTokensRequest other); } public interface _FinalStage { - TokensValidateRequest build(); + ValidateTokensRequest build(); /** *

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

@@ -110,7 +110,7 @@ public static final class Builder implements AppIdStage, _FinalStage { private Builder() {} @java.lang.Override - public Builder from(TokensValidateRequest other) { + public Builder from(ValidateTokensRequest other) { appId(other.getAppId()); oauthAppId(other.getOauthAppId()); return this; @@ -149,8 +149,8 @@ public _FinalStage oauthAppId(Optional oauthAppId) { } @java.lang.Override - public TokensValidateRequest build() { - return new TokensValidateRequest(appId, oauthAppId, additionalProperties); + public ValidateTokensRequest build() { + return new ValidateTokensRequest(appId, oauthAppId, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java b/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java index ddcd859..99f7f5c 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java @@ -14,17 +14,17 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; +import com.pipedream.api.resources.triggers.requests.ConfigurePropTriggersRequest; import com.pipedream.api.resources.triggers.requests.DeployTriggerOpts; -import com.pipedream.api.resources.triggers.requests.TriggersListRequest; -import com.pipedream.api.resources.triggers.requests.TriggersRetrieveRequest; +import com.pipedream.api.resources.triggers.requests.ListTriggersRequest; +import com.pipedream.api.resources.triggers.requests.ReloadPropsTriggersRequest; +import com.pipedream.api.resources.triggers.requests.RetrieveTriggersRequest; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; import com.pipedream.api.types.DeployTriggerResponse; import com.pipedream.api.types.Emitter; import com.pipedream.api.types.GetComponentResponse; import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import java.io.IOException; import java.util.List; @@ -53,13 +53,13 @@ public AsyncRawTriggersClient(ClientOptions clientOptions) { * Retrieve available triggers with optional search and app filtering */ public CompletableFuture>> list() { - return list(TriggersListRequest.builder().build()); + return list(ListTriggersRequest.builder().build()); } /** * Retrieve available triggers with optional search and app filtering */ - public CompletableFuture>> list(TriggersListRequest request) { + public CompletableFuture>> list(ListTriggersRequest request) { return list(request, null); } @@ -67,7 +67,7 @@ public CompletableFuture>> * Retrieve available triggers with optional search and app filtering */ public CompletableFuture>> list( - TriggersListRequest request, RequestOptions requestOptions) { + ListTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -106,12 +106,13 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - TriggersListRequest nextRequest = TriggersListRequest.builder() + ListTriggersRequest nextRequest = ListTriggersRequest.builder() .from(request) .after(startingAfter) .build(); @@ -130,7 +131,6 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -140,11 +140,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -163,14 +161,14 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get detailed configuration for a specific trigger by its key */ public CompletableFuture> retrieve(String componentId) { - return retrieve(componentId, TriggersRetrieveRequest.builder().build()); + return retrieve(componentId, RetrieveTriggersRequest.builder().build()); } /** * Get detailed configuration for a specific trigger by its key */ public CompletableFuture> retrieve( - String componentId, TriggersRetrieveRequest request) { + String componentId, RetrieveTriggersRequest request) { return retrieve(componentId, request, null); } @@ -178,7 +176,7 @@ public CompletableFuture> retrieve( * Get detailed configuration for a specific trigger by its key */ public CompletableFuture> retrieve( - String componentId, TriggersRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -204,13 +202,13 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentResponse.class); future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -220,11 +218,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -242,7 +238,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Retrieve remote options for a given prop for a trigger */ - public CompletableFuture> configureProp(ConfigurePropOpts request) { + public CompletableFuture> configureProp( + ConfigurePropTriggersRequest request) { return configureProp(request, null); } @@ -250,17 +247,18 @@ public CompletableFuture> configur * Retrieve remote options for a given prop for a trigger */ public CompletableFuture> configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropTriggersRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/configure") + .addPathSegments("triggers") + .addPathSegments("configure") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -280,13 +278,13 @@ public CompletableFuture> configur @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ConfigurePropResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -296,11 +294,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -318,7 +314,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture> reloadProps(ReloadPropsOpts request) { + public CompletableFuture> reloadProps( + ReloadPropsTriggersRequest request) { return reloadProps(request, null); } @@ -326,17 +323,18 @@ public CompletableFuture> reloadProp * Reload the prop definition based on the currently configured props */ public CompletableFuture> reloadProps( - ReloadPropsOpts request, RequestOptions requestOptions) { + ReloadPropsTriggersRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/props") + .addPathSegments("triggers") + .addPathSegments("props") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -356,13 +354,13 @@ public CompletableFuture> reloadProp @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ReloadPropsResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -372,11 +370,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); @@ -407,7 +403,8 @@ public CompletableFuture> deploy( .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/deploy") + .addPathSegments("triggers") + .addPathSegments("deploy") .build(); RequestBody body; try { @@ -432,13 +429,13 @@ public CompletableFuture> deploy( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { DeployTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeployTriggerResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DeployTriggerResponse.class); future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { future.completeExceptionally(new TooManyRequestsError( @@ -448,11 +445,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/triggers/AsyncTriggersClient.java b/src/main/java/com/pipedream/api/resources/triggers/AsyncTriggersClient.java index 9aa6e5e..6ddd2e9 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/AsyncTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/triggers/AsyncTriggersClient.java @@ -6,14 +6,14 @@ 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.ConfigurePropTriggersRequest; import com.pipedream.api.resources.triggers.requests.DeployTriggerOpts; -import com.pipedream.api.resources.triggers.requests.TriggersListRequest; -import com.pipedream.api.resources.triggers.requests.TriggersRetrieveRequest; +import com.pipedream.api.resources.triggers.requests.ListTriggersRequest; +import com.pipedream.api.resources.triggers.requests.ReloadPropsTriggersRequest; +import com.pipedream.api.resources.triggers.requests.RetrieveTriggersRequest; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; import com.pipedream.api.types.Emitter; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import java.util.concurrent.CompletableFuture; @@ -44,7 +44,7 @@ public CompletableFuture> list() { /** * Retrieve available triggers with optional search and app filtering */ - public CompletableFuture> list(TriggersListRequest request) { + public CompletableFuture> list(ListTriggersRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } @@ -52,7 +52,7 @@ public CompletableFuture> list(TriggersListRequest * Retrieve available triggers with optional search and app filtering */ public CompletableFuture> list( - TriggersListRequest request, RequestOptions requestOptions) { + ListTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } @@ -66,7 +66,7 @@ public CompletableFuture retrieve(String componentId) { /** * Get detailed configuration for a specific trigger by its key */ - public CompletableFuture retrieve(String componentId, TriggersRetrieveRequest request) { + public CompletableFuture retrieve(String componentId, RetrieveTriggersRequest request) { return this.rawClient.retrieve(componentId, request).thenApply(response -> response.body()); } @@ -74,14 +74,14 @@ public CompletableFuture retrieve(String componentId, TriggersRetriev * Get detailed configuration for a specific trigger by its key */ public CompletableFuture retrieve( - String componentId, TriggersRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(componentId, request, requestOptions).thenApply(response -> response.body()); } /** * Retrieve remote options for a given prop for a trigger */ - public CompletableFuture configureProp(ConfigurePropOpts request) { + public CompletableFuture configureProp(ConfigurePropTriggersRequest request) { return this.rawClient.configureProp(request).thenApply(response -> response.body()); } @@ -89,21 +89,22 @@ public CompletableFuture configureProp(ConfigurePropOpts * Retrieve remote options for a given prop for a trigger */ public CompletableFuture configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.configureProp(request, requestOptions).thenApply(response -> response.body()); } /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture reloadProps(ReloadPropsOpts request) { + public CompletableFuture reloadProps(ReloadPropsTriggersRequest request) { return this.rawClient.reloadProps(request).thenApply(response -> response.body()); } /** * Reload the prop definition based on the currently configured props */ - public CompletableFuture reloadProps(ReloadPropsOpts request, RequestOptions requestOptions) { + public CompletableFuture reloadProps( + ReloadPropsTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.reloadProps(request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java b/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java index 052ddee..f205bf8 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java @@ -14,17 +14,17 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.errors.TooManyRequestsError; +import com.pipedream.api.resources.triggers.requests.ConfigurePropTriggersRequest; import com.pipedream.api.resources.triggers.requests.DeployTriggerOpts; -import com.pipedream.api.resources.triggers.requests.TriggersListRequest; -import com.pipedream.api.resources.triggers.requests.TriggersRetrieveRequest; +import com.pipedream.api.resources.triggers.requests.ListTriggersRequest; +import com.pipedream.api.resources.triggers.requests.ReloadPropsTriggersRequest; +import com.pipedream.api.resources.triggers.requests.RetrieveTriggersRequest; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; import com.pipedream.api.types.DeployTriggerResponse; import com.pipedream.api.types.Emitter; import com.pipedream.api.types.GetComponentResponse; import com.pipedream.api.types.GetComponentsResponse; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; import java.io.IOException; import java.util.List; @@ -48,13 +48,13 @@ public RawTriggersClient(ClientOptions clientOptions) { * Retrieve available triggers with optional search and app filtering */ public BaseClientHttpResponse> list() { - return list(TriggersListRequest.builder().build()); + return list(ListTriggersRequest.builder().build()); } /** * Retrieve available triggers with optional search and app filtering */ - public BaseClientHttpResponse> list(TriggersListRequest request) { + public BaseClientHttpResponse> list(ListTriggersRequest request) { return list(request, null); } @@ -62,7 +62,7 @@ public BaseClientHttpResponse> list(TriggersListRe * Retrieve available triggers with optional search and app filtering */ public BaseClientHttpResponse> list( - TriggersListRequest request, RequestOptions requestOptions) { + ListTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -98,11 +98,12 @@ public BaseClientHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentsResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentsResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); - TriggersListRequest nextRequest = TriggersListRequest.builder() + ListTriggersRequest nextRequest = ListTriggersRequest.builder() .from(request) .after(startingAfter) .build(); @@ -113,7 +114,6 @@ public BaseClientHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -122,11 +122,9 @@ public BaseClientHttpResponse> list( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -136,13 +134,13 @@ public BaseClientHttpResponse> list( * Get detailed configuration for a specific trigger by its key */ public BaseClientHttpResponse retrieve(String componentId) { - return retrieve(componentId, TriggersRetrieveRequest.builder().build()); + return retrieve(componentId, RetrieveTriggersRequest.builder().build()); } /** * Get detailed configuration for a specific trigger by its key */ - public BaseClientHttpResponse retrieve(String componentId, TriggersRetrieveRequest request) { + public BaseClientHttpResponse retrieve(String componentId, RetrieveTriggersRequest request) { return retrieve(componentId, request, null); } @@ -150,7 +148,7 @@ public BaseClientHttpResponse retrieve(String componentId, TriggersRe * Get detailed configuration for a specific trigger by its key */ public BaseClientHttpResponse retrieve( - String componentId, TriggersRetrieveRequest request, RequestOptions requestOptions) { + String componentId, RetrieveTriggersRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -173,12 +171,12 @@ public BaseClientHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { GetComponentResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetComponentResponse.class); return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -187,11 +185,9 @@ public BaseClientHttpResponse retrieve( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -200,7 +196,7 @@ public BaseClientHttpResponse retrieve( /** * Retrieve remote options for a given prop for a trigger */ - public BaseClientHttpResponse configureProp(ConfigurePropOpts request) { + public BaseClientHttpResponse configureProp(ConfigurePropTriggersRequest request) { return configureProp(request, null); } @@ -208,17 +204,18 @@ public BaseClientHttpResponse configureProp(ConfigureProp * Retrieve remote options for a given prop for a trigger */ public BaseClientHttpResponse configureProp( - ConfigurePropOpts request, RequestOptions requestOptions) { + ConfigurePropTriggersRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/configure") + .addPathSegments("triggers") + .addPathSegments("configure") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -235,12 +232,11 @@ public BaseClientHttpResponse configureProp( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ConfigurePropResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -249,11 +245,9 @@ public BaseClientHttpResponse configureProp( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -262,7 +256,7 @@ public BaseClientHttpResponse configureProp( /** * Reload the prop definition based on the currently configured props */ - public BaseClientHttpResponse reloadProps(ReloadPropsOpts request) { + public BaseClientHttpResponse reloadProps(ReloadPropsTriggersRequest request) { return reloadProps(request, null); } @@ -270,17 +264,18 @@ public BaseClientHttpResponse reloadProps(ReloadPropsOpts r * Reload the prop definition based on the currently configured props */ public BaseClientHttpResponse reloadProps( - ReloadPropsOpts request, RequestOptions requestOptions) { + ReloadPropsTriggersRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/props") + .addPathSegments("triggers") + .addPathSegments("props") .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new BaseClientException("Failed to serialize request", e); } @@ -297,12 +292,11 @@ public BaseClientHttpResponse reloadProps( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ReloadPropsResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -311,11 +305,9 @@ public BaseClientHttpResponse reloadProps( } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } @@ -336,7 +328,8 @@ public BaseClientHttpResponse deploy(DeployTriggerOpts request, Request .newBuilder() .addPathSegments("v1/connect") .addPathSegment(clientOptions.projectId()) - .addPathSegments("triggers/deploy") + .addPathSegments("triggers") + .addPathSegments("deploy") .build(); RequestBody body; try { @@ -358,12 +351,12 @@ public BaseClientHttpResponse deploy(DeployTriggerOpts request, Request } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { DeployTriggerResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeployTriggerResponse.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DeployTriggerResponse.class); return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; try { if (response.code() == 429) { throw new TooManyRequestsError( @@ -372,11 +365,9 @@ public BaseClientHttpResponse deploy(DeployTriggerOpts request, Request } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/triggers/TriggersClient.java b/src/main/java/com/pipedream/api/resources/triggers/TriggersClient.java index 04ee913..27d4b3c 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/TriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/triggers/TriggersClient.java @@ -6,14 +6,14 @@ 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.ConfigurePropTriggersRequest; import com.pipedream.api.resources.triggers.requests.DeployTriggerOpts; -import com.pipedream.api.resources.triggers.requests.TriggersListRequest; -import com.pipedream.api.resources.triggers.requests.TriggersRetrieveRequest; +import com.pipedream.api.resources.triggers.requests.ListTriggersRequest; +import com.pipedream.api.resources.triggers.requests.ReloadPropsTriggersRequest; +import com.pipedream.api.resources.triggers.requests.RetrieveTriggersRequest; import com.pipedream.api.types.Component; -import com.pipedream.api.types.ConfigurePropOpts; import com.pipedream.api.types.ConfigurePropResponse; import com.pipedream.api.types.Emitter; -import com.pipedream.api.types.ReloadPropsOpts; import com.pipedream.api.types.ReloadPropsResponse; public class TriggersClient { @@ -43,14 +43,14 @@ public SyncPagingIterable list() { /** * Retrieve available triggers with optional search and app filtering */ - public SyncPagingIterable list(TriggersListRequest request) { + public SyncPagingIterable list(ListTriggersRequest request) { return this.rawClient.list(request).body(); } /** * Retrieve available triggers with optional search and app filtering */ - public SyncPagingIterable list(TriggersListRequest request, RequestOptions requestOptions) { + public SyncPagingIterable list(ListTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } @@ -64,42 +64,42 @@ public Component retrieve(String componentId) { /** * Get detailed configuration for a specific trigger by its key */ - public Component retrieve(String componentId, TriggersRetrieveRequest request) { + public Component retrieve(String componentId, RetrieveTriggersRequest request) { return this.rawClient.retrieve(componentId, request).body(); } /** * Get detailed configuration for a specific trigger by its key */ - public Component retrieve(String componentId, TriggersRetrieveRequest request, RequestOptions requestOptions) { + public Component retrieve(String componentId, RetrieveTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(componentId, request, requestOptions).body(); } /** * Retrieve remote options for a given prop for a trigger */ - public ConfigurePropResponse configureProp(ConfigurePropOpts request) { + public ConfigurePropResponse configureProp(ConfigurePropTriggersRequest request) { return this.rawClient.configureProp(request).body(); } /** * Retrieve remote options for a given prop for a trigger */ - public ConfigurePropResponse configureProp(ConfigurePropOpts request, RequestOptions requestOptions) { + public ConfigurePropResponse configureProp(ConfigurePropTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.configureProp(request, requestOptions).body(); } /** * Reload the prop definition based on the currently configured props */ - public ReloadPropsResponse reloadProps(ReloadPropsOpts request) { + public ReloadPropsResponse reloadProps(ReloadPropsTriggersRequest request) { return this.rawClient.reloadProps(request).body(); } /** * Reload the prop definition based on the currently configured props */ - public ReloadPropsResponse reloadProps(ReloadPropsOpts request, RequestOptions requestOptions) { + public ReloadPropsResponse reloadProps(ReloadPropsTriggersRequest request, RequestOptions requestOptions) { return this.rawClient.reloadProps(request, requestOptions).body(); } diff --git a/src/main/java/com/pipedream/api/resources/triggers/requests/ConfigurePropTriggersRequest.java b/src/main/java/com/pipedream/api/resources/triggers/requests/ConfigurePropTriggersRequest.java new file mode 100644 index 0000000..f1f59e7 --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/triggers/requests/ConfigurePropTriggersRequest.java @@ -0,0 +1,103 @@ +/** + * 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.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 org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConfigurePropTriggersRequest.Builder.class) +public final class ConfigurePropTriggersRequest { + private final ConfigurePropOpts body; + + private final Map additionalProperties; + + private ConfigurePropTriggersRequest(ConfigurePropOpts body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public ConfigurePropOpts getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConfigurePropTriggersRequest && equalTo((ConfigurePropTriggersRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConfigurePropTriggersRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(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(ConfigurePropTriggersRequest other); + } + + public interface _FinalStage { + ConfigurePropTriggersRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private ConfigurePropOpts body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ConfigurePropTriggersRequest other) { + 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 ConfigurePropTriggersRequest build() { + return new ConfigurePropTriggersRequest(body, additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/triggers/requests/DeployTriggerOpts.java b/src/main/java/com/pipedream/api/resources/triggers/requests/DeployTriggerOpts.java index 96ffad8..2148827 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/requests/DeployTriggerOpts.java +++ b/src/main/java/com/pipedream/api/resources/triggers/requests/DeployTriggerOpts.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.types.ConfiguredPropValue; import java.util.HashMap; @@ -68,8 +71,11 @@ public String getId() { /** * @return Optional trigger component version (in SemVer format, for example '1.0.0'), defaults to latest */ - @JsonProperty("version") + @JsonIgnore public Optional getVersion() { + if (version == null) { + return Optional.empty(); + } return version; } @@ -110,6 +116,12 @@ public Optional getWebhookUrl() { return webhookUrl; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("version") + private Optional _getVersion() { + return version; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -178,6 +190,8 @@ public interface _FinalStage { _FinalStage version(String version); + _FinalStage version(Nullable version); + _FinalStage configuredProps(Optional> configuredProps); _FinalStage configuredProps(Map configuredProps); @@ -334,6 +348,22 @@ public _FinalStage configuredProps(Optional> co return this; } + /** + *

Optional trigger component version (in SemVer format, for example '1.0.0'), defaults to latest

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage version(Nullable version) { + if (version.isNull()) { + this.version = null; + } else if (version.isEmpty()) { + this.version = Optional.empty(); + } else { + this.version = Optional.of(version.get()); + } + return this; + } + /** *

Optional trigger component version (in SemVer format, for example '1.0.0'), defaults to latest

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersListRequest.java b/src/main/java/com/pipedream/api/resources/triggers/requests/ListTriggersRequest.java similarity index 92% rename from src/main/java/com/pipedream/api/resources/triggers/requests/TriggersListRequest.java rename to src/main/java/com/pipedream/api/resources/triggers/requests/ListTriggersRequest.java index 833a738..7f0c070 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersListRequest.java +++ b/src/main/java/com/pipedream/api/resources/triggers/requests/ListTriggersRequest.java @@ -18,8 +18,8 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TriggersListRequest.Builder.class) -public final class TriggersListRequest { +@JsonDeserialize(builder = ListTriggersRequest.Builder.class) +public final class ListTriggersRequest { private final Optional after; private final Optional before; @@ -32,7 +32,7 @@ public final class TriggersListRequest { private final Map additionalProperties; - private TriggersListRequest( + private ListTriggersRequest( Optional after, Optional before, Optional limit, @@ -90,7 +90,7 @@ public Optional getApp() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TriggersListRequest && equalTo((TriggersListRequest) other); + return other instanceof ListTriggersRequest && equalTo((ListTriggersRequest) other); } @JsonAnyGetter @@ -98,7 +98,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(TriggersListRequest other) { + private boolean equalTo(ListTriggersRequest other) { return after.equals(other.after) && before.equals(other.before) && limit.equals(other.limit) @@ -137,7 +137,7 @@ public static final class Builder { private Builder() {} - public Builder from(TriggersListRequest other) { + public Builder from(ListTriggersRequest other) { after(other.getAfter()); before(other.getBefore()); limit(other.getLimit()); @@ -216,8 +216,8 @@ public Builder app(String app) { return this; } - public TriggersListRequest build() { - return new TriggersListRequest(after, before, limit, q, app, additionalProperties); + public ListTriggersRequest build() { + return new ListTriggersRequest(after, before, limit, q, app, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/triggers/requests/ReloadPropsTriggersRequest.java b/src/main/java/com/pipedream/api/resources/triggers/requests/ReloadPropsTriggersRequest.java new file mode 100644 index 0000000..d1d3c83 --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/triggers/requests/ReloadPropsTriggersRequest.java @@ -0,0 +1,103 @@ +/** + * 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.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 org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ReloadPropsTriggersRequest.Builder.class) +public final class ReloadPropsTriggersRequest { + private final ReloadPropsOpts body; + + private final Map additionalProperties; + + private ReloadPropsTriggersRequest(ReloadPropsOpts body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public ReloadPropsOpts getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ReloadPropsTriggersRequest && equalTo((ReloadPropsTriggersRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ReloadPropsTriggersRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(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(ReloadPropsTriggersRequest other); + } + + public interface _FinalStage { + ReloadPropsTriggersRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private ReloadPropsOpts body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ReloadPropsTriggersRequest other) { + 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 ReloadPropsTriggersRequest build() { + return new ReloadPropsTriggersRequest(body, additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersRetrieveRequest.java b/src/main/java/com/pipedream/api/resources/triggers/requests/RetrieveTriggersRequest.java similarity index 83% rename from src/main/java/com/pipedream/api/resources/triggers/requests/TriggersRetrieveRequest.java rename to src/main/java/com/pipedream/api/resources/triggers/requests/RetrieveTriggersRequest.java index a822cec..4a232e8 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/requests/TriggersRetrieveRequest.java +++ b/src/main/java/com/pipedream/api/resources/triggers/requests/RetrieveTriggersRequest.java @@ -18,13 +18,13 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TriggersRetrieveRequest.Builder.class) -public final class TriggersRetrieveRequest { +@JsonDeserialize(builder = RetrieveTriggersRequest.Builder.class) +public final class RetrieveTriggersRequest { private final Optional version; private final Map additionalProperties; - private TriggersRetrieveRequest(Optional version, Map additionalProperties) { + private RetrieveTriggersRequest(Optional version, Map additionalProperties) { this.version = version; this.additionalProperties = additionalProperties; } @@ -40,7 +40,7 @@ public Optional getVersion() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TriggersRetrieveRequest && equalTo((TriggersRetrieveRequest) other); + return other instanceof RetrieveTriggersRequest && equalTo((RetrieveTriggersRequest) other); } @JsonAnyGetter @@ -48,7 +48,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(TriggersRetrieveRequest other) { + private boolean equalTo(RetrieveTriggersRequest other) { return version.equals(other.version); } @@ -75,7 +75,7 @@ public static final class Builder { private Builder() {} - public Builder from(TriggersRetrieveRequest other) { + public Builder from(RetrieveTriggersRequest other) { version(other.getVersion()); return this; } @@ -94,8 +94,8 @@ public Builder version(String version) { return this; } - public TriggersRetrieveRequest build() { - return new TriggersRetrieveRequest(version, additionalProperties); + public RetrieveTriggersRequest build() { + return new RetrieveTriggersRequest(version, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java b/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java index c41f6f1..3433f53 100644 --- a/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java +++ b/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java @@ -11,6 +11,7 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.errors.TooManyRequestsError; +import com.pipedream.api.resources.users.requests.DeleteExternalUserUsersRequest; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -34,14 +35,23 @@ public AsyncRawUsersClient(ClientOptions clientOptions) { * Remove an external user and all their associated accounts and resources */ public CompletableFuture> deleteExternalUser(String externalUserId) { - return deleteExternalUser(externalUserId, null); + return deleteExternalUser( + externalUserId, DeleteExternalUserUsersRequest.builder().build()); } /** * Remove an external user and all their associated accounts and resources */ public CompletableFuture> deleteExternalUser( - String externalUserId, RequestOptions requestOptions) { + String externalUserId, DeleteExternalUserUsersRequest request) { + return deleteExternalUser(externalUserId, request, null); + } + + /** + * Remove an external user and all their associated accounts and resources + */ + public CompletableFuture> deleteExternalUser( + String externalUserId, DeleteExternalUserUsersRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -49,12 +59,12 @@ public CompletableFuture> deleteExternalUser( .addPathSegments("users") .addPathSegment(externalUserId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -78,11 +88,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/pipedream/api/resources/users/AsyncUsersClient.java b/src/main/java/com/pipedream/api/resources/users/AsyncUsersClient.java index 8839a62..cbc8ffd 100644 --- a/src/main/java/com/pipedream/api/resources/users/AsyncUsersClient.java +++ b/src/main/java/com/pipedream/api/resources/users/AsyncUsersClient.java @@ -5,6 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.resources.users.requests.DeleteExternalUserUsersRequest; import java.util.concurrent.CompletableFuture; public class AsyncUsersClient { @@ -34,7 +35,17 @@ public CompletableFuture deleteExternalUser(String externalUserId) { /** * Remove an external user and all their associated accounts and resources */ - public CompletableFuture deleteExternalUser(String externalUserId, RequestOptions requestOptions) { - return this.rawClient.deleteExternalUser(externalUserId, requestOptions).thenApply(response -> response.body()); + public CompletableFuture deleteExternalUser(String externalUserId, DeleteExternalUserUsersRequest request) { + return this.rawClient.deleteExternalUser(externalUserId, request).thenApply(response -> response.body()); + } + + /** + * Remove an external user and all their associated accounts and resources + */ + public CompletableFuture deleteExternalUser( + String externalUserId, DeleteExternalUserUsersRequest request, RequestOptions requestOptions) { + return this.rawClient + .deleteExternalUser(externalUserId, request, requestOptions) + .thenApply(response -> response.body()); } } diff --git a/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java b/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java index 097eaaf..bd292b7 100644 --- a/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java +++ b/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java @@ -11,6 +11,7 @@ import com.pipedream.api.core.ObjectMappers; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.errors.TooManyRequestsError; +import com.pipedream.api.resources.users.requests.DeleteExternalUserUsersRequest; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -30,13 +31,23 @@ public RawUsersClient(ClientOptions clientOptions) { * Remove an external user and all their associated accounts and resources */ public BaseClientHttpResponse deleteExternalUser(String externalUserId) { - return deleteExternalUser(externalUserId, null); + return deleteExternalUser( + externalUserId, DeleteExternalUserUsersRequest.builder().build()); } /** * Remove an external user and all their associated accounts and resources */ - public BaseClientHttpResponse deleteExternalUser(String externalUserId, RequestOptions requestOptions) { + public BaseClientHttpResponse deleteExternalUser( + String externalUserId, DeleteExternalUserUsersRequest request) { + return deleteExternalUser(externalUserId, request, null); + } + + /** + * Remove an external user and all their associated accounts and resources + */ + public BaseClientHttpResponse deleteExternalUser( + String externalUserId, DeleteExternalUserUsersRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -44,12 +55,12 @@ public BaseClientHttpResponse deleteExternalUser(String externalUserId, Re .addPathSegments("users") .addPathSegment(externalUserId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -68,11 +79,9 @@ public BaseClientHttpResponse deleteExternalUser(String externalUserId, Re } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + "Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new BaseClientException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/pipedream/api/resources/users/UsersClient.java b/src/main/java/com/pipedream/api/resources/users/UsersClient.java index dba3d67..72a7a9a 100644 --- a/src/main/java/com/pipedream/api/resources/users/UsersClient.java +++ b/src/main/java/com/pipedream/api/resources/users/UsersClient.java @@ -5,6 +5,7 @@ import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.RequestOptions; +import com.pipedream.api.resources.users.requests.DeleteExternalUserUsersRequest; public class UsersClient { protected final ClientOptions clientOptions; @@ -33,7 +34,17 @@ public void deleteExternalUser(String externalUserId) { /** * Remove an external user and all their associated accounts and resources */ - public void deleteExternalUser(String externalUserId, RequestOptions requestOptions) { - this.rawClient.deleteExternalUser(externalUserId, requestOptions).body(); + public void deleteExternalUser(String externalUserId, DeleteExternalUserUsersRequest request) { + this.rawClient.deleteExternalUser(externalUserId, request).body(); + } + + /** + * Remove an external user and all their associated accounts and resources + */ + public void deleteExternalUser( + String externalUserId, DeleteExternalUserUsersRequest request, RequestOptions requestOptions) { + this.rawClient + .deleteExternalUser(externalUserId, request, requestOptions) + .body(); } } diff --git a/src/main/java/com/pipedream/api/resources/users/requests/DeleteExternalUserUsersRequest.java b/src/main/java/com/pipedream/api/resources/users/requests/DeleteExternalUserUsersRequest.java new file mode 100644 index 0000000..b2800e1 --- /dev/null +++ b/src/main/java/com/pipedream/api/resources/users/requests/DeleteExternalUserUsersRequest.java @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.resources.users.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.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteExternalUserUsersRequest.Builder.class) +public final class DeleteExternalUserUsersRequest { + private final Map additionalProperties; + + private DeleteExternalUserUsersRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteExternalUserUsersRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteExternalUserUsersRequest other) { + return this; + } + + public DeleteExternalUserUsersRequest build() { + return new DeleteExternalUserUsersRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/pipedream/api/types/Account.java b/src/main/java/com/pipedream/api/types/Account.java index 3c14085..ad29a29 100644 --- a/src/main/java/com/pipedream/api/types/Account.java +++ b/src/main/java/com/pipedream/api/types/Account.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -89,8 +92,11 @@ public String getId() { /** * @return The custom name of the account if set. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -113,8 +119,11 @@ public Optional getHealthy() { /** * @return Indicates if the account is no longer active */ - @JsonProperty("dead") + @JsonIgnore public Optional getDead() { + if (dead == null) { + return Optional.empty(); + } return dead; } @@ -142,8 +151,11 @@ public Optional getUpdatedAt() { /** * @return The credentials associated with the account, if the include_credentials parameter was set to true in the request */ - @JsonProperty("credentials") + @JsonIgnore public Optional> getCredentials() { + if (credentials == null) { + return Optional.empty(); + } return credentials; } @@ -158,8 +170,11 @@ public Optional getExpiresAt() { /** * @return The error message if the account is unhealthy or dead, null otherwise */ - @JsonProperty("error") + @JsonIgnore public Optional getError() { + if (error == null) { + return Optional.empty(); + } return error; } @@ -174,8 +189,41 @@ public Optional getLastRefreshedAt() { /** * @return The date and time the account will next be refreshed, an ISO 8601 formatted string */ - @JsonProperty("next_refresh_at") + @JsonIgnore public Optional getNextRefreshAt() { + if (nextRefreshAt == null) { + return Optional.empty(); + } + return nextRefreshAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("dead") + private Optional _getDead() { + return dead; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("credentials") + private Optional> _getCredentials() { + return credentials; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error") + private Optional _getError() { + return error; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next_refresh_at") + private Optional _getNextRefreshAt() { return nextRefreshAt; } @@ -249,6 +297,8 @@ public interface _FinalStage { _FinalStage name(String name); + _FinalStage name(Nullable name); + /** *

The external ID associated with the account.

*/ @@ -270,6 +320,8 @@ public interface _FinalStage { _FinalStage dead(Boolean dead); + _FinalStage dead(Nullable dead); + _FinalStage app(Optional app); _FinalStage app(App app); @@ -295,6 +347,8 @@ public interface _FinalStage { _FinalStage credentials(Map credentials); + _FinalStage credentials(Nullable> credentials); + /** *

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

*/ @@ -309,6 +363,8 @@ public interface _FinalStage { _FinalStage error(String error); + _FinalStage error(Nullable error); + /** *

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

*/ @@ -322,6 +378,8 @@ public interface _FinalStage { _FinalStage nextRefreshAt(Optional nextRefreshAt); _FinalStage nextRefreshAt(OffsetDateTime nextRefreshAt); + + _FinalStage nextRefreshAt(Nullable nextRefreshAt); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -382,6 +440,22 @@ public _FinalStage id(@NotNull String id) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage nextRefreshAt(Nullable nextRefreshAt) { + if (nextRefreshAt.isNull()) { + this.nextRefreshAt = null; + } else if (nextRefreshAt.isEmpty()) { + this.nextRefreshAt = Optional.empty(); + } else { + this.nextRefreshAt = Optional.of(nextRefreshAt.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -422,6 +496,22 @@ public _FinalStage lastRefreshedAt(Optional lastRefreshedAt) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage error(Nullable error) { + if (error.isNull()) { + this.error = null; + } else if (error.isEmpty()) { + this.error = Optional.empty(); + } else { + this.error = Optional.of(error.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -462,6 +552,22 @@ public _FinalStage expiresAt(Optional expiresAt) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage credentials(Nullable> credentials) { + if (credentials.isNull()) { + this.credentials = null; + } else if (credentials.isEmpty()) { + this.credentials = Optional.empty(); + } else { + this.credentials = Optional.of(credentials.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -535,6 +641,22 @@ public _FinalStage app(Optional app) { return this; } + /** + *

Indicates if the account is no longer active

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage dead(Nullable dead) { + if (dead.isNull()) { + this.dead = null; + } else if (dead.isEmpty()) { + this.dead = Optional.empty(); + } else { + this.dead = Optional.of(dead.get()); + } + return this; + } + /** *

Indicates if the account is no longer active

* @return Reference to {@code this} so that method calls can be chained together. @@ -595,6 +717,22 @@ public _FinalStage externalId(Optional externalId) { return this; } + /** + *

The custom name of the account if set.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

The custom name of the account if set.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/App.java b/src/main/java/com/pipedream/api/types/App.java index e2a7888..bdc0184 100644 --- a/src/main/java/com/pipedream/api/types/App.java +++ b/src/main/java/com/pipedream/api/types/App.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -69,8 +72,11 @@ private App( /** * @return ID of the app. Only applies for OAuth apps. */ - @JsonProperty("id") + @JsonIgnore public Optional getId() { + if (id == null) { + return Optional.empty(); + } return id; } @@ -90,16 +96,22 @@ public String getName() { return name; } - @JsonProperty("auth_type") + @JsonIgnore public Optional getAuthType() { + if (authType == null) { + return Optional.empty(); + } return authType; } /** * @return A short description of the app */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -114,8 +126,11 @@ public String getImgSrc() { /** * @return A JSON string representing the custom fields for the app */ - @JsonProperty("custom_fields_json") + @JsonIgnore public Optional getCustomFieldsJson() { + if (customFieldsJson == null) { + return Optional.empty(); + } return customFieldsJson; } @@ -135,6 +150,30 @@ public double getFeaturedWeight() { return featuredWeight; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id") + private Optional _getId() { + return id; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth_type") + private Optional _getAuthType() { + return authType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_fields_json") + private Optional _getCustomFieldsJson() { + return customFieldsJson; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -221,10 +260,14 @@ public interface _FinalStage { _FinalStage id(String id); + _FinalStage id(Nullable id); + _FinalStage authType(Optional authType); _FinalStage authType(AppAuthType authType); + _FinalStage authType(Nullable authType); + /** *

A short description of the app

*/ @@ -232,6 +275,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

A JSON string representing the custom fields for the app

*/ @@ -239,6 +284,8 @@ public interface _FinalStage { _FinalStage customFieldsJson(String customFieldsJson); + _FinalStage customFieldsJson(Nullable customFieldsJson); + /** *

Categories associated with the app

*/ @@ -372,6 +419,22 @@ public _FinalStage categories(List 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(Nullable customFieldsJson) { + if (customFieldsJson.isNull()) { + this.customFieldsJson = null; + } else if (customFieldsJson.isEmpty()) { + this.customFieldsJson = Optional.empty(); + } else { + this.customFieldsJson = Optional.of(customFieldsJson.get()); + } + 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. @@ -392,6 +455,22 @@ public _FinalStage customFieldsJson(Optional 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(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

A short description of the app

* @return Reference to {@code this} so that method calls can be chained together. @@ -412,6 +491,18 @@ public _FinalStage description(Optional description) { return this; } + @java.lang.Override + public _FinalStage authType(Nullable authType) { + if (authType.isNull()) { + this.authType = null; + } else if (authType.isEmpty()) { + this.authType = Optional.empty(); + } else { + this.authType = Optional.of(authType.get()); + } + return this; + } + @java.lang.Override public _FinalStage authType(AppAuthType authType) { this.authType = Optional.ofNullable(authType); @@ -425,6 +516,22 @@ public _FinalStage authType(Optional 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(Nullable id) { + if (id.isNull()) { + this.id = null; + } else if (id.isEmpty()) { + this.id = Optional.empty(); + } else { + this.id = Optional.of(id.get()); + } + return this; + } + /** *

ID of the app. Only applies for OAuth apps.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/AppCategory.java b/src/main/java/com/pipedream/api/types/AppCategory.java index 12799ff..c443974 100644 --- a/src/main/java/com/pipedream/api/types/AppCategory.java +++ b/src/main/java/com/pipedream/api/types/AppCategory.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -58,8 +61,17 @@ public Optional getName() { /** * @return A short description of the app category */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { return description; } @@ -154,6 +166,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + public AppCategory build() { return new AppCategory(id, name, description, additionalProperties); } diff --git a/src/main/java/com/pipedream/api/types/Component.java b/src/main/java/com/pipedream/api/types/Component.java index c7dcbcc..7a93254 100644 --- a/src/main/java/com/pipedream/api/types/Component.java +++ b/src/main/java/com/pipedream/api/types/Component.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -94,26 +97,62 @@ public List getConfigurableProps() { /** * @return A description of the component */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The type of component (trigger or action) */ - @JsonProperty("component_type") + @JsonIgnore public Optional getComponentType() { + if (componentType == null) { + return Optional.empty(); + } return componentType; } - @JsonProperty("stash") + @JsonIgnore public Optional getStash() { + if (stash == null) { + return Optional.empty(); + } return stash; } - @JsonProperty("annotations") + @JsonIgnore public Optional getAnnotations() { + if (annotations == null) { + return Optional.empty(); + } + return annotations; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("component_type") + private Optional _getComponentType() { + return componentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("stash") + private Optional _getStash() { + return stash; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("annotations") + private Optional _getAnnotations() { return annotations; } @@ -200,6 +239,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

The type of component (trigger or action)

*/ @@ -207,13 +248,19 @@ public interface _FinalStage { _FinalStage componentType(String componentType); + _FinalStage componentType(Nullable componentType); + _FinalStage stash(Optional stash); _FinalStage stash(ComponentStash stash); + _FinalStage stash(Nullable stash); + _FinalStage annotations(Optional annotations); _FinalStage annotations(ToolAnnotations annotations); + + _FinalStage annotations(Nullable annotations); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -288,6 +335,18 @@ public _FinalStage version(@NotNull String version) { return this; } + @java.lang.Override + public _FinalStage annotations(Nullable annotations) { + if (annotations.isNull()) { + this.annotations = null; + } else if (annotations.isEmpty()) { + this.annotations = Optional.empty(); + } else { + this.annotations = Optional.of(annotations.get()); + } + return this; + } + @java.lang.Override public _FinalStage annotations(ToolAnnotations annotations) { this.annotations = Optional.ofNullable(annotations); @@ -301,6 +360,18 @@ public _FinalStage annotations(Optional annotations) { return this; } + @java.lang.Override + public _FinalStage stash(Nullable stash) { + if (stash.isNull()) { + this.stash = null; + } else if (stash.isEmpty()) { + this.stash = Optional.empty(); + } else { + this.stash = Optional.of(stash.get()); + } + return this; + } + @java.lang.Override public _FinalStage stash(ComponentStash stash) { this.stash = Optional.ofNullable(stash); @@ -314,6 +385,22 @@ public _FinalStage stash(Optional 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(Nullable componentType) { + if (componentType.isNull()) { + this.componentType = null; + } else if (componentType.isEmpty()) { + this.componentType = Optional.empty(); + } else { + this.componentType = Optional.of(componentType.get()); + } + return this; + } + /** *

The type of component (trigger or action)

* @return Reference to {@code this} so that method calls can be chained together. @@ -334,6 +421,22 @@ public _FinalStage componentType(Optional 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(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

A description of the component

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurableProp.java b/src/main/java/com/pipedream/api/types/ConfigurableProp.java index 4c5213e..369e2c9 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurableProp.java +++ b/src/main/java/com/pipedream/api/types/ConfigurableProp.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -88,72 +91,153 @@ public ConfigurablePropType getType() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -230,6 +314,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -237,6 +323,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -244,6 +332,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -251,6 +341,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -258,6 +350,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -265,6 +359,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -272,6 +368,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -279,12 +377,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -351,6 +453,22 @@ public _FinalStage type(@NotNull ConfigurablePropType type) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -371,6 +489,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -391,6 +525,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -411,6 +561,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -431,6 +597,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -451,6 +633,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -471,6 +669,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -491,6 +705,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -511,6 +741,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableBaseId.java b/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableBaseId.java index 4e70c27..261b001 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableBaseId.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableBaseId.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -96,72 +99,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -241,6 +325,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -248,6 +334,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -255,6 +343,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -262,6 +352,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -269,6 +361,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -276,6 +370,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -283,6 +379,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -290,12 +388,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -367,6 +469,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -387,6 +505,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -407,6 +541,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -427,6 +577,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -447,6 +613,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -467,6 +649,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -487,6 +685,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -507,6 +721,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -527,6 +757,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableFieldId.java b/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableFieldId.java index 04b67ca..b48b212 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableFieldId.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableFieldId.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -96,72 +99,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -241,6 +325,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -248,6 +334,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -255,6 +343,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -262,6 +352,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -269,6 +361,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -276,6 +370,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -283,6 +379,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -290,12 +388,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -367,6 +469,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -387,6 +505,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -407,6 +541,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -427,6 +577,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -447,6 +613,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -467,6 +649,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -487,6 +685,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -507,6 +721,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -527,6 +757,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableTableId.java b/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableTableId.java index 0ceeaee..53f2294 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableTableId.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableTableId.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -96,72 +99,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -241,6 +325,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -248,6 +334,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -255,6 +343,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -262,6 +352,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -269,6 +361,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -276,6 +370,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -283,6 +379,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -290,12 +388,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -367,6 +469,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -387,6 +505,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -407,6 +541,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -427,6 +577,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -447,6 +613,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -467,6 +649,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -487,6 +685,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -507,6 +721,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -527,6 +757,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableViewId.java b/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableViewId.java index 0104c20..92bb3cc 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableViewId.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropAirtableViewId.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -96,72 +99,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -241,6 +325,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -248,6 +334,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -255,6 +343,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -262,6 +352,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -269,6 +361,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -276,6 +370,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -283,6 +379,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -290,12 +388,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -367,6 +469,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -387,6 +505,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -407,6 +541,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -427,6 +577,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -447,6 +613,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -467,6 +649,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -487,6 +685,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -507,6 +721,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -527,6 +757,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropAlert.java b/src/main/java/com/pipedream/api/types/ConfigurablePropAlert.java index 188ce32..a0bdda3 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropAlert.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropAlert.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -105,72 +108,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -256,6 +340,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -263,6 +349,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -270,6 +358,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -277,6 +367,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -284,6 +376,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -291,6 +385,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -298,6 +394,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -305,12 +403,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -385,6 +487,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -405,6 +523,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -425,6 +559,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -445,6 +595,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -465,6 +631,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -485,6 +667,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -505,6 +703,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -525,6 +739,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -545,6 +775,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropAny.java b/src/main/java/com/pipedream/api/types/ConfigurablePropAny.java index f94d595..2cb19e7 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropAny.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropAny.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -103,72 +106,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -251,6 +335,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -258,6 +344,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -265,6 +353,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -272,6 +362,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -279,6 +371,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -286,6 +380,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -293,6 +389,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -300,12 +398,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -368,6 +470,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -388,6 +506,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -408,6 +542,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -428,6 +578,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -448,6 +614,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -468,6 +650,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -488,6 +686,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -508,6 +722,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -528,6 +758,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropApp.java b/src/main/java/com/pipedream/api/types/ConfigurablePropApp.java index 3b71506..6134766 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropApp.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropApp.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -96,72 +99,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -241,6 +325,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -248,6 +334,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -255,6 +343,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -262,6 +352,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -269,6 +361,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -276,6 +370,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -283,6 +379,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -290,12 +388,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -367,6 +469,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -387,6 +505,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -407,6 +541,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -427,6 +577,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -447,6 +613,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -467,6 +649,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -487,6 +685,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -507,6 +721,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -527,6 +757,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropApphook.java b/src/main/java/com/pipedream/api/types/ConfigurablePropApphook.java index fbfd3f7..b4ebd1d 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropApphook.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropApphook.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -101,24 +104,33 @@ public String getAppProp() { /** * @return List of event names to listen for */ - @JsonProperty("eventNames") + @JsonIgnore public Optional> getEventNames() { + if (eventNames == null) { + return Optional.empty(); + } return eventNames; } /** * @return Whether this apphook is remote */ - @JsonProperty("remote") + @JsonIgnore public Optional getRemote() { + if (remote == null) { + return Optional.empty(); + } return remote; } /** * @return Static configuration for the apphook */ - @JsonProperty("static") + @JsonIgnore public Optional> getStatic() { + if (static_ == null) { + return Optional.empty(); + } return static_; } @@ -133,72 +145,171 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("eventNames") + private Optional> _getEventNames() { + return eventNames; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote") + private Optional _getRemote() { + return remote; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("static") + private Optional> _getStatic() { + return static_; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -284,6 +395,8 @@ public interface _FinalStage { _FinalStage eventNames(List eventNames); + _FinalStage eventNames(Nullable> eventNames); + /** *

Whether this apphook is remote

*/ @@ -291,6 +404,8 @@ public interface _FinalStage { _FinalStage remote(Boolean remote); + _FinalStage remote(Nullable remote); + /** *

Static configuration for the apphook

*/ @@ -298,6 +413,8 @@ public interface _FinalStage { _FinalStage static_(List static_); + _FinalStage static_(Nullable> static_); + /** *

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.

*/ @@ -305,6 +422,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -312,6 +431,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -319,6 +440,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -326,6 +449,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -333,6 +458,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -340,6 +467,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -347,6 +476,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -354,12 +485,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -440,6 +575,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -460,6 +611,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -480,6 +647,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -500,6 +683,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -520,6 +719,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -540,6 +755,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -560,6 +791,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -580,6 +827,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -600,6 +863,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

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

Static configuration for the apphook

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage static_(Nullable> static_) { + if (static_.isNull()) { + this.static_ = null; + } else if (static_.isEmpty()) { + this.static_ = Optional.empty(); + } else { + this.static_ = Optional.of(static_.get()); + } + return this; + } + /** *

Static configuration for the apphook

* @return Reference to {@code this} so that method calls can be chained together. @@ -640,6 +935,22 @@ public _FinalStage static_(Optional> static_) { return this; } + /** + *

Whether this apphook is remote

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remote(Nullable remote) { + if (remote.isNull()) { + this.remote = null; + } else if (remote.isEmpty()) { + this.remote = Optional.empty(); + } else { + this.remote = Optional.of(remote.get()); + } + return this; + } + /** *

Whether this apphook is remote

* @return Reference to {@code this} so that method calls can be chained together. @@ -660,6 +971,22 @@ public _FinalStage remote(Optional remote) { return this; } + /** + *

List of event names to listen for

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage eventNames(Nullable> eventNames) { + if (eventNames.isNull()) { + this.eventNames = null; + } else if (eventNames.isEmpty()) { + this.eventNames = Optional.empty(); + } else { + this.eventNames = Optional.of(eventNames.get()); + } + return this; + } + /** *

List of event names to listen for

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropBoolean.java b/src/main/java/com/pipedream/api/types/ConfigurablePropBoolean.java index 8d20484..05af82e 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropBoolean.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropBoolean.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -103,72 +106,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -251,6 +335,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -258,6 +344,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -265,6 +353,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -272,6 +362,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -279,6 +371,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -286,6 +380,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -293,6 +389,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -300,12 +398,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -368,6 +470,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -388,6 +506,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -408,6 +542,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -428,6 +578,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -448,6 +614,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -468,6 +650,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -488,6 +686,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -508,6 +722,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -528,6 +758,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropDb.java b/src/main/java/com/pipedream/api/types/ConfigurablePropDb.java index e66e9bf..32c9e57 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropDb.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropDb.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -84,72 +87,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -220,6 +304,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -227,6 +313,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -234,6 +322,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -241,6 +331,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -248,6 +340,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -255,6 +349,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -262,6 +358,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -269,12 +367,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -331,6 +433,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -351,6 +469,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -371,6 +505,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -391,6 +541,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -411,6 +577,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -431,6 +613,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -451,6 +649,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -471,6 +685,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -491,6 +721,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropDiscord.java b/src/main/java/com/pipedream/api/types/ConfigurablePropDiscord.java index 456b93e..dd454ff 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropDiscord.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropDiscord.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -84,72 +87,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -220,6 +304,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -227,6 +313,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -234,6 +322,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -241,6 +331,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -248,6 +340,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -255,6 +349,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -262,6 +358,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -269,12 +367,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -331,6 +433,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -351,6 +469,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -371,6 +505,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -391,6 +541,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -411,6 +577,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -431,6 +613,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -451,6 +649,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -471,6 +685,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -491,6 +721,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropDiscordChannel.java b/src/main/java/com/pipedream/api/types/ConfigurablePropDiscordChannel.java index daae542..8e87a44 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropDiscordChannel.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropDiscordChannel.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -96,72 +99,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -241,6 +325,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -248,6 +334,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -255,6 +343,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -262,6 +352,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -269,6 +361,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -276,6 +370,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -283,6 +379,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -290,12 +388,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -367,6 +469,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -387,6 +505,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -407,6 +541,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -427,6 +577,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -447,6 +613,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -467,6 +649,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -487,6 +685,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -507,6 +721,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -527,6 +757,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropDiscordChannelArray.java b/src/main/java/com/pipedream/api/types/ConfigurablePropDiscordChannelArray.java index 240c7bd..172f3c7 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropDiscordChannelArray.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropDiscordChannelArray.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -96,72 +99,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -242,6 +326,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -249,6 +335,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -256,6 +344,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -263,6 +353,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -270,6 +362,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -277,6 +371,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -284,6 +380,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -291,12 +389,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -356,6 +458,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -376,6 +494,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -396,6 +530,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -416,6 +566,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -436,6 +602,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -456,6 +638,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -476,6 +674,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -496,6 +710,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -516,6 +746,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropHttp.java b/src/main/java/com/pipedream/api/types/ConfigurablePropHttp.java index 18c009b..1382228 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropHttp.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropHttp.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -80,8 +83,11 @@ public String getType() { /** * @return Whether this HTTP interface allows custom responses */ - @JsonProperty("customResponse") + @JsonIgnore public Optional getCustomResponse() { + if (customResponse == null) { + return Optional.empty(); + } return customResponse; } @@ -96,72 +102,159 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("customResponse") + private Optional _getCustomResponse() { + return customResponse; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -234,6 +327,8 @@ public interface _FinalStage { _FinalStage customResponse(Boolean customResponse); + _FinalStage customResponse(Nullable customResponse); + /** *

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.

*/ @@ -241,6 +336,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -248,6 +345,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -255,6 +354,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -262,6 +363,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -269,6 +372,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -276,6 +381,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -283,6 +390,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -290,12 +399,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -355,6 +468,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -375,6 +504,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -395,6 +540,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -415,6 +576,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -435,6 +612,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -455,6 +648,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -475,6 +684,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -495,6 +720,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -515,6 +756,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. @@ -535,6 +792,22 @@ public _FinalStage label(Optional label) { return this; } + /** + *

Whether this HTTP interface allows custom responses

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage customResponse(Nullable customResponse) { + if (customResponse.isNull()) { + this.customResponse = null; + } else if (customResponse.isEmpty()) { + this.customResponse = Optional.empty(); + } else { + this.customResponse = Optional.of(customResponse.get()); + } + return this; + } + /** *

Whether this HTTP interface allows custom responses

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropInteger.java b/src/main/java/com/pipedream/api/types/ConfigurablePropInteger.java index 5559198..75e3c71 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropInteger.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropInteger.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -93,16 +96,22 @@ public String getType() { /** * @return The minimum value for this integer prop. */ - @JsonProperty("min") + @JsonIgnore public Optional getMin() { + if (min == null) { + return Optional.empty(); + } return min; } /** * @return The maximum value for this integer prop. */ - @JsonProperty("max") + @JsonIgnore public Optional getMax() { + if (max == null) { + return Optional.empty(); + } return max; } @@ -114,8 +123,11 @@ public Optional getDefault() { /** * @return Available integer options */ - @JsonProperty("options") + @JsonIgnore public Optional> getOptions() { + if (options == null) { + return Optional.empty(); + } return options; } @@ -130,72 +142,171 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("min") + private Optional _getMin() { + return min; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("max") + private Optional _getMax() { + return max; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("options") + private Optional> _getOptions() { + return options; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -274,6 +385,8 @@ public interface _FinalStage { _FinalStage min(Integer min); + _FinalStage min(Nullable min); + /** *

The maximum value for this integer prop.

*/ @@ -281,6 +394,8 @@ public interface _FinalStage { _FinalStage max(Integer max); + _FinalStage max(Nullable max); + _FinalStage default_(Optional default_); _FinalStage default_(Double default_); @@ -292,6 +407,8 @@ public interface _FinalStage { _FinalStage options(List options); + _FinalStage options(Nullable> options); + /** *

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.

*/ @@ -299,6 +416,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -306,6 +425,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -313,6 +434,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -320,6 +443,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -327,6 +452,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -334,6 +461,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -341,6 +470,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -348,12 +479,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -422,6 +557,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -442,6 +593,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -462,6 +629,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -482,6 +665,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -502,6 +701,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -522,6 +737,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -542,6 +773,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -562,6 +809,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -582,6 +845,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. @@ -602,6 +881,22 @@ public _FinalStage label(Optional label) { return this; } + /** + *

Available integer options

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage options(Nullable> options) { + if (options.isNull()) { + this.options = null; + } else if (options.isEmpty()) { + this.options = Optional.empty(); + } else { + this.options = Optional.of(options.get()); + } + return this; + } + /** *

Available integer options

* @return Reference to {@code this} so that method calls can be chained together. @@ -635,6 +930,22 @@ public _FinalStage default_(Optional default_) { return this; } + /** + *

The maximum value for this integer prop.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage max(Nullable max) { + if (max.isNull()) { + this.max = null; + } else if (max.isEmpty()) { + this.max = Optional.empty(); + } else { + this.max = Optional.of(max.get()); + } + return this; + } + /** *

The maximum value for this integer prop.

* @return Reference to {@code this} so that method calls can be chained together. @@ -655,6 +966,22 @@ public _FinalStage max(Optional max) { return this; } + /** + *

The minimum value for this integer prop.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage min(Nullable min) { + if (min.isNull()) { + this.min = null; + } else if (min.isEmpty()) { + this.min = Optional.empty(); + } else { + this.min = Optional.of(min.get()); + } + return this; + } + /** *

The minimum value for this integer prop.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropIntegerArray.java b/src/main/java/com/pipedream/api/types/ConfigurablePropIntegerArray.java index dc2000d..a95c58e 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropIntegerArray.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropIntegerArray.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -93,32 +96,44 @@ public String getType() { /** * @return The minimum value for integers in this array */ - @JsonProperty("min") + @JsonIgnore public Optional getMin() { + if (min == null) { + return Optional.empty(); + } return min; } /** * @return The maximum value for integers in this array */ - @JsonProperty("max") + @JsonIgnore public Optional getMax() { + if (max == null) { + return Optional.empty(); + } return max; } /** * @return Default array of integers */ - @JsonProperty("default") + @JsonIgnore public Optional> getDefault() { + if (default_ == null) { + return Optional.empty(); + } return default_; } /** * @return Available options for the integer array */ - @JsonProperty("options") + @JsonIgnore public Optional> getOptions() { + if (options == null) { + return Optional.empty(); + } return options; } @@ -133,72 +148,177 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("min") + private Optional _getMin() { + return min; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("max") + private Optional _getMax() { + return max; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default") + private Optional> _getDefault() { + return default_; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("options") + private Optional> _getOptions() { + return options; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -277,6 +397,8 @@ public interface _FinalStage { _FinalStage min(Integer min); + _FinalStage min(Nullable min); + /** *

The maximum value for integers in this array

*/ @@ -284,6 +406,8 @@ public interface _FinalStage { _FinalStage max(Integer max); + _FinalStage max(Nullable max); + /** *

Default array of integers

*/ @@ -291,6 +415,8 @@ public interface _FinalStage { _FinalStage default_(List default_); + _FinalStage default_(Nullable> default_); + /** *

Available options for the integer array

*/ @@ -298,6 +424,8 @@ public interface _FinalStage { _FinalStage options(List options); + _FinalStage options(Nullable> options); + /** *

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.

*/ @@ -305,6 +433,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -312,6 +442,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -319,6 +451,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -326,6 +460,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -333,6 +469,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -340,6 +478,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -347,6 +487,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -354,12 +496,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -428,6 +574,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -448,6 +610,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -468,6 +646,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -488,6 +682,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -508,6 +718,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -528,6 +754,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -548,6 +790,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -568,6 +826,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -588,6 +862,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. @@ -608,6 +898,22 @@ public _FinalStage label(Optional label) { return this; } + /** + *

Available options for the integer array

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage options(Nullable> options) { + if (options.isNull()) { + this.options = null; + } else if (options.isEmpty()) { + this.options = Optional.empty(); + } else { + this.options = Optional.of(options.get()); + } + return this; + } + /** *

Available options for the integer array

* @return Reference to {@code this} so that method calls can be chained together. @@ -628,6 +934,22 @@ public _FinalStage options(OptionalDefault array of integers

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage default_(Nullable> default_) { + if (default_.isNull()) { + this.default_ = null; + } else if (default_.isEmpty()) { + this.default_ = Optional.empty(); + } else { + this.default_ = Optional.of(default_.get()); + } + return this; + } + /** *

Default array of integers

* @return Reference to {@code this} so that method calls can be chained together. @@ -648,6 +970,22 @@ public _FinalStage default_(Optional> default_) { return this; } + /** + *

The maximum value for integers in this array

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage max(Nullable max) { + if (max.isNull()) { + this.max = null; + } else if (max.isEmpty()) { + this.max = Optional.empty(); + } else { + this.max = Optional.of(max.get()); + } + return this; + } + /** *

The maximum value for integers in this array

* @return Reference to {@code this} so that method calls can be chained together. @@ -668,6 +1006,22 @@ public _FinalStage max(Optional max) { return this; } + /** + *

The minimum value for integers in this array

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage min(Nullable min) { + if (min.isNull()) { + this.min = null; + } else if (min.isEmpty()) { + this.min = Optional.empty(); + } else { + this.min = Optional.of(min.get()); + } + return this; + } + /** *

The minimum value for integers in this array

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropObject.java b/src/main/java/com/pipedream/api/types/ConfigurablePropObject.java index 6174398..d86900c 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropObject.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropObject.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -103,72 +106,153 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -251,6 +335,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -258,6 +344,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -265,6 +353,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -272,6 +362,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -279,6 +371,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -286,6 +380,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -293,6 +389,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -300,12 +398,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -368,6 +470,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -388,6 +506,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -408,6 +542,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -428,6 +578,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -448,6 +614,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -468,6 +650,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -488,6 +686,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -508,6 +722,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -528,6 +758,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropSql.java b/src/main/java/com/pipedream/api/types/ConfigurablePropSql.java index 7a570e1..e066423 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropSql.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropSql.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -86,8 +89,11 @@ public String getType() { return "sql"; } - @JsonProperty("auth") + @JsonIgnore public Optional getAuth() { + if (auth == null) { + return Optional.empty(); + } return auth; } @@ -112,72 +118,159 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("auth") + private Optional _getAuth() { + return auth; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -251,6 +344,8 @@ public interface _FinalStage { _FinalStage auth(ConfigurablePropSqlAuth auth); + _FinalStage auth(Nullable auth); + _FinalStage default_(Optional default_); _FinalStage default_(ConfiguredPropValueSql default_); @@ -266,6 +361,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -273,6 +370,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -280,6 +379,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -287,6 +388,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -294,6 +397,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -301,6 +406,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -308,6 +415,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -315,12 +424,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -386,6 +499,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -406,6 +535,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -426,6 +571,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -446,6 +607,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -466,6 +643,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -486,6 +679,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -506,6 +715,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -526,6 +751,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -546,6 +787,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. @@ -592,6 +849,18 @@ public _FinalStage default_(Optional default_) { return this; } + @java.lang.Override + public _FinalStage auth(Nullable auth) { + if (auth.isNull()) { + this.auth = null; + } else if (auth.isEmpty()) { + this.auth = Optional.empty(); + } else { + this.auth = Optional.of(auth.get()); + } + return this; + } + @java.lang.Override public _FinalStage auth(ConfigurablePropSqlAuth auth) { this.auth = Optional.ofNullable(auth); diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropString.java b/src/main/java/com/pipedream/api/types/ConfigurablePropString.java index d1ce2e7..8ce614c 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropString.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropString.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -89,8 +92,11 @@ public String getType() { /** * @return If true, this prop is a secret and should not be displayed in plain text. */ - @JsonProperty("secret") + @JsonIgnore public Optional getSecret() { + if (secret == null) { + return Optional.empty(); + } return secret; } @@ -115,72 +121,159 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("secret") + private Optional _getSecret() { + return secret; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -257,6 +350,8 @@ public interface _FinalStage { _FinalStage secret(Boolean secret); + _FinalStage secret(Nullable secret); + _FinalStage default_(Optional default_); _FinalStage default_(String default_); @@ -272,6 +367,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -279,6 +376,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -286,6 +385,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -293,6 +394,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -300,6 +403,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -307,6 +412,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -314,6 +421,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -321,12 +430,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -392,6 +505,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -412,6 +541,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -432,6 +577,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -452,6 +613,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -472,6 +649,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -492,6 +685,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -512,6 +721,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -532,6 +757,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -552,6 +793,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. @@ -598,6 +855,22 @@ public _FinalStage default_(Optional default_) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage secret(Nullable secret) { + if (secret.isNull()) { + this.secret = null; + } else if (secret.isEmpty()) { + this.secret = Optional.empty(); + } else { + this.secret = Optional.of(secret.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropStringArray.java b/src/main/java/com/pipedream/api/types/ConfigurablePropStringArray.java index af508a0..e17a54b 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropStringArray.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropStringArray.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -89,16 +92,22 @@ public String getType() { /** * @return If true, this prop is a secret and should not be displayed in plain text. */ - @JsonProperty("secret") + @JsonIgnore public Optional getSecret() { + if (secret == null) { + return Optional.empty(); + } return secret; } /** * @return The default value for this prop */ - @JsonProperty("default") + @JsonIgnore public Optional> getDefault() { + if (default_ == null) { + return Optional.empty(); + } return default_; } @@ -118,72 +127,165 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("secret") + private Optional _getSecret() { + return secret; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default") + private Optional> _getDefault() { + return default_; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -260,6 +362,8 @@ public interface _FinalStage { _FinalStage secret(Boolean secret); + _FinalStage secret(Nullable secret); + /** *

The default value for this prop

*/ @@ -267,6 +371,8 @@ public interface _FinalStage { _FinalStage default_(List default_); + _FinalStage default_(Nullable> default_); + _FinalStage options(Optional> options); _FinalStage options(List options); @@ -278,6 +384,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -285,6 +393,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -292,6 +402,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -299,6 +411,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -306,6 +420,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -313,6 +429,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -320,6 +438,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -327,12 +447,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -398,6 +522,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -418,6 +558,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -438,6 +594,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -458,6 +630,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -478,6 +666,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -498,6 +702,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -518,6 +738,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -538,6 +774,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -558,6 +810,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. @@ -591,6 +859,22 @@ public _FinalStage options(Optional return this; } + /** + *

The default value for this prop

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage default_(Nullable> default_) { + if (default_.isNull()) { + this.default_ = null; + } else if (default_.isEmpty()) { + this.default_ = Optional.empty(); + } else { + this.default_ = Optional.of(default_.get()); + } + return this; + } + /** *

The default value for this prop

* @return Reference to {@code this} so that method calls can be chained together. @@ -611,6 +895,22 @@ public _FinalStage default_(Optional> default_) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage secret(Nullable secret) { + if (secret.isNull()) { + this.secret = null; + } else if (secret.isEmpty()) { + this.secret = Optional.empty(); + } else { + this.secret = Optional.of(secret.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurablePropTimer.java b/src/main/java/com/pipedream/api/types/ConfigurablePropTimer.java index 91e02c9..44611e4 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurablePropTimer.java +++ b/src/main/java/com/pipedream/api/types/ConfigurablePropTimer.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -86,21 +89,30 @@ public String getType() { return "$.interface.timer"; } - @JsonProperty("static") + @JsonIgnore public Optional getStatic() { + if (static_ == null) { + return Optional.empty(); + } return static_; } - @JsonProperty("default") + @JsonIgnore public Optional getDefault() { + if (default_ == null) { + return Optional.empty(); + } return default_; } /** * @return Available timer configuration options */ - @JsonProperty("options") + @JsonIgnore public Optional>> getOptions() { + if (options == null) { + return Optional.empty(); + } return options; } @@ -115,72 +127,171 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } /** * @return A description of the prop, shown to the user when configuring the component. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return If true, this prop does not need to be specified. */ - @JsonProperty("optional") + @JsonIgnore public Optional getOptional() { + if (optional == null) { + return Optional.empty(); + } return optional; } /** * @return If true, this prop will be ignored. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return If true, should not expose this prop to the user */ - @JsonProperty("hidden") + @JsonIgnore public Optional getHidden() { + if (hidden == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getRemoteOptions() { + if (remoteOptions == null) { + return Optional.empty(); + } return remoteOptions; } /** * @return If true, calls to configureComponent for this prop support receiving a query parameter to filter remote options */ - @JsonProperty("useQuery") + @JsonIgnore public Optional getUseQuery() { + if (useQuery == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getReloadProps() { + if (reloadProps == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getWithLabel() { + if (withLabel == null) { + return Optional.empty(); + } + return withLabel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("static") + private Optional _getStatic() { + return static_; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default") + private Optional _getDefault() { + return default_; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("options") + private Optional>> _getOptions() { + return options; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("optional") + private Optional _getOptional() { + return optional; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hidden") + private Optional _getHidden() { + return hidden; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remoteOptions") + private Optional _getRemoteOptions() { + return remoteOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("useQuery") + private Optional _getUseQuery() { + return useQuery; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reloadProps") + private Optional _getReloadProps() { + return reloadProps; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("withLabel") + private Optional _getWithLabel() { return withLabel; } @@ -254,10 +365,14 @@ public interface _FinalStage { _FinalStage static_(ConfigurablePropTimerStatic static_); + _FinalStage static_(Nullable static_); + _FinalStage default_(Optional default_); _FinalStage default_(ConfigurablePropTimerDefault default_); + _FinalStage default_(Nullable default_); + /** *

Available timer configuration options

*/ @@ -265,6 +380,8 @@ public interface _FinalStage { _FinalStage options(List> options); + _FinalStage options(Nullable>> options); + /** *

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.

*/ @@ -272,6 +389,8 @@ public interface _FinalStage { _FinalStage label(String label); + _FinalStage label(Nullable label); + /** *

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

*/ @@ -279,6 +398,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + /** *

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

*/ @@ -286,6 +407,8 @@ public interface _FinalStage { _FinalStage optional(Boolean optional); + _FinalStage optional(Nullable optional); + /** *

If true, this prop will be ignored.

*/ @@ -293,6 +416,8 @@ public interface _FinalStage { _FinalStage disabled(Boolean disabled); + _FinalStage disabled(Nullable disabled); + /** *

If true, should not expose this prop to the user

*/ @@ -300,6 +425,8 @@ public interface _FinalStage { _FinalStage hidden(Boolean hidden); + _FinalStage hidden(Nullable hidden); + /** *

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

*/ @@ -307,6 +434,8 @@ public interface _FinalStage { _FinalStage remoteOptions(Boolean remoteOptions); + _FinalStage remoteOptions(Nullable remoteOptions); + /** *

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

*/ @@ -314,6 +443,8 @@ public interface _FinalStage { _FinalStage useQuery(Boolean useQuery); + _FinalStage useQuery(Nullable useQuery); + /** *

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

*/ @@ -321,12 +452,16 @@ public interface _FinalStage { _FinalStage reloadProps(Boolean reloadProps); + _FinalStage reloadProps(Nullable reloadProps); + /** *

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

*/ _FinalStage withLabel(Optional withLabel); _FinalStage withLabel(Boolean withLabel); + + _FinalStage withLabel(Nullable withLabel); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -392,6 +527,22 @@ public _FinalStage name(@NotNull String name) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage withLabel(Nullable withLabel) { + if (withLabel.isNull()) { + this.withLabel = null; + } else if (withLabel.isEmpty()) { + this.withLabel = Optional.empty(); + } else { + this.withLabel = Optional.of(withLabel.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -412,6 +563,22 @@ public _FinalStage withLabel(Optional withLabel) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage reloadProps(Nullable reloadProps) { + if (reloadProps.isNull()) { + this.reloadProps = null; + } else if (reloadProps.isEmpty()) { + this.reloadProps = Optional.empty(); + } else { + this.reloadProps = Optional.of(reloadProps.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -432,6 +599,22 @@ public _FinalStage reloadProps(Optional reloadProps) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage useQuery(Nullable useQuery) { + if (useQuery.isNull()) { + this.useQuery = null; + } else if (useQuery.isEmpty()) { + this.useQuery = Optional.empty(); + } else { + this.useQuery = Optional.of(useQuery.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -452,6 +635,22 @@ public _FinalStage useQuery(Optional useQuery) { 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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteOptions(Nullable remoteOptions) { + if (remoteOptions.isNull()) { + this.remoteOptions = null; + } else if (remoteOptions.isEmpty()) { + this.remoteOptions = Optional.empty(); + } else { + this.remoteOptions = Optional.of(remoteOptions.get()); + } + 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

* @return Reference to {@code this} so that method calls can be chained together. @@ -472,6 +671,22 @@ public _FinalStage remoteOptions(Optional remoteOptions) { return this; } + /** + *

If true, should not expose this prop to the user

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hidden(Nullable hidden) { + if (hidden.isNull()) { + this.hidden = null; + } else if (hidden.isEmpty()) { + this.hidden = Optional.empty(); + } else { + this.hidden = Optional.of(hidden.get()); + } + return this; + } + /** *

If true, should not expose this prop to the user

* @return Reference to {@code this} so that method calls can be chained together. @@ -492,6 +707,22 @@ public _FinalStage hidden(Optional hidden) { return this; } + /** + *

If true, this prop will be ignored.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

If true, this prop will be ignored.

* @return Reference to {@code this} so that method calls can be chained together. @@ -512,6 +743,22 @@ public _FinalStage disabled(Optional disabled) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage optional(Nullable optional) { + if (optional.isNull()) { + this.optional = null; + } else if (optional.isEmpty()) { + this.optional = Optional.empty(); + } else { + this.optional = Optional.of(optional.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -532,6 +779,22 @@ public _FinalStage optional(Optional optional) { return this; } + /** + *

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

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

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

* @return Reference to {@code this} so that method calls can be chained together. @@ -552,6 +815,22 @@ public _FinalStage description(Optional description) { 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.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

* @return Reference to {@code this} so that method calls can be chained together. @@ -572,6 +851,22 @@ public _FinalStage label(Optional label) { return this; } + /** + *

Available timer configuration options

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage options(Nullable>> options) { + if (options.isNull()) { + this.options = null; + } else if (options.isEmpty()) { + this.options = Optional.empty(); + } else { + this.options = Optional.of(options.get()); + } + return this; + } + /** *

Available timer configuration options

* @return Reference to {@code this} so that method calls can be chained together. @@ -592,6 +887,18 @@ public _FinalStage options(Optional>> return this; } + @java.lang.Override + public _FinalStage default_(Nullable default_) { + if (default_.isNull()) { + this.default_ = null; + } else if (default_.isEmpty()) { + this.default_ = Optional.empty(); + } else { + this.default_ = Optional.of(default_.get()); + } + return this; + } + @java.lang.Override public _FinalStage default_(ConfigurablePropTimerDefault default_) { this.default_ = Optional.ofNullable(default_); @@ -605,6 +912,18 @@ public _FinalStage default_(Optional default_) { return this; } + @java.lang.Override + public _FinalStage static_(Nullable static_) { + if (static_.isNull()) { + this.static_ = null; + } else if (static_.isEmpty()) { + this.static_ = Optional.empty(); + } else { + this.static_ = Optional.of(static_.get()); + } + return this; + } + @java.lang.Override public _FinalStage static_(ConfigurablePropTimerStatic static_) { this.static_ = Optional.ofNullable(static_); diff --git a/src/main/java/com/pipedream/api/types/ConfigurePropOpts.java b/src/main/java/com/pipedream/api/types/ConfigurePropOpts.java index 3ed90b7..ff333ee 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurePropOpts.java +++ b/src/main/java/com/pipedream/api/types/ConfigurePropOpts.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -79,8 +82,11 @@ public String getId() { /** * @return Optional component version (in SemVer format, for example '1.0.0'), defaults to latest */ - @JsonProperty("version") + @JsonIgnore public Optional getVersion() { + if (version == null) { + return Optional.empty(); + } return version; } @@ -145,6 +151,12 @@ public Optional getQuery() { return query; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("version") + private Optional _getVersion() { + return version; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -226,6 +238,8 @@ public interface _FinalStage { _FinalStage version(String version); + _FinalStage version(Nullable version); + /** *

Whether this operation should block until completion

*/ @@ -457,6 +471,22 @@ public _FinalStage blocking(Optional blocking) { return this; } + /** + *

Optional component version (in SemVer format, for example '1.0.0'), defaults to latest

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage version(Nullable version) { + if (version.isNull()) { + this.version = null; + } else if (version.isEmpty()) { + this.version = Optional.empty(); + } else { + this.version = Optional.of(version.get()); + } + return this; + } + /** *

Optional component version (in SemVer format, for example '1.0.0'), defaults to latest

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ConfigurePropResponse.java b/src/main/java/com/pipedream/api/types/ConfigurePropResponse.java index f44af77..ae9799c 100644 --- a/src/main/java/com/pipedream/api/types/ConfigurePropResponse.java +++ b/src/main/java/com/pipedream/api/types/ConfigurePropResponse.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -48,29 +51,41 @@ private ConfigurePropResponse( this.additionalProperties = additionalProperties; } - @JsonProperty("options") + @JsonIgnore public Optional> getOptions() { + if (options == null) { + return Optional.empty(); + } return options; } /** * @return Available options for the configured prop */ - @JsonProperty("string_options") + @JsonIgnore public Optional> getStringOptions() { + if (stringOptions == null) { + return Optional.empty(); + } return stringOptions; } - @JsonProperty("observations") + @JsonIgnore public Optional> getObservations() { + if (observations == null) { + return Optional.empty(); + } return observations; } /** * @return New context after configuring the prop */ - @JsonProperty("context") + @JsonIgnore public Optional> getContext() { + if (context == null) { + return Optional.empty(); + } return context; } @@ -82,6 +97,30 @@ public Optional> getErrors() { return errors; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("options") + private Optional> _getOptions() { + return options; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("string_options") + private Optional> _getStringOptions() { + return stringOptions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("observations") + private Optional> _getObservations() { + return observations; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("context") + private Optional> _getContext() { + return context; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -152,6 +191,17 @@ public Builder options(List options) { return this; } + public Builder options(Nullable> options) { + if (options.isNull()) { + this.options = null; + } else if (options.isEmpty()) { + this.options = Optional.empty(); + } else { + this.options = Optional.of(options.get()); + } + return this; + } + /** *

Available options for the configured prop

*/ @@ -166,6 +216,17 @@ public Builder stringOptions(List stringOptions) { return this; } + public Builder stringOptions(Nullable> stringOptions) { + if (stringOptions.isNull()) { + this.stringOptions = null; + } else if (stringOptions.isEmpty()) { + this.stringOptions = Optional.empty(); + } else { + this.stringOptions = Optional.of(stringOptions.get()); + } + return this; + } + @JsonSetter(value = "observations", nulls = Nulls.SKIP) public Builder observations(Optional> observations) { this.observations = observations; @@ -177,6 +238,17 @@ public Builder observations(List observations) { return this; } + public Builder observations(Nullable> observations) { + if (observations.isNull()) { + this.observations = null; + } else if (observations.isEmpty()) { + this.observations = Optional.empty(); + } else { + this.observations = Optional.of(observations.get()); + } + return this; + } + /** *

New context after configuring the prop

*/ @@ -191,6 +263,17 @@ public Builder context(Map context) { return this; } + public Builder context(Nullable> context) { + if (context.isNull()) { + this.context = null; + } else if (context.isEmpty()) { + this.context = Optional.empty(); + } else { + this.context = Optional.of(context.get()); + } + return this; + } + /** *

Any errors that occurred during configuration

*/ diff --git a/src/main/java/com/pipedream/api/types/DeployedComponent.java b/src/main/java/com/pipedream/api/types/DeployedComponent.java index f019798..53944a9 100644 --- a/src/main/java/com/pipedream/api/types/DeployedComponent.java +++ b/src/main/java/com/pipedream/api/types/DeployedComponent.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -106,8 +109,11 @@ public String getComponentId() { /** * @return The component key (name) that was deployed */ - @JsonProperty("component_key") + @JsonIgnore public Optional getComponentKey() { + if (componentKey == null) { + return Optional.empty(); + } return componentKey; } @@ -167,8 +173,23 @@ public String getNameSlug() { /** * @return Callback observations for the deployed component */ - @JsonProperty("callback_observations") + @JsonIgnore public Optional getCallbackObservations() { + if (callbackObservations == null) { + return Optional.empty(); + } + return callbackObservations; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("component_key") + private Optional _getComponentKey() { + return componentKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("callback_observations") + private Optional _getCallbackObservations() { return callbackObservations; } @@ -292,6 +313,8 @@ public interface _FinalStage { _FinalStage componentKey(String componentKey); + _FinalStage componentKey(Nullable componentKey); + /** *

The configurable properties of the component

*/ @@ -313,6 +336,8 @@ public interface _FinalStage { _FinalStage callbackObservations(Optional callbackObservations); _FinalStage callbackObservations(Object callbackObservations); + + _FinalStage callbackObservations(Nullable callbackObservations); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -468,6 +493,22 @@ public _FinalStage nameSlug(@NotNull String nameSlug) { return this; } + /** + *

Callback observations for the deployed component

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage callbackObservations(Nullable callbackObservations) { + if (callbackObservations.isNull()) { + this.callbackObservations = null; + } else if (callbackObservations.isEmpty()) { + this.callbackObservations = Optional.empty(); + } else { + this.callbackObservations = Optional.of(callbackObservations.get()); + } + return this; + } + /** *

Callback observations for the deployed component

* @return Reference to {@code this} so that method calls can be chained together. @@ -547,6 +588,22 @@ public _FinalStage configurableProps(List configurableProps) { return this; } + /** + *

The component key (name) that was deployed

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage componentKey(Nullable componentKey) { + if (componentKey.isNull()) { + this.componentKey = null; + } else if (componentKey.isEmpty()) { + this.componentKey = Optional.empty(); + } else { + this.componentKey = Optional.of(componentKey.get()); + } + return this; + } + /** *

The component key (name) that was deployed

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/ProjectInfoResponseApp.java b/src/main/java/com/pipedream/api/types/ProjectInfoResponseApp.java index 81eff17..ad7388d 100644 --- a/src/main/java/com/pipedream/api/types/ProjectInfoResponseApp.java +++ b/src/main/java/com/pipedream/api/types/ProjectInfoResponseApp.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -36,8 +39,11 @@ private ProjectInfoResponseApp( /** * @return ID of the app. Only applies for OAuth apps. */ - @JsonProperty("id") + @JsonIgnore public Optional getId() { + if (id == null) { + return Optional.empty(); + } return id; } @@ -49,6 +55,12 @@ public Optional getNameSlug() { return nameSlug; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id") + private Optional _getId() { + return id; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -109,6 +121,17 @@ public Builder id(String id) { return this; } + public Builder id(Nullable id) { + if (id.isNull()) { + this.id = null; + } else if (id.isEmpty()) { + this.id = Optional.empty(); + } else { + this.id = Optional.of(id.get()); + } + return this; + } + /** *

The name slug of the target app

*/ diff --git a/src/main/java/com/pipedream/api/types/PropOption.java b/src/main/java/com/pipedream/api/types/PropOption.java index 29d341b..2add8a5 100644 --- a/src/main/java/com/pipedream/api/types/PropOption.java +++ b/src/main/java/com/pipedream/api/types/PropOption.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -41,8 +44,17 @@ public String getLabel() { return label; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { return value; } @@ -90,6 +102,8 @@ public interface _FinalStage { _FinalStage value(Optional value); _FinalStage value(PropOptionValue value); + + _FinalStage value(Nullable value); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -122,6 +136,18 @@ public _FinalStage label(@NotNull String label) { return this; } + @java.lang.Override + public _FinalStage value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @java.lang.Override public _FinalStage value(PropOptionValue value) { this.value = Optional.ofNullable(value); diff --git a/src/main/java/com/pipedream/api/types/ReloadPropsOpts.java b/src/main/java/com/pipedream/api/types/ReloadPropsOpts.java index 0bed54c..4ce011a 100644 --- a/src/main/java/com/pipedream/api/types/ReloadPropsOpts.java +++ b/src/main/java/com/pipedream/api/types/ReloadPropsOpts.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -63,8 +66,11 @@ public String getId() { /** * @return Optional component version (in SemVer format, for example '1.0.0'), defaults to latest */ - @JsonProperty("version") + @JsonIgnore public Optional getVersion() { + if (version == null) { + return Optional.empty(); + } return version; } @@ -97,6 +103,12 @@ public Optional getDynamicPropsId() { return dynamicPropsId; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("version") + private Optional _getVersion() { + return version; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -158,6 +170,8 @@ public interface _FinalStage { _FinalStage version(String version); + _FinalStage version(Nullable version); + /** *

Whether this operation should block until completion

*/ @@ -284,6 +298,22 @@ public _FinalStage blocking(Optional blocking) { return this; } + /** + *

Optional component version (in SemVer format, for example '1.0.0'), defaults to latest

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage version(Nullable version) { + if (version.isNull()) { + this.version = null; + } else if (version.isEmpty()) { + this.version = Optional.empty(); + } else { + this.version = Optional.of(version.get()); + } + return this; + } + /** *

Optional component version (in SemVer format, for example '1.0.0'), defaults to latest

* @return Reference to {@code this} so that method calls can be chained together. diff --git a/src/main/java/com/pipedream/api/types/RunActionResponse.java b/src/main/java/com/pipedream/api/types/RunActionResponse.java index 5c68e55..0a974e0 100644 --- a/src/main/java/com/pipedream/api/types/RunActionResponse.java +++ b/src/main/java/com/pipedream/api/types/RunActionResponse.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -67,8 +70,17 @@ public Optional getRet() { return ret; } - @JsonProperty("stash_id") + @JsonIgnore public Optional getStashId() { + if (stashId == null) { + return Optional.empty(); + } + return stashId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("stash_id") + private Optional _getStashId() { return stashId; } @@ -180,6 +192,17 @@ public Builder stashId(String stashId) { return this; } + public Builder stashId(Nullable stashId) { + if (stashId.isNull()) { + this.stashId = null; + } else if (stashId.isEmpty()) { + this.stashId = Optional.empty(); + } else { + this.stashId = Optional.of(stashId.get()); + } + return this; + } + public RunActionResponse build() { return new RunActionResponse(exports, os, ret, stashId, additionalProperties); } diff --git a/src/main/java/com/pipedream/api/types/ToolAnnotations.java b/src/main/java/com/pipedream/api/types/ToolAnnotations.java index ebbc4ec..b26ed64 100644 --- a/src/main/java/com/pipedream/api/types/ToolAnnotations.java +++ b/src/main/java/com/pipedream/api/types/ToolAnnotations.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -50,40 +53,85 @@ private ToolAnnotations( /** * @return If true, the component may perform destructive updates to its environment. If false, the component performs only additive updates. */ - @JsonProperty("destructiveHint") + @JsonIgnore public Optional getDestructiveHint() { + if (destructiveHint == null) { + return Optional.empty(); + } return destructiveHint; } /** * @return If true, calling the component repeatedly with the same arguments will have no additional effect on the its environment. */ - @JsonProperty("idempotentHint") + @JsonIgnore public Optional getIdempotentHint() { + if (idempotentHint == null) { + return Optional.empty(); + } return idempotentHint; } /** * @return If true, this component may interact with an “open world” of external entities. If false, the component's domain of interaction is closed. For example, the world of a web search component is open, whereas that of a memory component is not. */ - @JsonProperty("openWorldHint") + @JsonIgnore public Optional getOpenWorldHint() { + if (openWorldHint == null) { + return Optional.empty(); + } return openWorldHint; } /** * @return If true, the component does not modify its environment. */ - @JsonProperty("readOnlyHint") + @JsonIgnore public Optional getReadOnlyHint() { + if (readOnlyHint == null) { + return Optional.empty(); + } return readOnlyHint; } /** * @return A human-readable title for the component. */ - @JsonProperty("title") + @JsonIgnore public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("destructiveHint") + private Optional _getDestructiveHint() { + return destructiveHint; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("idempotentHint") + private Optional _getIdempotentHint() { + return idempotentHint; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("openWorldHint") + private Optional _getOpenWorldHint() { + return openWorldHint; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("readOnlyHint") + private Optional _getReadOnlyHint() { + return readOnlyHint; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { return title; } @@ -161,6 +209,17 @@ public Builder destructiveHint(Boolean destructiveHint) { return this; } + public Builder destructiveHint(Nullable destructiveHint) { + if (destructiveHint.isNull()) { + this.destructiveHint = null; + } else if (destructiveHint.isEmpty()) { + this.destructiveHint = Optional.empty(); + } else { + this.destructiveHint = Optional.of(destructiveHint.get()); + } + return this; + } + /** *

If true, calling the component repeatedly with the same arguments will have no additional effect on the its environment.

*/ @@ -175,6 +234,17 @@ public Builder idempotentHint(Boolean idempotentHint) { return this; } + public Builder idempotentHint(Nullable idempotentHint) { + if (idempotentHint.isNull()) { + this.idempotentHint = null; + } else if (idempotentHint.isEmpty()) { + this.idempotentHint = Optional.empty(); + } else { + this.idempotentHint = Optional.of(idempotentHint.get()); + } + return this; + } + /** *

If true, this component may interact with an “open world” of external entities. If false, the component's domain of interaction is closed. For example, the world of a web search component is open, whereas that of a memory component is not.

*/ @@ -189,6 +259,17 @@ public Builder openWorldHint(Boolean openWorldHint) { return this; } + public Builder openWorldHint(Nullable openWorldHint) { + if (openWorldHint.isNull()) { + this.openWorldHint = null; + } else if (openWorldHint.isEmpty()) { + this.openWorldHint = Optional.empty(); + } else { + this.openWorldHint = Optional.of(openWorldHint.get()); + } + return this; + } + /** *

If true, the component does not modify its environment.

*/ @@ -203,6 +284,17 @@ public Builder readOnlyHint(Boolean readOnlyHint) { return this; } + public Builder readOnlyHint(Nullable readOnlyHint) { + if (readOnlyHint.isNull()) { + this.readOnlyHint = null; + } else if (readOnlyHint.isEmpty()) { + this.readOnlyHint = Optional.empty(); + } else { + this.readOnlyHint = Optional.of(readOnlyHint.get()); + } + return this; + } + /** *

A human-readable title for the component.

*/ @@ -217,6 +309,17 @@ public Builder title(String title) { return this; } + public Builder title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + public ToolAnnotations build() { return new ToolAnnotations( destructiveHint, idempotentHint, openWorldHint, readOnlyHint, title, additionalProperties); diff --git a/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java b/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java index 5691d9d..ba9972b 100644 --- a/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java +++ b/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.pipedream.api.core.NullableNonemptyFilter; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -67,64 +70,88 @@ private ValidateTokenResponse( this.additionalProperties = additionalProperties; } - @JsonProperty("app") + @JsonIgnore public Optional getApp() { + if (app == null) { + return Optional.empty(); + } return app; } /** * @return Error message if validation failed */ - @JsonProperty("error") + @JsonIgnore public Optional getError() { + if (error == null) { + return Optional.empty(); + } return error; } /** * @return URI to redirect to on error */ - @JsonProperty("error_redirect_uri") + @JsonIgnore public Optional getErrorRedirectUri() { + if (errorRedirectUri == null) { + return Optional.empty(); + } return errorRedirectUri; } /** * @return OAuth app ID if applicable */ - @JsonProperty("oauth_app_id") + @JsonIgnore public Optional getOauthAppId() { + if (oauthAppId == null) { + return Optional.empty(); + } return oauthAppId; } /** * @return Name of the project app */ - @JsonProperty("project_app_name") + @JsonIgnore public Optional getProjectAppName() { + if (projectAppName == null) { + return Optional.empty(); + } return projectAppName; } /** * @return Environment of the project */ - @JsonProperty("project_environment") + @JsonIgnore public Optional getProjectEnvironment() { + if (projectEnvironment == null) { + return Optional.empty(); + } return projectEnvironment; } /** * @return ID of the project */ - @JsonProperty("project_id") + @JsonIgnore public Optional getProjectId() { + if (projectId == null) { + return Optional.empty(); + } return projectId; } /** * @return Support email for the project */ - @JsonProperty("project_support_email") + @JsonIgnore public Optional getProjectSupportEmail() { + if (projectSupportEmail == null) { + return Optional.empty(); + } return projectSupportEmail; } @@ -139,8 +166,65 @@ public boolean getSuccess() { /** * @return URI to redirect to on success */ - @JsonProperty("success_redirect_uri") + @JsonIgnore public Optional getSuccessRedirectUri() { + if (successRedirectUri == null) { + return Optional.empty(); + } + return successRedirectUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("app") + private Optional _getApp() { + return app; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error") + private Optional _getError() { + return error; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("error_redirect_uri") + private Optional _getErrorRedirectUri() { + return errorRedirectUri; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("oauth_app_id") + private Optional _getOauthAppId() { + return oauthAppId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project_app_name") + private Optional _getProjectAppName() { + return projectAppName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project_environment") + private Optional _getProjectEnvironment() { + return projectEnvironment; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project_id") + private Optional _getProjectId() { + return projectId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project_support_email") + private Optional _getProjectSupportEmail() { + return projectSupportEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("success_redirect_uri") + private Optional _getSuccessRedirectUri() { return successRedirectUri; } @@ -208,6 +292,8 @@ public interface _FinalStage { _FinalStage app(App app); + _FinalStage app(Nullable app); + /** *

Error message if validation failed

*/ @@ -215,6 +301,8 @@ public interface _FinalStage { _FinalStage error(String error); + _FinalStage error(Nullable error); + /** *

URI to redirect to on error

*/ @@ -222,6 +310,8 @@ public interface _FinalStage { _FinalStage errorRedirectUri(String errorRedirectUri); + _FinalStage errorRedirectUri(Nullable errorRedirectUri); + /** *

OAuth app ID if applicable

*/ @@ -229,6 +319,8 @@ public interface _FinalStage { _FinalStage oauthAppId(String oauthAppId); + _FinalStage oauthAppId(Nullable oauthAppId); + /** *

Name of the project app

*/ @@ -236,6 +328,8 @@ public interface _FinalStage { _FinalStage projectAppName(String projectAppName); + _FinalStage projectAppName(Nullable projectAppName); + /** *

Environment of the project

*/ @@ -243,6 +337,8 @@ public interface _FinalStage { _FinalStage projectEnvironment(String projectEnvironment); + _FinalStage projectEnvironment(Nullable projectEnvironment); + /** *

ID of the project

*/ @@ -250,6 +346,8 @@ public interface _FinalStage { _FinalStage projectId(String projectId); + _FinalStage projectId(Nullable projectId); + /** *

Support email for the project

*/ @@ -257,12 +355,16 @@ public interface _FinalStage { _FinalStage projectSupportEmail(String projectSupportEmail); + _FinalStage projectSupportEmail(Nullable projectSupportEmail); + /** *

URI to redirect to on success

*/ _FinalStage successRedirectUri(Optional successRedirectUri); _FinalStage successRedirectUri(String successRedirectUri); + + _FinalStage successRedirectUri(Nullable successRedirectUri); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -319,6 +421,22 @@ public _FinalStage success(boolean 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(Nullable successRedirectUri) { + if (successRedirectUri.isNull()) { + this.successRedirectUri = null; + } else if (successRedirectUri.isEmpty()) { + this.successRedirectUri = Optional.empty(); + } else { + this.successRedirectUri = Optional.of(successRedirectUri.get()); + } + return this; + } + /** *

URI to redirect to on success

* @return Reference to {@code this} so that method calls can be chained together. @@ -339,6 +457,22 @@ public _FinalStage successRedirectUri(Optional 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(Nullable projectSupportEmail) { + if (projectSupportEmail.isNull()) { + this.projectSupportEmail = null; + } else if (projectSupportEmail.isEmpty()) { + this.projectSupportEmail = Optional.empty(); + } else { + this.projectSupportEmail = Optional.of(projectSupportEmail.get()); + } + return this; + } + /** *

Support email for the project

* @return Reference to {@code this} so that method calls can be chained together. @@ -359,6 +493,22 @@ public _FinalStage projectSupportEmail(Optional 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(Nullable projectId) { + if (projectId.isNull()) { + this.projectId = null; + } else if (projectId.isEmpty()) { + this.projectId = Optional.empty(); + } else { + this.projectId = Optional.of(projectId.get()); + } + return this; + } + /** *

ID of the project

* @return Reference to {@code this} so that method calls can be chained together. @@ -379,6 +529,22 @@ public _FinalStage projectId(Optional 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(Nullable projectEnvironment) { + if (projectEnvironment.isNull()) { + this.projectEnvironment = null; + } else if (projectEnvironment.isEmpty()) { + this.projectEnvironment = Optional.empty(); + } else { + this.projectEnvironment = Optional.of(projectEnvironment.get()); + } + return this; + } + /** *

Environment of the project

* @return Reference to {@code this} so that method calls can be chained together. @@ -399,6 +565,22 @@ public _FinalStage projectEnvironment(Optional 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(Nullable projectAppName) { + if (projectAppName.isNull()) { + this.projectAppName = null; + } else if (projectAppName.isEmpty()) { + this.projectAppName = Optional.empty(); + } else { + this.projectAppName = Optional.of(projectAppName.get()); + } + return this; + } + /** *

Name of the project app

* @return Reference to {@code this} so that method calls can be chained together. @@ -419,6 +601,22 @@ public _FinalStage projectAppName(Optional 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(Nullable oauthAppId) { + if (oauthAppId.isNull()) { + this.oauthAppId = null; + } else if (oauthAppId.isEmpty()) { + this.oauthAppId = Optional.empty(); + } else { + this.oauthAppId = Optional.of(oauthAppId.get()); + } + return this; + } + /** *

OAuth app ID if applicable

* @return Reference to {@code this} so that method calls can be chained together. @@ -439,6 +637,22 @@ public _FinalStage oauthAppId(Optional 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(Nullable errorRedirectUri) { + if (errorRedirectUri.isNull()) { + this.errorRedirectUri = null; + } else if (errorRedirectUri.isEmpty()) { + this.errorRedirectUri = Optional.empty(); + } else { + this.errorRedirectUri = Optional.of(errorRedirectUri.get()); + } + return this; + } + /** *

URI to redirect to on error

* @return Reference to {@code this} so that method calls can be chained together. @@ -459,6 +673,22 @@ public _FinalStage errorRedirectUri(Optional 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(Nullable error) { + if (error.isNull()) { + this.error = null; + } else if (error.isEmpty()) { + this.error = Optional.empty(); + } else { + this.error = Optional.of(error.get()); + } + return this; + } + /** *

Error message if validation failed

* @return Reference to {@code this} so that method calls can be chained together. @@ -479,6 +709,18 @@ public _FinalStage error(Optional error) { return this; } + @java.lang.Override + public _FinalStage app(Nullable app) { + if (app.isNull()) { + this.app = null; + } else if (app.isEmpty()) { + this.app = Optional.empty(); + } else { + this.app = Optional.of(app.get()); + } + return this; + } + @java.lang.Override public _FinalStage app(App app) { this.app = Optional.ofNullable(app); diff --git a/src/test/java/com/pipedream/api/OauthTokensWireTest.java b/src/test/java/com/pipedream/api/OauthTokensWireTest.java deleted file mode 100644 index 0979f9c..0000000 --- a/src/test/java/com/pipedream/api/OauthTokensWireTest.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.pipedream.api; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; -import com.pipedream.api.types.CreateOAuthTokenResponse; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public class OauthTokensWireTest { - private MockWebServer server; - private BaseClient client; - private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; - - @BeforeEach - public void setup() throws Exception { - server = new MockWebServer(); - server.start(); - client = BaseClient.builder().url(server.url("/").toString()).build(); - } - - @AfterEach - public void teardown() throws Exception { - server.shutdown(); - } - - @Test - public void testCreate() throws Exception { - server.enqueue(new MockResponse() - .setResponseCode(200) - .setBody("{\"access_token\":\"access_token\",\"token_type\":\"token_type\",\"expires_in\":1}")); - CreateOAuthTokenResponse response = client.oauthTokens() - .create(CreateOAuthTokenOpts.builder() - .clientId("client_id") - .clientSecret("client_secret") - .build()); - RecordedRequest request = server.takeRequest(); - Assertions.assertNotNull(request); - Assertions.assertEquals("POST", request.getMethod()); - // Validate request body - String actualRequestBody = request.getBody().readUtf8(); - String expectedRequestBody = "" - + "{\n" - + " \"grant_type\": \"client_credentials\",\n" - + " \"client_id\": \"client_id\",\n" - + " \"client_secret\": \"client_secret\"\n" - + "}"; - JsonNode actualJson = objectMapper.readTree(actualRequestBody); - JsonNode expectedJson = objectMapper.readTree(expectedRequestBody); - Assertions.assertEquals(expectedJson, actualJson, "Request body structure does not match expected"); - if (actualJson.has("type") || actualJson.has("_type") || actualJson.has("kind")) { - String discriminator = null; - if (actualJson.has("type")) discriminator = actualJson.get("type").asText(); - else if (actualJson.has("_type")) - discriminator = actualJson.get("_type").asText(); - else if (actualJson.has("kind")) - discriminator = actualJson.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualJson.isNull()) { - Assertions.assertTrue( - actualJson.isObject() || actualJson.isArray() || actualJson.isValueNode(), - "request should be a valid JSON value"); - } - - if (actualJson.isArray()) { - Assertions.assertTrue(actualJson.size() >= 0, "Array should have valid size"); - } - if (actualJson.isObject()) { - Assertions.assertTrue(actualJson.size() >= 0, "Object should have valid field count"); - } - - // Validate response body - Assertions.assertNotNull(response, "Response should not be null"); - String actualResponseJson = objectMapper.writeValueAsString(response); - String expectedResponseBody = "" - + "{\n" - + " \"access_token\": \"access_token\",\n" - + " \"token_type\": \"token_type\",\n" - + " \"expires_in\": 1\n" - + "}"; - JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); - JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); - Assertions.assertEquals( - expectedResponseNode, actualResponseNode, "Response body structure does not match expected"); - if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { - String discriminator = null; - if (actualResponseNode.has("type")) - discriminator = actualResponseNode.get("type").asText(); - else if (actualResponseNode.has("_type")) - discriminator = actualResponseNode.get("_type").asText(); - else if (actualResponseNode.has("kind")) - discriminator = actualResponseNode.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualResponseNode.isNull()) { - Assertions.assertTrue( - actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), - "response should be a valid JSON value"); - } - - if (actualResponseNode.isArray()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); - } - if (actualResponseNode.isObject()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); - } - } -} diff --git a/src/test/java/com/pipedream/api/TokensWireTest.java b/src/test/java/com/pipedream/api/TokensWireTest.java deleted file mode 100644 index 0762707..0000000 --- a/src/test/java/com/pipedream/api/TokensWireTest.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.pipedream.api; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.resources.tokens.requests.TokensValidateRequest; -import com.pipedream.api.types.ValidateTokenResponse; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -public class TokensWireTest { - private MockWebServer server; - private BaseClient client; - private ObjectMapper objectMapper = ObjectMappers.JSON_MAPPER; - - @BeforeEach - public void setup() throws Exception { - server = new MockWebServer(); - server.start(); - client = BaseClient.builder().url(server.url("/").toString()).build(); - } - - @AfterEach - public void teardown() throws Exception { - server.shutdown(); - } - - @Test - public void testValidate() throws Exception { - server.enqueue( - new MockResponse() - .setResponseCode(200) - .setBody( - "{\"app\":{\"id\":\"id\",\"name_slug\":\"name_slug\",\"name\":\"name\",\"auth_type\":\"keys\",\"description\":\"description\",\"img_src\":\"img_src\",\"custom_fields_json\":\"custom_fields_json\",\"categories\":[\"categories\"],\"featured_weight\":1.1},\"error\":\"error\",\"error_redirect_uri\":\"error_redirect_uri\",\"oauth_app_id\":\"oauth_app_id\",\"project_app_name\":\"project_app_name\",\"project_environment\":\"project_environment\",\"project_id\":\"project_id\",\"project_support_email\":\"project_support_email\",\"success\":true,\"success_redirect_uri\":\"success_redirect_uri\"}")); - ValidateTokenResponse response = client.tokens() - .validate( - "ctok", - TokensValidateRequest.builder() - .appId("app_id") - .oauthAppId("oauth_app_id") - .build()); - RecordedRequest request = server.takeRequest(); - Assertions.assertNotNull(request); - Assertions.assertEquals("GET", request.getMethod()); - - // Validate response body - Assertions.assertNotNull(response, "Response should not be null"); - String actualResponseJson = objectMapper.writeValueAsString(response); - String expectedResponseBody = "" - + "{\n" - + " \"app\": {\n" - + " \"id\": \"id\",\n" - + " \"name_slug\": \"name_slug\",\n" - + " \"name\": \"name\",\n" - + " \"auth_type\": \"keys\",\n" - + " \"description\": \"description\",\n" - + " \"img_src\": \"img_src\",\n" - + " \"custom_fields_json\": \"custom_fields_json\",\n" - + " \"categories\": [\n" - + " \"categories\"\n" - + " ],\n" - + " \"featured_weight\": 1.1\n" - + " },\n" - + " \"error\": \"error\",\n" - + " \"error_redirect_uri\": \"error_redirect_uri\",\n" - + " \"oauth_app_id\": \"oauth_app_id\",\n" - + " \"project_app_name\": \"project_app_name\",\n" - + " \"project_environment\": \"project_environment\",\n" - + " \"project_id\": \"project_id\",\n" - + " \"project_support_email\": \"project_support_email\",\n" - + " \"success\": true,\n" - + " \"success_redirect_uri\": \"success_redirect_uri\"\n" - + "}"; - JsonNode actualResponseNode = objectMapper.readTree(actualResponseJson); - JsonNode expectedResponseNode = objectMapper.readTree(expectedResponseBody); - Assertions.assertEquals( - expectedResponseNode, actualResponseNode, "Response body structure does not match expected"); - if (actualResponseNode.has("type") || actualResponseNode.has("_type") || actualResponseNode.has("kind")) { - String discriminator = null; - if (actualResponseNode.has("type")) - discriminator = actualResponseNode.get("type").asText(); - else if (actualResponseNode.has("_type")) - discriminator = actualResponseNode.get("_type").asText(); - else if (actualResponseNode.has("kind")) - discriminator = actualResponseNode.get("kind").asText(); - Assertions.assertNotNull(discriminator, "Union type should have a discriminator field"); - Assertions.assertFalse(discriminator.isEmpty(), "Union discriminator should not be empty"); - } - - if (!actualResponseNode.isNull()) { - Assertions.assertTrue( - actualResponseNode.isObject() || actualResponseNode.isArray() || actualResponseNode.isValueNode(), - "response should be a valid JSON value"); - } - - if (actualResponseNode.isArray()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Array should have valid size"); - } - if (actualResponseNode.isObject()) { - Assertions.assertTrue(actualResponseNode.size() >= 0, "Object should have valid field count"); - } - } -}