|
1 |
| -Manager for {{ cls | classref() }} objects. |
2 |
| - |
3 |
| -{% if cls.canUpdate %} |
4 |
| -{{ cls | classref() }} objects can be updated. |
5 |
| -{% else %} |
6 |
| -{{ cls | classref() }} objects **cannot** be updated. |
| 1 | +{% if cls._list_filters %} |
| 2 | +**Object listing filters** |
| 3 | +{% for item in cls._list_filters %} |
| 4 | +- ``{{ item }}`` |
| 5 | +{% endfor %} |
7 | 6 | {% endif %}
|
8 | 7 |
|
9 |
| -{% if cls.canList %} |
10 |
| -.. method:: list(**kwargs) |
11 |
| - |
12 |
| - Returns a list of objects of type {{ cls | classref() }}. |
13 |
| - |
14 |
| - Available keys for ``kwargs`` are: |
15 |
| - |
16 |
| - {% for k in cls.requiredListAttrs %} |
17 |
| - * ``{{ k }}`` (required) |
18 |
| - {% endfor %} |
19 |
| - {% for k in cls.optionalListAttrs %} |
20 |
| - * ``{{ k }}`` (optional) |
21 |
| - {% endfor %} |
22 |
| - * ``per_page`` (int): number of item per page. May be limited by the server. |
23 |
| - * ``page`` (int): page to retrieve |
24 |
| - * ``all`` (bool): iterate over all the pages and return all the entries |
25 |
| - * ``sudo`` (string or int): run the request as another user (requires admin |
26 |
| - permissions) |
| 8 | +{% if cls._create_attrs %} |
| 9 | +**Object Creation** |
| 10 | +{% if cls._create_attrs[0] %} |
| 11 | +Mandatory attributes: |
| 12 | +{% for item in cls._create_attrs[0] %} |
| 13 | +- ``{{ item }}`` |
| 14 | +{% endfor %} |
27 | 15 | {% endif %}
|
28 |
| - |
29 |
| -{% if cls.canGet %} |
30 |
| -{% if cls.getRequiresId %} |
31 |
| -.. method:: get(id, **kwargs) |
32 |
| - |
33 |
| - Get a single object of type {{ cls | classref() }} using its ``id``. |
34 |
| -{% else %} |
35 |
| -.. method:: get(**kwargs) |
36 |
| - |
37 |
| - Get a single object of type {{ cls | classref() }}. |
| 16 | +{% if cls._create_attrs[1] %} |
| 17 | +Optional attributes: |
| 18 | +{% for item in cls._create_attrs[1] %} |
| 19 | +- ``{{ item }}`` |
| 20 | +{% endfor %} |
38 | 21 | {% endif %}
|
39 |
| - |
40 |
| - Available keys for ``kwargs`` are: |
41 |
| - |
42 |
| - {% for k in cls.requiredGetAttrs %} |
43 |
| - * ``{{ k }}`` (required) |
44 |
| - {% endfor %} |
45 |
| - {% for k in cls.optionalGetAttrs %} |
46 |
| - * ``{{ k }}`` (optional) |
47 |
| - {% endfor %} |
48 |
| - * ``sudo`` (string or int): run the request as another user (requires admin |
49 |
| - permissions) |
50 | 22 | {% endif %}
|
51 | 23 |
|
52 |
| -{% if cls.canCreate %} |
53 |
| -.. method:: create(data, **kwargs) |
54 |
| - |
55 |
| - Create an object of type {{ cls | classref() }}. |
56 |
| - |
57 |
| - ``data`` is a dict defining the object attributes. Available attributes are: |
58 |
| - |
59 |
| - {% for a in cls.requiredUrlAttrs %} |
60 |
| - * ``{{ a }}`` (required if not discovered on the parent objects) |
61 |
| - {% endfor %} |
62 |
| - {% for a in cls.requiredCreateAttrs %} |
63 |
| - * ``{{ a }}`` (required) |
64 |
| - {% endfor %} |
65 |
| - {% for a in cls.optionalCreateAttrs %} |
66 |
| - * ``{{ a }}`` (optional) |
67 |
| - {% endfor %} |
68 |
| - |
69 |
| - Available keys for ``kwargs`` are: |
70 |
| - |
71 |
| - * ``sudo`` (string or int): run the request as another user (requires admin |
72 |
| - permissions) |
| 24 | +{% if cls._update_attrs %} |
| 25 | +**Object update** |
| 26 | +{% if cls._update_attrs[0] %} |
| 27 | +Mandatory attributes for object update: |
| 28 | +{% for item in cls._update_attrs[0] %} |
| 29 | +- ``{{ item }}`` |
| 30 | +{% endfor %} |
| 31 | +{% endif %} |
| 32 | +{% if cls._update_attrs[1] %} |
| 33 | +Optional attributes for object update: |
| 34 | +{% for item in cls._update_attrs[1] %} |
| 35 | +- ``{{ item }}`` |
| 36 | +{% endfor %} |
73 | 37 | {% endif %}
|
74 |
| - |
75 |
| -{% if cls.canDelete %} |
76 |
| -.. method:: delete(id, **kwargs) |
77 |
| - |
78 |
| - Delete the object with ID ``id``. |
79 |
| - |
80 |
| - Available keys for ``kwargs`` are: |
81 |
| - |
82 |
| - * ``sudo`` (string or int): run the request as another user (requires admin |
83 |
| - permissions) |
84 | 38 | {% endif %}
|
0 commit comments