python-gitlab 4.9.0__py3-none-any.whl → 4.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gitlab/_version.py CHANGED
@@ -3,4 +3,4 @@ __copyright__ = "Copyright 2013-2019 Gauvain Pocentek, 2019-2023 python-gitlab t
3
3
  __email__ = "gauvainpocentek@gmail.com"
4
4
  __license__ = "LGPL3"
5
5
  __title__ = "python-gitlab"
6
- __version__ = "4.9.0"
6
+ __version__ = "4.10.0"
gitlab/exceptions.py CHANGED
@@ -316,6 +316,10 @@ class GitlabDeploymentApprovalError(GitlabOperationError):
316
316
  pass
317
317
 
318
318
 
319
+ class GitlabHookTestError(GitlabOperationError):
320
+ pass
321
+
322
+
319
323
  # For an explanation of how these type-hints work see:
320
324
  # https://mypy.readthedocs.io/en/stable/generics.html#declaring-decorators
321
325
  #
@@ -370,6 +374,7 @@ __all__ = [
370
374
  "GitlabGetError",
371
375
  "GitlabGroupTransferError",
372
376
  "GitlabHeadError",
377
+ "GitlabHookTestError",
373
378
  "GitlabHousekeepingError",
374
379
  "GitlabHttpError",
375
380
  "GitlabImportError",
@@ -1,5 +1,6 @@
1
1
  from typing import Any, cast, Union
2
2
 
3
+ from gitlab import exceptions as exc
3
4
  from gitlab.base import RESTManager, RESTObject
4
5
  from gitlab.mixins import CRUDMixin, NoUpdateMixin, ObjectDeleteMixin, SaveMixin
5
6
  from gitlab.types import RequiredOptional
@@ -31,6 +32,20 @@ class HookManager(NoUpdateMixin, RESTManager):
31
32
  class ProjectHook(SaveMixin, ObjectDeleteMixin, RESTObject):
32
33
  _repr_attr = "url"
33
34
 
35
+ @exc.on_http_error(exc.GitlabHookTestError)
36
+ def test(self, trigger: str) -> None:
37
+ """
38
+ Test a Project Hook
39
+
40
+ Args:
41
+ trigger: Type of trigger event to test
42
+
43
+ Raises:
44
+ GitlabHookTestError: If the hook test attempt failed
45
+ """
46
+ path = f"{self.manager.path}/{self.encoded_id}/test/{trigger}"
47
+ self.manager.gitlab.http_post(path)
48
+
34
49
 
35
50
  class ProjectHookManager(CRUDMixin, RESTManager):
36
51
  _path = "/projects/{project_id}/hooks"
@@ -78,6 +93,20 @@ class ProjectHookManager(CRUDMixin, RESTManager):
78
93
  class GroupHook(SaveMixin, ObjectDeleteMixin, RESTObject):
79
94
  _repr_attr = "url"
80
95
 
96
+ @exc.on_http_error(exc.GitlabHookTestError)
97
+ def test(self, trigger: str) -> None:
98
+ """
99
+ Test a Group Hook
100
+
101
+ Args:
102
+ trigger: Type of trigger event to test
103
+
104
+ Raises:
105
+ GitlabHookTestError: If the hook test attempt failed
106
+ """
107
+ path = f"{self.manager.path}/{self.encoded_id}/test/{trigger}"
108
+ self.manager.gitlab.http_post(path)
109
+
81
110
 
82
111
  class GroupHookManager(CRUDMixin, RESTManager):
83
112
  _path = "/groups/{group_id}/hooks"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-gitlab
3
- Version: 4.9.0
3
+ Version: 4.10.0
4
4
  Summary: A python wrapper for the GitLab API
5
5
  Author-email: Gauvain Pocentek <gauvain@pocentek.net>
6
6
  Maintainer-email: John Villalovos <john@sodarock.com>, Max Wittig <max.wittig@siemens.com>, Nejc Habjan <nejc.habjan@siemens.com>, Roger Meier <r.meier@siemens.com>
@@ -1,12 +1,12 @@
1
1
  gitlab/__init__.py,sha256=bd8BSLyUUjtHMKtzmf-T5855W6FUHcuhIwx2hNu0w2o,1382
2
2
  gitlab/__main__.py,sha256=HTesNl0UAU6mPb9EXWkTKMy6Q6pAUxGi3iPnDHTE2uE,68
3
- gitlab/_version.py,sha256=8WblZEmwtyX2c4VXUoXvIs7Z3e6CE5dlH-tV99io0nc,249
3
+ gitlab/_version.py,sha256=C2if8HKzMGs_l0KkoB0yUyEdcIgWXwepCAiMYKCptLo,250
4
4
  gitlab/base.py,sha256=5cotawlHD01Vw88aN4o7wNIhDyk_bmcwubX4mbOpnVo,13780
5
5
  gitlab/cli.py,sha256=d3-LtZuA1Fgon5wZWn4c3E70fTIu4mM4Juyhh3F8EBs,12416
6
6
  gitlab/client.py,sha256=fPezDHNi4kJxzGxGeDWOWsKmKy76wVR4-fteCgDrY4I,49296
7
7
  gitlab/config.py,sha256=T1DgUXD0-MN2qNszrv-SO5d4uy0FITnNN0vWJgOt2yo,9088
8
8
  gitlab/const.py,sha256=rtPU-fxVSOvgpueoQVTvZGQp6iAZ-aa3nsY4RcSs_M4,5352
9
- gitlab/exceptions.py,sha256=Ruz9LusKMRu6SyV1vXpOu_UTCi3XU64A9BeHsqKASOw,8303
9
+ gitlab/exceptions.py,sha256=VOQftPzEq5mpVj6vke7z6Xe4S7Yf_rDTab0lNHqf3AY,8390
10
10
  gitlab/mixins.py,sha256=7iPlzqGmd5Ew2RLzRzRWsJ4r8Bn6wteUj791BJrjtXc,36645
11
11
  gitlab/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  gitlab/types.py,sha256=lepiiI_YOr94B4koqIHuY70tszZC_X3YW4lDvbadbI8,3312
@@ -48,7 +48,7 @@ gitlab/v4/objects/files.py,sha256=9M7pocu_n9JDRAPu5BqIt398emYD5WVnGh3wAJinPX8,10
48
48
  gitlab/v4/objects/geo_nodes.py,sha256=tD9piU7OIZgbNQRUeLTFPtAJ6PVL_SI6tR_zh6Tm2M8,3686
49
49
  gitlab/v4/objects/group_access_tokens.py,sha256=EijY0sfsp0Gtx_q4JLBeLL3jphx5b_6-nTzKxV272jc,1023
50
50
  gitlab/v4/objects/groups.py,sha256=YxOeaRYUjhu8PicCicVT7Eua04YuyOLAc8J13V7r9Gg,15958
51
- gitlab/v4/objects/hooks.py,sha256=1uDYi09GOmgR6t7gVT06CeMGL0ZZ1N5swz1KMtsybDk,3598
51
+ gitlab/v4/objects/hooks.py,sha256=ig8qyC6ZWpZXqcGYCSS7LVvTpD1xnLkNNtfJAOXeYv8,4445
52
52
  gitlab/v4/objects/integrations.py,sha256=QWl5ZnE1oivt4ho9qJa_o268ORdaW35D4klBRy1jUyQ,9229
53
53
  gitlab/v4/objects/invitations.py,sha256=ya9x7xhL1oSbx-FLJud-lHKmbYQoTplZlAbjsZip2CI,2734
54
54
  gitlab/v4/objects/issues.py,sha256=kxciXrLGxCsevJ2eoxpDdMLnw1kF4VrQTy4YB4AoN1U,10393
@@ -94,10 +94,10 @@ gitlab/v4/objects/triggers.py,sha256=UAERq_C-QdPBbBQPHLh5IfhpkdDeIxdnVGPHfu9Qy5Y
94
94
  gitlab/v4/objects/users.py,sha256=_gGrTwcE17jeoXIPgfFSv54jtF1_9C1R0Y0hhssTvXY,21381
95
95
  gitlab/v4/objects/variables.py,sha256=S0Vz32jEpUbo4J2js8gMPPTVpcy1ge5FYVHLiPz9c-A,2627
96
96
  gitlab/v4/objects/wikis.py,sha256=JtI1cQqZV1_PRfKVlQRMh4LZjdxEfi9T2VuFYv6PrV8,1775
97
- python_gitlab-4.9.0.dist-info/AUTHORS,sha256=Z0P61GJSVnp7iFbRcMezhx3f4zMyPkVmG--TWaRo768,526
98
- python_gitlab-4.9.0.dist-info/COPYING,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
99
- python_gitlab-4.9.0.dist-info/METADATA,sha256=IRtLbkQzDvBZ5PfUV0aoYo8Z_AchFifHacjgnmBY7Ik,8228
100
- python_gitlab-4.9.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
101
- python_gitlab-4.9.0.dist-info/entry_points.txt,sha256=nhpKLLP_uQPFByn8UtE9zsvQQwa402t52o_Cw9IFXMo,43
102
- python_gitlab-4.9.0.dist-info/top_level.txt,sha256=MvIaP8p_Oaf4gO_hXmHkX-5y2deHLp1pe6tJR3ukQ6o,7
103
- python_gitlab-4.9.0.dist-info/RECORD,,
97
+ python_gitlab-4.10.0.dist-info/AUTHORS,sha256=Z0P61GJSVnp7iFbRcMezhx3f4zMyPkVmG--TWaRo768,526
98
+ python_gitlab-4.10.0.dist-info/COPYING,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
99
+ python_gitlab-4.10.0.dist-info/METADATA,sha256=11-PatLY4p9_VyEBKOAU4MWJcYVPn3YjnifSnxeLZlg,8229
100
+ python_gitlab-4.10.0.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
101
+ python_gitlab-4.10.0.dist-info/entry_points.txt,sha256=nhpKLLP_uQPFByn8UtE9zsvQQwa402t52o_Cw9IFXMo,43
102
+ python_gitlab-4.10.0.dist-info/top_level.txt,sha256=MvIaP8p_Oaf4gO_hXmHkX-5y2deHLp1pe6tJR3ukQ6o,7
103
+ python_gitlab-4.10.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.1.0)
2
+ Generator: setuptools (74.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5