diff --git a/api/swagger.yaml b/api/swagger.yaml index 7a5318915d1cd8147d26dc288afb08758dd4ecb5..dbb16ac38584474a2b47014d946bb1dda6b581a3 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -14483,10 +14483,6 @@ definitions: $ref: "#/definitions/UserBasic" milestone: $ref: "#/definitions/Milestone" - stale_labels: - type: "array" - items: - $ref: "#/definitions/StaleLabels" labels: type: "array" items: diff --git a/gitee/hook_branchhook_accessors.go b/gitee/hook_branchhook_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..694de3e0e846c9707aa4ea723ba90ad1e7599103 --- /dev/null +++ b/gitee/hook_branchhook_accessors.go @@ -0,0 +1,41 @@ +package gitee + +func (b *BranchHook) GetLabel() string { + if b == nil { + return "" + } + + return b.Label +} + +func (b *BranchHook) GetRef() string { + if b == nil { + return "" + } + + return b.Ref +} + +func (b *BranchHook) GetSha() string { + if b == nil { + return "" + } + + return b.Sha +} + +func (b *BranchHook) GetUser() *UserHook { + if b == nil { + return nil + } + + return b.User +} + +func (b *BranchHook) GetRepo() *ProjectHook { + if b == nil { + return nil + } + + return b.Repo +} \ No newline at end of file diff --git a/gitee/hook_commithook_accessors.go b/gitee/hook_commithook_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..69f3dc1daf8936a68f6011cb12a6f75c56e1c3f0 --- /dev/null +++ b/gitee/hook_commithook_accessors.go @@ -0,0 +1,17 @@ +package gitee + +func (c *CommitHook) GetAuthor() *UserHook { + if c == nil { + return nil + } + + return c.Author +} + +func (c *CommitHook) GetCommitter() *UserHook { + if c == nil { + return nil + } + + return c.Committer +} \ No newline at end of file diff --git a/gitee/hook_enterprisehook_accessors.go b/gitee/hook_enterprisehook_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..02ab8f428b66705423b95c56cb7c6d6f20094c99 --- /dev/null +++ b/gitee/hook_enterprisehook_accessors.go @@ -0,0 +1,17 @@ +package gitee + +func (eh *EnterpriseHook) GetName() string { + if eh == nil { + return "" + } + + return eh.Name +} + +func (eh *EnterpriseHook) GetUrl() string { + if eh == nil { + return "" + } + + return eh.Url +} \ No newline at end of file diff --git a/gitee/hook_issueevent_accessors.go b/gitee/hook_issueevent_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..3a658ac95461bd8108a530a43f2df869ce0b9687 --- /dev/null +++ b/gitee/hook_issueevent_accessors.go @@ -0,0 +1,137 @@ +package gitee + +func (ie *IssueEvent) GetAction() string { + if ie == nil || ie.Action == nil { + return "" + } + + return *ie.Action +} + +func (ie *IssueEvent) GetIssue() *IssueHook { + if ie == nil { + return nil + } + + return ie.Issue +} + +func (ie *IssueEvent) GetRepository() *ProjectHook { + if ie == nil { + return nil + } + + return ie.Repository +} + +func (ie *IssueEvent) GetProject() *ProjectHook { + if ie == nil { + return nil + } + + return ie.Project +} + +func (ie *IssueEvent) GetSender() *UserHook { + if ie == nil { + return nil + } + + return ie.Sender +} + +func (ie *IssueEvent) GetTargetUser() *UserHook { + if ie == nil { + return nil + } + + return ie.TargetUser +} + +func (ie *IssueEvent) GetUser() *UserHook { + if ie == nil { + return nil + } + + return ie.User +} + +func (ie *IssueEvent) GetAssignee() *UserHook { + if ie == nil { + return nil + } + + return ie.Assignee +} + +func (ie *IssueEvent) GetUpdatedBy() *UserHook { + if ie == nil { + return nil + } + + return ie.UpdatedBy +} + +func (ie *IssueEvent) GetTitle() string { + if ie == nil || ie.Title == nil { + return "" + } + + return *ie.Title +} + +func (ie *IssueEvent) GetDescription() string { + if ie == nil || ie.Description == nil { + return "" + } + + return *ie.Description +} + +func (ie *IssueEvent) GetState() string { + if ie == nil || ie.State == nil { + return "" + } + + return *ie.State +} + +func (ie *IssueEvent) GetMilestone() string { + if ie == nil || ie.Milestone == nil { + return "" + } + + return *ie.Milestone +} + +func (ie *IssueEvent) GetURL() string { + if ie == nil || ie.URL == nil { + return "" + } + + return *ie.URL +} + +func (ie *IssueEvent) GetEnterprise() *EnterpriseHook { + if ie == nil { + return nil + } + + return ie.Enterprise +} + +func (ie *IssueEvent) GetHookName() string { + if ie == nil || ie.HookName == nil { + return "" + } + + return *ie.HookName +} + +func (ie *IssueEvent) GetPassword() string { + if ie == nil || ie.Password == nil { + return "" + } + + return *ie.Password +} diff --git a/gitee/hook_issuehook_accessors.go b/gitee/hook_issuehook_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..c11c6b4a6a0cb6cb609bc871b5eb8b9f8d744967 --- /dev/null +++ b/gitee/hook_issuehook_accessors.go @@ -0,0 +1,25 @@ +package gitee + +func (ih *IssueHook) GetUser() *UserHook { + if ih == nil { + return nil + } + + return ih.User +} + +func (ih *IssueHook) GetNumber() string { + if ih == nil { + return "" + } + + return ih.Number +} + +func (ih *IssueHook) GetState() string { + if ih == nil { + return "" + } + + return ih.State +} diff --git a/gitee/hook_labelhokk_accessors.go b/gitee/hook_labelhokk_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..e4b375ec56e7bd201b33d4c669730c70455cb63c --- /dev/null +++ b/gitee/hook_labelhokk_accessors.go @@ -0,0 +1,17 @@ +package gitee + +func (l *LabelHook) GetName() string { + if l == nil { + return "" + } + + return l.Name +} + +func (l *LabelHook) GetColor() string { + if l == nil { + return "" + } + + return l.Color +} diff --git a/gitee/hook_milestonehook_accessors.go b/gitee/hook_milestonehook_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..d9e2e253d28dd1e6d9df9c784b832dcc2231e0ac --- /dev/null +++ b/gitee/hook_milestonehook_accessors.go @@ -0,0 +1,17 @@ +package gitee + +func (m *MilestoneHook) GetTitle() string { + if m == nil { + return "" + } + + return m.Title +} + +func (m *MilestoneHook) GetState() string { + if m == nil { + return "" + } + + return m.State +} diff --git a/gitee/hook_noteevent_accessors.go b/gitee/hook_noteevent_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..b1b1cd366040225c1a170636c3a1316af89ab6b7 --- /dev/null +++ b/gitee/hook_noteevent_accessors.go @@ -0,0 +1,137 @@ +package gitee + +func (ne *NoteEvent) GetAction() string { + if ne == nil || ne.Action == nil { + return "" + } + + return *ne.Action +} + +func (ne *NoteEvent) GetComment() *NoteHook { + if ne == nil { + return nil + } + + return ne.Comment +} + +func (ne *NoteEvent) GetRepository() *ProjectHook { + if ne == nil { + return nil + } + + return ne.Repository +} + +func (ne *NoteEvent) GetProject() *ProjectHook { + if ne == nil { + return nil + } + + return ne.Project +} + +func (ne *NoteEvent) GetAuthor() *UserHook { + if ne == nil { + return nil + } + + return ne.Author +} + +func (ne *NoteEvent) GetSender() *UserHook { + if ne == nil { + return nil + } + + return ne.Sender +} + +func (ne *NoteEvent) GetURL() string { + if ne == nil || ne.URL == nil { + return "" + } + + return *ne.URL +} + +func (ne *NoteEvent) GetNote() string { + if ne == nil || ne.Note == nil { + return "" + } + + return *ne.Note +} + +func (ne *NoteEvent) GetNoteableType() string { + if ne == nil || ne.NoteableType == nil { + return "" + } + + return *ne.NoteableType +} + +func (ne *NoteEvent) GetTitle() string { + if ne == nil || ne.Title == nil { + return "" + } + + return *ne.Title +} + +func (ne *NoteEvent) GetPerIID() string { + if ne == nil || ne.PerIID == nil { + return "" + } + + return *ne.PerIID +} + +func (ne *NoteEvent) GetShortCommitID() string { + if ne == nil || ne.ShortCommitID == nil { + return "" + } + + return *ne.ShortCommitID +} + +func (ne *NoteEvent) GetEnterprise() *EnterpriseHook { + if ne == nil { + return nil + } + + return ne.Enterprise +} + +func (ne *NoteEvent) GetPullRequest() *PullRequestHook { + if ne == nil { + return nil + } + + return ne.PullRequest +} + +func (ne *NoteEvent) GetIssue() *IssueHook { + if ne == nil { + return nil + } + + return ne.Issue +} + +func (ne *NoteEvent) GetHookName() string { + if ne == nil || ne.HookName == nil { + return "" + } + + return *ne.HookName +} + +func (ne *NoteEvent) GetPassword() string { + if ne == nil || ne.Password == nil { + return "" + } + + return *ne.Password +} diff --git a/gitee/hook_notehook_accessors.go b/gitee/hook_notehook_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..39c156d243d2f24faa17625e701122468db0da1e --- /dev/null +++ b/gitee/hook_notehook_accessors.go @@ -0,0 +1,9 @@ +package gitee + +func (nh *NoteHook) GetBody() string { + if nh == nil { + return "" + } + + return nh.Body +} diff --git a/gitee/hook_projecthook_accessors.go b/gitee/hook_projecthook_accessors.go index 90dd83e9ace09c26de28661599999874671527aa..31950142b3510a77f03bf9e6d6ccb5f11e9c026b 100644 --- a/gitee/hook_projecthook_accessors.go +++ b/gitee/hook_projecthook_accessors.go @@ -14,4 +14,20 @@ func (pj *ProjectHook) GetPath() string { } return pj.Path +} + +func (pj *ProjectHook) GetOwner() *UserHook { + if pj == nil { + return nil + } + + return pj.Owner +} + +func (pj *ProjectHook) GetOwnerAndRepo() (string, string) { + if pj == nil { + return "", "" + } + + return pj.Namespace, pj.Path } \ No newline at end of file diff --git a/gitee/hook_pullrequestevent_accessors.go b/gitee/hook_pullrequestevent_accessors.go index 0db9452038f52ccab73c25e82a0791883feab946..7d1ddfe873d62a0a7e64f21efec20447f5b75bd5 100644 --- a/gitee/hook_pullrequestevent_accessors.go +++ b/gitee/hook_pullrequestevent_accessors.go @@ -154,9 +154,3 @@ func (p *PullRequestEvent) GetPassword() string{ } return *p.Password } - -func (p *PullRequestEvent) GetOwnerAndRepo() (string, string) { - r := p.GetRepository() - - return r.GetNameSpace(), r.GetPath() -} diff --git a/gitee/hook_pullrequesthook_accessors.go b/gitee/hook_pullrequesthook_accessors.go index 73d543ab788312f2d85ce492657c7f7d1fc8fb4b..62dd5cfcc350716108c83f25e9f1b642ebb7620b 100644 --- a/gitee/hook_pullrequesthook_accessors.go +++ b/gitee/hook_pullrequesthook_accessors.go @@ -39,6 +39,7 @@ func (ph *PullRequestHook) GetBase() *BranchHook { return ph.Base } + func (ph *PullRequestHook) GetUpdatedBy() *UserHook { if ph == nil { return nil diff --git a/gitee/hook_pushevent_accessors.go b/gitee/hook_pushevent_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..3b28c6707dd9d691f6136db5023592f346feae6b --- /dev/null +++ b/gitee/hook_pushevent_accessors.go @@ -0,0 +1,137 @@ +package gitee + +func (pe *PushEvent) GetAction() string { + if pe == nil || pe.Ref == nil { + return "" + } + + return *pe.Ref +} + +func (pe *PushEvent) GetBefore() string { + if pe == nil || pe.Before == nil { + return "" + } + + return *pe.Before +} + +func (pe *PushEvent) GetAfter() string { + if pe == nil || pe.After == nil { + return "" + } + + return *pe.After +} + +func (pe *PushEvent) GetCommitsMoreThanTen() bool { + if pe == nil || pe.CommitsMoreThanTen == nil { + return false + } + + return *pe.CommitsMoreThanTen +} + +func (pe *PushEvent) GetCreated() bool { + if pe == nil || pe.Created == nil { + return false + } + + return *pe.Created +} + +func (pe *PushEvent) GetDeleted() bool { + if pe == nil || pe.Deleted == nil { + return false + } + + return *pe.Deleted +} + +func (pe *PushEvent) GetCompare() string { + if pe == nil || pe.Compare == nil { + return "" + } + + return *pe.Compare +} + +func (pe *PushEvent) GetHeadCommit() *CommitHook { + if pe == nil { + return nil + } + + return pe.HeadCommit +} + +func (pe *PushEvent) GetRepository() *ProjectHook { + if pe == nil { + return nil + } + + return pe.Repository +} + +func (pe *PushEvent) GetProject() *ProjectHook { + if pe == nil { + return nil + } + + return pe.Project +} + +func (pe *PushEvent) GetUserName() string { + if pe == nil || pe.UserName == nil { + return "" + } + + return *pe.UserName +} + +func (pe *PushEvent) GetUser() *UserHook { + if pe == nil { + return nil + } + + return pe.User +} + +func (pe *PushEvent) GetPusher() *UserHook { + if pe == nil { + return nil + } + + return pe.Pusher +} + +func (pe *PushEvent) GetSender() *UserHook { + if pe == nil { + return nil + } + + return pe.Sender +} + +func (pe *PushEvent) GetEnterprise() *EnterpriseHook { + if pe == nil { + return nil + } + + return pe.Enterprise +} + +func (pe *PushEvent) GetHookName() string { + if pe == nil || pe.HookName == nil { + return "" + } + + return *pe.HookName +} + +func (pe *PushEvent) GetPassword() string { + if pe == nil || pe.Password == nil { + return "" + } + + return *pe.Password +} diff --git a/gitee/hook_userhook_accessors.go b/gitee/hook_userhook_accessors.go new file mode 100644 index 0000000000000000000000000000000000000000..48a8378c36398d438f39d85dba3404d35829100e --- /dev/null +++ b/gitee/hook_userhook_accessors.go @@ -0,0 +1,9 @@ +package gitee + +func (u *UserHook) GetLogin() string { + if u == nil { + return "" + } + + return u.Login +} \ No newline at end of file