- release_tracks: [ALPHA, BETA]
  command_type: GENERIC
  help_text:
    brief: Reject a pending build.
    description: Reject a pending build.
    examples: |
      To reject a pending build with its ID, run:

        $ {command} build-id

      To reject multiple pending builds, run the command in a for loop:

        $ for i in $(cat build-ids.txt); do {command} $i; done

  request:
    collection: cloudbuild.projects.builds
    api_version: v1
    method: approve
    static_fields:
      approveBuildRequest.approvalResult.decision: REJECTED
  arguments:
    resource:
      help_text: "Build."
      spec: !REF googlecloudsdk.command_lib.cloudbuild.resources:build

    params:
    - api_field: approveBuildRequest.approvalResult.comment
      arg_name: comment
      help_text: Optional comment to annotate the build's rejection.
    - api_field: approveBuildRequest.approvalResult.url
      arg_name: url
      help_text: Optional URL to annotate the build's rejection.
