def METHOD_NAME(connection, module, rest_api_id):
    try:
        response = connection.get_rest_api(restApiId=rest_api_id)
        response.pop("ResponseMetadata")
    except is_boto3_error_code("ResourceNotFoundException"):
        response = {}
    except (
        botocore.exceptions.ClientError,
        botocore.exceptions.BotoCoreError,
    ) as e:  # pylint: disable=duplicate-except
        module.fail_json_aws(e, msg="Trying to get Rest API '{0}'.".format(rest_api_id))
    return response