forked from doe-iri/iri-facility-api-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfacility_adapter.py
More file actions
28 lines (23 loc) · 945 Bytes
/
Copy pathfacility_adapter.py
File metadata and controls
28 lines (23 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from abc import ABC, abstractmethod
from . import models as facility_models
class FacilityAdapter(ABC):
"""
Facility-specific code is handled by the implementation of this interface.
Use the `IRI_API_ADAPTER_<domain>` environment variable to install your
facility adapter before the API starts.
"""
@abstractmethod
async def get_facility(self: "FacilityAdapter", modified_since: str | None = None) -> facility_models.Facility | None:
pass
@abstractmethod
async def list_sites(
self: "FacilityAdapter", modified_since: str | None = None, name: str | None = None, offset: int | None = None, limit: int | None = None, short_name: str | None = None
) -> list[facility_models.Site]:
pass
@abstractmethod
async def get_site(
self: "FacilityAdapter",
site_id: str,
modified_since: str | None = None,
) -> facility_models.Site | None:
pass