- release_tracks: [GA, BETA, ALPHA]

  help_text:
    brief: Set an IAM policy on a Cloud Bigtable authorized view.
    description: |
      Set an IAM policy on a Cloud Bigtable authorized view.

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

        $ {command} my-authorized-view --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.authorizedViews
    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: Cloud Bigtable authorized view to set the IAM policy on.
      spec: !REF googlecloudsdk.command_lib.bigtable.resources:authorized_view

  iam:
    policy_version: 3
