@@ -39,21 +39,21 @@ class Gitlab(object):
39
39
"""Represents a GitLab server connection.
40
40
41
41
Args:
42
- url (str) : The URL of the GitLab server (defaults to https://gitlab.com).
43
- private_token (str) : The user private token
44
- oauth_token (str) : An oauth token
45
- job_token (str) : A CI job token
46
- ssl_verify (bool|str) : Whether SSL certificates should be validated. If
42
+ url: The URL of the GitLab server (defaults to https://gitlab.com).
43
+ private_token: The user private token
44
+ oauth_token: An oauth token
45
+ job_token: A CI job token
46
+ ssl_verify: Whether SSL certificates should be validated. If
47
47
the value is a string, it is the path to a CA file used for
48
48
certificate validation.
49
- timeout (float) : Timeout to use for requests to the GitLab server.
50
- http_username (str) : Username for HTTP authentication
51
- http_password (str) : Password for HTTP authentication
52
- api_version (str) : Gitlab API version to use (support for 4 only)
53
- pagination (str) : Can be set to 'keyset' to use keyset pagination
54
- order_by (str) : Set order_by globally
55
- user_agent (str) : A custom user agent to use for making HTTP requests.
56
- retry_transient_errors (bool) : Whether to retry after 500, 502, 503, or
49
+ timeout: Timeout to use for requests to the GitLab server.
50
+ http_username: Username for HTTP authentication
51
+ http_password: Password for HTTP authentication
52
+ api_version: Gitlab API version to use (support for 4 only)
53
+ pagination: Can be set to 'keyset' to use keyset pagination
54
+ order_by: Set order_by globally
55
+ user_agent: A custom user agent to use for making HTTP requests.
56
+ retry_transient_errors: Whether to retry after 500, 502, 503, or
57
57
504 responses. Defaults to False.
58
58
"""
59
59
@@ -225,11 +225,11 @@ def from_config(
225
225
"""Create a Gitlab connection from configuration files.
226
226
227
227
Args:
228
- gitlab_id (str) : ID of the configuration section.
228
+ gitlab_id: ID of the configuration section.
229
229
config_files list[str]: List of paths to configuration files.
230
230
231
231
Returns:
232
- (gitlab.Gitlab): A Gitlab connection.
232
+ A Gitlab connection.
233
233
234
234
Raises:
235
235
gitlab.config.GitlabDataError: If the configuration is not correct.
@@ -269,7 +269,7 @@ def version(self) -> Tuple[str, str]:
269
269
object.
270
270
271
271
Returns:
272
- tuple (str, str) : The server version and server revision.
272
+ tuple: The server version and server revision.
273
273
('unknown', 'unknwown') if the server doesn't
274
274
perform as expected.
275
275
"""
@@ -293,7 +293,7 @@ def lint(self, content: str, **kwargs: Any) -> Tuple[bool, List[str]]:
293
293
"""Validate a gitlab CI configuration.
294
294
295
295
Args:
296
- content (txt) : The .gitlab-ci.yml content
296
+ content: The .gitlab-ci.yml content
297
297
**kwargs: Extra options to send to the server (e.g. sudo)
298
298
299
299
Raises:
@@ -317,11 +317,9 @@ def markdown(
317
317
"""Render an arbitrary Markdown document.
318
318
319
319
Args:
320
- text (str): The markdown text to render
321
- gfm (bool): Render text using GitLab Flavored Markdown. Default is
322
- False
323
- project (str): Full path of a project used a context when `gfm` is
324
- True
320
+ text: The markdown text to render
321
+ gfm: Render text using GitLab Flavored Markdown. Default is False
322
+ project: Full path of a project used a context when `gfm` is True
325
323
**kwargs: Extra options to send to the server (e.g. sudo)
326
324
327
325
Raises:
@@ -363,7 +361,7 @@ def set_license(self, license: str, **kwargs: Any) -> Dict[str, Any]:
363
361
"""Add a new license.
364
362
365
363
Args:
366
- license (str) : The license string
364
+ license: The license string
367
365
**kwargs: Extra options to send to the server (e.g. sudo)
368
366
369
367
Raises:
@@ -541,20 +539,19 @@ def http_request(
541
539
"""Make an HTTP request to the Gitlab server.
542
540
543
541
Args:
544
- verb (str): The HTTP method to call ('get', 'post', 'put',
545
- 'delete')
546
- path (str): Path or full URL to query ('/projects' or
542
+ verb: The HTTP method to call ('get', 'post', 'put', 'delete')
543
+ path: Path or full URL to query ('/projects' or
547
544
'http://whatever/v4/api/projecs')
548
- query_data (dict) : Data to send as query parameters
549
- post_data (dict|bytes) : Data to send in the body (will be converted to
545
+ query_data: Data to send as query parameters
546
+ post_data: Data to send in the body (will be converted to
550
547
json by default)
551
- raw (bool) : If True, do not convert post_data to json
552
- streamed (bool) : Whether the data should be streamed
553
- files (dict) : The files to send to the server
554
- timeout (float) : The timeout, in seconds, for the request
555
- obey_rate_limit (bool) : Whether to obey 429 Too Many Request
548
+ raw: If True, do not convert post_data to json
549
+ streamed: Whether the data should be streamed
550
+ files: The files to send to the server
551
+ timeout: The timeout, in seconds, for the request
552
+ obey_rate_limit: Whether to obey 429 Too Many Request
556
553
responses. Defaults to True.
557
- max_retries (int) : Max retries after 429 or transient errors,
554
+ max_retries: Max retries after 429 or transient errors,
558
555
set to -1 to retry forever. Defaults to 10.
559
556
**kwargs: Extra options to send to the server (e.g. sudo)
560
557
@@ -667,11 +664,11 @@ def http_get(
667
664
"""Make a GET request to the Gitlab server.
668
665
669
666
Args:
670
- path (str) : Path or full URL to query ('/projects' or
667
+ path: Path or full URL to query ('/projects' or
671
668
'http://whatever/v4/api/projecs')
672
- query_data (dict) : Data to send as query parameters
673
- streamed (bool) : Whether the data should be streamed
674
- raw (bool) : If True do not try to parse the output as json
669
+ query_data: Data to send as query parameters
670
+ streamed: Whether the data should be streamed
671
+ raw: If True do not try to parse the output as json
675
672
**kwargs: Extra options to send to the server (e.g. sudo)
676
673
677
674
Returns:
@@ -712,9 +709,9 @@ def http_list(
712
709
"""Make a GET request to the Gitlab server for list-oriented queries.
713
710
714
711
Args:
715
- path (str) : Path or full URL to query ('/projects' or
712
+ path: Path or full URL to query ('/projects' or
716
713
'http://whatever/v4/api/projects')
717
- query_data (dict) : Data to send as query parameters
714
+ query_data: Data to send as query parameters
718
715
**kwargs: Extra options to send to the server (e.g. sudo, page,
719
716
per_page)
720
717
@@ -761,13 +758,13 @@ def http_post(
761
758
"""Make a POST request to the Gitlab server.
762
759
763
760
Args:
764
- path (str) : Path or full URL to query ('/projects' or
761
+ path: Path or full URL to query ('/projects' or
765
762
'http://whatever/v4/api/projecs')
766
- query_data (dict) : Data to send as query parameters
767
- post_data (dict) : Data to send in the body (will be converted to
763
+ query_data: Data to send as query parameters
764
+ post_data: Data to send in the body (will be converted to
768
765
json by default)
769
- raw (bool) : If True, do not convert post_data to json
770
- files (dict) : The files to send to the server
766
+ raw: If True, do not convert post_data to json
767
+ files: The files to send to the server
771
768
**kwargs: Extra options to send to the server (e.g. sudo)
772
769
773
770
Returns:
@@ -810,13 +807,13 @@ def http_put(
810
807
"""Make a PUT request to the Gitlab server.
811
808
812
809
Args:
813
- path (str) : Path or full URL to query ('/projects' or
810
+ path: Path or full URL to query ('/projects' or
814
811
'http://whatever/v4/api/projecs')
815
- query_data (dict) : Data to send as query parameters
816
- post_data (dict|bytes) : Data to send in the body (will be converted to
812
+ query_data: Data to send as query parameters
813
+ post_data: Data to send in the body (will be converted to
817
814
json by default)
818
- raw (bool) : If True, do not convert post_data to json
819
- files (dict) : The files to send to the server
815
+ raw: If True, do not convert post_data to json
816
+ files: The files to send to the server
820
817
**kwargs: Extra options to send to the server (e.g. sudo)
821
818
822
819
Returns:
@@ -849,7 +846,7 @@ def http_delete(self, path: str, **kwargs: Any) -> requests.Response:
849
846
"""Make a DELETE request to the Gitlab server.
850
847
851
848
Args:
852
- path (str) : Path or full URL to query ('/projects' or
849
+ path: Path or full URL to query ('/projects' or
853
850
'http://whatever/v4/api/projecs')
854
851
**kwargs: Extra options to send to the server (e.g. sudo)
855
852
@@ -868,8 +865,8 @@ def search(
868
865
"""Search GitLab resources matching the provided string.'
869
866
870
867
Args:
871
- scope (str) : Scope of the search
872
- search (str) : Search string
868
+ scope: Scope of the search
869
+ search: Search string
873
870
**kwargs: Extra options to send to the server (e.g. sudo)
874
871
875
872
Raises:
0 commit comments