def ListPackages(client, messages, repo):
  """Lists all packages under a repository."""
  list_pkgs_req = messages.ArtifactregistryProjectsLocationsRepositoriesPackagesListRequest(
      parent=repo)
  list_pkgs_res = client.projects_locations_repositories_packages.List(
      list_pkgs_req)
  return list_pkgs_res.packages