Current state
Every write surfaces an id or nothing: 12 create_* methods return int,
link_ticket_timeline_document returns int, upload_document returns dict[str, object], and all 13
update_* plus 11 delete_* return None.
Correcting a common justification
-> int reflects what the client keeps, not what GLPI sends. _resource_create parses the entire
JSON body and returns one integer from it (_transport.py:426-480), discarding the rest silently.
Demonstrated with httpx.MockTransport under the real client: a POST answering 201 with a complete
16-field ticket record still yields bare 4242, and a PATCH answering 200 with the full updated record
yields None.
So the current signature cannot be cited as evidence about server behaviour. Open question worth one
preprod probe: does the v2 POST body carry only id, or a fuller record? Live runs prove an integer id
is present (four create_* ids are round-tripped in integration_tests/); nobody has recorded the full
body.
Likewise, "re-reading would hide a second HTTP call behind a write" is not an invariant this codebase
holds -- create_kb_article already makes a v2 POST plus a v1 PUT behind one create-shaped name
(_article.py:89-121).
Recommendation: keep the primitives
The load-bearing reasons are:
- 19 of
GetTicket's 44 fields are server-assigned, so the fetch is real work a caller may not want
- the read-back can fail independently of the write and destroy the id
- callers already write the two-line composition in the docs
Costs if adopted
- 12-13 methods, not one, and it cannot be made uniform --
create_item_plugin_field_row has no get_
counterpart
_and_ appears in zero of 85 current method names, against a verb_noun house style
testing/tests/test_skill_references.py forces every new name into a SKILL.md
- the composed helper has a failure mode the primitive lacks (write succeeds, read-back raises, id lost) --
it would need create_kb_article's discipline of naming the new id in the error
Mechanically it is safe: a plain token rewrite for unasync, no mypy ignore needed, and
test_method_invocation.py:265-302 parametrises over every public name so coverage is automatic. Sphinx
needs no edit (api_reference.rst uses :members: :inherited-members:).
Filed for a decision, low priority.
Current state
Every write surfaces an id or nothing: 12
create_*methods returnint,link_ticket_timeline_documentreturnsint,upload_documentreturnsdict[str, object], and all 13update_*plus 11delete_*returnNone.Correcting a common justification
-> intreflects what the client keeps, not what GLPI sends._resource_createparses the entireJSON body and returns one integer from it (
_transport.py:426-480), discarding the rest silently.Demonstrated with
httpx.MockTransportunder the real client: a POST answering 201 with a complete16-field ticket record still yields bare
4242, and a PATCH answering 200 with the full updated recordyields
None.So the current signature cannot be cited as evidence about server behaviour. Open question worth one
preprod probe: does the v2 POST body carry only
id, or a fuller record? Live runs prove an integeridis present (four
create_*ids are round-tripped inintegration_tests/); nobody has recorded the fullbody.
Likewise, "re-reading would hide a second HTTP call behind a write" is not an invariant this codebase
holds --
create_kb_articlealready makes a v2 POST plus a v1 PUT behind one create-shaped name(
_article.py:89-121).Recommendation: keep the primitives
The load-bearing reasons are:
GetTicket's 44 fields are server-assigned, so the fetch is real work a caller may not wantCosts if adopted
create_item_plugin_field_rowhas noget_counterpart
_and_appears in zero of 85 current method names, against averb_nounhouse styletesting/tests/test_skill_references.pyforces every new name into aSKILL.mdit would need
create_kb_article's discipline of naming the new id in the errorMechanically it is safe: a plain token rewrite for unasync, no mypy ignore needed, and
test_method_invocation.py:265-302parametrises over every public name so coverage is automatic. Sphinxneeds no edit (
api_reference.rstuses:members: :inherited-members:).Filed for a decision, low priority.