public ActionResult GetAllFolders(FileManagerRequest request = null) { Task <IEnumerable <FileManagerFolder> > result = null; result = mailChimpManager.FileManagerFolders.GetAllAsync(request); return(View(result.Result)); }
public ActionResult GetFolderResponse(FileManagerRequest request = null) { Task <FileManagerFolderResponse> result = null; result = mailChimpManager.FileManagerFolders.GetResponseAsync(request); return(View(result.Result)); }
public async Task <IEnumerable <FileManagerFile> > GetAllAsync(FileManagerRequest request = null) { using (var client = this.CreateMailClient(BaseUrl)) { var response = await client.GetAsync(request?.ToQueryString()).ConfigureAwait(false); await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false); var fileManagerFileResponse = await response.Content.ReadAsAsync <FileManagerFileResponse>().ConfigureAwait(false); return(fileManagerFileResponse.Files); } }
public async Task<FileManagerFolderResponse> GetResponseAsync(FileManagerRequest request = null) { request = request ?? new FileManagerRequest { Limit = _limit }; using (var client = CreateMailClient(BaseUrl)) { var response = await client.GetAsync(request.ToQueryString()).ConfigureAwait(false); await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false); var fileManagerFolderResponse = await response.Content.ReadAsAsync<FileManagerFolderResponse>().ConfigureAwait(false); return fileManagerFolderResponse; } }
public async Task <IEnumerable <FileManagerFolder> > GetAllAsync(FileManagerRequest request = null) { return((await GetResponseAsync(request).ConfigureAwait(false))?.Folders); }