// Copyright © WireMock.Net

using WireMock.Matchers.Request;

namespace WireMock.RequestBuilders;

/// <summary>
/// IRequestBuilder
/// </summary>
public interface IRequestBuilder : IClientIPRequestBuilder
{
    /// <summary>
    /// Adds a request matcher to the builder.<br/>
    /// If the request matcher is already present, it will be replaced.
    /// </summary>
    /// <typeparam name="T">The type of the request matcher.</typeparam>
    /// <param name="requestMatcher">The request matcher to add.</param>
    /// <returns>The current <see cref="IRequestBuilder"/> instance.</returns>
    IRequestBuilder Add<T>(T requestMatcher) where T : IRequestMatcher;

    /// <summary>
    /// The link back to the Mapping.
    /// </summary>
    IMapping Mapping { get; set; }

    /// <summary>
    /// Chooses the <see cref="IRequestMatcher"/> which immediately returns a mismatch during mappings enumeration.
    /// </summary>
    /// <param name="earlyMatcherType">Selected type to choose the matcher from available list.</param>
    /// <returns>The current <see cref="IRequestBuilder"/> instance.</returns>
    IRequestBuilder WithEarlyMismatch(RequestMatcherType? earlyMatcherType);
}