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
6 changes: 6 additions & 0 deletions method/resources/Account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]


Expand Down
13 changes: 11 additions & 2 deletions method/resources/Entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand All @@ -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)
16 changes: 14 additions & 2 deletions method/resources/Payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down