Ejemplo n.º 1
0
        public HubPagedResponse <ProjectView> GetPagedProjectView(string projectName)
        {
            HubRequest hubRequest = new HubRequest(RestConnection);

            hubRequest.Path = $"api/{ApiLinks.PROJECTS_LINK}";
            hubRequest.QueryParameters[HubRequest.Q_QUERY] = $"name:{projectName}";
            HubPagedResponse <ProjectView> response = hubRequest.ExecuteGetForResponsePaged <ProjectView>();

            return(response);
        }
Ejemplo n.º 2
0
        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 List <CodeLocationView> FetchCodeLocations(string q, int limit)
        {
            HubRequest request = new HubRequest(RestConnection);

            request.QueryParameters[HubRequest.Q_LIMIT] = limit.ToString();
            request.QueryParameters[HubRequest.Q_QUERY] = q;
            request.Path = $"api/{ApiLinks.CODE_LOCATION_LINK}";
            HubPagedResponse <CodeLocationView> response      = request.ExecuteGetForResponsePaged <CodeLocationView>();
            List <CodeLocationView>             codeLocations = response.Items;

            return(codeLocations);
        }
        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);
        }