- release_tracks: [BETA]

  help_text:
    brief: Get the IAM policy for a hub resource.
    description: |
      Get the IAM policy of a hub. If formatted as JSON, the output
      can be edited and used as a policy file for *set-iam-policy*.
    examples: |
      To get the IAM policy for a hub named ``my-hub'', run:

      $ {command} my-hub

  request:
    collection: networkconnectivity.projects.locations.global.hubs
    api_version: v1beta

  arguments:
    resource:
      help_text: The hub for which you want the IAM policy.
      spec: !REF googlecloudsdk.command_lib.network_connectivity.resources:hub

  iam:
    set_iam_policy_request_path: googleIamV1SetIamPolicyRequest
    message_type_overrides:
      policy: GoogleIamV1Policy
      set_iam_policy_request: NetworkconnectivityProjectsLocationsGlobalHubsSetIamPolicyRequest


- release_tracks: [GA]

  help_text:
    brief: Get the IAM policy for a hub resource.
    description: |
      Get the IAM policy of a hub. If formatted as JSON, the output
      can be edited and used as a policy file for *set-iam-policy*.
    examples: |
      To get the IAM policy for a hub named ``my-hub'', run:

      $ {command} my-hub

  request:
    collection: networkconnectivity.projects.locations.global.hubs
    api_version: v1

  arguments:
    resource:
      help_text: The hub for which you want the IAM policy.
      spec: !REF googlecloudsdk.command_lib.network_connectivity.resources:hub
