Skip to content

Commit

Permalink
refactor: update type hints to use built-in list
Browse files Browse the repository at this point in the history
  • Loading branch information
gabino committed Jan 9, 2025
1 parent 19081ee commit 1712d33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cuenca/resources/endpoints.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List, Optional, cast
from typing import ClassVar, Optional, cast

from cuenca_validations.types import HttpUrlString
from cuenca_validations.types.enums import WebhookEvent
Expand Down Expand Up @@ -26,7 +26,7 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
description='Allows user to turn-off the endpoint without the '
'need of deleting it',
)
events: List[WebhookEvent] = Field(
events: list[WebhookEvent] = Field(
...,
description='list of enabled events. If None, all events will '
'be enabled for this Endpoint',
Expand Down Expand Up @@ -56,7 +56,7 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
def create(
cls,
url: HttpUrl,
events: Optional[List[WebhookEvent]] = None,
events: Optional[list[WebhookEvent]] = None,
*,
session: Session = global_session,
) -> 'Endpoint':
Expand All @@ -79,7 +79,7 @@ def update(
cls,
endpoint_id: str,
url: Optional[HttpUrl] = None,
events: Optional[List[WebhookEvent]] = None,
events: Optional[list[WebhookEvent]] = None,
is_enable: Optional[bool] = None,
*,
session: Session = global_session,
Expand Down
6 changes: 3 additions & 3 deletions cuenca/resources/kyc_validations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List, Optional, cast
from typing import ClassVar, Optional, cast

from cuenca_validations.types import KYCFile, KYCValidationRequest
from pydantic import ConfigDict
Expand All @@ -12,7 +12,7 @@ class KYCValidation(Creatable, Retrievable, Queryable):
platform_id: str
attemps: Optional[int] = None
verification_id: Optional[str] = None
files_uri: Optional[List[str]] = None
files_uri: Optional[list[str]] = None
model_config = ConfigDict(
json_schema_extra={
'example': {
Expand All @@ -31,7 +31,7 @@ def create(
cls,
user_id: str,
force: bool = False,
documents: List[KYCFile] = [],
documents: list[KYCFile] = [],
session: Session = global_session,
) -> 'KYCValidation':
req = KYCValidationRequest(
Expand Down
4 changes: 2 additions & 2 deletions cuenca/resources/transfers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime as dt
from typing import ClassVar, List, Optional, cast
from typing import ClassVar, Optional, cast

from clabe import Clabe
from cuenca_validations.types import (
Expand Down Expand Up @@ -73,7 +73,7 @@ def create(
return cast('Transfer', cls._create(**req.model_dump()))

@classmethod
def create_many(cls, requests: List[TransferRequest]) -> DictStrAny:
def create_many(cls, requests: list[TransferRequest]) -> DictStrAny:
transfers: DictStrAny = dict(submitted=[], errors=[])
for req in requests:
try:
Expand Down

0 comments on commit 1712d33

Please sign in to comment.