{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/cloudtruth/main/json-schema/cloudtruth-value-schema.json",
  "title": "Value",
  "description": "A value for a parameter in a given environment.",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudtruth-openapi.yml#/components/schemas/Value",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "readOnly": true,
      "description": "The value url."
    },
    "id": {
      "type": "string",
      "readOnly": true
    },
    "ledger_id": {
      "type": "string",
      "readOnly": true
    },
    "active_environment": {
      "type": "string",
      "readOnly": true,
      "description": "The active environment this Value is viewed under"
    },
    "active_environment_id": {
      "type": "string",
      "readOnly": true,
      "description": "The active environment id this Value is viewed under"
    },
    "active_environment_name": {
      "type": "string",
      "readOnly": true,
      "description": "The name of the environment that this environment is viewed under"
    },
    "environment": {
      "type": "string",
      "format": "uri",
      "readOnly": true,
      "description": "The environment this value is set in."
    },
    "environment_id": {
      "type": "string",
      "readOnly": true,
      "description": "The environment id for this value."
    },
    "environment_name": {
      "type": "string",
      "readOnly": true,
      "description": "The environment name for this value.  This is a convenience to avoid another query against the server to resolve the environment url into a name."
    },
    "parameter": {
      "type": "string",
      "format": "uri",
      "readOnly": true,
      "description": "The parameter this value is for."
    },
    "parameter_id": {
      "type": "string",
      "readOnly": true,
      "description": "The parameter id for this value."
    },
    "external": {
      "type": "boolean"
    },
    "external_fqn": {
      "type": "string"
    },
    "external_filter": {
      "type": [
        "string",
        "null"
      ]
    },
    "external_error": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "This field is deprecated and unused."
    },
    "external_status": {
      "allOf": [
        {
          "$ref": "#/$defs/TaskStep"
        }
      ],
      "readOnly": true,
      "nullable": true,
      "description": "The most recent mapped pull status for an external value."
    },
    "internal_value": {
      "type": [
        "string",
        "null"
      ]
    },
    "interpolated": {
      "type": "boolean"
    },
    "value": {
      "type": [
        "string",
        "null"
      ],
      "description": "This is the actual content of the Value for the given parameter in the given environment.\n\nIf you request secret masking, no secret content will be included in the result and instead a series of asterisks will be used instead for the value.\n\nClients applying this value to a shell environment should set `<parameter_name>=<value>` even if `value` is the empty string.  If `value` is `null`, the client should unset that shell environment variable.",
      "readOnly": true
    },
    "evaluated": {
      "type": "boolean",
      "readOnly": true,
      "description": "If true, the `value` field has undergone template evaluation."
    },
    "secret": {
      "type": [
        "boolean",
        "null"
      ],
      "readOnly": true,
      "description": "Indicates the value content is a secret.  Normally this is `true` when the parameter is a secret. It is possible for a parameter to be a secret with a external value that is not a secret.  It is not possible to convert a parameter from a secret to a non-secret if any of the values are external and a secret.  Clients can check this condition by leveraging this field.  It is also possible for a parameter to not be a secret but for this value to be dynamic and reference a Parameter that is a secret.  In this case, we indicate the value is a secret."
    },
    "referenced_projects": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "readOnly": true,
      "description": "The projects this value references, if dynamic.  This field is not valid for history requests."
    },
    "referenced_parameters": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "readOnly": true,
      "description": "The parameters this value references, if dynamic.  this field is not valid for history requests."
    },
    "referenced_templates": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "readOnly": true,
      "description": "The templates this value references, if dynamic.  This field is not valid for history requests."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "modified_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true
    }
  },
  "required": [
    "active_environment",
    "active_environment_id",
    "active_environment_name",
    "created_at",
    "environment",
    "environment_id",
    "environment_name",
    "evaluated",
    "expires_at",
    "external_error",
    "external_status",
    "id",
    "ledger_id",
    "modified_at",
    "parameter",
    "parameter_id",
    "referenced_parameters",
    "referenced_projects",
    "referenced_templates",
    "secret",
    "url",
    "value"
  ],
  "$defs": {
    "OperationEnum": {
      "enum": [
        "create",
        "read",
        "update",
        "delete"
      ],
      "type": "string",
      "description": "* `create` - Create\n* `read` - Read\n* `update` - Update\n* `delete` - Delete"
    },
    "TaskStep": {
      "type": "object",
      "description": "Each task detail documents the synchronization of a single\nvalue through an integration.",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "readOnly": true
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true,
          "description": "Unique identifier for a task step."
        },
        "operation": {
          "allOf": [
            {
              "$ref": "#/$defs/OperationEnum"
            }
          ],
          "nullable": true,
          "description": "The operation performed, if any.\n\nWhen the operation is an update, there may be additional details in the success_detail field to describe the change.\n\nWhen the project is filled in but the environment and parameterare not, the operation is on the project.  When the environmentis filled in but the project and parameter are not, the operationis on the environment.  When the project and parameter are filledin but the environment is not, the operation is on the parameter.When all three are filled in, the operation is on the value ofthe parameter of the project in the specified environment.\n\n* `create` - Create\n* `read` - Read\n* `update` - Update\n* `delete` - Delete"
        },
        "success": {
          "type": "boolean",
          "description": "Indicates if the operation was successful."
        },
        "success_detail": {
          "type": [
            "string",
            "null"
          ],
          "description": "Additional details about the successful operation, if any."
        },
        "fqn": {
          "type": [
            "string",
            "null"
          ],
          "description": "The fully-qualified name (FQN) this of the value that was changed.",
          "maxLength": 1024
        },
        "environment": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "readOnly": true,
          "description": "The environment affected by this step."
        },
        "environment_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The environment id involved in the operation."
        },
        "environment_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The environment name involved in the operation.",
          "maxLength": 256
        },
        "project": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "readOnly": true,
          "description": "The project affected by this step."
        },
        "project_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The project id involved in the operation."
        },
        "project_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The project name involved in the operation.",
          "maxLength": 256
        },
        "parameter": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "readOnly": true,
          "description": "The parameter affected by this step."
        },
        "parameter_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The parameter id involved in the operation."
        },
        "parameter_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The parameter name involved in the operation.",
          "maxLength": 256
        },
        "venue_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "The integration-native id for the resource.",
          "maxLength": 2048
        },
        "venue_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the item or resource as known by the integration.",
          "maxLength": 1024
        },
        "summary": {
          "type": [
            "string",
            "null"
          ],
          "description": "The summary of this step (what it was trying to do)."
        },
        "error_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "An error code, if not successful.",
          "maxLength": 256
        },
        "error_detail": {
          "type": [
            "string",
            "null"
          ],
          "description": "Details on the error that occurred during processing."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "modified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        }
      },
      "required": [
        "created_at",
        "environment",
        "id",
        "modified_at",
        "parameter",
        "project",
        "success",
        "url"
      ]
    }
  }
}