Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
],
"retry-status-codes": "legacy"
},
"originGitCommit": "4ec89179f0cd7c09cc536f40a9c42a089d9cd425",
"originGitCommit": "c2e5677e51c00b8d3b0c89f56c00a2ddadb4c490",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"ciProvider": "github",
"sdkVersion": "2.2.0"
"sdkVersion": "2.3.0"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add the dependency in your `build.gradle` file:

```groovy
dependencies {
implementation 'com.pipedream:pipedream:2.2.0'
implementation 'com.pipedream:pipedream:2.3.0'
}
```

Expand All @@ -42,7 +42,7 @@ Add the dependency in your `pom.xml` file:
<dependency>
<groupId>com.pipedream</groupId>
<artifactId>pipedream</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ java {

group = 'com.pipedream'

version = '2.2.0'
version = '2.3.0'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.pipedream'
artifactId = 'pipedream'
version = '2.2.0'
version = '2.3.0'
from components.java
pom {
name = 'pipedream'
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pipedream/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "com.pipedream:pipedream/2.2.0");
put("User-Agent", "com.pipedream:pipedream/2.3.0");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk");
put("X-Fern-SDK-Version", "2.2.0");
put("X-Fern-SDK-Version", "2.3.0");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/com/pipedream/api/errors/UnauthorizedError.java
Original file line number Diff line number Diff line change
@@ -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.UnauthorizedErrorBody;
import okhttp3.Response;

public final class UnauthorizedError extends BaseClientApiException {
/**
* The body of the response that triggered the exception.
*/
private final UnauthorizedErrorBody body;

public UnauthorizedError(UnauthorizedErrorBody body) {
super("UnauthorizedError", 401, body);
this.body = body;
}

public UnauthorizedError(UnauthorizedErrorBody body, Response rawResponse) {
super("UnauthorizedError", 401, body, rawResponse);
this.body = body;
}

/**
* @return the body
*/
@java.lang.Override
public UnauthorizedErrorBody body() {
return this.body;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWebhooksRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWorkflowsRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRegenerateWebhookSigningKeyRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersResetWebhookDeliveryStateRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveWebhookRequest;
import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts;
Expand Down Expand Up @@ -205,6 +206,29 @@ public CompletableFuture<GetWebhookWithSigningKeyResponse> retrieveWebhook(
.thenApply(response -> response.body());
}

/**
* Reactivate a disabled webhook and clear its delivery failure evidence
*/
public CompletableFuture<GetWebhookWithSigningKeyResponse> resetWebhookDeliveryState(
String triggerId, String webhookId, DeployedTriggersResetWebhookDeliveryStateRequest request) {
return this.rawClient
.resetWebhookDeliveryState(triggerId, webhookId, request)
.thenApply(response -> response.body());
}

/**
* Reactivate a disabled webhook and clear its delivery failure evidence
*/
public CompletableFuture<GetWebhookWithSigningKeyResponse> resetWebhookDeliveryState(
String triggerId,
String webhookId,
DeployedTriggersResetWebhookDeliveryStateRequest request,
RequestOptions requestOptions) {
return this.rawClient
.resetWebhookDeliveryState(triggerId, webhookId, request, requestOptions)
.thenApply(response -> response.body());
}

/**
* Regenerate the signing key for a specific webhook on a deployed trigger
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWebhooksRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWorkflowsRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRegenerateWebhookSigningKeyRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersResetWebhookDeliveryStateRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveWebhookRequest;
import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts;
Expand Down Expand Up @@ -862,6 +863,86 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
return future;
}

/**
* Reactivate a disabled webhook and clear its delivery failure evidence
*/
public CompletableFuture<BaseClientHttpResponse<GetWebhookWithSigningKeyResponse>> resetWebhookDeliveryState(
String triggerId, String webhookId, DeployedTriggersResetWebhookDeliveryStateRequest request) {
return resetWebhookDeliveryState(triggerId, webhookId, request, null);
}

/**
* Reactivate a disabled webhook and clear its delivery failure evidence
*/
public CompletableFuture<BaseClientHttpResponse<GetWebhookWithSigningKeyResponse>> resetWebhookDeliveryState(
String triggerId,
String webhookId,
DeployedTriggersResetWebhookDeliveryStateRequest request,
RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v1/connect")
.addPathSegment(clientOptions.projectId())
.addPathSegments("deployed-triggers")
.addPathSegment(triggerId)
.addPathSegments("webhooks")
.addPathSegment(webhookId)
.addPathSegments("reset_delivery_state");
QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false);
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
});
}
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("POST", RequestBody.create("", null))
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
CompletableFuture<BaseClientHttpResponse<GetWebhookWithSigningKeyResponse>> 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<>(
ObjectMappers.JSON_MAPPER.readValue(
responseBodyString, GetWebhookWithSigningKeyResponse.class),
response));
return;
}
try {
if (response.code() == 429) {
future.completeExceptionally(new TooManyRequestsError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.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;
}

/**
* Regenerate the signing key for a specific webhook on a deployed trigger
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWebhooksRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWorkflowsRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRegenerateWebhookSigningKeyRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersResetWebhookDeliveryStateRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveWebhookRequest;
import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts;
Expand Down Expand Up @@ -195,6 +196,29 @@ public GetWebhookWithSigningKeyResponse retrieveWebhook(
.body();
}

/**
* Reactivate a disabled webhook and clear its delivery failure evidence
*/
public GetWebhookWithSigningKeyResponse resetWebhookDeliveryState(
String triggerId, String webhookId, DeployedTriggersResetWebhookDeliveryStateRequest request) {
return this.rawClient
.resetWebhookDeliveryState(triggerId, webhookId, request)
.body();
}

/**
* Reactivate a disabled webhook and clear its delivery failure evidence
*/
public GetWebhookWithSigningKeyResponse resetWebhookDeliveryState(
String triggerId,
String webhookId,
DeployedTriggersResetWebhookDeliveryStateRequest request,
RequestOptions requestOptions) {
return this.rawClient
.resetWebhookDeliveryState(triggerId, webhookId, request, requestOptions)
.body();
}

/**
* Regenerate the signing key for a specific webhook on a deployed trigger
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWebhooksRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersListWorkflowsRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRegenerateWebhookSigningKeyRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersResetWebhookDeliveryStateRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveRequest;
import com.pipedream.api.resources.deployedtriggers.requests.DeployedTriggersRetrieveWebhookRequest;
import com.pipedream.api.resources.deployedtriggers.requests.UpdateTriggerOpts;
Expand Down Expand Up @@ -701,6 +702,71 @@ public BaseClientHttpResponse<GetWebhookWithSigningKeyResponse> retrieveWebhook(
}
}

/**
* Reactivate a disabled webhook and clear its delivery failure evidence
*/
public BaseClientHttpResponse<GetWebhookWithSigningKeyResponse> resetWebhookDeliveryState(
String triggerId, String webhookId, DeployedTriggersResetWebhookDeliveryStateRequest request) {
return resetWebhookDeliveryState(triggerId, webhookId, request, null);
}

/**
* Reactivate a disabled webhook and clear its delivery failure evidence
*/
public BaseClientHttpResponse<GetWebhookWithSigningKeyResponse> resetWebhookDeliveryState(
String triggerId,
String webhookId,
DeployedTriggersResetWebhookDeliveryStateRequest request,
RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v1/connect")
.addPathSegment(clientOptions.projectId())
.addPathSegments("deployed-triggers")
.addPathSegment(triggerId)
.addPathSegments("webhooks")
.addPathSegment(webhookId)
.addPathSegments("reset_delivery_state");
QueryStringMapper.addQueryParameter(httpUrl, "external_user_id", request.getExternalUserId(), false);
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
});
}
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("POST", RequestBody.create("", null))
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json");
Request okhttpRequest = _requestBuilder.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
if (response.isSuccessful()) {
return new BaseClientHttpResponse<>(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetWebhookWithSigningKeyResponse.class),
response);
}
try {
if (response.code() == 429) {
throw new TooManyRequestsError(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.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);
}
}

/**
* Regenerate the signing key for a specific webhook on a deployed trigger
*/
Expand Down
Loading
Loading