diff --git a/resource_iteration_events.go b/resource_iteration_events.go index 6c7912e4d..7ad354a7b 100644 --- a/resource_iteration_events.go +++ b/resource_iteration_events.go @@ -34,21 +34,21 @@ type ResourceIterationEventsService struct { // // GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html type IterationEvent struct { - ID int `json:"id"` - Action string `json:"action"` - CreatedAt *time.Time `json:"created_at"` - ResourceType string `json:"resource_type"` - ResourceID int `json:"resource_id"` - User *BasicUser `json:"user"` - Iteration *ProjectIssueIteration `json:"iteration"` + ID int `json:"id"` + User *BasicUser `json:"user"` + CreatedAt *time.Time `json:"created_at"` + ResourceType string `json:"resource_type"` + ResourceID int `json:"resource_id"` + Iteration *Iteration `json:"iteration"` + Action string `json:"action"` } -// ProjectIssueIteration represents a project issue iteration. +// Iteration represents a project issue iteration. // // GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html -type ProjectIssueIteration struct { - Id int `json:"id"` - Iid int `json:"iid"` +type Iteration struct { + ID int `json:"id"` + IID int `json:"iid"` Sequence int `json:"sequence"` GroupId int `json:"group_id"` Title string `json:"title"` @@ -58,11 +58,11 @@ type ProjectIssueIteration struct { UpdatedAt *time.Time `json:"updated_at"` DueDate *ISOTime `json:"due_date"` StartDate *ISOTime `json:"start_date"` - WebUrl string `json:"web_url"` + WebURL string `json:"web_url"` } -// ListIterationEventsOptions represents the options for all resource state events -// list methods. +// ListIterationEventsOptions represents the options for all resource state +// events list methods. // // GitLab API docs: // https://docs.gitlab.com/ee/api/resource_iteration_events.html#list-project-issue-iteration-events @@ -70,8 +70,8 @@ type ListIterationEventsOptions struct { ListOptions } -// ListIssueIterationEvents retrieves resource iteration events for the specified -// project and issue. +// ListIssueIterationEvents retrieves resource iteration events for the +// specified project and issue. // // GitLab API docs: // https://docs.gitlab.com/ee/api/resource_iteration_events.html#list-project-issue-iteration-events diff --git a/resource_iteration_events_test.go b/resource_iteration_events_test.go index e470692c6..f4c707bcd 100644 --- a/resource_iteration_events_test.go +++ b/resource_iteration_events_test.go @@ -83,20 +83,20 @@ func TestListIssueIterationEventsService_ListIssueIterationEvents(t *testing.T) }, ResourceType: "Issue", ResourceID: 11, - CreatedAt: Time(time.Date(2023, time.September, 22, 06, 51, 04, 801000000, time.UTC)), - Iteration: &ProjectIssueIteration{ - Id: 133, - Iid: 1, + CreatedAt: Time(time.Date(2023, time.September, 22, 0o6, 51, 0o4, 801000000, time.UTC)), + Iteration: &Iteration{ + ID: 133, + IID: 1, Sequence: 1, GroupId: 153, Title: "Iteration 1", Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", State: 1, - CreatedAt: Time(time.Date(2023, time.July, 15, 00, 05, 06, 509000000, time.UTC)), - UpdatedAt: Time(time.Date(2023, time.September, 24, 00, 05, 10, 476000000, time.UTC)), + CreatedAt: Time(time.Date(2023, time.July, 15, 0o0, 0o5, 0o6, 509000000, time.UTC)), + UpdatedAt: Time(time.Date(2023, time.September, 24, 0o0, 0o5, 10, 476000000, time.UTC)), StartDate: &startDateISOTime, DueDate: &dueDateISOTime, - WebUrl: "https://gitlab.example.com/groups/project/-/iterations/1", + WebURL: "https://gitlab.example.com/groups/project/-/iterations/1", }, Action: "add", }} @@ -162,20 +162,20 @@ func TestListIssueIterationEventsService_GetIssueIterationEvent(t *testing.T) { }, ResourceType: "Issue", ResourceID: 11, - CreatedAt: Time(time.Date(2023, time.September, 22, 06, 51, 04, 801000000, time.UTC)), - Iteration: &ProjectIssueIteration{ - Id: 133, - Iid: 1, + CreatedAt: Time(time.Date(2023, time.September, 22, 0o6, 51, 0o4, 801000000, time.UTC)), + Iteration: &Iteration{ + ID: 133, + IID: 1, Sequence: 1, GroupId: 153, Title: "Iteration 1", Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", State: 1, - CreatedAt: Time(time.Date(2023, time.July, 15, 00, 05, 06, 509000000, time.UTC)), - UpdatedAt: Time(time.Date(2023, time.September, 24, 00, 05, 10, 476000000, time.UTC)), + CreatedAt: Time(time.Date(2023, time.July, 15, 0o0, 0o5, 0o6, 509000000, time.UTC)), + UpdatedAt: Time(time.Date(2023, time.September, 24, 0o0, 0o5, 10, 476000000, time.UTC)), StartDate: &startDateISOTime, DueDate: &dueDateISOTime, - WebUrl: "https://gitlab.example.com/groups/project/-/iterations/2", + WebURL: "https://gitlab.example.com/groups/project/-/iterations/2", }, Action: "add", }