public Task Delete(string owner, string name, int number, PullRequestReviewRequest users)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
            Ensure.ArgumentNotNull(users, nameof(users));

            return(ApiConnection.Delete(ApiUrls.PullRequestReviewRequests(owner, name, number), users, AcceptHeaders.PullRequestReviewsApiPreview));
        }
Beispiel #2
0
        public Task <PullRequest> Create(long repositoryId, int number, PullRequestReviewRequest users)
        {
            Ensure.ArgumentNotNull(users, nameof(users));

            var endpoint = ApiUrls.PullRequestReviewRequests(repositoryId, number);

            return(ApiConnection.Post <PullRequest>(endpoint, users));
        }
Beispiel #3
0
        public Task <PullRequest> Create(string owner, string name, int number, PullRequestReviewRequest users)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
            Ensure.ArgumentNotNull(users, nameof(users));

            var endpoint = ApiUrls.PullRequestReviewRequests(owner, name, number);

            return(ApiConnection.Post <PullRequest>(endpoint, users));
        }
        public async Task <PullRequest> Create(long repositoryId, int number, PullRequestReviewRequest users)
        {
            Ensure.ArgumentNotNull(users, nameof(users));

            var endpoint = ApiUrls.PullRequestReviewRequests(repositoryId, number);
            var response = await ApiConnection.Connection.Post <PullRequest>(endpoint, users, AcceptHeaders.PullRequestReviewsApiPreview, null).ConfigureAwait(false);

            if (response.HttpResponse.StatusCode != HttpStatusCode.Created)
            {
                throw new ApiException("Invalid Status Code returned. Expected a 201", response.HttpResponse.StatusCode);
            }

            return(response.Body);
        }
        public Task Delete(long repositoryId, int number, PullRequestReviewRequest users)
        {
            Ensure.ArgumentNotNull(users, nameof(users));

            return(ApiConnection.Delete(ApiUrls.PullRequestReviewRequests(repositoryId, number), users, AcceptHeaders.PullRequestReviewsApiPreview));
        }
Beispiel #6
0
        /// <summary>
        /// Creates review requests on a pull request for specified users.
        /// </summary>
        /// <remarks>https://developer.github.com/v3/pulls/review_requests/#create-a-review-request</remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="number">The Pull Request number</param>
        /// <param name="users">List of logins of user will be requested for review</param>
        public async Task <PullRequest> Create(string owner, string name, int number, PullRequestReviewRequest users)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(users, "users");

            var endpoint = ApiUrls.PullRequestReviewRequests(owner, name, number);
            var response = await ApiConnection.Connection.Post <PullRequest>(endpoint, users, AcceptHeaders.PullRequestReviewsApiPreview, null).ConfigureAwait(false);

            if (response.HttpResponse.StatusCode != HttpStatusCode.Created)
            {
                throw new ApiException("Invalid Status Code returned. Expected a 201", response.HttpResponse.StatusCode);
            }

            return(response.Body);
        }