From 0bf548e12480bd0ab17993dbb9e247da24d0a306 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 Oct 2023 09:01:18 +0200 Subject: [PATCH] Bump github.com/xanzy/go-gitlab from 0.93.1 to 0.93.2 (#106) Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.93.1 to 0.93.2. - [Changelog](https://github.com/xanzy/go-gitlab/blob/main/releases_test.go) - [Commits](https://github.com/xanzy/go-gitlab/compare/v0.93.1...v0.93.2) --- updated-dependencies: - dependency-name: github.com/xanzy/go-gitlab dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 +- .../github.com/xanzy/go-gitlab/appearance.go | 110 ++++++++++++++++ .../github.com/xanzy/go-gitlab/discussions.go | 37 +++++- vendor/github.com/xanzy/go-gitlab/gitlab.go | 4 + .../xanzy/go-gitlab/merge_requests.go | 3 + .../xanzy/go-gitlab/notifications.go | 64 +++++---- .../go-gitlab/resource_iteration_events.go | 122 ++++++++++++++++++ vendor/github.com/xanzy/go-gitlab/settings.go | 4 +- vendor/modules.txt | 2 +- 10 files changed, 316 insertions(+), 36 deletions(-) create mode 100644 vendor/github.com/xanzy/go-gitlab/appearance.go create mode 100644 vendor/github.com/xanzy/go-gitlab/resource_iteration_events.go diff --git a/go.mod b/go.mod index 5697362..8d44f2a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/sj14/review-bot require ( github.com/google/go-github/v25 v25.1.3 github.com/stretchr/testify v1.8.4 - github.com/xanzy/go-gitlab v0.93.1 + github.com/xanzy/go-gitlab v0.93.2 golang.org/x/oauth2 v0.13.0 ) diff --git a/go.sum b/go.sum index dde7588..2803d1e 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/xanzy/go-gitlab v0.93.1 h1:f7J33cw/P9b/8paIOoH0F3H+TFrswvWHs6yUgoTp9LY= -github.com/xanzy/go-gitlab v0.93.1/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw= +github.com/xanzy/go-gitlab v0.93.2 h1:kNNf3BYNYn/Zkig0B89fma12l36VLcYSGu7OnaRlRDg= +github.com/xanzy/go-gitlab v0.93.2/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= diff --git a/vendor/github.com/xanzy/go-gitlab/appearance.go b/vendor/github.com/xanzy/go-gitlab/appearance.go new file mode 100644 index 0000000..f21893c --- /dev/null +++ b/vendor/github.com/xanzy/go-gitlab/appearance.go @@ -0,0 +1,110 @@ +// +// Copyright 2023, 徐晓伟 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package gitlab + +import "net/http" + +// AppearanceService handles communication with appearance of the Gitlab API. +// +// Gitlab API docs : https://docs.gitlab.com/ee/api/appearance.html +type AppearanceService struct { + client *Client +} + +// Appearance represents a GitLab appearance. +// +// Gitlab API docs : https://docs.gitlab.com/ee/api/appearance.html +type Appearance struct { + Title string `json:"title"` + Description string `json:"description"` + PWAName string `json:"pwa_name"` + PWAShortName string `json:"pwa_short_name"` + PWADescription string `json:"pwa_description"` + PWAIcon string `json:"pwa_icon"` + Logo string `json:"logo"` + HeaderLogo string `json:"header_logo"` + Favicon string `json:"favicon"` + NewProjectGuidelines string `json:"new_project_guidelines"` + ProfileImageGuidelines string `json:"profile_image_guidelines"` + HeaderMessage string `json:"header_message"` + FooterMessage string `json:"footer_message"` + MessageBackgroundColor string `json:"message_background_color"` + MessageFontColor string `json:"message_font_color"` + EmailHeaderAndFooterEnabled bool `json:"email_header_and_footer_enabled"` +} + +// GetAppearance gets the current appearance configuration of the GitLab instance. +// +// Gitlab API docs: +// https://docs.gitlab.com/ee/api/appearance.html#get-current-appearance-configuration +func (s *AppearanceService) GetAppearance(options ...RequestOptionFunc) (*Appearance, *Response, error) { + req, err := s.client.NewRequest(http.MethodGet, "application/appearance", nil, options) + if err != nil { + return nil, nil, err + } + + as := new(Appearance) + resp, err := s.client.Do(req, as) + if err != nil { + return nil, resp, err + } + + return as, resp, nil +} + +// ChangeAppearanceOptions represents the available ChangeAppearance() options. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/appearance.html#change-appearance-configuration +type ChangeAppearanceOptions struct { + Title *string `url:"title,omitempty" json:"title,omitempty"` + Description *string `url:"description,omitempty" json:"description,omitempty"` + PWAName *string `url:"pwa_name,omitempty" json:"pwa_name,omitempty"` + PWAShortName *string `url:"pwa_short_name,omitempty" json:"pwa_short_name,omitempty"` + PWADescription *string `url:"pwa_description,omitempty" json:"pwa_description,omitempty"` + PWAIcon *string `url:"pwa_icon,omitempty" json:"pwa_icon,omitempty"` + Logo *string `url:"logo,omitempty" json:"logo,omitempty"` + HeaderLogo *string `url:"header_logo,omitempty" json:"header_logo,omitempty"` + Favicon *string `url:"favicon,omitempty" json:"favicon,omitempty"` + NewProjectGuidelines *string `url:"new_project_guidelines,omitempty" json:"new_project_guidelines,omitempty"` + ProfileImageGuidelines *string `url:"profile_image_guidelines,omitempty" json:"profile_image_guidelines,omitempty"` + HeaderMessage *string `url:"header_message,omitempty" json:"header_message,omitempty"` + FooterMessage *string `url:"footer_message,omitempty" json:"footer_message,omitempty"` + MessageBackgroundColor *string `url:"message_background_color,omitempty" json:"message_background_color,omitempty"` + MessageFontColor *string `url:"message_font_color,omitempty" json:"message_font_color,omitempty"` + EmailHeaderAndFooterEnabled *bool `url:"email_header_and_footer_enabled,omitempty" json:"email_header_and_footer_enabled,omitempty"` + URL *string `url:"url,omitempty" json:"url,omitempty"` +} + +// ChangeAppearance changes the appearance configuration. +// +// Gitlab API docs: +// https://docs.gitlab.com/ee/api/appearance.html#change-appearance-configuration +func (s *AppearanceService) ChangeAppearance(opt *ChangeAppearanceOptions, options ...RequestOptionFunc) (*Appearance, *Response, error) { + req, err := s.client.NewRequest(http.MethodPut, "application/appearance", opt, options) + if err != nil { + return nil, nil, err + } + + as := new(Appearance) + resp, err := s.client.Do(req, as) + if err != nil { + return nil, resp, err + } + + return as, resp, nil +} diff --git a/vendor/github.com/xanzy/go-gitlab/discussions.go b/vendor/github.com/xanzy/go-gitlab/discussions.go index b4d7f24..7f791c5 100644 --- a/vendor/github.com/xanzy/go-gitlab/discussions.go +++ b/vendor/github.com/xanzy/go-gitlab/discussions.go @@ -724,10 +724,39 @@ func (s *DiscussionsService) GetMergeRequestDiscussion(pid interface{}, mergeReq // GitLab API docs: // https://docs.gitlab.com/ee/api/discussions.html#create-new-merge-request-thread type CreateMergeRequestDiscussionOptions struct { - Body *string `url:"body,omitempty" json:"body,omitempty"` - CommitID *string `url:"commit_id,omitempty" json:"commit_id,omitempty"` - CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` - Position *NotePosition `url:"position,omitempty" json:"position,omitempty"` + Body *string `url:"body,omitempty" json:"body,omitempty"` + CommitID *string `url:"commit_id,omitempty" json:"commit_id,omitempty"` + CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` + Position *PositionOptions `url:"position,omitempty" json:"position,omitempty"` +} + +// PositionOptions represents the position option of a discussion. +type PositionOptions struct { + BaseSHA *string `url:"base_sha,omitempty" json:"base_sha,omitempty"` + HeadSHA *string `url:"head_sha,omitempty" json:"head_sha,omitempty"` + StartSHA *string `url:"start_sha,omitempty" json:"start_sha,omitempty"` + NewPath *string `url:"new_path,omitempty" json:"new_path,omitempty"` + OldPath *string `url:"old_path,omitempty" json:"old_path,omitempty"` + PositionType *string `url:"position_type,omitempty" json:"position_type"` + NewLine *int `url:"new_line,omitempty" json:"new_line,omitempty"` + OldLine *int `url:"old_line,omitempty" json:"old_line,omitempty"` + LineRange *LineRangeOptions `url:"line_range,omitempty" json:"line_range,omitempty"` + Width *int `url:"width,omitempty" json:"width,omitempty"` + Height *int `url:"height,omitempty" json:"height,omitempty"` + X *float64 `url:"x,omitempty" json:"x,omitempty"` + Y *float64 `url:"y,omitempty" json:"y,omitempty"` +} + +// LineRangeOptions represents the line range option of a discussion. +type LineRangeOptions struct { + Start *LinePositionOptions `url:"start,omitempty" json:"start,omitempty"` + End *LinePositionOptions `url:"end,omitempty" json:"end,omitempty"` +} + +// LinePositionOptions represents the line position option of a discussion. +type LinePositionOptions struct { + LineCode *string `url:"line_code,omitempty" json:"line_code,omitempty"` + Type *string `url:"type,omitempty" json:"type,omitempty"` } // CreateMergeRequestDiscussion creates a new discussion for a single merge diff --git a/vendor/github.com/xanzy/go-gitlab/gitlab.go b/vendor/github.com/xanzy/go-gitlab/gitlab.go index 0f882bf..88d5505 100644 --- a/vendor/github.com/xanzy/go-gitlab/gitlab.go +++ b/vendor/github.com/xanzy/go-gitlab/gitlab.go @@ -105,6 +105,7 @@ type Client struct { // Services used for talking to different parts of the GitLab API. AccessRequests *AccessRequestsService + Appearance *AppearanceService Applications *ApplicationsService AuditEvents *AuditEventsService Avatar *AvatarRequestsService @@ -201,6 +202,7 @@ type Client struct { Repositories *RepositoriesService RepositoryFiles *RepositoryFilesService RepositorySubmodules *RepositorySubmodulesService + ResourceIterationEvents *ResourceIterationEventsService ResourceLabelEvents *ResourceLabelEventsService ResourceMilestoneEvents *ResourceMilestoneEventsService ResourceStateEvents *ResourceStateEventsService @@ -328,6 +330,7 @@ func newClient(options ...ClientOptionFunc) (*Client, error) { // Create all the public services. c.AccessRequests = &AccessRequestsService{client: c} + c.Appearance = &AppearanceService{client: c} c.Applications = &ApplicationsService{client: c} c.AuditEvents = &AuditEventsService{client: c} c.Avatar = &AvatarRequestsService{client: c} @@ -424,6 +427,7 @@ func newClient(options ...ClientOptionFunc) (*Client, error) { c.Repositories = &RepositoriesService{client: c} c.RepositoryFiles = &RepositoryFilesService{client: c} c.RepositorySubmodules = &RepositorySubmodulesService{client: c} + c.ResourceIterationEvents = &ResourceIterationEventsService{client: c} c.ResourceLabelEvents = &ResourceLabelEventsService{client: c} c.ResourceMilestoneEvents = &ResourceMilestoneEventsService{client: c} c.ResourceStateEvents = &ResourceStateEventsService{client: c} diff --git a/vendor/github.com/xanzy/go-gitlab/merge_requests.go b/vendor/github.com/xanzy/go-gitlab/merge_requests.go index f5b68fd..458255f 100644 --- a/vendor/github.com/xanzy/go-gitlab/merge_requests.go +++ b/vendor/github.com/xanzy/go-gitlab/merge_requests.go @@ -202,6 +202,7 @@ type ListMergeRequestsOptions struct { Scope *string `url:"scope,omitempty" json:"scope,omitempty"` AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` + NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` ApproverIDs *ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"` ApprovedByIDs *ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"` @@ -262,6 +263,7 @@ type ListProjectMergeRequestsOptions struct { Scope *string `url:"scope,omitempty" json:"scope,omitempty"` AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` + NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` ApproverIDs *ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"` ApprovedByIDs *ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"` @@ -323,6 +325,7 @@ type ListGroupMergeRequestsOptions struct { Scope *string `url:"scope,omitempty" json:"scope,omitempty"` AuthorID *int `url:"author_id,omitempty" json:"author_id,omitempty"` AuthorUsername *string `url:"author_username,omitempty" json:"author_username,omitempty"` + NotAuthorUsername *string `url:"not[author_username],omitempty" json:"not[author_username],omitempty"` AssigneeID *AssigneeIDValue `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` ApproverIDs *ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"` ApprovedByIDs *ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"` diff --git a/vendor/github.com/xanzy/go-gitlab/notifications.go b/vendor/github.com/xanzy/go-gitlab/notifications.go index da02415..92c2cb1 100644 --- a/vendor/github.com/xanzy/go-gitlab/notifications.go +++ b/vendor/github.com/xanzy/go-gitlab/notifications.go @@ -45,18 +45,24 @@ type NotificationSettings struct { // GitLab API docs: // https://docs.gitlab.com/ee/api/notification_settings.html#valid-notification-levels type NotificationEvents struct { - CloseIssue bool `json:"close_issue"` - CloseMergeRequest bool `json:"close_merge_request"` - FailedPipeline bool `json:"failed_pipeline"` - MergeMergeRequest bool `json:"merge_merge_request"` - NewIssue bool `json:"new_issue"` - NewMergeRequest bool `json:"new_merge_request"` - NewNote bool `json:"new_note"` - ReassignIssue bool `json:"reassign_issue"` - ReassignMergeRequest bool `json:"reassign_merge_request"` - ReopenIssue bool `json:"reopen_issue"` - ReopenMergeRequest bool `json:"reopen_merge_request"` - SuccessPipeline bool `json:"success_pipeline"` + CloseIssue bool `json:"close_issue"` + CloseMergeRequest bool `json:"close_merge_request"` + FailedPipeline bool `json:"failed_pipeline"` + FixedPipeline bool `json:"fixed_pipeline"` + IssueDue bool `json:"issue_due"` + MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"` + MergeMergeRequest bool `json:"merge_merge_request"` + MovedProject bool `json:"moved_project"` + NewIssue bool `json:"new_issue"` + NewMergeRequest bool `json:"new_merge_request"` + NewEpic bool `json:"new_epic"` + NewNote bool `json:"new_note"` + PushToMergeRequest bool `json:"push_to_merge_request"` + ReassignIssue bool `json:"reassign_issue"` + ReassignMergeRequest bool `json:"reassign_merge_request"` + ReopenIssue bool `json:"reopen_issue"` + ReopenMergeRequest bool `json:"reopen_merge_request"` + SuccessPipeline bool `json:"success_pipeline"` } func (ns NotificationSettings) String() string { @@ -87,20 +93,26 @@ func (s *NotificationSettingsService) GetGlobalSettings(options ...RequestOption // NotificationSettingsOptions represents the available options that can be passed // to the API when updating the notification settings. type NotificationSettingsOptions struct { - Level *NotificationLevelValue `url:"level,omitempty" json:"level,omitempty"` - NotificationEmail *string `url:"notification_email,omitempty" json:"notification_email,omitempty"` - CloseIssue *bool `url:"close_issue,omitempty" json:"close_issue,omitempty"` - CloseMergeRequest *bool `url:"close_merge_request,omitempty" json:"close_merge_request,omitempty"` - FailedPipeline *bool `url:"failed_pipeline,omitempty" json:"failed_pipeline,omitempty"` - MergeMergeRequest *bool `url:"merge_merge_request,omitempty" json:"merge_merge_request,omitempty"` - NewIssue *bool `url:"new_issue,omitempty" json:"new_issue,omitempty"` - NewMergeRequest *bool `url:"new_merge_request,omitempty" json:"new_merge_request,omitempty"` - NewNote *bool `url:"new_note,omitempty" json:"new_note,omitempty"` - ReassignIssue *bool `url:"reassign_issue,omitempty" json:"reassign_issue,omitempty"` - ReassignMergeRequest *bool `url:"reassign_merge_request,omitempty" json:"reassign_merge_request,omitempty"` - ReopenIssue *bool `url:"reopen_issue,omitempty" json:"reopen_issue,omitempty"` - ReopenMergeRequest *bool `url:"reopen_merge_request,omitempty" json:"reopen_merge_request,omitempty"` - SuccessPipeline *bool `url:"success_pipeline,omitempty" json:"success_pipeline,omitempty"` + Level *NotificationLevelValue `url:"level,omitempty" json:"level,omitempty"` + NotificationEmail *string `url:"notification_email,omitempty" json:"notification_email,omitempty"` + CloseIssue *bool `url:"close_issue,omitempty" json:"close_issue,omitempty"` + CloseMergeRequest *bool `url:"close_merge_request,omitempty" json:"close_merge_request,omitempty"` + FailedPipeline *bool `url:"failed_pipeline,omitempty" json:"failed_pipeline,omitempty"` + FixedPipeline *bool `url:"fixed_pipeline,omitempty" json:"fixed_pipeline,omitempty"` + IssueDue *bool `url:"issue_due,omitempty" json:"issue_due,omitempty"` + MergeMergeRequest *bool `url:"merge_merge_request,omitempty" json:"merge_merge_request,omitempty"` + MergeWhenPipelineSucceeds *bool `url:"merge_when_pipeline_succeeds,omitempty" json:"merge_when_pipeline_succeeds,omitempty"` + MovedProject *bool `url:"moved_project,omitempty" json:"moved_project,omitempty"` + NewEpic *bool `url:"new_epic,omitempty" json:"new_epic,omitempty"` + NewIssue *bool `url:"new_issue,omitempty" json:"new_issue,omitempty"` + NewMergeRequest *bool `url:"new_merge_request,omitempty" json:"new_merge_request,omitempty"` + NewNote *bool `url:"new_note,omitempty" json:"new_note,omitempty"` + PushToMergeRequest *bool `url:"push_to_merge_request,omitempty" json:"push_to_merge_request,omitempty"` + ReassignIssue *bool `url:"reassign_issue,omitempty" json:"reassign_issue,omitempty"` + ReassignMergeRequest *bool `url:"reassign_merge_request,omitempty" json:"reassign_merge_request,omitempty"` + ReopenIssue *bool `url:"reopen_issue,omitempty" json:"reopen_issue,omitempty"` + ReopenMergeRequest *bool `url:"reopen_merge_request,omitempty" json:"reopen_merge_request,omitempty"` + SuccessPipeline *bool `url:"success_pipeline,omitempty" json:"success_pipeline,omitempty"` } // UpdateGlobalSettings updates current notification settings and email address. diff --git a/vendor/github.com/xanzy/go-gitlab/resource_iteration_events.go b/vendor/github.com/xanzy/go-gitlab/resource_iteration_events.go new file mode 100644 index 0000000..7ad354a --- /dev/null +++ b/vendor/github.com/xanzy/go-gitlab/resource_iteration_events.go @@ -0,0 +1,122 @@ +// +// Copyright 2023, Hakki Ceylan, Yavuz Turk +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package gitlab + +import ( + "fmt" + "net/http" + "time" +) + +// ResourceIterationEventsService handles communication with the event related +// methods of the GitLab API. +// +// GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html +type ResourceIterationEventsService struct { + client *Client +} + +// IterationEvent represents a resource iteration event. +// +// GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html +type IterationEvent struct { + 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"` +} + +// Iteration represents a project issue iteration. +// +// GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html +type Iteration struct { + ID int `json:"id"` + IID int `json:"iid"` + Sequence int `json:"sequence"` + GroupId int `json:"group_id"` + Title string `json:"title"` + Description string `json:"description"` + State int `json:"state"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + DueDate *ISOTime `json:"due_date"` + StartDate *ISOTime `json:"start_date"` + WebURL string `json:"web_url"` +} + +// 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 +type ListIterationEventsOptions struct { + ListOptions +} + +// 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 +func (s *ResourceIterationEventsService) ListIssueIterationEvents(pid interface{}, issue int, opt *ListIterationEventsOptions, options ...RequestOptionFunc) ([]*IterationEvent, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/issues/%d/resource_iteration_events", PathEscape(project), issue) + + req, err := s.client.NewRequest(http.MethodGet, u, opt, options) + if err != nil { + return nil, nil, err + } + + var ies []*IterationEvent + resp, err := s.client.Do(req, &ies) + if err != nil { + return nil, resp, err + } + + return ies, resp, nil +} + +// GetIssueIterationEvent gets a single issue iteration event. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/resource_iteration_events.html#get-single-issue-iteration-event +func (s *ResourceIterationEventsService) GetIssueIterationEvent(pid interface{}, issue int, event int, options ...RequestOptionFunc) (*IterationEvent, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/issues/%d/resource_iteration_events/%d", PathEscape(project), issue, event) + + req, err := s.client.NewRequest(http.MethodGet, u, nil, options) + if err != nil { + return nil, nil, err + } + + ie := new(IterationEvent) + resp, err := s.client.Do(req, ie) + if err != nil { + return nil, resp, err + } + + return ie, resp, nil +} diff --git a/vendor/github.com/xanzy/go-gitlab/settings.go b/vendor/github.com/xanzy/go-gitlab/settings.go index 92a1ef6..a81d892 100644 --- a/vendor/github.com/xanzy/go-gitlab/settings.go +++ b/vendor/github.com/xanzy/go-gitlab/settings.go @@ -238,7 +238,7 @@ type Settings struct { PasswordSymbolRequired bool `json:"password_symbol_required"` PasswordUppercaseRequired bool `json:"password_uppercase_required"` PasswordLowercaseRequired bool `json:"password_lowercase_required"` - PerformanceBarAllowedGroupID string `json:"performance_bar_allowed_group_id"` + PerformanceBarAllowedGroupID int `json:"performance_bar_allowed_group_id"` PerformanceBarAllowedGroupPath string `json:"performance_bar_allowed_group_path"` PerformanceBarEnabled bool `json:"performance_bar_enabled"` PersonalAccessTokenPrefix string `json:"personal_access_token_prefix"` @@ -617,7 +617,7 @@ type UpdateSettingsOptions struct { PasswordSymbolRequired *bool `url:"password_symbol_required,omitempty" json:"password_symbol_required,omitempty"` PasswordUppercaseRequired *bool `url:"password_uppercase_required,omitempty" json:"password_uppercase_required,omitempty"` PasswordLowercaseRequired *bool `url:"password_lowercase_required,omitempty" json:"password_lowercase_required,omitempty"` - PerformanceBarAllowedGroupID *string `url:"performance_bar_allowed_group_id,omitempty" json:"performance_bar_allowed_group_id,omitempty"` + PerformanceBarAllowedGroupID *int `url:"performance_bar_allowed_group_id,omitempty" json:"performance_bar_allowed_group_id,omitempty"` PerformanceBarAllowedGroupPath *string `url:"performance_bar_allowed_group_path,omitempty" json:"performance_bar_allowed_group_path,omitempty"` PerformanceBarEnabled *bool `url:"performance_bar_enabled,omitempty" json:"performance_bar_enabled,omitempty"` PersonalAccessTokenPrefix *string `url:"personal_access_token_prefix,omitempty" json:"personal_access_token_prefix,omitempty"` diff --git a/vendor/modules.txt b/vendor/modules.txt index 7c39128..4cae687 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -23,7 +23,7 @@ github.com/pmezard/go-difflib/difflib ## explicit; go 1.20 github.com/stretchr/testify/assert github.com/stretchr/testify/require -# github.com/xanzy/go-gitlab v0.93.1 +# github.com/xanzy/go-gitlab v0.93.2 ## explicit; go 1.18 github.com/xanzy/go-gitlab # golang.org/x/net v0.17.0