public static DesiredProperties FromJsonObject(JObject root) { DesiredProperties desiredProperties = new DesiredProperties(); JToken jValue; if (root.TryGetValue(JsonApplyProperties, out jValue) && jValue is JObject) { desiredProperties.applyProperties = WUProperties.FromJsonObject((JObject)jValue); } if (root.TryGetValue(JsonReportProperties, out jValue) && jValue is JValue && jValue.Type == JTokenType.String) { desiredProperties.reportProperties = (string)jValue; } return(desiredProperties); }
public static WUProperties FromJsonObject(JObject root) { WUProperties wuProperties = new WUProperties(); wuProperties.activeHoursStart = Utils.GetInt(root, JsonActiveHoursStart, -1); wuProperties.activeHoursEnd = Utils.GetInt(root, JsonActiveHoursEnd, -1); wuProperties.allowAutoUpdate = Utils.GetInt(root, JsonAllowAutoUpdate, -1); wuProperties.allowUpdateService = Utils.GetInt(root, JsonAllowUpdateService, -1); wuProperties.branchReadinessLevel = Utils.GetInt(root, JsonBranchReadinessLevel, -1); wuProperties.deferFeatureUpdatesPeriod = Utils.GetInt(root, JsonDeferFeatureUpdatesPeriod, -1); wuProperties.deferQualityUpdatesPeriod = Utils.GetInt(root, JsonDeferQualityUpdatesPeriod, -1); wuProperties.pauseFeatureUpdates = Utils.GetInt(root, JsonPauseFeatureUpdates, -1); wuProperties.pauseQualityUpdates = Utils.GetInt(root, JsonPauseQualityUpdates, -1); wuProperties.scheduledInstallDay = Utils.GetInt(root, JsonScheduledInstallDay, -1); wuProperties.scheduledInstallTime = Utils.GetInt(root, JsonScheduledInstallTime, -1); wuProperties.ring = Utils.GetString(root, JsonRing, NotFound); wuProperties.sourcePriority = Utils.GetString(root, JsonSourcePriority, NotFound); return(wuProperties); }