# -*- 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: Preview an application
    description: Preview an application in a space.
    examples: |-
      To preview the application `my-application` in space `my-space`, project `my-project` and location `us-central1`, run:

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

      Or run:

        $ {command} projects/my-project/locations/us-central1/spaces/my-space/applications/my-application

      To preview the application `my-application` in space `my-space`, project `my-project` and location `us-central1` using a worker pool `projects/my-project/locations/us-central1/workerPools/my-worker-pool`, run:

        $ {command} my-application --space=my-space --project=my-project --location=us-central1 --worker-pool=projects/my-project/locations/us-central1/workerPools/my-worker-pool

      To preview the application `my-application` in space `my-space`, project `my-project` and location `us-central1` asynchronously, run:

        $ {command} my-application --space=my-space --project=my-project --location=us-central1 --async
  arguments:
    params:
    - help_text: |-
        The application name in the following format:
        projects/$project/locations/$location/spaces/$space/applications/$application
      is_positional: true
      is_primary_resource: true
      resource_spec: !REF googlecloudsdk.command_lib.design_center.v1alpha_resources:projects_locations_spaces_applications
      required: true
    - arg_name: worker-pool
      api_field: previewApplicationRequest.workerPool
      required: false
      repeated: false
      help_text: |-
        The user-specified Worker Pool resource in which the Cloud Build job will
        execute.
        Format projects/{project}/locations/{location}/workerPools/{workerPoolId}
        If this field is unspecified, the default Cloud Build worker pool will be
        used. If omitted and application resource ref provided has worker_pool
        defined, that worker pool is used.
    - arg_name: service-account
      api_field: previewApplicationRequest.serviceAccount
      required: false
      repeated: false
      help_text: |-
        The email address of the service account to use for this preview operation.

        - If provided, this service account will be used to execute the preview
          process, taking precedence over any service_account specified on the
          Application resource.
        - The caller must have the 'iam.serviceAccounts.actAs' permission on this
          service account.
        - If this field is omitted, the system will use the 'service_account'
          defined within the Application resource.
        - We recommend that you provide a service account here or on the
          Application resource. If you don't provide a service account, the preview
          will fail.
        Format: projects/{PROJECT}/serviceAccounts/{EMAIL_ADDRESS}
  request:
    api_version: v1alpha
    collection:
    - designcenter.projects.locations.spaces.applications
    method: preview
  async:
    collection:
    - designcenter.projects.locations.operations
  command_type: GENERIC
