# -*- 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:
  - GA
  auto_generated: true
  help_text:
    brief: Create a framework deployment.
    description: |
      Create a framework deployment for a given organization and location.
    examples: |-
      To create a framework deployment `my-framework-deployment-id` in organization `my-organization-id` and location `global`, targeting `folders/my-folder-id` and using framework `my-framework-name`, run:

      $ {command} my-framework-deployment-id --organization=my-organization-id --location=global \
          --target-resource-config-existing=folders/my-folder-id \
          --framework='organizations/my-organization-id/locations/global/frameworks/my-framework-name' \
          --framework-major-revision-id='1' \
          --cloud-control-metadata='[{"cloudControlDetails": {"name": "organizations/my-organization-id/locations/global/cloudControls/my-control-1", "majorRevisionId": "1", "parameters": []}, "enforcementMode": "DETECTIVE"}]'
  arguments:
    params:
    - help_text: |-
        Identifier. The name of the framework deployment, in the format
        `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
        The only supported location is `global`.
      is_positional: true
      is_primary_resource: true
      request_id_field: frameworkDeploymentId
      resource_spec: !REF googlecloudsdk.command_lib.compliance_manager.v1_resources:organizations_locations_framework_deployments
      required: true
    - group:
        api_field: frameworkDeployment.targetResourceConfig
        required: true
        help_text: |-
          The name of the target resource or the configuration that's required to
          create a new target resource.
        params:
        - group:
            mutex: true
            help_text: |-
              Arguments for the resource config.
            params:
            - arg_name: target-resource-config-existing
              api_field: frameworkDeployment.targetResourceConfig.existingTargetResource
              required: false
              repeated: false
              help_text: |-
                The resource hierarchy node, in one of the following formats:

                - `organizations/{organizationID}`
                - `folders/{folderID}`
                - `projects/{projectID}`
            - group:
                api_field: frameworkDeployment.targetResourceConfig.targetResourceCreationConfig
                required: false
                help_text: |-
                  The configuration that's required to create a target resource.
                params:
                - group:
                    mutex: true
                    help_text: |-
                      Arguments for the resource creation config.
                    params:
                    - group:
                        api_field: frameworkDeployment.targetResourceConfig.targetResourceCreationConfig.folderCreationConfig
                        required: false
                        help_text: |-
                          The configuration that's required to create a folder to be used
                          as the target resource for a deployment.
                        params:
                        - arg_name: target-resource-creation-config-folder-parent
                          api_field: frameworkDeployment.targetResourceConfig.targetResourceCreationConfig.folderCreationConfig.parent
                          required: true
                          repeated: false
                          help_text: |-
                            The parent of the folder, in the format
                            `organizations/{organizationID}` or `folders/{folderID}`.
                        - arg_name: target-resource-creation-config-folder-display-name
                          api_field: frameworkDeployment.targetResourceConfig.targetResourceCreationConfig.folderCreationConfig.folderDisplayName
                          required: true
                          repeated: false
                          help_text: |-
                            The display name of the folder.
                    - group:
                        api_field: frameworkDeployment.targetResourceConfig.targetResourceCreationConfig.projectCreationConfig
                        required: false
                        help_text: |-
                          The configuration that's required to create a project to be used
                          as the target resource of a deployment.
                        params:
                        - arg_name: target-resource-creation-config-project-parent
                          api_field: frameworkDeployment.targetResourceConfig.targetResourceCreationConfig.projectCreationConfig.parent
                          required: true
                          repeated: false
                          help_text: |-
                            The parent of the project, in the format
                            `organizations/{organizationID}` or `folders/{folderID}`.
                        - arg_name: target-resource-creation-config-project-display-name
                          api_field: frameworkDeployment.targetResourceConfig.targetResourceCreationConfig.projectCreationConfig.projectDisplayName
                          required: true
                          repeated: false
                          help_text: |-
                            The display name of the project.
                        - arg_name: target-resource-creation-config-project-billing-account-id
                          api_field: frameworkDeployment.targetResourceConfig.targetResourceCreationConfig.projectCreationConfig.billingAccountId
                          required: true
                          repeated: false
                          help_text: |-
                            The billing account ID for the project.
    - group:
        api_field: frameworkDeployment.framework
        required: true
        help_text: |-
          The reference of a framework, in the format
          `organizations/{organization}/locations/{location}/frameworks/{framework}`.
          The only supported location is `global`.
        params:
        - group:
            mutex: true
            help_text: |-
              Arguments for the  major revision id.
            params:
            - arg_name: framework-major-revision-id
              api_field: frameworkDeployment.framework.majorRevisionId
              required: false
              repeated: false
              type: long
              help_text: |-
                The major version of the framework. If not specified, the version
                corresponds to the latest version of the framework.
        - arg_name: framework
          api_field: frameworkDeployment.framework.framework
          required: true
          repeated: false
          help_text: |-
            The major version of the framework. If not specified, the version
            corresponds to the latest version of the framework.
    - arg_name: description
      api_field: frameworkDeployment.description
      required: false
      repeated: false
      help_text: |-
        A user-provided description of the framework deployment.
    - arg_name: cloud-control-metadata
      api_field: frameworkDeployment.cloudControlMetadata
      required: true
      repeated: true
      help_text: |-
        The deployment mode and parameters for each of the cloud controls in
        the framework. Every cloud control in the framework includes
        metadata.
      spec:
      - api_field: cloudControlDetails
        help_text: |-
          The cloud control name and parameters.
        spec:
        - api_field: name
          help_text: |-
            The name of the cloud control, in the format
            `organizations/{organization}/locations/{location}/cloudControls/{cloud-control}`.
            The only supported location is `global`.
        - api_field: majorRevisionId
          help_text: |-
            The major version of the cloud control.
        - api_field: parameters
          help_text: |-
            Parameters are key-value pairs that let you provide your custom location
            requirements, environment requirements, or other settings that are
            relevant to the cloud control. An example parameter is
            `{"name": "location","value": "us-west-1"}`.
          spec:
          - api_field: name
            help_text: |-
              The name or key of the parameter.
      - api_field: enforcementMode
        help_text: |-
          The enforcement mode of the cloud control.
    - arg_name: etag
      api_field: frameworkDeployment.etag
      required: false
      repeated: false
      help_text: |-
        To prevent concurrent updates from overwriting each other, always provide
        the `etag` when you update a framework deployment. You can also
        provide the `etag` when you delete a framework deployment, to help
        ensure that you're deleting the intended version of the
        framework deployment.
  request:
    api_version: v1
    collection:
    - cloudsecuritycompliance.organizations.locations.frameworkDeployments
  async:
    collection:
    - cloudsecuritycompliance.organizations.locations.operations
