belvo.resources.statements
1from typing import Dict, List, Union 2 3from belvo.resources.base import Resource 4 5 6class Statements(Resource): 7 """ 8 <br> 9 <div style="background-color:#f9c806; border-left: 6px solid #f9c806;padding: 12px;margin-left: 25px; border-radius: 4px; margin-right: 25px"> 10 <strong>⚠️ Sunset notice: </strong> The Statements resource is due to be sunsetted on 09.05.2022. After which, we will no longer support the resource and we will remove it from our documentation, API, and SDKs. 11 </div> 12 13 """ 14 15 endpoint = "/api/statements/" 16 17 def create( 18 self, 19 link: str, 20 account: str, 21 year: str, 22 month: str, 23 *, 24 attach_pdf: bool = False, 25 save_data: bool = True, 26 raise_exception: bool = False, 27 **kwargs: Dict, 28 ) -> Union[List[Dict], Dict]: 29 """ 30 <br> 31 <div style="background-color:#f9c806; border-left: 6px solid #f9c806;padding: 12px;margin-left: 25px; border-radius: 4px; margin-right: 25px"> 32 <strong>⚠️ Sunset notice: </strong> The Statements resource is due to be sunsetted on 09.05.2022. After which, we will no longer support the resource and we will remove it from our documentation, API, and SDKs. 33 </div> 34 35 """ 36 37 data = { 38 "link": link, 39 "account": account, 40 "year": year, 41 "month": month, 42 "attach_pdf": attach_pdf, 43 "save_data": save_data, 44 } 45 46 return self.session.post( 47 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 48 ) 49 50 def resume( 51 self, 52 session: str, 53 token: str, 54 *, 55 link: str = None, 56 account: str = None, 57 raise_exception: bool = False, 58 **kwargs, 59 ) -> Union[List[Dict], Dict]: 60 data = {"session": session, "token": token} 61 62 if link is not None: 63 data.update(link=link) 64 65 if account is not None: 66 data.update(account=account) 67 68 return self.session.patch( 69 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 70 )
7class Statements(Resource): 8 """ 9 <br> 10 <div style="background-color:#f9c806; border-left: 6px solid #f9c806;padding: 12px;margin-left: 25px; border-radius: 4px; margin-right: 25px"> 11 <strong>⚠️ Sunset notice: </strong> The Statements resource is due to be sunsetted on 09.05.2022. After which, we will no longer support the resource and we will remove it from our documentation, API, and SDKs. 12 </div> 13 14 """ 15 16 endpoint = "/api/statements/" 17 18 def create( 19 self, 20 link: str, 21 account: str, 22 year: str, 23 month: str, 24 *, 25 attach_pdf: bool = False, 26 save_data: bool = True, 27 raise_exception: bool = False, 28 **kwargs: Dict, 29 ) -> Union[List[Dict], Dict]: 30 """ 31 <br> 32 <div style="background-color:#f9c806; border-left: 6px solid #f9c806;padding: 12px;margin-left: 25px; border-radius: 4px; margin-right: 25px"> 33 <strong>⚠️ Sunset notice: </strong> The Statements resource is due to be sunsetted on 09.05.2022. After which, we will no longer support the resource and we will remove it from our documentation, API, and SDKs. 34 </div> 35 36 """ 37 38 data = { 39 "link": link, 40 "account": account, 41 "year": year, 42 "month": month, 43 "attach_pdf": attach_pdf, 44 "save_data": save_data, 45 } 46 47 return self.session.post( 48 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 49 ) 50 51 def resume( 52 self, 53 session: str, 54 token: str, 55 *, 56 link: str = None, 57 account: str = None, 58 raise_exception: bool = False, 59 **kwargs, 60 ) -> Union[List[Dict], Dict]: 61 data = {"session": session, "token": token} 62 63 if link is not None: 64 data.update(link=link) 65 66 if account is not None: 67 data.update(account=account) 68 69 return self.session.patch( 70 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 71 )
⚠️ Sunset notice: The Statements resource is due to be sunsetted on 09.05.2022. After which, we will no longer support the resource and we will remove it from our documentation, API, and SDKs.
def
create( self, link: str, account: str, year: str, month: str, *, attach_pdf: bool = False, save_data: bool = True, raise_exception: bool = False, **kwargs: Dict) -> Union[List[Dict], Dict]:
18 def create( 19 self, 20 link: str, 21 account: str, 22 year: str, 23 month: str, 24 *, 25 attach_pdf: bool = False, 26 save_data: bool = True, 27 raise_exception: bool = False, 28 **kwargs: Dict, 29 ) -> Union[List[Dict], Dict]: 30 """ 31 <br> 32 <div style="background-color:#f9c806; border-left: 6px solid #f9c806;padding: 12px;margin-left: 25px; border-radius: 4px; margin-right: 25px"> 33 <strong>⚠️ Sunset notice: </strong> The Statements resource is due to be sunsetted on 09.05.2022. After which, we will no longer support the resource and we will remove it from our documentation, API, and SDKs. 34 </div> 35 36 """ 37 38 data = { 39 "link": link, 40 "account": account, 41 "year": year, 42 "month": month, 43 "attach_pdf": attach_pdf, 44 "save_data": save_data, 45 } 46 47 return self.session.post( 48 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 49 )
⚠️ Sunset notice: The Statements resource is due to be sunsetted on 09.05.2022. After which, we will no longer support the resource and we will remove it from our documentation, API, and SDKs.
def
resume( self, session: str, token: str, *, link: str = None, account: str = None, raise_exception: bool = False, **kwargs) -> Union[List[Dict], Dict]:
51 def resume( 52 self, 53 session: str, 54 token: str, 55 *, 56 link: str = None, 57 account: str = None, 58 raise_exception: bool = False, 59 **kwargs, 60 ) -> Union[List[Dict], Dict]: 61 data = {"session": session, "token": token} 62 63 if link is not None: 64 data.update(link=link) 65 66 if account is not None: 67 data.update(account=account) 68 69 return self.session.patch( 70 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 71 )
Resume a resource sessions
Example:
# Login to Belvo API
client = Client("Secret Key ID", "Secret Key PASSWORD", "sandbox")
# Resume a link
link = client.Links.resume(
session="session_id",
token="token",
link="link_id"
)
Arguments:
- session (str): The session you want to resume (UUID).
- token (str): The MFA token required to continue the session.
- link (str, optional): The Link ID . Defaults to None.
- raise_exception (bool, optional): Boolean indicating whether to return an API error or to raise an exception. Defaults to False.
Returns:
Union[List[Dict], Dict]: On success, returns the resource data requests.