public Silanis.ESL.API.Result <Silanis.ESL.API.Sender> GetSenders(Direction direction, PageRequest request) { string path = template.UrlFor(UrlTemplate.ACCOUNT_MEMBER_LIST_PATH) .Replace("{dir}", DirectionUtility.getDirection(direction)) .Replace("{from}", request.From.ToString()) .Replace("{to}", request.To.ToString()) .Build(); try { string response = restClient.Get(path); Silanis.ESL.API.Result <Silanis.ESL.API.Sender> apiResponse = JsonConvert.DeserializeObject <Silanis.ESL.API.Result <Silanis.ESL.API.Sender> > (response, jsonSettings); return(apiResponse); } catch (EslServerException e) { throw new EslServerException("Failed to retrieve Account Members List.\t" + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Failed to retrieve Account Members List.\t" + " Exception: " + e.Message, e); } }
public IList <Silanis.ESL.API.CustomField> GetCustomFields(Direction direction, PageRequest request) { string path = template.UrlFor(UrlTemplate.ACCOUNT_CUSTOMFIELD_LIST_PATH) .Replace("{dir}", DirectionUtility.getDirection(direction)) .Replace("{from}", request.From.ToString()) .Replace("{to}", request.To.ToString()) .Build(); try { string response = client.Get(path); return(JsonConvert.DeserializeObject <IList <Silanis.ESL.API.CustomField> > (response, settings)); } catch (EslServerException e) { throw new EslServerException("Could not get the list of custom fields from account." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Could not get the list of custom fields from account." + " Exception: " + e.Message, e); } }
public Result <Package> GetLayouts(Direction direction, PageRequest request) { string path = template.UrlFor(UrlTemplate.LAYOUT_LIST_PATH) .Replace("{dir}", DirectionUtility.getDirection(direction)) .Replace("{from}", request.From.ToString()) .Replace("{to}", request.To.ToString()) .Build(); try { string response = restClient.Get(path); return(JsonConvert.DeserializeObject <Result <Silanis.ESL.API.Package> >(response, settings)); } catch (EslServerException e) { throw new EslServerException("Could not get list of layouts." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Could not get list of layouts." + " Exception: " + e.Message, e); } }