Skip to content

Commit 60cb884

Browse files
authored
list endpoints for products + tests (#43)
* list endpoints for products * test coverage
1 parent 8b21167 commit 60cb884

17 files changed

Lines changed: 303 additions & 40 deletions

method/resources/Accounts/Balances.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from typing import TypedDict, Optional, Literal
1+
from typing import List, TypedDict, Optional, Literal
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66

@@ -28,6 +28,9 @@ def __init__(self, config: Configuration):
2828

2929
def retrieve(self, bal_id: str) -> MethodResponse[AccountBalance]:
3030
return super(AccountBalancesResource, self)._get_with_id(bal_id)
31+
32+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[AccountBalance]]:
33+
return super(AccountBalancesResource, self)._list(params)
3134

3235
def create(self) -> MethodResponse[AccountBalance]:
3336
return super(AccountBalancesResource, self)._create({})

method/resources/Accounts/CardBrands.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import TypedDict, Optional, Literal, List
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66

@@ -32,5 +32,8 @@ def __init__(self, config: Configuration):
3232
def retrieve(self, crbd_id: str) -> MethodResponse[AccountCardBrand]:
3333
return super(AccountCardBrandsResource, self)._get_with_id(crbd_id)
3434

35+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[AccountCardBrand]]:
36+
return super(AccountCardBrandsResource, self)._list(params)
37+
3538
def create(self) -> MethodResponse[AccountCardBrand]:
3639
return super(AccountCardBrandsResource, self)._create({})

method/resources/Accounts/Payoffs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from typing import TypedDict, Optional, Literal
1+
from typing import List, TypedDict, Optional, Literal
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66

@@ -32,5 +32,8 @@ def __init__(self, config: Configuration):
3232
def retrieve(self, pyf_id: str) -> MethodResponse[AccountPayoff]:
3333
return super(AccountPayoffsResource, self)._get_with_id(pyf_id)
3434

35+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[AccountPayoff]]:
36+
return super(AccountPayoffsResource, self)._list(params)
37+
3538
def create(self) -> MethodResponse[AccountPayoff]:
3639
return super(AccountPayoffsResource, self)._create({})

method/resources/Accounts/Sensitive.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import TypedDict, Optional, Literal, List
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66

@@ -52,6 +52,9 @@ def __init__(self, config: Configuration):
5252

5353
def retrieve(self, astv_id: str) -> MethodResponse[AccountSensitive]:
5454
return super(AccountSensitiveResource, self)._get_with_id(astv_id)
55+
56+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[AccountSensitive]]:
57+
return super(AccountSensitiveResource, self)._list(params)
5558

5659
def create(self, data: AccountSensitiveCreateOpts) -> MethodResponse[AccountSensitive]:
5760
return super(AccountSensitiveResource, self)._create(data)

method/resources/Accounts/VerificationSessions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import TypedDict, Optional, List, Literal, Union
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66
from method.resources.Accounts.ExternalTypes import PlaidBalance, PlaidTransaction, MXAccount, MXTransaction, TellerBalance, TellerTransaction
@@ -157,6 +157,9 @@ def create(self, opts: AccountVerificationSessionCreateOpts) -> MethodResponse[A
157157

158158
def retrieve(self, avs_id: str) -> MethodResponse[AccountVerificationSession]:
159159
return super(AccountVerificationSessionResource, self)._get_with_id(avs_id)
160+
161+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[AccountVerificationSession]]:
162+
return super(AccountVerificationSessionResource, self)._list(params)
160163

161164
def update(self, avs_id: str, opts: AccountVerificationSessionUpdateOpts) -> MethodResponse[AccountVerificationSession]:
162165
return super(AccountVerificationSessionResource, self)._update_with_id(avs_id, opts)

method/resources/Entities/Attributes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import TypedDict, Optional, Literal, List
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66

@@ -51,6 +51,9 @@ def __init__(self, config: Configuration):
5151

5252
def retrieve(self, attr_id: str) -> MethodResponse[EntityAttributes]:
5353
return super(EntityAttributesResource, self)._get_with_id(attr_id)
54+
55+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[EntityAttributes]]:
56+
return super(EntityAttributesResource, self)._list(params)
5457

5558
def create(self) -> MethodResponse[EntityAttributes]:
5659
return super(EntityAttributesResource, self)._create({})

method/resources/Entities/Connect.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import TypedDict, Optional, Literal, List
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66

@@ -28,6 +28,9 @@ def __init__(self, config: Configuration):
2828

2929
def retrieve(self, cxn_id: str) -> MethodResponse[EntityConnect]:
3030
return super(EntityConnectResource, self)._get_with_id(cxn_id)
31+
32+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[EntityConnect]]:
33+
return super(EntityConnectResource, self)._list(params)
3134

3235
def create(self) -> MethodResponse[EntityConnect]:
3336
return super(EntityConnectResource, self)._create({})

method/resources/Entities/CreditScores.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import TypedDict, Optional, List, Literal
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66
from method.resources.Entities.Types import EntityStatusesLiterals, CreditReportBureausLiterals
@@ -42,6 +42,9 @@ def __init__(self, config: Configuration):
4242

4343
def retrieve(self, crs_id: str) -> MethodResponse[EntityCreditScores]:
4444
return super(EntityCreditScoresResource, self)._get_with_id(crs_id)
45+
46+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[EntityCreditScores]]:
47+
return super(EntityCreditScoresResource, self)._list(params)
4548

4649
def create(self) -> MethodResponse[EntityCreditScores]:
4750
return super(EntityCreditScoresResource, self)._create({})

method/resources/Entities/Identities.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import TypedDict, Optional, Literal, List
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55
from method.errors import ResourceError
66
from method.resources.Entities.Types import EntityIdentityType
@@ -29,6 +29,9 @@ def __init__(self, config: Configuration):
2929

3030
def retrieve(self, identity_id: str) -> MethodResponse[EntityIdentity]:
3131
return super(EntityIdentityResource, self)._get_with_id(identity_id)
32+
33+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[EntityIdentity]]:
34+
return super(EntityIdentityResource, self)._list(params)
3235

3336
def create(self, opts: Optional[EntityIdentityType] = {}) -> MethodResponse[EntityIdentity]: # pylint: disable=dangerous-default-value
3437
return super(EntityIdentityResource, self)._create(opts)

method/resources/Entities/Sensitive.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import TypedDict, Optional, List
22

3-
from method.resource import MethodResponse, Resource
3+
from method.resource import MethodResponse, Resource, ResourceListOpts
44
from method.configuration import Configuration
55

66
from method.resources.Entities.Types import EntityKYCAddressRecordData, EntityIdentityType
@@ -27,3 +27,6 @@ def __init__(self, config: Configuration):
2727

2828
def retrieve(self) -> MethodResponse[EntitySensitive]:
2929
return super(EntitySensitiveResource, self)._get()
30+
31+
def list(self, params: Optional[ResourceListOpts] = None) -> MethodResponse[List[EntitySensitive]]:
32+
return super(EntitySensitiveResource, self)._list(params)

0 commit comments

Comments
 (0)