Skip to content

Commit 2f274bc

Browse files
author
Gauvain Pocentek
committed
document the dynamic aspect of objects
1 parent 492a751 commit 2f274bc

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/api-usage.rst

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Getting started with the API
33
############################
44

5-
The ``gitlab`` package provides 3 basic types:
5+
The ``gitlab`` package provides 3 base types:
66

77
* ``gitlab.Gitlab`` is the primary class, handling the HTTP requests. It holds
88
the GitLab URL and authentication information.
@@ -68,6 +68,17 @@ Examples:
6868
user = gl.users.create(user_data)
6969
print(user)
7070
71+
The attributes of objects are defined upon object creation, and depend on the
72+
GitLab API itself. To list the available information associated with an object
73+
use the python introspection tools:
74+
75+
.. code-block:: python
76+
77+
project = gl.projects.get(1)
78+
print(vars(project))
79+
# or
80+
print(project.__dict__)
81+
7182
Some ``gitlab.GitlabObject`` classes also provide managers to access related
7283
GitLab resources:
7384

0 commit comments

Comments
 (0)