/
SendOperationResult.cs
41 lines (37 loc) · 1.18 KB
/
SendOperationResult.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Altinn.Notifications.Email.Core.Status
{
/// <summary>
/// A class representing a send operation update object
/// </summary>
public class SendOperationResult
{
/// <summary>
/// The notification id
/// </summary>
public Guid? NotificationId { get; set; }
/// <summary>
/// The send operation id
/// </summary>
public string OperationId { get; set; } = string.Empty;
/// <summary>
/// The email send result
/// </summary>
public EmailSendResult? SendResult { get; set; }
/// <summary>
/// Json serializes the <see cref="SendOperationResult"/>
/// </summary>
public string Serialize()
{
return JsonSerializer.Serialize(
this,
new JsonSerializerOptions
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
Converters = { new JsonStringEnumConverter() }
});
}
}
}