diff --git a/integrations.go b/integrations.go index 2e4357ada853f58cfe4aabebbfa5203c0677b04f..d9fdd13156bca67fbb8a0951c68eeb85662d7ed3 100644 --- a/integrations.go +++ b/integrations.go @@ -14,20 +14,75 @@ package gitlab import ( - "fmt" "net/http" "time" ) type ( IntegrationsServiceInterface interface { + // ListActiveGroupIntegrations gets a list of all active group integrations. + // The vulnerability_events field is only available for GitLab Enterprise Edition. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#list-all-active-integrations ListActiveGroupIntegrations(gid any, opt *ListActiveIntegrationsOptions, options ...RequestOptionFunc) ([]*Integration, *Response, error) + + // SetUpGroupHarbor sets up the Harbor integration for a group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#set-up-harbor SetUpGroupHarbor(gid any, opt *SetUpHarborOptions, options ...RequestOptionFunc) (*Integration, *Response, error) + + // DisableGroupHarbor disables the Harbor integration for a group. + // Integration settings are reset. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#disable-harbor DisableGroupHarbor(gid any, options ...RequestOptionFunc) (*Response, error) + + // GetGroupHarborSettings gets the Harbor integration for a group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#get-harbor-settings GetGroupHarborSettings(gid any, options ...RequestOptionFunc) (*Integration, *Response, error) + + // SetGroupMicrosoftTeamsNotifications sets up Microsoft Teams notifications for a group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#set-up-microsoft-teams-notifications SetGroupMicrosoftTeamsNotifications(gid any, opt *SetMicrosoftTeamsNotificationsOptions, options ...RequestOptionFunc) (*Integration, *Response, error) + + // DisableGroupMicrosoftTeamsNotifications disables Microsoft Teams notifications + // for a group. Integration settings are reset. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#disable-microsoft-teams-notifications DisableGroupMicrosoftTeamsNotifications(gid any, options ...RequestOptionFunc) (*Response, error) + + // GetGroupMicrosoftTeamsNotifications gets the Microsoft Teams notifications for a group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#get-microsoft-teams-notifications-settings GetGroupMicrosoftTeamsNotifications(gid any, options ...RequestOptionFunc) (*Integration, *Response, error) + + // SetUpGroupJira sets up the Jira integration for a group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#set-up-jira + SetUpGroupJira(gid any, opt *SetUpJiraOptions, options ...RequestOptionFunc) (*Integration, *Response, error) + + // DisableGroupJira disables the Jira integration for a group. + // Integration settings are reset. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#disable-jira + DisableGroupJira(gid any, options ...RequestOptionFunc) (*Response, error) + + // GetGroupJiraSettings gets the Jira integration for a group. + // + // GitLab API docs: + // https://docs.gitlab.com/api/group_integrations/#get-jira-settings + GetGroupJiraSettings(gid any, options ...RequestOptionFunc) (*Integration, *Response, error) } // IntegrationsService handles communication with the group @@ -83,30 +138,12 @@ type ListActiveIntegrationsOptions struct { ListOptions } -// ListActiveGroupIntegrations gets a list of all active group integrations. -// The vulnerability_events field is only available for GitLab Enterprise Edition. -// -// GitLab API docs: -// https://docs.gitlab.com/api/group_integrations/#list-all-active-integrations func (s *IntegrationsService) ListActiveGroupIntegrations(gid any, opt *ListActiveIntegrationsOptions, options ...RequestOptionFunc) ([]*Integration, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err } - u := fmt.Sprintf("groups/%s/integrations", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, opt, options) - if err != nil { - return nil, nil, err - } - - var integrations []*Integration - resp, err := s.client.Do(req, &integrations) - if err != nil { - return nil, resp, err - } - - return integrations, resp, nil + return do[[]*Integration](s.client, withPath("groups/%s/integrations", group), withMethod(http.MethodGet), withAPIOpts(opt), withRequestOpts(options...)) } // SetUpHarborOptions represents the available SetUpGroupHarbor() @@ -122,76 +159,29 @@ type SetUpHarborOptions struct { UseInheritedSettings *bool `url:"use_inherited_settings,omitempty" json:"use_inherited_settings,omitempty"` } -// SetUpGroupHarbor sets up the Harbor integration for a group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/group_integrations/#set-up-harbor func (s *IntegrationsService) SetUpGroupHarbor(gid any, opt *SetUpHarborOptions, options ...RequestOptionFunc) (*Integration, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err } - u := fmt.Sprintf("groups/%s/integrations/harbor", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - integration := new(Integration) - resp, err := s.client.Do(req, integration) - if err != nil { - return nil, resp, err - } - return integration, resp, nil + return do[*Integration](s.client, withPath("groups/%s/integrations/harbor", group), withMethod(http.MethodPut), withAPIOpts(opt), withRequestOpts(options...)) } -// DisableGroupHarbor disables the Harbor integration for a group. -// Integration settings are reset. -// -// GitLab API docs: -// https://docs.gitlab.com/api/group_integrations/#disable-harbor func (s *IntegrationsService) DisableGroupHarbor(gid any, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err } - u := fmt.Sprintf("groups/%s/integrations/harbor", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } - - resp, err := s.client.Do(req, nil) - if err != nil { - return nil, err - } - return resp, nil + _, resp, err := do[none](s.client, withPath("groups/%s/integrations/harbor", group), withMethod(http.MethodDelete), withRequestOpts(options...)) + return resp, err } -// GetGroupHarborSettings gets the Harbor integration for a group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/group_integrations/#get-harbor-settings func (s *IntegrationsService) GetGroupHarborSettings(gid any, options ...RequestOptionFunc) (*Integration, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err } - u := fmt.Sprintf("groups/%s/integrations/harbor", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) - if err != nil { - return nil, nil, err - } - - integration := new(Integration) - resp, err := s.client.Do(req, integration) - if err != nil { - return nil, nil, err - } - return integration, resp, nil + return do[*Integration](s.client, withPath("groups/%s/integrations/harbor", group), withMethod(http.MethodGet), withRequestOpts(options...)) } // SetMicrosoftTeamsNotificationsOptions represents the available @@ -217,74 +207,75 @@ type SetMicrosoftTeamsNotificationsOptions struct { UseInheritedSettings *bool `url:"use_inherited_settings,omitempty"` } -// SetGroupMicrosoftTeamsNotifications sets up Microsoft Teams notifications for a group. -// -// GitLab API docs: -// https://docs.gitlab.com/api/group_integrations/#set-up-microsoft-teams-notifications func (s *IntegrationsService) SetGroupMicrosoftTeamsNotifications(gid any, opt *SetMicrosoftTeamsNotificationsOptions, options ...RequestOptionFunc) (*Integration, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err } - u := fmt.Sprintf("groups/%s/integrations/microsoft_teams", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodPut, u, opt, options) - if err != nil { - return nil, nil, err - } - - integration := new(Integration) - resp, err := s.client.Do(req, integration) - if err != nil { - return nil, resp, err - } - return integration, resp, nil + return do[*Integration](s.client, withPath("groups/%s/integrations/microsoft_teams", group), withMethod(http.MethodPut), withAPIOpts(opt), withRequestOpts(options...)) } -// DisableGroupMicrosoftTeamsNotifications disables Microsoft Teams notifications -// for a group. Integration settings are reset. -// -// GitLab API docs: -// https://docs.gitlab.com/api/group_integrations/#disable-microsoft-teams-notifications func (s *IntegrationsService) DisableGroupMicrosoftTeamsNotifications(gid any, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err } - u := fmt.Sprintf("groups/%s/integrations/microsoft_teams", PathEscape(group)) - - req, err := s.client.NewRequest(http.MethodDelete, u, nil, options) - if err != nil { - return nil, err - } + _, resp, err := do[none](s.client, withPath("groups/%s/integrations/microsoft_teams", group), withMethod(http.MethodDelete), withRequestOpts(options...)) + return resp, err +} - resp, err := s.client.Do(req, nil) +func (s *IntegrationsService) GetGroupMicrosoftTeamsNotifications(gid any, options ...RequestOptionFunc) (*Integration, *Response, error) { + group, err := parseID(gid) if err != nil { - return nil, err + return nil, nil, err } - return resp, nil + return do[*Integration](s.client, withPath("groups/%s/integrations/microsoft_teams", group), withMethod(http.MethodGet), withRequestOpts(options...)) } -// GetGroupMicrosoftTeamsNotifications gets the Microsoft Teams notifications for a group. +// SetUpJiraOptions represents the available SetUpJira() options. // // GitLab API docs: -// https://docs.gitlab.com/api/group_integrations/#get-microsoft-teams-notifications-settings -func (s *IntegrationsService) GetGroupMicrosoftTeamsNotifications(gid any, options ...RequestOptionFunc) (*Integration, *Response, error) { +// https://docs.gitlab.com/api/group_integrations/#set-up-jira +type SetUpJiraOptions struct { + URL *string `url:"url,omitempty" json:"url,omitempty"` + APIURL *string `url:"api_url,omitempty" json:"api_url,omitempty"` + Username *string `url:"username,omitempty" json:"username,omitempty"` + Password *string `url:"password,omitempty" json:"password,omitempty"` + Active *bool `url:"active,omitempty" json:"active,omitempty"` + JiraAuthType *int64 `url:"jira_auth_type,omitempty" json:"jira_auth_type,omitempty"` + JiraIssuePrefix *string `url:"jira_issue_prefix,omitempty" json:"jira_issue_prefix,omitempty"` + JiraIssueRegex *string `url:"jira_issue_regex,omitempty" json:"jira_issue_regex,omitempty"` + JiraIssueTransitionAutomatic *bool `url:"jira_issue_transition_automatic,omitempty" json:"jira_issue_transition_automatic,omitempty"` + JiraIssueTransitionID *string `url:"jira_issue_transition_id,omitempty" json:"jira_issue_transition_id,omitempty"` + CommitEvents *bool `url:"commit_events,omitempty" json:"commit_events,omitempty"` + MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"` + CommentOnEventEnabled *bool `url:"comment_on_event_enabled,omitempty" json:"comment_on_event_enabled,omitempty"` + IssuesEnabled *bool `url:"issues_enabled,omitempty" json:"issues_enabled,omitempty"` + ProjectKeys *[]string `url:"project_keys,omitempty" json:"project_keys,omitempty"` + UseInheritedSettings *bool `url:"use_inherited_settings,omitempty" json:"use_inherited_settings,omitempty"` +} + +func (s *IntegrationsService) SetUpGroupJira(gid any, opt *SetUpJiraOptions, options ...RequestOptionFunc) (*Integration, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err } - u := fmt.Sprintf("groups/%s/integrations/microsoft_teams", PathEscape(group)) + return do[*Integration](s.client, withPath("groups/%s/integrations/jira", group), withMethod(http.MethodPut), withAPIOpts(opt), withRequestOpts(options...)) +} - req, err := s.client.NewRequest(http.MethodGet, u, nil, options) +func (s *IntegrationsService) DisableGroupJira(gid any, options ...RequestOptionFunc) (*Response, error) { + group, err := parseID(gid) if err != nil { - return nil, nil, err + return nil, err } + _, resp, err := do[none](s.client, withPath("groups/%s/integrations/jira", group), withMethod(http.MethodDelete), withRequestOpts(options...)) + return resp, err +} - integration := new(Integration) - resp, err := s.client.Do(req, integration) +func (s *IntegrationsService) GetGroupJiraSettings(gid any, options ...RequestOptionFunc) (*Integration, *Response, error) { + group, err := parseID(gid) if err != nil { return nil, nil, err } - return integration, resp, nil + return do[*Integration](s.client, withPath("groups/%s/integrations/jira", group), withMethod(http.MethodGet), withRequestOpts(options...)) } diff --git a/integrations_test.go b/integrations_test.go index b2ef9ff60312970c2debabb18ec27236e6bf31eb..1d91ebff3d8da12d2830cae48446b8345e245fcb 100644 --- a/integrations_test.go +++ b/integrations_test.go @@ -407,3 +407,142 @@ func TestGetGroupMicrosoftTeamsNotifications(t *testing.T) { } assert.Equal(t, want, integration) } + +func TestSetUpGroupJira(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/groups/1/integrations/jira", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodPut) + fmt.Fprint(w, `{ + "id": 1, + "title": "Jira", + "slug": "jira", + "created_at": "2025-01-01T00:00:00.000Z", + "updated_at": "2025-01-02T00:00:00.000Z", + "active": true, + "commit_events": true, + "push_events": true, + "issues_events": true, + "alert_events": false, + "confidential_issues_events": false, + "merge_requests_events": true, + "tag_push_events": true, + "deployment_events": false, + "note_events": true, + "confidential_note_events": false, + "pipeline_events": true, + "wiki_page_events": false, + "job_events": false, + "comment_on_event_enabled": true, + "inherited": false, + "vulnerability_events": false + }`) + }) + integration, resp, err := client.Integrations.SetUpGroupJira(1, nil) + assert.NoError(t, err) + assert.NotNil(t, resp) + createdAt, _ := time.Parse(time.RFC3339, "2025-01-01T00:00:00.000Z") + updatedAt, _ := time.Parse(time.RFC3339, "2025-01-02T00:00:00.000Z") + want := &Integration{ + ID: 1, + Title: "Jira", + Slug: "jira", + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, + Active: true, + CommitEvents: true, + PushEvents: true, + IssuesEvents: true, + AlertEvents: false, + ConfidentialIssuesEvents: false, + MergeRequestsEvents: true, + TagPushEvents: true, + DeploymentEvents: false, + NoteEvents: true, + ConfidentialNoteEvents: false, + PipelineEvents: true, + WikiPageEvents: false, + JobEvents: false, + CommentOnEventEnabled: true, + Inherited: false, + VulnerabilityEvents: false, + } + assert.Equal(t, want, integration) +} + +func TestDisableGroupJira(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/groups/1/integrations/jira", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodDelete) + }) + resp, err := client.Integrations.DisableGroupJira(1) + assert.NoError(t, err) + assert.NotNil(t, resp) +} + +func TestGetGroupJiraSettings(t *testing.T) { + t.Parallel() + mux, client := setup(t) + + mux.HandleFunc("/api/v4/groups/1/integrations/jira", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + fmt.Fprint(w, `{ + "id": 1, + "title": "Jira", + "slug": "jira", + "created_at": "2025-01-01T00:00:00.000Z", + "updated_at": "2025-01-02T00:00:00.000Z", + "active": true, + "commit_events": true, + "push_events": true, + "issues_events": true, + "alert_events": false, + "confidential_issues_events": false, + "merge_requests_events": true, + "tag_push_events": true, + "deployment_events": false, + "note_events": true, + "confidential_note_events": false, + "pipeline_events": true, + "wiki_page_events": false, + "job_events": false, + "comment_on_event_enabled": true, + "inherited": false, + "vulnerability_events": false + }`) + }) + integration, resp, err := client.Integrations.GetGroupJiraSettings(1) + assert.NoError(t, err) + assert.NotNil(t, resp) + + createdAt, _ := time.Parse(time.RFC3339, "2025-01-01T00:00:00.000Z") + updatedAt, _ := time.Parse(time.RFC3339, "2025-01-02T00:00:00.000Z") + want := &Integration{ + ID: 1, + Title: "Jira", + Slug: "jira", + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, + Active: true, + CommitEvents: true, + PushEvents: true, + IssuesEvents: true, + AlertEvents: false, + ConfidentialIssuesEvents: false, + MergeRequestsEvents: true, + TagPushEvents: true, + DeploymentEvents: false, + NoteEvents: true, + ConfidentialNoteEvents: false, + PipelineEvents: true, + WikiPageEvents: false, + JobEvents: false, + CommentOnEventEnabled: true, + Inherited: false, + VulnerabilityEvents: false, + } + assert.Equal(t, want, integration) +} diff --git a/testing/integrations_mock.go b/testing/integrations_mock.go index 677a471a8cf01ec35b2ebf2f45945e12433f164e..0b5150f542578b6e50da0b0af98505b5d1597cc0 100644 --- a/testing/integrations_mock.go +++ b/testing/integrations_mock.go @@ -83,6 +83,50 @@ func (c *MockIntegrationsServiceInterfaceDisableGroupHarborCall) DoAndReturn(f f return c } +// DisableGroupJira mocks base method. +func (m *MockIntegrationsServiceInterface) DisableGroupJira(gid any, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{gid} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DisableGroupJira", varargs...) + ret0, _ := ret[0].(*gitlab.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DisableGroupJira indicates an expected call of DisableGroupJira. +func (mr *MockIntegrationsServiceInterfaceMockRecorder) DisableGroupJira(gid any, options ...any) *MockIntegrationsServiceInterfaceDisableGroupJiraCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{gid}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DisableGroupJira", reflect.TypeOf((*MockIntegrationsServiceInterface)(nil).DisableGroupJira), varargs...) + return &MockIntegrationsServiceInterfaceDisableGroupJiraCall{Call: call} +} + +// MockIntegrationsServiceInterfaceDisableGroupJiraCall wrap *gomock.Call +type MockIntegrationsServiceInterfaceDisableGroupJiraCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockIntegrationsServiceInterfaceDisableGroupJiraCall) Return(arg0 *gitlab.Response, arg1 error) *MockIntegrationsServiceInterfaceDisableGroupJiraCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockIntegrationsServiceInterfaceDisableGroupJiraCall) Do(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIntegrationsServiceInterfaceDisableGroupJiraCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockIntegrationsServiceInterfaceDisableGroupJiraCall) DoAndReturn(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.Response, error)) *MockIntegrationsServiceInterfaceDisableGroupJiraCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + // DisableGroupMicrosoftTeamsNotifications mocks base method. func (m *MockIntegrationsServiceInterface) DisableGroupMicrosoftTeamsNotifications(gid any, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) { m.ctrl.T.Helper() @@ -172,6 +216,51 @@ func (c *MockIntegrationsServiceInterfaceGetGroupHarborSettingsCall) DoAndReturn return c } +// GetGroupJiraSettings mocks base method. +func (m *MockIntegrationsServiceInterface) GetGroupJiraSettings(gid any, options ...gitlab.RequestOptionFunc) (*gitlab.Integration, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{gid} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetGroupJiraSettings", varargs...) + ret0, _ := ret[0].(*gitlab.Integration) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetGroupJiraSettings indicates an expected call of GetGroupJiraSettings. +func (mr *MockIntegrationsServiceInterfaceMockRecorder) GetGroupJiraSettings(gid any, options ...any) *MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{gid}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGroupJiraSettings", reflect.TypeOf((*MockIntegrationsServiceInterface)(nil).GetGroupJiraSettings), varargs...) + return &MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall{Call: call} +} + +// MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall wrap *gomock.Call +type MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall) Return(arg0 *gitlab.Integration, arg1 *gitlab.Response, arg2 error) *MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall) Do(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.Integration, *gitlab.Response, error)) *MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall) DoAndReturn(f func(any, ...gitlab.RequestOptionFunc) (*gitlab.Integration, *gitlab.Response, error)) *MockIntegrationsServiceInterfaceGetGroupJiraSettingsCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + // GetGroupMicrosoftTeamsNotifications mocks base method. func (m *MockIntegrationsServiceInterface) GetGroupMicrosoftTeamsNotifications(gid any, options ...gitlab.RequestOptionFunc) (*gitlab.Integration, *gitlab.Response, error) { m.ctrl.T.Helper() @@ -351,3 +440,48 @@ func (c *MockIntegrationsServiceInterfaceSetUpGroupHarborCall) DoAndReturn(f fun c.Call = c.Call.DoAndReturn(f) return c } + +// SetUpGroupJira mocks base method. +func (m *MockIntegrationsServiceInterface) SetUpGroupJira(gid any, opt *gitlab.SetUpJiraOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Integration, *gitlab.Response, error) { + m.ctrl.T.Helper() + varargs := []any{gid, opt} + for _, a := range options { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SetUpGroupJira", varargs...) + ret0, _ := ret[0].(*gitlab.Integration) + ret1, _ := ret[1].(*gitlab.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// SetUpGroupJira indicates an expected call of SetUpGroupJira. +func (mr *MockIntegrationsServiceInterfaceMockRecorder) SetUpGroupJira(gid, opt any, options ...any) *MockIntegrationsServiceInterfaceSetUpGroupJiraCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{gid, opt}, options...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUpGroupJira", reflect.TypeOf((*MockIntegrationsServiceInterface)(nil).SetUpGroupJira), varargs...) + return &MockIntegrationsServiceInterfaceSetUpGroupJiraCall{Call: call} +} + +// MockIntegrationsServiceInterfaceSetUpGroupJiraCall wrap *gomock.Call +type MockIntegrationsServiceInterfaceSetUpGroupJiraCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockIntegrationsServiceInterfaceSetUpGroupJiraCall) Return(arg0 *gitlab.Integration, arg1 *gitlab.Response, arg2 error) *MockIntegrationsServiceInterfaceSetUpGroupJiraCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockIntegrationsServiceInterfaceSetUpGroupJiraCall) Do(f func(any, *gitlab.SetUpJiraOptions, ...gitlab.RequestOptionFunc) (*gitlab.Integration, *gitlab.Response, error)) *MockIntegrationsServiceInterfaceSetUpGroupJiraCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockIntegrationsServiceInterfaceSetUpGroupJiraCall) DoAndReturn(f func(any, *gitlab.SetUpJiraOptions, ...gitlab.RequestOptionFunc) (*gitlab.Integration, *gitlab.Response, error)) *MockIntegrationsServiceInterfaceSetUpGroupJiraCall { + c.Call = c.Call.DoAndReturn(f) + return c +}