glpi-python-client 0.6.6__py3-none-any.whl → 0.6.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- glpi_python_client/__init__.py +3 -1
- glpi_python_client/_async/clients/api/administration/_group.py +43 -0
- glpi_python_client/_async/clients/api/administration/_user.py +214 -1
- glpi_python_client/_async/clients/api/assistance/_ticket.py +132 -0
- glpi_python_client/_async/clients/commons/_payloads.py +35 -1
- glpi_python_client/_sync/clients/api/administration/_group.py +43 -0
- glpi_python_client/_sync/clients/api/administration/_user.py +214 -1
- glpi_python_client/_sync/clients/api/assistance/_ticket.py +132 -0
- glpi_python_client/_sync/clients/commons/_payloads.py +35 -1
- glpi_python_client/models/__init__.py +2 -0
- glpi_python_client/models/api_schema/administration/__init__.py +4 -0
- glpi_python_client/models/api_schema/administration/_user_authorization.py +48 -0
- {glpi_python_client-0.6.6.dist-info → glpi_python_client-0.6.8.dist-info}/METADATA +1 -1
- {glpi_python_client-0.6.6.dist-info → glpi_python_client-0.6.8.dist-info}/RECORD +16 -15
- {glpi_python_client-0.6.6.dist-info → glpi_python_client-0.6.8.dist-info}/WHEEL +0 -0
- {glpi_python_client-0.6.6.dist-info → glpi_python_client-0.6.8.dist-info}/licenses/LICENSE +0 -0
glpi_python_client/__init__.py
CHANGED
|
@@ -130,6 +130,7 @@ from glpi_python_client.models import (
|
|
|
130
130
|
PostTimelineDocument,
|
|
131
131
|
PostUser,
|
|
132
132
|
TicketMarkdownOptions,
|
|
133
|
+
UserAuthorization,
|
|
133
134
|
)
|
|
134
135
|
from glpi_python_client.rsql import (
|
|
135
136
|
changed_since,
|
|
@@ -137,7 +138,7 @@ from glpi_python_client.rsql import (
|
|
|
137
138
|
date_window,
|
|
138
139
|
)
|
|
139
140
|
|
|
140
|
-
__version__ = "0.6.
|
|
141
|
+
__version__ = "0.6.8"
|
|
141
142
|
|
|
142
143
|
__all__ = [
|
|
143
144
|
"AsyncGlpiClient",
|
|
@@ -250,6 +251,7 @@ __all__ = [
|
|
|
250
251
|
"PostTimelineDocument",
|
|
251
252
|
"PostUser",
|
|
252
253
|
"TicketMarkdownOptions",
|
|
254
|
+
"UserAuthorization",
|
|
253
255
|
"__version__",
|
|
254
256
|
"changed_since",
|
|
255
257
|
"created_between",
|
|
@@ -11,6 +11,9 @@ from __future__ import annotations
|
|
|
11
11
|
from collections.abc import AsyncIterator
|
|
12
12
|
|
|
13
13
|
from glpi_python_client._async.clients.commons._constants import GROUP_ENDPOINT, GlpiId
|
|
14
|
+
from glpi_python_client._async.clients.commons._payloads import (
|
|
15
|
+
ensure_v1_write_accepted,
|
|
16
|
+
)
|
|
14
17
|
from glpi_python_client._async.clients.commons._transport import TransportMixin
|
|
15
18
|
from glpi_python_client.models.api_schema.administration._group import (
|
|
16
19
|
DeleteGroup,
|
|
@@ -19,6 +22,8 @@ from glpi_python_client.models.api_schema.administration._group import (
|
|
|
19
22
|
PostGroup,
|
|
20
23
|
)
|
|
21
24
|
|
|
25
|
+
_V1_GROUP_FEATURE_LABEL = "group recursion"
|
|
26
|
+
|
|
22
27
|
|
|
23
28
|
class GroupMixin(TransportMixin):
|
|
24
29
|
"""CRUD helpers for ``/Administration/Group``."""
|
|
@@ -214,5 +219,43 @@ class GroupMixin(TransportMixin):
|
|
|
214
219
|
delete_model_cls=DeleteGroup,
|
|
215
220
|
)
|
|
216
221
|
|
|
222
|
+
async def set_group_recursive(
|
|
223
|
+
self, group_id: GlpiId, recursive: bool = True
|
|
224
|
+
) -> None:
|
|
225
|
+
"""Set whether one group is visible in the sub-entities of its entity.
|
|
226
|
+
|
|
227
|
+
The GLPI v2 ``Group`` schema has no ``is_recursive`` property (a v2
|
|
228
|
+
create or update silently drops the key), so this helper writes the
|
|
229
|
+
flag through the legacy v1 API, which requires
|
|
230
|
+
``v1_base_url``/``v1_user_token`` to be configured (pointing at the
|
|
231
|
+
legacy ``apirest.php``).
|
|
232
|
+
|
|
233
|
+
Parameters
|
|
234
|
+
----------
|
|
235
|
+
group_id : int | str
|
|
236
|
+
Identifier of the group.
|
|
237
|
+
recursive : bool, optional
|
|
238
|
+
``True`` (the default) makes the group apply to the sub-entities
|
|
239
|
+
of its entity; ``False`` restricts it to its own entity.
|
|
240
|
+
|
|
241
|
+
Raises
|
|
242
|
+
------
|
|
243
|
+
RuntimeError
|
|
244
|
+
When no legacy v1 session is configured on the client.
|
|
245
|
+
GlpiStatusError
|
|
246
|
+
When the legacy API returns a non-success status.
|
|
247
|
+
GlpiProtocolError
|
|
248
|
+
When the legacy API answers that the update was refused.
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
v1 = self._require_v1_session(_V1_GROUP_FEATURE_LABEL)
|
|
252
|
+
payload = await v1.request_json(
|
|
253
|
+
"PUT",
|
|
254
|
+
f"Group/{group_id}",
|
|
255
|
+
json_body={"input": {"id": int(group_id), "is_recursive": int(recursive)}},
|
|
256
|
+
failure_message=f"Failed to set is_recursive on group {group_id}",
|
|
257
|
+
)
|
|
258
|
+
ensure_v1_write_accepted(payload, f"Setting is_recursive on group {group_id}")
|
|
259
|
+
|
|
217
260
|
|
|
218
261
|
__all__ = ["GroupMixin"]
|
|
@@ -11,14 +11,24 @@ from __future__ import annotations
|
|
|
11
11
|
from collections.abc import AsyncIterator
|
|
12
12
|
|
|
13
13
|
from glpi_python_client._async.clients.commons._constants import USER_ENDPOINT, GlpiId
|
|
14
|
+
from glpi_python_client._async.clients.commons._payloads import (
|
|
15
|
+
ensure_v1_write_accepted,
|
|
16
|
+
model_from_payload,
|
|
17
|
+
)
|
|
14
18
|
from glpi_python_client._async.clients.commons._transport import TransportMixin
|
|
15
|
-
from glpi_python_client._errors import GlpiValidationError
|
|
19
|
+
from glpi_python_client._errors import GlpiProtocolError, GlpiValidationError
|
|
16
20
|
from glpi_python_client.models.api_schema.administration._user import (
|
|
17
21
|
DeleteUser,
|
|
18
22
|
GetUser,
|
|
19
23
|
PatchUser,
|
|
20
24
|
PostUser,
|
|
21
25
|
)
|
|
26
|
+
from glpi_python_client.models.api_schema.administration._user_authorization import (
|
|
27
|
+
UserAuthorization,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
_V1_AUTHORIZATION_FEATURE_LABEL = "user authorizations"
|
|
31
|
+
_AUTHORIZATION_LIST_RANGE = "0-999"
|
|
22
32
|
|
|
23
33
|
|
|
24
34
|
class UserMixin(TransportMixin):
|
|
@@ -296,5 +306,208 @@ class UserMixin(TransportMixin):
|
|
|
296
306
|
delete_model_cls=DeleteUser,
|
|
297
307
|
)
|
|
298
308
|
|
|
309
|
+
async def list_user_authorizations(
|
|
310
|
+
self, user_id: GlpiId
|
|
311
|
+
) -> list[UserAuthorization]:
|
|
312
|
+
"""List the profile/entity authorizations of one user.
|
|
313
|
+
|
|
314
|
+
The GLPI v2 API has no route for a user's authorizations
|
|
315
|
+
(``Profile_User`` rows), so this helper reads them through the legacy
|
|
316
|
+
v1 API, which requires ``v1_base_url``/``v1_user_token`` to be
|
|
317
|
+
configured (pointing at the legacy ``apirest.php``).
|
|
318
|
+
|
|
319
|
+
Parameters
|
|
320
|
+
----------
|
|
321
|
+
user_id : int | str
|
|
322
|
+
Identifier of the user.
|
|
323
|
+
|
|
324
|
+
Returns
|
|
325
|
+
-------
|
|
326
|
+
list[UserAuthorization]
|
|
327
|
+
One entry per profile the user holds, with the entity it applies
|
|
328
|
+
to and whether it is recursive.
|
|
329
|
+
|
|
330
|
+
Raises
|
|
331
|
+
------
|
|
332
|
+
RuntimeError
|
|
333
|
+
When no legacy v1 session is configured on the client.
|
|
334
|
+
GlpiStatusError
|
|
335
|
+
When the legacy API returns a non-success status.
|
|
336
|
+
"""
|
|
337
|
+
|
|
338
|
+
v1 = self._require_v1_session(_V1_AUTHORIZATION_FEATURE_LABEL)
|
|
339
|
+
payload = await v1.request_json(
|
|
340
|
+
"GET",
|
|
341
|
+
f"User/{user_id}/Profile_User",
|
|
342
|
+
params={"range": _AUTHORIZATION_LIST_RANGE},
|
|
343
|
+
failure_message=f"Failed to list the authorizations of user {user_id}",
|
|
344
|
+
)
|
|
345
|
+
rows = payload if isinstance(payload, list) else []
|
|
346
|
+
return [
|
|
347
|
+
model_from_payload(
|
|
348
|
+
UserAuthorization, row, server_timezone=self.server_timezone
|
|
349
|
+
)
|
|
350
|
+
for row in rows
|
|
351
|
+
]
|
|
352
|
+
|
|
353
|
+
async def add_user_authorization(
|
|
354
|
+
self,
|
|
355
|
+
user_id: GlpiId,
|
|
356
|
+
*,
|
|
357
|
+
profile_id: GlpiId,
|
|
358
|
+
entity_id: GlpiId,
|
|
359
|
+
recursive: bool = False,
|
|
360
|
+
) -> int:
|
|
361
|
+
"""Give one user a profile in an entity.
|
|
362
|
+
|
|
363
|
+
The GLPI v2 API has no route for a user's authorizations, so this
|
|
364
|
+
helper creates the ``Profile_User`` row through the legacy v1 API,
|
|
365
|
+
which requires ``v1_base_url``/``v1_user_token`` to be configured.
|
|
366
|
+
|
|
367
|
+
Parameters
|
|
368
|
+
----------
|
|
369
|
+
user_id : int | str
|
|
370
|
+
Identifier of the user.
|
|
371
|
+
profile_id : int | str
|
|
372
|
+
Identifier of the profile to grant.
|
|
373
|
+
entity_id : int | str
|
|
374
|
+
Identifier of the entity the profile applies to.
|
|
375
|
+
recursive : bool, optional
|
|
376
|
+
Whether the profile also applies to the sub-entities of
|
|
377
|
+
``entity_id``. ``False`` by default.
|
|
378
|
+
|
|
379
|
+
Returns
|
|
380
|
+
-------
|
|
381
|
+
int
|
|
382
|
+
Identifier of the new authorization.
|
|
383
|
+
|
|
384
|
+
Raises
|
|
385
|
+
------
|
|
386
|
+
RuntimeError
|
|
387
|
+
When no legacy v1 session is configured on the client.
|
|
388
|
+
GlpiStatusError
|
|
389
|
+
When the legacy API returns a non-success status.
|
|
390
|
+
GlpiProtocolError
|
|
391
|
+
When the answer carries no authorization id.
|
|
392
|
+
"""
|
|
393
|
+
|
|
394
|
+
v1 = self._require_v1_session(_V1_AUTHORIZATION_FEATURE_LABEL)
|
|
395
|
+
payload = await v1.request_json(
|
|
396
|
+
"POST",
|
|
397
|
+
"Profile_User",
|
|
398
|
+
json_body={
|
|
399
|
+
"input": {
|
|
400
|
+
"users_id": int(user_id),
|
|
401
|
+
"profiles_id": int(profile_id),
|
|
402
|
+
"entities_id": int(entity_id),
|
|
403
|
+
"is_recursive": int(recursive),
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
failure_message=(
|
|
407
|
+
f"Failed to add profile {profile_id} in entity {entity_id} "
|
|
408
|
+
f"to user {user_id}"
|
|
409
|
+
),
|
|
410
|
+
)
|
|
411
|
+
new_id = payload.get("id") if isinstance(payload, dict) else None
|
|
412
|
+
if new_id is None or isinstance(new_id, bool):
|
|
413
|
+
raise GlpiProtocolError(
|
|
414
|
+
f"GLPI user authorization response missing id: {payload!r}"
|
|
415
|
+
)
|
|
416
|
+
try:
|
|
417
|
+
return int(new_id)
|
|
418
|
+
except (TypeError, ValueError) as exc:
|
|
419
|
+
raise GlpiProtocolError(
|
|
420
|
+
f"GLPI user authorization response has a non-numeric id: {payload!r}"
|
|
421
|
+
) from exc
|
|
422
|
+
|
|
423
|
+
async def update_user_authorization(
|
|
424
|
+
self,
|
|
425
|
+
authorization_id: GlpiId,
|
|
426
|
+
*,
|
|
427
|
+
entity_id: GlpiId | None = None,
|
|
428
|
+
recursive: bool | None = None,
|
|
429
|
+
) -> None:
|
|
430
|
+
"""Move or re-scope one user authorization.
|
|
431
|
+
|
|
432
|
+
The GLPI v2 API has no route for a user's authorizations, so this
|
|
433
|
+
helper updates the ``Profile_User`` row through the legacy v1 API,
|
|
434
|
+
which requires ``v1_base_url``/``v1_user_token`` to be configured.
|
|
435
|
+
Only the supplied arguments are changed.
|
|
436
|
+
|
|
437
|
+
Parameters
|
|
438
|
+
----------
|
|
439
|
+
authorization_id : int | str
|
|
440
|
+
Identifier of the authorization (see
|
|
441
|
+
:meth:`list_user_authorizations`).
|
|
442
|
+
entity_id : int | str | None, optional
|
|
443
|
+
New entity for the authorization.
|
|
444
|
+
recursive : bool | None, optional
|
|
445
|
+
New recursion flag.
|
|
446
|
+
|
|
447
|
+
Raises
|
|
448
|
+
------
|
|
449
|
+
GlpiValidationError
|
|
450
|
+
When neither ``entity_id`` nor ``recursive`` is given; no request
|
|
451
|
+
is sent.
|
|
452
|
+
RuntimeError
|
|
453
|
+
When no legacy v1 session is configured on the client.
|
|
454
|
+
GlpiStatusError
|
|
455
|
+
When the legacy API returns a non-success status.
|
|
456
|
+
GlpiProtocolError
|
|
457
|
+
When the legacy API answers that the update was refused.
|
|
458
|
+
"""
|
|
459
|
+
|
|
460
|
+
if entity_id is None and recursive is None:
|
|
461
|
+
raise GlpiValidationError(
|
|
462
|
+
"update_user_authorization needs entity_id, recursive or both."
|
|
463
|
+
)
|
|
464
|
+
v1 = self._require_v1_session(_V1_AUTHORIZATION_FEATURE_LABEL)
|
|
465
|
+
fields: dict[str, object] = {"id": int(authorization_id)}
|
|
466
|
+
if entity_id is not None:
|
|
467
|
+
fields["entities_id"] = int(entity_id)
|
|
468
|
+
if recursive is not None:
|
|
469
|
+
fields["is_recursive"] = int(recursive)
|
|
470
|
+
payload = await v1.request_json(
|
|
471
|
+
"PUT",
|
|
472
|
+
f"Profile_User/{authorization_id}",
|
|
473
|
+
json_body={"input": fields},
|
|
474
|
+
failure_message=f"Failed to update user authorization {authorization_id}",
|
|
475
|
+
)
|
|
476
|
+
ensure_v1_write_accepted(
|
|
477
|
+
payload, f"Updating user authorization {authorization_id}"
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
async def delete_user_authorization(self, authorization_id: GlpiId) -> None:
|
|
481
|
+
"""Remove one user authorization.
|
|
482
|
+
|
|
483
|
+
The GLPI v2 API has no route for a user's authorizations, so this
|
|
484
|
+
helper deletes the ``Profile_User`` row through the legacy v1 API,
|
|
485
|
+
which requires ``v1_base_url``/``v1_user_token`` to be configured.
|
|
486
|
+
|
|
487
|
+
Parameters
|
|
488
|
+
----------
|
|
489
|
+
authorization_id : int | str
|
|
490
|
+
Identifier of the authorization to remove.
|
|
491
|
+
|
|
492
|
+
Raises
|
|
493
|
+
------
|
|
494
|
+
RuntimeError
|
|
495
|
+
When no legacy v1 session is configured on the client.
|
|
496
|
+
GlpiStatusError
|
|
497
|
+
When the legacy API returns a non-success status.
|
|
498
|
+
GlpiProtocolError
|
|
499
|
+
When the legacy API answers that the deletion was refused.
|
|
500
|
+
"""
|
|
501
|
+
|
|
502
|
+
v1 = self._require_v1_session(_V1_AUTHORIZATION_FEATURE_LABEL)
|
|
503
|
+
payload = await v1.request_json(
|
|
504
|
+
"DELETE",
|
|
505
|
+
f"Profile_User/{authorization_id}",
|
|
506
|
+
failure_message=f"Failed to delete user authorization {authorization_id}",
|
|
507
|
+
)
|
|
508
|
+
ensure_v1_write_accepted(
|
|
509
|
+
payload, f"Deleting user authorization {authorization_id}"
|
|
510
|
+
)
|
|
511
|
+
|
|
299
512
|
|
|
300
513
|
__all__ = ["UserMixin"]
|
|
@@ -7,8 +7,12 @@ GLPI ticket resource using the ``api_schema`` Pydantic models.
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
9
|
from collections.abc import AsyncIterator
|
|
10
|
+
from datetime import datetime
|
|
10
11
|
|
|
11
12
|
from glpi_python_client._async.clients.commons._constants import TICKET_ENDPOINT, GlpiId
|
|
13
|
+
from glpi_python_client._async.clients.commons._payloads import (
|
|
14
|
+
ensure_v1_write_accepted,
|
|
15
|
+
)
|
|
12
16
|
from glpi_python_client._async.clients.commons._transport import TransportMixin
|
|
13
17
|
from glpi_python_client.models.api_schema.assistance._ticket import (
|
|
14
18
|
DeleteTicket,
|
|
@@ -17,6 +21,8 @@ from glpi_python_client.models.api_schema.assistance._ticket import (
|
|
|
17
21
|
PostTicket,
|
|
18
22
|
)
|
|
19
23
|
|
|
24
|
+
_V1_TICKET_FEATURE_LABEL = "take-into-account writes"
|
|
25
|
+
|
|
20
26
|
|
|
21
27
|
class TicketMixin(TransportMixin):
|
|
22
28
|
"""CRUD helpers for ``/Assistance/Ticket``.
|
|
@@ -240,5 +246,131 @@ class TicketMixin(TransportMixin):
|
|
|
240
246
|
delete_model_cls=DeleteTicket,
|
|
241
247
|
)
|
|
242
248
|
|
|
249
|
+
async def change_ticket_take_into_account(
|
|
250
|
+
self,
|
|
251
|
+
ticket_id: GlpiId,
|
|
252
|
+
*,
|
|
253
|
+
take_into_account_date: datetime | None,
|
|
254
|
+
take_into_account_duration: int,
|
|
255
|
+
do_not_compute: bool = True,
|
|
256
|
+
disable_notifications: bool = True,
|
|
257
|
+
) -> None:
|
|
258
|
+
"""Write the take-into-account stamp of one ticket.
|
|
259
|
+
|
|
260
|
+
GLPI stamps ``take_into_account_date`` on the first write made by an
|
|
261
|
+
account allowed to take a ticket into account (and when a group is
|
|
262
|
+
assigned). The v2 ``Ticket`` schema exposes the date as read-only and
|
|
263
|
+
silently ignores ``_do_not_compute_takeintoaccount``, so the write
|
|
264
|
+
goes through the legacy v1 API, which requires
|
|
265
|
+
``v1_base_url``/``v1_user_token`` to be configured (pointing at the
|
|
266
|
+
legacy ``apirest.php``). GLPI records the change in the ticket
|
|
267
|
+
history either way.
|
|
268
|
+
|
|
269
|
+
Parameters
|
|
270
|
+
----------
|
|
271
|
+
ticket_id : int | str
|
|
272
|
+
Identifier of the ticket.
|
|
273
|
+
take_into_account_date : datetime | None
|
|
274
|
+
New take-into-account instant (v1 ``takeintoaccountdate``), or
|
|
275
|
+
``None`` for no stamp. An aware value is converted to the
|
|
276
|
+
server's clock; a naive one is taken to be on it already. GLPI
|
|
277
|
+
writes ``null`` instead whenever the duration is ``0``.
|
|
278
|
+
take_into_account_duration : int
|
|
279
|
+
Seconds from creation to the take-into-account (v1
|
|
280
|
+
``takeintoaccount_delay_stat``). GLPI treats ``0`` as "not taken
|
|
281
|
+
into account".
|
|
282
|
+
do_not_compute : bool, optional
|
|
283
|
+
``True`` (the default) sends ``_do_not_compute_takeintoaccount``
|
|
284
|
+
so GLPI keeps the values written. With ``False`` and a zero
|
|
285
|
+
duration, an account allowed to take the ticket into account
|
|
286
|
+
stamps it again with the current time in the same write.
|
|
287
|
+
disable_notifications : bool, optional
|
|
288
|
+
``True`` (the default) sends ``_disablenotif``, which suppresses
|
|
289
|
+
the "ticket updated" notification.
|
|
290
|
+
|
|
291
|
+
Raises
|
|
292
|
+
------
|
|
293
|
+
RuntimeError
|
|
294
|
+
When no legacy v1 session is configured on the client.
|
|
295
|
+
GlpiStatusError
|
|
296
|
+
When the legacy API returns a non-success status.
|
|
297
|
+
GlpiProtocolError
|
|
298
|
+
When the legacy API answers that the update was refused.
|
|
299
|
+
"""
|
|
300
|
+
|
|
301
|
+
v1 = self._require_v1_session(_V1_TICKET_FEATURE_LABEL)
|
|
302
|
+
stamp: str | None = None
|
|
303
|
+
if take_into_account_date is not None:
|
|
304
|
+
if take_into_account_date.tzinfo is not None:
|
|
305
|
+
take_into_account_date = take_into_account_date.astimezone(
|
|
306
|
+
self.server_timezone
|
|
307
|
+
)
|
|
308
|
+
stamp = take_into_account_date.strftime("%Y-%m-%d %H:%M:%S")
|
|
309
|
+
update: dict[str, object] = {
|
|
310
|
+
"id": int(ticket_id),
|
|
311
|
+
"takeintoaccountdate": stamp,
|
|
312
|
+
"takeintoaccount_delay_stat": take_into_account_duration,
|
|
313
|
+
}
|
|
314
|
+
# GLPI reads ``_disablenotif`` with isset(), so a False flag must be absent.
|
|
315
|
+
if do_not_compute:
|
|
316
|
+
update["_do_not_compute_takeintoaccount"] = True
|
|
317
|
+
if disable_notifications:
|
|
318
|
+
update["_disablenotif"] = True
|
|
319
|
+
payload = await v1.request_json(
|
|
320
|
+
"PUT",
|
|
321
|
+
f"Ticket/{ticket_id}",
|
|
322
|
+
json_body={"input": update},
|
|
323
|
+
failure_message=(
|
|
324
|
+
f"Failed to write the take-into-account stamp of ticket {ticket_id}"
|
|
325
|
+
),
|
|
326
|
+
)
|
|
327
|
+
ensure_v1_write_accepted(
|
|
328
|
+
payload, f"Writing the take-into-account stamp of ticket {ticket_id}"
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
async def clear_ticket_take_into_account(
|
|
332
|
+
self,
|
|
333
|
+
ticket_id: GlpiId,
|
|
334
|
+
*,
|
|
335
|
+
do_not_compute: bool = True,
|
|
336
|
+
disable_notifications: bool = True,
|
|
337
|
+
) -> None:
|
|
338
|
+
"""Clear the take-into-account stamp of one ticket.
|
|
339
|
+
|
|
340
|
+
The stamp collapses the time-to-own statistic to nearly zero for a
|
|
341
|
+
ticket a connector has just created and written to. This is
|
|
342
|
+
:meth:`change_ticket_take_into_account` with a ``None`` date and a
|
|
343
|
+
``0`` duration, so it has the same v1 requirement.
|
|
344
|
+
|
|
345
|
+
Parameters
|
|
346
|
+
----------
|
|
347
|
+
ticket_id : int | str
|
|
348
|
+
Identifier of the ticket.
|
|
349
|
+
do_not_compute : bool, optional
|
|
350
|
+
``True`` (the default) keeps GLPI from stamping the ticket again
|
|
351
|
+
in the same write. ``False`` lets an account allowed to take the
|
|
352
|
+
ticket into account undo the clear at once.
|
|
353
|
+
disable_notifications : bool, optional
|
|
354
|
+
``True`` (the default) suppresses the "ticket updated"
|
|
355
|
+
notification.
|
|
356
|
+
|
|
357
|
+
Raises
|
|
358
|
+
------
|
|
359
|
+
RuntimeError
|
|
360
|
+
When no legacy v1 session is configured on the client.
|
|
361
|
+
GlpiStatusError
|
|
362
|
+
When the legacy API returns a non-success status.
|
|
363
|
+
GlpiProtocolError
|
|
364
|
+
When the legacy API answers that the update was refused.
|
|
365
|
+
"""
|
|
366
|
+
|
|
367
|
+
await self.change_ticket_take_into_account(
|
|
368
|
+
ticket_id,
|
|
369
|
+
take_into_account_date=None,
|
|
370
|
+
take_into_account_duration=0,
|
|
371
|
+
do_not_compute=do_not_compute,
|
|
372
|
+
disable_notifications=disable_notifications,
|
|
373
|
+
)
|
|
374
|
+
|
|
243
375
|
|
|
244
376
|
__all__ = ["TicketMixin"]
|
|
@@ -10,6 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
from datetime import tzinfo
|
|
11
11
|
from typing import TypeVar
|
|
12
12
|
|
|
13
|
+
from glpi_python_client._errors import GlpiProtocolError
|
|
13
14
|
from glpi_python_client.models._base import (
|
|
14
15
|
SERVER_TIMEZONE_CONTEXT_KEY,
|
|
15
16
|
GlpiModel,
|
|
@@ -94,4 +95,37 @@ def model_from_payload(
|
|
|
94
95
|
return model_class.model_validate(payload, context=context)
|
|
95
96
|
|
|
96
97
|
|
|
97
|
-
__all__ = ["model_from_payload", "model_to_payload"]
|
|
98
|
+
__all__ = ["ensure_v1_write_accepted", "model_from_payload", "model_to_payload"]
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def ensure_v1_write_accepted(payload: object, description: str) -> None:
|
|
102
|
+
"""Raise when a legacy v1 write answered ``false`` for an item.
|
|
103
|
+
|
|
104
|
+
The v1 API reports a refused write with a success HTTP status and a
|
|
105
|
+
body such as ``[{"<id>": false, "message": "..."}]``, so the status
|
|
106
|
+
check alone lets it pass. An empty body, or a body without any
|
|
107
|
+
``false`` entry, is accepted.
|
|
108
|
+
|
|
109
|
+
Parameters
|
|
110
|
+
----------
|
|
111
|
+
payload : object
|
|
112
|
+
Parsed JSON body returned by the v1 session.
|
|
113
|
+
description : str
|
|
114
|
+
What was attempted, used as the prefix of the error message.
|
|
115
|
+
|
|
116
|
+
Raises
|
|
117
|
+
------
|
|
118
|
+
GlpiProtocolError
|
|
119
|
+
When any item of the answer is ``false``; the message carries the
|
|
120
|
+
server's own explanation when it gave one.
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
if not isinstance(payload, list):
|
|
124
|
+
return
|
|
125
|
+
for entry in payload:
|
|
126
|
+
if not isinstance(entry, dict):
|
|
127
|
+
continue
|
|
128
|
+
if any(value is False for key, value in entry.items() if key != "message"):
|
|
129
|
+
reason = entry.get("message")
|
|
130
|
+
suffix = f": {reason}" if reason else ""
|
|
131
|
+
raise GlpiProtocolError(f"{description} was refused by GLPI{suffix}")
|
|
@@ -11,6 +11,9 @@ from __future__ import annotations
|
|
|
11
11
|
from collections.abc import Iterator
|
|
12
12
|
|
|
13
13
|
from glpi_python_client._sync.clients.commons._constants import GROUP_ENDPOINT, GlpiId
|
|
14
|
+
from glpi_python_client._sync.clients.commons._payloads import (
|
|
15
|
+
ensure_v1_write_accepted,
|
|
16
|
+
)
|
|
14
17
|
from glpi_python_client._sync.clients.commons._transport import TransportMixin
|
|
15
18
|
from glpi_python_client.models.api_schema.administration._group import (
|
|
16
19
|
DeleteGroup,
|
|
@@ -19,6 +22,8 @@ from glpi_python_client.models.api_schema.administration._group import (
|
|
|
19
22
|
PostGroup,
|
|
20
23
|
)
|
|
21
24
|
|
|
25
|
+
_V1_GROUP_FEATURE_LABEL = "group recursion"
|
|
26
|
+
|
|
22
27
|
|
|
23
28
|
class GroupMixin(TransportMixin):
|
|
24
29
|
"""CRUD helpers for ``/Administration/Group``."""
|
|
@@ -214,5 +219,43 @@ class GroupMixin(TransportMixin):
|
|
|
214
219
|
delete_model_cls=DeleteGroup,
|
|
215
220
|
)
|
|
216
221
|
|
|
222
|
+
def set_group_recursive(
|
|
223
|
+
self, group_id: GlpiId, recursive: bool = True
|
|
224
|
+
) -> None:
|
|
225
|
+
"""Set whether one group is visible in the sub-entities of its entity.
|
|
226
|
+
|
|
227
|
+
The GLPI v2 ``Group`` schema has no ``is_recursive`` property (a v2
|
|
228
|
+
create or update silently drops the key), so this helper writes the
|
|
229
|
+
flag through the legacy v1 API, which requires
|
|
230
|
+
``v1_base_url``/``v1_user_token`` to be configured (pointing at the
|
|
231
|
+
legacy ``apirest.php``).
|
|
232
|
+
|
|
233
|
+
Parameters
|
|
234
|
+
----------
|
|
235
|
+
group_id : int | str
|
|
236
|
+
Identifier of the group.
|
|
237
|
+
recursive : bool, optional
|
|
238
|
+
``True`` (the default) makes the group apply to the sub-entities
|
|
239
|
+
of its entity; ``False`` restricts it to its own entity.
|
|
240
|
+
|
|
241
|
+
Raises
|
|
242
|
+
------
|
|
243
|
+
RuntimeError
|
|
244
|
+
When no legacy v1 session is configured on the client.
|
|
245
|
+
GlpiStatusError
|
|
246
|
+
When the legacy API returns a non-success status.
|
|
247
|
+
GlpiProtocolError
|
|
248
|
+
When the legacy API answers that the update was refused.
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
v1 = self._require_v1_session(_V1_GROUP_FEATURE_LABEL)
|
|
252
|
+
payload = v1.request_json(
|
|
253
|
+
"PUT",
|
|
254
|
+
f"Group/{group_id}",
|
|
255
|
+
json_body={"input": {"id": int(group_id), "is_recursive": int(recursive)}},
|
|
256
|
+
failure_message=f"Failed to set is_recursive on group {group_id}",
|
|
257
|
+
)
|
|
258
|
+
ensure_v1_write_accepted(payload, f"Setting is_recursive on group {group_id}")
|
|
259
|
+
|
|
217
260
|
|
|
218
261
|
__all__ = ["GroupMixin"]
|
|
@@ -11,14 +11,24 @@ from __future__ import annotations
|
|
|
11
11
|
from collections.abc import Iterator
|
|
12
12
|
|
|
13
13
|
from glpi_python_client._sync.clients.commons._constants import USER_ENDPOINT, GlpiId
|
|
14
|
+
from glpi_python_client._sync.clients.commons._payloads import (
|
|
15
|
+
ensure_v1_write_accepted,
|
|
16
|
+
model_from_payload,
|
|
17
|
+
)
|
|
14
18
|
from glpi_python_client._sync.clients.commons._transport import TransportMixin
|
|
15
|
-
from glpi_python_client._errors import GlpiValidationError
|
|
19
|
+
from glpi_python_client._errors import GlpiProtocolError, GlpiValidationError
|
|
16
20
|
from glpi_python_client.models.api_schema.administration._user import (
|
|
17
21
|
DeleteUser,
|
|
18
22
|
GetUser,
|
|
19
23
|
PatchUser,
|
|
20
24
|
PostUser,
|
|
21
25
|
)
|
|
26
|
+
from glpi_python_client.models.api_schema.administration._user_authorization import (
|
|
27
|
+
UserAuthorization,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
_V1_AUTHORIZATION_FEATURE_LABEL = "user authorizations"
|
|
31
|
+
_AUTHORIZATION_LIST_RANGE = "0-999"
|
|
22
32
|
|
|
23
33
|
|
|
24
34
|
class UserMixin(TransportMixin):
|
|
@@ -296,5 +306,208 @@ class UserMixin(TransportMixin):
|
|
|
296
306
|
delete_model_cls=DeleteUser,
|
|
297
307
|
)
|
|
298
308
|
|
|
309
|
+
def list_user_authorizations(
|
|
310
|
+
self, user_id: GlpiId
|
|
311
|
+
) -> list[UserAuthorization]:
|
|
312
|
+
"""List the profile/entity authorizations of one user.
|
|
313
|
+
|
|
314
|
+
The GLPI v2 API has no route for a user's authorizations
|
|
315
|
+
(``Profile_User`` rows), so this helper reads them through the legacy
|
|
316
|
+
v1 API, which requires ``v1_base_url``/``v1_user_token`` to be
|
|
317
|
+
configured (pointing at the legacy ``apirest.php``).
|
|
318
|
+
|
|
319
|
+
Parameters
|
|
320
|
+
----------
|
|
321
|
+
user_id : int | str
|
|
322
|
+
Identifier of the user.
|
|
323
|
+
|
|
324
|
+
Returns
|
|
325
|
+
-------
|
|
326
|
+
list[UserAuthorization]
|
|
327
|
+
One entry per profile the user holds, with the entity it applies
|
|
328
|
+
to and whether it is recursive.
|
|
329
|
+
|
|
330
|
+
Raises
|
|
331
|
+
------
|
|
332
|
+
RuntimeError
|
|
333
|
+
When no legacy v1 session is configured on the client.
|
|
334
|
+
GlpiStatusError
|
|
335
|
+
When the legacy API returns a non-success status.
|
|
336
|
+
"""
|
|
337
|
+
|
|
338
|
+
v1 = self._require_v1_session(_V1_AUTHORIZATION_FEATURE_LABEL)
|
|
339
|
+
payload = v1.request_json(
|
|
340
|
+
"GET",
|
|
341
|
+
f"User/{user_id}/Profile_User",
|
|
342
|
+
params={"range": _AUTHORIZATION_LIST_RANGE},
|
|
343
|
+
failure_message=f"Failed to list the authorizations of user {user_id}",
|
|
344
|
+
)
|
|
345
|
+
rows = payload if isinstance(payload, list) else []
|
|
346
|
+
return [
|
|
347
|
+
model_from_payload(
|
|
348
|
+
UserAuthorization, row, server_timezone=self.server_timezone
|
|
349
|
+
)
|
|
350
|
+
for row in rows
|
|
351
|
+
]
|
|
352
|
+
|
|
353
|
+
def add_user_authorization(
|
|
354
|
+
self,
|
|
355
|
+
user_id: GlpiId,
|
|
356
|
+
*,
|
|
357
|
+
profile_id: GlpiId,
|
|
358
|
+
entity_id: GlpiId,
|
|
359
|
+
recursive: bool = False,
|
|
360
|
+
) -> int:
|
|
361
|
+
"""Give one user a profile in an entity.
|
|
362
|
+
|
|
363
|
+
The GLPI v2 API has no route for a user's authorizations, so this
|
|
364
|
+
helper creates the ``Profile_User`` row through the legacy v1 API,
|
|
365
|
+
which requires ``v1_base_url``/``v1_user_token`` to be configured.
|
|
366
|
+
|
|
367
|
+
Parameters
|
|
368
|
+
----------
|
|
369
|
+
user_id : int | str
|
|
370
|
+
Identifier of the user.
|
|
371
|
+
profile_id : int | str
|
|
372
|
+
Identifier of the profile to grant.
|
|
373
|
+
entity_id : int | str
|
|
374
|
+
Identifier of the entity the profile applies to.
|
|
375
|
+
recursive : bool, optional
|
|
376
|
+
Whether the profile also applies to the sub-entities of
|
|
377
|
+
``entity_id``. ``False`` by default.
|
|
378
|
+
|
|
379
|
+
Returns
|
|
380
|
+
-------
|
|
381
|
+
int
|
|
382
|
+
Identifier of the new authorization.
|
|
383
|
+
|
|
384
|
+
Raises
|
|
385
|
+
------
|
|
386
|
+
RuntimeError
|
|
387
|
+
When no legacy v1 session is configured on the client.
|
|
388
|
+
GlpiStatusError
|
|
389
|
+
When the legacy API returns a non-success status.
|
|
390
|
+
GlpiProtocolError
|
|
391
|
+
When the answer carries no authorization id.
|
|
392
|
+
"""
|
|
393
|
+
|
|
394
|
+
v1 = self._require_v1_session(_V1_AUTHORIZATION_FEATURE_LABEL)
|
|
395
|
+
payload = v1.request_json(
|
|
396
|
+
"POST",
|
|
397
|
+
"Profile_User",
|
|
398
|
+
json_body={
|
|
399
|
+
"input": {
|
|
400
|
+
"users_id": int(user_id),
|
|
401
|
+
"profiles_id": int(profile_id),
|
|
402
|
+
"entities_id": int(entity_id),
|
|
403
|
+
"is_recursive": int(recursive),
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
failure_message=(
|
|
407
|
+
f"Failed to add profile {profile_id} in entity {entity_id} "
|
|
408
|
+
f"to user {user_id}"
|
|
409
|
+
),
|
|
410
|
+
)
|
|
411
|
+
new_id = payload.get("id") if isinstance(payload, dict) else None
|
|
412
|
+
if new_id is None or isinstance(new_id, bool):
|
|
413
|
+
raise GlpiProtocolError(
|
|
414
|
+
f"GLPI user authorization response missing id: {payload!r}"
|
|
415
|
+
)
|
|
416
|
+
try:
|
|
417
|
+
return int(new_id)
|
|
418
|
+
except (TypeError, ValueError) as exc:
|
|
419
|
+
raise GlpiProtocolError(
|
|
420
|
+
f"GLPI user authorization response has a non-numeric id: {payload!r}"
|
|
421
|
+
) from exc
|
|
422
|
+
|
|
423
|
+
def update_user_authorization(
|
|
424
|
+
self,
|
|
425
|
+
authorization_id: GlpiId,
|
|
426
|
+
*,
|
|
427
|
+
entity_id: GlpiId | None = None,
|
|
428
|
+
recursive: bool | None = None,
|
|
429
|
+
) -> None:
|
|
430
|
+
"""Move or re-scope one user authorization.
|
|
431
|
+
|
|
432
|
+
The GLPI v2 API has no route for a user's authorizations, so this
|
|
433
|
+
helper updates the ``Profile_User`` row through the legacy v1 API,
|
|
434
|
+
which requires ``v1_base_url``/``v1_user_token`` to be configured.
|
|
435
|
+
Only the supplied arguments are changed.
|
|
436
|
+
|
|
437
|
+
Parameters
|
|
438
|
+
----------
|
|
439
|
+
authorization_id : int | str
|
|
440
|
+
Identifier of the authorization (see
|
|
441
|
+
:meth:`list_user_authorizations`).
|
|
442
|
+
entity_id : int | str | None, optional
|
|
443
|
+
New entity for the authorization.
|
|
444
|
+
recursive : bool | None, optional
|
|
445
|
+
New recursion flag.
|
|
446
|
+
|
|
447
|
+
Raises
|
|
448
|
+
------
|
|
449
|
+
GlpiValidationError
|
|
450
|
+
When neither ``entity_id`` nor ``recursive`` is given; no request
|
|
451
|
+
is sent.
|
|
452
|
+
RuntimeError
|
|
453
|
+
When no legacy v1 session is configured on the client.
|
|
454
|
+
GlpiStatusError
|
|
455
|
+
When the legacy API returns a non-success status.
|
|
456
|
+
GlpiProtocolError
|
|
457
|
+
When the legacy API answers that the update was refused.
|
|
458
|
+
"""
|
|
459
|
+
|
|
460
|
+
if entity_id is None and recursive is None:
|
|
461
|
+
raise GlpiValidationError(
|
|
462
|
+
"update_user_authorization needs entity_id, recursive or both."
|
|
463
|
+
)
|
|
464
|
+
v1 = self._require_v1_session(_V1_AUTHORIZATION_FEATURE_LABEL)
|
|
465
|
+
fields: dict[str, object] = {"id": int(authorization_id)}
|
|
466
|
+
if entity_id is not None:
|
|
467
|
+
fields["entities_id"] = int(entity_id)
|
|
468
|
+
if recursive is not None:
|
|
469
|
+
fields["is_recursive"] = int(recursive)
|
|
470
|
+
payload = v1.request_json(
|
|
471
|
+
"PUT",
|
|
472
|
+
f"Profile_User/{authorization_id}",
|
|
473
|
+
json_body={"input": fields},
|
|
474
|
+
failure_message=f"Failed to update user authorization {authorization_id}",
|
|
475
|
+
)
|
|
476
|
+
ensure_v1_write_accepted(
|
|
477
|
+
payload, f"Updating user authorization {authorization_id}"
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
def delete_user_authorization(self, authorization_id: GlpiId) -> None:
|
|
481
|
+
"""Remove one user authorization.
|
|
482
|
+
|
|
483
|
+
The GLPI v2 API has no route for a user's authorizations, so this
|
|
484
|
+
helper deletes the ``Profile_User`` row through the legacy v1 API,
|
|
485
|
+
which requires ``v1_base_url``/``v1_user_token`` to be configured.
|
|
486
|
+
|
|
487
|
+
Parameters
|
|
488
|
+
----------
|
|
489
|
+
authorization_id : int | str
|
|
490
|
+
Identifier of the authorization to remove.
|
|
491
|
+
|
|
492
|
+
Raises
|
|
493
|
+
------
|
|
494
|
+
RuntimeError
|
|
495
|
+
When no legacy v1 session is configured on the client.
|
|
496
|
+
GlpiStatusError
|
|
497
|
+
When the legacy API returns a non-success status.
|
|
498
|
+
GlpiProtocolError
|
|
499
|
+
When the legacy API answers that the deletion was refused.
|
|
500
|
+
"""
|
|
501
|
+
|
|
502
|
+
v1 = self._require_v1_session(_V1_AUTHORIZATION_FEATURE_LABEL)
|
|
503
|
+
payload = v1.request_json(
|
|
504
|
+
"DELETE",
|
|
505
|
+
f"Profile_User/{authorization_id}",
|
|
506
|
+
failure_message=f"Failed to delete user authorization {authorization_id}",
|
|
507
|
+
)
|
|
508
|
+
ensure_v1_write_accepted(
|
|
509
|
+
payload, f"Deleting user authorization {authorization_id}"
|
|
510
|
+
)
|
|
511
|
+
|
|
299
512
|
|
|
300
513
|
__all__ = ["UserMixin"]
|
|
@@ -7,8 +7,12 @@ GLPI ticket resource using the ``api_schema`` Pydantic models.
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
9
|
from collections.abc import Iterator
|
|
10
|
+
from datetime import datetime
|
|
10
11
|
|
|
11
12
|
from glpi_python_client._sync.clients.commons._constants import TICKET_ENDPOINT, GlpiId
|
|
13
|
+
from glpi_python_client._sync.clients.commons._payloads import (
|
|
14
|
+
ensure_v1_write_accepted,
|
|
15
|
+
)
|
|
12
16
|
from glpi_python_client._sync.clients.commons._transport import TransportMixin
|
|
13
17
|
from glpi_python_client.models.api_schema.assistance._ticket import (
|
|
14
18
|
DeleteTicket,
|
|
@@ -17,6 +21,8 @@ from glpi_python_client.models.api_schema.assistance._ticket import (
|
|
|
17
21
|
PostTicket,
|
|
18
22
|
)
|
|
19
23
|
|
|
24
|
+
_V1_TICKET_FEATURE_LABEL = "take-into-account writes"
|
|
25
|
+
|
|
20
26
|
|
|
21
27
|
class TicketMixin(TransportMixin):
|
|
22
28
|
"""CRUD helpers for ``/Assistance/Ticket``.
|
|
@@ -240,5 +246,131 @@ class TicketMixin(TransportMixin):
|
|
|
240
246
|
delete_model_cls=DeleteTicket,
|
|
241
247
|
)
|
|
242
248
|
|
|
249
|
+
def change_ticket_take_into_account(
|
|
250
|
+
self,
|
|
251
|
+
ticket_id: GlpiId,
|
|
252
|
+
*,
|
|
253
|
+
take_into_account_date: datetime | None,
|
|
254
|
+
take_into_account_duration: int,
|
|
255
|
+
do_not_compute: bool = True,
|
|
256
|
+
disable_notifications: bool = True,
|
|
257
|
+
) -> None:
|
|
258
|
+
"""Write the take-into-account stamp of one ticket.
|
|
259
|
+
|
|
260
|
+
GLPI stamps ``take_into_account_date`` on the first write made by an
|
|
261
|
+
account allowed to take a ticket into account (and when a group is
|
|
262
|
+
assigned). The v2 ``Ticket`` schema exposes the date as read-only and
|
|
263
|
+
silently ignores ``_do_not_compute_takeintoaccount``, so the write
|
|
264
|
+
goes through the legacy v1 API, which requires
|
|
265
|
+
``v1_base_url``/``v1_user_token`` to be configured (pointing at the
|
|
266
|
+
legacy ``apirest.php``). GLPI records the change in the ticket
|
|
267
|
+
history either way.
|
|
268
|
+
|
|
269
|
+
Parameters
|
|
270
|
+
----------
|
|
271
|
+
ticket_id : int | str
|
|
272
|
+
Identifier of the ticket.
|
|
273
|
+
take_into_account_date : datetime | None
|
|
274
|
+
New take-into-account instant (v1 ``takeintoaccountdate``), or
|
|
275
|
+
``None`` for no stamp. An aware value is converted to the
|
|
276
|
+
server's clock; a naive one is taken to be on it already. GLPI
|
|
277
|
+
writes ``null`` instead whenever the duration is ``0``.
|
|
278
|
+
take_into_account_duration : int
|
|
279
|
+
Seconds from creation to the take-into-account (v1
|
|
280
|
+
``takeintoaccount_delay_stat``). GLPI treats ``0`` as "not taken
|
|
281
|
+
into account".
|
|
282
|
+
do_not_compute : bool, optional
|
|
283
|
+
``True`` (the default) sends ``_do_not_compute_takeintoaccount``
|
|
284
|
+
so GLPI keeps the values written. With ``False`` and a zero
|
|
285
|
+
duration, an account allowed to take the ticket into account
|
|
286
|
+
stamps it again with the current time in the same write.
|
|
287
|
+
disable_notifications : bool, optional
|
|
288
|
+
``True`` (the default) sends ``_disablenotif``, which suppresses
|
|
289
|
+
the "ticket updated" notification.
|
|
290
|
+
|
|
291
|
+
Raises
|
|
292
|
+
------
|
|
293
|
+
RuntimeError
|
|
294
|
+
When no legacy v1 session is configured on the client.
|
|
295
|
+
GlpiStatusError
|
|
296
|
+
When the legacy API returns a non-success status.
|
|
297
|
+
GlpiProtocolError
|
|
298
|
+
When the legacy API answers that the update was refused.
|
|
299
|
+
"""
|
|
300
|
+
|
|
301
|
+
v1 = self._require_v1_session(_V1_TICKET_FEATURE_LABEL)
|
|
302
|
+
stamp: str | None = None
|
|
303
|
+
if take_into_account_date is not None:
|
|
304
|
+
if take_into_account_date.tzinfo is not None:
|
|
305
|
+
take_into_account_date = take_into_account_date.astimezone(
|
|
306
|
+
self.server_timezone
|
|
307
|
+
)
|
|
308
|
+
stamp = take_into_account_date.strftime("%Y-%m-%d %H:%M:%S")
|
|
309
|
+
update: dict[str, object] = {
|
|
310
|
+
"id": int(ticket_id),
|
|
311
|
+
"takeintoaccountdate": stamp,
|
|
312
|
+
"takeintoaccount_delay_stat": take_into_account_duration,
|
|
313
|
+
}
|
|
314
|
+
# GLPI reads ``_disablenotif`` with isset(), so a False flag must be absent.
|
|
315
|
+
if do_not_compute:
|
|
316
|
+
update["_do_not_compute_takeintoaccount"] = True
|
|
317
|
+
if disable_notifications:
|
|
318
|
+
update["_disablenotif"] = True
|
|
319
|
+
payload = v1.request_json(
|
|
320
|
+
"PUT",
|
|
321
|
+
f"Ticket/{ticket_id}",
|
|
322
|
+
json_body={"input": update},
|
|
323
|
+
failure_message=(
|
|
324
|
+
f"Failed to write the take-into-account stamp of ticket {ticket_id}"
|
|
325
|
+
),
|
|
326
|
+
)
|
|
327
|
+
ensure_v1_write_accepted(
|
|
328
|
+
payload, f"Writing the take-into-account stamp of ticket {ticket_id}"
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
def clear_ticket_take_into_account(
|
|
332
|
+
self,
|
|
333
|
+
ticket_id: GlpiId,
|
|
334
|
+
*,
|
|
335
|
+
do_not_compute: bool = True,
|
|
336
|
+
disable_notifications: bool = True,
|
|
337
|
+
) -> None:
|
|
338
|
+
"""Clear the take-into-account stamp of one ticket.
|
|
339
|
+
|
|
340
|
+
The stamp collapses the time-to-own statistic to nearly zero for a
|
|
341
|
+
ticket a connector has just created and written to. This is
|
|
342
|
+
:meth:`change_ticket_take_into_account` with a ``None`` date and a
|
|
343
|
+
``0`` duration, so it has the same v1 requirement.
|
|
344
|
+
|
|
345
|
+
Parameters
|
|
346
|
+
----------
|
|
347
|
+
ticket_id : int | str
|
|
348
|
+
Identifier of the ticket.
|
|
349
|
+
do_not_compute : bool, optional
|
|
350
|
+
``True`` (the default) keeps GLPI from stamping the ticket again
|
|
351
|
+
in the same write. ``False`` lets an account allowed to take the
|
|
352
|
+
ticket into account undo the clear at once.
|
|
353
|
+
disable_notifications : bool, optional
|
|
354
|
+
``True`` (the default) suppresses the "ticket updated"
|
|
355
|
+
notification.
|
|
356
|
+
|
|
357
|
+
Raises
|
|
358
|
+
------
|
|
359
|
+
RuntimeError
|
|
360
|
+
When no legacy v1 session is configured on the client.
|
|
361
|
+
GlpiStatusError
|
|
362
|
+
When the legacy API returns a non-success status.
|
|
363
|
+
GlpiProtocolError
|
|
364
|
+
When the legacy API answers that the update was refused.
|
|
365
|
+
"""
|
|
366
|
+
|
|
367
|
+
self.change_ticket_take_into_account(
|
|
368
|
+
ticket_id,
|
|
369
|
+
take_into_account_date=None,
|
|
370
|
+
take_into_account_duration=0,
|
|
371
|
+
do_not_compute=do_not_compute,
|
|
372
|
+
disable_notifications=disable_notifications,
|
|
373
|
+
)
|
|
374
|
+
|
|
243
375
|
|
|
244
376
|
__all__ = ["TicketMixin"]
|
|
@@ -10,6 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
from datetime import tzinfo
|
|
11
11
|
from typing import TypeVar
|
|
12
12
|
|
|
13
|
+
from glpi_python_client._errors import GlpiProtocolError
|
|
13
14
|
from glpi_python_client.models._base import (
|
|
14
15
|
SERVER_TIMEZONE_CONTEXT_KEY,
|
|
15
16
|
GlpiModel,
|
|
@@ -94,4 +95,37 @@ def model_from_payload(
|
|
|
94
95
|
return model_class.model_validate(payload, context=context)
|
|
95
96
|
|
|
96
97
|
|
|
97
|
-
__all__ = ["model_from_payload", "model_to_payload"]
|
|
98
|
+
__all__ = ["ensure_v1_write_accepted", "model_from_payload", "model_to_payload"]
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def ensure_v1_write_accepted(payload: object, description: str) -> None:
|
|
102
|
+
"""Raise when a legacy v1 write answered ``false`` for an item.
|
|
103
|
+
|
|
104
|
+
The v1 API reports a refused write with a success HTTP status and a
|
|
105
|
+
body such as ``[{"<id>": false, "message": "..."}]``, so the status
|
|
106
|
+
check alone lets it pass. An empty body, or a body without any
|
|
107
|
+
``false`` entry, is accepted.
|
|
108
|
+
|
|
109
|
+
Parameters
|
|
110
|
+
----------
|
|
111
|
+
payload : object
|
|
112
|
+
Parsed JSON body returned by the v1 session.
|
|
113
|
+
description : str
|
|
114
|
+
What was attempted, used as the prefix of the error message.
|
|
115
|
+
|
|
116
|
+
Raises
|
|
117
|
+
------
|
|
118
|
+
GlpiProtocolError
|
|
119
|
+
When any item of the answer is ``false``; the message carries the
|
|
120
|
+
server's own explanation when it gave one.
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
if not isinstance(payload, list):
|
|
124
|
+
return
|
|
125
|
+
for entry in payload:
|
|
126
|
+
if not isinstance(entry, dict):
|
|
127
|
+
continue
|
|
128
|
+
if any(value is False for key, value in entry.items() if key != "message"):
|
|
129
|
+
reason = entry.get("message")
|
|
130
|
+
suffix = f": {reason}" if reason else ""
|
|
131
|
+
raise GlpiProtocolError(f"{description} was refused by GLPI{suffix}")
|
|
@@ -33,6 +33,7 @@ from glpi_python_client.models.api_schema.administration import (
|
|
|
33
33
|
PostEntity,
|
|
34
34
|
PostGroup,
|
|
35
35
|
PostUser,
|
|
36
|
+
UserAuthorization,
|
|
36
37
|
)
|
|
37
38
|
from glpi_python_client.models.api_schema.assets import (
|
|
38
39
|
DeleteComputer,
|
|
@@ -235,4 +236,5 @@ __all__ = [
|
|
|
235
236
|
"PostTimelineDocument",
|
|
236
237
|
"PostUser",
|
|
237
238
|
"TicketMarkdownOptions",
|
|
239
|
+
"UserAuthorization",
|
|
238
240
|
]
|
|
@@ -24,6 +24,9 @@ from glpi_python_client.models.api_schema.administration._user import (
|
|
|
24
24
|
PatchUser,
|
|
25
25
|
PostUser,
|
|
26
26
|
)
|
|
27
|
+
from glpi_python_client.models.api_schema.administration._user_authorization import (
|
|
28
|
+
UserAuthorization,
|
|
29
|
+
)
|
|
27
30
|
|
|
28
31
|
__all__ = [
|
|
29
32
|
"DeleteEntity",
|
|
@@ -38,4 +41,5 @@ __all__ = [
|
|
|
38
41
|
"PostEntity",
|
|
39
42
|
"PostGroup",
|
|
40
43
|
"PostUser",
|
|
44
|
+
"UserAuthorization",
|
|
41
45
|
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Schema of one GLPI user authorization (``Profile_User`` row).
|
|
2
|
+
|
|
3
|
+
A user authorization says that a user holds a profile in an entity, and
|
|
4
|
+
whether that profile also applies to the entity's sub-entities. The GLPI v2
|
|
5
|
+
API has no route for these rows, so they are read and written through the
|
|
6
|
+
legacy v1 REST API, which names the columns ``users_id``, ``profiles_id`` and
|
|
7
|
+
``entities_id`` and encodes flags as ``0``/``1``.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from pydantic import AliasChoices, Field
|
|
13
|
+
|
|
14
|
+
from glpi_python_client.models._base import GlpiModel
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class UserAuthorization(GlpiModel):
|
|
18
|
+
"""One profile held by a user in an entity.
|
|
19
|
+
|
|
20
|
+
Both the v1 column names (``users_id``, ``profiles_id``, ``entities_id``)
|
|
21
|
+
and the Python field names are accepted on input; the ``0``/``1`` flags
|
|
22
|
+
of the v1 API become booleans.
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
id : int
|
|
27
|
+
Identifier of the authorization row.
|
|
28
|
+
user_id : int
|
|
29
|
+
Identifier of the user holding the profile.
|
|
30
|
+
profile_id : int
|
|
31
|
+
Identifier of the profile.
|
|
32
|
+
entity_id : int
|
|
33
|
+
Identifier of the entity the profile applies to.
|
|
34
|
+
is_recursive : bool, optional
|
|
35
|
+
Whether the profile also applies to the sub-entities of the entity.
|
|
36
|
+
is_dynamic : bool, optional
|
|
37
|
+
Whether the row was added by a directory rule rather than by hand.
|
|
38
|
+
is_default_profile : bool, optional
|
|
39
|
+
Whether this is the user's default profile.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
id: int
|
|
43
|
+
user_id: int = Field(validation_alias=AliasChoices("user_id", "users_id"))
|
|
44
|
+
profile_id: int = Field(validation_alias=AliasChoices("profile_id", "profiles_id"))
|
|
45
|
+
entity_id: int = Field(validation_alias=AliasChoices("entity_id", "entities_id"))
|
|
46
|
+
is_recursive: bool = False
|
|
47
|
+
is_dynamic: bool = False
|
|
48
|
+
is_default_profile: bool = False
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: glpi-python-client
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.8
|
|
4
4
|
Summary: A typed Python client for GLPI ITSM APIs.
|
|
5
5
|
Project-URL: Homepage, https://github.com/baraline/glpi_python_client
|
|
6
6
|
Project-URL: Documentation, https://glpi-python-client.readthedocs.io/en/latest/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
glpi_python_client/__init__.py,sha256=
|
|
1
|
+
glpi_python_client/__init__.py,sha256=gW8x9fJRzEx95wmAJYbe7ST7Ix9sOIxe46mTMCzXjSg,5810
|
|
2
2
|
glpi_python_client/_errors.py,sha256=Bc9UvlxulbdcGvzZIKXnJCTL78sW78R6EFg50P-1dpY,7151
|
|
3
3
|
glpi_python_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
glpi_python_client/rsql.py,sha256=3u3lH3_-F1bvHbVzxALXTDPoHyoMATP1f4QPTar_sEU,8974
|
|
@@ -14,13 +14,13 @@ glpi_python_client/_async/clients/client.py,sha256=4lZbd4wHNRqI2xbzjsff3iy8e4FnM
|
|
|
14
14
|
glpi_python_client/_async/clients/api/__init__.py,sha256=keInRT6ogmkeWETnNQC6VliBjZZk4ur2hRcIyWSv1_k,1776
|
|
15
15
|
glpi_python_client/_async/clients/api/administration/__init__.py,sha256=raqpFI2U8WDfeSRzN8-PcqhzD3sKP0oTamgj77-Nhxk,614
|
|
16
16
|
glpi_python_client/_async/clients/api/administration/_entity.py,sha256=qG1SBMwOCZWHjHV4KfswY6bTaTQP9I83mQvOd-Xo70w,6453
|
|
17
|
-
glpi_python_client/_async/clients/api/administration/_group.py,sha256=
|
|
18
|
-
glpi_python_client/_async/clients/api/administration/_user.py,sha256=
|
|
17
|
+
glpi_python_client/_async/clients/api/administration/_group.py,sha256=c8qpqHl3METBggY5VJCAQyZNfmqBtOhi3IcxFK6eoMU,8175
|
|
18
|
+
glpi_python_client/_async/clients/api/administration/_user.py,sha256=lwwaMh0b8qP1V41xPQGa3lnoaLTy3vdboDE4abOiDpE,17681
|
|
19
19
|
glpi_python_client/_async/clients/api/assets/__init__.py,sha256=WFWG5zcRf0kFtz35it3W83xOlqXJ77IcYI51KRSiL08,198
|
|
20
20
|
glpi_python_client/_async/clients/api/assets/_computer.py,sha256=U-dDeYmY3MaS0BTqJAQThKtKTbvDS7BvshbXheD64rM,13634
|
|
21
21
|
glpi_python_client/_async/clients/api/assistance/__init__.py,sha256=nL77QpQ4YzfdSWhkpUfcp5SwYlfjtONL37RgjU_OTuM,302
|
|
22
22
|
glpi_python_client/_async/clients/api/assistance/_team.py,sha256=QEwFTXE8W_MURi_zgfDTLoqYP__NF1SwBd_7dLJZg5U,3824
|
|
23
|
-
glpi_python_client/_async/clients/api/assistance/_ticket.py,sha256=
|
|
23
|
+
glpi_python_client/_async/clients/api/assistance/_ticket.py,sha256=F0mC0k2liCJi9dKI8uBBle1_0a9erKh5BgqAc4USI1A,13389
|
|
24
24
|
glpi_python_client/_async/clients/api/assistance/timeline/__init__.py,sha256=AqB_UpcRMHjfvZyLBjkwfsnEBwz77xBbGJzXzWmS7os,619
|
|
25
25
|
glpi_python_client/_async/clients/api/assistance/timeline/_document.py,sha256=BYCScaSyfrPzAh-znObYh1yEeL4dwYLYV8F0hKn6YcE,14803
|
|
26
26
|
glpi_python_client/_async/clients/api/assistance/timeline/_followup.py,sha256=jgE_kpJxMa3v1Tt4Jm2PahiRNX7v3vKh6xjbX27sp7w,6221
|
|
@@ -44,7 +44,7 @@ glpi_python_client/_async/clients/commons/_config.py,sha256=JlUZy_oPQj0ldSbBVWcy
|
|
|
44
44
|
glpi_python_client/_async/clients/commons/_constants.py,sha256=Y2uQ0zE_7m0DLSKLg41JEbW4ww23Mk9g-hDbjNZjaZQ,1834
|
|
45
45
|
glpi_python_client/_async/clients/commons/_filters.py,sha256=eQdrc06RhEuGHtvAqBJy1VrOVHVjeiFh82pvX-HxGw8,4695
|
|
46
46
|
glpi_python_client/_async/clients/commons/_http.py,sha256=8x9H9eHw-neOYoQ2MAP2JmbVqcpno42pZlzfuhizpmk,15240
|
|
47
|
-
glpi_python_client/_async/clients/commons/_payloads.py,sha256=
|
|
47
|
+
glpi_python_client/_async/clients/commons/_payloads.py,sha256=dtljozIhGB_wga3bLqT2hPNuV_ImX8EfHKv9CPV2EvY,4957
|
|
48
48
|
glpi_python_client/_async/clients/commons/_transport.py,sha256=QhXpQK54DAYAXJ20n1Dg2targ5yThWL6OkivLI9uYfE,23515
|
|
49
49
|
glpi_python_client/_async/clients/custom/__init__.py,sha256=Pi65Zs4lko41pk5L3vDqjv9b24OM6HDxBmQSGURhWP0,886
|
|
50
50
|
glpi_python_client/_async/clients/custom/_statistics.py,sha256=GFgxHLWWZvQzHxl2bjerhlJDjuttvVa1aZIdaGIztg0,38751
|
|
@@ -61,13 +61,13 @@ glpi_python_client/_sync/clients/client.py,sha256=WTqrTs_0xSUSR8ez__JjHPgDBhsBUt
|
|
|
61
61
|
glpi_python_client/_sync/clients/api/__init__.py,sha256=_nlTpSQyldJrTVvlifp__DQGF6_vqCl_YPWp6FCa-mM,1767
|
|
62
62
|
glpi_python_client/_sync/clients/api/administration/__init__.py,sha256=3s3Nfawu1FI97Q-WIlz5OgLZL7TszItF6l_JzQHVzaM,611
|
|
63
63
|
glpi_python_client/_sync/clients/api/administration/_entity.py,sha256=jYvIl1hXcPQuAABa0I0TCKBG6FMHtO8xl55xhG5CRS8,6369
|
|
64
|
-
glpi_python_client/_sync/clients/api/administration/_group.py,sha256=
|
|
65
|
-
glpi_python_client/_sync/clients/api/administration/_user.py,sha256=
|
|
64
|
+
glpi_python_client/_sync/clients/api/administration/_group.py,sha256=uKIt5q-G2YmOQLMJWcjLkLTNYmFdUtB0gKGSgUvj9YQ,8078
|
|
65
|
+
glpi_python_client/_sync/clients/api/administration/_user.py,sha256=y2DHsMn029ofg4KJ62w6HGvBdtQJzs6dNhZUmIWpqxo,17536
|
|
66
66
|
glpi_python_client/_sync/clients/api/assets/__init__.py,sha256=_4-S2nkXQNuFXzZzXoLR3DnykaKTzata9ZPN74ASO8s,197
|
|
67
67
|
glpi_python_client/_sync/clients/api/assets/_computer.py,sha256=jILfoo7L2FJwL7Q_uFXkpfDBCuPczCAJ_TbAoyiGrj0,13490
|
|
68
68
|
glpi_python_client/_sync/clients/api/assistance/__init__.py,sha256=dAXVQPgCmPhCLESRC8nkVvCKLwp655wu9nsyqmvzLDk,300
|
|
69
69
|
glpi_python_client/_sync/clients/api/assistance/_team.py,sha256=Nk0FXUHyZZOkg62Os4FBee3Jv4YzMJoOqsvsWM0yqI0,3785
|
|
70
|
-
glpi_python_client/_sync/clients/api/assistance/_ticket.py,sha256=
|
|
70
|
+
glpi_python_client/_sync/clients/api/assistance/_ticket.py,sha256=mWJsHcIk806iudiXJuPM3CW8nn1r8tVRs3dMvtpfVhs,13280
|
|
71
71
|
glpi_python_client/_sync/clients/api/assistance/timeline/__init__.py,sha256=d_YAwgv3r1sNrRVlPC5r1yEhbUZQKzLtuNzHD9eBF8Y,615
|
|
72
72
|
glpi_python_client/_sync/clients/api/assistance/timeline/_document.py,sha256=0T7wEyVNoECI8c0LUZ1WQtXgvpRBKyl-GTsB4jdJ2xA,14709
|
|
73
73
|
glpi_python_client/_sync/clients/api/assistance/timeline/_followup.py,sha256=trQJJThA8jk2jVK-jTW8uPZyYEvR5Zi18mqGT6436VM,6158
|
|
@@ -91,23 +91,24 @@ glpi_python_client/_sync/clients/commons/_config.py,sha256=f2wVtUUdh6rxaf-s84X8F
|
|
|
91
91
|
glpi_python_client/_sync/clients/commons/_constants.py,sha256=Y2uQ0zE_7m0DLSKLg41JEbW4ww23Mk9g-hDbjNZjaZQ,1834
|
|
92
92
|
glpi_python_client/_sync/clients/commons/_filters.py,sha256=eQdrc06RhEuGHtvAqBJy1VrOVHVjeiFh82pvX-HxGw8,4695
|
|
93
93
|
glpi_python_client/_sync/clients/commons/_http.py,sha256=5p8S1J1usIB0WQg5u3h6zovr14an-NoIGNfwAHEOSS4,15239
|
|
94
|
-
glpi_python_client/_sync/clients/commons/_payloads.py,sha256=
|
|
94
|
+
glpi_python_client/_sync/clients/commons/_payloads.py,sha256=dtljozIhGB_wga3bLqT2hPNuV_ImX8EfHKv9CPV2EvY,4957
|
|
95
95
|
glpi_python_client/_sync/clients/commons/_transport.py,sha256=x9xRFSUrJLPyp1DrVh8Txyhr9DZmWkKXZ1FM9T6xjfo,23303
|
|
96
96
|
glpi_python_client/_sync/clients/custom/__init__.py,sha256=sxfGlHVulucP7bacWhUMi9qGJZaiZm8lXceY0OGqWio,882
|
|
97
97
|
glpi_python_client/_sync/clients/custom/_statistics.py,sha256=xrD5C99ieROJx60iUomBHacQ_49HpgQL4XjnfREUQvs,38616
|
|
98
98
|
glpi_python_client/_sync/clients/custom/_ticket_context.py,sha256=LDUvKNr8VpZonF5bDo8QYYwMEsWmayVU28Ra3GonNmE,3004
|
|
99
99
|
glpi_python_client/content/__init__.py,sha256=TaZPo8WSvVj4U-hSnxhUcqU8JnCKNZYpfQf4pH45aN4,424
|
|
100
100
|
glpi_python_client/content/conversion.py,sha256=0dxQW0ojSo1KC8zcTFa476KQa1i3sLWzQ8gTEEVslys,45341
|
|
101
|
-
glpi_python_client/models/__init__.py,sha256
|
|
101
|
+
glpi_python_client/models/__init__.py,sha256=-t0GsZuXTp4te9bgvMxsSH-BhXCGl8lulw7-x7cwE4g,5634
|
|
102
102
|
glpi_python_client/models/_base.py,sha256=pYg69KHuR5TDED5utr4Knr7HncBnLTxXHJZYf6vEUKA,12183
|
|
103
103
|
glpi_python_client/models/api_schema/__init__.py,sha256=yTxUYih1Xy7NUogzD7UKp2b8HyE4wdeC_FCKS6ZRVVM,1176
|
|
104
104
|
glpi_python_client/models/api_schema/_common.py,sha256=wVtaIkUM9iS3jyDb0bpFopEkP_3vP1ax7D8rwHe9QkI,2004
|
|
105
105
|
glpi_python_client/models/api_schema/_content.py,sha256=DlsEmlXIK_0jyXh3j5PgU6vkwch2o0I8UpUkLq2fqYw,12826
|
|
106
106
|
glpi_python_client/models/api_schema/enums.py,sha256=bHNCuumOXIZm80n5RqIhCzFqizII-3er41mn2aktF5s,5071
|
|
107
|
-
glpi_python_client/models/api_schema/administration/__init__.py,sha256=
|
|
107
|
+
glpi_python_client/models/api_schema/administration/__init__.py,sha256=Hqgh6JZ0TQYVY2OHLK98sI0hh5VkZy4oJBrgyagNG4Y,1060
|
|
108
108
|
glpi_python_client/models/api_schema/administration/_entity.py,sha256=KdbxMyPXumGZKmmabDIciF3nFS61pLRp5SBOTFa8slk,3297
|
|
109
109
|
glpi_python_client/models/api_schema/administration/_group.py,sha256=8aWnDupTT9lxGtzMC_dAG8yDLO_NKtFz-OCNHOYESi0,5298
|
|
110
110
|
glpi_python_client/models/api_schema/administration/_user.py,sha256=MQ6cHKdni98sjm-Whf0GKdGpNjPgGGJpUBgVjlGa19Q,15872
|
|
111
|
+
glpi_python_client/models/api_schema/administration/_user_authorization.py,sha256=-WC4YUuR9ebLkBBBUDgX626V-I9DNV6pPIfbgp_C6C0,1801
|
|
111
112
|
glpi_python_client/models/api_schema/assets/__init__.py,sha256=QikGfQwwhjKt3vUd5FYC1F-BeClP5ByK1hahRRumdsA,562
|
|
112
113
|
glpi_python_client/models/api_schema/assets/_computer.py,sha256=me3px9rkaN_ZataDVLjOer9wsZw_fRoRikxkLzXopsE,10304
|
|
113
114
|
glpi_python_client/models/api_schema/assets/_contract_item.py,sha256=sS9SqdI47IGFaFBa5_8koOu26wut198-N-CG1OKbl7s,3430
|
|
@@ -139,7 +140,7 @@ glpi_python_client/models/custom_schema/_ticket_context.py,sha256=jnlfgho-aDbmA9
|
|
|
139
140
|
glpi_python_client/testing/__init__.py,sha256=iLtUyJjyv3fEhy3PN25NxNTbtqDl3SoHLbNium0Z80U,568
|
|
140
141
|
glpi_python_client/testing/fixtures.py,sha256=HKt6MXHgcmLn4L98pSwp-oGlc9C--_vrABNe5G_iBeg,1286
|
|
141
142
|
glpi_python_client/testing/utils.py,sha256=JyO3w2d-0kYdtC1hEZ2Tu_YjnCz8nUQ_Ck05-1EhsX4,4404
|
|
142
|
-
glpi_python_client-0.6.
|
|
143
|
-
glpi_python_client-0.6.
|
|
144
|
-
glpi_python_client-0.6.
|
|
145
|
-
glpi_python_client-0.6.
|
|
143
|
+
glpi_python_client-0.6.8.dist-info/METADATA,sha256=NO8Su8O8dS0rA3fzg_Heai9rxsNdsPElUHsmmsW8UbY,8234
|
|
144
|
+
glpi_python_client-0.6.8.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
145
|
+
glpi_python_client-0.6.8.dist-info/licenses/LICENSE,sha256=nL8re-TIKkxCoL7OkSBja6EB4NsQR1HoOJgxv_MEhtc,1088
|
|
146
|
+
glpi_python_client-0.6.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|