Skip to content

Commit 655dba0

Browse files
committed
pre release omni
1 parent d363c4e commit 655dba0

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

cuenca/resources/balance_entries.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import ClassVar, TypeVar, cast
1+
from typing import ClassVar, Optional, TypeVar, cast
22

33
from cuenca_validations.types import EntryType
44
from pydantic.dataclasses import dataclass
@@ -24,14 +24,16 @@ class BalanceEntry(Retrievable, Queryable):
2424
rolling_balance: int
2525
type: EntryType
2626
related_transaction_uri: str
27-
funding_instrument_uri: str
27+
funding_instrument_uri: Optional[str]
2828

2929
@property # type: ignore
3030
def related_transaction(self) -> Transaction:
3131
return cast(Transaction, retrieve_uri(self.related_transaction_uri))
3232

3333
@property # type: ignore
34-
def funding_instrument(self) -> FundingInstrument:
34+
def funding_instrument(self) -> Optional[FundingInstrument]:
35+
if not self.funding_instrument_uri:
36+
return None
3537
return cast(
3638
FundingInstrument,
3739
retrieve_uri(self.funding_instrument_uri),

cuenca/resources/deposits.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ class Deposit(Transaction):
1414
_query_params: ClassVar = DepositQuery
1515

1616
network: DepositNetwork
17-
source_uri: str
17+
source_uri: Optional[str]
1818
tracking_key: Optional[str] # clave rastreo if network is SPEI
1919

2020
@property # type: ignore
21-
def source(self) -> Account:
21+
def source(self) -> Optional[Account]:
22+
if not self.source_uri:
23+
return None
2224
return cast(Account, retrieve_uri(self.source_uri))

cuenca/resources/transfers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ class Transfer(Transaction, Creatable):
2626
account_number: str
2727
idempotency_key: str
2828
network: TransferNetwork
29-
destination_uri: str
29+
destination_uri: Optional[str]
3030
tracking_key: Optional[str] # clave rastreo if network is SPEI
3131

3232
@property # type: ignore
3333
def destination(self) -> Optional[Account]:
34+
if not self.destination_uri:
35+
return None
3436
return cast(Account, retrieve_uri(self.destination_uri))
3537

3638
@classmethod

cuenca/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '0.7.2'
1+
__version__ = '0.7.3.dev0'
22
CLIENT_VERSION = __version__
33
API_VERSION = '2020-03-19'

0 commit comments

Comments
 (0)