belvo.resources.employment_records
1from typing import Dict, List, Union 2 3from belvo.resources.base import Resource 4 5 6class EmploymentRecords(Resource): 7 endpoint = "/api/employment-records/" 8 9 def create( 10 self, 11 link: str, 12 attach_pdf: bool = False, 13 save_data: bool = True, 14 raise_exception: bool = False, 15 **kwargs: Dict, 16 ) -> Union[List[Dict], Dict]: 17 """Retrieve employment records for a link 18 19 Args: 20 link (str): The fiscal `link.id` you want specific employment record for. 21 attach_pdf (bool, optional): When this is set to `True`, you will receive the PDF as a binary string in the response. Defaults to `False`. 22 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 23 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 24 25 Returns: 26 Dict: The details of the object. For more information on the response from the API, see our api reference 27 """ 28 29 data = { 30 "link": link, 31 "attach_pdf": attach_pdf, 32 "save_data": save_data, 33 } 34 35 return self.session.post( 36 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 37 )
7class EmploymentRecords(Resource): 8 endpoint = "/api/employment-records/" 9 10 def create( 11 self, 12 link: str, 13 attach_pdf: bool = False, 14 save_data: bool = True, 15 raise_exception: bool = False, 16 **kwargs: Dict, 17 ) -> Union[List[Dict], Dict]: 18 """Retrieve employment records for a link 19 20 Args: 21 link (str): The fiscal `link.id` you want specific employment record for. 22 attach_pdf (bool, optional): When this is set to `True`, you will receive the PDF as a binary string in the response. Defaults to `False`. 23 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 24 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 25 26 Returns: 27 Dict: The details of the object. For more information on the response from the API, see our api reference 28 """ 29 30 data = { 31 "link": link, 32 "attach_pdf": attach_pdf, 33 "save_data": save_data, 34 } 35 36 return self.session.post( 37 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 38 )
def
create( self, link: str, attach_pdf: bool = False, save_data: bool = True, raise_exception: bool = False, **kwargs: Dict) -> Union[List[Dict], Dict]:
10 def create( 11 self, 12 link: str, 13 attach_pdf: bool = False, 14 save_data: bool = True, 15 raise_exception: bool = False, 16 **kwargs: Dict, 17 ) -> Union[List[Dict], Dict]: 18 """Retrieve employment records for a link 19 20 Args: 21 link (str): The fiscal `link.id` you want specific employment record for. 22 attach_pdf (bool, optional): When this is set to `True`, you will receive the PDF as a binary string in the response. Defaults to `False`. 23 save_data (bool, optional): Indicates whether or not to persist the data in Belvo. Defaults to `True`. 24 raise_exception (bool, optional): Indicates whether to raise an exception or return the API error. Defaults to `False`. 25 26 Returns: 27 Dict: The details of the object. For more information on the response from the API, see our api reference 28 """ 29 30 data = { 31 "link": link, 32 "attach_pdf": attach_pdf, 33 "save_data": save_data, 34 } 35 36 return self.session.post( 37 self.endpoint, data=data, raise_exception=raise_exception, **kwargs 38 )
Retrieve employment records for a link
Arguments:
- link (str): The fiscal
link.id
you want specific employment record for. - attach_pdf (bool, optional): When this is set to
True
, you will receive the PDF as a binary string in the response. Defaults toFalse
. - 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 api reference