@databricks/sdk-genie 0.1.0-dev.4 → 0.1.0-dev.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/v1/model.ts DELETED
@@ -1,2738 +0,0 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
-
3
- import {z} from 'zod';
4
-
5
- export enum ColumnTypeName {
6
- BOOLEAN = 'BOOLEAN',
7
- BYTE = 'BYTE',
8
- SHORT = 'SHORT',
9
- INT = 'INT',
10
- LONG = 'LONG',
11
- FLOAT = 'FLOAT',
12
- DOUBLE = 'DOUBLE',
13
- DATE = 'DATE',
14
- TIMESTAMP = 'TIMESTAMP',
15
- STRING = 'STRING',
16
- BINARY = 'BINARY',
17
- DECIMAL = 'DECIMAL',
18
- INTERVAL = 'INTERVAL',
19
- ARRAY = 'ARRAY',
20
- STRUCT = 'STRUCT',
21
- MAP = 'MAP',
22
- CHAR = 'CHAR',
23
- NULL = 'NULL',
24
- USER_DEFINED_TYPE = 'USER_DEFINED_TYPE',
25
- TIMESTAMP_NTZ = 'TIMESTAMP_NTZ',
26
- VARIANT = 'VARIANT',
27
- GEOMETRY = 'GEOMETRY',
28
- GEOGRAPHY = 'GEOGRAPHY',
29
- TABLE_TYPE = 'TABLE_TYPE',
30
- }
31
-
32
- /** Error codes returned by Databricks APIs to indicate specific failure conditions. */
33
- export enum ErrorCode {
34
- /**
35
- * Unknown error. This error generally should not be returned explicitly, but will be used
36
- * as a fallback if the error enum is missing from the message for some reason.
37
- *
38
- * It's assigned tag 0 to follow the best practice from
39
- * https://developers.google.com/protocol-buffers/docs/style#enums
40
- *
41
- * TODO(PLAT-55898): Add custom option to declare HTTP and gRPC mappings.
42
- * Maps to:
43
- * - google.rpc.Code: UNKNOWN = 2;
44
- * - HTTP code: 500 Internal Server Error
45
- */
46
- UNKNOWN = 'UNKNOWN',
47
- /**
48
- * Internal error. This means that some invariants expected by the underlying system have been
49
- * broken. This error code is reserved for serious errors, which generally cannot be resolved
50
- * by the user.
51
- *
52
- * Prefer this over all kinds of detailed error messages (e.g IO_ERROR), unless there's some
53
- * automation that relies on the custom error code.
54
- *
55
- * Maps to:
56
- * - google.rpc.Code: INTERNAL = 13;
57
- * - HTTP code: 500 Internal Server Error
58
- */
59
- INTERNAL_ERROR = 'INTERNAL_ERROR',
60
- /**
61
- * The service is currently unavailable. This is most likely a transient condition, which can be
62
- * corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent
63
- * operations.
64
- *
65
- * Prefer this over SERVICE_UNDER_MAINTENANCE, WORKSPACE_TEMPORARILY_UNAVAILABLE.
66
- *
67
- * See https://docs.google.com/document/d/1FL8p2sbYWqBPL-UvhzI7uXAw4EoLG7Rj6PAOQWZRSOk/edit#
68
- * for guideline on how to pick this vs RESOURCE_EXHAUSTED.
69
- *
70
- * Maps to:
71
- * - google.rpc.Code: UNAVAILABLE = 14;
72
- * - HTTP code: 503 Service Unavailable
73
- */
74
- TEMPORARILY_UNAVAILABLE = 'TEMPORARILY_UNAVAILABLE',
75
- /**
76
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
77
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
78
- * Indicates that an IOException has been internally thrown.
79
- */
80
- IO_ERROR = 'IO_ERROR',
81
- /**
82
- * The request is invalid. Prefer more specific error code whenever possible.
83
- * Also see similar recommendation for the google.rpc.Code.FAILED_PRECONDITION.
84
- *
85
- * Prefer this error code over MALFORMED_REQUEST, INVALID_STATE, UNPARSEABLE_HTTP_ERROR.
86
- *
87
- * Maps to:
88
- * - google.rpc.Code: FAILED_PRECONDITION = 9;
89
- * - HTTP code: 400 Bad Request
90
- */
91
- BAD_REQUEST = 'BAD_REQUEST',
92
- /**
93
- * An external service is unavailable temporarily as it is being updated/re-deployed. Indicates
94
- * gateway proxy to safely retry the request.
95
- */
96
- SERVICE_UNDER_MAINTENANCE = 'SERVICE_UNDER_MAINTENANCE',
97
- /** A workspace is temporarily unavailable as the workspace is being re-assigned. */
98
- WORKSPACE_TEMPORARILY_UNAVAILABLE = 'WORKSPACE_TEMPORARILY_UNAVAILABLE',
99
- /**
100
- * The deadline expired before the operation could complete. For operations that change the state
101
- * of the system, this error may be returned even if the operation has completed successfully.
102
- * For example, a successful response from a server could have been delayed long enough for
103
- * the deadline to expire. When possible - implementations should make sure further processing of
104
- * the request is aborted, e.g. by throwing an exception instead of making the RPC request,
105
- * making the database query, etc.
106
- *
107
- * Maps to:
108
- * - google.rpc.Code: DEADLINE_EXCEEDED = 4;
109
- * - HTTP code: 504 Gateway Timeout
110
- */
111
- DEADLINE_EXCEEDED = 'DEADLINE_EXCEEDED',
112
- /**
113
- * The operation was canceled by the caller. An example - client closed the connection without
114
- * waiting for a response.
115
- *
116
- * Maps to:
117
- * - google.rpc.Code: CANCELLED = 1;
118
- * - HTTP code: 499 Client Closed Request
119
- */
120
- CANCELLED = 'CANCELLED',
121
- /**
122
- * The operation is rejected because of either rate limiting or resource quota,
123
- * such as the client has sent too many requests recently or the client has allocated too many
124
- * resources.
125
- *
126
- * See https://docs.google.com/document/d/1FL8p2sbYWqBPL-UvhzI7uXAw4EoLG7Rj6PAOQWZRSOk/edit#
127
- * for guideline on how to pick this vs TEMPORARILY_UNAVAILABLE.
128
- *
129
- * Maps to:
130
- * - google.rpc.Code: RESOURCE_EXHAUSTED = 8;
131
- * - HTTP code: 429 Too Many Requests
132
- */
133
- RESOURCE_EXHAUSTED = 'RESOURCE_EXHAUSTED',
134
- /**
135
- * The operation was aborted, typically due to a concurrency issue such as a sequencer
136
- * check failure, transaction abort, or transaction conflict.
137
- *
138
- * Maps to:
139
- * - google.rpc.Code: ABORTED = 10;
140
- * - HTTP code: 409 Conflict
141
- */
142
- ABORTED = 'ABORTED',
143
- /**
144
- * Operation was performed on a resource that does not exist,
145
- * e.g. file or directory was not found.
146
- *
147
- * Maps to:
148
- * - google.rpc.Code: NOT_FOUND = 5;
149
- * - HTTP code: 404 Not Found
150
- */
151
- NOT_FOUND = 'NOT_FOUND',
152
- /**
153
- * Operation was rejected due a conflict with an existing resource, e.g. attempted to create
154
- * file or directory that already exists.
155
- *
156
- * Prefer this over RESOURCE_CONFLICT.
157
- *
158
- * Maps to:
159
- * - google.rpc.Code: ALREADY_EXISTS = 6;
160
- * - HTTP code: 409 Conflict
161
- */
162
- ALREADY_EXISTS = 'ALREADY_EXISTS',
163
- /**
164
- * The request does not have valid authentication (AuthN) credentials for the operation.
165
- *
166
- * Prefer this over CUSTOMER_UNAUTHORIZED, unless you need to keep consistent behavior with legacy
167
- * code.
168
- * For authorization (AuthZ) errors use PERMISSION_DENIED.
169
- *
170
- * Maps to:
171
- * - google.rpc.Code: UNAUTHENTICATED = 16;
172
- * - HTTP code: 401 Unauthorized
173
- */
174
- UNAUTHENTICATED = 'UNAUTHENTICATED',
175
- /**
176
- * The service is currently unavailable. Please note that the unavailability may or may not be transient.
177
- * That means if this is a non-transient condition, retrying it does not work. If the unavailability
178
- * is certainly a transient condition, pleases use `TEMPORARILY_UNAVAILABLE` which signals its transient
179
- * nature explicitly.
180
- * An example of this error code’s use case is that when DNS resolution fails, the DNS resolver does
181
- * not know whether it is because the domain name is completely wrong (non-transient situation) or
182
- * the domain name is valid but the DNS server does not have an entry for this domain name yet (transient
183
- * situation). Hence, `UNAVAILABLE` is suitable for this case.
184
- *
185
- * Maps to:
186
- * - google.rpc.Code: UNAVAILABLE = 14;
187
- * - HTTP code: 503 Service Unavailable
188
- */
189
- UNAVAILABLE = 'UNAVAILABLE',
190
- /**
191
- * Supplied value for a parameter was invalid (e.g., giving a number for a string parameter).
192
- *
193
- * Maps to:
194
- * - google.rpc.Code: INVALID_ARGUMENT = 3;
195
- * - HTTP code: 400 Bad Request
196
- */
197
- INVALID_PARAMETER_VALUE = 'INVALID_PARAMETER_VALUE',
198
- /**
199
- * Indicates that the given API endpoint does not exist. Legacy, when possible - NOT_IMPLEMENTED
200
- * should be used instead to indicate that API doesn't exist.
201
- *
202
- * Maps to:
203
- * - google.rpc.Code: NOT_FOUND = 5;
204
- * - HTTP code: 404 Not Found
205
- */
206
- ENDPOINT_NOT_FOUND = 'ENDPOINT_NOT_FOUND',
207
- /** Indicates that the given API request was malformed. */
208
- MALFORMED_REQUEST = 'MALFORMED_REQUEST',
209
- /**
210
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
211
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
212
- * If one or more of the inputs to a given RPC are not in a valid state for the action.
213
- */
214
- INVALID_STATE = 'INVALID_STATE',
215
- /**
216
- * The caller does not have permission to execute the specified operation.
217
- * PERMISSION_DENIED must not be used for rejections caused by exhausting some resource,
218
- * use RESOURCE_EXHAUSTED instead for those errors.
219
- * PERMISSION_DENIED must not be used if the caller can not be identified,
220
- * use CUSTOMER_UNAUTHORIZED instead for those errors.
221
- * This error code does not imply the request is valid or the requested entity exists or
222
- * satisfies other pre-conditions.
223
- *
224
- * Maps to:
225
- * - google.rpc.Code: PERMISSION_DENIED = 7;
226
- * - HTTP code: 403 Forbidden
227
- */
228
- PERMISSION_DENIED = 'PERMISSION_DENIED',
229
- /**
230
- * NOTE: Deprecated due to inconsistent mapping in legacy code, see
231
- * https://docs.google.com/document/d/17TZIKX_Y39cJMBr333lc-d5dTvvBLSu3DPUyGU5eMJg/edit?disco=AAAAzVGt6FA.
232
- * Prefer using NOT_FOUND or PERMISSION_DENIED.
233
- *
234
- * If a given user/entity is trying to use a feature which has been disabled.
235
- *
236
- * Maps to:
237
- * - google.rpc.Code: NOT_FOUND = 5;
238
- * - HTTP code: 404 Not Found
239
- */
240
- FEATURE_DISABLED = 'FEATURE_DISABLED',
241
- /**
242
- * The request does not have valid authentication (AuthN) credentials for the operation.
243
- *
244
- * For authentication (AuthN) errors prefer using UNAUTHENTICATED, unless you need to keep
245
- * consistent behavior with legacy code.
246
- * For authorization (AuthZ) errors use PERMISSION_DENIED.
247
- *
248
- * Important: name is confusing, this error code is for authentication (AuthN) errors, not
249
- * authorization (AuthZ) errors. It maps to 401 Unauthorized and suffers from the same confusing
250
- * naming. See https://datatracker.ietf.org/doc/html/rfc7235#section-3.1 - "[...] status code
251
- * indicates that the request has not been applied because it lacks valid authentication
252
- * credentials for the target resource. [...] If the request included authentication credentials,
253
- * then the 401 response indicates that authorization has been refused for those credentials."
254
- *
255
- * Also, see https://stackoverflow.com/a/6937030/16352922, it covers it pretty well.
256
- *
257
- * Maps to:
258
- * - google.rpc.Code: UNAUTHENTICATED = 16;
259
- * - HTTP code: 401 Unauthorized
260
- */
261
- CUSTOMER_UNAUTHORIZED = 'CUSTOMER_UNAUTHORIZED',
262
- /**
263
- * The operation is rejected because of request rate limit, for example rate limiting applied to
264
- * users, workspaces, IP addresses, etc.
265
- *
266
- * Prefer a more generic RESOURCE_EXHAUSTED for the new use cases.
267
- *
268
- * See https://docs.google.com/document/d/1FL8p2sbYWqBPL-UvhzI7uXAw4EoLG7Rj6PAOQWZRSOk/edit#
269
- * for guideline on the rate limiting vs throttling.
270
- *
271
- * Maps to:
272
- * - google.rpc.Code: RESOURCE_EXHAUSTED = 8;
273
- * - HTTP code: 429 Too Many Requests
274
- */
275
- REQUEST_LIMIT_EXCEEDED = 'REQUEST_LIMIT_EXCEEDED',
276
- /** Indicates API request was rejected due a conflict with an existing resource. */
277
- RESOURCE_CONFLICT = 'RESOURCE_CONFLICT',
278
- /**
279
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
280
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
281
- * Indicates that the HTTP response cannot be correctly deserialized.
282
- * This currently is only used in DUST test clients, and not by any real service code.
283
- */
284
- UNPARSEABLE_HTTP_ERROR = 'UNPARSEABLE_HTTP_ERROR',
285
- /**
286
- * The operation is not implemented or is not supported/enabled in this service.
287
- *
288
- * Maps to:
289
- * - google.rpc.Code: UNIMPLEMENTED = 12;
290
- * - HTTP code: 501 Not Implemented
291
- */
292
- NOT_IMPLEMENTED = 'NOT_IMPLEMENTED',
293
- /**
294
- * Unrecoverable data loss or corruption.
295
- *
296
- * One of the major use cases is to indicate that server failed to validate the integrity of
297
- * the request. This error can occur when the checksum specified in the `X-Databricks-Checksum`
298
- * request header (or trailer) doesn't match the actual request content checksum.
299
- *
300
- * Note, in case of the severe corruption that results in a malformed request, the server may
301
- * send a generic `400 Bad Request` response rather than sending this error code.
302
- *
303
- * Maps to:
304
- * - google.rpc.Code: DATA_LOSS = 15;
305
- * - HTTP code: 500 Internal Server Error
306
- */
307
- DATA_LOSS = 'DATA_LOSS',
308
- /** If the user attempts to perform an invalid state transition on a shard. */
309
- INVALID_STATE_TRANSITION = 'INVALID_STATE_TRANSITION',
310
- /**
311
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
312
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
313
- * Unable to perform the operation because the shard was locked by some other operation.
314
- */
315
- COULD_NOT_ACQUIRE_LOCK = 'COULD_NOT_ACQUIRE_LOCK',
316
- /**
317
- * NOTE: Deprecated, prefer using ALREADY_EXISTS.
318
- * Unlike ALREADY_EXISTS - this maps to HTTP code 400 Bad Request due to legacy reasons,
319
- * remapping will be a backwards incompatible change.
320
- *
321
- * Operation was performed on a resource that already exists.
322
- */
323
- RESOURCE_ALREADY_EXISTS = 'RESOURCE_ALREADY_EXISTS',
324
- /**
325
- * NOTE: Deprecated, prefer using NOT_FOUND - see the note for the RESOURCE_ALREADY_EXISTS,
326
- * because this pair of codes is related and RESOURCE_ALREADY_EXISTS has bad mapping to the HTTP
327
- * codes we added new error codes NOT_FOUND and ALREADY_EXISTS, and recommend to use them instead.
328
- *
329
- * Operation was performed on a resource that does not exist.
330
- */
331
- RESOURCE_DOES_NOT_EXIST = 'RESOURCE_DOES_NOT_EXIST',
332
- /**
333
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
334
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
335
- */
336
- QUOTA_EXCEEDED = 'QUOTA_EXCEEDED',
337
- /**
338
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
339
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
340
- */
341
- MAX_BLOCK_SIZE_EXCEEDED = 'MAX_BLOCK_SIZE_EXCEEDED',
342
- /**
343
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
344
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
345
- */
346
- MAX_READ_SIZE_EXCEEDED = 'MAX_READ_SIZE_EXCEEDED',
347
- PARTIAL_DELETE = 'PARTIAL_DELETE',
348
- MAX_LIST_SIZE_EXCEEDED = 'MAX_LIST_SIZE_EXCEEDED',
349
- /**
350
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
351
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
352
- */
353
- DRY_RUN_FAILED = 'DRY_RUN_FAILED',
354
- /**
355
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
356
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
357
- * Cluster request was rejected because it would exceed a resource limit.
358
- */
359
- RESOURCE_LIMIT_EXCEEDED = 'RESOURCE_LIMIT_EXCEEDED',
360
- /**
361
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
362
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
363
- */
364
- DIRECTORY_NOT_EMPTY = 'DIRECTORY_NOT_EMPTY',
365
- /**
366
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
367
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
368
- */
369
- DIRECTORY_PROTECTED = 'DIRECTORY_PROTECTED',
370
- /**
371
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
372
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
373
- */
374
- MAX_NOTEBOOK_SIZE_EXCEEDED = 'MAX_NOTEBOOK_SIZE_EXCEEDED',
375
- MAX_CHILD_NODE_SIZE_EXCEEDED = 'MAX_CHILD_NODE_SIZE_EXCEEDED',
376
- /**
377
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
378
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
379
- */
380
- SEARCH_QUERY_TOO_LONG = 'SEARCH_QUERY_TOO_LONG',
381
- /**
382
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
383
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
384
- */
385
- SEARCH_QUERY_TOO_SHORT = 'SEARCH_QUERY_TOO_SHORT',
386
- /**
387
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
388
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
389
- */
390
- MANAGED_RESOURCE_GROUP_DOES_NOT_EXIST = 'MANAGED_RESOURCE_GROUP_DOES_NOT_EXIST',
391
- /**
392
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
393
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
394
- */
395
- PERMISSION_NOT_PROPAGATED = 'PERMISSION_NOT_PROPAGATED',
396
- /**
397
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
398
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
399
- */
400
- DEPLOYMENT_TIMEOUT = 'DEPLOYMENT_TIMEOUT',
401
- /**
402
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
403
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
404
- */
405
- GIT_CONFLICT = 'GIT_CONFLICT',
406
- /**
407
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
408
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
409
- */
410
- GIT_UNKNOWN_REF = 'GIT_UNKNOWN_REF',
411
- /**
412
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
413
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
414
- */
415
- GIT_SENSITIVE_TOKEN_DETECTED = 'GIT_SENSITIVE_TOKEN_DETECTED',
416
- /**
417
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
418
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
419
- */
420
- GIT_URL_NOT_ON_ALLOW_LIST = 'GIT_URL_NOT_ON_ALLOW_LIST',
421
- /**
422
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
423
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
424
- */
425
- GIT_REMOTE_ERROR = 'GIT_REMOTE_ERROR',
426
- /**
427
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
428
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
429
- */
430
- PROJECTS_OPERATION_TIMEOUT = 'PROJECTS_OPERATION_TIMEOUT',
431
- /**
432
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
433
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
434
- */
435
- IPYNB_FILE_IN_REPO = 'IPYNB_FILE_IN_REPO',
436
- /**
437
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
438
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
439
- */
440
- INSECURE_PARTNER_RESPONSE = 'INSECURE_PARTNER_RESPONSE',
441
- /**
442
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
443
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
444
- */
445
- MALFORMED_PARTNER_RESPONSE = 'MALFORMED_PARTNER_RESPONSE',
446
- METASTORE_DOES_NOT_EXIST = 'METASTORE_DOES_NOT_EXIST',
447
- /**
448
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
449
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
450
- */
451
- DAC_DOES_NOT_EXIST = 'DAC_DOES_NOT_EXIST',
452
- CATALOG_DOES_NOT_EXIST = 'CATALOG_DOES_NOT_EXIST',
453
- SCHEMA_DOES_NOT_EXIST = 'SCHEMA_DOES_NOT_EXIST',
454
- TABLE_DOES_NOT_EXIST = 'TABLE_DOES_NOT_EXIST',
455
- SHARE_DOES_NOT_EXIST = 'SHARE_DOES_NOT_EXIST',
456
- RECIPIENT_DOES_NOT_EXIST = 'RECIPIENT_DOES_NOT_EXIST',
457
- STORAGE_CREDENTIAL_DOES_NOT_EXIST = 'STORAGE_CREDENTIAL_DOES_NOT_EXIST',
458
- EXTERNAL_LOCATION_DOES_NOT_EXIST = 'EXTERNAL_LOCATION_DOES_NOT_EXIST',
459
- PRINCIPAL_DOES_NOT_EXIST = 'PRINCIPAL_DOES_NOT_EXIST',
460
- PROVIDER_DOES_NOT_EXIST = 'PROVIDER_DOES_NOT_EXIST',
461
- /**
462
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
463
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
464
- */
465
- METASTORE_ALREADY_EXISTS = 'METASTORE_ALREADY_EXISTS',
466
- /**
467
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
468
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
469
- */
470
- DAC_ALREADY_EXISTS = 'DAC_ALREADY_EXISTS',
471
- /**
472
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
473
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
474
- */
475
- CATALOG_ALREADY_EXISTS = 'CATALOG_ALREADY_EXISTS',
476
- /**
477
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
478
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
479
- */
480
- SCHEMA_ALREADY_EXISTS = 'SCHEMA_ALREADY_EXISTS',
481
- /**
482
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
483
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
484
- */
485
- TABLE_ALREADY_EXISTS = 'TABLE_ALREADY_EXISTS',
486
- /**
487
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
488
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
489
- */
490
- SHARE_ALREADY_EXISTS = 'SHARE_ALREADY_EXISTS',
491
- /**
492
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
493
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
494
- */
495
- RECIPIENT_ALREADY_EXISTS = 'RECIPIENT_ALREADY_EXISTS',
496
- /**
497
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
498
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
499
- */
500
- STORAGE_CREDENTIAL_ALREADY_EXISTS = 'STORAGE_CREDENTIAL_ALREADY_EXISTS',
501
- /**
502
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
503
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
504
- */
505
- EXTERNAL_LOCATION_ALREADY_EXISTS = 'EXTERNAL_LOCATION_ALREADY_EXISTS',
506
- /**
507
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
508
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
509
- */
510
- PROVIDER_ALREADY_EXISTS = 'PROVIDER_ALREADY_EXISTS',
511
- /**
512
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
513
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
514
- */
515
- CATALOG_NOT_EMPTY = 'CATALOG_NOT_EMPTY',
516
- /**
517
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
518
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
519
- */
520
- SCHEMA_NOT_EMPTY = 'SCHEMA_NOT_EMPTY',
521
- /**
522
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
523
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
524
- */
525
- METASTORE_NOT_EMPTY = 'METASTORE_NOT_EMPTY',
526
- /**
527
- * NOTE: Deprecated and kept to maintain backwards compatibility for public APIs that use it,
528
- * avoid using it in the new APIs, refer error codes listed in the http://go/error-codes.
529
- */
530
- PROVIDER_SHARE_NOT_ACCESSIBLE = 'PROVIDER_SHARE_NOT_ACCESSIBLE',
531
- }
532
-
533
- export enum EvaluationStatusType {
534
- EVALUATION_STATUS_TYPE_UNSPECIFIED = 'EVALUATION_STATUS_TYPE_UNSPECIFIED',
535
- RUNNING = 'RUNNING',
536
- DONE = 'DONE',
537
- NOT_STARTED = 'NOT_STARTED',
538
- EVALUATION_FAILED = 'EVALUATION_FAILED',
539
- EVALUATION_CANCELLED = 'EVALUATION_CANCELLED',
540
- EVALUATION_TIMEOUT = 'EVALUATION_TIMEOUT',
541
- }
542
-
543
- export enum Format {
544
- FORMAT_UNSPECIFIED = 'FORMAT_UNSPECIFIED',
545
- JSON_ARRAY = 'JSON_ARRAY',
546
- ARROW_STREAM = 'ARROW_STREAM',
547
- CSV = 'CSV',
548
- }
549
-
550
- export enum GenieEvalAssessment {
551
- GENIE_EVAL_ASSESSMENT_UNSPECIFIED = 'GENIE_EVAL_ASSESSMENT_UNSPECIFIED',
552
- GOOD = 'GOOD',
553
- BAD = 'BAD',
554
- NEEDS_REVIEW = 'NEEDS_REVIEW',
555
- }
556
-
557
- export enum GenieEvalResponseType {
558
- GENIE_EVAL_RESPONSE_TYPE_UNSPECIFIED = 'GENIE_EVAL_RESPONSE_TYPE_UNSPECIFIED',
559
- TEXT = 'TEXT',
560
- SQL = 'SQL',
561
- }
562
-
563
- /** Feedback rating for Genie messages */
564
- export enum GenieFeedbackRating {
565
- GENIE_FEEDBACK_RATING_UNSPECIFIED = 'GENIE_FEEDBACK_RATING_UNSPECIFIED',
566
- POSITIVE = 'POSITIVE',
567
- NEGATIVE = 'NEGATIVE',
568
- NONE = 'NONE',
569
- }
570
-
571
- /**
572
- * copied from proto3 / Google Well Known Types, source:
573
- * https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto
574
- * `NullValue` is a singleton enumeration to represent the null value for the
575
- * `Value` type union.
576
- *
577
- * The JSON representation for `NullValue` is JSON `null`.
578
- */
579
- export enum NullValue {
580
- /** Null value. */
581
- NULL_VALUE = 'NULL_VALUE',
582
- }
583
-
584
- export enum ScoreReason {
585
- SCORE_REASON_UNSPECIFIED = 'SCORE_REASON_UNSPECIFIED',
586
- EMPTY_RESULT = 'EMPTY_RESULT',
587
- RESULT_MISSING_ROWS = 'RESULT_MISSING_ROWS',
588
- RESULT_EXTRA_ROWS = 'RESULT_EXTRA_ROWS',
589
- RESULT_MISSING_COLUMNS = 'RESULT_MISSING_COLUMNS',
590
- RESULT_EXTRA_COLUMNS = 'RESULT_EXTRA_COLUMNS',
591
- SINGLE_CELL_DIFFERENCE = 'SINGLE_CELL_DIFFERENCE',
592
- EMPTY_GOOD_SQL = 'EMPTY_GOOD_SQL',
593
- COLUMN_TYPE_DIFFERENCE = 'COLUMN_TYPE_DIFFERENCE',
594
- /** Deprecated LLM Judge error categories - kept for backward compatibility */
595
- LLM_JUDGE_MISSING_JOIN = 'LLM_JUDGE_MISSING_JOIN',
596
- LLM_JUDGE_WRONG_FILTER = 'LLM_JUDGE_WRONG_FILTER',
597
- LLM_JUDGE_WRONG_AGGREGATION = 'LLM_JUDGE_WRONG_AGGREGATION',
598
- LLM_JUDGE_WRONG_COLUMNS = 'LLM_JUDGE_WRONG_COLUMNS',
599
- LLM_JUDGE_SYNTAX_ERROR = 'LLM_JUDGE_SYNTAX_ERROR',
600
- LLM_JUDGE_SEMANTIC_ERROR = 'LLM_JUDGE_SEMANTIC_ERROR',
601
- /** New LLM Judge error categories - aligned with LlmJudgeFunctionSpec */
602
- LLM_JUDGE_OTHER = 'LLM_JUDGE_OTHER',
603
- LLM_JUDGE_MISSING_OR_INCORRECT_FILTER = 'LLM_JUDGE_MISSING_OR_INCORRECT_FILTER',
604
- LLM_JUDGE_INCOMPLETE_OR_PARTIAL_OUTPUT = 'LLM_JUDGE_INCOMPLETE_OR_PARTIAL_OUTPUT',
605
- LLM_JUDGE_MISINTERPRETATION_OF_USER_REQUEST = 'LLM_JUDGE_MISINTERPRETATION_OF_USER_REQUEST',
606
- LLM_JUDGE_INSTRUCTION_COMPLIANCE_OR_MISSING_BUSINESS_LOGIC = 'LLM_JUDGE_INSTRUCTION_COMPLIANCE_OR_MISSING_BUSINESS_LOGIC',
607
- LLM_JUDGE_INCORRECT_METRIC_CALCULATION = 'LLM_JUDGE_INCORRECT_METRIC_CALCULATION',
608
- LLM_JUDGE_INCORRECT_TABLE_OR_FIELD_USAGE = 'LLM_JUDGE_INCORRECT_TABLE_OR_FIELD_USAGE',
609
- LLM_JUDGE_INCORRECT_FUNCTION_USAGE = 'LLM_JUDGE_INCORRECT_FUNCTION_USAGE',
610
- LLM_JUDGE_MISSING_OR_INCORRECT_JOIN = 'LLM_JUDGE_MISSING_OR_INCORRECT_JOIN',
611
- LLM_JUDGE_MISSING_OR_INCORRECT_AGGREGATION = 'LLM_JUDGE_MISSING_OR_INCORRECT_AGGREGATION',
612
- LLM_JUDGE_FORMATTING_ERROR = 'LLM_JUDGE_FORMATTING_ERROR',
613
- }
614
-
615
- /** Purpose/intent of a text attachment */
616
- export enum TextAttachmentPurpose {
617
- TEXT_ATTACHMENT_PURPOSE_UNSPECIFIED = 'TEXT_ATTACHMENT_PURPOSE_UNSPECIFIED',
618
- FOLLOW_UP_QUESTION = 'FOLLOW_UP_QUESTION',
619
- }
620
-
621
- /**
622
- * ThoughtType.
623
- * The possible values are:
624
- * * `THOUGHT_TYPE_UNSPECIFIED`: Default value that should not be used.
625
- * * `THOUGHT_TYPE_DESCRIPTION`: A high-level description of how the question was interpreted.
626
- * * `THOUGHT_TYPE_UNDERSTANDING`: How ambiguous parts of the question were resolved.
627
- * * `THOUGHT_TYPE_DATA_SOURCING`: Which tables or datasets were identified as relevant.
628
- * * `THOUGHT_TYPE_INSTRUCTIONS`: Which author-defined instructions were referenced.
629
- * * `THOUGHT_TYPE_STEPS`: The logical steps taken to compute the answer.
630
- * The category of a Thought.
631
- * Additional values may be added in the future.
632
- */
633
- export enum ThoughtType {
634
- THOUGHT_TYPE_UNSPECIFIED = 'THOUGHT_TYPE_UNSPECIFIED',
635
- /** A high-level description of how the question was interpreted. */
636
- THOUGHT_TYPE_DESCRIPTION = 'THOUGHT_TYPE_DESCRIPTION',
637
- /** How ambiguous parts of the question were resolved. */
638
- THOUGHT_TYPE_UNDERSTANDING = 'THOUGHT_TYPE_UNDERSTANDING',
639
- /** Which tables or datasets were identified as relevant. */
640
- THOUGHT_TYPE_DATA_SOURCING = 'THOUGHT_TYPE_DATA_SOURCING',
641
- /** Which author-defined instructions were referenced. */
642
- THOUGHT_TYPE_INSTRUCTIONS = 'THOUGHT_TYPE_INSTRUCTIONS',
643
- /** The logical steps taken to compute the answer. */
644
- THOUGHT_TYPE_STEPS = 'THOUGHT_TYPE_STEPS',
645
- }
646
-
647
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
648
- export enum MessageError_Type {
649
- TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED',
650
- UNEXPECTED_REPLY_PROCESS_EXCEPTION = 'UNEXPECTED_REPLY_PROCESS_EXCEPTION',
651
- GENERIC_CHAT_COMPLETION_EXCEPTION = 'GENERIC_CHAT_COMPLETION_EXCEPTION',
652
- /** TokenCounter estimates were off and OpenAi responds with an error due to the token limit. */
653
- CONTEXT_EXCEEDED_EXCEPTION = 'CONTEXT_EXCEEDED_EXCEPTION',
654
- DEPLOYMENT_NOT_FOUND_EXCEPTION = 'DEPLOYMENT_NOT_FOUND_EXCEPTION',
655
- FUNCTIONS_NOT_AVAILABLE_EXCEPTION = 'FUNCTIONS_NOT_AVAILABLE_EXCEPTION',
656
- INVALID_COMPLETION_REQUEST_EXCEPTION = 'INVALID_COMPLETION_REQUEST_EXCEPTION',
657
- CONTENT_FILTER_EXCEPTION = 'CONTENT_FILTER_EXCEPTION',
658
- FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION = 'FUNCTION_ARGUMENTS_INVALID_JSON_EXCEPTION',
659
- RETRYABLE_PROCESSING_EXCEPTION = 'RETRYABLE_PROCESSING_EXCEPTION',
660
- INVALID_FUNCTION_CALL_EXCEPTION = 'INVALID_FUNCTION_CALL_EXCEPTION',
661
- /** Request can not fit into model or the configured limits and TokenCounter registers token limit exceeded. */
662
- LOCAL_CONTEXT_EXCEEDED_EXCEPTION = 'LOCAL_CONTEXT_EXCEEDED_EXCEPTION',
663
- CHAT_COMPLETION_NETWORK_EXCEPTION = 'CHAT_COMPLETION_NETWORK_EXCEPTION',
664
- INVALID_CHAT_COMPLETION_JSON_EXCEPTION = 'INVALID_CHAT_COMPLETION_JSON_EXCEPTION',
665
- GENERIC_CHAT_COMPLETION_SERVICE_EXCEPTION = 'GENERIC_CHAT_COMPLETION_SERVICE_EXCEPTION',
666
- WAREHOUSE_ACCESS_MISSING_EXCEPTION = 'WAREHOUSE_ACCESS_MISSING_EXCEPTION',
667
- WAREHOUSE_NOT_FOUND_EXCEPTION = 'WAREHOUSE_NOT_FOUND_EXCEPTION',
668
- NO_TABLES_TO_QUERY_EXCEPTION = 'NO_TABLES_TO_QUERY_EXCEPTION',
669
- SQL_EXECUTION_EXCEPTION = 'SQL_EXECUTION_EXCEPTION',
670
- REPLY_PROCESS_TIMEOUT_EXCEPTION = 'REPLY_PROCESS_TIMEOUT_EXCEPTION',
671
- COULD_NOT_GET_UC_SCHEMA_EXCEPTION = 'COULD_NOT_GET_UC_SCHEMA_EXCEPTION',
672
- INVALID_TABLE_IDENTIFIER_EXCEPTION = 'INVALID_TABLE_IDENTIFIER_EXCEPTION',
673
- TOO_MANY_TABLES_EXCEPTION = 'TOO_MANY_TABLES_EXCEPTION',
674
- FUNCTION_ARGUMENTS_INVALID_EXCEPTION = 'FUNCTION_ARGUMENTS_INVALID_EXCEPTION',
675
- GENERIC_SQL_EXEC_API_CALL_EXCEPTION = 'GENERIC_SQL_EXEC_API_CALL_EXCEPTION',
676
- CHAT_COMPLETION_CLIENT_EXCEPTION = 'CHAT_COMPLETION_CLIENT_EXCEPTION',
677
- CHAT_COMPLETION_CLIENT_TIMEOUT_EXCEPTION = 'CHAT_COMPLETION_CLIENT_TIMEOUT_EXCEPTION',
678
- UNKNOWN_AI_MODEL = 'UNKNOWN_AI_MODEL',
679
- TABLES_MISSING_EXCEPTION = 'TABLES_MISSING_EXCEPTION',
680
- MESSAGE_DELETED_WHILE_EXECUTING_EXCEPTION = 'MESSAGE_DELETED_WHILE_EXECUTING_EXCEPTION',
681
- MESSAGE_UPDATED_WHILE_EXECUTING_EXCEPTION = 'MESSAGE_UPDATED_WHILE_EXECUTING_EXCEPTION',
682
- BLOCK_MULTIPLE_EXECUTIONS_EXCEPTION = 'BLOCK_MULTIPLE_EXECUTIONS_EXCEPTION',
683
- INVALID_CERTIFIED_ANSWER_IDENTIFIER_EXCEPTION = 'INVALID_CERTIFIED_ANSWER_IDENTIFIER_EXCEPTION',
684
- TOO_MANY_CERTIFIED_ANSWERS_EXCEPTION = 'TOO_MANY_CERTIFIED_ANSWERS_EXCEPTION',
685
- RATE_LIMIT_EXCEEDED_GENERIC_EXCEPTION = 'RATE_LIMIT_EXCEEDED_GENERIC_EXCEPTION',
686
- RATE_LIMIT_EXCEEDED_SPECIFIED_WAIT_EXCEPTION = 'RATE_LIMIT_EXCEEDED_SPECIFIED_WAIT_EXCEPTION',
687
- FUNCTION_CALL_MISSING_PARAMETER_EXCEPTION = 'FUNCTION_CALL_MISSING_PARAMETER_EXCEPTION',
688
- INVALID_CERTIFIED_ANSWER_FUNCTION_EXCEPTION = 'INVALID_CERTIFIED_ANSWER_FUNCTION_EXCEPTION',
689
- ILLEGAL_PARAMETER_DEFINITION_EXCEPTION = 'ILLEGAL_PARAMETER_DEFINITION_EXCEPTION',
690
- NO_QUERY_TO_VISUALIZE_EXCEPTION = 'NO_QUERY_TO_VISUALIZE_EXCEPTION',
691
- NO_DEPLOYMENTS_AVAILABLE_TO_WORKSPACE = 'NO_DEPLOYMENTS_AVAILABLE_TO_WORKSPACE',
692
- STOP_PROCESS_DUE_TO_AUTO_REGENERATE = 'STOP_PROCESS_DUE_TO_AUTO_REGENERATE',
693
- FUNCTION_ARGUMENTS_INVALID_TYPE_EXCEPTION = 'FUNCTION_ARGUMENTS_INVALID_TYPE_EXCEPTION',
694
- MESSAGE_CANCELLED_WHILE_EXECUTING_EXCEPTION = 'MESSAGE_CANCELLED_WHILE_EXECUTING_EXCEPTION',
695
- COULD_NOT_GET_MODEL_DEPLOYMENTS_EXCEPTION = 'COULD_NOT_GET_MODEL_DEPLOYMENTS_EXCEPTION',
696
- GENERATED_SQL_QUERY_TOO_LONG_EXCEPTION = 'GENERATED_SQL_QUERY_TOO_LONG_EXCEPTION',
697
- MISSING_SQL_QUERY_EXCEPTION = 'MISSING_SQL_QUERY_EXCEPTION',
698
- DESCRIBE_QUERY_UNEXPECTED_FAILURE = 'DESCRIBE_QUERY_UNEXPECTED_FAILURE',
699
- DESCRIBE_QUERY_TIMEOUT = 'DESCRIBE_QUERY_TIMEOUT',
700
- DESCRIBE_QUERY_INVALID_SQL_ERROR = 'DESCRIBE_QUERY_INVALID_SQL_ERROR',
701
- INVALID_SQL_UNKNOWN_TABLE_EXCEPTION = 'INVALID_SQL_UNKNOWN_TABLE_EXCEPTION',
702
- INVALID_SQL_MULTIPLE_STATEMENTS_EXCEPTION = 'INVALID_SQL_MULTIPLE_STATEMENTS_EXCEPTION',
703
- INVALID_SQL_MULTIPLE_DATASET_REFERENCES_EXCEPTION = 'INVALID_SQL_MULTIPLE_DATASET_REFERENCES_EXCEPTION',
704
- MESSAGE_ATTACHMENT_TOO_LONG_ERROR = 'MESSAGE_ATTACHMENT_TOO_LONG_ERROR',
705
- INTERNAL_CATALOG_PATH_OVERLAP_EXCEPTION = 'INTERNAL_CATALOG_PATH_OVERLAP_EXCEPTION',
706
- INTERNAL_CATALOG_MISSING_UC_PATH_EXCEPTION = 'INTERNAL_CATALOG_MISSING_UC_PATH_EXCEPTION',
707
- EXCEEDED_MAX_TOKEN_LENGTH_EXCEPTION = 'EXCEEDED_MAX_TOKEN_LENGTH_EXCEPTION',
708
- INTERNAL_CATALOG_ASSET_CREATION_ONGOING_EXCEPTION = 'INTERNAL_CATALOG_ASSET_CREATION_ONGOING_EXCEPTION',
709
- INTERNAL_CATALOG_ASSET_CREATION_FAILED_EXCEPTION = 'INTERNAL_CATALOG_ASSET_CREATION_FAILED_EXCEPTION',
710
- INTERNAL_CATALOG_ASSET_CREATION_UNSUPPORTED_EXCEPTION = 'INTERNAL_CATALOG_ASSET_CREATION_UNSUPPORTED_EXCEPTION',
711
- UNSUPPORTED_CONVERSATION_TYPE_EXCEPTION = 'UNSUPPORTED_CONVERSATION_TYPE_EXCEPTION',
712
- COULD_NOT_GET_DASHBOARD_SCHEMA_EXCEPTION = 'COULD_NOT_GET_DASHBOARD_SCHEMA_EXCEPTION',
713
- }
714
-
715
- /**
716
- * MessageStatus.
717
- * The possible values are:
718
- * * `FETCHING_METADATA`: Fetching metadata from the data sources.
719
- * * `FILTERING_CONTEXT`: Running smart context step to determine relevant context.
720
- * * `ASKING_AI`: Waiting for the LLM to respond to the user's question.
721
- * * `PENDING_WAREHOUSE`: Waiting for warehouse before the SQL query can start executing.
722
- * * `EXECUTING_QUERY`: Executing a generated SQL query. Get the SQL query result by calling [getMessageAttachmentQueryResult](:method:genie/getMessageAttachmentQueryResult) API.
723
- * * `FAILED`: The response generation or query execution failed. See `error` field.
724
- * * `COMPLETED`: Message processing is completed. Results are in the `attachments` field. Get the SQL query result by calling [getMessageAttachmentQueryResult](:method:genie/getMessageAttachmentQueryResult) API.
725
- * * `SUBMITTED`: Message has been submitted.
726
- * * `QUERY_RESULT_EXPIRED`: SQL result is not available anymore. The user needs to rerun the query. Rerun the SQL query result by calling [executeMessageAttachmentQuery](:method:genie/executeMessageAttachmentQuery) API.
727
- * * `CANCELLED`: Message has been cancelled.
728
- */
729
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
730
- export enum MessageStatus_MessageStatus {
731
- FETCHING_METADATA = 'FETCHING_METADATA',
732
- FILTERING_CONTEXT = 'FILTERING_CONTEXT',
733
- ASKING_AI = 'ASKING_AI',
734
- PENDING_WAREHOUSE = 'PENDING_WAREHOUSE',
735
- EXECUTING_QUERY = 'EXECUTING_QUERY',
736
- FAILED = 'FAILED',
737
- COMPLETED = 'COMPLETED',
738
- SUBMITTED = 'SUBMITTED',
739
- QUERY_RESULT_EXPIRED = 'QUERY_RESULT_EXPIRED',
740
- CANCELLED = 'CANCELLED',
741
- }
742
-
743
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
744
- export enum StatementStatus_State {
745
- STATE_UNSPECIFIED = 'STATE_UNSPECIFIED',
746
- PENDING = 'PENDING',
747
- RUNNING = 'RUNNING',
748
- SUCCEEDED = 'SUCCEEDED',
749
- FAILED = 'FAILED',
750
- CANCELED = 'CANCELED',
751
- CLOSED = 'CLOSED',
752
- }
753
-
754
- export interface ChunkInfo {
755
- /** The position within the sequence of result set chunks. */
756
- chunkIndex?: number | undefined;
757
- /** The starting row offset within the result set. */
758
- rowOffset?: bigint | undefined;
759
- /** The number of rows within the result chunk. */
760
- rowCount?: bigint | undefined;
761
- /**
762
- * The number of bytes in the result chunk. This field is not available when using `INLINE`
763
- * disposition.
764
- */
765
- byteCount?: bigint | undefined;
766
- /**
767
- * When fetching, provides the `chunk_index` for the _next_ chunk. If absent, indicates there are no
768
- * more chunks. The next chunk can be fetched with a
769
- * :method:statementexecution/getstatementresultchunkn request.
770
- */
771
- nextChunkIndex?: number | undefined;
772
- /**
773
- * When fetching, provides a link to fetch the _next_ chunk. If absent, indicates there are no more
774
- * chunks. This link is an absolute `path` to be joined with your `$DATABRICKS_HOST`, and should be
775
- * treated as an opaque link. This is an alternative to using `next_chunk_index`.
776
- */
777
- nextChunkInternalLink?: string | undefined;
778
- }
779
-
780
- export interface ColumnInfo {
781
- /** Name of Column. */
782
- name?: string | undefined;
783
- /** Full data type specification as SQL/catalogString text. */
784
- typeText?: string | undefined;
785
- typeName?: ColumnTypeName | undefined;
786
- /** Ordinal position of column (starting at position 0). */
787
- position?: number | undefined;
788
- /** Digits of precision; required for DecimalTypes. */
789
- typePrecision?: number | undefined;
790
- /** Digits to right of decimal; Required for DecimalTypes. */
791
- typeScale?: number | undefined;
792
- /** Format of IntervalType. */
793
- typeIntervalType?: string | undefined;
794
- /** Full data type specification, JSON-serialized. */
795
- typeJson?: string | undefined;
796
- /** User-provided free-form text description. */
797
- comment?: string | undefined;
798
- /** Whether field may be Null (default: true). */
799
- nullable?: boolean | undefined;
800
- /** Partition index for column. */
801
- partitionIndex?: number | undefined;
802
- mask?: ColumnMask | undefined;
803
- }
804
-
805
- export interface ColumnMask {
806
- /** The full name of the column mask SQL UDF. */
807
- functionName?: string | undefined;
808
- /**
809
- * The list of additional table columns to be passed as input to the column mask function. The
810
- * first arg of the mask function should be of the type of the column being masked and the
811
- * types of the rest of the args should match the types of columns in 'using_column_names'.
812
- */
813
- usingColumnNames?: string[] | undefined;
814
- /**
815
- * The list of additional table columns or literals to be passed as additional arguments to
816
- * a column mask function. This is the replacement of the deprecated using_column_names field and
817
- * carries information about the types (alias or constant) of the arguments to the mask function.
818
- */
819
- usingArguments?: PolicyFunctionArgument[] | undefined;
820
- }
821
-
822
- /**
823
- * Serialization format for DatabricksServiceException.
824
- * Note the definition of this message should be in sync with DatabricksServiceExceptionWithDetailsProto
825
- * defined in /api-base/proto/exception_with_details.proto except the later one has an extra error
826
- * details field defined.
827
- */
828
- export interface DatabricksServiceExceptionProto {
829
- errorCode?: ErrorCode | undefined;
830
- message?: string | undefined;
831
- stackTrace?: string | undefined;
832
- }
833
-
834
- export interface ExternalLink {
835
- /**
836
- * A URL pointing to a
837
- * chunk of result data, hosted by an external service, with a short expiration time
838
- * (<= 15 minutes). As this URL contains a temporary credential, it should be considered sensitive
839
- * and the client should not expose this URL in a log.
840
- */
841
- externalLink?: string | undefined;
842
- /**
843
- * Indicates the date-time that the given external link will expire and
844
- * becomes invalid, after which point a new `external_link` must be requested.
845
- */
846
- expiration?: string | undefined;
847
- /**
848
- * HTTP headers that must be included with a GET request to the `external_link`.
849
- * Each header is provided as a key-value pair.
850
- * Headers are typically used to pass a decryption key to the external service.
851
- * The values of these headers should be considered sensitive and the client should not expose
852
- * these values in a log.
853
- */
854
- httpHeaders?: Record<string, string> | undefined;
855
- /** The position within the sequence of result set chunks. */
856
- chunkIndex?: number | undefined;
857
- /** The starting row offset within the result set. */
858
- rowOffset?: bigint | undefined;
859
- /** The number of rows within the result chunk. */
860
- rowCount?: bigint | undefined;
861
- /**
862
- * The number of bytes in the result chunk. This field is not available when using `INLINE`
863
- * disposition.
864
- */
865
- byteCount?: bigint | undefined;
866
- /**
867
- * When fetching, provides the `chunk_index` for the _next_ chunk. If absent, indicates there are no
868
- * more chunks. The next chunk can be fetched with a
869
- * :method:statementexecution/getstatementresultchunkn request.
870
- */
871
- nextChunkIndex?: number | undefined;
872
- /**
873
- * When fetching, provides a link to fetch the _next_ chunk. If absent, indicates there are no more
874
- * chunks. This link is an absolute `path` to be joined with your `$DATABRICKS_HOST`, and should be
875
- * treated as an opaque link. This is an alternative to using `next_chunk_index`.
876
- */
877
- nextChunkInternalLink?: string | undefined;
878
- }
879
-
880
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
881
- export interface ExternalLink_HttpHeadersEntry {
882
- key?: string | undefined;
883
- value?: string | undefined;
884
- }
885
-
886
- /** Genie AI Response */
887
- export interface GenieAttachment {
888
- attachment?:
889
- | {
890
- $case: 'text';
891
- /**
892
- * Text Attachment if Genie responds with text
893
- * This also contains the final summary when available.
894
- */
895
- text: TextAttachment;
896
- }
897
- | {
898
- $case: 'query';
899
- /** Query Attachment if Genie responds with a SQL query */
900
- query: GenieQueryAttachment;
901
- }
902
- | {
903
- $case: 'suggestedQuestions';
904
- /** Follow-up questions suggested by Genie */
905
- suggestedQuestions: GenieSuggestedQuestionsAttachment;
906
- }
907
- | undefined;
908
- /** Attachment ID */
909
- attachmentId?: string | undefined;
910
- }
911
-
912
- export interface GenieConversation {
913
- /**
914
- * Conversation ID.
915
- * Legacy identifier, use conversation_id instead
916
- */
917
- id?: string | undefined;
918
- /** Genie space ID */
919
- spaceId?: string | undefined;
920
- /** ID of the user who created the conversation */
921
- userId?: bigint | undefined;
922
- /** Timestamp when the message was created */
923
- createdTimestamp?: bigint | undefined;
924
- /** Timestamp when the message was last updated */
925
- lastUpdatedTimestamp?: bigint | undefined;
926
- /** Conversation title */
927
- title?: string | undefined;
928
- /** Conversation ID */
929
- conversationId?: string | undefined;
930
- }
931
-
932
- export interface GenieConversationSummary {
933
- conversationId?: string | undefined;
934
- title?: string | undefined;
935
- createdTimestamp?: bigint | undefined;
936
- }
937
-
938
- export interface GenieCreateConversationMessageRequest {
939
- /** The ID associated with the Genie space where the conversation is started. */
940
- spaceId?: string | undefined;
941
- /** The ID associated with the conversation. */
942
- conversationId?: string | undefined;
943
- /** User message content. */
944
- content?: string | undefined;
945
- }
946
-
947
- export interface GenieCreateEvalRunRequest {
948
- /** The ID associated with the Genie space where the evaluations will be executed. */
949
- spaceId?: string | undefined;
950
- /** List of benchmark question IDs to evaluate. These questions must exist in the specified Genie space. If none are specified, then all benchmark questions are evaluated. */
951
- benchmarkQuestionIds?: string[] | undefined;
952
- }
953
-
954
- export interface GenieCreateMessageCommentRequest {
955
- /** The ID associated with the Genie space. */
956
- spaceId?: string | undefined;
957
- /** The ID associated with the conversation. */
958
- conversationId?: string | undefined;
959
- /** The ID associated with the message. */
960
- messageId?: string | undefined;
961
- /** Comment text content. */
962
- content?: string | undefined;
963
- }
964
-
965
- export interface GenieCreateSpaceRequest {
966
- /** Warehouse to associate with the new space */
967
- warehouseId?: string | undefined;
968
- /** Parent folder path where the space will be registered */
969
- parentPath?: string | undefined;
970
- /**
971
- * The contents of the Genie Space in serialized string form.
972
- * Use the [Get Genie Space](:method:genie/getspace) API to retrieve an example response, which includes the `serialized_space` field.
973
- * This field provides the structure of the JSON string that represents the space's layout and components.
974
- */
975
- serializedSpace?: string | undefined;
976
- /** Optional title override */
977
- title?: string | undefined;
978
- /** Optional description */
979
- description?: string | undefined;
980
- }
981
-
982
- export interface GenieDeleteConversationMessageRequest {
983
- /** The ID associated with the Genie space where the message is located. */
984
- spaceId?: string | undefined;
985
- /** The ID associated with the conversation. */
986
- conversationId?: string | undefined;
987
- /** The ID associated with the message to delete. */
988
- messageId?: string | undefined;
989
- }
990
-
991
- export interface GenieDeleteConversationRequest {
992
- /** The ID associated with the Genie space where the conversation is located. */
993
- spaceId?: string | undefined;
994
- /** The ID of the conversation to delete. */
995
- conversationId?: string | undefined;
996
- }
997
-
998
- export interface GenieEvalResponse {
999
- /** The response content (either text or SQL query). */
1000
- response?: string | undefined;
1001
- /** SQL Statement Execution response. */
1002
- sqlExecutionResult?: StatementResponse | undefined;
1003
- /** Type of response */
1004
- responseType?: GenieEvalResponseType | undefined;
1005
- }
1006
-
1007
- /**
1008
- * Shows summary information for an evaluation result.
1009
- * For detailed information including SQL execution results, actual/expected responses, and assessment scores, use GenieGetEvalResultDetails.
1010
- */
1011
- export interface GenieEvalResult {
1012
- /** Unique identifier for this evaluation result. */
1013
- resultId?: string | undefined;
1014
- /** The ID of the space the evaluation result belongs to. */
1015
- spaceId?: string | undefined;
1016
- /** The ID of the benchmark question that was evaluated. */
1017
- benchmarkQuestionId?: string | undefined;
1018
- /** Current status of this evaluation result. */
1019
- status?: EvaluationStatusType | undefined;
1020
- /** Stored snapshot of original benchmark question text. */
1021
- question?: string | undefined;
1022
- /** Stored snapshot of original benchmark answer text. */
1023
- benchmarkAnswer?: string | undefined;
1024
- /** User ID who created evaluation result. */
1025
- createdByUser?: bigint | undefined;
1026
- }
1027
-
1028
- /** Shows detailed information for an evaluation result. */
1029
- export interface GenieEvalResultDetails {
1030
- /** The unique identifier for the evaluation result. */
1031
- resultId?: string | undefined;
1032
- /** The ID of the space the evaluation result belongs to. */
1033
- spaceId?: string | undefined;
1034
- /** The ID of the benchmark question that was evaluated. */
1035
- benchmarkQuestionId?: string | undefined;
1036
- /** Current status of the evaluation run. */
1037
- evalRunStatus?: EvaluationStatusType | undefined;
1038
- /** Assessment of the evaluation result: good, bad, or needs review */
1039
- assessment?: GenieEvalAssessment | undefined;
1040
- /** Whether this evaluation was manually assessed. */
1041
- manualAssessment?: boolean | undefined;
1042
- /**
1043
- * Reasons for the assessment score.
1044
- *
1045
- * Assessment reasons describe why a Genie response was scored as BAD.
1046
- *
1047
- * Deterministic values (compared against the ground truth result):
1048
- * - EMPTY_RESULT: Genie's generated SQL results were empty for this benchmark question.
1049
- * - RESULT_MISSING_ROWS: Genie's generated SQL response is missing rows from the provided ground truth SQL.
1050
- * - RESULT_EXTRA_ROWS: Genie's generated SQL response has more rows than the provided ground truth SQL.
1051
- * - RESULT_MISSING_COLUMNS: Genie's generated SQL response is missing columns from the provided ground truth SQL.
1052
- * - RESULT_EXTRA_COLUMNS: Genie's generated SQL response has more columns than the provided ground truth SQL.
1053
- * - SINGLE_CELL_DIFFERENCE: Single value result was produced but differs from ground truth result.
1054
- * - EMPTY_GOOD_SQL: The benchmark SQL returned an empty result.
1055
- * - COLUMN_TYPE_DIFFERENCE: The values between the results match but the column type is different.
1056
- *
1057
- * LLM judge ratings explain the factors driving BAD results:
1058
- * - LLM_JUDGE_MISSING_OR_INCORRECT_FILTER: Genie's generated SQL is missing a WHERE clause condition or has incorrect filter logic that excludes/includes wrong data.
1059
- * - LLM_JUDGE_INCOMPLETE_OR_PARTIAL_OUTPUT: Genie's generated SQL returns only some of the requested data or columns, missing parts of what the ground truth SQL returns.
1060
- * - LLM_JUDGE_MISINTERPRETATION_OF_USER_REQUEST: Genie's generated SQL fundamentally misunderstands what the user is asking for, addressing the wrong question or goal.
1061
- * - LLM_JUDGE_INSTRUCTION_COMPLIANCE_OR_MISSING_BUSINESS_LOGIC: Genie's generated SQL fails to apply specified instructions or business logic that should be followed.
1062
- * - LLM_JUDGE_INCORRECT_METRIC_CALCULATION: Genie's generated SQL uses incorrect logic or makes wrong assumptions when calculating metrics.
1063
- * - LLM_JUDGE_INCORRECT_TABLE_OR_FIELD_USAGE: Genie's generated SQL references wrong tables, columns, or uses fields that don't match the ground truth SQL's intent.
1064
- * - LLM_JUDGE_INCORRECT_FUNCTION_USAGE: Genie's generated SQL uses SQL functions incorrectly or inappropriately (wrong parameters, wrong function for the task, etc.).
1065
- * - LLM_JUDGE_MISSING_OR_INCORRECT_JOIN: Genie's generated SQL is missing necessary joins between tables or has incorrect join conditions/types that produce wrong results.
1066
- * - LLM_JUDGE_MISSING_OR_INCORRECT_AGGREGATION: Genie's generated SQL is missing GROUP BY clauses or has incorrect grouping that doesn't match the requested aggregation level.
1067
- * - LLM_JUDGE_FORMATTING_ERROR: Genie's generated SQL output has incorrect formatting, ordering (ORDER BY), or presentation issues that don't match expectations.
1068
- * - LLM_JUDGE_OTHER: LLM judge identified an error that doesn't fall into other categories.
1069
- *
1070
- * Deprecated LLM judge values (kept for backward compatibility, do not use):
1071
- * - LLM_JUDGE_MISSING_JOIN (deprecated)
1072
- * - LLM_JUDGE_WRONG_FILTER (deprecated)
1073
- * - LLM_JUDGE_WRONG_AGGREGATION (deprecated)
1074
- * - LLM_JUDGE_WRONG_COLUMNS (deprecated)
1075
- * - LLM_JUDGE_SYNTAX_ERROR (deprecated)
1076
- * - LLM_JUDGE_SEMANTIC_ERROR (deprecated)
1077
- */
1078
- assessmentReasons?: ScoreReason[] | undefined;
1079
- /** The actual response generated by Genie. */
1080
- actualResponse?: GenieEvalResponse[] | undefined;
1081
- /** The expected responses from the benchmark. */
1082
- expectedResponse?: GenieEvalResponse[] | undefined;
1083
- }
1084
-
1085
- export interface GenieEvalRunResponse {
1086
- /** The unique identifier for the evaluation run. */
1087
- evalRunId?: string | undefined;
1088
- /** Current status of the evaluation run. */
1089
- evalRunStatus?: EvaluationStatusType | undefined;
1090
- /** User ID who initiated the evaluation run. */
1091
- runByUser?: bigint | undefined;
1092
- /** Timestamp when the evaluation run was created (milliseconds since epoch). */
1093
- createdTimestamp?: bigint | undefined;
1094
- /** Total number of questions in the evaluation run. */
1095
- numQuestions?: bigint | undefined;
1096
- /** Number of questions answered correctly. */
1097
- numCorrect?: bigint | undefined;
1098
- /** Number of questions that need manual review. */
1099
- numNeedsReview?: bigint | undefined;
1100
- /** Number of questions that have been completed. */
1101
- numDone?: bigint | undefined;
1102
- /** Timestamp when the evaluation run was last updated (milliseconds since epoch). */
1103
- lastUpdatedTimestamp?: bigint | undefined;
1104
- }
1105
-
1106
- export interface GenieExecuteMessageAttachmentQueryRequest {
1107
- /** Message ID */
1108
- messageId?: string | undefined;
1109
- /** Genie space ID */
1110
- spaceId?: string | undefined;
1111
- /** Conversation ID */
1112
- conversationId?: string | undefined;
1113
- /** Attachment ID */
1114
- attachmentId?: string | undefined;
1115
- }
1116
-
1117
- export interface GenieExecuteMessageQueryRequest {
1118
- /** Message ID */
1119
- messageId?: string | undefined;
1120
- /** Genie space ID */
1121
- spaceId?: string | undefined;
1122
- /** Conversation ID */
1123
- conversationId?: string | undefined;
1124
- }
1125
-
1126
- /** Feedback containing rating and optional comment */
1127
- export interface GenieFeedback {
1128
- /** The feedback rating */
1129
- rating?: GenieFeedbackRating | undefined;
1130
- /** Optional feedback comment text */
1131
- comment?: string | undefined;
1132
- }
1133
-
1134
- export interface GenieGenerateDownloadFullQueryResultRequest {
1135
- /** Genie space ID */
1136
- spaceId?: string | undefined;
1137
- /** Conversation ID */
1138
- conversationId?: string | undefined;
1139
- /** Message ID */
1140
- messageId?: string | undefined;
1141
- /** Attachment ID */
1142
- attachmentId?: string | undefined;
1143
- }
1144
-
1145
- export interface GenieGenerateDownloadFullQueryResultResponse {
1146
- /** Download ID. Use this ID to track the download request in subsequent polling calls */
1147
- downloadId?: string | undefined;
1148
- /** JWT signature for the download_id to ensure secure access to query results */
1149
- downloadIdSignature?: string | undefined;
1150
- }
1151
-
1152
- export interface GenieGetConversationMessageRequest {
1153
- /** The ID associated with the Genie space where the target conversation is located. */
1154
- spaceId?: string | undefined;
1155
- /** The ID associated with the target conversation. */
1156
- conversationId?: string | undefined;
1157
- /** The ID associated with the target message from the identified conversation. */
1158
- messageId?: string | undefined;
1159
- }
1160
-
1161
- export interface GenieGetDownloadFullQueryResultRequest {
1162
- /** Genie space ID */
1163
- spaceId?: string | undefined;
1164
- /** Conversation ID */
1165
- conversationId?: string | undefined;
1166
- /** Message ID */
1167
- messageId?: string | undefined;
1168
- /** Attachment ID */
1169
- attachmentId?: string | undefined;
1170
- /** Download ID. This ID is provided by the [Generate Download endpoint](:method:genie/generateDownloadFullQueryResult) */
1171
- downloadId?: string | undefined;
1172
- /** JWT signature for the download_id to ensure secure access to query results */
1173
- downloadIdSignature?: string | undefined;
1174
- }
1175
-
1176
- export interface GenieGetDownloadFullQueryResultResponse {
1177
- /** SQL Statement Execution response. See [Get status, manifest, and result first chunk](:method:statementexecution/getstatement) for more details. */
1178
- statementResponse?: StatementResponse | undefined;
1179
- }
1180
-
1181
- export interface GenieGetEvalResultDetailsRequest {
1182
- /** The ID associated with the Genie space where the evaluation run is located. */
1183
- spaceId?: string | undefined;
1184
- /** The unique identifier for the evaluation run. */
1185
- evalRunId?: string | undefined;
1186
- /** The unique identifier for the evaluation result. */
1187
- resultId?: string | undefined;
1188
- }
1189
-
1190
- export interface GenieGetEvalRunRequest {
1191
- /** The ID associated with the Genie space where the evaluation run is located. */
1192
- spaceId?: string | undefined;
1193
- evalRunId?: string | undefined;
1194
- }
1195
-
1196
- export interface GenieGetMessageAttachmentQueryResultRequest {
1197
- /** Message ID */
1198
- messageId?: string | undefined;
1199
- /** Genie space ID */
1200
- spaceId?: string | undefined;
1201
- /** Conversation ID */
1202
- conversationId?: string | undefined;
1203
- /** Attachment ID */
1204
- attachmentId?: string | undefined;
1205
- }
1206
-
1207
- export interface GenieGetMessageQueryResultRequest {
1208
- /** Message ID */
1209
- messageId?: string | undefined;
1210
- /** Genie space ID */
1211
- spaceId?: string | undefined;
1212
- /** Conversation ID */
1213
- conversationId?: string | undefined;
1214
- }
1215
-
1216
- export interface GenieGetMessageQueryResultResponse {
1217
- /** SQL Statement Execution response. See [Get status, manifest, and result first chunk](:method:statementexecution/getstatement) for more details. */
1218
- statementResponse?: StatementResponse | undefined;
1219
- }
1220
-
1221
- export interface GenieGetQueryResultByAttachmentRequest {
1222
- /** Message ID */
1223
- messageId?: string | undefined;
1224
- /** Genie space ID */
1225
- spaceId?: string | undefined;
1226
- /** Conversation ID */
1227
- conversationId?: string | undefined;
1228
- /** Attachment ID */
1229
- attachmentId?: string | undefined;
1230
- }
1231
-
1232
- export interface GenieGetSpaceRequest {
1233
- /** The ID associated with the Genie space */
1234
- spaceId?: string | undefined;
1235
- /**
1236
- * Whether to include the serialized space export in the response.
1237
- * Requires at least CAN EDIT permission on the space.
1238
- */
1239
- includeSerializedSpace?: boolean | undefined;
1240
- }
1241
-
1242
- export interface GenieListConversationCommentsRequest {
1243
- /** The ID associated with the Genie space. */
1244
- spaceId?: string | undefined;
1245
- /** The ID associated with the conversation. */
1246
- conversationId?: string | undefined;
1247
- /** Maximum number of comments to return per page. */
1248
- pageSize?: number | undefined;
1249
- /** Pagination token for getting the next page of results. */
1250
- pageToken?: string | undefined;
1251
- }
1252
-
1253
- export interface GenieListConversationCommentsResponse {
1254
- /** List of comments in the conversation. */
1255
- comments?: GenieMessageComment[] | undefined;
1256
- /** Token to get the next page of results. */
1257
- nextPageToken?: string | undefined;
1258
- }
1259
-
1260
- export interface GenieListConversationMessagesRequest {
1261
- /** The ID associated with the Genie space where the conversation is located */
1262
- spaceId?: string | undefined;
1263
- /** The ID of the conversation to list messages from */
1264
- conversationId?: string | undefined;
1265
- /** Maximum number of messages to return per page */
1266
- pageSize?: number | undefined;
1267
- /** Token to get the next page of results */
1268
- pageToken?: string | undefined;
1269
- }
1270
-
1271
- export interface GenieListConversationMessagesResponse {
1272
- /** List of messages in the conversation. */
1273
- messages?: GenieMessage[] | undefined;
1274
- /** The token to use for retrieving the next page of results. */
1275
- nextPageToken?: string | undefined;
1276
- }
1277
-
1278
- export interface GenieListConversationsRequest {
1279
- /** The ID of the Genie space to retrieve conversations from. */
1280
- spaceId?: string | undefined;
1281
- /** Maximum number of conversations to return per page */
1282
- pageSize?: number | undefined;
1283
- /** Token to get the next page of results */
1284
- pageToken?: string | undefined;
1285
- /**
1286
- * Include all conversations in the space across all users.
1287
- * Requires at least CAN MANAGE permission on the space.
1288
- */
1289
- includeAll?: boolean | undefined;
1290
- }
1291
-
1292
- export interface GenieListConversationsResponse {
1293
- /** List of conversations in the Genie space */
1294
- conversations?: GenieConversationSummary[] | undefined;
1295
- /** Token to get the next page of results */
1296
- nextPageToken?: string | undefined;
1297
- }
1298
-
1299
- export interface GenieListEvalResultsRequest {
1300
- /** The ID associated with the Genie space where the evaluation run is located. */
1301
- spaceId?: string | undefined;
1302
- /** The unique identifier for the evaluation run. */
1303
- evalRunId?: string | undefined;
1304
- /** Maximum number of eval results to return per page. */
1305
- pageSize?: number | undefined;
1306
- /** Opaque token to retrieve the next page of results. */
1307
- pageToken?: string | undefined;
1308
- }
1309
-
1310
- export interface GenieListEvalResultsResponse {
1311
- /** List of evaluation results for the specified run. */
1312
- evalResults?: GenieEvalResult[] | undefined;
1313
- /** The token to use for retrieving the next page of results. */
1314
- nextPageToken?: string | undefined;
1315
- }
1316
-
1317
- export interface GenieListEvalRunsRequest {
1318
- /** The ID associated with the Genie space where the evaluation run is located. */
1319
- spaceId?: string | undefined;
1320
- /** Maximum number of evaluation runs to return per page */
1321
- pageSize?: number | undefined;
1322
- /** Token to get the next page of results */
1323
- pageToken?: string | undefined;
1324
- }
1325
-
1326
- export interface GenieListEvalRunsResponse {
1327
- /** List of evaluation runs for a space on provided page token and page size */
1328
- evalRuns?: GenieEvalRunResponse[] | undefined;
1329
- /** The token to use for retrieving the next page of results. */
1330
- nextPageToken?: string | undefined;
1331
- }
1332
-
1333
- export interface GenieListMessageCommentsRequest {
1334
- /** The ID associated with the Genie space. */
1335
- spaceId?: string | undefined;
1336
- /** The ID associated with the conversation. */
1337
- conversationId?: string | undefined;
1338
- /** The ID associated with the message. */
1339
- messageId?: string | undefined;
1340
- /** Maximum number of comments to return per page. */
1341
- pageSize?: number | undefined;
1342
- /** Pagination token for getting the next page of results. */
1343
- pageToken?: string | undefined;
1344
- }
1345
-
1346
- export interface GenieListMessageCommentsResponse {
1347
- /** List of comments on the message. */
1348
- comments?: GenieMessageComment[] | undefined;
1349
- /** Token to get the next page of results. */
1350
- nextPageToken?: string | undefined;
1351
- }
1352
-
1353
- export interface GenieListSpacesRequest {
1354
- /** Maximum number of spaces to return per page */
1355
- pageSize?: number | undefined;
1356
- /** Pagination token for getting the next page of results */
1357
- pageToken?: string | undefined;
1358
- }
1359
-
1360
- export interface GenieListSpacesResponse {
1361
- /** List of Genie spaces */
1362
- spaces?: GenieSpace[] | undefined;
1363
- /** Token to get the next page of results */
1364
- nextPageToken?: string | undefined;
1365
- }
1366
-
1367
- export interface GenieMessage {
1368
- /**
1369
- * Message ID.
1370
- * Legacy identifier, use message_id instead
1371
- */
1372
- id?: string | undefined;
1373
- /** Genie space ID */
1374
- spaceId?: string | undefined;
1375
- /** Conversation ID */
1376
- conversationId?: string | undefined;
1377
- /** ID of the user who created the message */
1378
- userId?: bigint | undefined;
1379
- /** Timestamp when the message was created */
1380
- createdTimestamp?: bigint | undefined;
1381
- /** Timestamp when the message was last updated */
1382
- lastUpdatedTimestamp?: bigint | undefined;
1383
- status?: MessageStatus_MessageStatus | undefined;
1384
- /** User message content */
1385
- content?: string | undefined;
1386
- /** AI-generated response to the message */
1387
- attachments?: GenieAttachment[] | undefined;
1388
- /**
1389
- * The result of SQL query if the message includes a query attachment.
1390
- * Deprecated. Use `query_result_metadata` in `GenieQueryAttachment` instead.
1391
- */
1392
- queryResult?: Result | undefined;
1393
- /** Error message if Genie failed to respond to the message */
1394
- error?: MessageError | undefined;
1395
- /** Message ID */
1396
- messageId?: string | undefined;
1397
- /** User feedback for the message if provided */
1398
- feedback?: GenieFeedback | undefined;
1399
- }
1400
-
1401
- /** A comment on a Genie conversation message. */
1402
- export interface GenieMessageComment {
1403
- /** Genie space ID */
1404
- spaceId?: string | undefined;
1405
- /** Conversation ID */
1406
- conversationId?: string | undefined;
1407
- /** Message ID */
1408
- messageId?: string | undefined;
1409
- /** Comment ID */
1410
- messageCommentId?: string | undefined;
1411
- /** ID of the user who created the comment */
1412
- userId?: bigint | undefined;
1413
- /** Comment text content */
1414
- content?: string | undefined;
1415
- /** Timestamp when the comment was created */
1416
- createdTimestamp?: bigint | undefined;
1417
- }
1418
-
1419
- export interface GenieQueryAttachment {
1420
- /** Name of the query */
1421
- title?: string | undefined;
1422
- /** AI generated SQL query */
1423
- query?: string | undefined;
1424
- /** Description of the query */
1425
- description?: string | undefined;
1426
- /** Time when the user updated the query last */
1427
- lastUpdatedTimestamp?: bigint | undefined;
1428
- parameters?: QueryAttachmentParameter[] | undefined;
1429
- id?: string | undefined;
1430
- /** Statement Execution API statement id. Use [Get status, manifest, and result first chunk](:method:statementexecution/getstatement) to get the full result data. */
1431
- statementId?: string | undefined;
1432
- /** Metadata associated with the query result. */
1433
- queryResultMetadata?: GenieResultMetadata | undefined;
1434
- /** Insights into how Genie came to generate the SQL. */
1435
- thoughts?: Thought[] | undefined;
1436
- }
1437
-
1438
- export interface GenieResultMetadata {
1439
- /** The number of rows in the result set. */
1440
- rowCount?: bigint | undefined;
1441
- /** Indicates whether the result set is truncated. */
1442
- isTruncated?: boolean | undefined;
1443
- }
1444
-
1445
- export interface GenieSendMessageFeedbackRequest {
1446
- /** The ID associated with the Genie space where the message is located. */
1447
- spaceId?: string | undefined;
1448
- /** The ID associated with the conversation. */
1449
- conversationId?: string | undefined;
1450
- /** The ID associated with the message to provide feedback for. */
1451
- messageId?: string | undefined;
1452
- /** The rating (POSITIVE, NEGATIVE, or NONE). */
1453
- rating?: GenieFeedbackRating | undefined;
1454
- /** Optional text feedback that will be stored as a comment. */
1455
- comment?: string | undefined;
1456
- }
1457
-
1458
- export interface GenieSpace {
1459
- /** Genie space ID */
1460
- spaceId?: string | undefined;
1461
- /** Title of the Genie Space */
1462
- title?: string | undefined;
1463
- /** Description of the Genie Space */
1464
- description?: string | undefined;
1465
- /** Warehouse associated with the Genie Space */
1466
- warehouseId?: string | undefined;
1467
- /** Parent folder path of the Genie Space */
1468
- parentPath?: string | undefined;
1469
- /**
1470
- * The contents of the Genie Space in serialized string form.
1471
- * This field is excluded in List Genie spaces responses.
1472
- * Use the [Get Genie Space](:method:genie/getspace) API to retrieve an example response, which includes the `serialized_space` field.
1473
- * This field provides the structure of the JSON string that represents the space's layout and components.
1474
- */
1475
- serializedSpace?: string | undefined;
1476
- /**
1477
- * ETag for this space. Pass this value back in the update request to prevent overwriting
1478
- * concurrent changes.
1479
- */
1480
- etag?: string | undefined;
1481
- }
1482
-
1483
- export interface GenieStartConversationMessageRequest {
1484
- /** The ID associated with the Genie space where you want to start a conversation. */
1485
- spaceId?: string | undefined;
1486
- /** The text of the message that starts the conversation. */
1487
- content?: string | undefined;
1488
- }
1489
-
1490
- export interface GenieStartConversationResponse {
1491
- /** Message ID */
1492
- messageId?: string | undefined;
1493
- message?: GenieMessage | undefined;
1494
- /** Conversation ID */
1495
- conversationId?: string | undefined;
1496
- conversation?: GenieConversation | undefined;
1497
- }
1498
-
1499
- /** Follow-up questions suggested by Genie */
1500
- export interface GenieSuggestedQuestionsAttachment {
1501
- /** The suggested follow-up questions */
1502
- questions?: string[] | undefined;
1503
- }
1504
-
1505
- export interface GenieTrashSpaceRequest {
1506
- /** The ID associated with the Genie space to be sent to the trash. */
1507
- spaceId?: string | undefined;
1508
- }
1509
-
1510
- export interface GenieUpdateSpaceRequest {
1511
- /** Genie space ID */
1512
- spaceId?: string | undefined;
1513
- /**
1514
- * The contents of the Genie Space in serialized string form (full replacement).
1515
- * Use the [Get Genie Space](:method:genie/getspace) API to retrieve an example response, which includes the `serialized_space` field.
1516
- * This field provides the structure of the JSON string that represents the space's layout and components.
1517
- */
1518
- serializedSpace?: string | undefined;
1519
- /** Optional title override */
1520
- title?: string | undefined;
1521
- /** Optional description */
1522
- description?: string | undefined;
1523
- /** Optional warehouse override */
1524
- warehouseId?: string | undefined;
1525
- /**
1526
- * ETag returned by a previous GET or UPDATE. When set, the update will fail if the space
1527
- * has been modified since. Omit to apply the update unconditionally.
1528
- */
1529
- etag?: string | undefined;
1530
- /** Parent workspace folder path to move this Genie space under. */
1531
- parentPath?: string | undefined;
1532
- }
1533
-
1534
- /**
1535
- * copied from proto3 / Google Well Known Types, source:
1536
- * https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto
1537
- * `ListValue` is a wrapper around a repeated field of values.
1538
- *
1539
- * The JSON representation for `ListValue` is JSON array.
1540
- */
1541
- export interface ListValue {
1542
- /** Repeated field of dynamically typed values. */
1543
- values?: Value[] | undefined;
1544
- }
1545
-
1546
- /**
1547
- * <Databricks> proto compiler is too old and does not support map.
1548
- * This is wire compatible with map<string,string>.
1549
- * See https://developers.google.com/protocol-buffers/docs/proto#backwards_compatibility.
1550
- */
1551
- export interface MapStringValueEntry {
1552
- key?: string | undefined;
1553
- value?: Value | undefined;
1554
- }
1555
-
1556
- export interface MessageError {
1557
- error?: string | undefined;
1558
- type?: MessageError_Type | undefined;
1559
- }
1560
-
1561
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1562
- export interface MessageStatus {}
1563
-
1564
- /**
1565
- * A positional argument passed to a row filter or column mask function.
1566
- * Distinguishes between column references and literals.
1567
- */
1568
- export interface PolicyFunctionArgument {
1569
- arg?:
1570
- | {
1571
- $case: 'column';
1572
- /** A column reference. */
1573
- column: string;
1574
- }
1575
- | {
1576
- $case: 'constant';
1577
- /** A constant literal. */
1578
- constant: string;
1579
- }
1580
- | undefined;
1581
- }
1582
-
1583
- export interface QueryAttachmentParameter {
1584
- keyword?: string | undefined;
1585
- value?: string | undefined;
1586
- sqlType?: string | undefined;
1587
- }
1588
-
1589
- export interface Result {
1590
- /** Statement Execution API statement id. Use [Get status, manifest, and result first chunk](:method:statementexecution/getstatement) to get the full result data. */
1591
- statementId?: string | undefined;
1592
- /** Row count of the result */
1593
- rowCount?: bigint | undefined;
1594
- /** If result is truncated */
1595
- isTruncated?: boolean | undefined;
1596
- /** JWT corresponding to the statement contained in this result */
1597
- statementIdSignature?: string | undefined;
1598
- }
1599
-
1600
- /**
1601
- * Contains the result data of a single chunk when using `INLINE` disposition. When using
1602
- * `EXTERNAL_LINKS` disposition, the array `external_links` is used instead to provide
1603
- * URLs to the result data
1604
- * in cloud storage. Exactly one of these alternatives is used. (While the `external_links`
1605
- * array prepares the API to return multiple links in a single response. Currently only a single
1606
- * link is returned.)
1607
- */
1608
- export interface ResultData {
1609
- externalLinks?: ExternalLink[] | undefined;
1610
- /**
1611
- * The `JSON_ARRAY` format is an array of arrays of values, where each non-null value is
1612
- * formatted as a string. Null values are encoded as JSON `null`.
1613
- */
1614
- dataArray?: ListValue[] | undefined;
1615
- /** The position within the sequence of result set chunks. */
1616
- chunkIndex?: number | undefined;
1617
- /** The starting row offset within the result set. */
1618
- rowOffset?: bigint | undefined;
1619
- /** The number of rows within the result chunk. */
1620
- rowCount?: bigint | undefined;
1621
- /**
1622
- * The number of bytes in the result chunk. This field is not available when using `INLINE`
1623
- * disposition.
1624
- */
1625
- byteCount?: bigint | undefined;
1626
- /**
1627
- * When fetching, provides the `chunk_index` for the _next_ chunk. If absent, indicates there are no
1628
- * more chunks. The next chunk can be fetched with a
1629
- * :method:statementexecution/getstatementresultchunkn request.
1630
- */
1631
- nextChunkIndex?: number | undefined;
1632
- /**
1633
- * When fetching, provides a link to fetch the _next_ chunk. If absent, indicates there are no more
1634
- * chunks. This link is an absolute `path` to be joined with your `$DATABRICKS_HOST`, and should be
1635
- * treated as an opaque link. This is an alternative to using `next_chunk_index`.
1636
- */
1637
- nextChunkInternalLink?: string | undefined;
1638
- }
1639
-
1640
- /** The result manifest provides schema and metadata for the result set. */
1641
- export interface ResultManifest {
1642
- format?: Format | undefined;
1643
- schema?: Schema | undefined;
1644
- /** The total number of chunks that the result set has been divided into. */
1645
- totalChunkCount?: number | undefined;
1646
- /** Array of result set chunk metadata. */
1647
- chunks?: ChunkInfo[] | undefined;
1648
- /** The total number of rows in the result set. */
1649
- totalRowCount?: bigint | undefined;
1650
- /**
1651
- * The total number of bytes in the result set. This field is not available when using `INLINE`
1652
- * disposition.
1653
- */
1654
- totalByteCount?: bigint | undefined;
1655
- /** Indicates whether the result is truncated due to `row_limit` or `byte_limit`. */
1656
- truncated?: boolean | undefined;
1657
- }
1658
-
1659
- export interface Schema {
1660
- columnCount?: number | undefined;
1661
- columns?: ColumnInfo[] | undefined;
1662
- }
1663
-
1664
- export interface StatementResponse {
1665
- /**
1666
- * The statement ID is returned upon successfully submitting a SQL statement, and is a required
1667
- * reference for all subsequent calls.
1668
- */
1669
- statementId?: string | undefined;
1670
- status?: StatementStatus | undefined;
1671
- manifest?: ResultManifest | undefined;
1672
- result?: ResultData | undefined;
1673
- }
1674
-
1675
- /** The status response includes execution state and if relevant, error information. */
1676
- export interface StatementStatus {
1677
- /**
1678
- * Statement execution state:
1679
- * - `PENDING`: waiting for warehouse
1680
- * - `RUNNING`: running
1681
- * - `SUCCEEDED`: execution was successful, result data available for fetch
1682
- * - `FAILED`: execution failed; reason for failure described in accompanying error message
1683
- * - `CANCELED`: user canceled; can come from explicit cancel call, or timeout with
1684
- * `on_wait_timeout=CANCEL`
1685
- * - `CLOSED`: execution successful, and statement closed; result no longer available for fetch
1686
- */
1687
- state?: StatementStatus_State | undefined;
1688
- error?: DatabricksServiceExceptionProto | undefined;
1689
- /**
1690
- * SQLSTATE error code returned when the statement execution fails.
1691
- * Only populated when the statement status is `FAILED`.
1692
- */
1693
- sqlState?: string | undefined;
1694
- }
1695
-
1696
- /**
1697
- * copied from proto3 / Google Well Known Types, source:
1698
- * https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto
1699
- * `Struct` represents a structured data value, consisting of fields
1700
- * which map to dynamically typed values. In some languages, `Struct`
1701
- * might be supported by a native representation. For example, in
1702
- * scripting languages like JS a struct is represented as an
1703
- * object. The details of that representation are described together
1704
- * with the proto support for the language.
1705
- *
1706
- * The JSON representation for `Struct` is JSON object.
1707
- */
1708
- export interface Struct {
1709
- /** Unordered map of dynamically typed values. */
1710
- fields?: MapStringValueEntry[] | undefined;
1711
- }
1712
-
1713
- export interface TextAttachment {
1714
- /** AI generated message */
1715
- content?: string | undefined;
1716
- id?: string | undefined;
1717
- /** Purpose/intent of this text attachment */
1718
- purpose?: TextAttachmentPurpose | undefined;
1719
- }
1720
-
1721
- /** A single thought in the AI's reasoning process for a query. */
1722
- export interface Thought {
1723
- /**
1724
- * The category of this thought.
1725
- * The possible values are:
1726
- * * `THOUGHT_TYPE_DESCRIPTION`: A high-level description of how the question was interpreted.
1727
- * * `THOUGHT_TYPE_UNDERSTANDING`: How ambiguous parts of the question were resolved.
1728
- * * `THOUGHT_TYPE_DATA_SOURCING`: Which tables or datasets were identified as relevant.
1729
- * * `THOUGHT_TYPE_INSTRUCTIONS`: Which author-defined instructions were referenced.
1730
- * * `THOUGHT_TYPE_STEPS`: The logical steps taken to compute the answer.
1731
- */
1732
- thoughtType?: ThoughtType | undefined;
1733
- /** The md formatted content for this thought. */
1734
- content?: string | undefined;
1735
- }
1736
-
1737
- /**
1738
- * copied from proto3 / Google Well Known Types, source:
1739
- * https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto
1740
- * `Value` represents a dynamically typed value which can be either
1741
- * null, a number, a string, a boolean, a recursive struct value, or a
1742
- * list of values. A producer of value is expected to set one of these
1743
- * variants. Absence of any variant indicates an error.
1744
- *
1745
- * The JSON representation for `Value` is JSON value.
1746
- */
1747
- export interface Value {
1748
- /** The kind of value. */
1749
- kind?:
1750
- | {
1751
- $case: 'nullValue';
1752
- /** Represents a null value. */
1753
- nullValue: NullValue;
1754
- }
1755
- | {
1756
- $case: 'numberValue';
1757
- /** Represents a double value. */
1758
- numberValue: number;
1759
- }
1760
- | {
1761
- $case: 'stringValue';
1762
- /** Represents a string value. */
1763
- stringValue: string;
1764
- }
1765
- | {
1766
- $case: 'boolValue';
1767
- /** Represents a boolean value. */
1768
- boolValue: boolean;
1769
- }
1770
- | {
1771
- $case: 'structValue';
1772
- /** Represents a structured value. */
1773
- structValue: Struct;
1774
- }
1775
- | {
1776
- $case: 'listValue';
1777
- /** Represents a repeated `Value`. */
1778
- listValue: ListValue;
1779
- }
1780
- | undefined;
1781
- }
1782
-
1783
- export const unmarshalChunkInfoSchema: z.ZodType<ChunkInfo> = z
1784
- .object({
1785
- chunk_index: z.number().optional(),
1786
- row_offset: z
1787
- .union([z.number(), z.bigint()])
1788
- .transform(v => BigInt(v))
1789
- .optional(),
1790
- row_count: z
1791
- .union([z.number(), z.bigint()])
1792
- .transform(v => BigInt(v))
1793
- .optional(),
1794
- byte_count: z
1795
- .union([z.number(), z.bigint()])
1796
- .transform(v => BigInt(v))
1797
- .optional(),
1798
- next_chunk_index: z.number().optional(),
1799
- next_chunk_internal_link: z.string().optional(),
1800
- })
1801
- .transform(d => ({
1802
- chunkIndex: d.chunk_index,
1803
- rowOffset: d.row_offset,
1804
- rowCount: d.row_count,
1805
- byteCount: d.byte_count,
1806
- nextChunkIndex: d.next_chunk_index,
1807
- nextChunkInternalLink: d.next_chunk_internal_link,
1808
- }));
1809
-
1810
- export const unmarshalColumnInfoSchema: z.ZodType<ColumnInfo> = z
1811
- .object({
1812
- name: z.string().optional(),
1813
- type_text: z.string().optional(),
1814
- type_name: z.enum(ColumnTypeName).optional(),
1815
- position: z.number().optional(),
1816
- type_precision: z.number().optional(),
1817
- type_scale: z.number().optional(),
1818
- type_interval_type: z.string().optional(),
1819
- type_json: z.string().optional(),
1820
- comment: z.string().optional(),
1821
- nullable: z.boolean().optional(),
1822
- partition_index: z.number().optional(),
1823
- mask: z.lazy(() => unmarshalColumnMaskSchema).optional(),
1824
- })
1825
- .transform(d => ({
1826
- name: d.name,
1827
- typeText: d.type_text,
1828
- typeName: d.type_name,
1829
- position: d.position,
1830
- typePrecision: d.type_precision,
1831
- typeScale: d.type_scale,
1832
- typeIntervalType: d.type_interval_type,
1833
- typeJson: d.type_json,
1834
- comment: d.comment,
1835
- nullable: d.nullable,
1836
- partitionIndex: d.partition_index,
1837
- mask: d.mask,
1838
- }));
1839
-
1840
- export const unmarshalColumnMaskSchema: z.ZodType<ColumnMask> = z
1841
- .object({
1842
- function_name: z.string().optional(),
1843
- using_column_names: z.array(z.string()).optional(),
1844
- using_arguments: z
1845
- .array(z.lazy(() => unmarshalPolicyFunctionArgumentSchema))
1846
- .optional(),
1847
- })
1848
- .transform(d => ({
1849
- functionName: d.function_name,
1850
- usingColumnNames: d.using_column_names,
1851
- usingArguments: d.using_arguments,
1852
- }));
1853
-
1854
- export const unmarshalDatabricksServiceExceptionProtoSchema: z.ZodType<DatabricksServiceExceptionProto> =
1855
- z
1856
- .object({
1857
- error_code: z.enum(ErrorCode).optional(),
1858
- message: z.string().optional(),
1859
- stack_trace: z.string().optional(),
1860
- })
1861
- .transform(d => ({
1862
- errorCode: d.error_code,
1863
- message: d.message,
1864
- stackTrace: d.stack_trace,
1865
- }));
1866
-
1867
- export const unmarshalExternalLinkSchema: z.ZodType<ExternalLink> = z
1868
- .object({
1869
- external_link: z.string().optional(),
1870
- expiration: z.string().optional(),
1871
- http_headers: z.record(z.string(), z.string()).optional(),
1872
- chunk_index: z.number().optional(),
1873
- row_offset: z
1874
- .union([z.number(), z.bigint()])
1875
- .transform(v => BigInt(v))
1876
- .optional(),
1877
- row_count: z
1878
- .union([z.number(), z.bigint()])
1879
- .transform(v => BigInt(v))
1880
- .optional(),
1881
- byte_count: z
1882
- .union([z.number(), z.bigint()])
1883
- .transform(v => BigInt(v))
1884
- .optional(),
1885
- next_chunk_index: z.number().optional(),
1886
- next_chunk_internal_link: z.string().optional(),
1887
- })
1888
- .transform(d => ({
1889
- externalLink: d.external_link,
1890
- expiration: d.expiration,
1891
- httpHeaders: d.http_headers,
1892
- chunkIndex: d.chunk_index,
1893
- rowOffset: d.row_offset,
1894
- rowCount: d.row_count,
1895
- byteCount: d.byte_count,
1896
- nextChunkIndex: d.next_chunk_index,
1897
- nextChunkInternalLink: d.next_chunk_internal_link,
1898
- }));
1899
-
1900
- export const unmarshalGenieAttachmentSchema: z.ZodType<GenieAttachment> = z
1901
- .object({
1902
- text: z.lazy(() => unmarshalTextAttachmentSchema).optional(),
1903
- query: z.lazy(() => unmarshalGenieQueryAttachmentSchema).optional(),
1904
- suggested_questions: z
1905
- .lazy(() => unmarshalGenieSuggestedQuestionsAttachmentSchema)
1906
- .optional(),
1907
- attachment_id: z.string().optional(),
1908
- })
1909
- .transform(d => ({
1910
- attachment:
1911
- d.text !== undefined
1912
- ? {$case: 'text' as const, text: d.text}
1913
- : d.query !== undefined
1914
- ? {$case: 'query' as const, query: d.query}
1915
- : d.suggested_questions !== undefined
1916
- ? {
1917
- $case: 'suggestedQuestions' as const,
1918
- suggestedQuestions: d.suggested_questions,
1919
- }
1920
- : undefined,
1921
- attachmentId: d.attachment_id,
1922
- }));
1923
-
1924
- export const unmarshalGenieConversationSchema: z.ZodType<GenieConversation> = z
1925
- .object({
1926
- id: z.string().optional(),
1927
- space_id: z.string().optional(),
1928
- user_id: z
1929
- .union([z.number(), z.bigint()])
1930
- .transform(v => BigInt(v))
1931
- .optional(),
1932
- created_timestamp: z
1933
- .union([z.number(), z.bigint()])
1934
- .transform(v => BigInt(v))
1935
- .optional(),
1936
- last_updated_timestamp: z
1937
- .union([z.number(), z.bigint()])
1938
- .transform(v => BigInt(v))
1939
- .optional(),
1940
- title: z.string().optional(),
1941
- conversation_id: z.string().optional(),
1942
- })
1943
- .transform(d => ({
1944
- id: d.id,
1945
- spaceId: d.space_id,
1946
- userId: d.user_id,
1947
- createdTimestamp: d.created_timestamp,
1948
- lastUpdatedTimestamp: d.last_updated_timestamp,
1949
- title: d.title,
1950
- conversationId: d.conversation_id,
1951
- }));
1952
-
1953
- export const unmarshalGenieConversationSummarySchema: z.ZodType<GenieConversationSummary> =
1954
- z
1955
- .object({
1956
- conversation_id: z.string().optional(),
1957
- title: z.string().optional(),
1958
- created_timestamp: z
1959
- .union([z.number(), z.bigint()])
1960
- .transform(v => BigInt(v))
1961
- .optional(),
1962
- })
1963
- .transform(d => ({
1964
- conversationId: d.conversation_id,
1965
- title: d.title,
1966
- createdTimestamp: d.created_timestamp,
1967
- }));
1968
-
1969
- export const unmarshalGenieEvalResponseSchema: z.ZodType<GenieEvalResponse> = z
1970
- .object({
1971
- response: z.string().optional(),
1972
- sql_execution_result: z
1973
- .lazy(() => unmarshalStatementResponseSchema)
1974
- .optional(),
1975
- response_type: z.enum(GenieEvalResponseType).optional(),
1976
- })
1977
- .transform(d => ({
1978
- response: d.response,
1979
- sqlExecutionResult: d.sql_execution_result,
1980
- responseType: d.response_type,
1981
- }));
1982
-
1983
- export const unmarshalGenieEvalResultSchema: z.ZodType<GenieEvalResult> = z
1984
- .object({
1985
- result_id: z.string().optional(),
1986
- space_id: z.string().optional(),
1987
- benchmark_question_id: z.string().optional(),
1988
- status: z.enum(EvaluationStatusType).optional(),
1989
- question: z.string().optional(),
1990
- benchmark_answer: z.string().optional(),
1991
- created_by_user: z
1992
- .union([z.number(), z.bigint()])
1993
- .transform(v => BigInt(v))
1994
- .optional(),
1995
- })
1996
- .transform(d => ({
1997
- resultId: d.result_id,
1998
- spaceId: d.space_id,
1999
- benchmarkQuestionId: d.benchmark_question_id,
2000
- status: d.status,
2001
- question: d.question,
2002
- benchmarkAnswer: d.benchmark_answer,
2003
- createdByUser: d.created_by_user,
2004
- }));
2005
-
2006
- export const unmarshalGenieEvalResultDetailsSchema: z.ZodType<GenieEvalResultDetails> =
2007
- z
2008
- .object({
2009
- result_id: z.string().optional(),
2010
- space_id: z.string().optional(),
2011
- benchmark_question_id: z.string().optional(),
2012
- eval_run_status: z.enum(EvaluationStatusType).optional(),
2013
- assessment: z.enum(GenieEvalAssessment).optional(),
2014
- manual_assessment: z.boolean().optional(),
2015
- assessment_reasons: z.array(z.enum(ScoreReason)).optional(),
2016
- actual_response: z
2017
- .array(z.lazy(() => unmarshalGenieEvalResponseSchema))
2018
- .optional(),
2019
- expected_response: z
2020
- .array(z.lazy(() => unmarshalGenieEvalResponseSchema))
2021
- .optional(),
2022
- })
2023
- .transform(d => ({
2024
- resultId: d.result_id,
2025
- spaceId: d.space_id,
2026
- benchmarkQuestionId: d.benchmark_question_id,
2027
- evalRunStatus: d.eval_run_status,
2028
- assessment: d.assessment,
2029
- manualAssessment: d.manual_assessment,
2030
- assessmentReasons: d.assessment_reasons,
2031
- actualResponse: d.actual_response,
2032
- expectedResponse: d.expected_response,
2033
- }));
2034
-
2035
- export const unmarshalGenieEvalRunResponseSchema: z.ZodType<GenieEvalRunResponse> =
2036
- z
2037
- .object({
2038
- eval_run_id: z.string().optional(),
2039
- eval_run_status: z.enum(EvaluationStatusType).optional(),
2040
- run_by_user: z
2041
- .union([z.number(), z.bigint()])
2042
- .transform(v => BigInt(v))
2043
- .optional(),
2044
- created_timestamp: z
2045
- .union([z.number(), z.bigint()])
2046
- .transform(v => BigInt(v))
2047
- .optional(),
2048
- num_questions: z
2049
- .union([z.number(), z.bigint()])
2050
- .transform(v => BigInt(v))
2051
- .optional(),
2052
- num_correct: z
2053
- .union([z.number(), z.bigint()])
2054
- .transform(v => BigInt(v))
2055
- .optional(),
2056
- num_needs_review: z
2057
- .union([z.number(), z.bigint()])
2058
- .transform(v => BigInt(v))
2059
- .optional(),
2060
- num_done: z
2061
- .union([z.number(), z.bigint()])
2062
- .transform(v => BigInt(v))
2063
- .optional(),
2064
- last_updated_timestamp: z
2065
- .union([z.number(), z.bigint()])
2066
- .transform(v => BigInt(v))
2067
- .optional(),
2068
- })
2069
- .transform(d => ({
2070
- evalRunId: d.eval_run_id,
2071
- evalRunStatus: d.eval_run_status,
2072
- runByUser: d.run_by_user,
2073
- createdTimestamp: d.created_timestamp,
2074
- numQuestions: d.num_questions,
2075
- numCorrect: d.num_correct,
2076
- numNeedsReview: d.num_needs_review,
2077
- numDone: d.num_done,
2078
- lastUpdatedTimestamp: d.last_updated_timestamp,
2079
- }));
2080
-
2081
- export const unmarshalGenieFeedbackSchema: z.ZodType<GenieFeedback> = z
2082
- .object({
2083
- rating: z.enum(GenieFeedbackRating).optional(),
2084
- comment: z.string().optional(),
2085
- })
2086
- .transform(d => ({
2087
- rating: d.rating,
2088
- comment: d.comment,
2089
- }));
2090
-
2091
- export const unmarshalGenieGenerateDownloadFullQueryResultResponseSchema: z.ZodType<GenieGenerateDownloadFullQueryResultResponse> =
2092
- z
2093
- .object({
2094
- download_id: z.string().optional(),
2095
- download_id_signature: z.string().optional(),
2096
- })
2097
- .transform(d => ({
2098
- downloadId: d.download_id,
2099
- downloadIdSignature: d.download_id_signature,
2100
- }));
2101
-
2102
- export const unmarshalGenieGetDownloadFullQueryResultResponseSchema: z.ZodType<GenieGetDownloadFullQueryResultResponse> =
2103
- z
2104
- .object({
2105
- statement_response: z
2106
- .lazy(() => unmarshalStatementResponseSchema)
2107
- .optional(),
2108
- })
2109
- .transform(d => ({
2110
- statementResponse: d.statement_response,
2111
- }));
2112
-
2113
- export const unmarshalGenieGetMessageQueryResultResponseSchema: z.ZodType<GenieGetMessageQueryResultResponse> =
2114
- z
2115
- .object({
2116
- statement_response: z
2117
- .lazy(() => unmarshalStatementResponseSchema)
2118
- .optional(),
2119
- })
2120
- .transform(d => ({
2121
- statementResponse: d.statement_response,
2122
- }));
2123
-
2124
- export const unmarshalGenieListConversationCommentsResponseSchema: z.ZodType<GenieListConversationCommentsResponse> =
2125
- z
2126
- .object({
2127
- comments: z
2128
- .array(z.lazy(() => unmarshalGenieMessageCommentSchema))
2129
- .optional(),
2130
- next_page_token: z.string().optional(),
2131
- })
2132
- .transform(d => ({
2133
- comments: d.comments,
2134
- nextPageToken: d.next_page_token,
2135
- }));
2136
-
2137
- export const unmarshalGenieListConversationMessagesResponseSchema: z.ZodType<GenieListConversationMessagesResponse> =
2138
- z
2139
- .object({
2140
- messages: z.array(z.lazy(() => unmarshalGenieMessageSchema)).optional(),
2141
- next_page_token: z.string().optional(),
2142
- })
2143
- .transform(d => ({
2144
- messages: d.messages,
2145
- nextPageToken: d.next_page_token,
2146
- }));
2147
-
2148
- export const unmarshalGenieListConversationsResponseSchema: z.ZodType<GenieListConversationsResponse> =
2149
- z
2150
- .object({
2151
- conversations: z
2152
- .array(z.lazy(() => unmarshalGenieConversationSummarySchema))
2153
- .optional(),
2154
- next_page_token: z.string().optional(),
2155
- })
2156
- .transform(d => ({
2157
- conversations: d.conversations,
2158
- nextPageToken: d.next_page_token,
2159
- }));
2160
-
2161
- export const unmarshalGenieListEvalResultsResponseSchema: z.ZodType<GenieListEvalResultsResponse> =
2162
- z
2163
- .object({
2164
- eval_results: z
2165
- .array(z.lazy(() => unmarshalGenieEvalResultSchema))
2166
- .optional(),
2167
- next_page_token: z.string().optional(),
2168
- })
2169
- .transform(d => ({
2170
- evalResults: d.eval_results,
2171
- nextPageToken: d.next_page_token,
2172
- }));
2173
-
2174
- export const unmarshalGenieListEvalRunsResponseSchema: z.ZodType<GenieListEvalRunsResponse> =
2175
- z
2176
- .object({
2177
- eval_runs: z
2178
- .array(z.lazy(() => unmarshalGenieEvalRunResponseSchema))
2179
- .optional(),
2180
- next_page_token: z.string().optional(),
2181
- })
2182
- .transform(d => ({
2183
- evalRuns: d.eval_runs,
2184
- nextPageToken: d.next_page_token,
2185
- }));
2186
-
2187
- export const unmarshalGenieListMessageCommentsResponseSchema: z.ZodType<GenieListMessageCommentsResponse> =
2188
- z
2189
- .object({
2190
- comments: z
2191
- .array(z.lazy(() => unmarshalGenieMessageCommentSchema))
2192
- .optional(),
2193
- next_page_token: z.string().optional(),
2194
- })
2195
- .transform(d => ({
2196
- comments: d.comments,
2197
- nextPageToken: d.next_page_token,
2198
- }));
2199
-
2200
- export const unmarshalGenieListSpacesResponseSchema: z.ZodType<GenieListSpacesResponse> =
2201
- z
2202
- .object({
2203
- spaces: z.array(z.lazy(() => unmarshalGenieSpaceSchema)).optional(),
2204
- next_page_token: z.string().optional(),
2205
- })
2206
- .transform(d => ({
2207
- spaces: d.spaces,
2208
- nextPageToken: d.next_page_token,
2209
- }));
2210
-
2211
- export const unmarshalGenieMessageSchema: z.ZodType<GenieMessage> = z
2212
- .object({
2213
- id: z.string().optional(),
2214
- space_id: z.string().optional(),
2215
- conversation_id: z.string().optional(),
2216
- user_id: z
2217
- .union([z.number(), z.bigint()])
2218
- .transform(v => BigInt(v))
2219
- .optional(),
2220
- created_timestamp: z
2221
- .union([z.number(), z.bigint()])
2222
- .transform(v => BigInt(v))
2223
- .optional(),
2224
- last_updated_timestamp: z
2225
- .union([z.number(), z.bigint()])
2226
- .transform(v => BigInt(v))
2227
- .optional(),
2228
- status: z.enum(MessageStatus_MessageStatus).optional(),
2229
- content: z.string().optional(),
2230
- attachments: z
2231
- .array(z.lazy(() => unmarshalGenieAttachmentSchema))
2232
- .optional(),
2233
- query_result: z.lazy(() => unmarshalResultSchema).optional(),
2234
- error: z.lazy(() => unmarshalMessageErrorSchema).optional(),
2235
- message_id: z.string().optional(),
2236
- feedback: z.lazy(() => unmarshalGenieFeedbackSchema).optional(),
2237
- })
2238
- .transform(d => ({
2239
- id: d.id,
2240
- spaceId: d.space_id,
2241
- conversationId: d.conversation_id,
2242
- userId: d.user_id,
2243
- createdTimestamp: d.created_timestamp,
2244
- lastUpdatedTimestamp: d.last_updated_timestamp,
2245
- status: d.status,
2246
- content: d.content,
2247
- attachments: d.attachments,
2248
- queryResult: d.query_result,
2249
- error: d.error,
2250
- messageId: d.message_id,
2251
- feedback: d.feedback,
2252
- }));
2253
-
2254
- export const unmarshalGenieMessageCommentSchema: z.ZodType<GenieMessageComment> =
2255
- z
2256
- .object({
2257
- space_id: z.string().optional(),
2258
- conversation_id: z.string().optional(),
2259
- message_id: z.string().optional(),
2260
- message_comment_id: z.string().optional(),
2261
- user_id: z
2262
- .union([z.number(), z.bigint()])
2263
- .transform(v => BigInt(v))
2264
- .optional(),
2265
- content: z.string().optional(),
2266
- created_timestamp: z
2267
- .union([z.number(), z.bigint()])
2268
- .transform(v => BigInt(v))
2269
- .optional(),
2270
- })
2271
- .transform(d => ({
2272
- spaceId: d.space_id,
2273
- conversationId: d.conversation_id,
2274
- messageId: d.message_id,
2275
- messageCommentId: d.message_comment_id,
2276
- userId: d.user_id,
2277
- content: d.content,
2278
- createdTimestamp: d.created_timestamp,
2279
- }));
2280
-
2281
- export const unmarshalGenieQueryAttachmentSchema: z.ZodType<GenieQueryAttachment> =
2282
- z
2283
- .object({
2284
- title: z.string().optional(),
2285
- query: z.string().optional(),
2286
- description: z.string().optional(),
2287
- last_updated_timestamp: z
2288
- .union([z.number(), z.bigint()])
2289
- .transform(v => BigInt(v))
2290
- .optional(),
2291
- parameters: z
2292
- .array(z.lazy(() => unmarshalQueryAttachmentParameterSchema))
2293
- .optional(),
2294
- id: z.string().optional(),
2295
- statement_id: z.string().optional(),
2296
- query_result_metadata: z
2297
- .lazy(() => unmarshalGenieResultMetadataSchema)
2298
- .optional(),
2299
- thoughts: z.array(z.lazy(() => unmarshalThoughtSchema)).optional(),
2300
- })
2301
- .transform(d => ({
2302
- title: d.title,
2303
- query: d.query,
2304
- description: d.description,
2305
- lastUpdatedTimestamp: d.last_updated_timestamp,
2306
- parameters: d.parameters,
2307
- id: d.id,
2308
- statementId: d.statement_id,
2309
- queryResultMetadata: d.query_result_metadata,
2310
- thoughts: d.thoughts,
2311
- }));
2312
-
2313
- export const unmarshalGenieResultMetadataSchema: z.ZodType<GenieResultMetadata> =
2314
- z
2315
- .object({
2316
- row_count: z
2317
- .union([z.number(), z.bigint()])
2318
- .transform(v => BigInt(v))
2319
- .optional(),
2320
- is_truncated: z.boolean().optional(),
2321
- })
2322
- .transform(d => ({
2323
- rowCount: d.row_count,
2324
- isTruncated: d.is_truncated,
2325
- }));
2326
-
2327
- export const unmarshalGenieSpaceSchema: z.ZodType<GenieSpace> = z
2328
- .object({
2329
- space_id: z.string().optional(),
2330
- title: z.string().optional(),
2331
- description: z.string().optional(),
2332
- warehouse_id: z.string().optional(),
2333
- parent_path: z.string().optional(),
2334
- serialized_space: z.string().optional(),
2335
- etag: z.string().optional(),
2336
- })
2337
- .transform(d => ({
2338
- spaceId: d.space_id,
2339
- title: d.title,
2340
- description: d.description,
2341
- warehouseId: d.warehouse_id,
2342
- parentPath: d.parent_path,
2343
- serializedSpace: d.serialized_space,
2344
- etag: d.etag,
2345
- }));
2346
-
2347
- export const unmarshalGenieStartConversationResponseSchema: z.ZodType<GenieStartConversationResponse> =
2348
- z
2349
- .object({
2350
- message_id: z.string().optional(),
2351
- message: z.lazy(() => unmarshalGenieMessageSchema).optional(),
2352
- conversation_id: z.string().optional(),
2353
- conversation: z.lazy(() => unmarshalGenieConversationSchema).optional(),
2354
- })
2355
- .transform(d => ({
2356
- messageId: d.message_id,
2357
- message: d.message,
2358
- conversationId: d.conversation_id,
2359
- conversation: d.conversation,
2360
- }));
2361
-
2362
- export const unmarshalGenieSuggestedQuestionsAttachmentSchema: z.ZodType<GenieSuggestedQuestionsAttachment> =
2363
- z
2364
- .object({
2365
- questions: z.array(z.string()).optional(),
2366
- })
2367
- .transform(d => ({
2368
- questions: d.questions,
2369
- }));
2370
-
2371
- export const unmarshalListValueSchema: z.ZodType<ListValue> = z
2372
- .object({
2373
- values: z.array(z.lazy(() => unmarshalValueSchema)).optional(),
2374
- })
2375
- .transform(d => ({
2376
- values: d.values,
2377
- }));
2378
-
2379
- export const unmarshalMapStringValueEntrySchema: z.ZodType<MapStringValueEntry> =
2380
- z
2381
- .object({
2382
- key: z.string().optional(),
2383
- value: z.lazy(() => unmarshalValueSchema).optional(),
2384
- })
2385
- .transform(d => ({
2386
- key: d.key,
2387
- value: d.value,
2388
- }));
2389
-
2390
- export const unmarshalMessageErrorSchema: z.ZodType<MessageError> = z
2391
- .object({
2392
- error: z.string().optional(),
2393
- type: z.enum(MessageError_Type).optional(),
2394
- })
2395
- .transform(d => ({
2396
- error: d.error,
2397
- type: d.type,
2398
- }));
2399
-
2400
- export const unmarshalPolicyFunctionArgumentSchema: z.ZodType<PolicyFunctionArgument> =
2401
- z
2402
- .object({
2403
- column: z.string().optional(),
2404
- constant: z.string().optional(),
2405
- })
2406
- .transform(d => ({
2407
- arg:
2408
- d.column !== undefined
2409
- ? {$case: 'column' as const, column: d.column}
2410
- : d.constant !== undefined
2411
- ? {$case: 'constant' as const, constant: d.constant}
2412
- : undefined,
2413
- }));
2414
-
2415
- export const unmarshalQueryAttachmentParameterSchema: z.ZodType<QueryAttachmentParameter> =
2416
- z
2417
- .object({
2418
- keyword: z.string().optional(),
2419
- value: z.string().optional(),
2420
- sql_type: z.string().optional(),
2421
- })
2422
- .transform(d => ({
2423
- keyword: d.keyword,
2424
- value: d.value,
2425
- sqlType: d.sql_type,
2426
- }));
2427
-
2428
- export const unmarshalResultSchema: z.ZodType<Result> = z
2429
- .object({
2430
- statement_id: z.string().optional(),
2431
- row_count: z
2432
- .union([z.number(), z.bigint()])
2433
- .transform(v => BigInt(v))
2434
- .optional(),
2435
- is_truncated: z.boolean().optional(),
2436
- statement_id_signature: z.string().optional(),
2437
- })
2438
- .transform(d => ({
2439
- statementId: d.statement_id,
2440
- rowCount: d.row_count,
2441
- isTruncated: d.is_truncated,
2442
- statementIdSignature: d.statement_id_signature,
2443
- }));
2444
-
2445
- export const unmarshalResultDataSchema: z.ZodType<ResultData> = z
2446
- .object({
2447
- external_links: z
2448
- .array(z.lazy(() => unmarshalExternalLinkSchema))
2449
- .optional(),
2450
- data_array: z.array(z.lazy(() => unmarshalListValueSchema)).optional(),
2451
- chunk_index: z.number().optional(),
2452
- row_offset: z
2453
- .union([z.number(), z.bigint()])
2454
- .transform(v => BigInt(v))
2455
- .optional(),
2456
- row_count: z
2457
- .union([z.number(), z.bigint()])
2458
- .transform(v => BigInt(v))
2459
- .optional(),
2460
- byte_count: z
2461
- .union([z.number(), z.bigint()])
2462
- .transform(v => BigInt(v))
2463
- .optional(),
2464
- next_chunk_index: z.number().optional(),
2465
- next_chunk_internal_link: z.string().optional(),
2466
- })
2467
- .transform(d => ({
2468
- externalLinks: d.external_links,
2469
- dataArray: d.data_array,
2470
- chunkIndex: d.chunk_index,
2471
- rowOffset: d.row_offset,
2472
- rowCount: d.row_count,
2473
- byteCount: d.byte_count,
2474
- nextChunkIndex: d.next_chunk_index,
2475
- nextChunkInternalLink: d.next_chunk_internal_link,
2476
- }));
2477
-
2478
- export const unmarshalResultManifestSchema: z.ZodType<ResultManifest> = z
2479
- .object({
2480
- format: z.enum(Format).optional(),
2481
- schema: z.lazy(() => unmarshalSchemaSchema).optional(),
2482
- total_chunk_count: z.number().optional(),
2483
- chunks: z.array(z.lazy(() => unmarshalChunkInfoSchema)).optional(),
2484
- total_row_count: z
2485
- .union([z.number(), z.bigint()])
2486
- .transform(v => BigInt(v))
2487
- .optional(),
2488
- total_byte_count: z
2489
- .union([z.number(), z.bigint()])
2490
- .transform(v => BigInt(v))
2491
- .optional(),
2492
- truncated: z.boolean().optional(),
2493
- })
2494
- .transform(d => ({
2495
- format: d.format,
2496
- schema: d.schema,
2497
- totalChunkCount: d.total_chunk_count,
2498
- chunks: d.chunks,
2499
- totalRowCount: d.total_row_count,
2500
- totalByteCount: d.total_byte_count,
2501
- truncated: d.truncated,
2502
- }));
2503
-
2504
- export const unmarshalSchemaSchema: z.ZodType<Schema> = z
2505
- .object({
2506
- column_count: z.number().optional(),
2507
- columns: z.array(z.lazy(() => unmarshalColumnInfoSchema)).optional(),
2508
- })
2509
- .transform(d => ({
2510
- columnCount: d.column_count,
2511
- columns: d.columns,
2512
- }));
2513
-
2514
- export const unmarshalStatementResponseSchema: z.ZodType<StatementResponse> = z
2515
- .object({
2516
- statement_id: z.string().optional(),
2517
- status: z.lazy(() => unmarshalStatementStatusSchema).optional(),
2518
- manifest: z.lazy(() => unmarshalResultManifestSchema).optional(),
2519
- result: z.lazy(() => unmarshalResultDataSchema).optional(),
2520
- })
2521
- .transform(d => ({
2522
- statementId: d.statement_id,
2523
- status: d.status,
2524
- manifest: d.manifest,
2525
- result: d.result,
2526
- }));
2527
-
2528
- export const unmarshalStatementStatusSchema: z.ZodType<StatementStatus> = z
2529
- .object({
2530
- state: z.enum(StatementStatus_State).optional(),
2531
- error: z
2532
- .lazy(() => unmarshalDatabricksServiceExceptionProtoSchema)
2533
- .optional(),
2534
- sql_state: z.string().optional(),
2535
- })
2536
- .transform(d => ({
2537
- state: d.state,
2538
- error: d.error,
2539
- sqlState: d.sql_state,
2540
- }));
2541
-
2542
- export const unmarshalStructSchema: z.ZodType<Struct> = z
2543
- .object({
2544
- fields: z
2545
- .array(z.lazy(() => unmarshalMapStringValueEntrySchema))
2546
- .optional(),
2547
- })
2548
- .transform(d => ({
2549
- fields: d.fields,
2550
- }));
2551
-
2552
- export const unmarshalTextAttachmentSchema: z.ZodType<TextAttachment> = z
2553
- .object({
2554
- content: z.string().optional(),
2555
- id: z.string().optional(),
2556
- purpose: z.enum(TextAttachmentPurpose).optional(),
2557
- })
2558
- .transform(d => ({
2559
- content: d.content,
2560
- id: d.id,
2561
- purpose: d.purpose,
2562
- }));
2563
-
2564
- export const unmarshalThoughtSchema: z.ZodType<Thought> = z
2565
- .object({
2566
- thought_type: z.enum(ThoughtType).optional(),
2567
- content: z.string().optional(),
2568
- })
2569
- .transform(d => ({
2570
- thoughtType: d.thought_type,
2571
- content: d.content,
2572
- }));
2573
-
2574
- export const unmarshalValueSchema: z.ZodType<Value> = z
2575
- .object({
2576
- null_value: z.enum(NullValue).optional(),
2577
- number_value: z.number().optional(),
2578
- string_value: z.string().optional(),
2579
- bool_value: z.boolean().optional(),
2580
- struct_value: z.lazy(() => unmarshalStructSchema).optional(),
2581
- list_value: z.lazy(() => unmarshalListValueSchema).optional(),
2582
- })
2583
- .transform(d => ({
2584
- kind:
2585
- d.null_value !== undefined
2586
- ? {$case: 'nullValue' as const, nullValue: d.null_value}
2587
- : d.number_value !== undefined
2588
- ? {$case: 'numberValue' as const, numberValue: d.number_value}
2589
- : d.string_value !== undefined
2590
- ? {$case: 'stringValue' as const, stringValue: d.string_value}
2591
- : d.bool_value !== undefined
2592
- ? {$case: 'boolValue' as const, boolValue: d.bool_value}
2593
- : d.struct_value !== undefined
2594
- ? {$case: 'structValue' as const, structValue: d.struct_value}
2595
- : d.list_value !== undefined
2596
- ? {$case: 'listValue' as const, listValue: d.list_value}
2597
- : undefined,
2598
- }));
2599
-
2600
- export const marshalGenieCreateConversationMessageRequestSchema: z.ZodType = z
2601
- .object({
2602
- spaceId: z.string().optional(),
2603
- conversationId: z.string().optional(),
2604
- content: z.string().optional(),
2605
- })
2606
- .transform(d => ({
2607
- space_id: d.spaceId,
2608
- conversation_id: d.conversationId,
2609
- content: d.content,
2610
- }));
2611
-
2612
- export const marshalGenieCreateEvalRunRequestSchema: z.ZodType = z
2613
- .object({
2614
- spaceId: z.string().optional(),
2615
- benchmarkQuestionIds: z.array(z.string()).optional(),
2616
- })
2617
- .transform(d => ({
2618
- space_id: d.spaceId,
2619
- benchmark_question_ids: d.benchmarkQuestionIds,
2620
- }));
2621
-
2622
- export const marshalGenieCreateMessageCommentRequestSchema: z.ZodType = z
2623
- .object({
2624
- spaceId: z.string().optional(),
2625
- conversationId: z.string().optional(),
2626
- messageId: z.string().optional(),
2627
- content: z.string().optional(),
2628
- })
2629
- .transform(d => ({
2630
- space_id: d.spaceId,
2631
- conversation_id: d.conversationId,
2632
- message_id: d.messageId,
2633
- content: d.content,
2634
- }));
2635
-
2636
- export const marshalGenieCreateSpaceRequestSchema: z.ZodType = z
2637
- .object({
2638
- warehouseId: z.string().optional(),
2639
- parentPath: z.string().optional(),
2640
- serializedSpace: z.string().optional(),
2641
- title: z.string().optional(),
2642
- description: z.string().optional(),
2643
- })
2644
- .transform(d => ({
2645
- warehouse_id: d.warehouseId,
2646
- parent_path: d.parentPath,
2647
- serialized_space: d.serializedSpace,
2648
- title: d.title,
2649
- description: d.description,
2650
- }));
2651
-
2652
- export const marshalGenieExecuteMessageAttachmentQueryRequestSchema: z.ZodType =
2653
- z
2654
- .object({
2655
- messageId: z.string().optional(),
2656
- spaceId: z.string().optional(),
2657
- conversationId: z.string().optional(),
2658
- attachmentId: z.string().optional(),
2659
- })
2660
- .transform(d => ({
2661
- message_id: d.messageId,
2662
- space_id: d.spaceId,
2663
- conversation_id: d.conversationId,
2664
- attachment_id: d.attachmentId,
2665
- }));
2666
-
2667
- export const marshalGenieExecuteMessageQueryRequestSchema: z.ZodType = z
2668
- .object({
2669
- messageId: z.string().optional(),
2670
- spaceId: z.string().optional(),
2671
- conversationId: z.string().optional(),
2672
- })
2673
- .transform(d => ({
2674
- message_id: d.messageId,
2675
- space_id: d.spaceId,
2676
- conversation_id: d.conversationId,
2677
- }));
2678
-
2679
- export const marshalGenieGenerateDownloadFullQueryResultRequestSchema: z.ZodType =
2680
- z
2681
- .object({
2682
- spaceId: z.string().optional(),
2683
- conversationId: z.string().optional(),
2684
- messageId: z.string().optional(),
2685
- attachmentId: z.string().optional(),
2686
- })
2687
- .transform(d => ({
2688
- space_id: d.spaceId,
2689
- conversation_id: d.conversationId,
2690
- message_id: d.messageId,
2691
- attachment_id: d.attachmentId,
2692
- }));
2693
-
2694
- export const marshalGenieSendMessageFeedbackRequestSchema: z.ZodType = z
2695
- .object({
2696
- spaceId: z.string().optional(),
2697
- conversationId: z.string().optional(),
2698
- messageId: z.string().optional(),
2699
- rating: z.enum(GenieFeedbackRating).optional(),
2700
- comment: z.string().optional(),
2701
- })
2702
- .transform(d => ({
2703
- space_id: d.spaceId,
2704
- conversation_id: d.conversationId,
2705
- message_id: d.messageId,
2706
- rating: d.rating,
2707
- comment: d.comment,
2708
- }));
2709
-
2710
- export const marshalGenieStartConversationMessageRequestSchema: z.ZodType = z
2711
- .object({
2712
- spaceId: z.string().optional(),
2713
- content: z.string().optional(),
2714
- })
2715
- .transform(d => ({
2716
- space_id: d.spaceId,
2717
- content: d.content,
2718
- }));
2719
-
2720
- export const marshalGenieUpdateSpaceRequestSchema: z.ZodType = z
2721
- .object({
2722
- spaceId: z.string().optional(),
2723
- serializedSpace: z.string().optional(),
2724
- title: z.string().optional(),
2725
- description: z.string().optional(),
2726
- warehouseId: z.string().optional(),
2727
- etag: z.string().optional(),
2728
- parentPath: z.string().optional(),
2729
- })
2730
- .transform(d => ({
2731
- space_id: d.spaceId,
2732
- serialized_space: d.serializedSpace,
2733
- title: d.title,
2734
- description: d.description,
2735
- warehouse_id: d.warehouseId,
2736
- etag: d.etag,
2737
- parent_path: d.parentPath,
2738
- }));