-
Notifications
You must be signed in to change notification settings - Fork 177
/
ILuisOptions.cs
92 lines (81 loc) · 2.61 KB
/
ILuisOptions.cs
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
89
90
91
92
namespace Bot.Builder.Community.Dialogs.Luis
{
/// <summary>
/// Interface containing optional parameters for a LUIS request.
/// </summary>
public interface ILuisOptions
{
/// <summary>
/// Gets or sets the value indicating if logging of queries to LUIS is allowed.
/// </summary>
/// <value>
/// The value indicating if logging of queries to LUIS is allowed.
/// </value>
bool? Log { get; set; }
/// <summary>
/// Gets or sets the value indicating if spell checking is enabled.
/// </summary>
/// <value>
/// Turn on spell checking.
/// </value>
bool? SpellCheck { get; set; }
/// <summary>
/// Gets or sets the value indicating if staging endpoint should be used.
/// </summary>
/// <value>
/// The value indicating if staging endpoint should be used.
/// </value>
bool? Staging { get; set; }
/// <summary>
/// Gets or sets the time zone offset.
/// </summary>
/// <value>
/// The time zone offset.
/// </value>
double? TimezoneOffset { get; set; }
/// <summary>
/// Gets or sets the verbose flag.
/// </summary>
/// <value>
/// The verbose flag.
/// </value>
bool? Verbose { get; set; }
/// <summary>
/// Gets or sets the Bing Spell Check subscription key.
/// </summary>
/// <value>
/// The Bing Spell Check subscription key.
/// </value>
string BingSpellCheckSubscriptionKey { get; set; }
}
public static partial class Extensions
{
public static void Apply(this ILuisOptions source, ILuisOptions target)
{
if (source.Log.HasValue)
{
target.Log = source.Log.Value;
}
if (source.SpellCheck.HasValue)
{
target.SpellCheck = source.SpellCheck.Value;
}
if (source.Staging.HasValue)
{
target.Staging = source.Staging.Value;
}
if (source.TimezoneOffset.HasValue)
{
target.TimezoneOffset = source.TimezoneOffset.Value;
}
if (source.Verbose.HasValue)
{
target.Verbose = source.Verbose.Value;
}
if (!string.IsNullOrWhiteSpace(source.BingSpellCheckSubscriptionKey))
{
target.BingSpellCheckSubscriptionKey = source.BingSpellCheckSubscriptionKey;
}
}
}
}