diff --git a/method/resource.py b/method/resource.py index 571dd99..272a432 100644 --- a/method/resource.py +++ b/method/resource.py @@ -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: diff --git a/method/resources/Account.py b/method/resources/Account.py index a0777d8..d44a1c9 100644 --- a/method/resources/Account.py +++ b/method/resources/Account.py @@ -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)) diff --git a/setup.py b/setup.py index edb33ef..de1c3de 100644 --- a/setup.py +++ b/setup.py @@ -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',