using System; using System.Threading.Tasks; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.ResponseProviders; using WireMock.Settings; namespace WireMock; /// /// The IMapping interface. /// public interface IMapping { /// /// Gets the unique identifier. /// Guid Guid { get; } /// /// The datetime when this mapping was created or updated. /// public DateTime? UpdatedAt { get; set; } /// /// Gets the TimeSettings (Start, End and TTL). /// ITimeSettings? TimeSettings { get; } /// /// Gets the unique title. /// string? Title { get; } /// /// Gets the description. /// string? Description { get; } /// /// The full filename path for this mapping (only defined for static mappings). /// string? Path { get; set; } /// /// Gets the priority. (A low value means higher priority.) /// int Priority { get; } /// /// Scenario. /// string? Scenario { get; } /// /// Execution state condition for the current mapping. /// string? ExecutionConditionState { get; } /// /// The next state which will be signaled after the current mapping execution. /// In case the value is null, state will not be changed. /// string? NextState { get; } /// /// The number of times this match should be matched before the state will be changed to the next state. /// int? StateTimes { get; } /// /// The Request matcher. /// IRequestMatcher RequestMatcher { get; } /// /// The Provider. /// IResponseProvider Provider { get; } /// /// The WireMockServerSettings. /// WireMockServerSettings Settings { get; } /// /// Is State started ? /// bool IsStartState { get; } /// /// Gets a value indicating whether this mapping is an Admin Interface. /// /// /// true if this mapping is an Admin Interface; otherwise, false. /// bool IsAdminInterface { get; } /// /// Gets a value indicating whether this mapping is a Proxy Mapping. /// /// /// true if this mapping is a Proxy Mapping; otherwise, false. /// bool IsProxy { get; } /// /// Gets a value indicating whether this mapping to be logged. /// /// /// true if this mapping to be logged; otherwise, false. /// bool LogMapping { get; } /// /// The Webhooks. /// IWebhook[]? Webhooks { get; } /// /// Use Fire and Forget for the defined webhook(s). [Optional] /// bool? UseWebhooksFireAndForget { get; } /// /// Data Object which can be used when WithTransformer is used. /// e.g. lookup an path in this object using /// /// lookup data "1" /// /// object? Data { get; } /// /// The probability when this request should be matched. Value is between 0 and 1. [Optional] /// double? Probability { get; } /// /// ProvideResponseAsync /// /// The request message. /// The including a new (optional) . Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IRequestMessage requestMessage); /// /// Gets the RequestMatchResult based on the RequestMessage. /// /// The request message. /// The Next State. /// The . IRequestMatchResult GetRequestMatchResult(IRequestMessage requestMessage, string? nextState); }