From 21cfc0d51e4481409b3a83149458f39ebbb4ea40 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Tue, 2 Jul 2024 09:01:45 -0700 Subject: [PATCH] Use `DateTimeOffset` everywhere instead of `string` --- src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJob.cs | 6 ++++-- .../Models/WorkflowJobEvent/WorkflowJobStep.cs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJob.cs b/src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJob.cs index 001926ba..0a20b789 100644 --- a/src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJob.cs +++ b/src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJob.cs @@ -60,7 +60,8 @@ public sealed record WorkflowJob public string? RunnerGroupName { get; init; } [JsonPropertyName("started_at")] - public string StartedAt { get; init; } = null!; + [JsonConverter(typeof(DateTimeOffsetConverter))] + public DateTimeOffset StartedAt { get; init; } [JsonPropertyName("completed_at")] public string? CompletedAt { get; init; } @@ -72,5 +73,6 @@ public sealed record WorkflowJob public string? HeadBranch { get; init; } [JsonPropertyName("created_at")] - public string CreatedAt { get; init; } = null!; + [JsonConverter(typeof(DateTimeOffsetConverter))] + public DateTimeOffset CreatedAt { get; init; } } diff --git a/src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJobStep.cs b/src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJobStep.cs index 14b65051..e4069039 100644 --- a/src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJobStep.cs +++ b/src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJobStep.cs @@ -18,7 +18,8 @@ public sealed record WorkflowJobStep public long Number { get; init; } [JsonPropertyName("started_at")] - public string StartedAt { get; init; } = null!; + [JsonConverter(typeof(DateTimeOffsetConverter))] + public DateTimeOffset StartedAt { get; init; } [JsonPropertyName("completed_at")] [JsonConverter(typeof(NullableDateTimeOffsetConverter))]