File: Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Validators.g.cs
Project: ..\..\..\src\Libraries\Microsoft.Extensions.Http.Resilience\Microsoft.Extensions.Http.Resilience.csproj (Microsoft.Extensions.Http.Resilience)

    // <auto-generated/>
    #nullable enable
    #pragma warning disable CS1591 // Compensate for https://github.com/dotnet/roslyn/issues/54103
    namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __HedgingEndpointOptionsValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.HedgingEndpointOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "RateLimiter";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HedgingEndpointOptions.RateLimiter" : $"{name}.RateLimiter";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.RateLimiter, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.RateLimiter is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpRateLimiterStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HedgingEndpointOptions.RateLimiter" : $"{name}.RateLimiter", options.RateLimiter));
            }
 
            context.MemberName = "CircuitBreaker";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HedgingEndpointOptions.CircuitBreaker" : $"{name}.CircuitBreaker";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.CircuitBreaker, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.CircuitBreaker is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpCircuitBreakerStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HedgingEndpointOptions.CircuitBreaker" : $"{name}.CircuitBreaker", options.CircuitBreaker));
            }
 
            context.MemberName = "Timeout";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HedgingEndpointOptions.Timeout" : $"{name}.Timeout";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Timeout, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.Timeout is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpTimeoutStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HedgingEndpointOptions.Timeout" : $"{name}.Timeout", options.Timeout));
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __HttpCircuitBreakerStrategyOptionsValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.HttpCircuitBreakerStrategyOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "FailureRatio";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpCircuitBreakerStrategyOptions.FailureRatio" : $"{name}.FailureRatio";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A2);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.FailureRatio, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "MinimumThroughput";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpCircuitBreakerStrategyOptions.MinimumThroughput" : $"{name}.MinimumThroughput";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A3);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.MinimumThroughput, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "SamplingDuration";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpCircuitBreakerStrategyOptions.SamplingDuration" : $"{name}.SamplingDuration";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A4);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.SamplingDuration, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "BreakDuration";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpCircuitBreakerStrategyOptions.BreakDuration" : $"{name}.BreakDuration";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A4);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.BreakDuration, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "ShouldHandle";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpCircuitBreakerStrategyOptions.ShouldHandle" : $"{name}.ShouldHandle";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.ShouldHandle, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __HttpHedgingStrategyOptionsValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.HttpHedgingStrategyOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "MaxHedgedAttempts";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpHedgingStrategyOptions.MaxHedgedAttempts" : $"{name}.MaxHedgedAttempts";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A5);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.MaxHedgedAttempts, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "ShouldHandle";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpHedgingStrategyOptions.ShouldHandle" : $"{name}.ShouldHandle";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.ShouldHandle, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "ActionGenerator";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpHedgingStrategyOptions.ActionGenerator" : $"{name}.ActionGenerator";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.ActionGenerator, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __HttpRateLimiterStrategyOptionsValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.HttpRateLimiterStrategyOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "DefaultRateLimiterOptions";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpRateLimiterStrategyOptions.DefaultRateLimiterOptions" : $"{name}.DefaultRateLimiterOptions";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.DefaultRateLimiterOptions, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __HttpRetryStrategyOptionsValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.HttpRetryStrategyOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "MaxRetryAttempts";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpRetryStrategyOptions.MaxRetryAttempts" : $"{name}.MaxRetryAttempts";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A6);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.MaxRetryAttempts, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "Delay";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpRetryStrategyOptions.Delay" : $"{name}.Delay";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A7);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Delay, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "MaxDelay";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpRetryStrategyOptions.MaxDelay" : $"{name}.MaxDelay";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A7);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.MaxDelay, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "ShouldHandle";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpRetryStrategyOptions.ShouldHandle" : $"{name}.ShouldHandle";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.ShouldHandle, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "Randomizer";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpRetryStrategyOptions.Randomizer" : $"{name}.Randomizer";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Randomizer, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __HttpTimeoutStrategyOptionsValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.HttpTimeoutStrategyOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "Timeout";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpTimeoutStrategyOptions.Timeout" : $"{name}.Timeout";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A8);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Timeout, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __UriEndpointGroupValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.UriEndpointGroup options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "Endpoints";
            context.DisplayName = string.IsNullOrEmpty(name) ? "UriEndpointGroup.Endpoints" : $"{name}.Endpoints";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A9);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Endpoints, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.Endpoints is not null)
            {
                var count = 0;
                foreach (var o in options.Endpoints)
                {
                    if (o is not null)
                    {
                        (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__WeightedUriEndpointValidator__.Validate(string.IsNullOrEmpty(name) ? $"UriEndpointGroup.Endpoints[{count}]" : $"{name}.Endpoints[{count}]", o));
                    }
                    else
                    {
                        (builder ??= new()).AddError(string.IsNullOrEmpty(name) ? $"UriEndpointGroup.Endpoints[{count}] is null" : $"{name}.Endpoints[{count}] is null");
                    }
                    count++;
                }
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __WeightedUriEndpointGroupValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.WeightedUriEndpointGroup options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "Weight";
            context.DisplayName = string.IsNullOrEmpty(name) ? "WeightedUriEndpointGroup.Weight" : $"{name}.Weight";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A10);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Weight, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "Endpoints";
            context.DisplayName = string.IsNullOrEmpty(name) ? "WeightedUriEndpointGroup.Endpoints" : $"{name}.Endpoints";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A9);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Endpoints, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.Endpoints is not null)
            {
                var count = 0;
                foreach (var o in options.Endpoints)
                {
                    if (o is not null)
                    {
                        (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__WeightedUriEndpointValidator__.Validate(string.IsNullOrEmpty(name) ? $"WeightedUriEndpointGroup.Endpoints[{count}]" : $"{name}.Endpoints[{count}]", o));
                    }
                    else
                    {
                        (builder ??= new()).AddError(string.IsNullOrEmpty(name) ? $"WeightedUriEndpointGroup.Endpoints[{count}] is null" : $"{name}.Endpoints[{count}] is null");
                    }
                    count++;
                }
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    internal sealed partial class __WeightedUriEndpointValidator__
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public static global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.WeightedUriEndpoint options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "Uri";
            context.DisplayName = string.IsNullOrEmpty(name) ? "WeightedUriEndpoint.Uri" : $"{name}.Uri";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Uri, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            context.MemberName = "Weight";
            context.DisplayName = string.IsNullOrEmpty(name) ? "WeightedUriEndpoint.Weight" : $"{name}.Weight";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A10);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Weight, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience.Internal.Routing
{
    partial class OrderedGroupsRoutingOptionsValidator
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.OrderedGroupsRoutingOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(2);
 
            context.MemberName = "Groups";
            context.DisplayName = string.IsNullOrEmpty(name) ? "OrderedGroupsRoutingOptions.Groups" : $"{name}.Groups";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A9);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Groups, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.Groups is not null)
            {
                var count = 0;
                foreach (var o in options.Groups)
                {
                    if (o is not null)
                    {
                        (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__UriEndpointGroupValidator__.Validate(string.IsNullOrEmpty(name) ? $"OrderedGroupsRoutingOptions.Groups[{count}]" : $"{name}.Groups[{count}]", o));
                    }
                    else
                    {
                        (builder ??= new()).AddError(string.IsNullOrEmpty(name) ? $"OrderedGroupsRoutingOptions.Groups[{count}] is null" : $"{name}.Groups[{count}] is null");
                    }
                    count++;
                }
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience.Internal.Routing
{
    partial class WeightedGroupsRoutingOptionsValidator
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.WeightedGroupsRoutingOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(2);
 
            context.MemberName = "Groups";
            context.DisplayName = string.IsNullOrEmpty(name) ? "WeightedGroupsRoutingOptions.Groups" : $"{name}.Groups";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A9);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Groups, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.Groups is not null)
            {
                var count = 0;
                foreach (var o in options.Groups)
                {
                    if (o is not null)
                    {
                        (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__WeightedUriEndpointGroupValidator__.Validate(string.IsNullOrEmpty(name) ? $"WeightedGroupsRoutingOptions.Groups[{count}]" : $"{name}.Groups[{count}]", o));
                    }
                    else
                    {
                        (builder ??= new()).AddError(string.IsNullOrEmpty(name) ? $"WeightedGroupsRoutingOptions.Groups[{count}] is null" : $"{name}.Groups[{count}] is null");
                    }
                    count++;
                }
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience.Internal.Validators
{
    partial class HttpStandardHedgingResilienceOptionsValidator
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.HttpStandardHedgingResilienceOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "TotalRequestTimeout";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpStandardHedgingResilienceOptions.TotalRequestTimeout" : $"{name}.TotalRequestTimeout";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.TotalRequestTimeout, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.TotalRequestTimeout is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpTimeoutStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HttpStandardHedgingResilienceOptions.TotalRequestTimeout" : $"{name}.TotalRequestTimeout", options.TotalRequestTimeout));
            }
 
            context.MemberName = "Hedging";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpStandardHedgingResilienceOptions.Hedging" : $"{name}.Hedging";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Hedging, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.Hedging is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpHedgingStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HttpStandardHedgingResilienceOptions.Hedging" : $"{name}.Hedging", options.Hedging));
            }
 
            context.MemberName = "Endpoint";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpStandardHedgingResilienceOptions.Endpoint" : $"{name}.Endpoint";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Endpoint, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.Endpoint is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HedgingEndpointOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HttpStandardHedgingResilienceOptions.Endpoint" : $"{name}.Endpoint", options.Endpoint));
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace Microsoft.Extensions.Http.Resilience.Internal.Validators
{
    partial class HttpStandardResilienceOptionsValidator
    {
        /// <summary>
        /// Validates a specific named options instance (or all when <paramref name="name"/> is <see langword="null" />).
        /// </summary>
        /// <param name="name">The name of the options instance being validated.</param>
        /// <param name="options">The options instance.</param>
        /// <returns>Validation result.</returns>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
        public global::Microsoft.Extensions.Options.ValidateOptionsResult Validate(string? name, global::Microsoft.Extensions.Http.Resilience.HttpStandardResilienceOptions options)
        {
            global::Microsoft.Extensions.Options.ValidateOptionsResultBuilder? builder = null;
            var context = new global::System.ComponentModel.DataAnnotations.ValidationContext(options);
            var validationResults = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationResult>();
            var validationAttributes = new global::System.Collections.Generic.List<global::System.ComponentModel.DataAnnotations.ValidationAttribute>(1);
 
            context.MemberName = "RateLimiter";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.RateLimiter" : $"{name}.RateLimiter";
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.RateLimiter, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.RateLimiter is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpRateLimiterStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.RateLimiter" : $"{name}.RateLimiter", options.RateLimiter));
            }
 
            context.MemberName = "TotalRequestTimeout";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.TotalRequestTimeout" : $"{name}.TotalRequestTimeout";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.TotalRequestTimeout, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.TotalRequestTimeout is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpTimeoutStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.TotalRequestTimeout" : $"{name}.TotalRequestTimeout", options.TotalRequestTimeout));
            }
 
            context.MemberName = "Retry";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.Retry" : $"{name}.Retry";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.Retry, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.Retry is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpRetryStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.Retry" : $"{name}.Retry", options.Retry));
            }
 
            context.MemberName = "CircuitBreaker";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.CircuitBreaker" : $"{name}.CircuitBreaker";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.CircuitBreaker, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.CircuitBreaker is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpCircuitBreakerStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.CircuitBreaker" : $"{name}.CircuitBreaker", options.CircuitBreaker));
            }
 
            context.MemberName = "AttemptTimeout";
            context.DisplayName = string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.AttemptTimeout" : $"{name}.AttemptTimeout";
            validationResults.Clear();
            validationAttributes.Clear();
            validationAttributes.Add(global::__OptionValidationStaticInstances.__Attributes.A1);
            if (!global::System.ComponentModel.DataAnnotations.Validator.TryValidateValue(options.AttemptTimeout, context, validationResults, validationAttributes))
            {
                (builder ??= new()).AddResults(validationResults);
            }
 
            if (options.AttemptTimeout is not null)
            {
                (builder ??= new()).AddResult(global::Microsoft.Extensions.Http.Resilience.__HttpTimeoutStrategyOptionsValidator__.Validate(string.IsNullOrEmpty(name) ? "HttpStandardResilienceOptions.AttemptTimeout" : $"{name}.AttemptTimeout", options.AttemptTimeout));
            }
 
            return builder is null ? global::Microsoft.Extensions.Options.ValidateOptionsResult.Success : builder.Build();
        }
    }
}
namespace __OptionValidationStaticInstances
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    file static class __Attributes
    {
        internal static readonly global::System.ComponentModel.DataAnnotations.RequiredAttribute A1 = new global::System.ComponentModel.DataAnnotations.RequiredAttribute();
 
        internal static readonly __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute A2 = new __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute(
            (double)0,
            (double)1);
 
        internal static readonly __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute A3 = new __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute(
            (int)2,
            (int)2147483647);
 
        internal static readonly __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute A4 = new __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute(
            typeof(global::System.TimeSpan),
            "00:00:00.500",
            "1.00:00:00");
 
        internal static readonly __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute A5 = new __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute(
            (int)1,
            (int)10);
 
        internal static readonly __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute A6 = new __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute(
            (int)1,
            (int)2147483647);
 
        internal static readonly __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute A7 = new __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute(
            typeof(global::System.TimeSpan),
            "00:00:00",
            "1.00:00:00");
 
        internal static readonly __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute A8 = new __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute(
            typeof(global::System.TimeSpan),
            "00:00:00.010",
            "1.00:00:00");
 
        internal static readonly global::Microsoft.Shared.Data.Validation.LengthAttribute A9 = new global::Microsoft.Shared.Data.Validation.LengthAttribute(
            (int)1);
 
        internal static readonly __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute A10 = new __OptionValidationGeneratedAttributes.__SourceGen__RangeAttribute(
            (int)1,
            (int)64000);
    }
}
namespace __OptionValidationStaticInstances
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    file static class __Validators
    {
    }
}
namespace __OptionValidationGeneratedAttributes
{
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Options.SourceGeneration", "8.0.10.6711")]
    [global::System.AttributeUsage(global::System.AttributeTargets.Property | global::System.AttributeTargets.Field | global::System.AttributeTargets.Parameter, AllowMultiple = false)]
    file class __SourceGen__RangeAttribute : global::System.ComponentModel.DataAnnotations.ValidationAttribute
    {
        public __SourceGen__RangeAttribute(int minimum, int maximum) : base()
        {
            Minimum = minimum;
            Maximum = maximum;
            OperandType = typeof(int);
        }
        public __SourceGen__RangeAttribute(double minimum, double maximum) : base()
        {
            Minimum = minimum;
            Maximum = maximum;
            OperandType = typeof(double);
        }
        public __SourceGen__RangeAttribute(global::System.Type type, string minimum, string maximum) : base()
        {
            OperandType = type;
            _needToConvertMinMax = true;
            Minimum = minimum;
            Maximum = maximum;
        }
        public object Minimum { get; private set; }
        public object Maximum { get; private set; }
        public bool MinimumIsExclusive { get; set; }
        public bool MaximumIsExclusive { get; set; }
        public global::System.Type OperandType { get; }
        public bool ParseLimitsInInvariantCulture { get; set; }
        public bool ConvertValueInInvariantCulture { get; set; }
        public override string FormatErrorMessage(string name) =>
                string.Format(global::System.Globalization.CultureInfo.CurrentCulture, GetValidationErrorMessage(), name, Minimum, Maximum);
        private readonly bool _needToConvertMinMax;
        private volatile bool _initialized;
        private readonly object _lock = new();
        private const string MinMaxError = "The minimum and maximum values must be set to valid values.";
 
        public override bool IsValid(object? value)
        {
            if (!_initialized)
            {
                lock (_lock)
                {
                    if (!_initialized)
                    {
                        if (Minimum is null || Maximum is null)
                        {
                            throw new global::System.InvalidOperationException(MinMaxError);
                        }
                        if (_needToConvertMinMax)
                        {
                            System.Globalization.CultureInfo culture = ParseLimitsInInvariantCulture ? global::System.Globalization.CultureInfo.InvariantCulture : global::System.Globalization.CultureInfo.CurrentCulture;
                            if (OperandType == typeof(global::System.TimeSpan))
                            {
                                if (!global::System.TimeSpan.TryParse((string)Minimum, culture, out global::System.TimeSpan timeSpanMinimum) ||
                                    !global::System.TimeSpan.TryParse((string)Maximum, culture, out global::System.TimeSpan timeSpanMaximum))
                                {
                                    throw new global::System.InvalidOperationException(MinMaxError);
                                }
                                Minimum = timeSpanMinimum;
                                Maximum = timeSpanMaximum;
                            }
                            else
                            {
                                Minimum = ConvertValue(Minimum, culture) ?? throw new global::System.InvalidOperationException(MinMaxError);
                                Maximum = ConvertValue(Maximum, culture) ?? throw new global::System.InvalidOperationException(MinMaxError);
                            }
                        }
                        int cmp = ((global::System.IComparable)Minimum).CompareTo((global::System.IComparable)Maximum);
                        if (cmp > 0)
                        {
                            throw new global::System.InvalidOperationException("The maximum value '{Maximum}' must be greater than or equal to the minimum value '{Minimum}'.");
                        }
                        else if (cmp == 0 && (MinimumIsExclusive || MaximumIsExclusive))
                        {
                            throw new global::System.InvalidOperationException("Cannot use exclusive bounds when the maximum value is equal to the minimum value.");
                        }
                        _initialized = true;
                    }
                }
            }
 
            if (value is null or string { Length: 0 })
            {
                return true;
            }
 
            System.Globalization.CultureInfo formatProvider = ConvertValueInInvariantCulture ? global::System.Globalization.CultureInfo.InvariantCulture : global::System.Globalization.CultureInfo.CurrentCulture;
            object? convertedValue;
 
            if (OperandType == typeof(global::System.TimeSpan))
            {
                if (value is global::System.TimeSpan)
                {
                    convertedValue = value;
                }
                else if (value is string)
                {
                    if (!global::System.TimeSpan.TryParse((string)value, formatProvider, out global::System.TimeSpan timeSpanValue))
                    {
                        return false;
                    }
                    convertedValue = timeSpanValue;
                }
                else
                {
                    throw new global::System.InvalidOperationException($"A value type {value.GetType()} that is not a TimeSpan or a string has been given. This might indicate a problem with the source generator.");
                }
            }
            else
            {
                try
                {
                    convertedValue = ConvertValue(value, formatProvider);
                }
                catch (global::System.Exception e) when (e is global::System.FormatException or global::System.InvalidCastException or global::System.NotSupportedException)
                {
                    return false;
                }
            }
 
            var min = (global::System.IComparable)Minimum;
            var max = (global::System.IComparable)Maximum;
 
            return
                (MinimumIsExclusive ? min.CompareTo(convertedValue) < 0 : min.CompareTo(convertedValue) <= 0) &&
                (MaximumIsExclusive ? max.CompareTo(convertedValue) > 0 : max.CompareTo(convertedValue) >= 0);
        }
        private string GetValidationErrorMessage()
        {
            return (MinimumIsExclusive, MaximumIsExclusive) switch
            {
                (false, false) => "The field {0} must be between {1} and {2}.",
                (true, false) => "The field {0} must be between {1} exclusive and {2}.",
                (false, true) => "The field {0} must be between {1} and {2} exclusive.",
                (true, true) => "The field {0} must be between {1} exclusive and {2} exclusive.",
            };
        }
        private object? ConvertValue(object? value, System.Globalization.CultureInfo formatProvider)
        {
            if (value is string stringValue)
            {
                value = global::System.Convert.ChangeType(stringValue, OperandType, formatProvider);
            }
            else
            {
                value = global::System.Convert.ChangeType(value, OperandType, formatProvider);
            }
            return value;
        }
    }
}