<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_api_repr(self):
 """Construct the API resource representation of this access entry Returns: Dict[str, object]: Access entry represented as an API resource """

        resource = {self.entity_type: self.entity_id}
        if self.role is not None:
            resource["role"] = self.role
        return resource