-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptBase.cs
More file actions
40 lines (31 loc) · 1.23 KB
/
Copy pathScriptBase.cs
File metadata and controls
40 lines (31 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Net.Http;
public abstract class ScriptBase
{
// Context object
public IScriptContext Context { get; set;} //added the setter, but only setting it outside of the Script impelementation.
// CancellationToken for the execution
public CancellationToken CancellationToken { get; }
// Helper: Creates a StringContent object from the serialized JSON
public abstract StringContent CreateJsonContent(string serializedJson);
// Abstract method for your code
public abstract Task<HttpResponseMessage> ExecuteAsync();
}
public interface IScriptContext
{
// Correlation Id
string CorrelationId { get; }
// Connector Operation Id
string OperationId { get; set; } //added the setter, but only setting it outside of the Script impelementation.
// Incoming request
HttpRequestMessage Request { get; set;} //added the setter, but only setting it outside of the Script impelementation.
// Logger instance
ILogger Logger { get; }
// Used to send an HTTP request
// Use this method to send requests instead of HttpClient.SendAsync
Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request,
CancellationToken cancellationToken);
}
public interface ILogger
{
}