예제 #1
0
        public Task <IReadOnlyList <Issue> > GetAllForOwnedAndMemberRepositories(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, nameof(options));

            return(GetAllForOwnedAndMemberRepositories(new IssueRequest(), options));
        }
예제 #2
0
        public Task <GpgKey> Create(NewGpgKey newGpgKey)
        {
            Ensure.ArgumentNotNull(newGpgKey, nameof(newGpgKey));

            return(ApiConnection.Post <GpgKey>(ApiUrls.GpgKeys(), newGpgKey, AcceptHeaders.GpgKeysPreview));
        }
예제 #3
0
        public Task <IReadOnlyList <Issue> > GetAllForCurrent(IssueRequest request)
        {
            Ensure.ArgumentNotNull(request, nameof(request));

            return(GetAllForCurrent(request, ApiOptions.None));
        }
예제 #4
0
        /// <summary>
        /// Gets all repositories owned by the specified user.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-user-repositories">API documentation</a> for more information.
        /// The default page size on GitHub.com is 30.
        /// </remarks>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
        public Task <IReadOnlyList <Repository> > GetAllForUser(string login)
        {
            Ensure.ArgumentNotNullOrEmptyString(login, "login");

            return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories(login)));
        }
예제 #5
0
        public Task <IReadOnlyList <User> > GetAll(string org)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));

            return(GetAll(org, ApiOptions.None));
        }
예제 #6
0
        public Task <IReadOnlyList <Issue> > GetAllForRepository(long repositoryId, ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, nameof(options));

            return(GetAllForRepository(repositoryId, new RepositoryIssueRequest(), options));
        }
예제 #7
0
        public Task <Issue> Create(long repositoryId, NewIssue newIssue)
        {
            Ensure.ArgumentNotNull(newIssue, nameof(newIssue));

            return(ApiConnection.Post <Issue>(ApiUrls.Issues(repositoryId), newIssue));
        }
예제 #8
0
        /// <summary>
        /// Gets all repositories owned by the specified user.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-user-repositories">API documentation</a> for more information.
        /// The default page size on GitHub.com is 30.
        /// </remarks>
        /// <param name="login">The account name to search for</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
        public Task <IReadOnlyList <Repository> > GetAllForUser(string login)
        {
            Ensure.ArgumentNotNullOrEmptyString(login, "login");

            return(GetAllForUser(login, ApiOptions.None));
        }
예제 #9
0
        /// <summary>
        /// Gets all repositories owned by the specified organization.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-organization-repositories">API documentation</a> for more information.
        /// The default page size on GitHub.com is 30.
        /// </remarks>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
        public Task <IReadOnlyList <Repository> > GetAllForOrg(string organization)
        {
            Ensure.ArgumentNotNullOrEmptyString(organization, "organization");

            return(GetAllForOrg(organization, ApiOptions.None));
        }
예제 #10
0
        /// <summary>
        /// Gets all repositories owned by the current user.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-your-repositories">API documentation</a> for more information.
        /// </remarks>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
        public Task <IReadOnlyList <Repository> > GetAllForCurrent(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return(ApiConnection.GetAll <Repository>(ApiUrls.Repositories(), options));
        }
예제 #11
0
        /// <summary>
        /// Gets all repositories owned by the current user.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-your-repositories">API documentation</a> for more information.
        /// The default page size on GitHub.com is 30.
        /// </remarks>
        /// <param name="request">Search parameters to filter results on</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
        public Task <IReadOnlyList <Repository> > GetAllForCurrent(RepositoryRequest request)
        {
            Ensure.ArgumentNotNull(request, "request");

            return(GetAllForCurrent(request, ApiOptions.None));
        }
예제 #12
0
        /// <summary>
        /// Updates the specified repository with the values given in <paramref name="update"/>
        /// </summary>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="update">New values to update the repository with</param>
        /// <returns>The updated <see cref="T:Octokit.Repository"/></returns>
        public Task <Repository> Edit(long repositoryId, RepositoryUpdate update)
        {
            Ensure.ArgumentNotNull(update, "update");

            return(ApiConnection.Patch <Repository>(ApiUrls.Repository(repositoryId), update, AcceptHeaders.SquashCommitPreview));
        }
예제 #13
0
        public Task <Branch> GetBranch(long repositoryId, string branchName)
        {
            Ensure.ArgumentNotNullOrEmptyString(branchName, "branchName");

            return(Branch.Get(repositoryId, branchName));
        }
예제 #14
0
        /// <summary>
        /// Updates the comment with the specified gist- and comment id.
        /// </summary>
        /// <remarks>http://developer.github.com/v3/gists/comments/#edit-a-comment</remarks>
        /// <param name="gistId">The id of the gist</param>
        /// <param name="commentId">The id of the comment</param>
        /// <param name="comment">The updated body of the comment</param>
        /// <returns>Task{GistComment}.</returns>
        public Task <GistComment> Update(string gistId, int commentId, string comment)
        {
            Ensure.ArgumentNotNullOrEmptyString(comment, "comment");

            return(ApiConnection.Patch <GistComment>(ApiUrls.GistComment(gistId, commentId), new BodyWrapper(comment)));
        }
예제 #15
0
        public Task <IReadOnlyList <Issue> > GetAllForOwnedAndMemberRepositories(IssueRequest request)
        {
            Ensure.ArgumentNotNull(request, nameof(request));

            return(GetAllForOwnedAndMemberRepositories(request, ApiOptions.None));
        }
예제 #16
0
        /// <summary>
        /// Creates a new repository for the current user.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#create">API documentation</a> for more information.
        /// </remarks>
        /// <param name="newRepository">A <see cref="NewRepository"/> instance describing the new repository to create</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="Repository"/> instance for the created repository.</returns>
        public Task <Repository> Create(NewRepository newRepository)
        {
            Ensure.ArgumentNotNull(newRepository, "newRepository");

            return(Create(ApiUrls.Repositories(), null, newRepository));
        }
예제 #17
0
        public Task <IReadOnlyList <Issue> > GetAllForOrganization(string organization)
        {
            Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));

            return(GetAllForOrganization(organization, ApiOptions.None));
        }
예제 #18
0
        public Task <IReadOnlyList <Branch> > GetAllBranches(long repositoryId, ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return(Branch.GetAll(repositoryId, options));
        }
예제 #19
0
        public Task <IReadOnlyList <Issue> > GetAllForRepository(long repositoryId, RepositoryIssueRequest request)
        {
            Ensure.ArgumentNotNull(request, nameof(request));

            return(GetAllForRepository(repositoryId, request, ApiOptions.None));
        }
예제 #20
0
        /// <summary>
        /// Gets all contributors for the specified repository. Does not include anonymous contributors.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-contributors">API documentation</a> for more details
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="options">Options for changing the API response</param>
        /// <returns>All contributors of the repository.</returns>
        public Task <IReadOnlyList <RepositoryContributor> > GetAllContributors(long repositoryId, ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return(GetAllContributors(repositoryId, false, options));
        }
예제 #21
0
        public Task <Issue> Update(long repositoryId, int number, IssueUpdate issueUpdate)
        {
            Ensure.ArgumentNotNull(issueUpdate, nameof(issueUpdate));

            return(ApiConnection.Patch <Issue>(ApiUrls.Issue(repositoryId, number), issueUpdate));
        }
예제 #22
0
        /// <summary>
        /// Gets all tags for the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-tags">API documentation</a> for more details
        /// </remarks>
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="options">Options for changing the API response</param>
        /// <returns>All of the repositories tags.</returns>
        public Task <IReadOnlyList <RepositoryTag> > GetAllTags(long repositoryId, ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return(ApiConnection.GetAll <RepositoryTag>(ApiUrls.RepositoryTags(repositoryId), options));
        }
예제 #23
0
        /// <summary>
        /// Gets all repositories owned by the specified organization.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/#list-organization-repositories">API documentation</a> for more information.
        /// The default page size on GitHub.com is 30.
        /// </remarks>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
        public Task <IReadOnlyList <Repository> > GetAllForOrg(string organization)
        {
            Ensure.ArgumentNotNullOrEmptyString(organization, "organization");

            return(ApiConnection.GetAll <Repository>(ApiUrls.OrganizationRepositories(organization)));
        }
예제 #24
0
        public Task <IReadOnlyList <Issue> > GetAllForCurrent(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, nameof(options));

            return(GetAllForCurrent(new IssueRequest(), options));
        }
예제 #25
0
        public Task <IReadOnlyList <User> > GetAll(string org, OrganizationMembersFilter filter)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));

            return(GetAll(org, filter, ApiOptions.None));
        }
예제 #26
0
        public Task <IReadOnlyList <GpgKey> > GetAllForCurrent(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, nameof(options));

            return(ApiConnection.GetAll <GpgKey>(ApiUrls.GpgKeys(), null, AcceptHeaders.GpgKeysPreview, options));
        }