|
2 | 2 |
|
3 | 3 | namespace OpenFeature.Model
|
4 | 4 | {
|
5 |
| - /// <summary> |
6 |
| - /// The contract returned to the caller that describes the result of the flag evaluation process. |
7 |
| - /// </summary> |
8 |
| - /// <typeparam name="T">Flag value type</typeparam> |
9 |
| - /// <seealso href="https://github.com/open-feature/spec/blob/v0.7.0/specification/types.md#evaluation-details"/> |
10 |
| - public sealed class FlagEvaluationDetails<T> |
11 |
| - { |
12 | 5 | /// <summary>
|
13 |
| - /// Feature flag evaluated value |
| 6 | + /// The contract returned to the caller that describes the result of the flag evaluation process. |
14 | 7 | /// </summary>
|
15 |
| - public T Value { get; } |
| 8 | + /// <typeparam name="T">Flag value type</typeparam> |
| 9 | + /// <seealso href="https://github.com/open-feature/spec/blob/v0.7.0/specification/types.md#evaluation-details"/> |
| 10 | + public sealed class FlagEvaluationDetails<T> |
| 11 | + { |
| 12 | + /// <summary> |
| 13 | + /// Feature flag evaluated value |
| 14 | + /// </summary> |
| 15 | + public T Value { get; } |
16 | 16 |
|
17 |
| - /// <summary> |
18 |
| - /// Feature flag key |
19 |
| - /// </summary> |
20 |
| - public string FlagKey { get; } |
| 17 | + /// <summary> |
| 18 | + /// Feature flag key |
| 19 | + /// </summary> |
| 20 | + public string FlagKey { get; } |
21 | 21 |
|
22 |
| - /// <summary> |
23 |
| - /// Error that occurred during evaluation |
24 |
| - /// </summary> |
25 |
| - public ErrorType ErrorType { get; } |
| 22 | + /// <summary> |
| 23 | + /// Error that occurred during evaluation |
| 24 | + /// </summary> |
| 25 | + public ErrorType ErrorType { get; } |
26 | 26 |
|
27 |
| - /// <summary> |
28 |
| - /// Message containing additional details about an error. |
29 |
| - /// <para> |
30 |
| - /// Will be <see langword="null" /> if there is no error or if the provider didn't provide any additional error |
31 |
| - /// details. |
32 |
| - /// </para> |
33 |
| - /// </summary> |
34 |
| - public string? ErrorMessage { get; } |
| 27 | + /// <summary> |
| 28 | + /// Message containing additional details about an error. |
| 29 | + /// <para> |
| 30 | + /// Will be <see langword="null" /> if there is no error or if the provider didn't provide any additional error |
| 31 | + /// details. |
| 32 | + /// </para> |
| 33 | + /// </summary> |
| 34 | + public string? ErrorMessage { get; } |
35 | 35 |
|
36 |
| - /// <summary> |
37 |
| - /// Describes the reason for the outcome of the evaluation process |
38 |
| - /// </summary> |
39 |
| - public string? Reason { get; } |
| 36 | + /// <summary> |
| 37 | + /// Describes the reason for the outcome of the evaluation process |
| 38 | + /// </summary> |
| 39 | + public string? Reason { get; } |
40 | 40 |
|
41 |
| - /// <summary> |
42 |
| - /// A variant is a semantic identifier for a value. This allows for referral to particular values without |
43 |
| - /// necessarily including the value itself, which may be quite prohibitively large or otherwise unsuitable |
44 |
| - /// in some cases. |
45 |
| - /// </summary> |
46 |
| - public string? Variant { get; } |
| 41 | + /// <summary> |
| 42 | + /// A variant is a semantic identifier for a value. This allows for referral to particular values without |
| 43 | + /// necessarily including the value itself, which may be quite prohibitively large or otherwise unsuitable |
| 44 | + /// in some cases. |
| 45 | + /// </summary> |
| 46 | + public string? Variant { get; } |
47 | 47 |
|
48 |
| - /// <summary> |
49 |
| - /// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number. |
50 |
| - /// </summary> |
51 |
| - public FlagMetadata? FlagMetadata { get; } |
| 48 | + /// <summary> |
| 49 | + /// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number. |
| 50 | + /// </summary> |
| 51 | + public ImmutableMetadata? FlagMetadata { get; } |
52 | 52 |
|
53 |
| - /// <summary> |
54 |
| - /// Initializes a new instance of the <see cref="FlagEvaluationDetails{T}"/> class. |
55 |
| - /// </summary> |
56 |
| - /// <param name="flagKey">Feature flag key</param> |
57 |
| - /// <param name="value">Evaluated value</param> |
58 |
| - /// <param name="errorType">Error</param> |
59 |
| - /// <param name="reason">Reason</param> |
60 |
| - /// <param name="variant">Variant</param> |
61 |
| - /// <param name="errorMessage">Error message</param> |
62 |
| - /// <param name="flagMetadata">Flag metadata</param> |
63 |
| - public FlagEvaluationDetails(string flagKey, T value, ErrorType errorType, string? reason, string? variant, |
64 |
| - string? errorMessage = null, FlagMetadata? flagMetadata = null) |
65 |
| - { |
66 |
| - this.Value = value; |
67 |
| - this.FlagKey = flagKey; |
68 |
| - this.ErrorType = errorType; |
69 |
| - this.Reason = reason; |
70 |
| - this.Variant = variant; |
71 |
| - this.ErrorMessage = errorMessage; |
72 |
| - this.FlagMetadata = flagMetadata; |
| 53 | + /// <summary> |
| 54 | + /// Initializes a new instance of the <see cref="FlagEvaluationDetails{T}"/> class. |
| 55 | + /// </summary> |
| 56 | + /// <param name="flagKey">Feature flag key</param> |
| 57 | + /// <param name="value">Evaluated value</param> |
| 58 | + /// <param name="errorType">Error</param> |
| 59 | + /// <param name="reason">Reason</param> |
| 60 | + /// <param name="variant">Variant</param> |
| 61 | + /// <param name="errorMessage">Error message</param> |
| 62 | + /// <param name="flagMetadata">Flag metadata</param> |
| 63 | + public FlagEvaluationDetails(string flagKey, T value, ErrorType errorType, string? reason, string? variant, |
| 64 | + string? errorMessage = null, ImmutableMetadata? flagMetadata = null) |
| 65 | + { |
| 66 | + this.Value = value; |
| 67 | + this.FlagKey = flagKey; |
| 68 | + this.ErrorType = errorType; |
| 69 | + this.Reason = reason; |
| 70 | + this.Variant = variant; |
| 71 | + this.ErrorMessage = errorMessage; |
| 72 | + this.FlagMetadata = flagMetadata; |
| 73 | + } |
73 | 74 | }
|
74 |
| - } |
75 | 75 | }
|
0 commit comments