def _get_resources_to_iterate(self, sam_template, macro_resolver):
functions = []<EOL>apis = []<EOL>others = []<EOL>resources = sam_template["<STR_LIT>"]<EOL>for logicalId, resource in resources.items():<EOL><INDENT>data = (logicalId, resource)<EOL>if not macro_resolver.can_resolve(resource):<EOL><INDENT>continue<EOL><DEDENT>elif resource["<STR_LIT>"] == "<STR_LIT>":<EOL><INDENT>functions.append(data)<EOL><DEDENT>elif resource["<STR_LIT>"] == "<STR_LIT>":<EOL><INDENT>apis.append(data)<EOL><DEDENT>else:<EOL><INDENT>others.append(data)<EOL><DEDENT><DEDENT>return functions + apis + others<EOL>
Returns a list of resources to iterate, order them based on the following order:

    1. AWS::Serverless::Function - because API Events need to modify the corresponding Serverless::Api resource.
    2. AWS::Serverless::Api
    3. Anything else

This is necessary because a Function resource with API Events will modify the API resource's Swagger JSON.
Therefore API resource needs to be parsed only after all the Swagger modifications are complete.

:param dict sam_template: SAM template
:param macro_resolver: Resolver that knows if a resource can be processed or not
:return list: List containing tuple of (logicalId, resource_dict) in the order of processing