Commit 4d479a6b authored by Sune Keller's avatar Sune Keller Committed by Sander van Harmelen

Revert notes discussions isotime (#488)

* Revert NotesService and DiscussionsService ISOTime -> time.Time
Signed-off-by: 's avatarSune Keller <absukl@almbrand.dk>

* Fix missing imports
Signed-off-by: 's avatarSune Keller <absukl@almbrand.dk>
parent bfc0d7b1
...@@ -19,6 +19,7 @@ package gitlab ...@@ -19,6 +19,7 @@ package gitlab
import ( import (
"fmt" "fmt"
"net/url" "net/url"
"time"
) )
// DiscussionsService handles communication with the discussions related // DiscussionsService handles communication with the discussions related
...@@ -111,7 +112,7 @@ func (s *DiscussionsService) GetIssueDiscussion(pid interface{}, issue int, disc ...@@ -111,7 +112,7 @@ func (s *DiscussionsService) GetIssueDiscussion(pid interface{}, issue int, disc
// https://docs.gitlab.com/ce/api/discussions.html#create-new-issue-discussion // https://docs.gitlab.com/ce/api/discussions.html#create-new-issue-discussion
type CreateIssueDiscussionOptions struct { type CreateIssueDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// CreateIssueDiscussion creates a new discussion to a single project issue. // CreateIssueDiscussion creates a new discussion to a single project issue.
...@@ -146,7 +147,7 @@ func (s *DiscussionsService) CreateIssueDiscussion(pid interface{}, issue int, o ...@@ -146,7 +147,7 @@ func (s *DiscussionsService) CreateIssueDiscussion(pid interface{}, issue int, o
// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-issue-discussion // https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-issue-discussion
type AddIssueDiscussionNoteOptions struct { type AddIssueDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// AddIssueDiscussionNote creates a new discussion to a single project issue. // AddIssueDiscussionNote creates a new discussion to a single project issue.
...@@ -185,7 +186,7 @@ func (s *DiscussionsService) AddIssueDiscussionNote(pid interface{}, issue int, ...@@ -185,7 +186,7 @@ func (s *DiscussionsService) AddIssueDiscussionNote(pid interface{}, issue int,
// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-issue-discussion-note // https://docs.gitlab.com/ce/api/discussions.html#modify-existing-issue-discussion-note
type UpdateIssueDiscussionNoteOptions struct { type UpdateIssueDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// UpdateIssueDiscussionNote modifies existing discussion of an issue. // UpdateIssueDiscussionNote modifies existing discussion of an issue.
...@@ -311,7 +312,7 @@ func (s *DiscussionsService) GetSnippetDiscussion(pid interface{}, snippet int, ...@@ -311,7 +312,7 @@ func (s *DiscussionsService) GetSnippetDiscussion(pid interface{}, snippet int,
// https://docs.gitlab.com/ce/api/discussions.html#create-new-snippet-discussion // https://docs.gitlab.com/ce/api/discussions.html#create-new-snippet-discussion
type CreateSnippetDiscussionOptions struct { type CreateSnippetDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// CreateSnippetDiscussion creates a new discussion for a single snippet. // CreateSnippetDiscussion creates a new discussion for a single snippet.
...@@ -347,7 +348,7 @@ func (s *DiscussionsService) CreateSnippetDiscussion(pid interface{}, snippet in ...@@ -347,7 +348,7 @@ func (s *DiscussionsService) CreateSnippetDiscussion(pid interface{}, snippet in
// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-snippet-discussion // https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-snippet-discussion
type AddSnippetDiscussionNoteOptions struct { type AddSnippetDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// AddSnippetDiscussionNote creates a new discussion to a single project // AddSnippetDiscussionNote creates a new discussion to a single project
...@@ -387,7 +388,7 @@ func (s *DiscussionsService) AddSnippetDiscussionNote(pid interface{}, snippet i ...@@ -387,7 +388,7 @@ func (s *DiscussionsService) AddSnippetDiscussionNote(pid interface{}, snippet i
// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-snippet-discussion-note // https://docs.gitlab.com/ce/api/discussions.html#modify-existing-snippet-discussion-note
type UpdateSnippetDiscussionNoteOptions struct { type UpdateSnippetDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// UpdateSnippetDiscussionNote modifies existing discussion of a snippet. // UpdateSnippetDiscussionNote modifies existing discussion of a snippet.
...@@ -516,7 +517,7 @@ func (s *DiscussionsService) GetEpicDiscussion(gid interface{}, epic int, discus ...@@ -516,7 +517,7 @@ func (s *DiscussionsService) GetEpicDiscussion(gid interface{}, epic int, discus
// https://docs.gitlab.com/ee/api/discussions.html#create-new-epic-discussion // https://docs.gitlab.com/ee/api/discussions.html#create-new-epic-discussion
type CreateEpicDiscussionOptions struct { type CreateEpicDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// CreateEpicDiscussion creates a new discussion for a single epic. Epic // CreateEpicDiscussion creates a new discussion for a single epic. Epic
...@@ -555,7 +556,7 @@ func (s *DiscussionsService) CreateEpicDiscussion(gid interface{}, epic int, opt ...@@ -555,7 +556,7 @@ func (s *DiscussionsService) CreateEpicDiscussion(gid interface{}, epic int, opt
// https://docs.gitlab.com/ee/api/discussions.html#add-note-to-existing-epic-discussion // https://docs.gitlab.com/ee/api/discussions.html#add-note-to-existing-epic-discussion
type AddEpicDiscussionNoteOptions struct { type AddEpicDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// AddEpicDiscussionNote creates a new discussion to a single project epic. // AddEpicDiscussionNote creates a new discussion to a single project epic.
...@@ -594,7 +595,7 @@ func (s *DiscussionsService) AddEpicDiscussionNote(gid interface{}, epic int, di ...@@ -594,7 +595,7 @@ func (s *DiscussionsService) AddEpicDiscussionNote(gid interface{}, epic int, di
// https://docs.gitlab.com/ee/api/discussions.html#modify-existing-epic-discussion-note // https://docs.gitlab.com/ee/api/discussions.html#modify-existing-epic-discussion-note
type UpdateEpicDiscussionNoteOptions struct { type UpdateEpicDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// UpdateEpicDiscussionNote modifies existing discussion of a epic. // UpdateEpicDiscussionNote modifies existing discussion of a epic.
...@@ -724,7 +725,7 @@ func (s *DiscussionsService) GetMergeRequestDiscussion(pid interface{}, mergeReq ...@@ -724,7 +725,7 @@ func (s *DiscussionsService) GetMergeRequestDiscussion(pid interface{}, mergeReq
// https://docs.gitlab.com/ce/api/discussions.html#create-new-merge-request-discussion // https://docs.gitlab.com/ce/api/discussions.html#create-new-merge-request-discussion
type CreateMergeRequestDiscussionOptions struct { type CreateMergeRequestDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
Position *NotePosition `url:"position,omitempty" json:"position,omitempty"` Position *NotePosition `url:"position,omitempty" json:"position,omitempty"`
} }
...@@ -803,7 +804,7 @@ func (s *DiscussionsService) ResolveMergeRequestDiscussion(pid interface{}, merg ...@@ -803,7 +804,7 @@ func (s *DiscussionsService) ResolveMergeRequestDiscussion(pid interface{}, merg
// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-merge-request-discussion // https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-merge-request-discussion
type AddMergeRequestDiscussionNoteOptions struct { type AddMergeRequestDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// AddMergeRequestDiscussionNote creates a new discussion to a single project // AddMergeRequestDiscussionNote creates a new discussion to a single project
...@@ -843,7 +844,7 @@ func (s *DiscussionsService) AddMergeRequestDiscussionNote(pid interface{}, merg ...@@ -843,7 +844,7 @@ func (s *DiscussionsService) AddMergeRequestDiscussionNote(pid interface{}, merg
// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-merge-request-discussion-note // https://docs.gitlab.com/ce/api/discussions.html#modify-existing-merge-request-discussion-note
type UpdateMergeRequestDiscussionNoteOptions struct { type UpdateMergeRequestDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// UpdateMergeRequestDiscussionNote modifies existing discussion of a merge // UpdateMergeRequestDiscussionNote modifies existing discussion of a merge
...@@ -975,7 +976,7 @@ func (s *DiscussionsService) GetCommitDiscussion(pid interface{}, commit string, ...@@ -975,7 +976,7 @@ func (s *DiscussionsService) GetCommitDiscussion(pid interface{}, commit string,
// https://docs.gitlab.com/ce/api/discussions.html#create-new-commit-discussion // https://docs.gitlab.com/ce/api/discussions.html#create-new-commit-discussion
type CreateCommitDiscussionOptions struct { type CreateCommitDiscussionOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
Position *NotePosition `url:"position,omitempty" json:"position,omitempty"` Position *NotePosition `url:"position,omitempty" json:"position,omitempty"`
} }
...@@ -1014,7 +1015,7 @@ func (s *DiscussionsService) CreateCommitDiscussion(pid interface{}, commit stri ...@@ -1014,7 +1015,7 @@ func (s *DiscussionsService) CreateCommitDiscussion(pid interface{}, commit stri
// https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-commit-discussion // https://docs.gitlab.com/ce/api/discussions.html#add-note-to-existing-commit-discussion
type AddCommitDiscussionNoteOptions struct { type AddCommitDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// AddCommitDiscussionNote creates a new discussion to a single project commit. // AddCommitDiscussionNote creates a new discussion to a single project commit.
...@@ -1053,7 +1054,7 @@ func (s *DiscussionsService) AddCommitDiscussionNote(pid interface{}, commit str ...@@ -1053,7 +1054,7 @@ func (s *DiscussionsService) AddCommitDiscussionNote(pid interface{}, commit str
// https://docs.gitlab.com/ce/api/discussions.html#modify-existing-commit-discussion-note // https://docs.gitlab.com/ce/api/discussions.html#modify-existing-commit-discussion-note
type UpdateCommitDiscussionNoteOptions struct { type UpdateCommitDiscussionNoteOptions struct {
Body *string `url:"body,omitempty" json:"body,omitempty"` Body *string `url:"body,omitempty" json:"body,omitempty"`
CreatedAt *ISOTime `url:"created_at,omitempty" json:"created_at,omitempty"` CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
} }
// UpdateCommitDiscussionNote modifies existing discussion of an commit. // UpdateCommitDiscussionNote modifies existing discussion of an commit.
......
...@@ -19,6 +19,7 @@ package gitlab ...@@ -19,6 +19,7 @@ package gitlab
import ( import (
"fmt" "fmt"
"net/url" "net/url"
"time"
) )
// NotesService handles communication with the notes related methods // NotesService handles communication with the notes related methods
...@@ -48,9 +49,9 @@ type Note struct { ...@@ -48,9 +49,9 @@ type Note struct {
WebURL string `json:"web_url"` WebURL string `json:"web_url"`
} `json:"author"` } `json:"author"`
System bool `json:"system"` System bool `json:"system"`
ExpiresAt *ISOTime `json:"expires_at"` ExpiresAt *time.Time `json:"expires_at"`
UpdatedAt *ISOTime `json:"updated_at"` UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *ISOTime `json:"created_at"` CreatedAt *time.Time `json:"created_at"`
NoteableID int `json:"noteable_id"` NoteableID int `json:"noteable_id"`
NoteableType string `json:"noteable_type"` NoteableType string `json:"noteable_type"`
Position *NotePosition `json:"position"` Position *NotePosition `json:"position"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment