Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions sdk/src/opendecree/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,25 @@ def _metadata(self) -> list[tuple[str, str]]:
async def get(self, tenant_id: str, field_path: str) -> str: ...

@overload
async def get(self, tenant_id: str, field_path: str, type: type[bool]) -> bool: ...
async def get(self, tenant_id: str, field_path: str, value_type: type[bool]) -> bool: ...

@overload
async def get(self, tenant_id: str, field_path: str, type: type[int]) -> int: ...
async def get(self, tenant_id: str, field_path: str, value_type: type[int]) -> int: ...

@overload
async def get(self, tenant_id: str, field_path: str, type: type[float]) -> float: ...
async def get(self, tenant_id: str, field_path: str, value_type: type[float]) -> float: ...

@overload
async def get(self, tenant_id: str, field_path: str, type: type[timedelta]) -> timedelta: ...
async def get(
self, tenant_id: str, field_path: str, value_type: type[timedelta]
) -> timedelta: ...

@overload
async def get(
self,
tenant_id: str,
field_path: str,
type: type[str],
value_type: type[str],
*,
nullable: bool,
) -> str | None: ...
Expand All @@ -186,7 +188,7 @@ async def get(
self,
tenant_id: str,
field_path: str,
type: type | None = None,
value_type: type | None = None,
*,
nullable: bool = False,
) -> object:
Expand All @@ -198,7 +200,7 @@ async def get(
Args:
tenant_id: Tenant UUID.
field_path: Dot-separated field path (e.g., "payments.fee").
type: Target type (str, int, float, bool, timedelta). Defaults to str.
value_type: Target type (str, int, float, bool, timedelta). Defaults to str.
nullable: If True, return None for null/unset values instead of raising.

Returns:
Expand All @@ -208,7 +210,7 @@ async def get(
NotFoundError: If the field has no value (and nullable is False).
TypeMismatchError: If the value cannot be converted to the requested type.
"""
target_type = type or str
target_type = value_type or str

async def _call() -> object:
resp = await self._stub.GetField(
Expand Down
16 changes: 8 additions & 8 deletions sdk/src/opendecree/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,23 +176,23 @@ def check_compatibility(self) -> None:
def get(self, tenant_id: str, field_path: str) -> str: ...

@overload
def get(self, tenant_id: str, field_path: str, type: type[bool]) -> bool: ...
def get(self, tenant_id: str, field_path: str, value_type: type[bool]) -> bool: ...

@overload
def get(self, tenant_id: str, field_path: str, type: type[int]) -> int: ...
def get(self, tenant_id: str, field_path: str, value_type: type[int]) -> int: ...

@overload
def get(self, tenant_id: str, field_path: str, type: type[float]) -> float: ...
def get(self, tenant_id: str, field_path: str, value_type: type[float]) -> float: ...

@overload
def get(self, tenant_id: str, field_path: str, type: type[timedelta]) -> timedelta: ...
def get(self, tenant_id: str, field_path: str, value_type: type[timedelta]) -> timedelta: ...

@overload
def get(
self,
tenant_id: str,
field_path: str,
type: type[str],
value_type: type[str],
*,
nullable: bool,
) -> str | None: ...
Expand All @@ -201,7 +201,7 @@ def get(
self,
tenant_id: str,
field_path: str,
type: type | None = None,
value_type: type | None = None,
*,
nullable: bool = False,
) -> object:
Expand All @@ -213,7 +213,7 @@ def get(
Args:
tenant_id: Tenant UUID.
field_path: Dot-separated field path (e.g., "payments.fee").
type: Target type (str, int, float, bool, timedelta). Defaults to str.
value_type: Target type (str, int, float, bool, timedelta). Defaults to str.
nullable: If True, return None for null/unset values instead of raising.

Returns:
Expand All @@ -223,7 +223,7 @@ def get(
NotFoundError: If the field has no value (and nullable is False).
TypeMismatchError: If the value cannot be converted to the requested type.
"""
target_type = type or str
target_type = value_type or str

def _call() -> object:
resp = self._stub.GetField(
Expand Down