diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-24 01:36:48 +0100 |
---|---|---|
committer | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-24 01:36:48 +0100 |
commit | 81a392ca6e9b44444c0f1287139abe788d50119d (patch) | |
tree | 97e0f03be6f8819cb9b8a5dd0d46432ff6dfc5a4 /gitlab/v4/objects/snippets.py | |
parent | 7ba5995ed472997e6bf98e8ae58107af307a5615 (diff) | |
download | gitlab-chore/sphinx-annotations.tar.gz |
chore: deduplicate type annotations in docschore/sphinx-annotations
Diffstat (limited to 'gitlab/v4/objects/snippets.py')
-rw-r--r-- | gitlab/v4/objects/snippets.py | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/gitlab/v4/objects/snippets.py b/gitlab/v4/objects/snippets.py index 96b80c4..ca174a1 100644 --- a/gitlab/v4/objects/snippets.py +++ b/gitlab/v4/objects/snippets.py @@ -34,21 +34,21 @@ class Snippet(UserAgentDetailMixin, SaveMixin, ObjectDeleteMixin, RESTObject): ) -> Optional[bytes]: """Return the content of a snippet. - Args: - streamed (bool): If True the data will be processed by chunks of - `chunk_size` and each chunk is passed to `action` for - treatment. - action (callable): Callable responsible of dealing with chunk of - data - chunk_size (int): Size of each chunk - **kwargs: Extra options to send to the server (e.g. sudo) - - Raises: - GitlabAuthenticationError: If authentication is not correct - GitlabGetError: If the content could not be retrieved - - Returns: - str: The snippet content + Args: + streamed: If True the data will be processed by chunks of + `chunk_size` and each chunk is passed to `action` for + treatment. + action (callable): Callable responsible of dealing with chunk of + data + chunk_size: Size of each chunk + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabGetError: If the content could not be retrieved + + Returns: + The snippet content """ path = f"/snippets/{self.get_id()}/raw" result = self.manager.gitlab.http_get( @@ -74,14 +74,14 @@ class SnippetManager(CRUDMixin, RESTManager): """List all the public snippets. Args: - all (bool): If True the returned object will be a list + all: If True the returned object will be a list **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabListError: If the list could not be retrieved Returns: - RESTObjectList: A generator for the snippets list + A generator for the snippets list """ return self.list(path="/snippets/public", **kwargs) @@ -108,21 +108,21 @@ class ProjectSnippet(UserAgentDetailMixin, SaveMixin, ObjectDeleteMixin, RESTObj ) -> Optional[bytes]: """Return the content of a snippet. - Args: - streamed (bool): If True the data will be processed by chunks of - `chunk_size` and each chunk is passed to `action` for - treatment. - action (callable): Callable responsible of dealing with chunk of - data - chunk_size (int): Size of each chunk - **kwargs: Extra options to send to the server (e.g. sudo) - - Raises: - GitlabAuthenticationError: If authentication is not correct - GitlabGetError: If the content could not be retrieved - - Returns: - str: The snippet content + Args: + streamed: If True the data will be processed by chunks of + `chunk_size` and each chunk is passed to `action` for + treatment. + action (callable): Callable responsible of dealing with chunk of + data + chunk_size: Size of each chunk + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabGetError: If the content could not be retrieved + + Returns: + The snippet content """ path = f"{self.manager.path}/{self.get_id()}/raw" result = self.manager.gitlab.http_get( |