public MonitorRecurrence(RecurrenceFrequency frequency, RecurrentSchedule schedule)
        {
            if (schedule == null)
            {
                throw new ArgumentNullException(nameof(schedule));
            }

            Frequency = frequency;
            Schedule  = schedule;
        }
        internal static MonitorRecurrence DeserializeMonitorRecurrence(JsonElement element)
        {
            RecurrenceFrequency frequency = default;
            RecurrentSchedule   schedule  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("frequency"))
                {
                    frequency = property.Value.GetString().ToRecurrenceFrequency();
                    continue;
                }
                if (property.NameEquals("schedule"))
                {
                    schedule = RecurrentSchedule.DeserializeRecurrentSchedule(property.Value);
                    continue;
                }
            }
            return(new MonitorRecurrence(frequency, schedule));
        }