public List <VersionBomComponentView> GetBomEntries(ProjectVersionView projectVersionView) { string componentsUrl = MetadataResponseService.GetLink(projectVersionView, ApiLinks.COMPONENTS_LINK); List <VersionBomComponentView> allItems = GetAllItems <VersionBomComponentView>(componentsUrl); return(allItems); }
public VersionBomPolicyStatusView GetVersionBomPolicyStatusView(ProjectVersionView projectVersionView) { string policyStatusUrl = MetadataResponseService.GetLink(projectVersionView, ApiLinks.POLICY_STATUS_LINK); HubRequest request = new HubRequest(RestConnection); request.SetUriFromString(policyStatusUrl); VersionBomPolicyStatusView response = request.ExecuteGetForResponse <VersionBomPolicyStatusView>(); return(response); }
public HubPagedResponse <ProjectVersionView> GetPagedProjectVersionView(ProjectView projectView) { string projectVersionsUrl = MetadataResponseService.GetLink(projectView, ApiLinks.VERSIONS_LINK); HubRequest hubRequest = new HubRequest(RestConnection); hubRequest.QueryParameters[HubRequest.Q_SORT] = "updatedAt asc"; // Sort it by most recent hubRequest.SetUriFromString(projectVersionsUrl); HubPagedResponse <ProjectVersionView> response = hubRequest.ExecuteGetForResponsePaged <ProjectVersionView>(); return(response); }
public HubPagedResponse <ScanSummaryView> GetScanSummaries(CodeLocationView codeLocationView) { if (codeLocationView == null) { return(null); } string codeLocationUrl = MetadataResponseService.GetLink(codeLocationView, ApiLinks.SCANS_LINK); HubRequest request = new HubRequest(RestConnection); request.QueryParameters[HubRequest.Q_SORT] = "updated asc"; request.SetUriFromString(codeLocationUrl); HubPagedResponse <ScanSummaryView> response = request.ExecuteGetForResponsePaged <ScanSummaryView>(); return(response); }
public ProjectVersionView GetProjectVersion(ProjectView project, string projectVersionName) { string versionsUrl = MetadataResponseService.GetLink(project, ApiLinks.VERSIONS_LINK); HubPagedRequest request = new HubPagedRequest(RestConnection); request.QueryParameters[HubRequest.Q_QUERY] = String.Format("versionName:{0}", projectVersionName); request.SetUriFromString(versionsUrl); List <ProjectVersionView> allProjectVersionMatchingItems = GetAllItems <ProjectVersionView>(request); foreach (ProjectVersionView projectVersion in allProjectVersionMatchingItems) { if (projectVersionName.Equals(projectVersion.VersionName)) { return(projectVersion); } } throw new BlackDuckIntegrationException(String.Format("Could not find the version: {0} for project: {1}", projectVersionName, project.Name)); }