Skip to content

Commit

Permalink
Repository.Hook: Add missing fields Type, Name, TestURL, PingURL and …
Browse files Browse the repository at this point in the history
…LastResponse (#1790)
  • Loading branch information
andygrunwald authored Feb 4, 2021
1 parent 046c2f8 commit 319dcff
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 11 deletions.
32 changes: 32 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions github/github-stringify_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions github/repos_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ func (w WebHookAuthor) String() string {

// Hook represents a GitHub (web and service) hook for a repository.
type Hook struct {
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
URL *string `json:"url,omitempty"`
ID *int64 `json:"id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
URL *string `json:"url,omitempty"`
ID *int64 `json:"id,omitempty"`
Type *string `json:"type,omitempty"`
Name *string `json:"name,omitempty"`
TestURL *string `json:"test_url,omitempty"`
PingURL *string `json:"ping_url,omitempty"`
LastResponse map[string]interface{} `json:"last_response,omitempty"`

// Only the following fields are used when creating a hook.
// Config is required.
Expand Down
2 changes: 1 addition & 1 deletion github/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestString(t *testing.T) {
{Gist{ID: String("1")}, `github.Gist{ID:"1", Files:map[]}`},
{GitObject{SHA: String("s")}, `github.GitObject{SHA:"s"}`},
{Gitignore{Name: String("n")}, `github.Gitignore{Name:"n"}`},
{Hook{ID: Int64(1)}, `github.Hook{ID:1, Config:map[]}`},
{Hook{ID: Int64(1)}, `github.Hook{ID:1, LastResponse:map[], Config:map[]}`},
{IssueComment{ID: Int64(1)}, `github.IssueComment{ID:1}`},
{Issue{Number: Int(1)}, `github.Issue{Number:1}`},
{Key{ID: Int64(1)}, `github.Key{ID:1}`},
Expand Down

0 comments on commit 319dcff

Please sign in to comment.