@@ -1094,6 +1094,54 @@ def http_put(
1094
1094
error_message = "Failed to parse the server message"
1095
1095
) from e
1096
1096
1097
+ def http_patch (
1098
+ self ,
1099
+ path : str ,
1100
+ * ,
1101
+ query_data : Optional [Dict [str , Any ]] = None ,
1102
+ post_data : Optional [Union [Dict [str , Any ], bytes ]] = None ,
1103
+ raw : bool = False ,
1104
+ ** kwargs : Any ,
1105
+ ) -> Union [Dict [str , Any ], requests .Response ]:
1106
+ """Make a PATCH request to the Gitlab server.
1107
+
1108
+ Args:
1109
+ path: Path or full URL to query ('/projects' or
1110
+ 'http://whatever/v4/api/projecs')
1111
+ query_data: Data to send as query parameters
1112
+ post_data: Data to send in the body (will be converted to
1113
+ json by default)
1114
+ raw: If True, do not convert post_data to json
1115
+ **kwargs: Extra options to send to the server (e.g. sudo)
1116
+
1117
+ Returns:
1118
+ The parsed json returned by the server.
1119
+
1120
+ Raises:
1121
+ GitlabHttpError: When the return code is not 2xx
1122
+ GitlabParsingError: If the json data could not be parsed
1123
+ """
1124
+ query_data = query_data or {}
1125
+ post_data = post_data or {}
1126
+
1127
+ result = self .http_request (
1128
+ "patch" ,
1129
+ path ,
1130
+ query_data = query_data ,
1131
+ post_data = post_data ,
1132
+ raw = raw ,
1133
+ ** kwargs ,
1134
+ )
1135
+ try :
1136
+ json_result = result .json ()
1137
+ if TYPE_CHECKING :
1138
+ assert isinstance (json_result , dict )
1139
+ return json_result
1140
+ except Exception as e :
1141
+ raise gitlab .exceptions .GitlabParsingError (
1142
+ error_message = "Failed to parse the server message"
1143
+ ) from e
1144
+
1097
1145
def http_delete (self , path : str , ** kwargs : Any ) -> requests .Response :
1098
1146
"""Make a DELETE request to the Gitlab server.
1099
1147
0 commit comments