using System; using System.Collections.Generic; using WireMock.Models; using WireMock.ResponseProviders; using WireMock.Types; namespace WireMock.Server; /// /// IRespondWithAProvider /// public interface IRespondWithAProvider { /// /// Gets the unique identifier for this mapping. /// Guid Guid { get; } /// /// Define a unique identifier for this mapping. /// /// The unique identifier. /// The . IRespondWithAProvider WithGuid(Guid guid); /// /// Define the TimeSettings for this mapping. /// /// The TimeSettings. /// The . IRespondWithAProvider WithTimeSettings(ITimeSettings timeSettings); /// /// Define a unique title for this mapping. /// /// The unique title. /// The . IRespondWithAProvider WithTitle(string title); /// /// Define a description for this mapping. /// /// The description. /// The . IRespondWithAProvider WithDescription(string description); /// /// Define the full filepath for this mapping. /// /// The full filepath. /// The . IRespondWithAProvider WithPath(string path); /// /// Define a unique identifier for this mapping. /// /// The unique identifier. /// The . IRespondWithAProvider WithGuid(string guid); /// /// Define the priority for this mapping. /// /// The priority. (A lower value means a higher priority.) /// The . IRespondWithAProvider AtPriority(int priority); /// /// The respond with. /// /// The provider. void RespondWith(IResponseProvider provider); /// /// Sets the the scenario. /// /// The scenario. /// The . IRespondWithAProvider InScenario(string scenario); /// /// Sets the the scenario with an integer value. /// /// The scenario. /// The . IRespondWithAProvider InScenario(int scenario); /// /// Execute this respond only in case the current state is equal to specified one. /// /// Any object which identifies the current state /// The . IRespondWithAProvider WhenStateIs(string state); /// /// Execute this respond only in case the current state is equal to specified one. /// /// Any object which identifies the current state /// The . IRespondWithAProvider WhenStateIs(int state); /// /// Once this mapping is executed the state will be changed to specified one. /// /// Any object which identifies the new state /// The number of times this match should be matched before the state will be changed to the specified one. Default value is 1. /// The . IRespondWithAProvider WillSetStateTo(string state, int? times = 1); /// /// Once this mapping is executed the state will be changed to specified one. /// /// Any object which identifies the new state /// The number of times this match should be matched before the state will be changed to the specified one. Default value is 1. /// The . IRespondWithAProvider WillSetStateTo(int state, int? times = 1); /// /// Add (multiple) Webhook(s) to call after the response has been generated. /// /// The Webhooks /// The . IRespondWithAProvider WithWebhook(params IWebhook[] webhooks); /// /// Support FireAndForget for any configured Webhooks /// /// /// IRespondWithAProvider WithWebhookFireAndForget(bool useWebhooksFireAndForget); /// /// Add a Webhook to call after the response has been generated. /// /// The Webhook Url /// The method to use. [optional] /// The Headers to send. [optional] /// The body (as string) to send. [optional] /// Use Transformer. [optional] /// The transformer type. [optional] /// The . IRespondWithAProvider WithWebhook( string url, string method = "post", IDictionary>? headers = null, string? body = null, bool useTransformer = true, TransformerType transformerType = TransformerType.Handlebars ); /// /// Add a Webhook to call after the response has been generated. /// /// The Webhook Url /// The method to use. [optional] /// The Headers to send. [optional] /// The body (as json) to send. [optional] /// Use Transformer. [optional] /// The transformer type. [optional] /// The . IRespondWithAProvider WithWebhook( string url, string method = "post", IDictionary>? headers = null, object? body = null, bool useTransformer = true, TransformerType transformerType = TransformerType.Handlebars ); /// /// Data Object which can be used when WithTransformer is used. /// e.g. lookup an path in this object using /// The data dictionary object. /// /// lookup data "1" /// /// /// The . IRespondWithAProvider WithData(object data); /// /// Define the probability when this request should be matched. Value is between 0 and 1. /// /// The probability when this request should be matched. Value is between 0 and 1. /// The . IRespondWithAProvider WithProbability(double probability); /// /// Define a Grpc ProtoDefinition which is used for the request and the response. /// This can be a ProtoDefinition as a string, or an id when the ProtoDefinitions are defined at the WireMockServer. /// /// The proto definition as text or as id. /// The . IRespondWithAProvider WithProtoDefinition(string protoDefinitionOrId); /// /// Define a GraphQL Schema which is used for the request and the response. /// This can be a GraphQL Schema as a string, or an id when the GraphQL Schema are defined at the WireMockServer. /// /// The GraphQL Schema as text or as id. /// A dictionary defining the custom scalars used in this schema. [optional] /// The . IRespondWithAProvider WithGraphQLSchema(string graphQLSchemaOrId, IDictionary? customScalars = null); }