public ActionResult GetAllListSegments(string listId, ListSegmentRequest request = null) { Task <IEnumerable <ListSegment> > result = null; if (listId != null) { result = mailChimpManager.ListSegments.GetAllAsync(listId); } return(View(result.Result)); }
public ActionResult GetListSegmentResponse(string listId, ListSegmentRequest request = null) { Task <ListSegmentResponse> result = null; if (listId != null) { result = mailChimpManager.ListSegments.GetResponseAsync(listId, request); } return(View(result.Result)); }
public async Task <ListSegmentResponse> GetResponseAsync(string listId, ListSegmentRequest request = null) { using (var client = this.CreateMailClient(string.Format(BaseUrl, listId))) { var response = await client.GetAsync(request?.ToQueryString()).ConfigureAwait(false); await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false); var segmentResponse = await response.Content.ReadAsAsync <ListSegmentResponse>().ConfigureAwait(false); return(segmentResponse); } }
public async Task <IEnumerable <ListSegment> > GetAllAsync(string listId, ListSegmentRequest request = null) { var response = await this.GetResponseAsync(listId, request); return(response.Segments); }
public async Task <IEnumerable <ListSegment> > GetAllAsync(string listId, ListSegmentRequest request = null) { return((await GetResponseAsync(listId, request).ConfigureAwait(false))?.Segments); }
public ActionResult GetAllListSegmentMembers(string listId, string segmentId, ListSegmentRequest request = null) { Task <IEnumerable <Member> > result = null; if (listId != null && segmentId != null) { result = mailChimpManager.ListSegments.GetAllMembersAsync(listId, segmentId, request); } return(View(result.Result)); }