Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
 public async Task<IEnumerable<ListSegment>> GetAllAsync(string listId, ListSegmentRequest request = null)
 {
     var response = await this.GetResponseAsync(listId, request);
     return response.Segments;
 }