public SlackService updateSlackService ( Object projectIdOrPath , SlackService slackNotifications ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "webhook" , slackNotifications . getWebhook ( ) , true ) . withParam ( "username" , slackNotifications . getUsername ( ) ) . withParam ( "channel" , slackNotifications . getDefaultChannel ( ) ) . withParam ( "notify_only_broken_pipelines" , slackNotifications . getNotifyOnlyBrokenPipelines ( ) ) . withParam ( "notify_only_default_branch" , slackNotifications . getNotifyOnlyDefaultBranch ( ) ) . withParam ( "push_events" , slackNotifications . getPushEvents ( ) ) . withParam ( "issues_events" , slackNotifications . getIssuesEvents ( ) ) . withParam ( "confidential_issues_events" , slackNotifications . getConfidentialIssuesEvents ( ) ) . withParam ( "merge_requests_events" , slackNotifications . getMergeRequestsEvents ( ) ) . withParam ( "tag_push_events" , slackNotifications . getTagPushEvents ( ) ) . withParam ( "note_events" , slackNotifications . getNoteEvents ( ) ) . withParam ( "confidential_note_events" , slackNotifications . getConfidentialNoteEvents ( ) ) . withParam ( "pipeline_events" , slackNotifications . getPipelineEvents ( ) ) . withParam ( "wiki_page_events" , slackNotifications . getWikiPageEvents ( ) ) . withParam ( "push_channel" , slackNotifications . getPushChannel ( ) ) . withParam ( "issue_channel" , slackNotifications . getIssueChannel ( ) ) . withParam ( "confidential_issue_channel" , slackNotifications . getConfidentialIssueChannel ( ) ) . withParam ( "merge_request_channel" , slackNotifications . getMergeRequestChannel ( ) ) . withParam ( "note_channel" , slackNotifications . getNoteChannel ( ) ) . withParam ( "confidential_note_channel" , slackNotifications . getConfidentialNoteChannel ( ) ) . withParam ( "tag_push_channel" , slackNotifications . getTagPushChannel ( ) ) . withParam ( "pipeline_channel" , slackNotifications . getPipelineChannel ( ) ) . withParam ( "wiki_page_channel" , slackNotifications . getWikiPageChannel ( ) ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "slack" ) ; return ( response . readEntity ( SlackService . class ) ) ; }
Updates the Slack notification settings for a project .