예제 #1
0
 public static Meziantou.GitLab.PagedResponse <Todo> GetTodos(this Meziantou.GitLab.IGitLabToDosClient client, TodoAction?action = default(TodoAction?), UserIdRef?authorId = default(UserIdRef?), ProjectIdRef?projectId = default(ProjectIdRef?), GroupIdRef?groupId = default(GroupIdRef?), TodoState?state = default(TodoState?), Meziantou.GitLab.RequestOptions?requestOptions = default(Meziantou.GitLab.RequestOptions))
 {
     Meziantou.GitLab.GetTodosToDoRequest request = new Meziantou.GitLab.GetTodosToDoRequest();
     request.Action    = action;
     request.AuthorId  = authorId;
     request.ProjectId = projectId;
     request.GroupId   = groupId;
     request.State     = state;
     return(client.GetTodos(request, requestOptions));
 }
예제 #2
0
        private static string ToDos_GetTodos_BuildUrl(Meziantou.GitLab.GetTodosToDoRequest request)
        {
            string url;

            using (Meziantou.GitLab.Internals.UrlBuilder urlBuilder = new Meziantou.GitLab.Internals.UrlBuilder())
            {
                urlBuilder.Append("todos");
                char separator = '?';
                if (request.Action.HasValue)
                {
                    urlBuilder.Append(separator);
                    separator = '&';
                    urlBuilder.Append("action=");
                    urlBuilder.AppendParameter(request.Action.GetValueOrDefault());
                }

                if (request.AuthorId.HasValue)
                {
                    urlBuilder.Append(separator);
                    separator = '&';
                    urlBuilder.Append("author_id=");
                    urlBuilder.AppendParameter(request.AuthorId.GetValueOrDefault().Value);
                }

                if (request.ProjectId.HasValue)
                {
                    urlBuilder.Append(separator);
                    separator = '&';
                    urlBuilder.Append("project_id=");
                    urlBuilder.AppendParameter(request.ProjectId.GetValueOrDefault().Value);
                }

                if (request.GroupId.HasValue)
                {
                    urlBuilder.Append(separator);
                    separator = '&';
                    urlBuilder.Append("group_id=");
                    urlBuilder.AppendParameter(request.GroupId.GetValueOrDefault().Value);
                }

                if (request.State.HasValue)
                {
                    urlBuilder.Append(separator);
                    separator = '&';
                    urlBuilder.Append("state=");
                    urlBuilder.AppendParameter(request.State.GetValueOrDefault());
                }

                url = urlBuilder.ToString();
            }

            return(url);
        }
예제 #3
0
 Meziantou.GitLab.PagedResponse <Todo> Meziantou.GitLab.IGitLabToDosClient.GetTodos(Meziantou.GitLab.GetTodosToDoRequest request, Meziantou.GitLab.RequestOptions?requestOptions)
 {
     return(this.ToDos_GetTodos(request, requestOptions));
 }
예제 #4
0
        private Meziantou.GitLab.PagedResponse <Todo> ToDos_GetTodos(Meziantou.GitLab.GetTodosToDoRequest request, Meziantou.GitLab.RequestOptions?requestOptions = default(Meziantou.GitLab.RequestOptions))
        {
            string url = Meziantou.GitLab.GitLabClient.ToDos_GetTodos_BuildUrl(request);

            return(new Meziantou.GitLab.PagedResponse <Todo>(this, url, requestOptions));
        }