You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pull.go 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // Copyright 2016 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package structs
  5. import (
  6. "time"
  7. )
  8. // PullRequest represents a pull request
  9. type PullRequest struct {
  10. ID int64 `json:"id"`
  11. URL string `json:"url"`
  12. Index int64 `json:"number"`
  13. Poster *User `json:"user"`
  14. Title string `json:"title"`
  15. Body string `json:"body"`
  16. Labels []*Label `json:"labels"`
  17. Milestone *Milestone `json:"milestone"`
  18. Assignee *User `json:"assignee"`
  19. Assignees []*User `json:"assignees"`
  20. State StateType `json:"state"`
  21. IsLocked bool `json:"is_locked"`
  22. Comments int `json:"comments"`
  23. HTMLURL string `json:"html_url"`
  24. DiffURL string `json:"diff_url"`
  25. PatchURL string `json:"patch_url"`
  26. Mergeable bool `json:"mergeable"`
  27. HasMerged bool `json:"merged"`
  28. // swagger:strfmt date-time
  29. Merged *time.Time `json:"merged_at"`
  30. MergedCommitID *string `json:"merge_commit_sha"`
  31. MergedBy *User `json:"merged_by"`
  32. Base *PRBranchInfo `json:"base"`
  33. Head *PRBranchInfo `json:"head"`
  34. MergeBase string `json:"merge_base"`
  35. // swagger:strfmt date-time
  36. Deadline *time.Time `json:"due_date"`
  37. // swagger:strfmt date-time
  38. Created *time.Time `json:"created_at"`
  39. // swagger:strfmt date-time
  40. Updated *time.Time `json:"updated_at"`
  41. // swagger:strfmt date-time
  42. Closed *time.Time `json:"closed_at"`
  43. }
  44. // PRBranchInfo information about a branch
  45. type PRBranchInfo struct {
  46. Name string `json:"label"`
  47. Ref string `json:"ref"`
  48. Sha string `json:"sha"`
  49. RepoID int64 `json:"repo_id"`
  50. Repository *Repository `json:"repo"`
  51. }
  52. // ListPullRequestsOptions options for listing pull requests
  53. type ListPullRequestsOptions struct {
  54. Page int `json:"page"`
  55. State string `json:"state"`
  56. }
  57. // CreatePullRequestOption options when creating a pull request
  58. type CreatePullRequestOption struct {
  59. Head string `json:"head" binding:"Required"`
  60. Base string `json:"base" binding:"Required"`
  61. Title string `json:"title" binding:"Required"`
  62. Body string `json:"body"`
  63. Assignee string `json:"assignee"`
  64. Assignees []string `json:"assignees"`
  65. Milestone int64 `json:"milestone"`
  66. Labels []int64 `json:"labels"`
  67. // swagger:strfmt date-time
  68. Deadline *time.Time `json:"due_date"`
  69. }
  70. // EditPullRequestOption options when modify pull request
  71. type EditPullRequestOption struct {
  72. Title string `json:"title"`
  73. Body string `json:"body"`
  74. Assignee string `json:"assignee"`
  75. Assignees []string `json:"assignees"`
  76. Milestone int64 `json:"milestone"`
  77. Labels []int64 `json:"labels"`
  78. State *string `json:"state"`
  79. // swagger:strfmt date-time
  80. Deadline *time.Time `json:"due_date"`
  81. RemoveDeadline *bool `json:"unset_due_date"`
  82. }