RetryStrategyOptions<TResult>
Represents the options used to configure a retry strategy.
            
                using Polly.Utils;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace Polly.Retry
{
    [NullableContext(1)]
    [Nullable(0)]
    [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Addressed with DynamicDependency on ValidationHelper.Validate method")]
    public class RetryStrategyOptions<[Nullable(2)] TResult> : ResilienceStrategyOptions
    {
        [Range(1, int.MaxValue)]
        public int MaxRetryAttempts { get; set; } = 3;
        public DelayBackoffType BackoffType { get; set; }
        public bool UseJitter { get; set; }
        [Range(typeof(TimeSpan), "00:00:00", "1.00:00:00")]
        public TimeSpan Delay { get; set; } = RetryConstants.DefaultBaseDelay;
        [Range(typeof(TimeSpan), "00:00:00", "1.00:00:00")]
        public TimeSpan? MaxDelay { get; set; }
        [Nullable(new byte[] {
            1,
            0,
            1,
            0
        })]
        [Required]
        [field: Nullable(new byte[] {
            1,
            0,
            1,
            0
        })]
        public Func<RetryPredicateArguments<TResult>, ValueTask<bool>> ShouldHandle {
            [return: Nullable(new byte[] {
                1,
                0,
                1,
                0
            })]
            get;
            [param: Nullable(new byte[] {
                1,
                0,
                1,
                0
            })]
            set;
        } = DefaultPredicates<RetryPredicateArguments<TResult>, TResult>.HandleOutcome;
        [Nullable(new byte[] {
            2,
            0,
            1,
            0
        })]
        [field: Nullable(new byte[] {
            2,
            0,
            1,
            0
        })]
        public Func<RetryDelayGeneratorArguments<TResult>, ValueTask<TimeSpan?>> DelayGenerator {
            [return: Nullable(new byte[] {
                2,
                0,
                1,
                0
            })]
            get;
            [param: Nullable(new byte[] {
                2,
                0,
                1,
                0
            })]
            set;
        }
        [Nullable(new byte[] {
            2,
            0,
            1
        })]
        [field: Nullable(new byte[] {
            2,
            0,
            1
        })]
        public Func<OnRetryArguments<TResult>, ValueTask> OnRetry {
            [return: Nullable(new byte[] {
                2,
                0,
                1
            })]
            get;
            [param: Nullable(new byte[] {
                2,
                0,
                1
            })]
            set;
        }
        [EditorBrowsable(EditorBrowsableState.Never)]
        [Required]
        public Func<double> Randomizer { get; set; } = RandomUtil.Instance.NextDouble;
        public RetryStrategyOptions()
        {
            base.Name = "Retry";
        }
    }
}