예제 #1
0
        public void NonDefaultQueryBuilt()
        {
            var sut = new ProjectsGroupQueryBuilder();

            string query = sut.Build(
                "https://gitlab.com/api/v4/groups",
                new ProjectsGroupQueryOptions("1")
            {
                Archived   = true,
                Visibility = GroupsVisibility.Internal,
                Order      = GroupsProjectsOrder.Id,
                Sort       = GroupsSort.Descending,
                Search     = "filter",
                Simple     = true,
                Owned      = true,
                Starred    = true
            });

            query.Should().Be("https://gitlab.com/api/v4/groups?" +
                              "id=1&" +
                              "archived=true&" +
                              "visibility=internal&" +
                              "order_by=id&" +
                              "sort=desc&" +
                              "search=filter&" +
                              "simple=true&" +
                              "owned=true&" +
                              "starred=true");
        }
예제 #2
0
        /// <summary>
        /// Get a list of projects in this group.
        /// When accessed without authentication, only public projects are returned.
        /// </summary>
        /// <param name="groupId">The ID, path or <see cref="Group"/> of the project.</param>
        /// <param name="options">Groups projects retrieval options.</param>
        /// <returns>Issues satisfying options.</returns>
        public async Task <IList <Project> > GetProjectsAsync(GroupId groupId, Action <ProjectsGroupQueryOptions> options = null)
        {
            var queryOptions = new ProjectsGroupQueryOptions();

            options?.Invoke(queryOptions);

            string url = _projectsQueryBuilder.Build($"groups/{groupId}/projects", queryOptions);

            return(await _httpFacade.GetPagedList <Project>(url));
        }