コード例 #1
0
        public ActionResult GetAllFolders(FileManagerRequest request = null)
        {
            Task <IEnumerable <FileManagerFolder> > result = null;

            result = mailChimpManager.FileManagerFolders.GetAllAsync(request);

            return(View(result.Result));
        }
コード例 #2
0
        public ActionResult GetFolderResponse(FileManagerRequest request = null)
        {
            Task <FileManagerFolderResponse> result = null;

            result = mailChimpManager.FileManagerFolders.GetResponseAsync(request);

            return(View(result.Result));
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
 public async Task <IEnumerable <FileManagerFolder> > GetAllAsync(FileManagerRequest request = null)
 {
     return((await GetResponseAsync(request).ConfigureAwait(false))?.Folders);
 }