Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Slack integration #2042

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 75 additions & 53 deletions services.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,31 @@ type ServicesService struct {
//
// GitLab API docs: https://docs.gitlab.com/ee/api/integrations.html
type Service struct {
ID int `json:"id"`
Title string `json:"title"`
Slug string `json:"slug"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
Active bool `json:"active"`
PushEvents bool `json:"push_events"`
IssuesEvents bool `json:"issues_events"`
AlertEvents bool `json:"alert_events"`
ConfidentialIssuesEvents bool `json:"confidential_issues_events"`
CommitEvents bool `json:"commit_events"`
MergeRequestsEvents bool `json:"merge_requests_events"`
CommentOnEventEnabled bool `json:"comment_on_event_enabled"`
TagPushEvents bool `json:"tag_push_events"`
NoteEvents bool `json:"note_events"`
ConfidentialNoteEvents bool `json:"confidential_note_events"`
PipelineEvents bool `json:"pipeline_events"`
JobEvents bool `json:"job_events"`
WikiPageEvents bool `json:"wiki_page_events"`
VulnerabilityEvents bool `json:"vulnerability_events"`
DeploymentEvents bool `json:"deployment_events"`
ID int `json:"id"`
Title string `json:"title"`
Slug string `json:"slug"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
Active bool `json:"active"`
AlertEvents bool `json:"alert_events"`
CommitEvents bool `json:"commit_events"`
ConfidentialIssuesEvents bool `json:"confidential_issues_events"`
ConfidentialNoteEvents bool `json:"confidential_note_events"`
DeploymentEvents bool `json:"deployment_events"`
GroupConfidentialMentionEvents bool `json:"group_confidential_mention_events"`
GroupMentionEvents bool `json:"group_mention_events"`
IncidentEvents bool `json:"incident_events"`
IssuesEvents bool `json:"issues_events"`
JobEvents bool `json:"job_events"`
MergeRequestsEvents bool `json:"merge_requests_events"`
NoteEvents bool `json:"note_events"`
PipelineEvents bool `json:"pipeline_events"`
PushEvents bool `json:"push_events"`
TagPushEvents bool `json:"tag_push_events"`
VulnerabilityEvents bool `json:"vulnerability_events"`
WikiPageEvents bool `json:"wiki_page_events"`
CommentOnEventEnabled bool `json:"comment_on_event_enabled"`
Inherited bool `json:"inherited"`
}

// ListServices gets a list of all active services.
Expand Down Expand Up @@ -878,22 +882,24 @@ type SlackApplication struct {
// GitLab API docs:
// https://docs.gitlab.com/ee/api/integrations.html#gitlab-for-slack-app
type SlackApplicationProperties struct {
Channel string `json:"channel"`
NotifyOnlyBrokenPipelines bool `json:"notify_only_broken_pipelines"`
BranchesToBeNotified string `json:"branches_to_be_notified"`
AlertEvents bool `json:"alert_events"`
IssuesEvents bool `json:"issues_events"`
ConfidentialIssuesEvents bool `json:"confidential_issues_events"`
MergeRequestsEvents bool `json:"merge_requests_events"`
NoteEvents bool `json:"note_events"`
ConfidentialNoteEvents bool `json:"confidential_note_events"`
DeploymentEvents bool `json:"deployment_events"`
IncidentsEvents bool `json:"incidents_events"`
PipelineEvents bool `json:"pipeline_events"`
PushEvents bool `json:"push_events"`
TagPushEvents bool `json:"tag_push_events"`
VulnerabilityEvents bool `json:"vulnerability_events"`
WikiPageEvents bool `json:"wiki_page_events"`
Channel string `json:"channel"`
NotifyOnlyBrokenPipelines bool `json:"notify_only_broken_pipelines"`
BranchesToBeNotified string `json:"branches_to_be_notified"`
LabelsToBeNotified string `json:"labels_to_be_notified"`
LabelsToBeNotifiedBehavior string `json:"labels_to_be_notified_behavior"`
PushChannel string `json:"push_channel"`
IssueChannel string `json:"issue_channel"`
ConfidentialIssueChannel string `json:"confidential_issue_channel"`
MergeRequestChannel string `json:"merge_request_channel"`
NoteChannel string `json:"note_channel"`
ConfidentialNoteChannel string `json:"confidential_note_channel"`
TagPushChannel string `json:"tag_push_channel"`
PipelineChannel string `json:"pipeline_channel"`
WikiPageChannel string `json:"wiki_page_channel"`
DeploymentChannel string `json:"deployment_channel"`
IncidentChannel string `json:"incident_channel"`
VulnerabilityChannel string `json:"vulnerability_channel"`
AlertChannel string `json:"alert_channel"`

Copy link
Contributor

@jgangemi jgangemi Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should include this as well:

        LabelsToBeNotified         string `json:"labels_to_be_notified,omitempty"`
	LabelsToBeNotifiedBehavior string `json:"labels_to_be_notified_behavior,omitempty"`
	PushChannel                string `json:"push_channel,omitempty"`
	IssueChannel               string `json:"issue_channel,omitempty"`
	ConfidentialIssueChannel   string `json:"confidential_issue_channel,omitempty"`
	MergeRequestChannel        string `json:"merge_request_channel,omitempty"`
	NoteChannel                string `json:"note_channel,omitempty"`
	ConfidentialNoteChannel    string `json:"confidential_note_channel,omitempty"`
	TagPushChannel             string `json:"tag_push_channel,omitempty"`
	PipelineChannel            string `json:"pipeline_channel,omitempty"`
	WikiPageChannel            string `json:"wiki_page_channel,omitempty"`
	DeploymentChannel          string `json:"deployment_channel,omitempty"`
	IncidentChannel            string `json:"incident_channel,omitempty"`
	VulnerabilityChannel       string `json:"vulnerability_channel,omitempty"`
	AlertChannel               string `json:"alert_channel,omitempty"`

// Deprecated: This parameter has been replaced with BranchesToBeNotified.
NotifyOnlyDefaultBranch bool `json:"notify_only_default_branch"`
Expand Down Expand Up @@ -931,22 +937,38 @@ func (s *ServicesService) GetSlackApplication(pid interface{}, options ...Reques
// GitLab API docs:
// https://docs.gitlab.com/ee/api/integrations.html#set-up-gitlab-for-slack-app
type SetSlackApplicationOptions struct {
Channel *string `url:"channel,omitempty" json:"channel,omitempty"`
NotifyOnlyBrokenPipelines *bool `url:"notify_only_broken_pipelines,omitempty" json:"notify_only_broken_pipelines,omitempty"`
BranchesToBeNotified *string `url:"branches_to_be_notified,omitempty" json:"branches_to_be_notified,omitempty"`
AlertEvents *bool `url:"alert_events,omitempty" json:"alert_events,omitempty"`
IssuesEvents *bool `url:"issues_events,omitempty" json:"issues_events,omitempty"`
ConfidentialIssuesEvents *bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
NoteEvents *bool `url:"note_events,omitempty" json:"note_events,omitempty"`
ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"`
DeploymentEvents *bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
IncidentsEvents *bool `url:"incidents_events,omitempty" json:"incidents_events,omitempty"`
PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
PushEvents *bool `url:"push_events,omitempty" json:"push_events,omitempty"`
TagPushEvents *bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
VulnerabilityEvents *bool `url:"vulnerability_events,omitempty" json:"vulnerability_events,omitempty"`
WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
Channel *string `url:"channel,omitempty" json:"channel,omitempty"`
NotifyOnlyBrokenPipelines *bool `url:"notify_only_broken_pipelines,omitempty" json:"notify_only_broken_pipelines,omitempty"`
BranchesToBeNotified *string `url:"branches_to_be_notified,omitempty" json:"branches_to_be_notified,omitempty"`
AlertEvents *bool `url:"alert_events,omitempty" json:"alert_events,omitempty"`
IssuesEvents *bool `url:"issues_events,omitempty" json:"issues_events,omitempty"`
ConfidentialIssuesEvents *bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
NoteEvents *bool `url:"note_events,omitempty" json:"note_events,omitempty"`
ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"`
DeploymentEvents *bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
IncidentsEvents *bool `url:"incidents_events,omitempty" json:"incidents_events,omitempty"`
PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
PushEvents *bool `url:"push_events,omitempty" json:"push_events,omitempty"`
TagPushEvents *bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
VulnerabilityEvents *bool `url:"vulnerability_events,omitempty" json:"vulnerability_events,omitempty"`
WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
LabelsToBeNotified *string `url:"labels_to_be_notified,omitempty" json:"labels_to_be_notified,omitempty"`
LabelsToBeNotifiedBehavior *string `url:"labels_to_be_notified_behavior,omitempty" json:"labels_to_be_notified_behavior,omitempty"`
PushChannel *string `url:"push_channel,omitempty" json:"push_channel,omitempty"`
IssueChannel *string `url:"issue_channel,omitempty" json:"issue_channel,omitempty"`
ConfidentialIssueChannel *string `url:"confidential_issue_channel,omitempty" json:"confidential_issue_channel,omitempty"`
MergeRequestChannel *string `url:"merge_request_channel,omitempty" json:"merge_request_channel,omitempty"`
NoteChannel *string `url:"note_channel,omitempty" json:"note_channel,omitempty"`
ConfidentialNoteChannel *string `url:"confidential_note_channel,omitempty" json:"confidential_note_channel,omitempty"`
TagPushChannel *string `url:"tag_push_channel,omitempty" json:"tag_push_channel,omitempty"`
PipelineChannel *string `url:"pipeline_channel,omitempty" json:"pipeline_channel,omitempty"`
WikiPageChannel *string `url:"wiki_page_channel,omitempty" json:"wiki_page_channel,omitempty"`
DeploymentChannel *string `url:"deployment_channel,omitempty" json:"deployment_channel,omitempty"`
IncidentChannel *string `url:"incident_channel,omitempty" json:"incident_channel,omitempty"`
VulnerabilityChannel *string `url:"vulnerability_channel,omitempty" json:"vulnerability_channel,omitempty"`
AlertChannel *string `url:"alert_channel,omitempty" json:"alert_channel,omitempty"`
UseInheritedSettings *bool `url:"use_inherited_settings,omitempty" json:"use_inherited_settings,omitempty"`

// Deprecated: This parameter has been replaced with BranchesToBeNotified.
NotifyOnlyDefaultBranch *bool `url:"notify_only_default_branch,omitempty" json:"notify_only_default_branch,omitempty"`
Expand Down