public Silanis.ESL.SDK.DelegationReport DownloadDelegationReport(string senderId, DateTime from, DateTime to) { try { string path = BuildDelegationReportUrl(senderId, from, to); string response = restClient.Get(path); Silanis.ESL.API.DelegationReport apiDelegationReport = JsonConvert.DeserializeObject <Silanis.ESL.API.DelegationReport>(response, settings); return(new DelegationReportConverter(apiDelegationReport).ToSDKDelegationReport()); } catch (EslServerException e) { throw new EslServerException("Could not download the delegation report." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Could not download the delegation report." + " Exception: " + e.Message, e); } }
internal Silanis.ESL.API.DelegationReport ToAPIDelegationReport() { if (sdkDelegationReport == null) { return(apiDelegationReport); } Silanis.ESL.API.DelegationReport result = new Silanis.ESL.API.DelegationReport(); result.From = sdkDelegationReport.From; result.To = sdkDelegationReport.To; foreach (Silanis.ESL.SDK.DelegationEventReport sdkDelegationEventReport in sdkDelegationReport.DelegationEventReports) { result.AddDelegationEventReport(new DelegationEventReportConverter(sdkDelegationEventReport).ToAPIDelegationEventReport()); } return(result); }
internal Silanis.ESL.API.DelegationReport ToAPIDelegationReport() { if (sdkDelegationReport == null) { return(apiDelegationReport); } Silanis.ESL.API.DelegationReport result = new Silanis.ESL.API.DelegationReport(); result.From = sdkDelegationReport.From; result.To = sdkDelegationReport.To; foreach (KeyValuePair <string, IList <DelegationEventReport> > sdkDelegationEventDictionary in sdkDelegationReport.DelegationEvents) { result.DelegationEvents.Add(sdkDelegationEventDictionary.Key, GetAPIDelegationEventList(sdkDelegationEventDictionary.Value)); } return(result); }
internal DelegationReportConverter(Silanis.ESL.API.DelegationReport apiDelegationReport) { this.apiDelegationReport = apiDelegationReport; }