# -*- 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: Create an application
    description: Create an application in a space.
    examples: |-
      To create the application `my-application` with a display name of `My Application`, description of `My application description` and source application template revision `projects/my-project/locations/us-central1/spaces/my-space/applicationTemplates/my-app-template/revisions/rev1` in space `my-space`, project `my-project` and location `us-central1`, run:

        $ {command} my-application --space=my-space --project=my-project --location=us-central1 --display-name="My Application" --description="My application description" --source-application-template-revision=projects/my-project/locations/us-central1/spaces/my-space/applicationTemplates/my-app-template/revisions/rev1

      To create the application `my-application` with a deployment project `my-deployment-project`, deployment region `us-east1`, scope type `regional` and source application template revision `projects/my-project/locations/us-central1/spaces/my-space/applicationTemplates/my-app-template/revisions/rev1` in space `my-space`, project `my-project` and location `us-central1`, run:

        $ {command} my-application --space=my-space --project=my-project --location=us-central1 --deployment-project=my-deployment-project --deployment-region=us-east1 --scope-type=regional --source-application-template-revision=projects/my-project/locations/us-central1/spaces/my-space/applicationTemplates/my-app-template/revisions/rev1
  arguments:
    params:
    - help_text: |-
        Identifier. The name of the application.
        Format:
        projects/{project}/locations/{location}/spaces/{space}/applications/{application}
      is_positional: true
      is_primary_resource: true
      request_id_field: applicationId
      resource_spec: !REF googlecloudsdk.command_lib.design_center.v1alpha_resources:projects_locations_spaces_applications
      required: true
    - group:
        api_field: application.source
        required: true
        help_text: |-
          Source template information for the deployment.
        params:
        - group:
            mutex: true
            help_text: |-
              Arguments for the source.
            params:
            - arg_name: source-application-template-revision
              api_field: application.source.applicationTemplateRevision
              required: false
              repeated: false
              help_text: |-
                Application template revision URI.
            - arg_name: source-shared-template-revision-uri
              api_field: application.source.sharedTemplateRevisionUri
              required: false
              repeated: false
              help_text: |-
                Shared template revision URI.
    - arg_name: app-parameters
      api_field: application.appParameters
      required: false
      repeated: true
      help_text: |-
        A list of parameters to attach to the deployment source object, which is a
        catalog entry or application template snapshot.
      spec:
      - api_field: key
        help_text: |-
          The key of the parameter.
      - api_field: value
        type: arg_json
        help_text: |-
          The value of the parameter.
    - arg_name: component-parameters
      api_field: application.componentParameters
      required: false
      repeated: true
      help_text: |-
        A list of component parameters to associate with the application.
      spec:
      - api_field: component
        help_text: |-
          The name of the component parameter.
      - api_field: parameters
        help_text: |-
          A list of parameters associated with the component.
        spec:
        - api_field: key
          help_text: |-
            The key of the parameter.
        - api_field: value
          type: arg_json
          help_text: |-
            The value of the parameter.
    - arg_name: service-account
      api_field: application.serviceAccount
      required: false
      repeated: false
      help_text: |-
        Your own service account that you use to deploy an application.
    - arg_name: display-name
      api_field: application.displayName
      required: false
      repeated: false
      help_text: |-
        Display name of the application.
    - arg_name: description
      api_field: application.description
      required: false
      repeated: false
      help_text: |-
        Description of the application.
    - group:
        api_field: application.attributes
        required: false
        help_text: |-
          Consumer provided attributes.
        params:
        - group:
            api_field: application.attributes.criticality
            required: false
            help_text: |-
              Criticality of the Application, Service, or Workload
            params:
            - arg_name: criticality-level
              api_field: application.attributes.criticality.level
              required: false
              repeated: false
              help_text: |-
                Criticality level.
                Can contain only lowercase letters, numeric characters,
                underscores, and dashes. Can have a maximum length of 63 characters.
                Deprecated: Please refer to type instead.
            - arg_name: criticality-mission-critical
              api_field: application.attributes.criticality.missionCritical
              action: store_true
              required: false
              type: bool
              help_text: |-
                Indicates mission-critical Application, Service, or Workload.
                Deprecated: Please refer to type instead.
              default: null
            - arg_name: criticality-type
              api_field: application.attributes.criticality.type
              required: true
              help_text: |-
                Criticality Type.
              choices:
              - arg_value: mission-critical
                enum_value: MISSION_CRITICAL
                help_text: |-
                  Mission critical service, application or workload.
              - arg_value: high
                enum_value: HIGH
                help_text: |-
                  High impact.
              - arg_value: medium
                enum_value: MEDIUM
                help_text: |-
                  Medium impact.
              - arg_value: low
                enum_value: LOW
                help_text: |-
                  Low impact.
        - group:
            api_field: application.attributes.environment
            required: false
            help_text: |-
              Environment of the Application, Service, or Workload
            params:
            - arg_name: environment
              api_field: application.attributes.environment.environment
              required: false
              repeated: false
              help_text: |-
                Environment name.
                Can contain only lowercase letters, numeric characters,
                underscores, and dashes. Can have a maximum length of 63 characters.
                Deprecated: Please refer to type instead.
            - arg_name: environment-type
              api_field: application.attributes.environment.type
              required: true
              help_text: |-
                Environment Type.
              choices:
              - arg_value: production
                enum_value: PRODUCTION
                help_text: |-
                  Production environment.
              - arg_value: staging
                enum_value: STAGING
                help_text: |-
                  Staging environment.
              - arg_value: test
                enum_value: TEST
                help_text: |-
                  Test environment.
              - arg_value: development
                enum_value: DEVELOPMENT
                help_text: |-
                  Development environment.
        - arg_name: attributes-developer-owners
          api_field: application.attributes.developerOwners
          required: false
          repeated: true
          help_text: |-
            Developer team that owns development and coding.
          spec:
          - api_field: displayName
            help_text: |-
              Contact's name.
              Can have a maximum length of 63 characters.
          - api_field: email
            help_text: |-
              Email address of the contacts.
          - api_field: channel
            help_text: |-
              Communication channel of the contacts.
            spec:
            - api_field: uri
              help_text: |-
                URI of the channel.
        - arg_name: attributes-operator-owners
          api_field: application.attributes.operatorOwners
          required: false
          repeated: true
          help_text: |-
            Operator team that ensures runtime and operations.
          spec:
          - api_field: displayName
            help_text: |-
              Contact's name.
              Can have a maximum length of 63 characters.
          - api_field: email
            help_text: |-
              Email address of the contacts.
          - api_field: channel
            help_text: |-
              Communication channel of the contacts.
            spec:
            - api_field: uri
              help_text: |-
                URI of the channel.
        - arg_name: attributes-business-owners
          api_field: application.attributes.businessOwners
          required: false
          repeated: true
          help_text: |-
            Business team that ensures user needs are met and value is delivered
          spec:
          - api_field: displayName
            help_text: |-
              Contact's name.
              Can have a maximum length of 63 characters.
          - api_field: email
            help_text: |-
              Email address of the contacts.
          - api_field: channel
            help_text: |-
              Communication channel of the contacts.
            spec:
            - api_field: uri
              help_text: |-
                URI of the channel.
    - group:
        api_field: application.scope
        required: false
        help_text: |-
          Scope of an application.
        params:
        - arg_name: scope-type
          api_field: application.scope.type
          required: true
          help_text: |-
            Scope Type.
          choices:
          - arg_value: regional
            enum_value: REGIONAL
            help_text: |-
              Regional type.
          - arg_value: global
            enum_value: GLOBAL
            help_text: |-
              Global type.
    - arg_name: import-existing-resources
      api_field: application.importExistingResources
      action: store_true
      required: false
      type: bool
      help_text: |-
        Import existing resources into the application.
      default: null
    - arg_name: deployment-region
      api_field: application.deploymentRegion
      required: false
      repeated: false
      help_text: |-
        The region where the application is deployed.
    - arg_name: deployment-project
      api_field: application.deploymentProject
      required: false
      repeated: false
      help_text: |-
        Deployment project of the application.
    - arg_name: connection-configs
      api_field: application.connectionConfigs
      required: false
      repeated: true
      help_text: |-
        Connection configuration for the application.
      spec:
      - api_field: connectionUri
        help_text: |-
          The connection URI.
      - api_field: sourceComponentParameters
        help_text: |-
          The parameters of the connection associated with the source component.
        spec:
        - api_field: key
          help_text: |-
            The key of the parameter.
        - api_field: value
          type: arg_json
          help_text: |-
            The value of the parameter.
      - api_field: destinationComponentParameters
        help_text: |-
          The parameters of the connection associated with the destination component.
        spec:
        - api_field: key
          help_text: |-
            The key of the parameter.
        - api_field: value
          type: arg_json
          help_text: |-
            The value of the parameter.
  request:
    api_version: v1alpha
    collection:
    - designcenter.projects.locations.spaces.applications
