def update(self): """Update an existing referrer""" if not hasattr(self, 'referrer_id'): raise ClientException('model has no referrer_id.') endpoint = InfynipyBase.ENDPOINT + f'referrer/{self.referer_id}' self._infynity.put(endpoint, self.to_dict())
def delete(self): """Delete an existing referrer""" if not hasattr(self, 'referrer_id'): raise ClientException('model has no referrer_id.') endpoint = InfynipyBase.ENDPOINT + f'referrer/{self.referer_id}' self._infynity.delete(endpoint)
def delete(self): """Delete an existing employment""" if not hasattr(self, 'employment_id'): raise ClientException('No employment_id.') endpoint = InfynipyBase.ENDPOINT + f'addresss/{self.employment_id}' self._infynity.delete(endpoint)
def update(self): """Update an existing employment""" if not hasattr(self, 'employment_id'): raise ClientException('No employment_id.') endpoint = InfynipyBase.ENDPOINT + f'employment/{self.employment_id}' self._infynity.put(endpoint, self.to_dict())
def delete(self): """Delete a financial""" identifer = self.identifer if not hasattr(self, identifer): raise ClientException('{self._name} does not exist.') endpoint = InfynipyBase.ENDPOINT + f'{self._name}/{self.identifer_value}' self._infynity.delete(endpoint)
def update(self): """Update a financial""" identifer = self.identifer if not hasattr(self, identifer): raise ClientException(f'{self._name} does not exists.') endpoint = InfynipyBase.ENDPOINT + f'{self._name}/{self.identifer_value}' self._infynity.put(endpoint, self.to_dict())
def delete_account(self, account_id): """Delete entity in single client account""" identifer = self.identifer if not hasattr(self, identifer): raise ClientException('model has no identifer.') endpoint = InfynipyBase.ENDPOINT + f'{self._name}/{self.identifier_value}/{account_id}' self._infynity.delete(endpoint)
def update(self): """Update an existing entity""" identifer = self.identifer if not hasattr(self, identifer): raise ClientException('model has no identifer.') endpoint = InfynipyBase.ENDPOINT + f'{self._name}/{self.broker_id}/{self.identifier_value}' self._infynity.put(endpoint, self.to_dict())
def create(self): if hasattr(self, 'employment_id'): raise ClientException( 'Employment has employment_id, cannot create again.') endpoint = InfynipyBase.ENDPOINT + f'employment/{self.individual_id}' response = self._infynity.post(endpoint, self.to_dict()) self._get(InfynipyBase.ENDPOINT + f'employment/{response["employment_id"]}')
def create(self): """Create an entity with an existing account""" if hasattr(self, 'group_id'): raise ClientException(f'group already exists, cannot create again.') endpoint = InfynipyBase.ENDPOINT + 'referrergroup' response = self._infynity.post(endpoint, self.to_dict()) self._get(endpoint + '/' + response['group_id']) return response['group_id']
def create(self): """Create a new financial""" if hasattr(self, self.income_id): raise ClientException( f'income already exists, cannot create again.') endpoint = InfynipyBase.ENDPOINT + f'income/{self.entity_type}/{self.entity_id}' response = self._infynity.post(endpoint, self.to_dict()) self._get(InfynipyBase.ENDPOINT + f'income/individual/{response[self.identifer]}') return response[self.identifer]
def create_existing_account(self, account_id): """Create an entity with an existing account""" if hasattr(self, self.identifier): raise ClientException(f'{self._name} already exists, cannot create again.') endpoint = InfynipyBase.ENDPOINT + f'{self._name}/{self.broker_id}/{account_id}' response = self._infynity.post(endpoint, self.to_dict()) self._get( InfynipyBase.ENDPOINT + f'{self.name}/{self.broker_id}/{response[self.identifer]}' ) return response['account_id']