diff --git a/event_webhook_types.go b/event_webhook_types.go index cbdcd23ed..452d43fa1 100644 --- a/event_webhook_types.go +++ b/event_webhook_types.go @@ -868,7 +868,22 @@ type SnippetCommentEvent struct { Description string `json:"description"` URL string `json:"url"` } `json:"object_attributes"` - Snippet *Snippet `json:"snippet"` + Snippet *struct { + ID int `json:"id"` + Title string `json:"title"` + Content string `json:"content"` + AuthorID int `json:"author_id"` + ProjectID int `json:"project_id"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + Filename string `json:"file_name"` + ExpiresAt string `json:"expires_at"` + Type string `json:"type"` + VisibilityLevel int `json:"visibility_level"` + Description string `json:"description"` + Secret bool `json:"secret"` + RepositoryReadOnly bool `json:"repository_read_only"` + } `json:"snippet"` } // SubGroupEvent represents a subgroup event. diff --git a/testdata/webhooks/note_snippet.json b/testdata/webhooks/note_snippet.json index ef7ecf8bc..681715854 100644 --- a/testdata/webhooks/note_snippet.json +++ b/testdata/webhooks/note_snippet.json @@ -1,5 +1,6 @@ { "object_kind": "note", + "event_type": "note", "user": { "id": 42, "name": "User1", @@ -40,11 +41,20 @@ "updated_at": "2015-05-17 18:35:50 UTC", "project_id": 5, "attachment": null, + "change_position": null, + "discussion_id": "e1c5835f5f99414806f6fe45b28s48cfebb89ee1", "line_code": null, - "commit_id": "", + "commit_id": null, "noteable_id": 53, "system": false, + "original_position": null, + "position": null, + "resolved_at": null, + "resolved_by_id": null, + "resolved_by_push": null, "st_diff": null, + "type": null, + "updated_by_id": null, "description": "Is this snippet doing what it's supposed to be doing?", "url": "http://example.com/gitlab-org/gitlab-test/snippets/53#note_1245" }, @@ -54,11 +64,17 @@ "content": "puts 'Hello world'", "author_id": 1, "project_id": 5, - "created_at": "2016-01-04T15:31:46.176Z", - "updated_at": "2016-01-04T15:31:46.176Z", + "created_at": "2016-01-04 15:31:46 UTC", + "updated_at": "2016-01-04 15:32:46 UTC", "file_name": "test.rb", "expires_at": null, "type": "ProjectSnippet", - "visibility_level": 0 + "visibility_level": 0, + "description": "Prints 'Hello world'", + "encrypted_secret_token": null, + "encrypted_secret_token_iv": null, + "secret": false, + "repository_read_only": false, + "secret_token": null } }