def resources_to_link(self, resources):
rest_api_id = self.RestApiId<EOL>if isinstance(rest_api_id, dict) and "<STR_LIT>" in rest_api_id:<EOL><INDENT>rest_api_id = rest_api_id["<STR_LIT>"]<EOL><DEDENT>permitted_stage = "<STR_LIT:*>"<EOL>stage_suffix = "<STR_LIT>"<EOL>explicit_api = None<EOL>if isinstance(rest_api_id, string_types):<EOL><INDENT>if rest_api_id in resourcesand "<STR_LIT>" in resources[rest_api_id]and "<STR_LIT>" in resources[rest_api_id]["<STR_LIT>"]:<EOL><INDENT>explicit_api = resources[rest_api_id]["<STR_LIT>"]<EOL>permitted_stage = explicit_api["<STR_LIT>"]<EOL>if isinstance(permitted_stage, string_types):<EOL><INDENT>if not permitted_stage:<EOL><INDENT>raise InvalidResourceException(rest_api_id, '<STR_LIT>')<EOL><DEDENT>stage_suffix = permitted_stage<EOL><DEDENT>else:<EOL><INDENT>stage_suffix = "<STR_LIT>"<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise InvalidEventException(self.relative_id, "<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>return {<EOL>'<STR_LIT>': explicit_api,<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': permitted_stage,<EOL>'<STR_LIT>': stage_suffix<EOL>}<EOL>}<EOL>
If this API Event Source refers to an explicit API resource, resolve the reference and grab
necessary data from the explicit API