{
  "description": "Project manages HCP Terraform Projects.\nMore information:\n  - https://developer.hashicorp.com/terraform/cloud-docs/projects/manage",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "ProjectSpec defines the desired state of Project.\nMore information:\n  - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/organize-workspaces-with-projects",
      "properties": {
        "deletionPolicy": {
          "default": "retain",
          "description": "DeletionPolicy defines the strategy the Kubernetes operator uses when you delete a project, either manually or by a system event.\n\nYou must use one of the following values:\n- `retain`:  When the custom resource is deleted, the operator will not delete the associated project.\n- `soft`: Attempts to remove the project. The project must be empty.\nDefault: `retain`.",
          "enum": [
            "retain",
            "soft"
          ],
          "type": "string"
        },
        "name": {
          "description": "Name of the Project.",
          "minLength": 1,
          "type": "string"
        },
        "organization": {
          "description": "Organization name where the Workspace will be created.\nMore information:\n  - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/organizations",
          "minLength": 1,
          "type": "string"
        },
        "teamAccess": {
          "description": "HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization,\nusers must belong to a team that has been granted the appropriate permissions.\nYou can assign project-specific permissions to teams.\nMore information:\n  - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/organize-workspaces-with-projects#permissions\n  - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#project-permissions",
          "items": {
            "description": "HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization,\nusers must belong to a team that has been granted the appropriate permissions.\nYou can assign project-specific permissions to teams.\nMore information:\n  - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/organize-workspaces-with-projects#permissions\n  - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#project-permissions",
            "properties": {
              "access": {
                "description": "There are two ways to choose which permissions a given team has on a project: fixed permission sets, and custom permissions.\nMust be one of the following values: `admin`, `custom`, `maintain`, `read`, `write`.\nMore information:\n  - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#project-permissions\n  - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#general-project-permissions",
                "enum": [
                  "admin",
                  "custom",
                  "maintain",
                  "read",
                  "write"
                ],
                "type": "string"
              },
              "custom": {
                "description": "Custom permissions let you assign specific, finer-grained permissions to a team than the broader fixed permission sets provide.\nMore information:\n  - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#custom-project-permissions",
                "properties": {
                  "createWorkspace": {
                    "default": false,
                    "description": "Allow users to create workspaces in the project.\nThis grants read access to all workspaces in the project.\nDefault: `false`.",
                    "type": "boolean"
                  },
                  "deleteWorkspace": {
                    "default": false,
                    "description": "Allows users to delete workspaces in the project.\nDefault: `false`.",
                    "type": "boolean"
                  },
                  "lockWorkspace": {
                    "default": false,
                    "description": "Allows users to manually lock the workspace to temporarily prevent runs.\nWhen a workspace's execution mode is set to \"local\", users must have this permission to perform local CLI runs using the workspace's state.\nDefault: `false`.",
                    "type": "boolean"
                  },
                  "moveWorkspace": {
                    "default": false,
                    "description": "Allows users to move workspaces out of the project.\nA user must have this permission on both the source and destination project to successfully move a workspace from one project to another.\nDefault: `false`.",
                    "type": "boolean"
                  },
                  "projectAccess": {
                    "default": "read",
                    "description": "Project access.\nMust be one of the following values: `delete`, `read`, `update`.\nDefault: `read`.",
                    "enum": [
                      "delete",
                      "read",
                      "update"
                    ],
                    "type": "string"
                  },
                  "runTasks": {
                    "description": "Manage Workspace Run Tasks.\nDefault: `false`.",
                    "type": "boolean"
                  },
                  "runs": {
                    "default": "read",
                    "description": "Run access.\nMust be one of the following values: `apply`, `plan`, `read`.\nDefault: `read`.",
                    "enum": [
                      "apply",
                      "plan",
                      "read"
                    ],
                    "type": "string"
                  },
                  "sentinelMocks": {
                    "default": "none",
                    "description": "Download Sentinel mocks.\nMust be one of the following values: `none`, `read`.\nDefault: `none`.",
                    "enum": [
                      "none",
                      "read"
                    ],
                    "type": "string"
                  },
                  "stateVersions": {
                    "default": "none",
                    "description": "State access.\nMust be one of the following values: `none`, `read`, `read-outputs`, `write`.\nDefault: `none`.",
                    "enum": [
                      "none",
                      "read",
                      "read-outputs",
                      "write"
                    ],
                    "type": "string"
                  },
                  "teamManagement": {
                    "default": "none",
                    "description": "Team management.\nMust be one of the following values: `manage`, `none`, `read`.\nDefault: `none`.",
                    "enum": [
                      "manage",
                      "none",
                      "read"
                    ],
                    "type": "string"
                  },
                  "variables": {
                    "default": "none",
                    "description": "Variable access.\nMust be one of the following values: `none`, `read`, `write`.\nDefault: `none`.",
                    "enum": [
                      "none",
                      "read",
                      "write"
                    ],
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "team": {
                "description": "Team to grant access.\nMore information:\n  - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/teams",
                "properties": {
                  "id": {
                    "description": "Team ID.\nMust match pattern: `^team-[a-zA-Z0-9]+$`",
                    "pattern": "^team-[a-zA-Z0-9]+$",
                    "type": "string"
                  },
                  "name": {
                    "description": "Team name.",
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              }
            },
            "required": [
              "access",
              "team"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "minItems": 1,
          "type": "array"
        },
        "token": {
          "description": "API Token to be used for API calls.",
          "properties": {
            "secretKeyRef": {
              "description": "Selects a key of a secret in the workspace's namespace",
              "properties": {
                "key": {
                  "description": "The key of the secret to select from.  Must be a valid secret key.",
                  "type": "string"
                },
                "name": {
                  "default": "",
                  "description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
                  "type": "string"
                },
                "optional": {
                  "description": "Specify whether the Secret or its key must be defined",
                  "type": "boolean"
                }
              },
              "required": [
                "key"
              ],
              "type": "object",
              "x-kubernetes-map-type": "atomic",
              "additionalProperties": false
            }
          },
          "required": [
            "secretKeyRef"
          ],
          "type": "object",
          "additionalProperties": false
        }
      },
      "required": [
        "name",
        "organization",
        "token"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "ProjectStatus defines the observed state of Project.",
      "properties": {
        "id": {
          "description": "Project ID.",
          "type": "string"
        },
        "name": {
          "description": "Project name.",
          "type": "string"
        },
        "observedGeneration": {
          "description": "Real world state generation.",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "id",
        "name",
        "observedGeneration"
      ],
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
