Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/SparkPost.Tests/DataMapperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,22 @@ public void Target()
dataMapper.ToDictionary(webhook)["target"].ShouldEqual(webhook.Target);
}

[Test]
public void CustomHeaders()
{
var webhook = new Webhook
{
CustomHeaders = new
{
XAPIKey = "abcd"
}
};

var dictionary = dataMapper.ToDictionary(webhook);
var customHeadersDetails = dictionary["custom_headers"].CastAs<IDictionary<string, object>>();
customHeadersDetails["x-api-key"].ShouldEqual("abcd");
}

[Test]
public void AuthType()
{
Expand Down
1 change: 1 addition & 0 deletions src/SparkPost/ListWebhookResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ internal static Webhook ConvertToAWebhook(dynamic r)
Id = r.id,
Name = r.name,
Target = r.target,
CustomHeaders = r.custom_headers,
Events = events,
AuthType = r.auth_type,
AuthRequestDetails = r.auth_request_details,
Expand Down
1 change: 1 addition & 0 deletions src/SparkPost/Webhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public Webhook()
public string Id { get; set; }
public string Name { get; set; }
public string Target { get; set; }
public object CustomHeaders { get; set; }
public IList<string> Events { get; set; }

public DateTime? LastSuccessful { get; set; }
Expand Down