Skip to content

Commit 0845fb6

Browse files
committed
fixup: format
Signed-off-by: Todd Baert <[email protected]>
1 parent be8ab7e commit 0845fb6

File tree

3 files changed

+164
-164
lines changed

3 files changed

+164
-164
lines changed
+69-69
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
using OpenFeature.Constant;
22

33
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+
{
512
/// <summary>
6-
/// The contract returned to the caller that describes the result of the flag evaluation process.
13+
/// Feature flag evaluated value
714
/// </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-
/// <summary>
13-
/// Feature flag evaluated value
14-
/// </summary>
15-
public T Value { get; }
16-
17-
/// <summary>
18-
/// Feature flag key
19-
/// </summary>
20-
public string FlagKey { get; }
21-
22-
/// <summary>
23-
/// Error that occurred during evaluation
24-
/// </summary>
25-
public ErrorType ErrorType { get; }
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; }
35-
36-
/// <summary>
37-
/// Describes the reason for the outcome of the evaluation process
38-
/// </summary>
39-
public string? Reason { get; }
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; }
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 ImmutableMetadata? FlagMetadata { get; }
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, 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-
}
74-
}
15+
public T Value { get; }
16+
17+
/// <summary>
18+
/// Feature flag key
19+
/// </summary>
20+
public string FlagKey { get; }
21+
22+
/// <summary>
23+
/// Error that occurred during evaluation
24+
/// </summary>
25+
public ErrorType ErrorType { get; }
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; }
35+
36+
/// <summary>
37+
/// Describes the reason for the outcome of the evaluation process
38+
/// </summary>
39+
public string? Reason { get; }
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; }
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 ImmutableMetadata? FlagMetadata { get; }
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, 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+
}
74+
}
7575
}

src/OpenFeature/Model/ProviderEvents.cs

+27-27
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,39 @@
33

44
namespace OpenFeature.Model
55
{
6+
/// <summary>
7+
/// The EventHandlerDelegate is an implementation of an Event Handler
8+
/// </summary>
9+
public delegate void EventHandlerDelegate(ProviderEventPayload? eventDetails);
10+
11+
/// <summary>
12+
/// Contains the payload of an OpenFeature Event.
13+
/// </summary>
14+
public class ProviderEventPayload
15+
{
616
/// <summary>
7-
/// The EventHandlerDelegate is an implementation of an Event Handler
17+
/// Name of the provider.
818
/// </summary>
9-
public delegate void EventHandlerDelegate(ProviderEventPayload? eventDetails);
19+
public string? ProviderName { get; set; }
1020

1121
/// <summary>
12-
/// Contains the payload of an OpenFeature Event.
22+
/// Type of the event
1323
/// </summary>
14-
public class ProviderEventPayload
15-
{
16-
/// <summary>
17-
/// Name of the provider.
18-
/// </summary>
19-
public string? ProviderName { get; set; }
20-
21-
/// <summary>
22-
/// Type of the event
23-
/// </summary>
24-
public ProviderEventTypes Type { get; set; }
24+
public ProviderEventTypes Type { get; set; }
2525

26-
/// <summary>
27-
/// A message providing more information about the event.
28-
/// </summary>
29-
public string? Message { get; set; }
26+
/// <summary>
27+
/// A message providing more information about the event.
28+
/// </summary>
29+
public string? Message { get; set; }
3030

31-
/// <summary>
32-
/// A List of flags that have been changed.
33-
/// </summary>
34-
public List<string>? FlagsChanged { get; set; }
31+
/// <summary>
32+
/// A List of flags that have been changed.
33+
/// </summary>
34+
public List<string>? FlagsChanged { get; set; }
3535

36-
/// <summary>
37-
/// Metadata information for the event.
38-
/// </summary>
39-
public ImmutableMetadata? EventMetadata { get; set; }
40-
}
36+
/// <summary>
37+
/// Metadata information for the event.
38+
/// </summary>
39+
public ImmutableMetadata? EventMetadata { get; set; }
40+
}
4141
}
+68-68
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
11
using OpenFeature.Constant;
22

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

0 commit comments

Comments
 (0)