diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/BehaviorActionArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/BehaviorActionArguments.cs new file mode 100644 index 00000000000..789bed7cc88 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/BehaviorActionArguments.cs @@ -0,0 +1,11 @@ +// Assembly 'Polly.Core' + +using System.Runtime.CompilerServices; + +namespace Polly.Simmy.Behavior; + +public readonly struct BehaviorActionArguments +{ + public ResilienceContext Context { get; } + public BehaviorActionArguments(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/BehaviorStrategyOptions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/BehaviorStrategyOptions.cs new file mode 100644 index 00000000000..0f83f502b99 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/BehaviorStrategyOptions.cs @@ -0,0 +1,16 @@ +// Assembly 'Polly.Core' + +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; + +namespace Polly.Simmy.Behavior; + +public class BehaviorStrategyOptions : MonkeyStrategyOptions +{ + public Func? OnBehaviorInjected { get; set; } + [Required] + public Func? BehaviorAction { get; set; } + public BehaviorStrategyOptions(); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/OnBehaviorInjectedArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/OnBehaviorInjectedArguments.cs new file mode 100644 index 00000000000..78aca9d8811 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Behavior/OnBehaviorInjectedArguments.cs @@ -0,0 +1,11 @@ +// Assembly 'Polly.Core' + +using System.Runtime.CompilerServices; + +namespace Polly.Simmy.Behavior; + +public readonly struct OnBehaviorInjectedArguments +{ + public ResilienceContext Context { get; } + public OnBehaviorInjectedArguments(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/FaultGeneratorArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/FaultGeneratorArguments.cs new file mode 100644 index 00000000000..cb889edeaab --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/FaultGeneratorArguments.cs @@ -0,0 +1,11 @@ +// Assembly 'Polly.Core' + +using System.Runtime.CompilerServices; + +namespace Polly.Simmy.Fault; + +public readonly struct FaultGeneratorArguments +{ + public ResilienceContext Context { get; } + public FaultGeneratorArguments(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/FaultStrategyOptions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/FaultStrategyOptions.cs new file mode 100644 index 00000000000..6302d5dbcc1 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/FaultStrategyOptions.cs @@ -0,0 +1,15 @@ +// Assembly 'Polly.Core' + +using System; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; + +namespace Polly.Simmy.Fault; + +public class FaultStrategyOptions : MonkeyStrategyOptions +{ + public Func? OnFaultInjected { get; set; } + public Func>? FaultGenerator { get; set; } + public Exception? Fault { get; set; } + public FaultStrategyOptions(); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/OnFaultInjectedArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/OnFaultInjectedArguments.cs new file mode 100644 index 00000000000..c9d8388c018 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Fault/OnFaultInjectedArguments.cs @@ -0,0 +1,13 @@ +// Assembly 'Polly.Core' + +using System; +using System.Runtime.CompilerServices; + +namespace Polly.Simmy.Fault; + +public readonly struct OnFaultInjectedArguments +{ + public ResilienceContext Context { get; } + public Exception Fault { get; } + public OnFaultInjectedArguments(ResilienceContext context, Exception fault); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/LatencyGeneratorArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/LatencyGeneratorArguments.cs new file mode 100644 index 00000000000..567d8a765c1 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/LatencyGeneratorArguments.cs @@ -0,0 +1,11 @@ +// Assembly 'Polly.Core' + +using System.Runtime.CompilerServices; + +namespace Polly.Simmy.Latency; + +public readonly struct LatencyGeneratorArguments +{ + public ResilienceContext Context { get; } + public LatencyGeneratorArguments(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/LatencyStrategyOptions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/LatencyStrategyOptions.cs new file mode 100644 index 00000000000..b746494f707 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/LatencyStrategyOptions.cs @@ -0,0 +1,15 @@ +// Assembly 'Polly.Core' + +using System; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; + +namespace Polly.Simmy.Latency; + +public class LatencyStrategyOptions : MonkeyStrategyOptions +{ + public Func? OnLatency { get; set; } + public Func>? LatencyGenerator { get; set; } + public TimeSpan Latency { get; set; } + public LatencyStrategyOptions(); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/OnLatencyArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/OnLatencyArguments.cs new file mode 100644 index 00000000000..db040118ce7 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Latency/OnLatencyArguments.cs @@ -0,0 +1,13 @@ +// Assembly 'Polly.Core' + +using System; +using System.Runtime.CompilerServices; + +namespace Polly.Simmy.Latency; + +public readonly struct OnLatencyArguments +{ + public ResilienceContext Context { get; } + public TimeSpan Latency { get; } + public OnLatencyArguments(ResilienceContext context, TimeSpan latency); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OnOutcomeInjectedArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OnOutcomeInjectedArguments.cs new file mode 100644 index 00000000000..54d7aead6f1 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OnOutcomeInjectedArguments.cs @@ -0,0 +1,12 @@ +// Assembly 'Polly.Core' + +using System.Runtime.CompilerServices; + +namespace Polly.Simmy.Outcomes; + +public readonly struct OnOutcomeInjectedArguments +{ + public ResilienceContext Context { get; } + public Outcome Outcome { get; } + public OnOutcomeInjectedArguments(ResilienceContext context, Outcome outcome); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeGeneratorArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeGeneratorArguments.cs new file mode 100644 index 00000000000..b274b789282 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeGeneratorArguments.cs @@ -0,0 +1,11 @@ +// Assembly 'Polly.Core' + +using System.Runtime.CompilerServices; + +namespace Polly.Simmy.Outcomes; + +public readonly struct OutcomeGeneratorArguments +{ + public ResilienceContext Context { get; } + public OutcomeGeneratorArguments(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeStrategyOptions.TResult.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeStrategyOptions.TResult.cs new file mode 100644 index 00000000000..09d1bab9535 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeStrategyOptions.TResult.cs @@ -0,0 +1,16 @@ +// Assembly 'Polly.Core' + +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; + +namespace Polly.Simmy.Outcomes; + +public class OutcomeStrategyOptions : MonkeyStrategyOptions +{ + public Func, ValueTask>? OnOutcomeInjected { get; set; } + [Required] + public Func?>> OutcomeGenerator { get; set; } + public OutcomeStrategyOptions(); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeStrategyOptions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeStrategyOptions.cs new file mode 100644 index 00000000000..3521477f3ea --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy.Outcomes/OutcomeStrategyOptions.cs @@ -0,0 +1,8 @@ +// Assembly 'Polly.Core' + +namespace Polly.Simmy.Outcomes; + +public class OutcomeStrategyOptions : OutcomeStrategyOptions +{ + public OutcomeStrategyOptions(); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/BehaviorPipelineBuilderExtensions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/BehaviorPipelineBuilderExtensions.cs new file mode 100644 index 00000000000..960d910c2cf --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/BehaviorPipelineBuilderExtensions.cs @@ -0,0 +1,14 @@ +// Assembly 'Polly.Core' + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Threading.Tasks; +using Polly.Simmy.Behavior; + +namespace Polly.Simmy; + +public static class BehaviorPipelineBuilderExtensions +{ + public static TBuilder AddChaosBehavior(this TBuilder builder, double injectionRate, Func behavior) where TBuilder : ResiliencePipelineBuilderBase; + public static TBuilder AddChaosBehavior(this TBuilder builder, BehaviorStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase; +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/EnabledGeneratorArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/EnabledGeneratorArguments.cs new file mode 100644 index 00000000000..b86136ce155 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/EnabledGeneratorArguments.cs @@ -0,0 +1,11 @@ +// Assembly 'Polly.Core' + +using System.Runtime.CompilerServices; + +namespace Polly.Simmy; + +public readonly struct EnabledGeneratorArguments +{ + public ResilienceContext Context { get; } + public EnabledGeneratorArguments(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/FaultPipelineBuilderExtensions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/FaultPipelineBuilderExtensions.cs new file mode 100644 index 00000000000..bfd4a726f52 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/FaultPipelineBuilderExtensions.cs @@ -0,0 +1,14 @@ +// Assembly 'Polly.Core' + +using System; +using System.Diagnostics.CodeAnalysis; +using Polly.Simmy.Fault; + +namespace Polly.Simmy; + +public static class FaultPipelineBuilderExtensions +{ + public static TBuilder AddChaosFault(this TBuilder builder, double injectionRate, Exception fault) where TBuilder : ResiliencePipelineBuilderBase; + public static TBuilder AddChaosFault(this TBuilder builder, double injectionRate, Func faultGenerator) where TBuilder : ResiliencePipelineBuilderBase; + public static TBuilder AddChaosFault(this TBuilder builder, FaultStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase; +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/InjectionRateGeneratorArguments.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/InjectionRateGeneratorArguments.cs new file mode 100644 index 00000000000..8eaa7d8fa79 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/InjectionRateGeneratorArguments.cs @@ -0,0 +1,11 @@ +// Assembly 'Polly.Core' + +using System.Runtime.CompilerServices; + +namespace Polly.Simmy; + +public readonly struct InjectionRateGeneratorArguments +{ + public ResilienceContext Context { get; } + public InjectionRateGeneratorArguments(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/LatencyPipelineBuilderExtensions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/LatencyPipelineBuilderExtensions.cs new file mode 100644 index 00000000000..73ccd8a6928 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/LatencyPipelineBuilderExtensions.cs @@ -0,0 +1,13 @@ +// Assembly 'Polly.Core' + +using System; +using System.Diagnostics.CodeAnalysis; +using Polly.Simmy.Latency; + +namespace Polly.Simmy; + +public static class LatencyPipelineBuilderExtensions +{ + public static TBuilder AddChaosLatency(this TBuilder builder, double injectionRate, TimeSpan latency) where TBuilder : ResiliencePipelineBuilderBase; + public static TBuilder AddChaosLatency(this TBuilder builder, LatencyStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase; +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategy.T.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategy.T.cs new file mode 100644 index 00000000000..339133ee8ba --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategy.T.cs @@ -0,0 +1,14 @@ +// Assembly 'Polly.Core' + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; + +namespace Polly.Simmy; + +public abstract class MonkeyStrategy : ResilienceStrategy +{ + protected MonkeyStrategy(MonkeyStrategyOptions options); + protected ValueTask ShouldInjectAsync(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategy.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategy.cs new file mode 100644 index 00000000000..823ad90a6dd --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategy.cs @@ -0,0 +1,14 @@ +// Assembly 'Polly.Core' + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; + +namespace Polly.Simmy; + +public abstract class MonkeyStrategy : ResilienceStrategy +{ + protected MonkeyStrategy(MonkeyStrategyOptions options); + protected ValueTask ShouldInjectAsync(ResilienceContext context); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategyOptions.TResult.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategyOptions.TResult.cs new file mode 100644 index 00000000000..d8428eb04d6 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategyOptions.TResult.cs @@ -0,0 +1,20 @@ +// Assembly 'Polly.Core' + +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; + +namespace Polly.Simmy; + +public abstract class MonkeyStrategyOptions : ResilienceStrategyOptions +{ + [Range(0.0, 1.0)] + public double InjectionRate { get; set; } + public Func>? InjectionRateGenerator { get; set; } + public Func>? EnabledGenerator { get; set; } + public bool Enabled { get; set; } + [Required] + public Func Randomizer { get; set; } + protected MonkeyStrategyOptions(); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategyOptions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategyOptions.cs new file mode 100644 index 00000000000..24abb1662c3 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/MonkeyStrategyOptions.cs @@ -0,0 +1,8 @@ +// Assembly 'Polly.Core' + +namespace Polly.Simmy; + +public abstract class MonkeyStrategyOptions : MonkeyStrategyOptions +{ + protected MonkeyStrategyOptions(); +} diff --git a/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/OutcomePipelineBuilderExtensions.cs b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/OutcomePipelineBuilderExtensions.cs new file mode 100644 index 00000000000..8639184b594 --- /dev/null +++ b/ApiReview/API.Polly.Core/NoDocs/Polly.Simmy/OutcomePipelineBuilderExtensions.cs @@ -0,0 +1,14 @@ +// Assembly 'Polly.Core' + +using System; +using System.Diagnostics.CodeAnalysis; +using Polly.Simmy.Outcomes; + +namespace Polly.Simmy; + +public static class OutcomePipelineBuilderExtensions +{ + public static ResiliencePipelineBuilder AddChaosResult<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TResult>(this ResiliencePipelineBuilder builder, double injectionRate, TResult result); + public static ResiliencePipelineBuilder AddChaosResult<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TResult>(this ResiliencePipelineBuilder builder, double injectionRate, Func resultGenerator); + public static ResiliencePipelineBuilder AddChaosResult<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] TResult>(this ResiliencePipelineBuilder builder, OutcomeStrategyOptions options); +}