diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-02-04 09:04:23 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-02-04 09:04:23 +0100 |
commit | 2f274bcd0bfb9fef2a2682445843b7804980ecf6 (patch) | |
tree | 67dd5cf0a88fa6f6ec0a6a3e8728419fbfefae38 /docs/api-usage.rst | |
parent | 492a75121375059a66accbbbd6af433acf6d7106 (diff) | |
download | gitlab-2f274bcd0bfb9fef2a2682445843b7804980ecf6.tar.gz |
document the dynamic aspect of objects
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r-- | docs/api-usage.rst | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst index 4f8cb37..a15aecb 100644 --- a/docs/api-usage.rst +++ b/docs/api-usage.rst @@ -2,7 +2,7 @@ Getting started with the API ############################ -The ``gitlab`` package provides 3 basic types: +The ``gitlab`` package provides 3 base types: * ``gitlab.Gitlab`` is the primary class, handling the HTTP requests. It holds the GitLab URL and authentication information. @@ -68,6 +68,17 @@ Examples: user = gl.users.create(user_data) print(user) +The attributes of objects are defined upon object creation, and depend on the +GitLab API itself. To list the available information associated with an object +use the python introspection tools: + +.. code-block:: python + + project = gl.projects.get(1) + print(vars(project)) + # or + print(project.__dict__) + Some ``gitlab.GitlabObject`` classes also provide managers to access related GitLab resources: |