| 827 | } |
| 828 | |
| 829 | func ConvertPullRequestToDraft(client *Client, repo ghrepo.Interface, pr *PullRequest) error { |
| 830 | var mutation struct { |
| 831 | ConvertPullRequestToDraft struct { |
| 832 | PullRequest struct { |
| 833 | ID githubv4.ID |
| 834 | } |
| 835 | } `graphql:"convertPullRequestToDraft(input: $input)"` |
| 836 | } |
| 837 | |
| 838 | variables := map[string]interface{}{ |
| 839 | "input": githubv4.ConvertPullRequestToDraftInput{ |
| 840 | PullRequestID: pr.ID, |
| 841 | }, |
| 842 | } |
| 843 | |
| 844 | return client.Mutate(repo.RepoHost(), "ConvertPullRequestToDraft", &mutation, variables) |
| 845 | } |
| 846 | |
| 847 | func BranchDeleteRemote(client *Client, repo ghrepo.Interface, branch string) error { |
| 848 | path := fmt.Sprintf("repos/%s/%s/git/refs/heads/%s", repo.RepoOwner(), repo.RepoName(), url.PathEscape(branch)) |