- release_tracks: [GA, BETA, ALPHA]

  help_text:
    brief: |
      List Managed Microsoft AD domains.
    description: |
      List all Managed Microsoft AD domains in the specified project.

      You can specify the maximum number of domains to list using the
      `--limit` flag.
    examples: |
      The following command lists a maximum of five domains:

          $ {command} --limit=5

  request: &request
    collection: managedidentities.projects.locations.global.domains
    modify_request_hooks:
    - googlecloudsdk.command_lib.active_directory.util:AppendLocationsGlobalToParent
    ALPHA:
      api_version: v1alpha1
    BETA:
      api_version: v1beta1
    GA:
      api_version: v1

  arguments:
    resource:
      spec: !REF googlecloudsdk.command_lib.active_directory.resources:project
      help_text: |
        The project of the AD domains to display.

  output:
    ALPHA:
      format: |
         table(
            name.basename():label=DOMAIN_NAME,
            state:label=DOMAIN_STATE,
            reservedIpRange:label=RESERVED_IP_RANGE,
            locations:label=REGIONS,
            labels:label=LABELS,
            managedIdentitiesAdminName:label=ADMIN_NAME,
            auditLogsEnabled:label=AUDIT_LOGS_ENABLED,
            createTime.date():sort=1
          )
    BETA:
      format: |
         table(
            name.basename():label=DOMAIN_NAME,
            state:label=DOMAIN_STATE,
            reservedIpRange:label=RESERVED_IP_RANGE,
            locations:label=REGIONS,
            labels:label=LABELS,
            admin:label=ADMIN_NAME,
            auditLogsEnabled:label=AUDIT_LOGS_ENABLED,
            createTime.date():sort=1
          )
    GA:
      format: |
         table(
            name.basename():label=DOMAIN_NAME,
            state:label=DOMAIN_STATE,
            reservedIpRange:label=RESERVED_IP_RANGE,
            locations:label=REGIONS,
            labels:label=LABELS,
            admin:label=ADMIN_NAME,
            auditLogsEnabled:label=AUDIT_LOGS_ENABLED,
            createTime.date():sort=1
          )
