public void AddUserToRole(int userId, int groupId) { try { m_client.Post <object>($"role/{groupId}/user/{userId}", null); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public int CreateExternalRepository(ExternalRepositoryDetailContract externalRepository) { try { var externalRepositoryId = m_client.Post <int>("bibliography/repository", externalRepository); return(externalRepositoryId); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public long CreateFeedback(CreateFeedbackContract data) { try { var result = m_client.Post <long>("feedback", data); return(result); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public int CreateCategory(CategoryContract category) { try { var resultId = m_client.Post <int>("category", category); return(resultId); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public int CreateFilteringExpressionSet(FilteringExpressionSetDetailContract filteringExpressionSet) { try { var filteringExpressionSetId = m_client.Post <int>("bibliography/filtering-expression-set", filteringExpressionSet); return(filteringExpressionSetId); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public void ProcessSessionAsImport(string sessionId, NewBookImportContract request) { try { var requestTimeout = new TimeSpan(0, 10, 0); // Import is long running operation m_client.Post <object>($"ProjectImportSession/{sessionId}", request, requestTimeout); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public long CreateSnapshot(CreateSnapshotContract createSnapshotContract) { try { var snapshotId = m_client.Post <long>($"{BasePath}", createSnapshotContract); return(snapshotId); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public long CreateFavoriteLabel(FavoriteLabelContractBase data) { try { var result = m_client.Post <long>("favorite/label", data); return(result); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public int CreateNewUser(CreateUserContract data) { try { //EnsureSecuredClient(); var result = m_client.Post <int>("user", data); return(result); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public long CreateProject(CreateProjectContract project) { try { var projectId = m_client.Post <long>("project", project); return(projectId); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }
public List <PageContract> SearchPage(long projectId, SearchPageRequestContract request) { try { var result = m_client.Post <List <PageContract> >($"book/{projectId}/page/search", request); return(result); } catch (HttpRequestException e) { if (m_logger.IsErrorEnabled()) { m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e); } throw; } }