From 3cde22413e6290d2abd295ff86b16da6c76d07f0 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 19:25:10 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-java-sdk: 4.8.4 --- .fern/metadata.json | 11 +- README.md | 5 +- build.gradle | 4 +- .../com/pipedream/api/core/ClientOptions.java | 4 +- .../pipedream/api/errors/BadGatewayError.java | 32 + .../api/errors/InternalServerError.java | 32 + .../api/errors/NotImplementedError.java | 33 + .../api/errors/ServiceUnavailableError.java | 33 + .../api/errors/UnauthorizedError.java | 32 + .../api/resources/apps/AppsClient.java | 49 +- .../api/resources/apps/AsyncAppsClient.java | 50 +- .../resources/apps/AsyncRawAppsClient.java | 267 +++++-- .../api/resources/apps/RawAppsClient.java | 205 +++++- .../apps/requests/AppsListRequest.java | 365 ++++++---- .../types/AppsListRequestSortDirection.java | 84 --- .../apps/types/AppsListRequestSortKey.java | 95 --- .../com/pipedream/api/types/AppDocument.java | 649 ++++++++++++++++++ .../com/pipedream/api/types/AppResponse.java | 118 ++++ .../com/pipedream/api/types/AppsPageInfo.java | 253 +++++++ .../pipedream/api/types/ErrorResponse.java | 107 +-- .../com/pipedream/api/types/FacetValue.java | 140 ++++ .../pipedream/api/types/FacetsResponse.java | 116 ++++ .../com/pipedream/api/types/ListResponse.java | 162 +++++ .../com/pipedream/api/types/ScopeProfile.java | 194 ++++++ .../api/types/ValidateTokenResponse.java | 45 ++ 25 files changed, 2540 insertions(+), 545 deletions(-) create mode 100644 src/main/java/com/pipedream/api/errors/BadGatewayError.java create mode 100644 src/main/java/com/pipedream/api/errors/InternalServerError.java create mode 100644 src/main/java/com/pipedream/api/errors/NotImplementedError.java create mode 100644 src/main/java/com/pipedream/api/errors/ServiceUnavailableError.java create mode 100644 src/main/java/com/pipedream/api/errors/UnauthorizedError.java delete mode 100644 src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortDirection.java delete mode 100644 src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java create mode 100644 src/main/java/com/pipedream/api/types/AppDocument.java create mode 100644 src/main/java/com/pipedream/api/types/AppResponse.java create mode 100644 src/main/java/com/pipedream/api/types/AppsPageInfo.java create mode 100644 src/main/java/com/pipedream/api/types/FacetValue.java create mode 100644 src/main/java/com/pipedream/api/types/FacetsResponse.java create mode 100644 src/main/java/com/pipedream/api/types/ListResponse.java create mode 100644 src/main/java/com/pipedream/api/types/ScopeProfile.java diff --git a/.fern/metadata.json b/.fern/metadata.json index b960837..5a5ec41 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -10,9 +10,8 @@ ], "retry-status-codes": "legacy" }, - "originGitCommit": "0154aca6f568afe2b2c183a43a8454aa86412754", - "originGitCommitIsDirty": false, - "invokedBy": "ci", - "ciProvider": "github", - "sdkVersion": "2.1.0" -} + "originGitCommit": "e486216779bf25a6e0373cbd18ea78968134cc6f", + "originGitCommitIsDirty": true, + "invokedBy": "manual", + "sdkVersion": "2.1.1" +} \ No newline at end of file diff --git a/README.md b/README.md index f2529a9..8fb2837 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Add the dependency in your `build.gradle` file: ```groovy dependencies { - implementation 'com.pipedream:pipedream:2.1.0' + implementation 'com.pipedream:pipedream:2.1.1' } ``` @@ -42,7 +42,7 @@ Add the dependency in your `pom.xml` file: com.pipedream pipedream - 2.1.0 + 2.1.1 ``` @@ -267,3 +267,4 @@ On the other hand, contributions to the README are always very welcome! ## Reference A full reference for this library is available [here](https://github.com/PipedreamHQ/pipedream-sdk-java/blob/HEAD/./reference.md). + diff --git a/build.gradle b/build.gradle index 6d6eb8d..1fe1ce3 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ java { group = 'com.pipedream' -version = '2.1.0' +version = '2.1.1' jar { dependsOn(":generatePomFileForMavenPublication") @@ -79,7 +79,7 @@ publishing { maven(MavenPublication) { groupId = 'com.pipedream' artifactId = 'pipedream' - version = '2.1.0' + version = '2.1.1' from components.java pom { name = 'pipedream' diff --git a/src/main/java/com/pipedream/api/core/ClientOptions.java b/src/main/java/com/pipedream/api/core/ClientOptions.java index 0d8862c..6071745 100644 --- a/src/main/java/com/pipedream/api/core/ClientOptions.java +++ b/src/main/java/com/pipedream/api/core/ClientOptions.java @@ -41,10 +41,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.pipedream:pipedream/2.1.0"); + put("User-Agent", "com.pipedream:pipedream/2.1.1"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk"); - put("X-Fern-SDK-Version", "2.1.0"); + put("X-Fern-SDK-Version", "2.1.1"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/pipedream/api/errors/BadGatewayError.java b/src/main/java/com/pipedream/api/errors/BadGatewayError.java new file mode 100644 index 0000000..1f865fa --- /dev/null +++ b/src/main/java/com/pipedream/api/errors/BadGatewayError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.errors; + +import com.pipedream.api.core.BaseClientApiException; +import okhttp3.Response; + +public final class BadGatewayError extends BaseClientApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public BadGatewayError(Object body) { + super("BadGatewayError", 502, body); + this.body = body; + } + + public BadGatewayError(Object body, Response rawResponse) { + super("BadGatewayError", 502, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/pipedream/api/errors/InternalServerError.java b/src/main/java/com/pipedream/api/errors/InternalServerError.java new file mode 100644 index 0000000..fe6cd6d --- /dev/null +++ b/src/main/java/com/pipedream/api/errors/InternalServerError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.errors; + +import com.pipedream.api.core.BaseClientApiException; +import okhttp3.Response; + +public final class InternalServerError extends BaseClientApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public InternalServerError(Object body) { + super("InternalServerError", 500, body); + this.body = body; + } + + public InternalServerError(Object body, Response rawResponse) { + super("InternalServerError", 500, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} diff --git a/src/main/java/com/pipedream/api/errors/NotImplementedError.java b/src/main/java/com/pipedream/api/errors/NotImplementedError.java new file mode 100644 index 0000000..c325a18 --- /dev/null +++ b/src/main/java/com/pipedream/api/errors/NotImplementedError.java @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.errors; + +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.types.ErrorResponse; +import okhttp3.Response; + +public final class NotImplementedError extends BaseClientApiException { + /** + * The body of the response that triggered the exception. + */ + private final ErrorResponse body; + + public NotImplementedError(ErrorResponse body) { + super("NotImplementedError", 501, body); + this.body = body; + } + + public NotImplementedError(ErrorResponse body, Response rawResponse) { + super("NotImplementedError", 501, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public ErrorResponse body() { + return this.body; + } +} diff --git a/src/main/java/com/pipedream/api/errors/ServiceUnavailableError.java b/src/main/java/com/pipedream/api/errors/ServiceUnavailableError.java new file mode 100644 index 0000000..4f7e2a9 --- /dev/null +++ b/src/main/java/com/pipedream/api/errors/ServiceUnavailableError.java @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.errors; + +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.types.ErrorResponse; +import okhttp3.Response; + +public final class ServiceUnavailableError extends BaseClientApiException { + /** + * The body of the response that triggered the exception. + */ + private final ErrorResponse body; + + public ServiceUnavailableError(ErrorResponse body) { + super("ServiceUnavailableError", 503, body); + this.body = body; + } + + public ServiceUnavailableError(ErrorResponse body, Response rawResponse) { + super("ServiceUnavailableError", 503, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public ErrorResponse body() { + return this.body; + } +} diff --git a/src/main/java/com/pipedream/api/errors/UnauthorizedError.java b/src/main/java/com/pipedream/api/errors/UnauthorizedError.java new file mode 100644 index 0000000..71bc17c --- /dev/null +++ b/src/main/java/com/pipedream/api/errors/UnauthorizedError.java @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.errors; + +import com.pipedream.api.core.BaseClientApiException; +import okhttp3.Response; + +public final class UnauthorizedError extends BaseClientApiException { + /** + * The body of the response that triggered the exception. + */ + private final Object body; + + public UnauthorizedError(Object body) { + super("UnauthorizedError", 401, body); + this.body = body; + } + + public UnauthorizedError(Object body, Response rawResponse) { + super("UnauthorizedError", 401, body, rawResponse); + this.body = body; + } + + /** + * @return the body + */ + @java.lang.Override + public Object body() { + return this.body; + } +} 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 bae9766..2849445 100644 --- a/src/main/java/com/pipedream/api/resources/apps/AppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/AppsClient.java @@ -7,8 +7,9 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.apps.requests.AppsListRequest; -import com.pipedream.api.types.App; -import com.pipedream.api.types.GetAppResponse; +import com.pipedream.api.types.AppDocument; +import com.pipedream.api.types.AppResponse; +import com.pipedream.api.types.FacetsResponse; public class AppsClient { protected final ClientOptions clientOptions; @@ -27,45 +28,53 @@ public RawAppsClient withRawResponse() { return this.rawClient; } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public SyncPagingIterable list() { + public SyncPagingIterable list() { return this.rawClient.list().body(); } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public SyncPagingIterable list(RequestOptions requestOptions) { + public SyncPagingIterable list(RequestOptions requestOptions) { return this.rawClient.list(requestOptions).body(); } + public SyncPagingIterable list(AppsListRequest request) { + return this.rawClient.list(request).body(); + } + + public SyncPagingIterable list(AppsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + /** - * Retrieve all available apps with optional filtering and sorting + * Mirrors V1::AppsController#v2_facets (AppTypesenseSearch.facets): + * returns { data: { category_name: [...], auth_type: [...] } }. */ - public SyncPagingIterable list(AppsListRequest request) { - return this.rawClient.list(request).body(); + public FacetsResponse facets() { + return this.rawClient.facets().body(); } /** - * Retrieve all available apps with optional filtering and sorting + * Mirrors V1::AppsController#v2_facets (AppTypesenseSearch.facets): + * returns { data: { category_name: [...], auth_type: [...] } }. */ - public SyncPagingIterable list(AppsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).body(); + public FacetsResponse facets(RequestOptions requestOptions) { + return this.rawClient.facets(requestOptions).body(); } /** - * Get detailed information about a specific app by ID or name slug + * Looks up a single app by hashid (e.g. app_abc123) or name_slug (e.g. github). + * If the value starts with app_ it is treated as a hashid and matched against + * the document id field; otherwise it is matched against name_slug. */ - public GetAppResponse retrieve(String appId) { + public AppResponse retrieve(String appId) { return this.rawClient.retrieve(appId).body(); } /** - * Get detailed information about a specific app by ID or name slug + * Looks up a single app by hashid (e.g. app_abc123) or name_slug (e.g. github). + * If the value starts with app_ it is treated as a hashid and matched against + * the document id field; otherwise it is matched against name_slug. */ - public GetAppResponse retrieve(String appId, RequestOptions requestOptions) { + public AppResponse retrieve(String appId, RequestOptions requestOptions) { return this.rawClient.retrieve(appId, 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 65257a4..37312f2 100644 --- a/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/AsyncAppsClient.java @@ -7,8 +7,9 @@ import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; import com.pipedream.api.resources.apps.requests.AppsListRequest; -import com.pipedream.api.types.App; -import com.pipedream.api.types.GetAppResponse; +import com.pipedream.api.types.AppDocument; +import com.pipedream.api.types.AppResponse; +import com.pipedream.api.types.FacetsResponse; import java.util.concurrent.CompletableFuture; public class AsyncAppsClient { @@ -28,45 +29,54 @@ public AsyncRawAppsClient withRawResponse() { return this.rawClient; } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public CompletableFuture> list() { + public CompletableFuture> list() { return this.rawClient.list().thenApply(response -> response.body()); } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public CompletableFuture> list(RequestOptions requestOptions) { + public CompletableFuture> list(RequestOptions requestOptions) { return this.rawClient.list(requestOptions).thenApply(response -> response.body()); } + public CompletableFuture> list(AppsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + public CompletableFuture> list( + AppsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + /** - * Retrieve all available apps with optional filtering and sorting + * Mirrors V1::AppsController#v2_facets (AppTypesenseSearch.facets): + * returns { data: { category_name: [...], auth_type: [...] } }. */ - public CompletableFuture> list(AppsListRequest request) { - return this.rawClient.list(request).thenApply(response -> response.body()); + public CompletableFuture facets() { + return this.rawClient.facets().thenApply(response -> response.body()); } /** - * Retrieve all available apps with optional filtering and sorting + * Mirrors V1::AppsController#v2_facets (AppTypesenseSearch.facets): + * returns { data: { category_name: [...], auth_type: [...] } }. */ - public CompletableFuture> list(AppsListRequest request, RequestOptions requestOptions) { - return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + public CompletableFuture facets(RequestOptions requestOptions) { + return this.rawClient.facets(requestOptions).thenApply(response -> response.body()); } /** - * Get detailed information about a specific app by ID or name slug + * Looks up a single app by hashid (e.g. app_abc123) or name_slug (e.g. github). + * If the value starts with app_ it is treated as a hashid and matched against + * the document id field; otherwise it is matched against name_slug. */ - public CompletableFuture retrieve(String appId) { + public CompletableFuture retrieve(String appId) { return this.rawClient.retrieve(appId).thenApply(response -> response.body()); } /** - * Get detailed information about a specific app by ID or name slug + * Looks up a single app by hashid (e.g. app_abc123) or name_slug (e.g. github). + * If the value starts with app_ it is treated as a hashid and matched against + * the document id field; otherwise it is matched against name_slug. */ - public CompletableFuture retrieve(String appId, RequestOptions requestOptions) { + public CompletableFuture retrieve(String appId, RequestOptions requestOptions) { return this.rawClient.retrieve(appId, 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 8aace63..2ac0e26 100644 --- a/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java @@ -3,6 +3,7 @@ */ package com.pipedream.api.resources.apps; +import com.fasterxml.jackson.core.JsonProcessingException; import com.pipedream.api.core.BaseClientApiException; import com.pipedream.api.core.BaseClientException; import com.pipedream.api.core.BaseClientHttpResponse; @@ -11,10 +12,19 @@ import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; +import com.pipedream.api.errors.BadGatewayError; +import com.pipedream.api.errors.BadRequestError; +import com.pipedream.api.errors.InternalServerError; +import com.pipedream.api.errors.NotFoundError; +import com.pipedream.api.errors.NotImplementedError; +import com.pipedream.api.errors.ServiceUnavailableError; +import com.pipedream.api.errors.UnauthorizedError; import com.pipedream.api.resources.apps.requests.AppsListRequest; -import com.pipedream.api.types.App; -import com.pipedream.api.types.GetAppResponse; -import com.pipedream.api.types.ListAppsResponse; +import com.pipedream.api.types.AppDocument; +import com.pipedream.api.types.AppResponse; +import com.pipedream.api.types.ErrorResponse; +import com.pipedream.api.types.FacetsResponse; +import com.pipedream.api.types.ListResponse; import java.io.IOException; import java.util.List; import java.util.Optional; @@ -37,35 +47,31 @@ public AsyncRawAppsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(AppsListRequest.builder().build()); } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public CompletableFuture>> list(RequestOptions requestOptions) { + public CompletableFuture>> list( + RequestOptions requestOptions) { return list(AppsListRequest.builder().build(), requestOptions); } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public CompletableFuture>> list(AppsListRequest request) { + public CompletableFuture>> list(AppsListRequest request) { return list(request, null); } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public CompletableFuture>> list( + public CompletableFuture>> list( AppsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps"); + if (request.getQ().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); + } + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } if (request.getAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "after", request.getAfter().get(), false); @@ -74,12 +80,9 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "before", request.getBefore().get(), false); } - if (request.getLimit().isPresent()) { + if (request.getPage().isPresent()) { QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); + httpUrl, "page", request.getPage().get(), false); } if (request.getSortKey().isPresent()) { QueryStringMapper.addQueryParameter( @@ -89,6 +92,18 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "sort_direction", request.getSortDirection().get(), false); } + if (request.getCategoryName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category_name", request.getCategoryName().get(), false); + } + if (request.getCategoryIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category_ids", request.getCategoryIds().get(), false); + } + if (request.getAuthType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "auth_type", request.getAuthType().get(), false); + } if (request.getHasComponents().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "has_components", request.getHasComponents().get(), false); @@ -101,9 +116,12 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "has_triggers", request.getHasTriggers().get(), false); } - if (request.getCategoryIds().isPresent()) { + if (request.getHasPrivateComponents().isPresent()) { QueryStringMapper.addQueryParameter( - httpUrl, "category_ids", request.getCategoryIds().get(), true); + httpUrl, + "has_private_components", + request.getHasPrivateComponents().get(), + false); } if (requestOptions != null) { requestOptions.getQueryParameters().forEach((_key, _value) -> { @@ -120,35 +138,158 @@ public CompletableFuture>> list( 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()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - ListAppsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListAppsResponse.class); + ListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); AppsListRequest nextRequest = AppsListRequest.builder() .from(request) .after(startingAfter) .build(); - List result = parsedResponse.getData(); + List result = parsedResponse.getData(); + future.complete(new BaseClientHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 501: + future.completeExceptionally(new NotImplementedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), + response)); + return; + case 502: + future.completeExceptionally(new BadGatewayError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), + response)); + return; + } + } 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(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Mirrors V1::AppsController#v2_facets (AppTypesenseSearch.facets): + * returns { data: { category_name: [...], auth_type: [...] } }. + */ + public CompletableFuture> facets() { + return facets(null); + } + + /** + * Mirrors V1::AppsController#v2_facets (AppTypesenseSearch.facets): + * returns { data: { category_name: [...], auth_type: [...] } }. + */ + public CompletableFuture> facets(RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/connect/apps/facets"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { - try { - return list(nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FacetsResponse.class), response)); return; } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 502: + future.completeExceptionally(new BadGatewayError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), + response)); + return; + } + } 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(), errorBody, response)); @@ -167,16 +308,20 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Get detailed information about a specific app by ID or name slug + * Looks up a single app by hashid (e.g. app_abc123) or name_slug (e.g. github). + * If the value starts with app_ it is treated as a hashid and matched against + * the document id field; otherwise it is matched against name_slug. */ - public CompletableFuture> retrieve(String appId) { + public CompletableFuture> retrieve(String appId) { return retrieve(appId, null); } /** - * Get detailed information about a specific app by ID or name slug + * Looks up a single app by hashid (e.g. app_abc123) or name_slug (e.g. github). + * If the value starts with app_ it is treated as a hashid and matched against + * the document id field; otherwise it is matched against name_slug. */ - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String appId, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -197,7 +342,7 @@ public CompletableFuture> retrieve( 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 { @@ -205,10 +350,40 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetAppResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AppResponse.class), response)); return; } + try { + switch (response.code()) { + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 502: + future.completeExceptionally(new BadGatewayError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 503: + future.completeExceptionally(new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), + response)); + return; + } + } 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(), errorBody, response)); 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 8ccc408..14733be 100644 --- a/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java @@ -3,6 +3,7 @@ */ package com.pipedream.api.resources.apps; +import com.fasterxml.jackson.core.JsonProcessingException; import com.pipedream.api.core.BaseClientApiException; import com.pipedream.api.core.BaseClientException; import com.pipedream.api.core.BaseClientHttpResponse; @@ -11,10 +12,19 @@ import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; +import com.pipedream.api.errors.BadGatewayError; +import com.pipedream.api.errors.BadRequestError; +import com.pipedream.api.errors.InternalServerError; +import com.pipedream.api.errors.NotFoundError; +import com.pipedream.api.errors.NotImplementedError; +import com.pipedream.api.errors.ServiceUnavailableError; +import com.pipedream.api.errors.UnauthorizedError; import com.pipedream.api.resources.apps.requests.AppsListRequest; -import com.pipedream.api.types.App; -import com.pipedream.api.types.GetAppResponse; -import com.pipedream.api.types.ListAppsResponse; +import com.pipedream.api.types.AppDocument; +import com.pipedream.api.types.AppResponse; +import com.pipedream.api.types.ErrorResponse; +import com.pipedream.api.types.FacetsResponse; +import com.pipedream.api.types.ListResponse; import java.io.IOException; import java.util.List; import java.util.Optional; @@ -32,35 +42,30 @@ public RawAppsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public BaseClientHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(AppsListRequest.builder().build()); } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public BaseClientHttpResponse> list(RequestOptions requestOptions) { + public BaseClientHttpResponse> list(RequestOptions requestOptions) { return list(AppsListRequest.builder().build(), requestOptions); } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public BaseClientHttpResponse> list(AppsListRequest request) { + public BaseClientHttpResponse> list(AppsListRequest request) { return list(request, null); } - /** - * Retrieve all available apps with optional filtering and sorting - */ - public BaseClientHttpResponse> list( + public BaseClientHttpResponse> list( AppsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps"); + if (request.getQ().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); + } + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } if (request.getAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "after", request.getAfter().get(), false); @@ -69,12 +74,9 @@ public BaseClientHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "before", request.getBefore().get(), false); } - if (request.getLimit().isPresent()) { + if (request.getPage().isPresent()) { QueryStringMapper.addQueryParameter( - httpUrl, "limit", request.getLimit().get(), false); - } - if (request.getQ().isPresent()) { - QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); + httpUrl, "page", request.getPage().get(), false); } if (request.getSortKey().isPresent()) { QueryStringMapper.addQueryParameter( @@ -84,6 +86,18 @@ public BaseClientHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "sort_direction", request.getSortDirection().get(), false); } + if (request.getCategoryName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category_name", request.getCategoryName().get(), false); + } + if (request.getCategoryIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category_ids", request.getCategoryIds().get(), false); + } + if (request.getAuthType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "auth_type", request.getAuthType().get(), false); + } if (request.getHasComponents().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "has_components", request.getHasComponents().get(), false); @@ -96,9 +110,12 @@ public BaseClientHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "has_triggers", request.getHasTriggers().get(), false); } - if (request.getCategoryIds().isPresent()) { + if (request.getHasPrivateComponents().isPresent()) { QueryStringMapper.addQueryParameter( - httpUrl, "category_ids", request.getCategoryIds().get(), true); + httpUrl, + "has_private_components", + request.getHasPrivateComponents().get(), + false); } if (requestOptions != null) { requestOptions.getQueryParameters().forEach((_key, _value) -> { @@ -119,20 +136,109 @@ public BaseClientHttpResponse> list( ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - ListAppsResponse parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListAppsResponse.class); + ListResponse parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ListResponse.class); Optional startingAfter = parsedResponse.getPageInfo().getEndCursor(); AppsListRequest nextRequest = AppsListRequest.builder() .from(request) .after(startingAfter) .build(); - List result = parsedResponse.getData(); + List result = parsedResponse.getData(); return new BaseClientHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( - nextRequest, requestOptions) - .body()), + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), response); } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 501: + throw new NotImplementedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), response); + case 502: + throw new BadGatewayError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), response); + } + } 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(), errorBody, response); + } catch (IOException e) { + throw new BaseClientException("Network error executing HTTP request", e); + } + } + + /** + * Mirrors V1::AppsController#v2_facets (AppTypesenseSearch.facets): + * returns { data: { category_name: [...], auth_type: [...] } }. + */ + public BaseClientHttpResponse facets() { + return facets(null); + } + + /** + * Mirrors V1::AppsController#v2_facets (AppTypesenseSearch.facets): + * returns { data: { category_name: [...], auth_type: [...] } }. + */ + public BaseClientHttpResponse facets(RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/connect/apps/facets"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new BaseClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FacetsResponse.class), response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 502: + throw new BadGatewayError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), response); + } + } 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(), errorBody, response); @@ -142,16 +248,20 @@ public BaseClientHttpResponse> list( } /** - * Get detailed information about a specific app by ID or name slug + * Looks up a single app by hashid (e.g. app_abc123) or name_slug (e.g. github). + * If the value starts with app_ it is treated as a hashid and matched against + * the document id field; otherwise it is matched against name_slug. */ - public BaseClientHttpResponse retrieve(String appId) { + public BaseClientHttpResponse retrieve(String appId) { return retrieve(appId, null); } /** - * Get detailed information about a specific app by ID or name slug + * Looks up a single app by hashid (e.g. app_abc123) or name_slug (e.g. github). + * If the value starts with app_ it is treated as a hashid and matched against + * the document id field; otherwise it is matched against name_slug. */ - public BaseClientHttpResponse retrieve(String appId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String appId, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps") @@ -176,7 +286,28 @@ public BaseClientHttpResponse retrieve(String appId, RequestOpti String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new BaseClientHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetAppResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AppResponse.class), response); + } + try { + switch (response.code()) { + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 502: + throw new BadGatewayError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 503: + throw new ServiceUnavailableError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ErrorResponse.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error } Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); throw new BaseClientApiException( diff --git a/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java b/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java index 2912552..d54ab01 100644 --- a/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java +++ b/src/main/java/com/pipedream/api/resources/apps/requests/AppsListRequest.java @@ -12,11 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.resources.apps.types.AppsListRequestSortDirection; -import com.pipedream.api.resources.apps.types.AppsListRequestSortKey; -import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -24,63 +20,82 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AppsListRequest.Builder.class) public final class AppsListRequest { - private final Optional> categoryIds; + private final Optional q; + + private final Optional limit; private final Optional after; private final Optional before; - private final Optional limit; + private final Optional page; - private final Optional q; + private final Optional sortKey; + + private final Optional sortDirection; + + private final Optional categoryName; - private final Optional sortKey; + private final Optional categoryIds; - private final Optional sortDirection; + private final Optional authType; - private final Optional hasComponents; + private final Optional hasComponents; - private final Optional hasActions; + private final Optional hasActions; - private final Optional hasTriggers; + private final Optional hasTriggers; + + private final Optional hasPrivateComponents; private final Map additionalProperties; private AppsListRequest( - Optional> categoryIds, + Optional q, + Optional limit, Optional after, Optional before, - Optional limit, - Optional q, - Optional sortKey, - Optional sortDirection, - Optional hasComponents, - Optional hasActions, - Optional hasTriggers, + Optional page, + Optional sortKey, + Optional sortDirection, + Optional categoryName, + Optional categoryIds, + Optional authType, + Optional hasComponents, + Optional hasActions, + Optional hasTriggers, + Optional hasPrivateComponents, Map additionalProperties) { - this.categoryIds = categoryIds; + this.q = q; + this.limit = limit; this.after = after; this.before = before; - this.limit = limit; - this.q = q; + this.page = page; this.sortKey = sortKey; this.sortDirection = sortDirection; + this.categoryName = categoryName; + this.categoryIds = categoryIds; + this.authType = authType; this.hasComponents = hasComponents; this.hasActions = hasActions; this.hasTriggers = hasTriggers; + this.hasPrivateComponents = hasPrivateComponents; this.additionalProperties = additionalProperties; } - /** - * @return Only return apps in these categories - */ - @JsonProperty("category_ids") - public Optional> getCategoryIds() { - return categoryIds; + @JsonProperty("q") + public Optional getQ() { + return q; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; } /** - * @return The cursor to start from for pagination + * @return Opaque cursor naming the next page, from a prior response's + * page_info.end_cursor (see [PageInfo]). */ @JsonProperty("after") public Optional getAfter() { @@ -88,7 +103,8 @@ public Optional getAfter() { } /** - * @return The cursor to end before for pagination + * @return Opaque cursor naming the previous page, from a prior response's + * page_info.start_cursor. */ @JsonProperty("before") public Optional getBefore() { @@ -96,61 +112,84 @@ public Optional getBefore() { } /** - * @return The maximum number of results to return - */ - @JsonProperty("limit") - public Optional getLimit() { - return limit; - } - - /** - * @return A search query to filter the apps + * @return 1-based page number for built-in page-based pagination. Used only when no + * before/after cursor is supplied (the cursor contract takes + * precedence); values < 1 are clamped to 1. Echoed back as page_info.page. */ - @JsonProperty("q") - public Optional getQ() { - return q; + @JsonProperty("page") + public Optional getPage() { + return page; } /** - * @return The key to sort the apps by + * @return Field to sort by, mirroring v1: one of name, name_slug, + * featured_weight. Defaults to name_slug. Invalid values → 400. */ @JsonProperty("sort_key") - public Optional getSortKey() { + public Optional getSortKey() { return sortKey; } /** - * @return The direction to sort the apps + * @return Sort direction, asc or desc. Defaults to asc. Invalid values → 400. */ @JsonProperty("sort_direction") - public Optional getSortDirection() { + public Optional getSortDirection() { return sortDirection; } + @JsonProperty("category_name") + public Optional getCategoryName() { + return categoryName; + } + /** - * @return Only return apps that have components (actions or triggers) + * @return AppCategory hashid (appcat_*) to filter by, mirroring the v1 apps + * category_ids param. A single value — real-world clients don't send + * multiple category_ids, so multiple keys are not supported. */ - @JsonProperty("has_components") - public Optional getHasComponents() { - return hasComponents; + @JsonProperty("category_ids") + public Optional getCategoryIds() { + return categoryIds; + } + + @JsonProperty("auth_type") + public Optional getAuthType() { + return authType; } /** - * @return Only return apps that have actions + * @return Component filters, mirroring Rails V1::AppsController#having_components: + * the param's presence selects the filter and its boolean value picks the + * direction (false/0/f/off/empty → apps without, anything else → + * apps with). has_components means "has actions or triggers". Only the + * first present of has_components > has_actions > has_triggers applies. */ + @JsonProperty("has_components") + public Optional getHasComponents() { + return hasComponents; + } + @JsonProperty("has_actions") - public Optional getHasActions() { + public Optional getHasActions() { return hasActions; } - /** - * @return Only return apps that have triggers - */ @JsonProperty("has_triggers") - public Optional getHasTriggers() { + public Optional getHasTriggers() { return hasTriggers; } + /** + * @return Not supported yet in the Rust port — Rails uses + * PublishedComponentTypesenseSearch.app_slugs_for_owner_keys here, and + * we haven't ported that. Returns 501 when set. + */ + @JsonProperty("has_private_components") + public Optional getHasPrivateComponents() { + return hasPrivateComponents; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -163,31 +202,39 @@ public Map getAdditionalProperties() { } private boolean equalTo(AppsListRequest other) { - return categoryIds.equals(other.categoryIds) + return q.equals(other.q) + && limit.equals(other.limit) && after.equals(other.after) && before.equals(other.before) - && limit.equals(other.limit) - && q.equals(other.q) + && page.equals(other.page) && sortKey.equals(other.sortKey) && sortDirection.equals(other.sortDirection) + && categoryName.equals(other.categoryName) + && categoryIds.equals(other.categoryIds) + && authType.equals(other.authType) && hasComponents.equals(other.hasComponents) && hasActions.equals(other.hasActions) - && hasTriggers.equals(other.hasTriggers); + && hasTriggers.equals(other.hasTriggers) + && hasPrivateComponents.equals(other.hasPrivateComponents); } @java.lang.Override public int hashCode() { return Objects.hash( - this.categoryIds, + this.q, + this.limit, this.after, this.before, - this.limit, - this.q, + this.page, this.sortKey, this.sortDirection, + this.categoryName, + this.categoryIds, + this.authType, this.hasComponents, this.hasActions, - this.hasTriggers); + this.hasTriggers, + this.hasPrivateComponents); } @java.lang.Override @@ -201,25 +248,33 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional> categoryIds = Optional.empty(); + private Optional q = Optional.empty(); + + private Optional limit = Optional.empty(); private Optional after = Optional.empty(); private Optional before = Optional.empty(); - private Optional limit = Optional.empty(); + private Optional page = Optional.empty(); - 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(); + private Optional categoryName = Optional.empty(); - private Optional hasComponents = Optional.empty(); + private Optional categoryIds = Optional.empty(); - private Optional hasActions = Optional.empty(); + private Optional authType = Optional.empty(); - private Optional hasTriggers = Optional.empty(); + private Optional hasComponents = Optional.empty(); + + private Optional hasActions = Optional.empty(); + + private Optional hasTriggers = Optional.empty(); + + private Optional hasPrivateComponents = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -227,40 +282,48 @@ public static final class Builder { private Builder() {} public Builder from(AppsListRequest other) { - categoryIds(other.getCategoryIds()); + q(other.getQ()); + limit(other.getLimit()); after(other.getAfter()); before(other.getBefore()); - limit(other.getLimit()); - q(other.getQ()); + page(other.getPage()); sortKey(other.getSortKey()); sortDirection(other.getSortDirection()); + categoryName(other.getCategoryName()); + categoryIds(other.getCategoryIds()); + authType(other.getAuthType()); hasComponents(other.getHasComponents()); hasActions(other.getHasActions()); hasTriggers(other.getHasTriggers()); + hasPrivateComponents(other.getHasPrivateComponents()); return this; } - /** - *

Only return apps in these categories

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

The cursor to start from for pagination

+ *

Opaque cursor naming the next page, from a prior response's + * page_info.end_cursor (see [PageInfo]).

*/ @JsonSetter(value = "after", nulls = Nulls.SKIP) public Builder after(Optional after) { @@ -274,7 +337,8 @@ public Builder after(String after) { } /** - *

The cursor to end before for pagination

+ *

Opaque cursor naming the previous page, from a prior response's + * page_info.start_cursor.

*/ @JsonSetter(value = "before", nulls = Nulls.SKIP) public Builder before(Optional before) { @@ -288,115 +352,160 @@ public Builder before(String before) { } /** - *

The maximum number of results to return

+ *

1-based page number for built-in page-based pagination. Used only when no + * before/after cursor is supplied (the cursor contract takes + * precedence); values < 1 are clamped to 1. Echoed back as page_info.page.

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

A search query to filter the apps

+ *

Field to sort by, mirroring v1: one of name, name_slug, + * featured_weight. Defaults to name_slug. Invalid values → 400.

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

The key to sort the apps by

+ *

Sort direction, asc or desc. Defaults to asc. Invalid values → 400.

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

The direction to sort the apps

+ *

AppCategory hashid (appcat_*) to filter by, mirroring the v1 apps + * category_ids param. A single value — real-world clients don't send + * multiple category_ids, so multiple keys are not supported.

*/ - @JsonSetter(value = "sort_direction", nulls = Nulls.SKIP) - public Builder sortDirection(Optional sortDirection) { - this.sortDirection = sortDirection; + @JsonSetter(value = "category_ids", nulls = Nulls.SKIP) + public Builder categoryIds(Optional categoryIds) { + this.categoryIds = categoryIds; return this; } - public Builder sortDirection(AppsListRequestSortDirection sortDirection) { - this.sortDirection = Optional.ofNullable(sortDirection); + public Builder categoryIds(String categoryIds) { + this.categoryIds = Optional.ofNullable(categoryIds); + return this; + } + + @JsonSetter(value = "auth_type", nulls = Nulls.SKIP) + public Builder authType(Optional authType) { + this.authType = authType; + return this; + } + + public Builder authType(String authType) { + this.authType = Optional.ofNullable(authType); return this; } /** - *

Only return apps that have components (actions or triggers)

+ *

Component filters, mirroring Rails V1::AppsController#having_components: + * the param's presence selects the filter and its boolean value picks the + * direction (false/0/f/off/empty → apps without, anything else → + * apps with). has_components means "has actions or triggers". Only the + * first present of has_components > has_actions > has_triggers applies.

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

Only return apps that have actions

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

Only return apps that have triggers

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

Not supported yet in the Rust port — Rails uses + * PublishedComponentTypesenseSearch.app_slugs_for_owner_keys here, and + * we haven't ported that. Returns 501 when set.

+ */ + @JsonSetter(value = "has_private_components", nulls = Nulls.SKIP) + public Builder hasPrivateComponents(Optional hasPrivateComponents) { + this.hasPrivateComponents = hasPrivateComponents; + return this; + } + + public Builder hasPrivateComponents(String hasPrivateComponents) { + this.hasPrivateComponents = Optional.ofNullable(hasPrivateComponents); + return this; + } + public AppsListRequest build() { return new AppsListRequest( - categoryIds, + q, + limit, after, before, - limit, - q, + page, sortKey, sortDirection, + categoryName, + categoryIds, + authType, hasComponents, hasActions, hasTriggers, + hasPrivateComponents, 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/AppsListRequestSortDirection.java deleted file mode 100644 index 0e84e8f..0000000 --- a/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortDirection.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public final class AppsListRequestSortDirection { - public static final AppsListRequestSortDirection ASC = new AppsListRequestSortDirection(Value.ASC, "asc"); - - public static final AppsListRequestSortDirection DESC = new AppsListRequestSortDirection(Value.DESC, "desc"); - - private final Value value; - - private final String string; - - AppsListRequestSortDirection(Value value, String string) { - this.value = value; - this.string = string; - } - - public Value getEnumValue() { - return value; - } - - @java.lang.Override - @JsonValue - public String toString() { - return this.string; - } - - @java.lang.Override - public boolean equals(Object other) { - return (this == other) - || (other instanceof AppsListRequestSortDirection - && this.string.equals(((AppsListRequestSortDirection) other).string)); - } - - @java.lang.Override - public int hashCode() { - return this.string.hashCode(); - } - - public T visit(Visitor visitor) { - switch (value) { - case ASC: - return visitor.visitAsc(); - case DESC: - return visitor.visitDesc(); - case UNKNOWN: - default: - return visitor.visitUnknown(string); - } - } - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static AppsListRequestSortDirection valueOf(String value) { - switch (value) { - case "asc": - return ASC; - case "desc": - return DESC; - default: - return new AppsListRequestSortDirection(Value.UNKNOWN, value); - } - } - - public enum Value { - ASC, - - DESC, - - UNKNOWN - } - - public interface Visitor { - T visitAsc(); - - T visitDesc(); - - T visitUnknown(String unknownType); - } -} diff --git a/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java b/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java deleted file mode 100644 index 16800bb..0000000 --- a/src/main/java/com/pipedream/api/resources/apps/types/AppsListRequestSortKey.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.pipedream.api.resources.apps.types; - -import com.fasterxml.jackson.annotation.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 static final AppsListRequestSortKey FEATURED_WEIGHT = - new AppsListRequestSortKey(Value.FEATURED_WEIGHT, "featured_weight"); - - public static final AppsListRequestSortKey NAME = new AppsListRequestSortKey(Value.NAME, "name"); - - private final Value value; - - private final String string; - - AppsListRequestSortKey(Value value, String string) { - this.value = value; - this.string = string; - } - - public Value getEnumValue() { - return value; - } - - @java.lang.Override - @JsonValue - public String toString() { - return this.string; - } - - @java.lang.Override - public boolean equals(Object other) { - return (this == other) - || (other instanceof AppsListRequestSortKey - && this.string.equals(((AppsListRequestSortKey) other).string)); - } - - @java.lang.Override - public int hashCode() { - return this.string.hashCode(); - } - - public T visit(Visitor visitor) { - switch (value) { - case NAME_SLUG: - return visitor.visitNameSlug(); - case FEATURED_WEIGHT: - return visitor.visitFeaturedWeight(); - case NAME: - return visitor.visitName(); - case UNKNOWN: - default: - return visitor.visitUnknown(string); - } - } - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static AppsListRequestSortKey valueOf(String value) { - switch (value) { - case "name_slug": - return NAME_SLUG; - case "featured_weight": - return FEATURED_WEIGHT; - case "name": - return NAME; - default: - return new AppsListRequestSortKey(Value.UNKNOWN, value); - } - } - - public enum Value { - NAME, - - NAME_SLUG, - - FEATURED_WEIGHT, - - UNKNOWN - } - - public interface Visitor { - T visitName(); - - T visitNameSlug(); - - T visitFeaturedWeight(); - - T visitUnknown(String unknownType); - } -} diff --git a/src/main/java/com/pipedream/api/types/AppDocument.java b/src/main/java/com/pipedream/api/types/AppDocument.java new file mode 100644 index 0000000..27391c5 --- /dev/null +++ b/src/main/java/com/pipedream/api/types/AppDocument.java @@ -0,0 +1,649 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AppDocument.Builder.class) +public final class AppDocument { + private final Optional authType; + + private final List categories; + + private final Optional categoryName; + + private final Optional customFieldsJson; + + private final String description; + + private final long featuredWeight; + + private final boolean hasActions; + + private final boolean hasTriggers; + + private final String id; + + private final String imgSrc; + + private final String name; + + private final String nameSlug; + + private final List scopeProfiles; + + private final Map additionalProperties; + + private AppDocument( + Optional authType, + List categories, + Optional categoryName, + Optional customFieldsJson, + String description, + long featuredWeight, + boolean hasActions, + boolean hasTriggers, + String id, + String imgSrc, + String name, + String nameSlug, + List scopeProfiles, + Map additionalProperties) { + this.authType = authType; + this.categories = categories; + this.categoryName = categoryName; + this.customFieldsJson = customFieldsJson; + this.description = description; + this.featuredWeight = featuredWeight; + this.hasActions = hasActions; + this.hasTriggers = hasTriggers; + this.id = id; + this.imgSrc = imgSrc; + this.name = name; + this.nameSlug = nameSlug; + this.scopeProfiles = scopeProfiles; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("auth_type") + public Optional getAuthType() { + return authType; + } + + /** + * @return Category names associated with the app. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return Human-readable category name (e.g. Developer Tools). + */ + @JsonProperty("category_name") + public Optional getCategoryName() { + return categoryName; + } + + /** + * @return JSON string of the app's custom fields; null when it defines none. Always + * present (normalize_app_doc restores the key), hence required — matching + * v1, which emits the key with a null value. + */ + @JsonProperty("custom_fields_json") + public Optional getCustomFieldsJson() { + return customFieldsJson; + } + + /** + * @return Short description; "" when the app has none (never null). + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * @return Sort weight; higher sorts first. + */ + @JsonProperty("featured_weight") + public long getFeaturedWeight() { + return featuredWeight; + } + + /** + * @return Whether the app has any actions. + */ + @JsonProperty("has_actions") + public boolean getHasActions() { + return hasActions; + } + + /** + * @return Whether the app has any triggers (sources). + */ + @JsonProperty("has_triggers") + public boolean getHasTriggers() { + return hasTriggers; + } + + /** + * @return App hashid (e.g. app_abc123). + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Logo URL. + */ + @JsonProperty("img_src") + public String getImgSrc() { + return imgSrc; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return URL-safe identifier (e.g. github). + */ + @JsonProperty("name_slug") + public String getNameSlug() { + return nameSlug; + } + + /** + * @return Named subsets of the app's OAuth scopes. Empty for apps that define none. + */ + @JsonProperty("scope_profiles") + public List getScopeProfiles() { + return scopeProfiles; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AppDocument && equalTo((AppDocument) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AppDocument other) { + return authType.equals(other.authType) + && categories.equals(other.categories) + && categoryName.equals(other.categoryName) + && customFieldsJson.equals(other.customFieldsJson) + && description.equals(other.description) + && featuredWeight == other.featuredWeight + && hasActions == other.hasActions + && hasTriggers == other.hasTriggers + && id.equals(other.id) + && imgSrc.equals(other.imgSrc) + && name.equals(other.name) + && nameSlug.equals(other.nameSlug) + && scopeProfiles.equals(other.scopeProfiles); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.authType, + this.categories, + this.categoryName, + this.customFieldsJson, + this.description, + this.featuredWeight, + this.hasActions, + this.hasTriggers, + this.id, + this.imgSrc, + this.name, + this.nameSlug, + this.scopeProfiles); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DescriptionStage builder() { + return new Builder(); + } + + public interface DescriptionStage { + /** + *

Short description; "" when the app has none (never null).

+ */ + FeaturedWeightStage description(@NotNull String description); + + Builder from(AppDocument other); + } + + public interface FeaturedWeightStage { + /** + *

Sort weight; higher sorts first.

+ */ + HasActionsStage featuredWeight(long featuredWeight); + } + + public interface HasActionsStage { + /** + *

Whether the app has any actions.

+ */ + HasTriggersStage hasActions(boolean hasActions); + } + + public interface HasTriggersStage { + /** + *

Whether the app has any triggers (sources).

+ */ + IdStage hasTriggers(boolean hasTriggers); + } + + public interface IdStage { + /** + *

App hashid (e.g. app_abc123).

+ */ + ImgSrcStage id(@NotNull String id); + } + + public interface ImgSrcStage { + /** + *

Logo URL.

+ */ + NameStage imgSrc(@NotNull String imgSrc); + } + + public interface NameStage { + NameSlugStage name(@NotNull String name); + } + + public interface NameSlugStage { + /** + *

URL-safe identifier (e.g. github).

+ */ + _FinalStage nameSlug(@NotNull String nameSlug); + } + + public interface _FinalStage { + AppDocument build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage authType(Optional authType); + + _FinalStage authType(String authType); + + /** + *

Category names associated with the app.

+ */ + _FinalStage categories(List categories); + + _FinalStage addCategories(String categories); + + _FinalStage addAllCategories(List categories); + + /** + *

Human-readable category name (e.g. Developer Tools).

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

JSON string of the app's custom fields; null when it defines none. Always + * present (normalize_app_doc restores the key), hence required — matching + * v1, which emits the key with a null value.

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

Named subsets of the app's OAuth scopes. Empty for apps that define none.

+ */ + _FinalStage scopeProfiles(List scopeProfiles); + + _FinalStage addScopeProfiles(ScopeProfile scopeProfiles); + + _FinalStage addAllScopeProfiles(List scopeProfiles); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DescriptionStage, + FeaturedWeightStage, + HasActionsStage, + HasTriggersStage, + IdStage, + ImgSrcStage, + NameStage, + NameSlugStage, + _FinalStage { + private String description; + + private long featuredWeight; + + private boolean hasActions; + + private boolean hasTriggers; + + private String id; + + private String imgSrc; + + private String name; + + private String nameSlug; + + private List scopeProfiles = new ArrayList<>(); + + private Optional customFieldsJson = Optional.empty(); + + private Optional categoryName = Optional.empty(); + + private List categories = new ArrayList<>(); + + private Optional authType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AppDocument other) { + authType(other.getAuthType()); + categories(other.getCategories()); + categoryName(other.getCategoryName()); + customFieldsJson(other.getCustomFieldsJson()); + description(other.getDescription()); + featuredWeight(other.getFeaturedWeight()); + hasActions(other.getHasActions()); + hasTriggers(other.getHasTriggers()); + id(other.getId()); + imgSrc(other.getImgSrc()); + name(other.getName()); + nameSlug(other.getNameSlug()); + scopeProfiles(other.getScopeProfiles()); + return this; + } + + /** + *

Short description; "" when the app has none (never null).

+ *

Short description; "" when the app has none (never null).

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

Sort weight; higher sorts first.

+ *

Sort weight; higher sorts first.

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

Whether the app has any actions.

+ *

Whether the app has any actions.

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

Whether the app has any triggers (sources).

+ *

Whether the app has any triggers (sources).

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

App hashid (e.g. app_abc123).

+ *

App hashid (e.g. app_abc123).

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

Logo URL.

+ *

Logo URL.

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

URL-safe identifier (e.g. github).

+ *

URL-safe identifier (e.g. github).

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

Named subsets of the app's OAuth scopes. Empty for apps that define none.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllScopeProfiles(List scopeProfiles) { + if (scopeProfiles != null) { + this.scopeProfiles.addAll(scopeProfiles); + } + return this; + } + + /** + *

Named subsets of the app's OAuth scopes. Empty for apps that define none.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addScopeProfiles(ScopeProfile scopeProfiles) { + this.scopeProfiles.add(scopeProfiles); + return this; + } + + /** + *

Named subsets of the app's OAuth scopes. Empty for apps that define none.

+ */ + @java.lang.Override + @JsonSetter(value = "scope_profiles", nulls = Nulls.SKIP) + public _FinalStage scopeProfiles(List scopeProfiles) { + this.scopeProfiles.clear(); + if (scopeProfiles != null) { + this.scopeProfiles.addAll(scopeProfiles); + } + return this; + } + + /** + *

JSON string of the app's custom fields; null when it defines none. Always + * present (normalize_app_doc restores the key), hence required — matching + * v1, which emits the key with a null value.

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

JSON string of the app's custom fields; null when it defines none. Always + * present (normalize_app_doc restores the key), hence required — matching + * v1, which emits the key with a null value.

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

Human-readable category name (e.g. Developer Tools).

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

Human-readable category name (e.g. Developer Tools).

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

Category names associated with the app.

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

Category names associated with the app.

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

Category names associated with the app.

+ */ + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + @java.lang.Override + public _FinalStage authType(String authType) { + this.authType = Optional.ofNullable(authType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "auth_type", nulls = Nulls.SKIP) + public _FinalStage authType(Optional authType) { + this.authType = authType; + return this; + } + + @java.lang.Override + public AppDocument build() { + return new AppDocument( + authType, + categories, + categoryName, + customFieldsJson, + description, + featuredWeight, + hasActions, + hasTriggers, + id, + imgSrc, + name, + nameSlug, + scopeProfiles, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/pipedream/api/types/AppResponse.java b/src/main/java/com/pipedream/api/types/AppResponse.java new file mode 100644 index 0000000..516619b --- /dev/null +++ b/src/main/java/com/pipedream/api/types/AppResponse.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AppResponse.Builder.class) +public final class AppResponse { + private final AppDocument data; + + private final Map additionalProperties; + + private AppResponse(AppDocument data, Map additionalProperties) { + this.data = data; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public AppDocument getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AppResponse && equalTo((AppResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AppResponse other) { + return data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DataStage builder() { + return new Builder(); + } + + public interface DataStage { + _FinalStage data(@NotNull AppDocument data); + + Builder from(AppResponse other); + } + + public interface _FinalStage { + AppResponse build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DataStage, _FinalStage { + private AppDocument data; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AppResponse other) { + data(other.getData()); + return this; + } + + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull AppDocument data) { + this.data = Objects.requireNonNull(data, "data must not be null"); + return this; + } + + @java.lang.Override + public AppResponse build() { + return new AppResponse(data, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/pipedream/api/types/AppsPageInfo.java b/src/main/java/com/pipedream/api/types/AppsPageInfo.java new file mode 100644 index 0000000..403102b --- /dev/null +++ b/src/main/java/com/pipedream/api/types/AppsPageInfo.java @@ -0,0 +1,253 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AppsPageInfo.Builder.class) +public final class AppsPageInfo { + private final int count; + + private final Optional endCursor; + + private final long page; + + private final long perPage; + + private final Optional startCursor; + + private final long totalCount; + + private final Map additionalProperties; + + private AppsPageInfo( + int count, + Optional endCursor, + long page, + long perPage, + Optional startCursor, + long totalCount, + Map additionalProperties) { + this.count = count; + this.endCursor = endCursor; + this.page = page; + this.perPage = perPage; + this.startCursor = startCursor; + this.totalCount = totalCount; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("count") + public int getCount() { + return count; + } + + @JsonProperty("end_cursor") + public Optional getEndCursor() { + return endCursor; + } + + @JsonProperty("page") + public long getPage() { + return page; + } + + @JsonProperty("per_page") + public long getPerPage() { + return perPage; + } + + @JsonProperty("start_cursor") + public Optional getStartCursor() { + return startCursor; + } + + @JsonProperty("total_count") + public long getTotalCount() { + return totalCount; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AppsPageInfo && equalTo((AppsPageInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AppsPageInfo other) { + return count == other.count + && endCursor.equals(other.endCursor) + && page == other.page + && perPage == other.perPage + && startCursor.equals(other.startCursor) + && totalCount == other.totalCount; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.count, this.endCursor, this.page, this.perPage, this.startCursor, this.totalCount); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CountStage builder() { + return new Builder(); + } + + public interface CountStage { + PageStage count(int count); + + Builder from(AppsPageInfo other); + } + + public interface PageStage { + PerPageStage page(long page); + } + + public interface PerPageStage { + TotalCountStage perPage(long perPage); + } + + public interface TotalCountStage { + _FinalStage totalCount(long totalCount); + } + + public interface _FinalStage { + AppsPageInfo build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage endCursor(Optional endCursor); + + _FinalStage endCursor(String endCursor); + + _FinalStage startCursor(Optional startCursor); + + _FinalStage startCursor(String startCursor); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CountStage, PageStage, PerPageStage, TotalCountStage, _FinalStage { + private int count; + + private long page; + + private long perPage; + + private long totalCount; + + private Optional startCursor = Optional.empty(); + + private Optional endCursor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AppsPageInfo other) { + count(other.getCount()); + endCursor(other.getEndCursor()); + page(other.getPage()); + perPage(other.getPerPage()); + startCursor(other.getStartCursor()); + totalCount(other.getTotalCount()); + return this; + } + + @java.lang.Override + @JsonSetter("count") + public PageStage count(int count) { + this.count = count; + return this; + } + + @java.lang.Override + @JsonSetter("page") + public PerPageStage page(long page) { + this.page = page; + return this; + } + + @java.lang.Override + @JsonSetter("per_page") + public TotalCountStage perPage(long perPage) { + this.perPage = perPage; + return this; + } + + @java.lang.Override + @JsonSetter("total_count") + public _FinalStage totalCount(long totalCount) { + this.totalCount = totalCount; + return this; + } + + @java.lang.Override + public _FinalStage startCursor(String startCursor) { + this.startCursor = Optional.ofNullable(startCursor); + return this; + } + + @java.lang.Override + @JsonSetter(value = "start_cursor", nulls = Nulls.SKIP) + public _FinalStage startCursor(Optional startCursor) { + this.startCursor = startCursor; + return this; + } + + @java.lang.Override + public _FinalStage endCursor(String endCursor) { + this.endCursor = Optional.ofNullable(endCursor); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_cursor", nulls = Nulls.SKIP) + public _FinalStage endCursor(Optional endCursor) { + this.endCursor = endCursor; + return this; + } + + @java.lang.Override + public AppsPageInfo build() { + return new AppsPageInfo(count, endCursor, page, perPage, startCursor, totalCount, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/pipedream/api/types/ErrorResponse.java b/src/main/java/com/pipedream/api/types/ErrorResponse.java index b6f15d2..b7a27f0 100644 --- a/src/main/java/com/pipedream/api/types/ErrorResponse.java +++ b/src/main/java/com/pipedream/api/types/ErrorResponse.java @@ -9,13 +9,11 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.pipedream.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @@ -23,47 +21,18 @@ public final class ErrorResponse { private final String error; - private final Optional code; - - private final Optional> details; - private final Map additionalProperties; - private ErrorResponse( - String error, - Optional code, - Optional> details, - Map additionalProperties) { + private ErrorResponse(String error, Map additionalProperties) { this.error = error; - this.code = code; - this.details = details; this.additionalProperties = additionalProperties; } - /** - * @return The error message - */ @JsonProperty("error") public String getError() { return error; } - /** - * @return The error code - */ - @JsonProperty("code") - public Optional getCode() { - return code; - } - - /** - * @return Additional error details - */ - @JsonProperty("details") - public Optional> getDetails() { - return details; - } - @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -76,12 +45,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(ErrorResponse other) { - return error.equals(other.error) && code.equals(other.code) && details.equals(other.details); + return error.equals(other.error); } @java.lang.Override public int hashCode() { - return Objects.hash(this.error, this.code, this.details); + return Objects.hash(this.error); } @java.lang.Override @@ -94,9 +63,6 @@ public static ErrorStage builder() { } public interface ErrorStage { - /** - *

The error message

- */ _FinalStage error(@NotNull String error); Builder from(ErrorResponse other); @@ -108,30 +74,12 @@ public interface _FinalStage { _FinalStage additionalProperty(String key, Object value); _FinalStage additionalProperties(Map additionalProperties); - - /** - *

The error code

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

Additional error details

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

The error message

- *

The error message

- * @return Reference to {@code this} so that method calls can be chained together. - */ @java.lang.Override @JsonSetter("error") public _FinalStage error(@NotNull String error) { @@ -157,49 +98,9 @@ public _FinalStage error(@NotNull String error) { return this; } - /** - *

Additional error details

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

Additional error details

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

The error code

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

The error code

- */ - @java.lang.Override - @JsonSetter(value = "code", nulls = Nulls.SKIP) - public _FinalStage code(Optional code) { - this.code = code; - return this; - } - @java.lang.Override public ErrorResponse build() { - return new ErrorResponse(error, code, details, additionalProperties); + return new ErrorResponse(error, additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/pipedream/api/types/FacetValue.java b/src/main/java/com/pipedream/api/types/FacetValue.java new file mode 100644 index 0000000..883d5cc --- /dev/null +++ b/src/main/java/com/pipedream/api/types/FacetValue.java @@ -0,0 +1,140 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FacetValue.Builder.class) +public final class FacetValue { + private final long count; + + private final String value; + + private final Map additionalProperties; + + private FacetValue(long count, String value, Map additionalProperties) { + this.count = count; + this.value = value; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("count") + public long getCount() { + return count; + } + + @JsonProperty("value") + public String getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FacetValue && equalTo((FacetValue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FacetValue other) { + return count == other.count && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.count, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CountStage builder() { + return new Builder(); + } + + public interface CountStage { + ValueStage count(long count); + + Builder from(FacetValue other); + } + + public interface ValueStage { + _FinalStage value(@NotNull String value); + } + + public interface _FinalStage { + FacetValue build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CountStage, ValueStage, _FinalStage { + private long count; + + private String value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FacetValue other) { + count(other.getCount()); + value(other.getValue()); + return this; + } + + @java.lang.Override + @JsonSetter("count") + public ValueStage count(long count) { + this.count = count; + return this; + } + + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + public FacetValue build() { + return new FacetValue(count, value, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/pipedream/api/types/FacetsResponse.java b/src/main/java/com/pipedream/api/types/FacetsResponse.java new file mode 100644 index 0000000..4a95484 --- /dev/null +++ b/src/main/java/com/pipedream/api/types/FacetsResponse.java @@ -0,0 +1,116 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FacetsResponse.Builder.class) +public final class FacetsResponse { + private final Map> data; + + private final Map additionalProperties; + + private FacetsResponse(Map> data, Map additionalProperties) { + this.data = data; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public Map> getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FacetsResponse && equalTo((FacetsResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FacetsResponse other) { + return data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Map> data = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FacetsResponse other) { + data(other.getData()); + return this; + } + + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public Builder data(Map> data) { + this.data.clear(); + if (data != null) { + this.data.putAll(data); + } + return this; + } + + public Builder putAllData(Map> data) { + if (data != null) { + this.data.putAll(data); + } + return this; + } + + public Builder data(String key, List value) { + this.data.put(key, value); + return this; + } + + public FacetsResponse build() { + return new FacetsResponse(data, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/pipedream/api/types/ListResponse.java b/src/main/java/com/pipedream/api/types/ListResponse.java new file mode 100644 index 0000000..3a81917 --- /dev/null +++ b/src/main/java/com/pipedream/api/types/ListResponse.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListResponse.Builder.class) +public final class ListResponse { + private final List data; + + private final AppsPageInfo pageInfo; + + private final Map additionalProperties; + + private ListResponse(List data, AppsPageInfo pageInfo, Map additionalProperties) { + this.data = data; + this.pageInfo = pageInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + @JsonProperty("page_info") + public AppsPageInfo getPageInfo() { + return pageInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListResponse && equalTo((ListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListResponse other) { + return data.equals(other.data) && pageInfo.equals(other.pageInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.data, this.pageInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PageInfoStage builder() { + return new Builder(); + } + + public interface PageInfoStage { + _FinalStage pageInfo(@NotNull AppsPageInfo pageInfo); + + Builder from(ListResponse other); + } + + public interface _FinalStage { + ListResponse build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(AppDocument data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PageInfoStage, _FinalStage { + private AppsPageInfo pageInfo; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ListResponse other) { + data(other.getData()); + pageInfo(other.getPageInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("page_info") + public _FinalStage pageInfo(@NotNull AppsPageInfo pageInfo) { + this.pageInfo = Objects.requireNonNull(pageInfo, "pageInfo must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(AppDocument data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public ListResponse build() { + return new ListResponse(data, pageInfo, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/pipedream/api/types/ScopeProfile.java b/src/main/java/com/pipedream/api/types/ScopeProfile.java new file mode 100644 index 0000000..a9b99f4 --- /dev/null +++ b/src/main/java/com/pipedream/api/types/ScopeProfile.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.pipedream.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.pipedream.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ScopeProfile.Builder.class) +public final class ScopeProfile { + private final String name; + + private final List scopes; + + private final Map additionalProperties; + + private ScopeProfile(String name, List scopes, Map additionalProperties) { + this.name = name; + this.scopes = scopes; + this.additionalProperties = additionalProperties; + } + + /** + * @return The profile name — one of read_only, read_write, admin. Pass this + * back as oauth_scope_profile when starting the app's OAuth flow. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The upstream API's OAuth scopes the user authorizes for this profile. + */ + @JsonProperty("scopes") + public List getScopes() { + return scopes; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScopeProfile && equalTo((ScopeProfile) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ScopeProfile other) { + return name.equals(other.name) && scopes.equals(other.scopes); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.scopes); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

The profile name — one of read_only, read_write, admin. Pass this + * back as oauth_scope_profile when starting the app's OAuth flow.

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

The upstream API's OAuth scopes the user authorizes for this profile.

+ */ + _FinalStage scopes(List scopes); + + _FinalStage addScopes(String scopes); + + _FinalStage addAllScopes(List scopes); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private List scopes = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ScopeProfile other) { + name(other.getName()); + scopes(other.getScopes()); + return this; + } + + /** + *

The profile name — one of read_only, read_write, admin. Pass this + * back as oauth_scope_profile when starting the app's OAuth flow.

+ *

The profile name — one of read_only, read_write, admin. Pass this + * back as oauth_scope_profile when starting the app's OAuth flow.

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

The upstream API's OAuth scopes the user authorizes for this profile.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllScopes(List scopes) { + if (scopes != null) { + this.scopes.addAll(scopes); + } + return this; + } + + /** + *

The upstream API's OAuth scopes the user authorizes for this profile.

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

The upstream API's OAuth scopes the user authorizes for this profile.

+ */ + @java.lang.Override + @JsonSetter(value = "scopes", nulls = Nulls.SKIP) + public _FinalStage scopes(List scopes) { + this.scopes.clear(); + if (scopes != null) { + this.scopes.addAll(scopes); + } + return this; + } + + @java.lang.Override + public ScopeProfile build() { + return new ScopeProfile(name, scopes, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java b/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java index 887b8b4..2fda3df 100644 --- a/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java +++ b/src/main/java/com/pipedream/api/types/ValidateTokenResponse.java @@ -28,6 +28,8 @@ public final class ValidateTokenResponse { private final Optional oauthAppId; + private final Optional oauthAppWorkdayOfficial; + private final Optional projectAppName; private final Optional projectEnvironment; @@ -47,6 +49,7 @@ private ValidateTokenResponse( Optional error, Optional errorRedirectUri, Optional oauthAppId, + Optional oauthAppWorkdayOfficial, Optional projectAppName, Optional projectEnvironment, Optional projectId, @@ -58,6 +61,7 @@ private ValidateTokenResponse( this.error = error; this.errorRedirectUri = errorRedirectUri; this.oauthAppId = oauthAppId; + this.oauthAppWorkdayOfficial = oauthAppWorkdayOfficial; this.projectAppName = projectAppName; this.projectEnvironment = projectEnvironment; this.projectId = projectId; @@ -96,6 +100,14 @@ public Optional getOauthAppId() { return oauthAppId; } + /** + * @return True when the resolved OAuth client is the app's Workday-official client + */ + @JsonProperty("oauth_app_workday_official") + public Optional getOauthAppWorkdayOfficial() { + return oauthAppWorkdayOfficial; + } + /** * @return Name of the project app */ @@ -160,6 +172,7 @@ private boolean equalTo(ValidateTokenResponse other) { && error.equals(other.error) && errorRedirectUri.equals(other.errorRedirectUri) && oauthAppId.equals(other.oauthAppId) + && oauthAppWorkdayOfficial.equals(other.oauthAppWorkdayOfficial) && projectAppName.equals(other.projectAppName) && projectEnvironment.equals(other.projectEnvironment) && projectId.equals(other.projectId) @@ -175,6 +188,7 @@ public int hashCode() { this.error, this.errorRedirectUri, this.oauthAppId, + this.oauthAppWorkdayOfficial, this.projectAppName, this.projectEnvironment, this.projectId, @@ -233,6 +247,13 @@ public interface _FinalStage { _FinalStage oauthAppId(String oauthAppId); + /** + *

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

+ */ + _FinalStage oauthAppWorkdayOfficial(Optional oauthAppWorkdayOfficial); + + _FinalStage oauthAppWorkdayOfficial(Boolean oauthAppWorkdayOfficial); + /** *

Name of the project app

*/ @@ -283,6 +304,8 @@ public static final class Builder implements SuccessStage, _FinalStage { private Optional projectAppName = Optional.empty(); + private Optional oauthAppWorkdayOfficial = Optional.empty(); + private Optional oauthAppId = Optional.empty(); private Optional errorRedirectUri = Optional.empty(); @@ -302,6 +325,7 @@ public Builder from(ValidateTokenResponse other) { error(other.getError()); errorRedirectUri(other.getErrorRedirectUri()); oauthAppId(other.getOauthAppId()); + oauthAppWorkdayOfficial(other.getOauthAppWorkdayOfficial()); projectAppName(other.getProjectAppName()); projectEnvironment(other.getProjectEnvironment()); projectId(other.getProjectId()); @@ -423,6 +447,26 @@ public _FinalStage projectAppName(Optional projectAppName) { return this; } + /** + *

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

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

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

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

OAuth app ID if applicable

* @return Reference to {@code this} so that method calls can be chained together. @@ -503,6 +547,7 @@ public ValidateTokenResponse build() { error, errorRedirectUri, oauthAppId, + oauthAppWorkdayOfficial, projectAppName, projectEnvironment, projectId, From 5b3394799297489a8d96c98333695222cde6a565 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 19:25:10 +0000 Subject: [PATCH 2/2] [fern-replay] Applied customizations Patches with unresolved conflicts (1): - patch-edb0fd1d: Normalize paths in the request URLs Run `fern-replay resolve` to apply these customizations. --- .fern/replay.lock | 8 +++++++- README.md | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index cc42665..9b35086 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -6,5 +6,11 @@ generations: timestamp: 2026-05-19T23:19:48.346Z cli_version: unknown generator_versions: {} -current_generation: 93fd7063699edbf599967cbed5ad90943ff88a16 + - commit_sha: c54e11e10ab3461d99832180439e0098eb927d74 + tree_hash: 899055bbe3a634327866228cc0b2b55ecbe5d77d + timestamp: 2026-07-31T19:25:07.870Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 4.8.4 +current_generation: c54e11e10ab3461d99832180439e0098eb927d74 patches: [] diff --git a/README.md b/README.md index 8fb2837..8f935d1 100644 --- a/README.md +++ b/README.md @@ -267,4 +267,3 @@ On the other hand, contributions to the README are always very welcome! ## Reference A full reference for this library is available [here](https://github.com/PipedreamHQ/pipedream-sdk-java/blob/HEAD/./reference.md). -