def GetApiTargets(args, messages):
  """Create list of target apis."""
  api_targets = []
  for api_target in getattr(args, 'api_target', []) or []:
    api_targets.append(
        messages.V2ApiTarget(
            service=api_target.get('service'),
            methods=api_target.get('methods', [])))
  return api_targets