public OneSpanSign.Sdk.DelegationReport DownloadDelegationReport(string senderId, DateTime from, DateTime to) { try { string path = BuildDelegationReportUrl(senderId, from, to); string response = restClient.Get(path); OneSpanSign.API.DelegationReport apiDelegationReport = JsonConvert.DeserializeObject <OneSpanSign.API.DelegationReport>(response, settings); return(new DelegationReportConverter(apiDelegationReport).ToSDKDelegationReport()); } catch (OssServerException e) { throw new OssServerException("Could not download the delegation report." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new OssException("Could not download the delegation report." + " Exception: " + e.Message, e); } }
internal OneSpanSign.API.DelegationReport ToAPIDelegationReport() { if (sdkDelegationReport == null) { return(apiDelegationReport); } OneSpanSign.API.DelegationReport result = new OneSpanSign.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(OneSpanSign.API.DelegationReport apiDelegationReport) { this.apiDelegationReport = apiDelegationReport; }