コード例 #1
0
        /// <summary>
        /// Searches for passed string in team account repositories and processes them page by page with passed method.
        /// https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/search/code
        /// </summary>
        /// <param name="searchText">The string that is passed as search query.</param>
        /// <param name="searchFilesProcessor">The method that passes next batch of found files for processing.</param>
        /// <param name="max">The maximum number of items to process. 0 processes all items.</param>
        public void ProcessSeacrhFiles(
            string searchText,
            Action <List <SearchFile> > searchFilesProcessor,
            int max = 0)
        {
            var teamProfile       = _sharpBucketV2.Get <Team>(_baseUrl);
            var overrideUrl       = $"teams/{HttpUtility.UrlEncode(teamProfile.uuid)}/search/code";
            var requestParameters = new Dictionary <string, object>
            {
                { "search_query", searchText }
            };

            _sharpBucketV2.ProcessPaginatedValues(
                overrideUrl,
                searchFilesProcessor,
                max,
                requestParameters);
        }