# Models

## The StatementRequest object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"StatementRequest":{"type":"object","properties":{"statement":{"description":"DeltaStream SQL statement or batch of SQL statements to execute","type":"string"},"organization":{"description":"Organization Name or ID in which the statement should be executed","type":"string"},"role":{"description":"Role to use when executing a statement. This value is case sensitive","type":"string"},"database":{"description":"Database to add to search path for name resolution. This value is case sensitive","type":"string"},"schema":{"description":"Database schema to add to search path for name resolution. This value is case sensitive","type":"string"},"store":{"description":"Store to use when executing a statement. This value is case sensitive","type":"string"},"computePool":{"description":"Compute_pool to use when executing a statement. This value is case sensitive","type":"string"},"parameters":{"type":"object","properties":{"timezone":{"type":"string"},"sessionID":{"type":"string"}}}},"required":["statement"]}}}}
```

## The StatementStatus object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"StatementStatus":{"type":"object","properties":{"sqlState":{"type":"string"},"message":{"type":"string"},"statementID":{"type":"string","format":"uuid"},"statementIDs":{"type":"array","items":{"type":"string","format":"uuid"},"description":"IDs for each statement when a multi-statement SQL is submitted"},"createdOn":{"type":"integer","format":"int64","description":"UTC POSIX timestamp of when statement was submitted"}},"required":["sqlState","statementID","createdOn"]}}}}
```

## The ResultSet object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"ResultSet":{"type":"object","properties":{"sqlState":{"type":"string"},"message":{"type":"string"},"statementID":{"type":"string","format":"uuid"},"statementIDs":{"type":"array","items":{"type":"string","format":"uuid"},"description":"IDs for each statement when a multi-statement SQL is submitted"},"createdOn":{"type":"integer","format":"int64","description":"UTC POSIX timestamp of when statement was submitted"},"metadata":{"$ref":"#/components/schemas/ResultSetMetadata"},"data":{"type":"array","minItems":0,"items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"null","nullable":true}]}},"description":"Each item within a column of data is expressed as a string, regardless of the DeltaStream type of the column.\nFor example, the number 1.0 will be returned as \"1.0\"."}},"required":["sqlState","statementID","createdOn","metadata"]},"ResultSetMetadata":{"type":"object","properties":{"encoding":{"type":"string","enum":["json"]},"partitionInfo":{"type":"array","items":{"$ref":"#/components/schemas/ResultSetPartitionInfo"}},"columns":{"$ref":"#/components/schemas/ResultSetColumns"},"dataplaneRequest":{"$ref":"#/components/schemas/DataplaneRequest"},"context":{"$ref":"#/components/schemas/ResultSetContext"}},"required":["encoding","partitionInfo","columns"]},"ResultSetPartitionInfo":{"type":"object","properties":{"rowCount":{"type":"integer","format":"int32","minimum":0}},"required":["id","rowCount"]},"ResultSetColumns":{"type":"array","minItems":0,"items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"type":"boolean"},"display_hint":{"type":"string"}},"required":["name","type","nullable"]}},"DataplaneRequest":{"type":"object","properties":{"token":{"type":"string"},"uri":{"type":"string"},"statementID":{"type":"string"},"queryID":{"type":"string"},"requestType":{"type":"string","enum":["result-set","streaming"]}},"required":["token","uri","requestType","statementID"]},"ResultSetContext":{"type":"object","properties":{"organizationID":{"type":"string","format":"uuid"},"roleName":{"type":"string"},"databaseName":{"type":"string"},"schemaName":{"type":"string"},"storeName":{"type":"string"},"computePoolName":{"type":"string"}}}}}}
```

## The ResultSetPartitionInfo object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"ResultSetPartitionInfo":{"type":"object","properties":{"rowCount":{"type":"integer","format":"int32","minimum":0}},"required":["id","rowCount"]}}}}
```

## The ResultSetMetadata object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"ResultSetMetadata":{"type":"object","properties":{"encoding":{"type":"string","enum":["json"]},"partitionInfo":{"type":"array","items":{"$ref":"#/components/schemas/ResultSetPartitionInfo"}},"columns":{"$ref":"#/components/schemas/ResultSetColumns"},"dataplaneRequest":{"$ref":"#/components/schemas/DataplaneRequest"},"context":{"$ref":"#/components/schemas/ResultSetContext"}},"required":["encoding","partitionInfo","columns"]},"ResultSetPartitionInfo":{"type":"object","properties":{"rowCount":{"type":"integer","format":"int32","minimum":0}},"required":["id","rowCount"]},"ResultSetColumns":{"type":"array","minItems":0,"items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"type":"boolean"},"display_hint":{"type":"string"}},"required":["name","type","nullable"]}},"DataplaneRequest":{"type":"object","properties":{"token":{"type":"string"},"uri":{"type":"string"},"statementID":{"type":"string"},"queryID":{"type":"string"},"requestType":{"type":"string","enum":["result-set","streaming"]}},"required":["token","uri","requestType","statementID"]},"ResultSetContext":{"type":"object","properties":{"organizationID":{"type":"string","format":"uuid"},"roleName":{"type":"string"},"databaseName":{"type":"string"},"schemaName":{"type":"string"},"storeName":{"type":"string"},"computePoolName":{"type":"string"}}}}}}
```

## The ResultSetColumns object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"ResultSetColumns":{"type":"array","minItems":0,"items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"nullable":{"type":"boolean"},"display_hint":{"type":"string"}},"required":["name","type","nullable"]}}}}}
```

## The DataplaneRequest object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"DataplaneRequest":{"type":"object","properties":{"token":{"type":"string"},"uri":{"type":"string"},"statementID":{"type":"string"},"queryID":{"type":"string"},"requestType":{"type":"string","enum":["result-set","streaming"]}},"required":["token","uri","requestType","statementID"]}}}}
```

## The ResultSetContext object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"ResultSetContext":{"type":"object","properties":{"organizationID":{"type":"string","format":"uuid"},"roleName":{"type":"string"},"databaseName":{"type":"string"},"schemaName":{"type":"string"},"storeName":{"type":"string"},"computePoolName":{"type":"string"}}}}}}
```

## The ErrorResponse object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"traceID":{"type":"string"}},"required":["message"]}}}}
```

## The Version object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"Version":{"type":"object","properties":{"major":{"type":"integer"},"minor":{"type":"integer"},"patch":{"type":"integer"}},"required":["major","minor","patch"]}}}}
```

## The Organization object

```json
{"openapi":"3.0.3","info":{"title":"DeltaStream REST API","version":"2.0.0"},"components":{"schemas":{"Organization":{"type":"object","properties":{"organizationID":{"type":"string","format":"uuid"},"defaultRoleName":{"type":"string"},"grantedRoles":{"type":"array","items":{"type":"string"}},"inheritedRoles":{"type":"array","items":{"type":"string"}}},"required":["organizationID","defaultRoleName"]}}}}
```
