Skip to content

Commit

Permalink
fixup: format
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
  • Loading branch information
toddbaert committed Apr 22, 2024
1 parent be8ab7e commit 0845fb6
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 164 deletions.
138 changes: 69 additions & 69 deletions src/OpenFeature/Model/FlagEvaluationDetails.cs
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
using OpenFeature.Constant;

namespace OpenFeature.Model
{
{
/// <summary>
/// The contract returned to the caller that describes the result of the flag evaluation process.
/// </summary>
/// <typeparam name="T">Flag value type</typeparam>
/// <seealso href="https://github.com/open-feature/spec/blob/v0.7.0/specification/types.md#evaluation-details"/>
public sealed class FlagEvaluationDetails<T>
{
/// <summary>
/// The contract returned to the caller that describes the result of the flag evaluation process.
/// Feature flag evaluated value
/// </summary>
/// <typeparam name="T">Flag value type</typeparam>
/// <seealso href="https://github.com/open-feature/spec/blob/v0.7.0/specification/types.md#evaluation-details"/>
public sealed class FlagEvaluationDetails<T>
{
/// <summary>
/// Feature flag evaluated value
/// </summary>
public T Value { get; }

/// <summary>
/// Feature flag key
/// </summary>
public string FlagKey { get; }

/// <summary>
/// Error that occurred during evaluation
/// </summary>
public ErrorType ErrorType { get; }

/// <summary>
/// Message containing additional details about an error.
/// <para>
/// Will be <see langword="null" /> if there is no error or if the provider didn't provide any additional error
/// details.
/// </para>
/// </summary>
public string? ErrorMessage { get; }

/// <summary>
/// Describes the reason for the outcome of the evaluation process
/// </summary>
public string? Reason { get; }

/// <summary>
/// A variant is a semantic identifier for a value. This allows for referral to particular values without
/// necessarily including the value itself, which may be quite prohibitively large or otherwise unsuitable
/// in some cases.
/// </summary>
public string? Variant { get; }

/// <summary>
/// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number.
/// </summary>
public ImmutableMetadata? FlagMetadata { get; }

/// <summary>
/// Initializes a new instance of the <see cref="FlagEvaluationDetails{T}"/> class.
/// </summary>
/// <param name="flagKey">Feature flag key</param>
/// <param name="value">Evaluated value</param>
/// <param name="errorType">Error</param>
/// <param name="reason">Reason</param>
/// <param name="variant">Variant</param>
/// <param name="errorMessage">Error message</param>
/// <param name="flagMetadata">Flag metadata</param>
public FlagEvaluationDetails(string flagKey, T value, ErrorType errorType, string? reason, string? variant,
string? errorMessage = null, ImmutableMetadata? flagMetadata = null)
{
this.Value = value;
this.FlagKey = flagKey;
this.ErrorType = errorType;
this.Reason = reason;
this.Variant = variant;
this.ErrorMessage = errorMessage;
this.FlagMetadata = flagMetadata;
}
}
public T Value { get; }

/// <summary>
/// Feature flag key
/// </summary>
public string FlagKey { get; }

/// <summary>
/// Error that occurred during evaluation
/// </summary>
public ErrorType ErrorType { get; }

/// <summary>
/// Message containing additional details about an error.
/// <para>
/// Will be <see langword="null" /> if there is no error or if the provider didn't provide any additional error
/// details.
/// </para>
/// </summary>
public string? ErrorMessage { get; }

/// <summary>
/// Describes the reason for the outcome of the evaluation process
/// </summary>
public string? Reason { get; }

/// <summary>
/// A variant is a semantic identifier for a value. This allows for referral to particular values without
/// necessarily including the value itself, which may be quite prohibitively large or otherwise unsuitable
/// in some cases.
/// </summary>
public string? Variant { get; }

/// <summary>
/// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number.
/// </summary>
public ImmutableMetadata? FlagMetadata { get; }

/// <summary>
/// Initializes a new instance of the <see cref="FlagEvaluationDetails{T}"/> class.
/// </summary>
/// <param name="flagKey">Feature flag key</param>
/// <param name="value">Evaluated value</param>
/// <param name="errorType">Error</param>
/// <param name="reason">Reason</param>
/// <param name="variant">Variant</param>
/// <param name="errorMessage">Error message</param>
/// <param name="flagMetadata">Flag metadata</param>
public FlagEvaluationDetails(string flagKey, T value, ErrorType errorType, string? reason, string? variant,
string? errorMessage = null, ImmutableMetadata? flagMetadata = null)
{
this.Value = value;
this.FlagKey = flagKey;
this.ErrorType = errorType;
this.Reason = reason;
this.Variant = variant;
this.ErrorMessage = errorMessage;
this.FlagMetadata = flagMetadata;
}
}
}
54 changes: 27 additions & 27 deletions src/OpenFeature/Model/ProviderEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@

namespace OpenFeature.Model
{
/// <summary>
/// The EventHandlerDelegate is an implementation of an Event Handler
/// </summary>
public delegate void EventHandlerDelegate(ProviderEventPayload? eventDetails);

/// <summary>
/// Contains the payload of an OpenFeature Event.
/// </summary>
public class ProviderEventPayload
{
/// <summary>
/// The EventHandlerDelegate is an implementation of an Event Handler
/// Name of the provider.
/// </summary>
public delegate void EventHandlerDelegate(ProviderEventPayload? eventDetails);
public string? ProviderName { get; set; }

/// <summary>
/// Contains the payload of an OpenFeature Event.
/// Type of the event
/// </summary>
public class ProviderEventPayload
{
/// <summary>
/// Name of the provider.
/// </summary>
public string? ProviderName { get; set; }

/// <summary>
/// Type of the event
/// </summary>
public ProviderEventTypes Type { get; set; }
public ProviderEventTypes Type { get; set; }

/// <summary>
/// A message providing more information about the event.
/// </summary>
public string? Message { get; set; }
/// <summary>
/// A message providing more information about the event.
/// </summary>
public string? Message { get; set; }

/// <summary>
/// A List of flags that have been changed.
/// </summary>
public List<string>? FlagsChanged { get; set; }
/// <summary>
/// A List of flags that have been changed.
/// </summary>
public List<string>? FlagsChanged { get; set; }

/// <summary>
/// Metadata information for the event.
/// </summary>
public ImmutableMetadata? EventMetadata { get; set; }
}
/// <summary>
/// Metadata information for the event.
/// </summary>
public ImmutableMetadata? EventMetadata { get; set; }
}
}
136 changes: 68 additions & 68 deletions src/OpenFeature/Model/ResolutionDetails.cs
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
using OpenFeature.Constant;

namespace OpenFeature.Model
{
{
/// <summary>
/// Defines the contract that the <see cref="FeatureProvider"/> is required to return
/// Describes the details of the feature flag being evaluated
/// </summary>
/// <typeparam name="T">Flag value type</typeparam>
/// <seealso href="https://github.com/open-feature/spec/blob/v0.7.0/specification/types.md#resolution-details"/>
public sealed class ResolutionDetails<T>
{
/// <summary>
/// Defines the contract that the <see cref="FeatureProvider"/> is required to return
/// Describes the details of the feature flag being evaluated
/// Feature flag evaluated value
/// </summary>
/// <typeparam name="T">Flag value type</typeparam>
/// <seealso href="https://github.com/open-feature/spec/blob/v0.7.0/specification/types.md#resolution-details"/>
public sealed class ResolutionDetails<T>
{
/// <summary>
/// Feature flag evaluated value
/// </summary>
public T Value { get; }

/// <summary>
/// Feature flag key
/// </summary>
public string FlagKey { get; }

/// <summary>
/// Error that occurred during evaluation
/// <see cref="ErrorType"/>
/// </summary>
public ErrorType ErrorType { get; }

/// <summary>
/// Message containing additional details about an error.
/// </summary>
public string? ErrorMessage { get; }

/// <summary>
/// Describes the reason for the outcome of the evaluation process
/// <see cref="Reason"/>
/// </summary>
public string? Reason { get; }

/// <summary>
/// A variant is a semantic identifier for a value. This allows for referral to particular values without
/// necessarily including the value itself, which may be quite prohibitively large or otherwise unsuitable
/// in some cases.
/// </summary>
public string? Variant { get; }

/// <summary>
/// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number.
/// </summary>
public ImmutableMetadata? FlagMetadata { get; }

/// <summary>
/// Initializes a new instance of the <see cref="ResolutionDetails{T}"/> class.
/// </summary>
/// <param name="flagKey">Feature flag key</param>
/// <param name="value">Evaluated value</param>
/// <param name="errorType">Error</param>
/// <param name="reason">Reason</param>
/// <param name="variant">Variant</param>
/// <param name="errorMessage">Error message</param>
/// <param name="flagMetadata">Flag metadata</param>
public ResolutionDetails(string flagKey, T value, ErrorType errorType = ErrorType.None, string? reason = null,
string? variant = null, string? errorMessage = null, ImmutableMetadata? flagMetadata = null)
{
this.Value = value;
this.FlagKey = flagKey;
this.ErrorType = errorType;
this.Reason = reason;
this.Variant = variant;
this.ErrorMessage = errorMessage;
this.FlagMetadata = flagMetadata;
}
}
public T Value { get; }

/// <summary>
/// Feature flag key
/// </summary>
public string FlagKey { get; }

/// <summary>
/// Error that occurred during evaluation
/// <see cref="ErrorType"/>
/// </summary>
public ErrorType ErrorType { get; }

/// <summary>
/// Message containing additional details about an error.
/// </summary>
public string? ErrorMessage { get; }

/// <summary>
/// Describes the reason for the outcome of the evaluation process
/// <see cref="Reason"/>
/// </summary>
public string? Reason { get; }

/// <summary>
/// A variant is a semantic identifier for a value. This allows for referral to particular values without
/// necessarily including the value itself, which may be quite prohibitively large or otherwise unsuitable
/// in some cases.
/// </summary>
public string? Variant { get; }

/// <summary>
/// A structure which supports definition of arbitrary properties, with keys of type string, and values of type boolean, string, or number.
/// </summary>
public ImmutableMetadata? FlagMetadata { get; }

/// <summary>
/// Initializes a new instance of the <see cref="ResolutionDetails{T}"/> class.
/// </summary>
/// <param name="flagKey">Feature flag key</param>
/// <param name="value">Evaluated value</param>
/// <param name="errorType">Error</param>
/// <param name="reason">Reason</param>
/// <param name="variant">Variant</param>
/// <param name="errorMessage">Error message</param>
/// <param name="flagMetadata">Flag metadata</param>
public ResolutionDetails(string flagKey, T value, ErrorType errorType = ErrorType.None, string? reason = null,
string? variant = null, string? errorMessage = null, ImmutableMetadata? flagMetadata = null)
{
this.Value = value;
this.FlagKey = flagKey;
this.ErrorType = errorType;
this.Reason = reason;
this.Variant = variant;
this.ErrorMessage = errorMessage;
this.FlagMetadata = flagMetadata;
}
}
}

0 comments on commit 0845fb6

Please sign in to comment.