private Dictionary <string, string> CreateFormParametersJpa(JpaFile jpaEntry) { var parameters = new Dictionary <string, string>(); parameters.Add("jpa_name", jpaEntry.JpaName); parameters.Add("year", jpaEntry.Year.ToString()); parameters.Add("user", jpaEntry.UserName); return(parameters); }
public Task <JpaFile> CreateJpaHistoryAsync(JpaFile jpaEntry) { var parameters = CreateFormParametersJpa(jpaEntry); var file = CreateFileJpa(jpaEntry); var fileList = new List <FileToUpload>(); fileList.Add(file); return(RequestWrapper.PostFormAsync <JpaFile>(Endpoints.JpaHistoryAdminEndpoint, parameters, fileList)); }
private FileToUpload CreateFileJpa(JpaFile jpaEntry) { var data = File.ReadAllBytes(jpaEntry.File.ToString()); return(new FileToUpload { Data = data, DataName = "file", FileName = Path.GetFileName(jpaEntry.File.ToString()) }); }
public Task <JpaFile> UpdateJpaHistoryAsync(JpaFile jpaEntry) { var parameters = CreateFormParametersJpa(jpaEntry); var file = CreateFileJpa(jpaEntry); var fileList = new List <FileToUpload>(); fileList.Add(file); var url = string.Format(Endpoints.JpaHistoryUpdateAdminEndpoint, jpaEntry.Id.ToString()); return(RequestWrapper.PutFormAsync <JpaFile>(url, parameters, fileList)); }
public Task <bool> DeleteJpaHistoryAsync(JpaFile jpaEntry) { var url = string.Format(Endpoints.JpaHistoryUpdateAdminEndpoint, jpaEntry.Id.ToString()); return(RequestWrapper.DeleteAsyncWrapper(url)); }