Esempio n. 1
0
        internal static JobScheduleExecutionInformation DeserializeJobScheduleExecutionInformation(JsonElement element)
        {
            DateTimeOffset?nextRunTime = default;
            RecentJob      recentJob   = default;
            DateTimeOffset?endTime     = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("nextRunTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    nextRunTime = property.Value.GetDateTimeOffset("S");
                    continue;
                }
                if (property.NameEquals("recentJob"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    recentJob = RecentJob.DeserializeRecentJob(property.Value);
                    continue;
                }
                if (property.NameEquals("endTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    endTime = property.Value.GetDateTimeOffset("S");
                    continue;
                }
            }
            return(new JobScheduleExecutionInformation(nextRunTime, recentJob, endTime));
        }
 internal JobScheduleExecutionInformation(DateTimeOffset?nextRunTime, RecentJob recentJob, DateTimeOffset?endTime)
 {
     NextRunTime = nextRunTime;
     RecentJob   = recentJob;
     EndTime     = endTime;
 }