Webhook
This commit is contained in:
Stef Heyenrath
2021-03-24 18:15:31 +01:00
committed by GitHub
parent cee73023c7
commit d758301e4f
38 changed files with 1206 additions and 338 deletions

View File

@@ -0,0 +1,41 @@
using System.Text;
using WireMock.Types;
namespace WireMock.Util
{
/// <summary>
/// BodyData
/// </summary>
internal class BodyData : IBodyData
{
/// <inheritdoc cref="IBodyData.Encoding" />
public Encoding Encoding { get; set; }
/// <inheritdoc cref="IBodyData.BodyAsBytes" />
public string BodyAsString { get; set; }
/// <inheritdoc cref="IBodyData.BodyAsJson" />
public object BodyAsJson { get; set; }
/// <inheritdoc cref="IBodyData.BodyAsBytes" />
public byte[] BodyAsBytes { get; set; }
/// <inheritdoc cref="IBodyData.BodyAsJsonIndented" />
public bool? BodyAsJsonIndented { get; set; }
/// <inheritdoc cref="IBodyData.BodyAsFile" />
public string BodyAsFile { get; set; }
/// <inheritdoc cref="IBodyData.BodyAsFileIsCached" />
public bool? BodyAsFileIsCached { get; set; }
/// <inheritdoc cref="IBodyData.DetectedBodyType" />
public BodyType DetectedBodyType { get; set; }
/// <inheritdoc cref="IBodyData.DetectedBodyTypeFromContentType" />
public BodyType DetectedBodyTypeFromContentType { get; set; }
/// <inheritdoc cref="IRequestMessage.DetectedCompression" />
public string DetectedCompression { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
using JetBrains.Annotations;
using WireMock.Types;
namespace WireMock.Models
{
/// <summary>
/// Webhook
/// </summary>
public class Webhook : IWebhook
{
/// <inheritdoc cref="IWebhook.Request"/>
public IWebhookRequest Request { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
using WireMock.Types;
using WireMock.Util;
namespace WireMock.Models
{
/// <summary>
/// WebhookRequest
/// </summary>
public class WebhookRequest : IWebhookRequest
{
/// <inheritdoc cref="IWebhookRequest.Url"/>
public string Url { get; set; }
/// <inheritdoc cref="IWebhookRequest.Method"/>
public string Method { get; set; }
/// <inheritdoc cref="IWebhookRequest.Headers"/>
public IDictionary<string, WireMockList<string>> Headers { get; set; }
/// <inheritdoc cref="IWebhookRequest.BodyData"/>
public IBodyData BodyData { get; set; }
/// <inheritdoc cref="IWebhookRequest.UseTransformer"/>
public bool? UseTransformer { get; set; }
/// <inheritdoc cref="IWebhookRequest.TransformerType"/>
public TransformerType TransformerType { get; set; }
}
}