using System; using System.Text; using System.Threading.Tasks; using JsonConverter.Abstractions; namespace WireMock.ResponseBuilders; /// /// The BodyResponseBuilder interface. /// public interface IBodyResponseBuilder : IFaultResponseBuilder { /// /// WithBody : Create a ... response based on a string. /// /// The body. /// The Body Destination format (SameAsSource, String or Bytes). /// The body encoding. /// A . IResponseBuilder WithBody(string body, string? destination = BodyDestinationFormat.SameAsSource, Encoding? encoding = null); /// /// WithBody : Create a ... response based on a callback function. /// /// The delegate to build the body. /// The Body Destination format (SameAsSource, String or Bytes). /// The body encoding. /// A . IResponseBuilder WithBody(Func bodyFactory, string? destination = BodyDestinationFormat.SameAsSource, Encoding? encoding = null); /// /// WithBody : Create a ... response based on a async callback function. /// /// The async delegate to build the body. /// The Body Destination format (SameAsSource, String or Bytes). /// The body encoding. /// A . IResponseBuilder WithBody(Func> bodyFactory, string? destination = BodyDestinationFormat.SameAsSource, Encoding? encoding = null); /// /// WithBody : Create a ... response based on a bytearray. /// /// The body. /// The Body Destination format (SameAsSource, String or Bytes). /// The body encoding. /// A . IResponseBuilder WithBody(byte[] body, string? destination = BodyDestinationFormat.SameAsSource, Encoding? encoding = null); /// /// WithBody : Create a string response based on a object (which will be converted to a JSON string). /// /// The body. /// The body encoding. /// Define whether child objects to be indented according to the Newtonsoft.Json.JsonTextWriter.Indentation and Newtonsoft.Json.JsonTextWriter.IndentChar settings. /// A . IResponseBuilder WithBodyAsJson(object body, Encoding? encoding = null, bool? indented = null); /// /// WithBody : Create a string response based on a object (which will be converted to a JSON string). /// /// The body. /// Define whether child objects to be indented according to the Newtonsoft.Json.JsonTextWriter.Indentation and Newtonsoft.Json.JsonTextWriter.IndentChar settings. /// A . IResponseBuilder WithBodyAsJson(object body, bool indented); /// /// WithBodyAsJson : Create a ... response based on a callback function. /// /// The delegate to build the body. /// The body encoding. /// A . IResponseBuilder WithBodyAsJson(Func bodyFactory, Encoding? encoding = null); /// /// WithBodyAsJson : Create a ... response based on a async callback function. /// /// The async delegate to build the body. /// The body encoding. /// A . IResponseBuilder WithBodyAsJson(Func> bodyFactory, Encoding? encoding = null); /// /// WithBodyFromFile : Create a ... response based on a File. /// /// The filename. /// Defines if this file is cached in memory or retrieved from disk every time the response is created. /// A . IResponseBuilder WithBodyFromFile(string filename, bool cache = true); /// /// WithBody : Create a string response based on a object (which will be converted to a JSON string using the ). /// /// The body. /// The JsonConverter. /// The [optional]. /// A . IResponseBuilder WithBody(object body, IJsonConverter converter, JsonConverterOptions? options = null); /// /// WithBody : Create a string response based on a object (which will be converted to a JSON string using the ). /// /// The body. /// The body encoding, can be null. /// The JsonConverter. /// The [optional]. /// A . IResponseBuilder WithBody(object body, Encoding? encoding, IJsonConverter converter, JsonConverterOptions? options = null); }