glpi-python-client 0.6.6__tar.gz → 0.6.8__tar.gz
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-0.6.6 → glpi_python_client-0.6.8}/CHANGELOG.md +53 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/PKG-INFO +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/api_reference.rst +8 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/user_guide.rst +74 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/__init__.py +3 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/administration/_group.py +43 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/administration/_user.py +214 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assistance/_ticket.py +132 -0
- {glpi_python_client-0.6.6/glpi_python_client/_sync → glpi_python_client-0.6.8/glpi_python_client/_async}/clients/commons/_payloads.py +35 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/administration/_group.py +43 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/administration/_user.py +214 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assistance/_ticket.py +132 -0
- {glpi_python_client-0.6.6/glpi_python_client/_async → glpi_python_client-0.6.8/glpi_python_client/_sync}/clients/commons/_payloads.py +35 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/__init__.py +2 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/administration/__init__.py +4 -0
- glpi_python_client-0.6.8/glpi_python_client/models/api_schema/administration/_user_authorization.py +48 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/pyproject.toml +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/README.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-asset-workflow/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-client-setup/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-contract-workflow/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-document-workflow/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-knowledge-base/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-plugin-fields/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-reporting-and-context/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-team-members/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-ticket-timeline/SKILL.md +1 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-ticket-workflow/SKILL.md +2 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/skills/glpi-user-location-provisioning/SKILL.md +2 -1
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/.gitignore +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/.pre-commit-config.yaml +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/.readthedocs.yaml +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/CONTRIBUTING.md +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/LICENSE +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/README.md +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/_static/.gitkeep +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/conf.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/development.md +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/development_rtd.rst +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/index.rst +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/installation.rst +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/publishing.md +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/publishing_rtd.rst +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/docs/sponsoring.rst +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/_concurrency.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/_testing.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/auth/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/auth/_v1_session.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/auth/auth.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/_base_client.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/administration/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/administration/_entity.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assets/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assets/_computer.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assistance/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assistance/_team.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assistance/timeline/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assistance/timeline/_document.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assistance/timeline/_followup.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assistance/timeline/_solution.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/assistance/timeline/_task.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/dropdowns/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/dropdowns/_contract_type.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/dropdowns/_location.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/knowledgebase/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/knowledgebase/_article.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/knowledgebase/_category.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/knowledgebase/_comment.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/knowledgebase/_revision.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/management/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/management/_contract.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/management/_document.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/plugins/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/api/plugins/_fields.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/client.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/commons/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/commons/_config.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/commons/_constants.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/commons/_filters.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/commons/_http.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/commons/_transport.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/custom/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/custom/_statistics.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_async/clients/custom/_ticket_context.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_errors.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/_concurrency.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/_testing.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/auth/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/auth/_v1_session.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/auth/auth.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/_base_client.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/administration/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/administration/_entity.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assets/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assets/_computer.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assistance/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assistance/_team.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assistance/timeline/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assistance/timeline/_document.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assistance/timeline/_followup.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assistance/timeline/_solution.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/assistance/timeline/_task.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/dropdowns/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/dropdowns/_contract_type.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/dropdowns/_location.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/knowledgebase/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/knowledgebase/_article.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/knowledgebase/_category.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/knowledgebase/_comment.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/knowledgebase/_revision.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/management/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/management/_contract.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/management/_document.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/plugins/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/api/plugins/_fields.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/client.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/commons/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/commons/_config.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/commons/_constants.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/commons/_filters.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/commons/_http.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/commons/_transport.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/custom/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/custom/_statistics.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/_sync/clients/custom/_ticket_context.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/content/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/content/conversion.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/_base.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/_common.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/_content.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/administration/_entity.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/administration/_group.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/administration/_user.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assets/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assets/_computer.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assets/_contract_item.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assistance/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assistance/_team.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assistance/_ticket.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assistance/timeline/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assistance/timeline/_document.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assistance/timeline/_followup.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assistance/timeline/_solution.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/assistance/timeline/_task.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/dropdowns/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/dropdowns/_contract_type.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/dropdowns/_location.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/enums.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/knowledgebase/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/knowledgebase/_article.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/knowledgebase/_category.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/knowledgebase/_comment.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/knowledgebase/_revision.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/management/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/management/_contract.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/management/_contract_cost.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/management/_document.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/management/_document_item.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/plugins/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/api_schema/plugins/_fields.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/custom_schema/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/models/custom_schema/_ticket_context.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/py.typed +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/rsql.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/testing/__init__.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/testing/fixtures.py +0 -0
- {glpi_python_client-0.6.6 → glpi_python_client-0.6.8}/glpi_python_client/testing/utils.py +0 -0
|
@@ -4,6 +4,59 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## 0.6.8 — 2026-11-02
|
|
8
|
+
|
|
9
|
+
A minor addition: a way to write or clear a ticket's take-into-account stamp,
|
|
10
|
+
through the legacy v1 API. GLPI stamps the date on the first write by an
|
|
11
|
+
account allowed to take a ticket into account, so a connector that writes to a
|
|
12
|
+
ticket it has just created leaves a time-to-own of nearly zero. The v2 `Ticket`
|
|
13
|
+
schema exposes the date as read-only and ignores `_do_not_compute_takeintoaccount`.
|
|
14
|
+
Both helpers need `v1_base_url` / `v1_user_token` and raise `RuntimeError`
|
|
15
|
+
without them. Existing methods are unchanged.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- **`change_ticket_take_into_account(ticket_id, *, take_into_account_date,
|
|
20
|
+
take_into_account_duration, do_not_compute=True, disable_notifications=True)`**
|
|
21
|
+
on both clients. It writes the ticket's take-into-account date (an aware
|
|
22
|
+
value is converted to `server_timezone`) and its duration in seconds. GLPI
|
|
23
|
+
writes a null date whenever the duration is 0. `do_not_compute` sends
|
|
24
|
+
`_do_not_compute_takeintoaccount` and `disable_notifications` sends
|
|
25
|
+
`_disablenotif`; a `False` flag is left out of the request, because GLPI
|
|
26
|
+
tests `_disablenotif` for presence. A refused write raises
|
|
27
|
+
`GlpiProtocolError`.
|
|
28
|
+
- **`clear_ticket_take_into_account(ticket_id, *, do_not_compute=True,
|
|
29
|
+
disable_notifications=True)`** on both clients: the change above with a null
|
|
30
|
+
date and a 0 duration.
|
|
31
|
+
|
|
32
|
+
## 0.6.7 — 2026-10-30
|
|
33
|
+
|
|
34
|
+
A minor addition: group recursion and a user's profile/entity authorizations,
|
|
35
|
+
through the legacy v1 API. The GLPI v2 `Group` schema has no `is_recursive`
|
|
36
|
+
(a v2 create silently drops it) and v2 has no route for a user's
|
|
37
|
+
authorizations, so these helpers need `v1_base_url` / `v1_user_token` and
|
|
38
|
+
raise `RuntimeError` without them. Existing methods are unchanged.
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- **`set_group_recursive(group_id, recursive=True)`** on both clients.
|
|
43
|
+
- **`list_user_authorizations`, `add_user_authorization`,
|
|
44
|
+
`update_user_authorization` and `delete_user_authorization`** on both
|
|
45
|
+
clients, over GLPI's `Profile_User` rows. `update_user_authorization` with
|
|
46
|
+
neither `entity_id` nor `recursive` raises `GlpiValidationError` without a
|
|
47
|
+
request.
|
|
48
|
+
- **`UserAuthorization`**, one authorization row (`id`, `user_id`,
|
|
49
|
+
`profile_id`, `entity_id`, `is_recursive`, `is_dynamic`,
|
|
50
|
+
`is_default_profile`), exported from the package root and from
|
|
51
|
+
`glpi_python_client.models`.
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- A v1 write that GLPI answers with `false` for an item (a success status and
|
|
56
|
+
a body such as `[{"7": false, "message": "..."}]`) raises
|
|
57
|
+
`GlpiProtocolError` with the server's message. The new helpers do this; the
|
|
58
|
+
existing v1 writes are unchanged.
|
|
59
|
+
|
|
7
60
|
## 0.6.6 — 2026-10-28
|
|
8
61
|
|
|
9
62
|
A minor addition: the GLPI v2 `/Administration/Group` routes, so a caller can
|
|
@@ -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/
|
|
@@ -509,6 +509,14 @@ Groups
|
|
|
509
509
|
:undoc-members:
|
|
510
510
|
:show-inheritance:
|
|
511
511
|
|
|
512
|
+
User authorizations
|
|
513
|
+
-------------------
|
|
514
|
+
|
|
515
|
+
.. autoclass:: UserAuthorization
|
|
516
|
+
:members:
|
|
517
|
+
:undoc-members:
|
|
518
|
+
:show-inheritance:
|
|
519
|
+
|
|
512
520
|
Plugin: Fields (custom fields)
|
|
513
521
|
------------------------------
|
|
514
522
|
|
|
@@ -379,6 +379,7 @@ The full set is re-exported from the package root, including
|
|
|
379
379
|
``GetLocation`` / ``PostLocation`` / ``PatchLocation`` / ``DeleteLocation``,
|
|
380
380
|
``GetEntity`` / ``PostEntity`` / ``PatchEntity`` / ``DeleteEntity``,
|
|
381
381
|
``GetGroup`` / ``PostGroup`` / ``PatchGroup`` / ``DeleteGroup``,
|
|
382
|
+
``UserAuthorization``,
|
|
382
383
|
``GetFollowup``, ``GetTicketTask``, ``GetSolution``, ``GetTimelineDocument``,
|
|
383
384
|
``GetTeamMember``, and ``GetDocument`` together with their post / patch /
|
|
384
385
|
delete variants. The read-only ``GetDocumentItem`` and ``FollowupDocuments``
|
|
@@ -582,6 +583,79 @@ Example output::
|
|
|
582
583
|
the client (``v1_base_url`` and ``v1_user_token``) because the GLPI v2
|
|
583
584
|
contract does not advertise a binary upload endpoint.
|
|
584
585
|
|
|
586
|
+
Group recursion and user authorizations
|
|
587
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
588
|
+
|
|
589
|
+
GLPI lets a group, and a user's profile in an entity, apply to the
|
|
590
|
+
sub-entities of that entity too. The v2 API cannot set either: its ``Group``
|
|
591
|
+
schema has no ``is_recursive`` property (a v2 create silently drops the key)
|
|
592
|
+
and it has no route at all for a user's profile and entity authorizations.
|
|
593
|
+
Five helpers go through the legacy v1 session instead (``v1_base_url`` and
|
|
594
|
+
``v1_user_token``); without one they raise ``RuntimeError``.
|
|
595
|
+
|
|
596
|
+
* ``set_group_recursive(group_id, recursive=True)`` sets the flag on one
|
|
597
|
+
group.
|
|
598
|
+
* ``list_user_authorizations(user_id)`` returns the user's profiles as
|
|
599
|
+
:class:`~glpi_python_client.UserAuthorization` rows: the row ``id``, the
|
|
600
|
+
``profile_id`` and ``entity_id``, and the ``is_recursive``, ``is_dynamic``
|
|
601
|
+
and ``is_default_profile`` flags.
|
|
602
|
+
* ``add_user_authorization(user_id, profile_id=..., entity_id=...,
|
|
603
|
+
recursive=False)`` grants a profile in an entity and returns the new row id.
|
|
604
|
+
* ``update_user_authorization(authorization_id, entity_id=None,
|
|
605
|
+
recursive=None)`` moves a row to another entity or changes its recursion;
|
|
606
|
+
with neither argument it raises ``GlpiValidationError`` without a request.
|
|
607
|
+
* ``delete_user_authorization(authorization_id)`` removes a row.
|
|
608
|
+
|
|
609
|
+
The v1 API answers a refused write with a success status and a body such as
|
|
610
|
+
``[{"7": false, "message": "..."}]``. These helpers raise
|
|
611
|
+
``GlpiProtocolError`` with that message instead of returning as if it had
|
|
612
|
+
worked.
|
|
613
|
+
|
|
614
|
+
.. code-block:: python
|
|
615
|
+
|
|
616
|
+
await client.set_group_recursive(119)
|
|
617
|
+
rows = await client.list_user_authorizations(2568)
|
|
618
|
+
await client.update_user_authorization(rows[0].id, entity_id=493, recursive=True)
|
|
619
|
+
|
|
620
|
+
Writing the take-into-account stamp
|
|
621
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
622
|
+
|
|
623
|
+
GLPI stamps ``take_into_account_date`` on a ticket the first time an account
|
|
624
|
+
allowed to take it into account writes to it, which makes the time-to-own
|
|
625
|
+
statistic nearly zero for a ticket a connector has just created. The v2
|
|
626
|
+
``Ticket`` schema exposes the date as read-only and ignores the
|
|
627
|
+
``_do_not_compute_takeintoaccount`` flag, so both helpers below go through the
|
|
628
|
+
legacy v1 session (``v1_base_url`` and ``v1_user_token``); without one they
|
|
629
|
+
raise ``RuntimeError``, and a refused write raises ``GlpiProtocolError``.
|
|
630
|
+
|
|
631
|
+
* ``change_ticket_take_into_account(ticket_id, *, take_into_account_date,
|
|
632
|
+
take_into_account_duration, do_not_compute=True, disable_notifications=True)``
|
|
633
|
+
writes the date (an aware value is converted to ``server_timezone``, a
|
|
634
|
+
naive one is taken as already on it) and the duration in seconds. GLPI
|
|
635
|
+
writes a null date whenever the duration is 0.
|
|
636
|
+
* ``clear_ticket_take_into_account(ticket_id, *, do_not_compute=True,
|
|
637
|
+
disable_notifications=True)`` is that change with a null date and a 0
|
|
638
|
+
duration.
|
|
639
|
+
|
|
640
|
+
``do_not_compute`` sends ``_do_not_compute_takeintoaccount``, which keeps GLPI
|
|
641
|
+
from stamping the ticket again in the same write; with it off, a clear made
|
|
642
|
+
by an account allowed to take the ticket into account is undone at once.
|
|
643
|
+
``disable_notifications`` sends ``_disablenotif``, which suppresses the
|
|
644
|
+
"ticket updated" notification. GLPI tests ``_disablenotif`` for presence, so a
|
|
645
|
+
``False`` flag is left out of the request rather than sent as ``false``. Read
|
|
646
|
+
the result back with ``get_ticket`` (``take_into_account_date`` and
|
|
647
|
+
``take_into_account_duration``).
|
|
648
|
+
|
|
649
|
+
.. code-block:: python
|
|
650
|
+
|
|
651
|
+
await client.clear_ticket_take_into_account(321)
|
|
652
|
+
await client.change_ticket_take_into_account(
|
|
653
|
+
321,
|
|
654
|
+
take_into_account_date=datetime(2026, 11, 2, 9, 30, tzinfo=UTC),
|
|
655
|
+
take_into_account_duration=600,
|
|
656
|
+
disable_notifications=False,
|
|
657
|
+
)
|
|
658
|
+
|
|
585
659
|
Documents linked to a followup
|
|
586
660
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
587
661
|
|
|
@@ -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"]
|