{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lastmileai/main/json-schema/lastmileai-lmai-proto-webserver-v2-get-dataset-view-request-schema.json",
  "title": "GetDatasetViewRequest",
  "description": "Get a view of the data within a dataset.",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lastmileai-openapi.json#/components/schemas/lmai.proto.webserver.v2.GetDatasetViewRequest",
  "type": "object",
  "properties": {
    "datasetId": {
      "type": "string",
      "description": "The ID of the dataset from which to retrieve content. When specified,\n gets data from the current file in the dataset."
    },
    "datasetFileId": {
      "type": "string",
      "description": "The ID of the (pinned) dataset file from which to retrieve content.\n Requests iterating over pages of results are recommended to use this\n pinned identifier after the first page in order to prevent any effects\n from a dataset changing between the queries."
    },
    "after": {
      "type": "integer",
      "description": "Pagination: The index, by row-order, after which to query results."
    },
    "limit": {
      "type": "integer",
      "description": "Pagination: The maximum number of results to return on this page."
    },
    "previousPageCursor": {
      "type": "string",
      "description": "A cursor for the previous page in the pagination, if one exists."
    },
    "nextPageCursor": {
      "type": "string",
      "description": "A cursor for the next page in the pagination, if one exists."
    },
    "getLastPage": {
      "type": "boolean"
    },
    "useDatasetsService": {
      "type": "boolean"
    },
    "filters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/lmai.proto.datasets.v2.DatasetRowFilter",
        "description": "Filter criteria for the dataset rows"
      }
    },
    "orderBy": {
      "type": "string",
      "description": "Column to order results by"
    },
    "orderDirection": {
      "type": "string",
      "description": "Direction to order results (\"asc\" or \"desc\")"
    }
  },
  "required": [
    "datasetId",
    "datasetFileId",
    "filters"
  ],
  "$defs": {
    "lmai.proto.datasets.v2.DatasetFieldValuePredicate": {
      "title": "DatasetFieldValuePredicate",
      "type": "object",
      "properties": {
        "columnName": {
          "type": "string"
        },
        "stringCriteria": {
          "$ref": "#/$defs/lmai.proto.datasets.v2.StringCriteria"
        },
        "numericCriteria": {
          "$ref": "#/$defs/lmai.proto.datasets.v2.NumericCriteria"
        },
        "stringListCriteria": {
          "$ref": "#/$defs/lmai.proto.datasets.v2.StringListCriteria"
        }
      },
      "required": [
        "columnName",
        "stringCriteria",
        "numericCriteria",
        "stringListCriteria"
      ]
    },
    "lmai.proto.datasets.v2.DatasetRowFilter": {
      "title": "DatasetRowFilter",
      "type": "object",
      "properties": {
        "allOf": {
          "$ref": "#/$defs/lmai.proto.datasets.v2.DatasetRowFilter.AllOf"
        },
        "anyOf": {
          "$ref": "#/$defs/lmai.proto.datasets.v2.DatasetRowFilter.AnyOf"
        }
      },
      "required": [
        "allOf",
        "anyOf"
      ]
    },
    "lmai.proto.datasets.v2.DatasetRowFilter.AllOf": {
      "title": "AllOf",
      "type": "object",
      "properties": {
        "predicates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/lmai.proto.datasets.v2.DatasetFieldValuePredicate"
          }
        }
      },
      "required": [
        "predicates"
      ]
    },
    "lmai.proto.datasets.v2.DatasetRowFilter.AnyOf": {
      "title": "AnyOf",
      "type": "object",
      "properties": {
        "predicates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/lmai.proto.datasets.v2.DatasetFieldValuePredicate"
          }
        }
      },
      "required": [
        "predicates"
      ]
    },
    "lmai.proto.datasets.v2.NumericCriteria": {
      "title": "NumericCriteria",
      "type": "object",
      "properties": {
        "operator": {
          "type": "string",
          "enum": [
            "OPERATOR_UNSPECIFIED",
            "OPERATOR_EQUALS",
            "OPERATOR_NOT_EQUALS",
            "OPERATOR_GREATER_THAN",
            "OPERATOR_GREATER_THAN_OR_EQUAL",
            "OPERATOR_LESS_THAN",
            "OPERATOR_LESS_THAN_OR_EQUAL"
          ],
          "title": "Operator"
        },
        "int64Value": {
          "type": "integer"
        },
        "doubleValue": {
          "type": "number"
        }
      },
      "required": [
        "operator",
        "int64Value",
        "doubleValue"
      ]
    },
    "lmai.proto.datasets.v2.StringCriteria": {
      "title": "StringCriteria",
      "type": "object",
      "properties": {
        "operator": {
          "type": "string",
          "enum": [
            "OPERATOR_UNSPECIFIED",
            "OPERATOR_EQUALS",
            "OPERATOR_NOT_EQUALS",
            "OPERATOR_CONTAINS",
            "OPERATOR_STARTS_WITH",
            "OPERATOR_ENDS_WITH"
          ],
          "title": "Operator"
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "operator",
        "value"
      ]
    },
    "lmai.proto.datasets.v2.StringListCriteria": {
      "title": "StringListCriteria",
      "type": "object",
      "properties": {
        "operator": {
          "type": "string",
          "enum": [
            "OPERATOR_UNSPECIFIED",
            "OPERATOR_HAS_ANY",
            "OPERATOR_HAS_ALL",
            "OPERATOR_HAS_NONE"
          ],
          "title": "Operator"
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "operator",
        "values"
      ]
    }
  }
}