-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathWorkflowOutputUpdate.cs
More file actions
71 lines (65 loc) · 1.73 KB
/
Copy pathWorkflowOutputUpdate.cs
File metadata and controls
71 lines (65 loc) · 1.73 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
namespace BlogWriter;
public enum WorkflowOutputKind
{
Lifecycle,
ReviewerFeedback,
}
public enum WorkflowOutputOutcome
{
Progress,
Success,
Cancellation,
Validation,
Conflict,
Failure,
Review,
}
public sealed record WorkflowOutputUpdate
{
private WorkflowOutputUpdate(
WorkflowOutputKind kind,
WorkflowOutputOutcome outcome,
string message,
long operationVersion,
long sequence,
string updateKey,
int? revisionNumber)
{
Kind = kind;
Outcome = outcome;
Message = message;
OperationVersion = operationVersion;
Sequence = sequence;
UpdateKey = updateKey;
RevisionNumber = revisionNumber;
}
public WorkflowOutputKind Kind { get; }
public WorkflowOutputOutcome Outcome { get; }
public string Message { get; }
public long OperationVersion { get; }
public long Sequence { get; }
public string UpdateKey { get; }
public int? RevisionNumber { get; }
public static WorkflowOutputUpdate Create(
WorkflowOutputKind kind,
WorkflowOutputOutcome outcome,
string message,
long operationVersion,
long sequence,
string updateKey,
int? revisionNumber = null)
{
ArgumentException.ThrowIfNullOrWhiteSpace(message);
ArgumentException.ThrowIfNullOrWhiteSpace(updateKey);
ArgumentOutOfRangeException.ThrowIfNegative(operationVersion);
ArgumentOutOfRangeException.ThrowIfNegative(sequence);
return new WorkflowOutputUpdate(
kind,
outcome,
message,
operationVersion,
sequence,
updateKey,
revisionNumber);
}
}