/// <summary> /// /// </summary> /// <param name="campaignId"></param> /// <param name="mailingListId"></param> /// <param name="timestampSince"></param> /// <returns></returns> public async Task <List <ProfileUpdateType> > ProfileUpdatesAsync(string campaignId = null, string mailingListId = null, string timestampSince = null) { try { if (_profileUpdates == null) { var req = new GetProfileUpdatesReq() { header = Client.RequestHeader }; if (!string.IsNullOrWhiteSpace(campaignId)) { req.campaignId = int.Parse(campaignId); } req.campaignIdSpecified = true; if (!string.IsNullOrWhiteSpace(mailingListId)) { req.mailingListId = int.Parse(mailingListId); } req.mailingListIdSpecified = true; if (!string.IsNullOrWhiteSpace(timestampSince)) { req.timestampSince = timestampSince; } GetProfileUpdatesResponse response = await _client.API.GetProfileUpdatesAsync(req); _profileUpdates = response.GetProfileUpdatesResp; } if (_profileUpdates.errorCode == (int)errorCode.No_error) { return(_profileUpdates.profileUpdateTypeItems.ToList <ProfileUpdateType>()); } throw new FlexMailException(_profileUpdates.errorMessage, _profileUpdates.errorCode); } catch (Exception ex) { ////telemetry.TrackException(ex, new Dictionary<string, string> { { "Flexmail", "Account.ProfileUpdates" } }); if (ex is FlexMailException) { throw (ex); } } finally { _profileUpdates = null; } return(new List <ProfileUpdateType>()); }
private bool disposedValue = false; // To detect redundant calls /// <summary> /// /// </summary> /// <param name="disposing"></param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { } _balance = null; _bounces = null; _profileUpdates = null; _subscriptions = null; _unsubscriptions = null; disposedValue = true; } }