neris-api-client 1.3.6__tar.gz → 1.4.0__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.
- {neris_api_client-1.3.6/src/neris_api_client.egg-info → neris_api_client-1.4.0}/PKG-INFO +1 -1
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/pyproject.toml +1 -1
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/src/neris_api_client/client.py +41 -1
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/src/neris_api_client/models.py +704 -671
- {neris_api_client-1.3.6 → neris_api_client-1.4.0/src/neris_api_client.egg-info}/PKG-INFO +1 -1
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/LICENSE +0 -0
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/README.md +0 -0
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/setup.cfg +0 -0
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/src/neris_api_client/__init__.py +0 -0
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/src/neris_api_client/config.py +0 -0
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/src/neris_api_client.egg-info/SOURCES.txt +0 -0
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/src/neris_api_client.egg-info/dependency_links.txt +0 -0
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/src/neris_api_client.egg-info/requires.txt +0 -0
- {neris_api_client-1.3.6 → neris_api_client-1.4.0}/src/neris_api_client.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neris_api_client
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: NERIS API Client
|
|
5
5
|
Author-email: Ben Coleman <ben.coleman@ul.org>, Tommy Messbauer <thomas.messbauer@ul.org>, Joseph Pagani <joseph.pagani@ul.org>
|
|
6
6
|
Project-URL: Homepage, https://github.com/ulfsri/neris-api-client
|
|
@@ -2,7 +2,7 @@ import base64
|
|
|
2
2
|
from http import HTTPStatus
|
|
3
3
|
import json
|
|
4
4
|
from uuid import UUID
|
|
5
|
-
from typing import List, Optional, Dict, Any
|
|
5
|
+
from typing import List, Optional, Dict, Any, Literal
|
|
6
6
|
from datetime import datetime, timedelta
|
|
7
7
|
|
|
8
8
|
import requests
|
|
@@ -283,6 +283,46 @@ class NerisApiClient(_NerisApiClient):
|
|
|
283
283
|
"post", f"/incident/{neris_id}/validate", data=body, model=IncidentPayload
|
|
284
284
|
)
|
|
285
285
|
|
|
286
|
+
def list_incidents(
|
|
287
|
+
self,
|
|
288
|
+
*,
|
|
289
|
+
neris_id_entity: str | None = None,
|
|
290
|
+
incident_types: list[str] | None = None,
|
|
291
|
+
incident_types_set_operation: Literal["UNION", "INTERSECTION"] | None = None,
|
|
292
|
+
call_create_start: datetime | None = None,
|
|
293
|
+
call_create_end: datetime | None = None,
|
|
294
|
+
incident_number: str | None = None,
|
|
295
|
+
dispatch_incident_number: str | None = None,
|
|
296
|
+
status: list[Literal["APPROVED", "PENDING_APPROVAL", "REJECTED", "SUBMITTED"]] | None = None,
|
|
297
|
+
last_modified: str | None = None,
|
|
298
|
+
sort_by: Literal["call_create", "neris_id_entity", "incident_number", "dispatch_incident_number", "status", "last_modified"] | None = None,
|
|
299
|
+
sort_direction: Literal["ASCENDING", "DESCENDING"] | None = None,
|
|
300
|
+
page_size: int | None = None,
|
|
301
|
+
cursor: str | None = None,
|
|
302
|
+
) -> dict[str, Any]:
|
|
303
|
+
params = dict(
|
|
304
|
+
neris_id_entity=neris_id_entity,
|
|
305
|
+
incident_types=incident_types,
|
|
306
|
+
incident_types_set_operation=incident_types_set_operation,
|
|
307
|
+
call_create_start=call_create_start and call_create_start.isoformat(),
|
|
308
|
+
call_create_end=call_create_end and call_create_end.isoformat(),
|
|
309
|
+
incident_number=incident_number,
|
|
310
|
+
dispatch_incident_number=dispatch_incident_number,
|
|
311
|
+
status=status,
|
|
312
|
+
last_modified=last_modified,
|
|
313
|
+
sort_by=sort_by,
|
|
314
|
+
sort_direction=sort_direction,
|
|
315
|
+
page_size=page_size,
|
|
316
|
+
cursor=cursor,
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
# delete null params
|
|
320
|
+
for k in list(params.keys()):
|
|
321
|
+
if params[k] is None:
|
|
322
|
+
del params[k]
|
|
323
|
+
|
|
324
|
+
return self._call("get", "/incident", params=params)
|
|
325
|
+
|
|
286
326
|
def patch_entity(self, neris_id: str, body: str | Dict[str, Any]) -> Dict[str, Any]:
|
|
287
327
|
return self._call("patch", f"/entity/{neris_id}", data=body, model=PatchDepartmentPayload)
|
|
288
328
|
|