internal MileStoneClient(
     GitLabHttpFacade httpFacade,
     MileStoneQueryBuilder mileStoneQueryBuilder)
 {
     _httpFacade            = httpFacade;
     _mileStoneQueryBuilder = mileStoneQueryBuilder;
 }
Exemple #2
0
        /// <summary>
        /// Creates a new instance of the GitLab API v4 client pointing to the specified hostUrl.
        /// </summary>
        /// <param name="hostUrl">Host address of GitLab instance. For example https://gitlab.example.com or https://gitlab.example.com/api/v4/ </param>
        /// <param name="authenticationToken">Personal access token. Obtained from GitLab profile settings.</param>
        public GitLabClient(string hostUrl, string authenticationToken = "")
        {
            Guard.NotEmpty(hostUrl, nameof(hostUrl));
            Guard.NotNull(authenticationToken, nameof(authenticationToken));
            HostUrl = hostUrl;

            var jsonSerializer = new RequestsJsonSerializer();

            _httpFacade = new GitLabHttpFacade(
                FixBaseUrl(hostUrl),
                jsonSerializer,
                authenticationToken);

            var simpleQueryBuilder               = new SimpleQueryBuilder();
            var mileStoneQueryBuilder            = new MileStoneQueryBuilder();
            var projectQueryBuilder              = new ProjectsQueryBuilder();
            var projectIssuesQueryBuilder        = new ProjectIssuesQueryBuilder();
            var issuesQueryBuilder               = new IssuesQueryBuilder();
            var mergeRequestsQueryBuilder        = new MergeRequestsQueryBuilder();
            var projectMergeRequestsQueryBuilder = new ProjectMergeRequestsQueryBuilder();
            var groupsQueryBuilder               = new GroupsQueryBuilder();
            var projectsGroupsQueryBuilder       = new ProjectsGroupQueryBuilder();

            SimpleQuery   = new SimpleQueryClient(_httpFacade, simpleQueryBuilder);
            MileStone     = new MileStoneClient(_httpFacade, mileStoneQueryBuilder);
            Issues        = new IssuesClient(_httpFacade, issuesQueryBuilder, projectIssuesQueryBuilder);
            MergeRequests = new MergeRequestsClient(_httpFacade, mergeRequestsQueryBuilder, projectMergeRequestsQueryBuilder);
            Projects      = new ProjectsClient(_httpFacade, projectQueryBuilder);
            Users         = new UsersClient(_httpFacade);
            Groups        = new GroupsClient(_httpFacade, groupsQueryBuilder, projectsGroupsQueryBuilder);
        }