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
4 changes: 4 additions & 0 deletions method/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def _update_with_sub_path(self, path: str, data: Dict) -> Any:
@MethodError.catch
def _delete(self, _id: str) -> Any:
return self.client(_id).DELETE().json().get('data')

@MethodError.catch
def _delete_with_sub_path(self, path: str) -> Any:
return self.client(path).DELETE().json().get('data')

@MethodError.catch
def _download(self, _id: str) -> str:
Expand Down
13 changes: 8 additions & 5 deletions method/resources/Account.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ def list(self, params: Optional[AccountListOpts] = None) -> List[Account]:
def create(self, opts: AccountCreateOpts, request_opts: Optional[RequestOpts] = None) -> Account:
return super(AccountResource, self)._create(opts, request_opts)

def get_detail(self, _id: str) -> AccountDetail:
return super(AccountResource, self)._get_with_sub_path('{_id}/detail'.format(_id=_id))

def get_transactions(self, _id: str) -> List[AccountTransaction]:
return super(AccountResource, self)._get_with_sub_path('{_id}/transactions'.format(_id=_id))
def get_details(self, _id: str) -> AccountDetail:
return super(AccountResource, self)._get_with_sub_path('{_id}/details'.format(_id=_id))

def enroll_auto_syncs(self, _id: str) -> Account:
return super(AccountResource, self)._create_with_sub_path('{_id}/sync_enrollment'.format(_id=_id), {})

def unenroll_auto_syncs(self, _id: str) -> Account:
return super(AccountResource, self)._delete_with_sub_path('{_id}/sync_enrollment'.format(_id=_id))
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.29',
version='0.0.30',
description='Python library for the Method API',
long_description='Python library for the Method API',
long_description_content_type='text/x-rst',
Expand Down