-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixes function runs * add changeset * Use env vars for e2e tests * use default timeout * delete print statement
- Loading branch information
Jeremy Wagemans
authored
Apr 25, 2024
1 parent
80550a3
commit 4dca8da
Showing
9 changed files
with
253 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"evervault-java": minor | ||
--- | ||
|
||
Add ability to run functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
lib/src/main/java/com/evervault/contracts/IProvideFunctionRun.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.evervault.contracts; | ||
|
||
import com.evervault.exceptions.HttpFailureException; | ||
import com.evervault.models.FunctionRun; | ||
|
||
import java.io.IOException; | ||
|
||
public interface IProvideFunctionRun { | ||
<T> FunctionRun<T> runFunction(String url, String functionName, Object payload, Class<T> responseType, boolean async, int timeout) | ||
throws HttpFailureException, IOException; | ||
} |
8 changes: 8 additions & 0 deletions
8
lib/src/main/java/com/evervault/exceptions/FunctionRunException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.evervault.exceptions; | ||
|
||
public class FunctionRunException extends Exception { | ||
|
||
public FunctionRunException(String message, String stack) { | ||
super(message + ": " + stack); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
lib/src/main/java/com/evervault/models/CreateFunctionRunRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.evervault.models; | ||
|
||
public class CreateFunctionRunRequest { | ||
Object payload; | ||
boolean async; | ||
|
||
public CreateFunctionRunRequest(Object payload, boolean async) { | ||
this.payload = payload; | ||
this.async = async; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.evervault.models; | ||
|
||
public class FunctionRun<T> { | ||
private String id; | ||
private String status; | ||
private T result; | ||
private FunctionRunError error; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public String getStatus() { | ||
return status; | ||
} | ||
|
||
public T getResult() { | ||
return result; | ||
} | ||
|
||
public FunctionRunError getError() { | ||
return error; | ||
} | ||
|
||
public class FunctionRunError { | ||
private String message; | ||
private String stack; | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public String getStack() { | ||
return stack; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.