internal JobScheduleAddParameter(string id, string displayName, Schedule schedule, JobSpecification jobSpecification, IList <MetadataItem> metadata)
 {
     Id               = id;
     DisplayName      = displayName;
     Schedule         = schedule;
     JobSpecification = jobSpecification;
     Metadata         = metadata;
 }
        public JobScheduleUpdateParameter(Schedule schedule, JobSpecification jobSpecification)
        {
            if (schedule == null)
            {
                throw new ArgumentNullException(nameof(schedule));
            }
            if (jobSpecification == null)
            {
                throw new ArgumentNullException(nameof(jobSpecification));
            }

            Schedule         = schedule;
            JobSpecification = jobSpecification;
        }
        public JobScheduleAddParameter(string id, Schedule schedule, JobSpecification jobSpecification)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }
            if (schedule == null)
            {
                throw new ArgumentNullException(nameof(schedule));
            }
            if (jobSpecification == null)
            {
                throw new ArgumentNullException(nameof(jobSpecification));
            }

            Id               = id;
            Schedule         = schedule;
            JobSpecification = jobSpecification;
        }
        internal static CloudJobSchedule DeserializeCloudJobSchedule(JsonElement element)
        {
            string           id                           = default;
            string           displayName                  = default;
            string           url                          = default;
            string           eTag                         = default;
            DateTimeOffset?  lastModified                 = default;
            DateTimeOffset?  creationTime                 = default;
            JobScheduleState?state                        = default;
            DateTimeOffset?  stateTransitionTime          = default;
            JobScheduleState?previousState                = default;
            DateTimeOffset?  previousStateTransitionTime  = default;
            Schedule         schedule                     = default;
            JobSpecification jobSpecification             = default;
            JobScheduleExecutionInformation executionInfo = default;
            IReadOnlyList <MetadataItem>    metadata      = default;
            JobScheduleStatistics           stats         = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("displayName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    displayName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("url"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    url = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("eTag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    eTag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("lastModified"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    lastModified = property.Value.GetDateTimeOffset("S");
                    continue;
                }
                if (property.NameEquals("creationTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    creationTime = property.Value.GetDateTimeOffset("S");
                    continue;
                }
                if (property.NameEquals("state"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    state = property.Value.GetString().ToJobScheduleState();
                    continue;
                }
                if (property.NameEquals("stateTransitionTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    stateTransitionTime = property.Value.GetDateTimeOffset("S");
                    continue;
                }
                if (property.NameEquals("previousState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    previousState = property.Value.GetString().ToJobScheduleState();
                    continue;
                }
                if (property.NameEquals("previousStateTransitionTime"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    previousStateTransitionTime = property.Value.GetDateTimeOffset("S");
                    continue;
                }
                if (property.NameEquals("schedule"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    schedule = Schedule.DeserializeSchedule(property.Value);
                    continue;
                }
                if (property.NameEquals("jobSpecification"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    jobSpecification = JobSpecification.DeserializeJobSpecification(property.Value);
                    continue;
                }
                if (property.NameEquals("executionInfo"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    executionInfo = JobScheduleExecutionInformation.DeserializeJobScheduleExecutionInformation(property.Value);
                    continue;
                }
                if (property.NameEquals("metadata"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <MetadataItem> array = new List <MetadataItem>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MetadataItem.DeserializeMetadataItem(item));
                    }
                    metadata = array;
                    continue;
                }
                if (property.NameEquals("stats"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    stats = JobScheduleStatistics.DeserializeJobScheduleStatistics(property.Value);
                    continue;
                }
            }
            return(new CloudJobSchedule(id, displayName, url, eTag, lastModified, creationTime, state, stateTransitionTime, previousState, previousStateTransitionTime, schedule, jobSpecification, executionInfo, metadata, stats));
        }
 internal JobSchedulePatchParameter(Schedule schedule, JobSpecification jobSpecification, IList <MetadataItem> metadata)
 {
     Schedule         = schedule;
     JobSpecification = jobSpecification;
     Metadata         = metadata;
 }