forked from Gimly/FluentxApi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResult.cs
More file actions
88 lines (79 loc) · 3.36 KB
/
Result.cs
File metadata and controls
88 lines (79 loc) · 3.36 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using Mos.xApi.Builders;
using Newtonsoft.Json;
using System;
using System.Linq;
namespace Mos.xApi
{
/// <summary>
/// This class defines a result, which is an optional property that represents a measured outcome
/// related to the Statement in which it is included.
/// </summary>
public class Result
{
/// <summary>
/// Initializes a new instance of a Result class.
/// </summary>
/// <param name="score">The score of the Agent in relation to the success or quality of the experience.</param>
/// <param name="success">Indicates whether or not the attempt on the Activity was successful.</param>
/// <param name="completion">Indicates whether or not the Activity was completed.</param>
/// <param name="response">A response appropriately formatted for the given Activity.</param>
/// <param name="duration">Period of time over which the Statement occurred.</param>
/// <param name="extensions">A map of other properties as needed.</param>
public Result(
Score score = null,
bool? success = null,
bool? completion = null,
string response = null,
TimeSpan? duration = null,
Extension extensions = null)
{
Score = score;
Completion = completion;
Success = success;
Response = response;
Duration = duration;
if (extensions != null && extensions.Any())
{
Extensions = extensions;
}
}
/// <summary>
/// Gets an indicator whether or not the Activity was completed.
/// </summary>
[JsonProperty("completion", Order = 2, NullValueHandling = NullValueHandling.Ignore)]
public bool? Completion { get; }
/// <summary>
/// Gets the period of time over which the Statement occurred.
/// </summary>
[JsonProperty("duration", Order = 4, NullValueHandling = NullValueHandling.Ignore)]
public TimeSpan? Duration { get; }
/// <summary>
/// Gets a map of other properties as needed.
/// </summary>
[JsonProperty("extensions", Order = 5, NullValueHandling = NullValueHandling.Ignore)]
public Extension Extensions { get; }
/// <summary>
/// Gets a response appropriately formatted for the given Activity.
/// </summary>
[JsonProperty("response", Order = 3, NullValueHandling = NullValueHandling.Ignore)]
public string Response { get; }
/// <summary>
/// Gets the score of the Agent in relation to the success or quality of the experience.
/// </summary>
[JsonProperty("score", Order = 0, NullValueHandling = NullValueHandling.Ignore)]
public Score Score { get; }
/// <summary>
/// Gets an indicator that states whether or not the attempt on the Activity was successful.
/// </summary>
[JsonProperty("success", Order = 1, NullValueHandling = NullValueHandling.Ignore)]
public bool? Success { get; }
/// <summary>
/// Starts the fluent creation of a Result instance.
/// </summary>
/// <returns>The builder that allows to fluently construct a Result.</returns>
public static IResultBuilder Create()
{
return new ResultBuilder();
}
}
}