belvo.resources.risk_insights
1from typing import Dict, List, Union 2 3from belvo.resources.base import Resource 4 5 6class RiskInsights(Resource): 7 endpoint = "/api/risk-insights/" 8 9 def create( 10 self, 11 link: str, 12 *, 13 token: str = None, 14 save_data: bool = True, 15 raise_exception: bool = False, 16 **kwargs: Dict, 17 ) -> Union[List[Dict], Dict]: 18 """Retrieve risk insights for a link 19 20 Example: 21 ```python 22 # Fetch risk insights for a Link 23 risk_insights = client.RiskInsights.create("44d309dc-24c6-4734-99e0-22c595fee2c2") 24 25 # Fetch risk insights for a Link with and timeout after 15 seconds 26 risk_insights = client.RiskInsights.create( 27 "44d309dc-24c6-4734-99e0-22c595fee2c2", 28 timeout=15 29 ) 30 31 ``` 32 33 Args: 34 link (str): The `link.id` that you want to get information for (UUID). 35 token (str, optional): The MFA token generated by the bank in order to access the institution. Defaults to None. 36 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 37 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 38 39 Returns: 40 Dict: The details of the object. For more information on the response from the API, see our [Risk insights API documentation](https://developers.belvo.com/reference/retrieveriskinsights). 41 """ 42 43 data = {"link": link, "save_data": save_data} 44 45 if token: 46 data.update(token=token) 47 48 return self.session.post( 49 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 50 )
7class RiskInsights(Resource): 8 endpoint = "/api/risk-insights/" 9 10 def create( 11 self, 12 link: str, 13 *, 14 token: str = None, 15 save_data: bool = True, 16 raise_exception: bool = False, 17 **kwargs: Dict, 18 ) -> Union[List[Dict], Dict]: 19 """Retrieve risk insights for a link 20 21 Example: 22 ```python 23 # Fetch risk insights for a Link 24 risk_insights = client.RiskInsights.create("44d309dc-24c6-4734-99e0-22c595fee2c2") 25 26 # Fetch risk insights for a Link with and timeout after 15 seconds 27 risk_insights = client.RiskInsights.create( 28 "44d309dc-24c6-4734-99e0-22c595fee2c2", 29 timeout=15 30 ) 31 32 ``` 33 34 Args: 35 link (str): The `link.id` that you want to get information for (UUID). 36 token (str, optional): The MFA token generated by the bank in order to access the institution. Defaults to None. 37 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 38 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 39 40 Returns: 41 Dict: The details of the object. For more information on the response from the API, see our [Risk insights API documentation](https://developers.belvo.com/reference/retrieveriskinsights). 42 """ 43 44 data = {"link": link, "save_data": save_data} 45 46 if token: 47 data.update(token=token) 48 49 return self.session.post( 50 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 51 )
def
create( self, link: str, *, token: str = None, save_data: bool = True, raise_exception: bool = False, **kwargs: Dict) -> Union[List[Dict], Dict]:
10 def create( 11 self, 12 link: str, 13 *, 14 token: str = None, 15 save_data: bool = True, 16 raise_exception: bool = False, 17 **kwargs: Dict, 18 ) -> Union[List[Dict], Dict]: 19 """Retrieve risk insights for a link 20 21 Example: 22 ```python 23 # Fetch risk insights for a Link 24 risk_insights = client.RiskInsights.create("44d309dc-24c6-4734-99e0-22c595fee2c2") 25 26 # Fetch risk insights for a Link with and timeout after 15 seconds 27 risk_insights = client.RiskInsights.create( 28 "44d309dc-24c6-4734-99e0-22c595fee2c2", 29 timeout=15 30 ) 31 32 ``` 33 34 Args: 35 link (str): The `link.id` that you want to get information for (UUID). 36 token (str, optional): The MFA token generated by the bank in order to access the institution. Defaults to None. 37 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 38 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 39 40 Returns: 41 Dict: The details of the object. For more information on the response from the API, see our [Risk insights API documentation](https://developers.belvo.com/reference/retrieveriskinsights). 42 """ 43 44 data = {"link": link, "save_data": save_data} 45 46 if token: 47 data.update(token=token) 48 49 return self.session.post( 50 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 51 )
Retrieve risk insights for a link
Example:
# Fetch risk insights for a Link risk_insights = client.RiskInsights.create("44d309dc-24c6-4734-99e0-22c595fee2c2") # Fetch risk insights for a Link with and timeout after 15 seconds risk_insights = client.RiskInsights.create( "44d309dc-24c6-4734-99e0-22c595fee2c2", timeout=15 )
Arguments:
- link (str): The
link.id
that you want to get information for (UUID). - token (str, optional): The MFA token generated by the bank in order to access the institution. Defaults to None.
- save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to
True
. - raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to
False
.
Returns:
Dict: The details of the object. For more information on the response from the API, see our Risk insights API documentation.