218 lines
4.3 KiB
Go
218 lines
4.3 KiB
Go
package main
|
|
|
|
import "time"
|
|
|
|
type PullRequest struct {
|
|
ID string
|
|
Owner string
|
|
Repository string
|
|
RepoWithOwner string
|
|
Number int
|
|
Title string
|
|
URL string
|
|
Author string
|
|
IsDraft bool
|
|
UpdatedAt time.Time
|
|
ReviewCount int
|
|
ViewerAuthored bool
|
|
FromCache bool
|
|
CachedAt time.Time
|
|
}
|
|
|
|
type PRDetails struct {
|
|
PullRequest
|
|
Body string
|
|
CreatedAt time.Time
|
|
BaseRef string
|
|
HeadRef string
|
|
Mergeable string
|
|
MergeState string
|
|
ConflictFiles []string
|
|
ConflictFileError string
|
|
Assignees []string
|
|
Reviewers []Reviewer
|
|
Labels []string
|
|
Milestone string
|
|
Additions int
|
|
Deletions int
|
|
ChangedFiles int
|
|
CommitCount int
|
|
CommentCount int
|
|
HeadOID string
|
|
BaseOID string
|
|
RepositoryURL string
|
|
CheckState string
|
|
Checks []Check
|
|
ReviewDecision string
|
|
Conversation []PRComment
|
|
Reviews []ReviewSummary
|
|
Permissions ViewerPermissions
|
|
Requirements MergeRequirements
|
|
Threads []ReviewThread
|
|
ThreadsTruncated bool
|
|
Timeline []TimelineEvent
|
|
DataIssues []DataIssue
|
|
Rulesets []Ruleset
|
|
MergeQueue *MergeQueue
|
|
FromCache bool
|
|
CachedAt time.Time
|
|
}
|
|
|
|
type DataIssue struct {
|
|
Component string
|
|
Message string
|
|
}
|
|
|
|
type PRDetailsEnrichment struct {
|
|
Owner string
|
|
Repository string
|
|
Number int
|
|
HeadOID string
|
|
CheckAnnotations map[string][]CheckAnnotation
|
|
ConflictFiles []string
|
|
Issues []DataIssue
|
|
}
|
|
|
|
type PullRequestMetadata struct {
|
|
Title string
|
|
Body string
|
|
BaseRef string
|
|
Mergeable string
|
|
MergeState string
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type RepositoryBranch struct {
|
|
Name string
|
|
UpdatedAt time.Time
|
|
IsDefault bool
|
|
}
|
|
|
|
type Check struct {
|
|
ID string
|
|
Name string
|
|
State string
|
|
Conclusion string
|
|
URL string
|
|
Summary string
|
|
Annotations []CheckAnnotation
|
|
}
|
|
|
|
type CheckAnnotation struct {
|
|
Path string
|
|
StartLine int
|
|
EndLine int
|
|
Level string
|
|
Title string
|
|
Message string
|
|
}
|
|
|
|
type TimelineEvent struct {
|
|
Kind string
|
|
OID string
|
|
BeforeOID string
|
|
AfterOID string
|
|
Author string
|
|
Title string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type Ruleset struct {
|
|
Name string
|
|
Enforcement string
|
|
RuleTypes []string
|
|
Applies bool
|
|
}
|
|
|
|
type MergeQueue struct {
|
|
State string
|
|
Position int
|
|
EnqueuedAt time.Time
|
|
EstimatedSeconds int
|
|
}
|
|
|
|
type PRComment struct {
|
|
ID string
|
|
Author string
|
|
Body string
|
|
URL string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type ReviewSummary struct {
|
|
ID string
|
|
Author string
|
|
Body string
|
|
State string
|
|
URL string
|
|
CommitOID string
|
|
SubmittedAt time.Time
|
|
}
|
|
|
|
type ViewerPermissions struct {
|
|
Repository string
|
|
CanUpdatePR bool
|
|
CanResolveAny bool
|
|
CanUnresolveAny bool
|
|
CanReplyAny bool
|
|
CanReact bool
|
|
CanSubscribe bool
|
|
CanEnableMerge bool
|
|
}
|
|
|
|
type MergeRequirements struct {
|
|
ApprovalsRequired int
|
|
RequiresApprovals bool
|
|
RequiresStatusChecks bool
|
|
RequiresConversation bool
|
|
RequiresCodeOwnerReview bool
|
|
RequiresDeployments bool
|
|
RequiredDeployments []string
|
|
RequiresStrictChecks bool
|
|
RequiresLinearHistory bool
|
|
RequiresSignatures bool
|
|
RequiresMergeQueue bool
|
|
}
|
|
|
|
type Reviewer struct {
|
|
Login string
|
|
State string
|
|
}
|
|
|
|
type ReviewThread struct {
|
|
ID string
|
|
Path string
|
|
Line int
|
|
StartLine int
|
|
DiffSide string
|
|
IsResolved bool
|
|
IsOutdated bool
|
|
IsTruncated bool
|
|
ViewerCanResolve bool
|
|
ViewerCanUnresolve bool
|
|
ViewerCanReply bool
|
|
Comments []ReviewComment
|
|
}
|
|
|
|
type ReviewComment struct {
|
|
ID string
|
|
Author string
|
|
Body string
|
|
DiffHunk string
|
|
Line int
|
|
StartLine int
|
|
OriginalLine int
|
|
OriginalStartLine int
|
|
OriginalCommitOID string
|
|
Outdated bool
|
|
CreatedAt time.Time
|
|
URL string
|
|
Reactions []ReactionSummary
|
|
}
|
|
|
|
type ReactionSummary struct {
|
|
Content string
|
|
Count int
|
|
ViewerHasReacted bool
|
|
}
|