| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e0f2290 commit 08e7d5d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -110,6 +110,9 @@ class GitlabMRClosedError(GitlabOperationError): | |||
| 110 | 110 | class GitlabMROnBuildSuccessError(GitlabOperationError): | |
| 111 | 111 | pass | |
| 112 | 112 | ||
| 113 | + class GitlabServiceSlackError(GitlabOperationError): | ||
| 114 | + pass | ||
| 115 | + | ||
| 113 | 116 | ||
| 114 | 117 | def raise_error_from_response(response, error, expected_code=200): | |
| 115 | 118 | """Tries to parse gitlab error message from response and raises error. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1956,6 +1956,11 @@ def update_file(self, path, branch, content, message, **kwargs): | |||
| 1956 | 1956 | r = self.gitlab._raw_put(url, data=None, content_type=None, **kwargs) | |
| 1957 | 1957 | raise_error_from_response(r, GitlabUpdateError) | |
| 1958 | 1958 | ||
| 1959 | + def slack_service(self, webhook, username=None, channel=None, **kwargs): | ||
| 1960 | + url = "/projects/%s/services/slack" % self.id | ||
| 1961 | + r = self.gitlab._raw_put(url, data={'webhook': webhook, 'username': username, 'channel': channel}, **kwargs) | ||
| 1962 | + raise_error_from_response(r, GitlabServiceSlackError) | ||
| 1963 | + | ||
| 1959 | 1964 | def delete_file(self, path, branch, message, **kwargs): | |
| 1960 | 1965 | warnings.warn("`delete_file` is deprecated, " | |
| 1961 | 1966 | "use `files.delete()` instead", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments