# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
  - ALPHA
  auto_generated: true
  help_text:
    brief: Generate IaC for an application template
    description: Generates Terraform files for an application template.
    examples: |-
      To generate IaC for the application template `my-app-template` in space `my-space`, project `my-project` and location `us-central1`, run:

        $ {command} my-app-template --space=my-space --project=my-project --location=us-central1

      Or run:

        $ {command} projects/my-project/locations/us-central1/spaces/my-space/applicationTemplates/my-app-template

      To generate IaC for the application template `my-app-template` in space `my-space`, project `my-project` and location `us-central1` and save to cloud storage bucket `my-bucket`, run:

        $ {command} my-app-template --space=my-space --project=my-project --location=us-central1 --gcs-uri=gs://my-bucket

      To generate IaC for the application template `my-app-template` in Terraform format in space `my-space`, project `my-project` and location `us-central1`, run:

        $ {command} my-app-template --space=my-space --project=my-project --location=us-central1 --iac-format=terraform
  arguments:
    params:
    - help_text: |-
        The name of the application template.
      is_positional: true
      is_primary_resource: true
      resource_spec: !REF googlecloudsdk.command_lib.design_center.v1alpha_resources:projects_locations_spaces_application_templates
      required: true
    - arg_name: iac-format
      api_field: generateApplicationTemplateIaCRequest.iacFormat
      required: false
      help_text: |-
        The IaC format to generate.
      choices:
      - arg_value: terraform
        enum_value: TERRAFORM
        help_text: |-
          IaC format is Terraform.
      - arg_value: helm
        enum_value: HELM
        help_text: |-
          IaC format is HELM.
    - arg_name: gcs-uri
      api_field: generateApplicationTemplateIaCRequest.gcsUri
      required: false
      repeated: false
      help_text: |-
        The Cloud Storage URI to write the generated IaC to.

        DEPRECATED: Use the 'artifact_location' field instead.
    - group:
        mutex: true
        help_text: |-
          Arguments for the location.
        params:
        - group:
            api_field: generateApplicationTemplateIaCRequest.artifactLocation.developerConnectExportConfig
            required: false
            help_text: |-
              Through Developer Connect, defines a location where content such as
              Infrastructure as Code (IaC) is stored.
            params:
            - arg_name: developer-connect-export-config-repo-uri
              help_text: |-
                The Developer Connect Git repository link, formatted as
                `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
              is_positional: false
              is_primary_resource: false
              resource_spec: !REF googlecloudsdk.command_lib.design_center.v1alpha_resources:projects_locations_connections_git_repository_links
              resource_method_params:
                generateApplicationTemplateIaCRequest.artifactLocation.developerConnectExportConfig.developerConnectRepoUri: '{__relative_name__}'
              required: true
            - arg_name: developer-connect-export-config-branch
              api_field: generateApplicationTemplateIaCRequest.artifactLocation.developerConnectExportConfig.branch
              required: false
              repeated: false
              help_text: |-
                The branch in repo to which the content such as Infrastructure as Code
                (IaC) should be written to. If empty, ADC will create a branch and push the
                changes.
            - arg_name: developer-connect-export-config-dir
              api_field: generateApplicationTemplateIaCRequest.artifactLocation.developerConnectExportConfig.dir
              required: true
              repeated: false
              help_text: |-
                Directory, relative to the source repo, where content such as
                Infrastructure as Code (IaC) will be stored.
                This must be a relative path.To specify the root directory, use '/'.
                If the path or any subdirectories do not exist, they will be created.
        - arg_name: artifact-location-gcs-uri
          api_field: generateApplicationTemplateIaCRequest.artifactLocation.gcsUri
          required: false
          repeated: false
          help_text: |-
            The Cloud Storage URI for storing the generated IaC.
  request:
    api_version: v1alpha
    collection:
    - designcenter.projects.locations.spaces.applicationTemplates
    method: generate
  command_type: GENERIC
