- release_tracks: [GA, BETA, ALPHA]
  hidden: true  # TODO(b/420436006): unhide the CLI for GA.

  help_text:
    brief: Set an IAM policy on a Bigtable schema bundle.
    description: |
      Set an IAM policy on a Bigtable schema bundle.

    examples: |
      To set the IAM policy from file `my-policy` on the schema bundle `my-schema-bundle` in
      instance `my-instance` and table `my-table`, run:

        $ {command} my-schema-bundle --instance=`my-instance` --table=`my-table` my-policy

      See https://cloud.google.com/iam/docs/managing-policies for more information.

  request:
    collection: bigtableadmin.projects.instances.tables.schemaBundles
    modify_request_hooks:
    - googlecloudsdk.command_lib.iam.hooks:UseMaxRequestedPolicyVersion:api_field=setIamPolicyRequest.policy.version
    - googlecloudsdk.command_lib.iam.hooks:AddVersionToUpdateMaskIfNotPresent:update_mask_path=setIamPolicyRequest.updateMask

  arguments:
    resource:
      help_text: Bigtable schema bundle to set the IAM policy on.
      spec: !REF googlecloudsdk.command_lib.bigtable.resources:schema_bundle

  iam:
    policy_version: 3
