|
| 1 | +package github |
| 2 | + |
| 3 | +import "time" |
| 4 | + |
| 5 | +type PullRequestListOptions struct { |
| 6 | + // State filters pull requests based on their state. Possible values are: |
| 7 | + // open, closed, all. Default is "open". |
| 8 | + State string `url:"state,omitempty"` |
| 9 | + |
| 10 | + // Head filters pull requests by head user and branch name in the format of: |
| 11 | + // "user:ref-name". |
| 12 | + Head string `url:"head,omitempty"` |
| 13 | + |
| 14 | + // Base filters pull requests by base branch name. |
| 15 | + Base string `url:"base,omitempty"` |
| 16 | + |
| 17 | + // Sort specifies how to sort pull requests. Possible values are: created, |
| 18 | + // updated, popularity, long-running. Default is "created". |
| 19 | + Sort string `url:"sort,omitempty"` |
| 20 | + |
| 21 | + // Direction in which to sort pull requests. Possible values are: asc, desc. |
| 22 | + // If Sort is "created" or not specified, Default is "desc", otherwise Default |
| 23 | + // is "asc" |
| 24 | + Direction string `url:"direction,omitempty"` |
| 25 | + |
| 26 | + Page int `url:"page,omitempty"` |
| 27 | + PerPage int `url:"per_page,omitempty"` |
| 28 | +} |
| 29 | + |
| 30 | +type PullRequestAutoMerge struct { |
| 31 | + EnabledBy User `json:"enabled_by,omitempty"` |
| 32 | + MergeMethod string `json:"merge_method,omitempty"` |
| 33 | + CommitTitle string `json:"commit_title,omitempty"` |
| 34 | + CommitMessage string `json:"commit_message,omitempty"` |
| 35 | +} |
| 36 | + |
| 37 | +type PullRequestBranch struct { |
| 38 | + Label string `json:"label,omitempty"` |
| 39 | + Ref string `json:"ref,omitempty"` |
| 40 | + SHA string `json:"sha,omitempty"` |
| 41 | + Repo Repo `json:"repo,omitempty"` |
| 42 | + User User `json:"user,omitempty"` |
| 43 | +} |
| 44 | + |
| 45 | +type PullRequest struct { |
| 46 | + ID int64 `json:"id,omitempty"` |
| 47 | + Number int `json:"number,omitempty"` |
| 48 | + State string `json:"state,omitempty"` |
| 49 | + Locked bool `json:"locked,omitempty"` |
| 50 | + Title string `json:"title,omitempty"` |
| 51 | + Body string `json:"body,omitempty"` |
| 52 | + CreatedAt time.Time `json:"created_at,omitempty"` |
| 53 | + UpdatedAt time.Time `json:"updated_at,omitempty"` |
| 54 | + ClosedAt time.Time `json:"closed_at,omitempty"` |
| 55 | + MergedAt time.Time `json:"merged_at,omitempty"` |
| 56 | + Labels []Label `json:"labels,omitempty"` |
| 57 | + User User `json:"user,omitempty"` |
| 58 | + Draft bool `json:"draft,omitempty"` |
| 59 | + Merged bool `json:"merged,omitempty"` |
| 60 | + Mergeable bool `json:"mergeable,omitempty"` |
| 61 | + MergeableState string `json:"mergeable_state,omitempty"` |
| 62 | + MergedBy User `json:"merged_by,omitempty"` |
| 63 | + MergeCommitSHA string `json:"merge_commit_sha,omitempty"` |
| 64 | + Rebaseable bool `json:"rebaseable,omitempty"` |
| 65 | + Comments int `json:"comments,omitempty"` |
| 66 | + Commits int `json:"commits,omitempty"` |
| 67 | + Additions int `json:"additions,omitempty"` |
| 68 | + Deletions int `json:"deletions,omitempty"` |
| 69 | + ChangedFiles int `json:"changed_files,omitempty"` |
| 70 | + URL string `json:"url,omitempty"` |
| 71 | + HTMLURL string `json:"html_url,omitempty"` |
| 72 | + IssueURL string `json:"issue_url,omitempty"` |
| 73 | + StatusesURL string `json:"statuses_url,omitempty"` |
| 74 | + DiffURL string `json:"diff_url,omitempty"` |
| 75 | + PatchURL string `json:"patch_url,omitempty"` |
| 76 | + CommitsURL string `json:"commits_url,omitempty"` |
| 77 | + CommentsURL string `json:"comments_url,omitempty"` |
| 78 | + ReviewCommentsURL string `json:"review_comments_url,omitempty"` |
| 79 | + ReviewCommentURL string `json:"review_comment_url,omitempty"` |
| 80 | + ReviewComments int `json:"review_comments,omitempty"` |
| 81 | + Assignee User `json:"assignee,omitempty"` |
| 82 | + Assignees []User `json:"assignees,omitempty"` |
| 83 | + MaintainerCanModify bool `json:"maintainer_can_modify,omitempty"` |
| 84 | + AuthorAssociation string `json:"author_association,omitempty"` |
| 85 | + RequestedReviewers []User `json:"requested_reviewers,omitempty"` |
| 86 | + AutoMerge PullRequestAutoMerge `json:"auto_merge,omitempty"` |
| 87 | + Head PullRequestBranch `json:"head,omitempty"` |
| 88 | + Base PullRequestBranch `json:"base,omitempty"` |
| 89 | +} |
| 90 | + |
| 91 | +type PullRequestUpdate struct { |
| 92 | + Title string `json:"title,omitempty"` |
| 93 | + Body string `json:"body,omitempty"` |
| 94 | + State string `json:"state,omitempty"` |
| 95 | + Base string `json:"base,omitempty"` |
| 96 | +} |
| 97 | + |
| 98 | +type NewPullRequest struct { |
| 99 | + Title string `json:"title,omitempty"` |
| 100 | + Head string `json:"head,omitempty"` |
| 101 | + Base string `json:"base,omitempty"` |
| 102 | + Body string `json:"body,omitempty"` |
| 103 | + Issue int `json:"issue,omitempty"` |
| 104 | + MaintainerCanModify bool `json:"maintainer_can_modify,omitempty"` |
| 105 | + Draft bool `json:"draft,omitempty"` |
| 106 | +} |
0 commit comments