# Copyright 2025 Google Inc.
# 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.

---
name: 'Capability'
description:
  An app-enabled folder is a folder within the Google Cloud resource hierarchy that has been configured for application management.
  This folder lets you define and manage App Hub applications. These applications are functional groupings of services and workloads
  that span multiple projects within that folder and its descendant projects.
references:
  guides:
    'Official Documentation': 'https://cloud.google.com/resource-manager/docs/manage-applications'
  api: 'https://cloud.google.com/resource-manager/reference/rest'
min_version: beta

import_format:
  - '{{parent}}/capabilities/{{capability_name}}'

self_link: '{{parent}}/capabilities/{{capability_name}}'
create_url: '{{parent}}/capabilities/{{capability_name}}?updateMask=value'
update_url: '{{parent}}/capabilities/{{capability_name}}'

create_verb: 'PATCH'
update_verb: 'PATCH'

update_mask: true

exclude_delete: true
timeouts:
  insert_minutes: 20
  update_minutes: 20

autogen_async: true
async:
  actions: ['create', 'update']
  operation:
    base_url: '{{op_id}}'
custom_code:
  custom_import: 'templates/terraform/custom_import/resource_manager_capability.go.tmpl'
examples:
  - name: 'resource_manager_capability'
    primary_resource_id: 'capability'
    vars:
      display_name: 'my-folder'
    test_env_vars:
      org_id: "ORG_ID"
    min_version: beta
    external_providers: ["time"]

parameters:

properties:
  - name: 'parent'
    type: String
    description: |
      Folder on which Capability needs to be updated in the format folders/folder_id.
    required: true
    url_param_only: true
  - name: 'capability_name'
    type: String
    description: |
      Capability name that should be updated on the folder.
    required: true
    url_param_only: true
  - name: 'value'
    type: Boolean
    description: |
      Capability Value.
    required: true
