diff --git a/method/resources/Account.py b/method/resources/Account.py index 8db0908..dae4fbc 100644 --- a/method/resources/Account.py +++ b/method/resources/Account.py @@ -145,6 +145,12 @@ class AccountTransaction(TypedDict): class AccountListOpts(TypedDict): + to_date: Optional[str] + from_date: Optional[str] + page: Optional[str | int] + page_limit: Optional[str | int] + status: Optional[str] + type: Optional[str] holder_id: Optional[str] diff --git a/method/resources/Entity.py b/method/resources/Entity.py index b1758a0..cceb4e8 100644 --- a/method/resources/Entity.py +++ b/method/resources/Entity.py @@ -98,6 +98,15 @@ class EntityUpdateOpts(TypedDict): address: Optional[EntityAddress] +class EntityListOpts(TypedDict): + to_date: Optional[str] + from_date: Optional[str] + page: Optional[str | int] + page_limit: Optional[str | int] + status: Optional[str] + type: Optional[str] + + class EntityResource(Resource): def __init__(self, config: Configuration): super(EntityResource, self).__init__(config.add_path('entities')) @@ -111,5 +120,5 @@ def update(self, _id: str, opts: EntityCreateOpts) -> Entity: def get(self, _id: str) -> Entity: return super(EntityResource, self)._get_with_id(_id) - def list(self) -> List[Entity]: - return super(EntityResource, self)._list(None) + def list(self, params: EntityListOpts = None) -> List[Entity]: + return super(EntityResource, self)._list(params) diff --git a/method/resources/Payment.py b/method/resources/Payment.py index 1998642..204859f 100644 --- a/method/resources/Payment.py +++ b/method/resources/Payment.py @@ -61,6 +61,18 @@ class PaymentCreateOpts(TypedDict): metadata: Optional[Dict[str, Any]] +class PaymentListOpts(TypedDict): + to_date: Optional[str] + from_date: Optional[str] + page: Optional[str | int] + page_limit: Optional[str | int] + status: Optional[str] + type: Optional[str] + source: Optional[str] + destination: Optional[str] + reversal_id: Optional[str] + + class PaymentSubResources: reversals: ReversalResource @@ -78,8 +90,8 @@ def __call__(self, _id: str) -> PaymentSubResources: def get(self, _id: str) -> Payment: return super(PaymentResource, self)._get_with_id(_id) - def list(self) -> List[Payment]: - return super(PaymentResource, self)._list(None) + def list(self, params: Optional[PaymentListOpts] = None) -> List[Payment]: + return super(PaymentResource, self)._list(params) def create(self, opts: PaymentCreateOpts, request_opts: Optional[RequestOpts] = None) -> Payment: return super(PaymentResource, self)._create(opts, request_opts) diff --git a/setup.py b/setup.py index d76e1e0..c44efc8 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='method-python', - version='0.0.16', + version='0.0.17', description='Python library for the Method API', author='Marco del Carmen', author_email='marco@mdelcarmen.me',