def METHOD_NAME(client, backup_plan_name):
    first_iteration = False
    next_token = None
    # We can not use the paginator at the moment because if was introduced after boto3 version 1.22
    # paginator = client.get_paginator("list_backup_plans")
    # result = paginator.paginate(**params).build_full_result()["BackupPlansList"]
    response = client.list_backup_plans()
    next_token = response.get("NextToken", None)
    if next_token is None:
        entries = response["BackupPlansList"]
        for backup_plan in entries:
            if backup_plan_name == backup_plan["BackupPlanName"]:
                return backup_plan["BackupPlanId"]
    while next_token is not None:
        if first_iteration:
            response = client.list_backup_plans(NextToken=next_token)
        first_iteration = True
        entries = response["BackupPlansList"]
        for backup_plan in entries:
            if backup_plan_name == backup_plan["BackupPlanName"]:
                return backup_plan["BackupPlanId"]
        next_token = response.get("NextToken")