Create Script
var result = await Saga.Script.Create("Test Script", "/requests/post/test", "response.send(request.body);\ndone();");
if (result.IsSuccess) {
Script createdScript = result.Data;
}
Get Script
By Id
Result<Script> result = await Saga.Script.GetById(scriptResult.Data.Id);
if (result.IsSuccess) {
Script script = result.Data;
}
Get All Scripts
Result<Script[]> result = await Saga.Script.GetAll();
if (result.IsSuccess) {
Script[] scripts = result.Data;
}
Run HTTP Script
var result = await Saga.Script.Run<SomeType>("/requests/post/test", queryStrings: null, new {
data1 = "Hey there",
data2 = "More data
});
if (result.IsSuccess) {
SomeType data = result.Data;
}