neris-api-client 1.4.0__tar.gz → 1.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neris_api_client
3
- Version: 1.4.0
3
+ Version: 1.5.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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "neris_api_client"
7
- version = "1.4.0"
7
+ version = "1.5.0"
8
8
  authors = [
9
9
  { name="Ben Coleman", email="ben.coleman@ul.org" },
10
10
  { name="Tommy Messbauer", email="thomas.messbauer@ul.org" },
@@ -11,6 +11,10 @@ from pydantic import BaseModel
11
11
  from .config import Config, GrantType, TokenSet
12
12
 
13
13
  from .models import (
14
+ DeptSortBy,
15
+ StatesTerrs,
16
+ SortDirection,
17
+ TypeEntityValue,
14
18
  IncidentPayload,
15
19
  PatchUnitPayload,
16
20
  CreateUnitPayload,
@@ -228,6 +232,37 @@ class NerisApiClient(_NerisApiClient):
228
232
  def get_entity(self, neris_id: str) -> Dict[str, Any]:
229
233
  return self._call("get", f"/entity/{neris_id}")
230
234
 
235
+ def list_entities(
236
+ self,
237
+ name: str | None = None,
238
+ neris_id: str | None = None,
239
+ state: StatesTerrs | None = None,
240
+ entity_subtype: TypeEntityValue | None = None,
241
+ last_modified: str | None = None,
242
+ page_number: int | None = None,
243
+ page_size: int | None = None,
244
+ sort_by: DeptSortBy | None = None,
245
+ sort_direction: SortDirection | None = None,
246
+ ) -> Dict[str, Any]:
247
+ params = dict(
248
+ name=name,
249
+ neris_id=neris_id,
250
+ state=state,
251
+ entity_subtype=entity_subtype,
252
+ last_modified=last_modified,
253
+ page_number=page_number,
254
+ page_size=page_size,
255
+ sort_by=sort_by,
256
+ sort_direction=sort_direction,
257
+ )
258
+
259
+ # delete null params
260
+ for k in list(params.keys()):
261
+ if params[k] is None:
262
+ del params[k]
263
+
264
+ return self._call("get", "/entity", params=params)
265
+
231
266
  def create_entity(self, body: str | Dict[str, Any]) -> Dict[str, Any]:
232
267
  return self._call("post", "/entity/", body, model=CreateDepartmentPayload)
233
268
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neris_api_client
3
- Version: 1.4.0
3
+ Version: 1.5.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