public async Task SetAlertSettingsAsync(YouMailAlerts alerts) { try { AddPendingOp(); if (await LoginWaitAsync()) { var content = SerializeObjectToHttpContent(alerts, YMST.c_alertSettings); using (var response = await YouMailApiAsync(YMST.c_alertSettingsUrl, content, HttpMethod.Put)) { } } } finally { RemovePendingOp(); } }
/// <summary> /// Get the YouMail alert settings /// </summary> /// <returns></returns> public async Task <YouMailAlerts> GetAlertSettingsAsync() { try { AddPendingOp(); YouMailAlerts returnValue = null; if (await LoginWaitAsync()) { using (var response = await YouMailApiAsync(YMST.c_alertSettingsUrl, null, HttpMethod.Get)) { returnValue = DeserializeObject <YouMailAlerts>(response.GetResponseStream(), YMST.c_alertSettings); } } return(returnValue); } finally { RemovePendingOp(); } }