release_tracks: [GA, BETA, ALPHA]
help_text:
  brief: |
    Import Gateway Security Policy Rule.
  description: |
    Import a Gateway Security Policy Rule.
  examples: |
      To import a Gateway Security Policy Rule from a YAML file, run:

        $ {command} my-rule --source=my-rule.yaml --location={region} --gateway-security-policy={policy-name}

request:
  collection: networksecurity.projects.locations.gatewaySecurityPolicies.rules
  ALPHA:
    api_version: v1alpha1
  BETA:
    api_version: v1beta1
  GA:
    api_version: v1
  modify_request_hooks:
  - googlecloudsdk.command_lib.network_security.hooks:SetUpdateMask

arguments:
  resource:
    spec: !REF googlecloudsdk.command_lib.network_security.resources:gatewaySecurityPolicyRule
    help_text: |
      Name of the Gateway Security Policy Rule to import.
    is_positional: true

async:
  collection: networksecurity.projects.locations.operations

import:
  abort_if_equivalent: true
  create_if_not_exists: true
  create_request:
    collection: networksecurity.projects.locations.gatewaySecurityPolicies.rules
    ALPHA:
      api_version: v1alpha1
    BETA:
      api_version: v1beta1
    GA:
      api_version: v1
    method: create
