@@ -18,8 +18,7 @@ import (
1818// GitHub API docs: https://docs.github.com/rest/issues/sub-issues
1919type SubIssueService service
2020
21- // Issue represents a GitHub issue on a repository.
22- //
21+ // SubIssue represents a GitHub sub-issue on a repository.
2322// Note: As far as the GitHub API is concerned, every pull request is an issue,
2423// but not every issue is a pull request. Some endpoints, events, and webhooks
2524// may also return pull requests via this struct. If PullRequestLinks is nil,
@@ -39,17 +38,17 @@ type SubIssueListByIssueOptions struct {
3938
4039// SubIssueRequest represents a request to add, remove, or reprioritize sub-issues.
4140type SubIssueRequest struct {
42- SubIssueId int `json:"sub_issue_id,omitempty"` // Required: The ID of the sub-issue
43- AfterId int `json:"after_id,omitempty"` // Optional: Position after this sub-issue ID
44- BeforeId int `json:"before_id,omitempty"` // Optional: Position before this sub-issue ID
41+ SubIssueID int `json:"sub_issue_id,omitempty"` // Required: The ID of the sub-issue
42+ AfterID int `json:"after_id,omitempty"` // Optional: Position after this sub-issue ID
43+ BeforeID int `json:"before_id,omitempty"` // Optional: Position before this sub-issue ID
4544 ReplaceParent bool `json:"replace_parent,omitempty"` // Optional: Whether to replace the existing parent
4645}
4746
4847// Remove a sub-issue from the specified repository.
4948//
50- // GitHub API docs: https://docs.github.com/en/ rest/issues/sub-issues?apiVersion=2022-11-28 #remove-sub-issue
51-
52- //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issues
49+ // GitHub API docs: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue
50+ //
51+ //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue
5352func (s * SubIssueService ) Remove (ctx context.Context , owner string , repo string , subIssueNumber int , subIssue * SubIssueRequest ) (* SubIssue , * Response , error ) {
5453 u := fmt .Sprintf ("repos/%v/%v/issues/%d/sub_issues" , owner , repo , subIssueNumber )
5554
@@ -72,8 +71,8 @@ func (s *SubIssueService) Remove(ctx context.Context, owner string, repo string,
7271
7372// ListByIssue lists all sub-issues for the specified issue.
7473//
75- // GitHub API docs: https://docs.github.com/en/ rest/issues/sub-issues?apiVersion=2022-11-28 #list-sub-issues
76-
74+ // GitHub API docs: https://docs.github.com/rest/issues/sub-issues#list-sub-issues
75+ //
7776//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues
7877func (s * SubIssueService ) ListByIssue (ctx context.Context , owner string , repo string , issueNumber int , opts * IssueListOptions ) ([]* SubIssue , * Response , error ) {
7978 u := fmt .Sprintf ("repos/%v/%v/issues/%d/sub_issues" , owner , repo , issueNumber )
@@ -104,7 +103,7 @@ func (s *SubIssueService) ListByIssue(ctx context.Context, owner string, repo st
104103// The sub-issue to be added must belong to the same repository owner as the parent issue.
105104// To replace the existing parent of a sub-issue, set replaceParent to true.
106105//
107- // GitHub API docs: https://docs.github.com/en/ rest/issues/sub-issues?apiVersion=2022-11-28 #add-sub-issue
106+ // GitHub API docs: https://docs.github.com/rest/issues/sub-issues#add-sub-issue
108107//
109108//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues
110109func (s * SubIssueService ) Add (ctx context.Context , owner string , repo string , issueNumber int , subIssue * SubIssueRequest ) (* SubIssue , * Response , error ) {
@@ -127,12 +126,12 @@ func (s *SubIssueService) Add(ctx context.Context, owner string, repo string, is
127126//
128127// Either afterId or beforeId must be specified to determine the new position of the sub-issue.
129128//
130- // GitHub API docs: https://docs.github.com/en/ rest/issues/sub-issues?apiVersion=2022-11-28 #reprioritize-sub-issue
129+ // GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue
131130//
132- //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority
131+ //meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority
133132func (s * SubIssueService ) Reprioritize (ctx context.Context , owner string , repo string , issueNumber int , subIssue * SubIssueRequest ) (* SubIssue , * Response , error ) {
134133 u := fmt .Sprintf ("repos/%v/%v/issues/%d/sub_issues/priority" , owner , repo , issueNumber )
135- req , err := s .client .NewRequest ("POST " , u , subIssue )
134+ req , err := s .client .NewRequest ("PATCH " , u , subIssue )
136135 if err != nil {
137136 return nil , nil , err
138137 }
0 commit comments