@@ -90,11 +90,35 @@ class SnippetManager(CRUDMixin, RESTManager):
9090 )
9191
9292 @cli .register_custom_action (cls_names = "SnippetManager" )
93- def public (self , ** kwargs : Any ) -> Union [RESTObjectList , List [RESTObject ]]:
94- """List all the public snippets.
93+ def list_public (self , ** kwargs : Any ) -> Union [RESTObjectList , List [RESTObject ]]:
94+ """List all public snippets.
95+
96+ Args:
97+ get_all: If True, return all the items, without pagination
98+ per_page: Number of items to retrieve per request
99+ page: ID of the page to return (starts with page 1)
100+ iterator: If set to True and no pagination option is
101+ defined, return a generator instead of a list
102+ **kwargs: Extra options to send to the server (e.g. sudo)
103+
104+ Raises:
105+ GitlabListError: If the list could not be retrieved
106+
107+ Returns:
108+ The list of snippets, or a generator if `iterator` is True
109+ """
110+ return self .list (path = "/snippets/public" , ** kwargs )
111+
112+ @cli .register_custom_action (cls_names = "SnippetManager" )
113+ def list_all (self , ** kwargs : Any ) -> Union [RESTObjectList , List [RESTObject ]]:
114+ """List all snippets.
95115
96116 Args:
97- all: If True the returned object will be a list
117+ get_all: If True, return all the items, without pagination
118+ per_page: Number of items to retrieve per request
119+ page: ID of the page to return (starts with page 1)
120+ iterator: If set to True and no pagination option is
121+ defined, return a generator instead of a list
98122 **kwargs: Extra options to send to the server (e.g. sudo)
99123
100124 Raises:
@@ -103,6 +127,32 @@ def public(self, **kwargs: Any) -> Union[RESTObjectList, List[RESTObject]]:
103127 Returns:
104128 A generator for the snippets list
105129 """
130+ return self .list (path = "/snippets/all" , ** kwargs )
131+
132+ def public (self , ** kwargs : Any ) -> Union [RESTObjectList , List [RESTObject ]]:
133+ """List all public snippets.
134+
135+ Args:
136+ get_all: If True, return all the items, without pagination
137+ per_page: Number of items to retrieve per request
138+ page: ID of the page to return (starts with page 1)
139+ iterator: If set to True and no pagination option is
140+ defined, return a generator instead of a list
141+ **kwargs: Extra options to send to the server (e.g. sudo)
142+
143+ Raises:
144+ GitlabListError: If the list could not be retrieved
145+
146+ Returns:
147+ The list of snippets, or a generator if `iterator` is True
148+ """
149+ utils .warn (
150+ message = (
151+ "Gitlab.snippets.public() is deprecated and will be removed in a"
152+ "future major version. Use Gitlab.snippets.list_public() instead."
153+ ),
154+ category = DeprecationWarning ,
155+ )
106156 return self .list (path = "/snippets/public" , ** kwargs )
107157
108158 def get (self , id : Union [str , int ], lazy : bool = False , ** kwargs : Any ) -> Snippet :
0 commit comments