-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaidResponse.cs
More file actions
34 lines (27 loc) · 880 Bytes
/
PlaidResponse.cs
File metadata and controls
34 lines (27 loc) · 880 Bytes
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
using System;
using System.Net;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Take5ive.Plaid
{
public class PlaidResponse
{
private readonly JsonSerializerOptions _jsonOptions;
public PlaidResponse()
{
_jsonOptions = new JsonSerializerOptions() {
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
};
}
[JsonPropertyName("request_id")]
public string RequestID { get; set; }
[JsonPropertyName("status_code")]
public HttpStatusCode StatusCode { get; set; }
public PlaidError ErrorDetails { get; set; }
public string Serialize(bool ignoreNullValues = true)
{
_jsonOptions.IgnoreNullValues = ignoreNullValues;
return JsonSerializer.Serialize<Object>(this, _jsonOptions);
}
}
}