Skip to content

Commit 832936f

Browse files
committed
Add Compliance types and rename compliance_params to compliance
Ref: #69
1 parent 9aa91ce commit 832936f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

aidbox_python_sdk/sdk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from .aidboxpy import AsyncAidboxClient
99
from .db_migrations import sdk_migrations
10+
from .types import Compliance
1011

1112
logger = logging.getLogger("aidbox_sdk")
1213

@@ -152,7 +153,7 @@ def operation( # noqa: PLR0913
152153
access_policy=None,
153154
request_schema=None,
154155
timeout=None,
155-
compliance_params: Optional[Dict[str, Any]] = None,
156+
compliance: Optional[Compliance] = None,
156157
):
157158
if public and access_policy is not None:
158159
raise ValueError("Operation might be public or have access policy, not both")
@@ -186,7 +187,7 @@ def wrapped_func(operation, request):
186187
"method": method,
187188
"path": path,
188189
**({"timeout": timeout} if timeout else {}),
189-
**(compliance_params if compliance_params else {}),
190+
**(compliance if compliance else {}),
190191
}
191192
self._operation_handlers[operation_id] = wrapped_func
192193
if public is True:

aidbox_python_sdk/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
from aiohttp import web
44
from typing_extensions import TypedDict
55

6+
class Compliance(TypedDict, total=True):
7+
fhirUrl: str
8+
fhirCode: str
9+
fhirResource: list[str]
10+
611
SDKOperationRequest = TypedDict(
712
"SDKOperationRequest",
813
{"app": web.Application, "params": dict, "route-params": dict, "headers": dict, "resource": Any},

0 commit comments

Comments
 (0)