- release_tracks: [ALPHA, BETA, GA]

  help_text:
    brief: List memberships.
    description: List memberships in a fleet.
    examples: |
      List memberships in the active project's fleet:

        $ {command}

  request:
    collection: gkehub.projects.locations.memberships
    modify_request_hooks:
    - googlecloudsdk.command_lib.container.fleet.memberships.util:SetParentCollection
    ALPHA:
      api_version: v1alpha
    BETA:
      api_version: v1beta
    GA:
      api_version: v1

  arguments:
    resource:
      help_text: The project and location to list cluster memberships for.
      spec: !REF googlecloudsdk.command_lib.container.fleet.resources:locationDefaultToAll
      override_resource_collection: true

  response:
    id_field: name

  output:
    format: |
      table(
        name.basename():label=NAME,
        unique_id:label=UNIQUE_ID,
        name.scope().segment(-3):label=LOCATION
      )
