@@ -1166,6 +1166,97 @@ type SetMattermostServiceOptions struct {
1166
1166
WikiPageChannel * string `url:"wiki_page_channel,omitempty" json:"wiki_page_channel,omitempty"`
1167
1167
}
1168
1168
1169
+ // MattermostSlashCommandsService represents Mattermost slash commands settings.
1170
+ //
1171
+ // GitLab API docs:
1172
+ // https://docs.gitlab.com/ee/api/integrations.html#mattermost-slash-commands
1173
+ type MattermostSlashCommandsService struct {
1174
+ Service
1175
+ Properties * MattermostSlashCommandsProperties `json:"properties"`
1176
+ }
1177
+
1178
+ // MattermostSlashCommandsProperties represents Mattermost slash commands specific properties.
1179
+ //
1180
+ // GitLab API docs:
1181
+ // https://docs.gitlab.com/ee/api/integrations.html#mattermost-slash-commands
1182
+ type MattermostSlashCommandsProperties struct {
1183
+ Token string `json:"token"`
1184
+ Username string `json:"username,omitempty"`
1185
+ }
1186
+
1187
+ // GetMattermostSlashCommandsService gets Slack Mattermost commands service settings for a project.
1188
+ //
1189
+ // GitLab API docs:
1190
+ // https://docs.gitlab.com/ee/api/integrations.html#get-mattermost-slash-command-integration-settings
1191
+ func (s * ServicesService ) GetMattermostSlashCommandsService (pid interface {}, options ... RequestOptionFunc ) (* MattermostSlashCommandsService , * Response , error ) {
1192
+ project , err := parseID (pid )
1193
+ if err != nil {
1194
+ return nil , nil , err
1195
+ }
1196
+ u := fmt .Sprintf ("projects/%s/services/mattermost-slash-commands" , PathEscape (project ))
1197
+
1198
+ req , err := s .client .NewRequest (http .MethodGet , u , nil , options )
1199
+ if err != nil {
1200
+ return nil , nil , err
1201
+ }
1202
+
1203
+ svc := new (MattermostSlashCommandsService )
1204
+ resp , err := s .client .Do (req , svc )
1205
+ if err != nil {
1206
+ return nil , resp , err
1207
+ }
1208
+
1209
+ return svc , resp , nil
1210
+ }
1211
+
1212
+ // SetMattermostSlashCommandsServiceOptions represents the available SetSlackSlashCommandsService()
1213
+ // options.
1214
+ //
1215
+ // GitLab API docs:
1216
+ // https://docs.gitlab.com/ee/api/integrations.html#get-mattermost-slash-command-integration-settings
1217
+ type SetMattermostSlashCommandsServiceOptions struct {
1218
+ Token * string `url:"token,omitempty" json:"token,omitempty"`
1219
+ Username * string `url:"username,omitempty" json:"username,omitempty"`
1220
+ }
1221
+
1222
+ // SetMattermostSlashCommandsService sets Mattermost slash commands service for a project
1223
+ //
1224
+ // GitLab API docs:
1225
+ // https://docs.gitlab.com/ee/api/integrations.html#createedit-mattermost-slash-command-integration
1226
+ func (s * ServicesService ) SetMattermostSlashCommandsService (pid interface {}, opt * SetMattermostSlashCommandsServiceOptions , options ... RequestOptionFunc ) (* Response , error ) {
1227
+ project , err := parseID (pid )
1228
+ if err != nil {
1229
+ return nil , err
1230
+ }
1231
+ u := fmt .Sprintf ("projects/%s/services/mattermost-slash-commands" , PathEscape (project ))
1232
+
1233
+ req , err := s .client .NewRequest (http .MethodPut , u , opt , options )
1234
+ if err != nil {
1235
+ return nil , err
1236
+ }
1237
+
1238
+ return s .client .Do (req , nil )
1239
+ }
1240
+
1241
+ // DeleteMattermostSlashCommandsService deletes Mattermost slash commands service for project.
1242
+ //
1243
+ // GitLab API docs:
1244
+ // https://docs.gitlab.com/ee/api/integrations.html#disable-mattermost-slash-command-integration
1245
+ func (s * ServicesService ) DeleteMattermostSlashCommandsService (pid interface {}, options ... RequestOptionFunc ) (* Response , error ) {
1246
+ project , err := parseID (pid )
1247
+ if err != nil {
1248
+ return nil , err
1249
+ }
1250
+ u := fmt .Sprintf ("projects/%s/services/mattermost-slash-commands" , PathEscape (project ))
1251
+
1252
+ req , err := s .client .NewRequest (http .MethodDelete , u , nil , options )
1253
+ if err != nil {
1254
+ return nil , err
1255
+ }
1256
+
1257
+ return s .client .Do (req , nil )
1258
+ }
1259
+
1169
1260
// SetMattermostService sets Mattermost service for a project.
1170
1261
//
1171
1262
// GitLab API docs:
@@ -1725,41 +1816,42 @@ func (s *ServicesService) DeleteSlackSlashCommandsService(pid interface{}, optio
1725
1816
return s .client .Do (req , nil )
1726
1817
}
1727
1818
1728
- // MattermostSlashCommandsService represents Mattermost slash commands settings.
1819
+ // TelegramService represents Telegram service settings.
1729
1820
//
1730
- // GitLab API docs:
1731
- // https://docs.gitlab.com/ee/api/integrations.html#mattermost-slash-commands
1732
- type MattermostSlashCommandsService struct {
1821
+ // Gitlab API docs:
1822
+ // https://docs.gitlab.com/ee/api/integrations.html#telegram
1823
+ type TelegramService struct {
1733
1824
Service
1734
- Properties * MattermostSlashCommandsProperties `json:"properties"`
1825
+ Properties * TelegramServiceProperties `json:"properties"`
1735
1826
}
1736
1827
1737
- // MattermostSlashCommandsProperties represents Mattermost slash commands specific properties.
1828
+ // TelegramServiceProperties represents Telegram specific properties.
1738
1829
//
1739
1830
// GitLab API docs:
1740
- // https://docs.gitlab.com/ee/api/integrations.html#mattermost-slash-commands
1741
- type MattermostSlashCommandsProperties struct {
1742
- Token string `json:"token"`
1743
- Username string `json:"username,omitempty"`
1831
+ // https://docs.gitlab.com/ee/api/integrations.html#set-up-telegram
1832
+ type TelegramServiceProperties struct {
1833
+ Room string `json:"room"`
1834
+ NotifyOnlyBrokenPipelines bool `json:"notify_only_broken_pipelines"`
1835
+ BranchesToBeNotified string `json:"branches_to_be_notified"`
1744
1836
}
1745
1837
1746
- // GetMattermostSlashCommandsService gets Slack Mattermost commands service settings for a project.
1838
+ // GetTelegramService gets MicrosoftTeams service settings for a project.
1747
1839
//
1748
1840
// GitLab API docs:
1749
- // https://docs.gitlab.com/ee/api/integrations.html#get-mattermost-slash-command-integration -settings
1750
- func (s * ServicesService ) GetMattermostSlashCommandsService (pid interface {}, options ... RequestOptionFunc ) (* MattermostSlashCommandsService , * Response , error ) {
1841
+ // https://docs.gitlab.com/ee/api/integrations.html#get-telegram -settings
1842
+ func (s * ServicesService ) GetTelegramService (pid interface {}, options ... RequestOptionFunc ) (* TelegramService , * Response , error ) {
1751
1843
project , err := parseID (pid )
1752
1844
if err != nil {
1753
1845
return nil , nil , err
1754
1846
}
1755
- u := fmt .Sprintf ("projects/%s/services/mattermost-slash-commands " , PathEscape (project ))
1847
+ u := fmt .Sprintf ("projects/%s/services/telegram " , PathEscape (project ))
1756
1848
1757
1849
req , err := s .client .NewRequest (http .MethodGet , u , nil , options )
1758
1850
if err != nil {
1759
1851
return nil , nil , err
1760
1852
}
1761
1853
1762
- svc := new (MattermostSlashCommandsService )
1854
+ svc := new (TelegramService )
1763
1855
resp , err := s .client .Do (req , svc )
1764
1856
if err != nil {
1765
1857
return nil , resp , err
@@ -1768,26 +1860,37 @@ func (s *ServicesService) GetMattermostSlashCommandsService(pid interface{}, opt
1768
1860
return svc , resp , nil
1769
1861
}
1770
1862
1771
- // SetMattermostSlashCommandsServiceOptions represents the available SetSlackSlashCommandsService ()
1863
+ // SetTelegramServiceOptions represents the available SetTelegramService ()
1772
1864
// options.
1773
1865
//
1774
1866
// GitLab API docs:
1775
- // https://docs.gitlab.com/ee/api/integrations.html#get-mattermost-slash-command-integration-settings
1776
- type SetMattermostSlashCommandsServiceOptions struct {
1777
- Token * string `url:"token,omitempty" json:"token,omitempty"`
1778
- Username * string `url:"username,omitempty" json:"username,omitempty"`
1867
+ // https://docs.gitlab.com/ee/api/integrations.html#set-up-telegram
1868
+ type SetTelegramServiceOptions struct {
1869
+ Token * string `url:"token,omitempty" json:"token,omitempty"`
1870
+ Room * string `url:"room,omitempty" json:"room,omitempty"`
1871
+ NotifyOnlyBrokenPipelines * bool `url:"notify_only_broken_pipelines,omitempty" json:"notify_only_broken_pipelines,omitempty"`
1872
+ BranchesToBeNotified * string `url:"branches_to_be_notified,omitempty" json:"branches_to_be_notified,omitempty"`
1873
+ PushEvents * bool `url:"push_events,omitempty" json:"push_events,omitempty"`
1874
+ IssuesEvents * bool `url:"issues_events,omitempty" json:"issues_events,omitempty"`
1875
+ ConfidentialIssuesEvents * bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
1876
+ MergeRequestsEvents * bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
1877
+ TagPushEvents * bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
1878
+ NoteEvents * bool `url:"note_events,omitempty" json:"note_events,omitempty"`
1879
+ ConfidentialNoteEvents * bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"`
1880
+ PipelineEvents * bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
1881
+ WikiPageEvents * bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
1779
1882
}
1780
1883
1781
- // SetMattermostSlashCommandsService sets Mattermost slash commands service for a project
1884
+ // SetTelegramService sets Telegram service for a project
1782
1885
//
1783
1886
// GitLab API docs:
1784
- // https://docs.gitlab.com/ee/api/integrations.html#createedit-mattermost-slash-command-integration
1785
- func (s * ServicesService ) SetMattermostSlashCommandsService (pid interface {}, opt * SetMattermostSlashCommandsServiceOptions , options ... RequestOptionFunc ) (* Response , error ) {
1887
+ // https://docs.gitlab.com/ee/api/integrations.html#set-up-telegram
1888
+ func (s * ServicesService ) SetTelegramService (pid interface {}, opt * SetTelegramServiceOptions , options ... RequestOptionFunc ) (* Response , error ) {
1786
1889
project , err := parseID (pid )
1787
1890
if err != nil {
1788
1891
return nil , err
1789
1892
}
1790
- u := fmt .Sprintf ("projects/%s/services/mattermost-slash-commands " , PathEscape (project ))
1893
+ u := fmt .Sprintf ("projects/%s/services/telegram " , PathEscape (project ))
1791
1894
1792
1895
req , err := s .client .NewRequest (http .MethodPut , u , opt , options )
1793
1896
if err != nil {
@@ -1797,16 +1900,16 @@ func (s *ServicesService) SetMattermostSlashCommandsService(pid interface{}, opt
1797
1900
return s .client .Do (req , nil )
1798
1901
}
1799
1902
1800
- // DeleteMattermostSlashCommandsService deletes Mattermost slash commands service for project.
1903
+ // DeleteTelegramService deletes Telegram service for project.
1801
1904
//
1802
1905
// GitLab API docs:
1803
- // https://docs.gitlab.com/ee/api/integrations.html#disable-mattermost-slash-command-integration
1804
- func (s * ServicesService ) DeleteMattermostSlashCommandsService (pid interface {}, options ... RequestOptionFunc ) (* Response , error ) {
1906
+ // https://docs.gitlab.com/ee/api/integrations.html#disable-telegram
1907
+ func (s * ServicesService ) DeleteTelegramService (pid interface {}, options ... RequestOptionFunc ) (* Response , error ) {
1805
1908
project , err := parseID (pid )
1806
1909
if err != nil {
1807
1910
return nil , err
1808
1911
}
1809
- u := fmt .Sprintf ("projects/%s/services/mattermost-slash-commands " , PathEscape (project ))
1912
+ u := fmt .Sprintf ("projects/%s/services/telegram " , PathEscape (project ))
1810
1913
1811
1914
req , err := s .client .NewRequest (http .MethodDelete , u , nil , options )
1812
1915
if err != nil {
0 commit comments