@@ -7,32 +7,7 @@ python-gitlab supports both GitLab v3 and v4 APIs.
77v3 being deprecated by GitLab, its support in python-gitlab will be minimal.
88The development team will focus on v4.
99
10- v3 is still the default API used by python-gitlab, for compatibility reasons..
11-
12-
13- Base types
14- ==========
15-
16- The ``gitlab `` package provides some base types.
17-
18- * ``gitlab.Gitlab `` is the primary class, handling the HTTP requests. It holds
19- the GitLab URL and authentication information.
20-
21- For v4 the following types are defined:
22-
23- * ``gitlab.base.RESTObject `` is the base class for all the GitLab v4 objects.
24- These objects provide an abstraction for GitLab resources (projects, groups,
25- and so on).
26- * ``gitlab.base.RESTManager `` is the base class for v4 objects managers,
27- providing the API to manipulate the resources and their attributes.
28-
29- For v3 the following types are defined:
30-
31- * ``gitlab.base.GitlabObject `` is the base class for all the GitLab v3 objects.
32- These objects provide an abstraction for GitLab resources (projects, groups,
33- and so on).
34- * ``gitlab.base.BaseManager `` is the base class for v3 objects managers,
35- providing the API to manipulate the resources and their attributes.
10+ v3 is still the default API used by python-gitlab, for compatibility reasons.
3611
3712
3813``gitlab.Gitlab `` class
@@ -109,6 +84,17 @@ Examples:
10984 user = gl.users.create(user_data)
11085 print (user)
11186
87+ You can list the mandatory and optional attributes for object creation
88+ with the manager's ``get_create_attrs() `` method. It returns 2 tuples, the
89+ first one is the list of mandatory attributes, the second one the list of
90+ optional attribute:
91+
92+ .. code-block :: python
93+
94+ # v4 only
95+ print (gl.projects.get_create_attrs())
96+ ((' name' ,), (' path' , ' namespace_id' , ... ))
97+
11298 The attributes of objects are defined upon object creation, and depend on the
11399GitLab API itself. To list the available information associated with an object
114100use the python introspection tools for v3, or the ``attributes `` attribute for
@@ -150,7 +136,6 @@ You can update or delete a remote object when it exists locally:
150136 # delete the resource
151137 project.delete()
152138
153-
154139 Some classes provide additional methods, allowing more actions on the GitLab
155140resources. For example:
156141
@@ -160,6 +145,30 @@ resources. For example:
160145 project = gl.projects.get(1 )
161146 project.star()
162147
148+ Base types
149+ ==========
150+
151+ The ``gitlab `` package provides some base types.
152+
153+ * ``gitlab.Gitlab `` is the primary class, handling the HTTP requests. It holds
154+ the GitLab URL and authentication information.
155+
156+ For v4 the following types are defined:
157+
158+ * ``gitlab.base.RESTObject `` is the base class for all the GitLab v4 objects.
159+ These objects provide an abstraction for GitLab resources (projects, groups,
160+ and so on).
161+ * ``gitlab.base.RESTManager `` is the base class for v4 objects managers,
162+ providing the API to manipulate the resources and their attributes.
163+
164+ For v3 the following types are defined:
165+
166+ * ``gitlab.base.GitlabObject `` is the base class for all the GitLab v3 objects.
167+ These objects provide an abstraction for GitLab resources (projects, groups,
168+ and so on).
169+ * ``gitlab.base.BaseManager `` is the base class for v3 objects managers,
170+ providing the API to manipulate the resources and their attributes.
171+
163172Lazy objects (v4 only)
164173======================
165174
0 commit comments