release_tracks: [ALPHA, GA]
hidden: true

help_text:
  brief: |
    Import a target association.
  description: |
    Import the specified target association.
  examples: |
      To import a target association called `my-target_association`, run:

        $ {command} my-target_association --source=my-target_association.yaml --location=us-central1

arguments:
  resource:
    spec: !REF googlecloudsdk.command_lib.authz_toolkit.resources:target_association
    help_text: |
      Name of the target association you want to import.

async:
  collection: authztoolkit.projects.locations.operations

request:
  ALPHA:
    api_version: v1alpha
  GA:
    api_version: v1
  collection: authztoolkit.projects.locations.targetAssociations
  modify_request_hooks:
  - googlecloudsdk.command_lib.authz_toolkit.hooks:SetUpdateMask

import:
  abort_if_equivalent: true
  create_if_not_exists: true
  create_request:
    collection: authztoolkit.projects.locations.targetAssociations
    ALPHA:
      api_version: v1alpha
    GA:
      api_version: v1
    method: create
