/// <summary> /// Fetches data asynchronously from the FRED series/observations service endpoint and saves the result to a ZIP file. /// </summary> /// <param name="filePath">The file path at which to save the ZIP file.</param> /// <param name="overwrite">Indicates whether or not to overwrite the contents of an existing ZIP file. The default is true.</param> /// <returns>A Task of type Boolean, the resolution of which indicates whether or not the operation succeeded.</returns> public async Task <bool> FetchAsync(string filePath, bool overwrite = true) { try { if (!overwrite && File.Exists(filePath)) { Exception = new Exception("File " + filePath + " already exists."); return(false); } Request = new FileRequest { FilePath = filePath, Excel = Excel }; Arguments.ApiKey = ApiKey; await Request.FetchAsync <object>(Arguments); SetResultProperties(); return(Exception == null); } catch (Exception exception) { Exception = exception; } return(false); }