{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trimble/json-schema/trimble-data-inquiries-with-keys-schema.json",
  "title": "data_inquiries_withKeys",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trimble-vista-va-openapi.yml#/components/schemas/data_inquiries_withKeys",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "__ryvitKeys": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Array of key paths that can be used to retrieve this object."
        },
        "__modifiedUTC": {
          "type": "string",
          "description": "UTC timestamp of when this object was last modified in the cache."
        }
      }
    },
    {
      "$ref": "#/$defs/data_inquiries"
    }
  ],
  "$defs": {
    "data_inquiries": {
      "required": [
        "QueryName",
        "Query",
        "IsStandard",
        "KeyID",
        "QueryType",
        "IsAssignableInWorkCenter",
        "IsPublished"
      ],
      "type": "object",
      "properties": {
        "QueryName": {
          "maxLength": 50,
          "type": "string",
          "description": "The unique, internal name of the inquiry query (Primary Key Component)."
        },
        "QueryTitle": {
          "maxLength": 255,
          "type": [
            "string",
            "null"
          ],
          "description": "A user-friendly title for the inquiry."
        },
        "QueryDescription": {
          "maxLength": 512,
          "type": [
            "string",
            "null"
          ],
          "description": "A detailed description of the inquiry's purpose."
        },
        "Query": {
          "type": "string",
          "description": "The SQL query definition itself (may be large)."
        },
        "Notes": {
          "type": [
            "string",
            "null"
          ],
          "description": "Any additional notes regarding the query."
        },
        "IsStandard": {
          "maxLength": 1,
          "enum": [
            "Y",
            "N"
          ],
          "type": "string",
          "description": "Indicates if the query is a standard, system-provided definition ('Y' or 'N')."
        },
        "KeyID": {
          "type": "integer",
          "description": "The unique internal record identifier (Internal Primary Key)."
        },
        "QueryType": {
          "type": "integer",
          "description": "The numeric type code of the query (e.g., Grid, Report)."
        },
        "IsAssignableInWorkCenter": {
          "maxLength": 1,
          "enum": [
            "Y",
            "N"
          ],
          "type": "string",
          "description": "Indicates if the inquiry can be assigned within a WorkCenter ('Y' or 'N')."
        },
        "ChangeNotes": {
          "type": [
            "string",
            "null"
          ],
          "description": "Notes detailing changes made to the query."
        },
        "IsPublished": {
          "maxLength": 1,
          "enum": [
            "Y",
            "N"
          ],
          "type": "string",
          "description": "Indicates if the query is published and available for use ('Y' or 'N')."
        },
        "ApiExecutions": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Count of times the inquiry has been executed via API."
        },
        "LastApiExecution": {
          "type": [
            "string",
            "null"
          ],
          "description": "Timestamp of the last time the inquiry was executed via API.",
          "format": "date-time"
        },
        "FormName": {
          "maxLength": 128,
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the form associated with the query, if applicable."
        },
        "Parameters": {
          "type": "array",
          "items": {
            "required": [
              "ParameterName",
              "IsVisible",
              "IsStandard",
              "KeyID"
            ],
            "type": "object",
            "properties": {
              "ParameterName": {
                "maxLength": 50,
                "type": "string",
                "description": "The unique name of the parameter (Primary Key Component)."
              },
              "DataType": {
                "maxLength": 30,
                "type": [
                  "string",
                  "null"
                ],
                "description": "The SQL data type of the parameter (e.g., varchar, int, datetime)."
              },
              "Value": {
                "maxLength": 50,
                "type": [
                  "string",
                  "null"
                ],
                "description": "A default value or example value for the parameter."
              },
              "IsVisible": {
                "maxLength": 1,
                "enum": [
                  "Y",
                  "N"
                ],
                "type": "string",
                "description": "Indicates if the parameter is visible in the UI ('Y' or 'N')."
              },
              "Description": {
                "maxLength": 255,
                "type": [
                  "string",
                  "null"
                ],
                "description": "A user-friendly description of the parameter."
              },
              "DefaultType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The numeric code defining how the default value is determined."
              },
              "IsStandard": {
                "maxLength": 1,
                "enum": [
                  "Y",
                  "N"
                ],
                "type": "string",
                "description": "Indicates if the parameter is a standard, system-provided definition ('Y' or 'N')."
              },
              "InputType": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The numeric code defining the input control type (e.g., text box, lookup)."
              },
              "InputLength": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The maximum input length for the parameter value."
              },
              "Prec": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Precision for numeric data types."
              },
              "KeyID": {
                "type": "integer",
                "description": "The unique internal record identifier for the parameter."
              },
              "Lookup": {
                "maxLength": 30,
                "type": [
                  "string",
                  "null"
                ],
                "description": "The name of the lookup query or table used to populate the parameter values."
              },
              "Comparison": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": "The default comparison operator (e.g., EQ, LT, GT)."
              },
              "Operator": {
                "maxLength": 10,
                "type": [
                  "string",
                  "null"
                ],
                "description": "The logical operator used to combine multiple parameters (e.g., AND, OR)."
              },
              "Seq": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The sequence or order in which the parameter appears."
              },
              "ColumnName": {
                "maxLength": 50,
                "type": [
                  "string",
                  "null"
                ],
                "description": "The database column name associated with the parameter."
              },
              "DefaultOrder": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The default sort order for the parameter."
              }
            },
            "description": "A parameter associated with the VPGridQuery."
          },
          "description": "A collection of parameters required or used by this inquiry."
        }
      },
      "description": "Schema for caching Inquiry Definitions (originally VPGridQueries), including their associated parameters."
    }
  }
}