belvo.investments.portfolios
1from typing import Dict, List, Union 2 3from belvo.resources.base import Resource 4 5 6class InvestmentsPortfolios(Resource): 7 """ 8 <br> 9 <div style="background-color:#bce9af;padding: 6px; border-radius: 4px"> 10 <strong>🎉 In Beta </strong><br> 11 This resource is currently in open beta for all users. If you see any issues, don't hesitate to contact our support team. 12 </div> 13 14 """ 15 16 endpoint = "/investments/portfolios/" 17 18 def create( 19 self, 20 link: str, 21 *, 22 token: str = None, 23 save_data: bool = True, 24 raise_exception: bool = False, 25 **kwargs: Dict, 26 ) -> Union[List[Dict], Dict]: 27 """Retrieve portfolios for a link 28 29 Example: 30 ```python 31 # Fetch investments portfolios for a Link 32 investments_portfolios = client.InvestmentsPortfolios.create("b91835f5-6f83-4d9b-a0ad-a5a249f18b7c") 33 ``` 34 35 Args: 36 link (str): The `link.id` that you want to get information for (UUID). 37 token (str, optional): The MFA token generated by the bank in order to access the institution. Defaults to None. 38 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 39 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 40 41 Returns: 42 Dict: The details of the object. For more information on the response from the API, see our [Investment portfolios API documentation](https://developers.belvo.com/reference/retrieveportfolio). 43 """ 44 45 data = {"link": link, "save_data": save_data} 46 47 if token: 48 data.update(token=token) 49 50 return self.session.post( 51 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 52 )
7class InvestmentsPortfolios(Resource): 8 """ 9 <br> 10 <div style="background-color:#bce9af;padding: 6px; border-radius: 4px"> 11 <strong>🎉 In Beta </strong><br> 12 This resource is currently in open beta for all users. If you see any issues, don't hesitate to contact our support team. 13 </div> 14 15 """ 16 17 endpoint = "/investments/portfolios/" 18 19 def create( 20 self, 21 link: str, 22 *, 23 token: str = None, 24 save_data: bool = True, 25 raise_exception: bool = False, 26 **kwargs: Dict, 27 ) -> Union[List[Dict], Dict]: 28 """Retrieve portfolios for a link 29 30 Example: 31 ```python 32 # Fetch investments portfolios for a Link 33 investments_portfolios = client.InvestmentsPortfolios.create("b91835f5-6f83-4d9b-a0ad-a5a249f18b7c") 34 ``` 35 36 Args: 37 link (str): The `link.id` that you want to get information for (UUID). 38 token (str, optional): The MFA token generated by the bank in order to access the institution. Defaults to None. 39 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 40 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 41 42 Returns: 43 Dict: The details of the object. For more information on the response from the API, see our [Investment portfolios API documentation](https://developers.belvo.com/reference/retrieveportfolio). 44 """ 45 46 data = {"link": link, "save_data": save_data} 47 48 if token: 49 data.update(token=token) 50 51 return self.session.post( 52 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 53 )
🎉 In Beta
This resource is currently in open beta for all users. If you see any issues, don't hesitate to contact our support team.
This resource is currently in open beta for all users. If you see any issues, don't hesitate to contact our support team.
def
create( self, link: str, *, token: str = None, save_data: bool = True, raise_exception: bool = False, **kwargs: Dict) -> Union[List[Dict], Dict]:
19 def create( 20 self, 21 link: str, 22 *, 23 token: str = None, 24 save_data: bool = True, 25 raise_exception: bool = False, 26 **kwargs: Dict, 27 ) -> Union[List[Dict], Dict]: 28 """Retrieve portfolios for a link 29 30 Example: 31 ```python 32 # Fetch investments portfolios for a Link 33 investments_portfolios = client.InvestmentsPortfolios.create("b91835f5-6f83-4d9b-a0ad-a5a249f18b7c") 34 ``` 35 36 Args: 37 link (str): The `link.id` that you want to get information for (UUID). 38 token (str, optional): The MFA token generated by the bank in order to access the institution. Defaults to None. 39 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 40 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 41 42 Returns: 43 Dict: The details of the object. For more information on the response from the API, see our [Investment portfolios API documentation](https://developers.belvo.com/reference/retrieveportfolio). 44 """ 45 46 data = {"link": link, "save_data": save_data} 47 48 if token: 49 data.update(token=token) 50 51 return self.session.post( 52 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 53 )
Retrieve portfolios for a link
Example:
# Fetch investments portfolios for a Link investments_portfolios = client.InvestmentsPortfolios.create("b91835f5-6f83-4d9b-a0ad-a5a249f18b7c")
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 Investment portfolios API documentation.