def METHOD_NAME(
    storage_client, bucket, api_version, endpoint, target_dir
):
    """Return a list of metadata of public tables and their locations on GCS."""
    prefix = f"api/{api_version}"
    blobs = storage_client.list_blobs(bucket, prefix=prefix)
    return [
        GcsTableMetadata(list(blobs), endpoint, target_dir)
        for table, blobs in groupby(blobs, dataset_table_version_from_gcs_blob)
        if table is not None
        and table[0] in os.listdir(target_dir)
        and f"{table[1]}_{table[2]}" in os.listdir(os.path.join(target_dir, table[0]))
    ]