def METHOD_NAME(client, bid, target, attempt_id='latest'):
  """Return list of artifacts for a given build."""
  request = client.buildartifact().list(
      buildId=bid, target=target, attemptId=attempt_id)
  request_str = (f'{request.uri}, {request.method}, '
                 f'{request.body}, {request.methodId}')
  artifacts = []
  results = []
  while request:
    result = execute_request_with_retries(request)
    if not result:
      break
    results.append(result)
    if result and 'artifacts' in result:
      for artifact in result['artifacts']:
        artifacts.append(artifact)
    request = client.buildartifact().list_next(request, result)
  if not artifacts:
    logs.log_error(f'No artifact found for target {target}, build id {bid}.\n'
                   f'request {request_str}, results {results}')
  return artifacts