/// <summary> /// /// </summary> /// <param name="emailAddress"></param> /// <param name="emailAddressHistoryOptionsType"></param> /// <param name="sort"></param> /// <param name="timestampFrom"></param> /// <param name="timestampTill"></param> /// <returns></returns> public EmailAddressHistoryType History(string emailAddress = null, EmailAddressHistoryOptionsType emailAddressHistoryOptionsType = null, string sort = null, string timestampFrom = null, string timestampTill = null) { try { if (_history == null) { var req = new GetEmailAddressHistoryReq() { header = Client.RequestHeader }; if (!string.IsNullOrWhiteSpace(emailAddress)) { req.emailAddress = emailAddress; } if (emailAddressHistoryOptionsType != null) { req.emailAddressHistoryOptionsType = emailAddressHistoryOptionsType; } if (!string.IsNullOrWhiteSpace(sort)) { req.sort = sort; } if (!string.IsNullOrWhiteSpace(timestampFrom)) { req.timestampFrom = timestampFrom; } if (!string.IsNullOrWhiteSpace(timestampTill)) { req.timestampTill = timestampTill; } _history = _client.API.GetEmailAddressHistory(req); } if (_history.errorCode == (int)errorCode.No_error) { return(_history.emailAddressHistoryType); } throw new FlexMailException(_history.errorMessage, _history.errorCode); } catch (Exception ex) { //telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "EmailAddress.History" } }); if (ex is FlexMailException) { throw (ex); } } finally { _history = null; } return(new EmailAddressHistoryType()); }
private bool disposedValue = false; // To detect redundant calls /// <summary> /// /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { } _create = null; _delete = null; _emailaddresses = null; _update = null; _history = null; _import = null; disposedValue = true; } }