@@ -756,6 +756,132 @@ func (s *ServicesService) DeleteGithubService(pid interface{}, options ...Reques
756
756
return s .client .Do (req , nil )
757
757
}
758
758
759
+ // SlackApplication represents GitLab for slack application settings.
760
+ //
761
+ // GitLab API docs:
762
+ // https://docs.gitlab.com/ee/api/integrations.html#gitlab-for-slack-app
763
+ type SlackApplication struct {
764
+ Service
765
+ Properties * SlackApplicationProperties `json:"properties"`
766
+ }
767
+
768
+ // SlackApplicationProperties represents GitLab for slack application specific properties.
769
+ //
770
+ // GitLab API docs:
771
+ // https://docs.gitlab.com/ee/api/integrations.html#gitlab-for-slack-app
772
+ type SlackApplicationProperties struct {
773
+ Channel string `json:"channel"`
774
+ NotifyOnlyBrokenPipelines bool `json:"notify_only_broken_pipelines"`
775
+ BranchesToBeNotified string `json:"branches_to_be_notified"`
776
+ AlertEvents bool `json:"alert_events"`
777
+ IssuesEvents bool `json:"issues_events"`
778
+ ConfidentialIssuesEvents bool `json:"confidential_issues_events"`
779
+ MergeRequestsEvents bool `json:"merge_requests_events"`
780
+ NoteEvents bool `json:"note_events"`
781
+ ConfidentialNoteEvents bool `json:"confidential_note_events"`
782
+ DeploymentEvents bool `json:"deployment_events"`
783
+ IncidentsEvents bool `json:"incidents_events"`
784
+ PipelineEvents bool `json:"pipeline_events"`
785
+ PushEvents bool `json:"push_events"`
786
+ TagPushEvents bool `json:"tag_push_events"`
787
+ VulnerabilityEvents bool `json:"vulnerability_events"`
788
+ WikiPageEvents bool `json:"wiki_page_events"`
789
+
790
+ // Deprecated: This parameter has been replaced with BranchesToBeNotified.
791
+ NotifyOnlyDefaultBranch bool `json:"notify_only_default_branch"`
792
+ }
793
+
794
+ // GetSlackApplication gets the GitLab for Slack app integration settings for a
795
+ // project.
796
+ //
797
+ // GitLab API docs:
798
+ // https://docs.gitlab.com/ee/api/integrations.html#get-gitlab-for-slack-app-settings
799
+ func (s * ServicesService ) GetSlackApplication (pid interface {}, options ... RequestOptionFunc ) (* SlackApplication , * Response , error ) {
800
+ project , err := parseID (pid )
801
+ if err != nil {
802
+ return nil , nil , err
803
+ }
804
+ u := fmt .Sprintf ("projects/%s/integrations/gitlab-slack-application" , PathEscape (project ))
805
+
806
+ req , err := s .client .NewRequest (http .MethodGet , u , nil , options )
807
+ if err != nil {
808
+ return nil , nil , err
809
+ }
810
+
811
+ svc := new (SlackApplication )
812
+ resp , err := s .client .Do (req , svc )
813
+ if err != nil {
814
+ return nil , resp , err
815
+ }
816
+
817
+ return svc , resp , nil
818
+ }
819
+
820
+ // SetSlackApplicationOptions represents the available SetSlackApplication()
821
+ // options.
822
+ //
823
+ // GitLab API docs:
824
+ // https://docs.gitlab.com/ee/api/integrations.html#set-up-gitlab-for-slack-app
825
+ type SetSlackApplicationOptions struct {
826
+ Channel * string `url:"channel,omitempty" json:"channel,omitempty"`
827
+ NotifyOnlyBrokenPipelines * bool `url:"notify_only_broken_pipelines,omitempty" json:"notify_only_broken_pipelines,omitempty"`
828
+ BranchesToBeNotified * string `url:"branches_to_be_notified,omitempty" json:"branches_to_be_notified,omitempty"`
829
+ AlertEvents * bool `url:"alert_events,omitempty" json:"alert_events,omitempty"`
830
+ IssuesEvents * bool `url:"issues_events,omitempty" json:"issues_events,omitempty"`
831
+ ConfidentialIssuesEvents * bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
832
+ MergeRequestsEvents * bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
833
+ NoteEvents * bool `url:"note_events,omitempty" json:"note_events,omitempty"`
834
+ ConfidentialNoteEvents * bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"`
835
+ DeploymentEvents * bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
836
+ IncidentsEvents * bool `url:"incidents_events,omitempty" json:"incidents_events,omitempty"`
837
+ PipelineEvents * bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
838
+ PushEvents * bool `url:"push_events,omitempty" json:"push_events,omitempty"`
839
+ TagPushEvents * bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
840
+ VulnerabilityEvents * bool `url:"vulnerability_events,omitempty" json:"vulnerability_events,omitempty"`
841
+ WikiPageEvents * bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
842
+
843
+ // Deprecated: This parameter has been replaced with BranchesToBeNotified.
844
+ NotifyOnlyDefaultBranch * bool `url:"notify_only_default_branch,omitempty" json:"notify_only_default_branch,omitempty"`
845
+ }
846
+
847
+ // SetSlackApplication update the GitLab for Slack app integration for a project.
848
+ //
849
+ // GitLab API docs:
850
+ // https://docs.gitlab.com/ee/api/integrations.html#set-up-gitlab-for-slack-app
851
+ func (s * ServicesService ) SetSlackApplication (pid interface {}, opt * SetSlackApplicationOptions , options ... RequestOptionFunc ) (* Response , error ) {
852
+ project , err := parseID (pid )
853
+ if err != nil {
854
+ return nil , err
855
+ }
856
+ u := fmt .Sprintf ("projects/%s/integrations/gitlab-slack-application" , PathEscape (project ))
857
+
858
+ req , err := s .client .NewRequest (http .MethodPut , u , opt , options )
859
+ if err != nil {
860
+ return nil , err
861
+ }
862
+
863
+ return s .client .Do (req , nil )
864
+ }
865
+
866
+ // DisableSlackApplication disable the GitLab for Slack app integration for a project.
867
+ //
868
+ // GitLab API docs:
869
+ // https://docs.gitlab.com/ee/api/integrations.html#disable-gitlab-for-slack-app
870
+ func (s * ServicesService ) DisableSlackApplication (pid interface {}, options ... RequestOptionFunc ) (* Response , error ) {
871
+ project , err := parseID (pid )
872
+ if err != nil {
873
+ return nil , err
874
+ }
875
+ u := fmt .Sprintf ("projects/%s/integrations/gitlab-slack-application" , PathEscape (project ))
876
+
877
+ req , err := s .client .NewRequest (http .MethodDelete , u , nil , options )
878
+ if err != nil {
879
+ return nil , err
880
+ }
881
+
882
+ return s .client .Do (req , nil )
883
+ }
884
+
759
885
// SetGitLabCIServiceOptions represents the available SetGitLabCIService()
760
886
// options.
761
887
//
0 commit comments