def delete_photo(self): try: from .Handler import EntityAPIHandler except ImportError: from Handler import EntityAPIHandler return EntityAPIHandler.get_instance(self).delete_photo()
def get_record(self, entityID): try: from .Handler import EntityAPIHandler except ImportError: from Handler import EntityAPIHandler record = ZCRMRecord.get_instance(self.api_name, entityID) return EntityAPIHandler.get_instance(record).get_record()
def upload_photo(self, file_path): if file_path is None: from Utility import CommonUtil CommonUtil.raise_exception('Upload_Photo', "file path must be given", 'FILEPATH NOT PROVIDED', "FILEPATH") from Handler import EntityAPIHandler return EntityAPIHandler.get_instance(self).upload_photo(file_path)
def delete(self): if self.entity_id is None: from Utility import CommonUtil CommonUtil.raise_exception('Record_Delete', "id should be set for the record", 'ID DOES NOT PROVIDED', "ID") from Handler import EntityAPIHandler return EntityAPIHandler.get_instance(self).delete_record()
def create(self): if self.entity_id is not None: from Utility import CommonUtil CommonUtil.raise_exception('Record_Create', "id should not be set for the record", 'ID PROVIDED', "ID") from Handler import EntityAPIHandler return EntityAPIHandler.get_instance(self).create_record()
def convert(self, potential_record=None, assign_to_user=None): if self.entity_id is None: from Utility import CommonUtil CommonUtil.raise_exception('Convert_Record', "id should be set for the record", 'ID DOES NOT PROVIDED', "ID") from Handler import EntityAPIHandler return EntityAPIHandler.get_instance(self).convert_record( potential_record, assign_to_user)
def update(self): if self.entity_id is None: try: from .Utility import CommonUtil except ImportError: from Utility import CommonUtil CommonUtil.raise_exception('Record_Update', "id should be set for the record", 'ID DOES NOT PROVIDED', "ID") try: from .Handler import EntityAPIHandler except ImportError: from Handler import EntityAPIHandler return EntityAPIHandler.get_instance(self).update_record()
def delete_photo(self): from Handler import EntityAPIHandler return EntityAPIHandler.get_instance(self).delete_photo()
def download_photo(self): from Handler import EntityAPIHandler return EntityAPIHandler.get_instance(self).download_photo()