|
1 | | -from typing import Any, cast, Dict, Optional, TYPE_CHECKING, Union |
| 1 | +from typing import Any, cast, Dict, Optional, Union |
2 | 2 |
|
3 | 3 | from gitlab import exceptions as exc |
4 | 4 | from gitlab.base import RequiredOptional, RESTManager, RESTObject |
@@ -78,25 +78,6 @@ def update( # type: ignore |
78 | 78 | new_data["name"] = name |
79 | 79 | return super().update(id=None, new_data=new_data, **kwargs) |
80 | 80 |
|
81 | | - # Delete without ID. |
82 | | - @exc.on_http_error(exc.GitlabDeleteError) |
83 | | - # NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore |
84 | | - # type error |
85 | | - def delete(self, name: str, **kwargs: Any) -> None: # type: ignore |
86 | | - """Delete a Label on the server. |
87 | | -
|
88 | | - Args: |
89 | | - name: The name of the label |
90 | | - **kwargs: Extra options to send to the server (e.g. sudo) |
91 | | -
|
92 | | - Raises: |
93 | | - GitlabAuthenticationError: If authentication is not correct |
94 | | - GitlabDeleteError: If the server cannot perform the request |
95 | | - """ |
96 | | - if TYPE_CHECKING: |
97 | | - assert self.path is not None |
98 | | - self.gitlab.http_delete(self.path, query_data={"name": name}, **kwargs) |
99 | | - |
100 | 81 |
|
101 | 82 | class ProjectLabel( |
102 | 83 | PromoteMixin, SubscribableMixin, SaveMixin, ObjectDeleteMixin, RESTObject |
@@ -162,22 +143,3 @@ def update( # type: ignore |
162 | 143 | if name: |
163 | 144 | new_data["name"] = name |
164 | 145 | return super().update(id=None, new_data=new_data, **kwargs) |
165 | | - |
166 | | - # Delete without ID. |
167 | | - @exc.on_http_error(exc.GitlabDeleteError) |
168 | | - # NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore |
169 | | - # type error |
170 | | - def delete(self, name: str, **kwargs: Any) -> None: # type: ignore |
171 | | - """Delete a Label on the server. |
172 | | -
|
173 | | - Args: |
174 | | - name: The name of the label |
175 | | - **kwargs: Extra options to send to the server (e.g. sudo) |
176 | | -
|
177 | | - Raises: |
178 | | - GitlabAuthenticationError: If authentication is not correct |
179 | | - GitlabDeleteError: If the server cannot perform the request |
180 | | - """ |
181 | | - if TYPE_CHECKING: |
182 | | - assert self.path is not None |
183 | | - self.gitlab.http_delete(self.path, query_data={"name": name}, **kwargs) |
0 commit comments