Skip to content

Commit

Permalink
feat: add name to WhatsApp file attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Aug 8, 2024
1 parent f388e83 commit b04ac43
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"client_ref": "abcdefg",
"file": {
"url": "https://test.com/me.txt",
"caption": "Me"
"caption": "Me",
"name": "file.txt"
},
"webhook_version": "v1",
"webhook_url": "https://example.com/status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"client_ref": "abcdefg",
"file": {
"url": "https://test.com/me.txt",
"caption": "Me"
"caption": "Me",
"name": "file.txt"
},
"context": {
"message_uuid": "a1b2c3d4a1b2c3d4"
Expand Down
2 changes: 2 additions & 0 deletions Vonage.Test/Messages/WhatsApp/WhatsAppMessagesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public async Task SendWhatsAppFileAsyncReturnsOk()
{
Url = "https://test.com/me.txt",
Caption = "Me",
Name = "file.txt",
},
ClientRef = "abcdefg",
WebhookUrl = new Uri("https://example.com/status"),
Expand All @@ -163,6 +164,7 @@ public async Task SendWhatsAppFileAsyncReturnsOkWithContext()
{
Url = "https://test.com/me.txt",
Caption = "Me",
Name = "file.txt",
},
ClientRef = "abcdefg",
Context = new WhatsAppContext("a1b2c3d4a1b2c3d4"),
Expand Down
9 changes: 8 additions & 1 deletion Vonage/Messages/CaptionedAttachment.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Text.Json.Serialization;
#region
using System.Text.Json.Serialization;
#endregion

namespace Vonage.Messages;

Expand All @@ -18,4 +20,9 @@ public class CaptionedAttachment
/// </summary>
[JsonPropertyOrder(0)]
public string Url { get; set; }

/// <summary>
/// </summary>
[JsonPropertyOrder(2)]
public string Name { get; set; }
}

0 comments on commit b04ac43

Please sign in to comment.