fix: default nullable properties to actually datetimeoffset min value when new'd up

This commit is contained in:
Stevan Freeborn
2025-01-08 23:20:21 -06:00
parent c5f3c5eca5
commit 0a6d89bd77
2 changed files with 6 additions and 6 deletions
@@ -27,13 +27,13 @@ public class MessageBatchResponse
/// Gets the counts of requests in the batch. /// Gets the counts of requests in the batch.
/// </summary> /// </summary>
[JsonPropertyName("request_counts")] [JsonPropertyName("request_counts")]
public MessageBatchRequestCounts RequestCounts { get; init; } = new MessageBatchRequestCounts(); public MessageBatchRequestCounts RequestCounts { get; init; } = new();
/// <summary> /// <summary>
/// Gets the date and time when the batch ended. /// Gets the date and time when the batch ended.
/// </summary> /// </summary>
[JsonPropertyName("ended_at")] [JsonPropertyName("ended_at")]
public DateTimeOffset? EndedAt { get; init; } public DateTimeOffset? EndedAt { get; init; } = DateTimeOffset.MinValue;
/// <summary> /// <summary>
/// Gets the date and time when the batch was created. /// Gets the date and time when the batch was created.
@@ -51,13 +51,13 @@ public class MessageBatchResponse
/// Gets the date and time when the batch was archived. /// Gets the date and time when the batch was archived.
/// </summary> /// </summary>
[JsonPropertyName("archived_at")] [JsonPropertyName("archived_at")]
public DateTimeOffset? ArchivedAt { get; init; } public DateTimeOffset? ArchivedAt { get; init; } = DateTimeOffset.MinValue;
/// <summary> /// <summary>
/// Gets the date and time when the batch cancellation was initiated. /// Gets the date and time when the batch cancellation was initiated.
/// </summary> /// </summary>
[JsonPropertyName("cancel_initiated_at")] [JsonPropertyName("cancel_initiated_at")]
public DateTimeOffset? CancelInitiatedAt { get; init; } public DateTimeOffset? CancelInitiatedAt { get; init; } = DateTimeOffset.MinValue;
/// <summary> /// <summary>
/// Gets the URL to the results of the batch. /// Gets the URL to the results of the batch.
@@ -50,7 +50,7 @@ public class MessageBatchResponseTests : SerializationTest
Id = "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF", Id = "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
Type = "message_batch", Type = "message_batch",
ProcessingStatus = "in_progress", ProcessingStatus = "in_progress",
RequestCounts = new MessageBatchRequestCounts RequestCounts = new()
{ {
Processing = 100, Processing = 100,
Succeeded = 50, Succeeded = 50,
@@ -94,7 +94,7 @@ public class MessageBatchResponseTests : SerializationTest
Id = "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF", Id = "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
Type = "message_batch", Type = "message_batch",
ProcessingStatus = "in_progress", ProcessingStatus = "in_progress",
RequestCounts = new MessageBatchRequestCounts RequestCounts = new()
{ {
Processing = 100, Processing = 100,
Succeeded = 50, Succeeded = 50,