@databricks/sdk-features 0.0.0-dev → 0.1.0-dev.2

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.
@@ -0,0 +1,2253 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+ import { Temporal } from '@js-temporal/polyfill';
3
+ import { FieldMask } from '@databricks/sdk-core/wkt';
4
+ import { z } from 'zod';
5
+ /**
6
+ * Scalar data types for request-time field definitions.
7
+ * Only flat (non-nested) types are supported.
8
+ */
9
+ export var ScalarDataType;
10
+ (function (ScalarDataType) {
11
+ ScalarDataType["SCALAR_DATA_TYPE_UNSPECIFIED"] = "SCALAR_DATA_TYPE_UNSPECIFIED";
12
+ ScalarDataType["INTEGER"] = "INTEGER";
13
+ ScalarDataType["FLOAT"] = "FLOAT";
14
+ ScalarDataType["BOOLEAN"] = "BOOLEAN";
15
+ ScalarDataType["STRING"] = "STRING";
16
+ ScalarDataType["DOUBLE"] = "DOUBLE";
17
+ ScalarDataType["LONG"] = "LONG";
18
+ ScalarDataType["TIMESTAMP"] = "TIMESTAMP";
19
+ ScalarDataType["DATE"] = "DATE";
20
+ ScalarDataType["SHORT"] = "SHORT";
21
+ ScalarDataType["BINARY"] = "BINARY";
22
+ ScalarDataType["DECIMAL"] = "DECIMAL";
23
+ })(ScalarDataType || (ScalarDataType = {}));
24
+ /** Deprecated: Use the function-specific messages in AggregationFunction.function_type oneof instead. Kept for backwards compatibility. */
25
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
26
+ export var Function_FunctionType;
27
+ (function (Function_FunctionType) {
28
+ Function_FunctionType["FUNCTION_TYPE_UNSPECIFIED"] = "FUNCTION_TYPE_UNSPECIFIED";
29
+ Function_FunctionType["AVG"] = "AVG";
30
+ Function_FunctionType["COUNT"] = "COUNT";
31
+ Function_FunctionType["SUM"] = "SUM";
32
+ Function_FunctionType["MIN"] = "MIN";
33
+ Function_FunctionType["MAX"] = "MAX";
34
+ Function_FunctionType["FIRST"] = "FIRST";
35
+ Function_FunctionType["LAST"] = "LAST";
36
+ Function_FunctionType["APPROX_COUNT_DISTINCT"] = "APPROX_COUNT_DISTINCT";
37
+ Function_FunctionType["APPROX_PERCENTILE"] = "APPROX_PERCENTILE";
38
+ Function_FunctionType["STDDEV_POP"] = "STDDEV_POP";
39
+ Function_FunctionType["STDDEV_SAMP"] = "STDDEV_SAMP";
40
+ Function_FunctionType["VAR_POP"] = "VAR_POP";
41
+ Function_FunctionType["VAR_SAMP"] = "VAR_SAMP";
42
+ })(Function_FunctionType || (Function_FunctionType = {}));
43
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
44
+ export var MaterializedFeature_PipelineScheduleState;
45
+ (function (MaterializedFeature_PipelineScheduleState) {
46
+ /** Default value, not used. */
47
+ MaterializedFeature_PipelineScheduleState["PIPELINE_SCHEDULE_STATE_UNSPECIFIED"] = "PIPELINE_SCHEDULE_STATE_UNSPECIFIED";
48
+ /** Pipeline was configured to run once then stop. */
49
+ MaterializedFeature_PipelineScheduleState["SNAPSHOT"] = "SNAPSHOT";
50
+ /** Pipeline is actively running and computing features. */
51
+ MaterializedFeature_PipelineScheduleState["ACTIVE"] = "ACTIVE";
52
+ /** Pipeline is paused and not computing features. */
53
+ MaterializedFeature_PipelineScheduleState["PAUSED"] = "PAUSED";
54
+ })(MaterializedFeature_PipelineScheduleState || (MaterializedFeature_PipelineScheduleState = {}));
55
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
56
+ export var StreamingMode_StreamingModeType;
57
+ (function (StreamingMode_StreamingModeType) {
58
+ /** Default value, not used. */
59
+ StreamingMode_StreamingModeType["STREAMING_MODE_TYPE_UNSPECIFIED"] = "STREAMING_MODE_TYPE_UNSPECIFIED";
60
+ /**
61
+ * Real-time mode. Ultra-low-latency trigger intended for operational workloads
62
+ * that need responses in milliseconds or sub-second latency.
63
+ */
64
+ StreamingMode_StreamingModeType["STREAMING_MODE_TYPE_RTM"] = "STREAMING_MODE_TYPE_RTM";
65
+ /**
66
+ * Micro-batch mode in Structured Streaming. Better suited for ETL and analytics
67
+ * workloads where latency is measured in seconds or minutes and cost efficiency
68
+ * matters more.
69
+ */
70
+ StreamingMode_StreamingModeType["STREAMING_MODE_TYPE_MBM"] = "STREAMING_MODE_TYPE_MBM";
71
+ })(StreamingMode_StreamingModeType || (StreamingMode_StreamingModeType = {}));
72
+ export const unmarshalAggregationFunctionSchema = z
73
+ .object({
74
+ avg: z.lazy(() => unmarshalAvgFunctionSchema).optional(),
75
+ count_function: z.lazy(() => unmarshalCountFunctionSchema).optional(),
76
+ sum: z.lazy(() => unmarshalSumFunctionSchema).optional(),
77
+ min: z.lazy(() => unmarshalMinFunctionSchema).optional(),
78
+ max: z.lazy(() => unmarshalMaxFunctionSchema).optional(),
79
+ first: z.lazy(() => unmarshalFirstFunctionSchema).optional(),
80
+ last: z.lazy(() => unmarshalLastFunctionSchema).optional(),
81
+ approx_count_distinct: z
82
+ .lazy(() => unmarshalApproxCountDistinctFunctionSchema)
83
+ .optional(),
84
+ approx_percentile: z
85
+ .lazy(() => unmarshalApproxPercentileFunctionSchema)
86
+ .optional(),
87
+ stddev_pop: z.lazy(() => unmarshalStddevPopFunctionSchema).optional(),
88
+ stddev_samp: z.lazy(() => unmarshalStddevSampFunctionSchema).optional(),
89
+ var_pop: z.lazy(() => unmarshalVarPopFunctionSchema).optional(),
90
+ var_samp: z.lazy(() => unmarshalVarSampFunctionSchema).optional(),
91
+ time_window: z.lazy(() => unmarshalTimeWindowSchema).optional(),
92
+ })
93
+ .transform(d => ({
94
+ operation: d.avg !== undefined
95
+ ? { $case: 'avg', avg: d.avg }
96
+ : d.count_function !== undefined
97
+ ? { $case: 'countFunction', countFunction: d.count_function }
98
+ : d.sum !== undefined
99
+ ? { $case: 'sum', sum: d.sum }
100
+ : d.min !== undefined
101
+ ? { $case: 'min', min: d.min }
102
+ : d.max !== undefined
103
+ ? { $case: 'max', max: d.max }
104
+ : d.first !== undefined
105
+ ? { $case: 'first', first: d.first }
106
+ : d.last !== undefined
107
+ ? { $case: 'last', last: d.last }
108
+ : d.approx_count_distinct !== undefined
109
+ ? {
110
+ $case: 'approxCountDistinct',
111
+ approxCountDistinct: d.approx_count_distinct,
112
+ }
113
+ : d.approx_percentile !== undefined
114
+ ? {
115
+ $case: 'approxPercentile',
116
+ approxPercentile: d.approx_percentile,
117
+ }
118
+ : d.stddev_pop !== undefined
119
+ ? {
120
+ $case: 'stddevPop',
121
+ stddevPop: d.stddev_pop,
122
+ }
123
+ : d.stddev_samp !== undefined
124
+ ? {
125
+ $case: 'stddevSamp',
126
+ stddevSamp: d.stddev_samp,
127
+ }
128
+ : d.var_pop !== undefined
129
+ ? { $case: 'varPop', varPop: d.var_pop }
130
+ : d.var_samp !== undefined
131
+ ? {
132
+ $case: 'varSamp',
133
+ varSamp: d.var_samp,
134
+ }
135
+ : undefined,
136
+ timeWindow: d.time_window,
137
+ }));
138
+ export const unmarshalApproxCountDistinctFunctionSchema = z
139
+ .object({
140
+ input: z.string().optional(),
141
+ relative_sd: z.number().optional(),
142
+ })
143
+ .transform(d => ({
144
+ input: d.input,
145
+ relativeSd: d.relative_sd,
146
+ }));
147
+ export const unmarshalApproxPercentileFunctionSchema = z
148
+ .object({
149
+ input: z.string().optional(),
150
+ percentile: z.number().optional(),
151
+ accuracy: z
152
+ .union([z.number(), z.bigint()])
153
+ .transform(v => BigInt(v))
154
+ .optional(),
155
+ })
156
+ .transform(d => ({
157
+ input: d.input,
158
+ percentile: d.percentile,
159
+ accuracy: d.accuracy,
160
+ }));
161
+ export const unmarshalAuthConfigSchema = z
162
+ .object({
163
+ uc_service_credential_name: z.string().optional(),
164
+ mtls_config: z.lazy(() => unmarshalMtlsConfigSchema).optional(),
165
+ })
166
+ .transform(d => ({
167
+ authConfig: d.uc_service_credential_name !== undefined
168
+ ? {
169
+ $case: 'ucServiceCredentialName',
170
+ ucServiceCredentialName: d.uc_service_credential_name,
171
+ }
172
+ : d.mtls_config !== undefined
173
+ ? { $case: 'mtlsConfig', mtlsConfig: d.mtls_config }
174
+ : undefined,
175
+ }));
176
+ export const unmarshalAvgFunctionSchema = z
177
+ .object({
178
+ input: z.string().optional(),
179
+ })
180
+ .transform(d => ({
181
+ input: d.input,
182
+ }));
183
+ export const unmarshalBackfillSourceSchema = z
184
+ .object({
185
+ delta_table_source: z
186
+ .lazy(() => unmarshalDeltaTableSourceSchema)
187
+ .optional(),
188
+ delta_table_name: z.string().optional(),
189
+ })
190
+ .transform(d => ({
191
+ backfillSource: d.delta_table_source !== undefined
192
+ ? {
193
+ $case: 'deltaTableSource',
194
+ deltaTableSource: d.delta_table_source,
195
+ }
196
+ : d.delta_table_name !== undefined
197
+ ? {
198
+ $case: 'deltaTableName',
199
+ deltaTableName: d.delta_table_name,
200
+ }
201
+ : undefined,
202
+ }));
203
+ export const unmarshalBatchCreateMaterializedFeaturesResponseSchema = z
204
+ .object({
205
+ materialized_features: z
206
+ .array(z.lazy(() => unmarshalMaterializedFeatureSchema))
207
+ .optional(),
208
+ })
209
+ .transform(d => ({
210
+ materializedFeatures: d.materialized_features,
211
+ }));
212
+ export const unmarshalColumnIdentifierSchema = z
213
+ .object({
214
+ variant_expr_path: z.string().optional(),
215
+ })
216
+ .transform(d => ({
217
+ variantExprPath: d.variant_expr_path,
218
+ }));
219
+ export const unmarshalColumnSelectionSchema = z
220
+ .object({
221
+ column: z.string().optional(),
222
+ })
223
+ .transform(d => ({
224
+ column: d.column,
225
+ }));
226
+ export const unmarshalContinuousWindowSchema = z
227
+ .object({
228
+ window_duration: z
229
+ .string()
230
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
231
+ .optional(),
232
+ offset: z
233
+ .string()
234
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
235
+ .optional(),
236
+ })
237
+ .transform(d => ({
238
+ windowDuration: d.window_duration,
239
+ offset: d.offset,
240
+ }));
241
+ export const unmarshalCountFunctionSchema = z
242
+ .object({
243
+ input: z.string().optional(),
244
+ })
245
+ .transform(d => ({
246
+ input: d.input,
247
+ }));
248
+ export const unmarshalCronScheduleSchema = z
249
+ .object({
250
+ cron_expression: z.string().optional(),
251
+ })
252
+ .transform(d => ({
253
+ cronExpression: d.cron_expression,
254
+ }));
255
+ export const unmarshalDataSourceSchema = z
256
+ .object({
257
+ delta_table_source: z
258
+ .lazy(() => unmarshalDeltaTableSourceSchema)
259
+ .optional(),
260
+ kafka_source: z.lazy(() => unmarshalKafkaSourceSchema).optional(),
261
+ request_source: z.lazy(() => unmarshalRequestSourceSchema).optional(),
262
+ })
263
+ .transform(d => ({
264
+ dataSource: d.delta_table_source !== undefined
265
+ ? {
266
+ $case: 'deltaTableSource',
267
+ deltaTableSource: d.delta_table_source,
268
+ }
269
+ : d.kafka_source !== undefined
270
+ ? { $case: 'kafkaSource', kafkaSource: d.kafka_source }
271
+ : d.request_source !== undefined
272
+ ? { $case: 'requestSource', requestSource: d.request_source }
273
+ : undefined,
274
+ }));
275
+ export const unmarshalDeltaTableSourceSchema = z
276
+ .object({
277
+ full_name: z.string().optional(),
278
+ entity_columns: z.array(z.string()).optional(),
279
+ timeseries_column: z.string().optional(),
280
+ filter_condition: z.string().optional(),
281
+ transformation_sql: z.string().optional(),
282
+ dataframe_schema: z.string().optional(),
283
+ })
284
+ .transform(d => ({
285
+ fullName: d.full_name,
286
+ entityColumns: d.entity_columns,
287
+ timeseriesColumn: d.timeseries_column,
288
+ filterCondition: d.filter_condition,
289
+ transformationSql: d.transformation_sql,
290
+ dataframeSchema: d.dataframe_schema,
291
+ }));
292
+ export const unmarshalDirectMtlsConfigSchema = z
293
+ .object({
294
+ bootstrap_servers: z.string().optional(),
295
+ mtls_config: z.lazy(() => unmarshalMtlsConfigSchema).optional(),
296
+ })
297
+ .transform(d => ({
298
+ bootstrapServers: d.bootstrap_servers,
299
+ mtlsConfig: d.mtls_config,
300
+ }));
301
+ export const unmarshalDirectSchemasSchema = z
302
+ .object({
303
+ payload_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(),
304
+ key_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(),
305
+ })
306
+ .transform(d => ({
307
+ payloadSchema: d.payload_schema,
308
+ keySchema: d.key_schema,
309
+ }));
310
+ export const unmarshalEntityColumnSchema = z
311
+ .object({
312
+ name: z.string().optional(),
313
+ })
314
+ .transform(d => ({
315
+ name: d.name,
316
+ }));
317
+ export const unmarshalFeatureSchema = z
318
+ .object({
319
+ full_name: z.string().optional(),
320
+ source: z.lazy(() => unmarshalDataSourceSchema).optional(),
321
+ inputs: z.array(z.string()).optional(),
322
+ function: z.lazy(() => unmarshalFunctionSchema).optional(),
323
+ time_window: z.lazy(() => unmarshalTimeWindowSchema).optional(),
324
+ description: z.string().optional(),
325
+ filter_condition: z.string().optional(),
326
+ lineage_context: z.lazy(() => unmarshalLineageContextSchema).optional(),
327
+ entities: z.array(z.lazy(() => unmarshalEntityColumnSchema)).optional(),
328
+ timeseries_column: z.lazy(() => unmarshalTimeseriesColumnSchema).optional(),
329
+ catalog_name: z.string().optional(),
330
+ schema_name: z.string().optional(),
331
+ name: z.string().optional(),
332
+ created_at: z
333
+ .string()
334
+ .transform(s => Temporal.Instant.from(s))
335
+ .optional(),
336
+ created_by: z.string().optional(),
337
+ })
338
+ .transform(d => ({
339
+ fullName: d.full_name,
340
+ source: d.source,
341
+ inputs: d.inputs,
342
+ function: d.function,
343
+ timeWindow: d.time_window,
344
+ description: d.description,
345
+ filterCondition: d.filter_condition,
346
+ lineageContext: d.lineage_context,
347
+ entities: d.entities,
348
+ timeseriesColumn: d.timeseries_column,
349
+ catalogName: d.catalog_name,
350
+ schemaName: d.schema_name,
351
+ name: d.name,
352
+ createdAt: d.created_at,
353
+ createdBy: d.created_by,
354
+ }));
355
+ export const unmarshalFieldDefinitionSchema = z
356
+ .object({
357
+ name: z.string().optional(),
358
+ data_type: z.enum(ScalarDataType).optional(),
359
+ })
360
+ .transform(d => ({
361
+ name: d.name,
362
+ dataType: d.data_type,
363
+ }));
364
+ export const unmarshalFirstFunctionSchema = z
365
+ .object({
366
+ input: z.string().optional(),
367
+ })
368
+ .transform(d => ({
369
+ input: d.input,
370
+ }));
371
+ export const unmarshalFlatSchemaSchema = z
372
+ .object({
373
+ fields: z.array(z.lazy(() => unmarshalFieldDefinitionSchema)).optional(),
374
+ })
375
+ .transform(d => ({
376
+ fields: d.fields,
377
+ }));
378
+ export const unmarshalFunctionSchema = z
379
+ .object({
380
+ function_type: z.enum(Function_FunctionType).optional(),
381
+ extra_parameters: z
382
+ .array(z.lazy(() => unmarshalFunction_ExtraParameterSchema))
383
+ .optional(),
384
+ aggregation_function: z
385
+ .lazy(() => unmarshalAggregationFunctionSchema)
386
+ .optional(),
387
+ column_selection: z.lazy(() => unmarshalColumnSelectionSchema).optional(),
388
+ })
389
+ .transform(d => ({
390
+ functionType: d.function_type,
391
+ extraParameters: d.extra_parameters,
392
+ function: d.aggregation_function !== undefined
393
+ ? {
394
+ $case: 'aggregationFunction',
395
+ aggregationFunction: d.aggregation_function,
396
+ }
397
+ : d.column_selection !== undefined
398
+ ? {
399
+ $case: 'columnSelection',
400
+ columnSelection: d.column_selection,
401
+ }
402
+ : undefined,
403
+ }));
404
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
405
+ export const unmarshalFunction_ExtraParameterSchema = z
406
+ .object({
407
+ key: z.string().optional(),
408
+ value: z.string().optional(),
409
+ })
410
+ .transform(d => ({
411
+ key: d.key,
412
+ value: d.value,
413
+ }));
414
+ export const unmarshalIngestionConfigSchema = z
415
+ .object({
416
+ ingestion_destination: z
417
+ .lazy(() => unmarshalIngestionDestinationSchema)
418
+ .optional(),
419
+ backfill_source: z.lazy(() => unmarshalBackfillSourceSchema).optional(),
420
+ deduplication_columns: z.array(z.string()).optional(),
421
+ ingestion_pipeline_id: z.string().optional(),
422
+ ingestion_job_id: z
423
+ .union([z.number(), z.bigint()])
424
+ .transform(v => BigInt(v))
425
+ .optional(),
426
+ backfill_job_id: z
427
+ .union([z.number(), z.bigint()])
428
+ .transform(v => BigInt(v))
429
+ .optional(),
430
+ })
431
+ .transform(d => ({
432
+ ingestionDestination: d.ingestion_destination,
433
+ backfillSource: d.backfill_source,
434
+ deduplicationColumns: d.deduplication_columns,
435
+ ingestionPipelineId: d.ingestion_pipeline_id,
436
+ ingestionJobId: d.ingestion_job_id,
437
+ backfillJobId: d.backfill_job_id,
438
+ }));
439
+ export const unmarshalIngestionDestinationSchema = z
440
+ .object({
441
+ delta_table_name: z.string().optional(),
442
+ })
443
+ .transform(d => ({
444
+ ingestionDestination: d.delta_table_name !== undefined
445
+ ? {
446
+ $case: 'deltaTableName',
447
+ deltaTableName: d.delta_table_name,
448
+ }
449
+ : undefined,
450
+ }));
451
+ export const unmarshalJobContextSchema = z
452
+ .object({
453
+ job_id: z
454
+ .union([z.number(), z.bigint()])
455
+ .transform(v => BigInt(v))
456
+ .optional(),
457
+ job_run_id: z
458
+ .union([z.number(), z.bigint()])
459
+ .transform(v => BigInt(v))
460
+ .optional(),
461
+ })
462
+ .transform(d => ({
463
+ jobId: d.job_id,
464
+ jobRunId: d.job_run_id,
465
+ }));
466
+ export const unmarshalKafkaConfigSchema = z
467
+ .object({
468
+ name: z.string().optional(),
469
+ bootstrap_servers: z.string().optional(),
470
+ subscription_mode: z.lazy(() => unmarshalSubscriptionModeSchema).optional(),
471
+ auth_config: z.lazy(() => unmarshalAuthConfigSchema).optional(),
472
+ key_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(),
473
+ value_schema: z.lazy(() => unmarshalSchemaConfigSchema).optional(),
474
+ extra_options: z.record(z.string(), z.string()).optional(),
475
+ backfill_source: z.lazy(() => unmarshalBackfillSourceSchema).optional(),
476
+ })
477
+ .transform(d => ({
478
+ name: d.name,
479
+ bootstrapServers: d.bootstrap_servers,
480
+ subscriptionMode: d.subscription_mode,
481
+ authConfig: d.auth_config,
482
+ keySchema: d.key_schema,
483
+ valueSchema: d.value_schema,
484
+ extraOptions: d.extra_options,
485
+ backfillSource: d.backfill_source,
486
+ }));
487
+ export const unmarshalKafkaSourceSchema = z
488
+ .object({
489
+ name: z.string().optional(),
490
+ entity_column_identifiers: z
491
+ .array(z.lazy(() => unmarshalColumnIdentifierSchema))
492
+ .optional(),
493
+ timeseries_column_identifier: z
494
+ .lazy(() => unmarshalColumnIdentifierSchema)
495
+ .optional(),
496
+ filter_condition: z.string().optional(),
497
+ })
498
+ .transform(d => ({
499
+ name: d.name,
500
+ entityColumnIdentifiers: d.entity_column_identifiers,
501
+ timeseriesColumnIdentifier: d.timeseries_column_identifier,
502
+ filterCondition: d.filter_condition,
503
+ }));
504
+ export const unmarshalKafkaStreamConfigSchema = z
505
+ .object({
506
+ subscription_mode: z
507
+ .lazy(() => unmarshalKafkaSubscriptionModeSchema)
508
+ .optional(),
509
+ extra_options: z.record(z.string(), z.string()).optional(),
510
+ })
511
+ .transform(d => ({
512
+ subscriptionMode: d.subscription_mode,
513
+ extraOptions: d.extra_options,
514
+ }));
515
+ export const unmarshalKafkaSubscriptionModeSchema = z
516
+ .object({
517
+ assign: z.string().optional(),
518
+ subscribe: z.string().optional(),
519
+ subscribe_pattern: z.string().optional(),
520
+ })
521
+ .transform(d => ({
522
+ subscriptionMode: d.assign !== undefined
523
+ ? { $case: 'assign', assign: d.assign }
524
+ : d.subscribe !== undefined
525
+ ? { $case: 'subscribe', subscribe: d.subscribe }
526
+ : d.subscribe_pattern !== undefined
527
+ ? {
528
+ $case: 'subscribePattern',
529
+ subscribePattern: d.subscribe_pattern,
530
+ }
531
+ : undefined,
532
+ }));
533
+ export const unmarshalLastFunctionSchema = z
534
+ .object({
535
+ input: z.string().optional(),
536
+ })
537
+ .transform(d => ({
538
+ input: d.input,
539
+ }));
540
+ export const unmarshalLineageContextSchema = z
541
+ .object({
542
+ notebook_id: z
543
+ .union([z.number(), z.bigint()])
544
+ .transform(v => BigInt(v))
545
+ .optional(),
546
+ job_context: z.lazy(() => unmarshalJobContextSchema).optional(),
547
+ })
548
+ .transform(d => ({
549
+ notebookId: d.notebook_id,
550
+ jobContext: d.job_context,
551
+ }));
552
+ export const unmarshalListFeaturesResponseSchema = z
553
+ .object({
554
+ features: z.array(z.lazy(() => unmarshalFeatureSchema)).optional(),
555
+ next_page_token: z.string().optional(),
556
+ })
557
+ .transform(d => ({
558
+ features: d.features,
559
+ nextPageToken: d.next_page_token,
560
+ }));
561
+ export const unmarshalListKafkaConfigsResponseSchema = z
562
+ .object({
563
+ kafka_configs: z
564
+ .array(z.lazy(() => unmarshalKafkaConfigSchema))
565
+ .optional(),
566
+ next_page_token: z.string().optional(),
567
+ })
568
+ .transform(d => ({
569
+ kafkaConfigs: d.kafka_configs,
570
+ nextPageToken: d.next_page_token,
571
+ }));
572
+ export const unmarshalListMaterializedFeaturesResponseSchema = z
573
+ .object({
574
+ materialized_features: z
575
+ .array(z.lazy(() => unmarshalMaterializedFeatureSchema))
576
+ .optional(),
577
+ next_page_token: z.string().optional(),
578
+ })
579
+ .transform(d => ({
580
+ materializedFeatures: d.materialized_features,
581
+ nextPageToken: d.next_page_token,
582
+ }));
583
+ export const unmarshalListStreamsResponseSchema = z
584
+ .object({
585
+ streams: z.array(z.lazy(() => unmarshalStreamSchema)).optional(),
586
+ next_page_token: z.string().optional(),
587
+ })
588
+ .transform(d => ({
589
+ streams: d.streams,
590
+ nextPageToken: d.next_page_token,
591
+ }));
592
+ export const unmarshalMaterializedFeatureSchema = z
593
+ .object({
594
+ materialized_feature_id: z.string().optional(),
595
+ feature_name: z.string().optional(),
596
+ offline_store_config: z
597
+ .lazy(() => unmarshalOfflineStoreConfigSchema)
598
+ .optional(),
599
+ online_store_config: z
600
+ .lazy(() => unmarshalOnlineStoreConfigSchema)
601
+ .optional(),
602
+ table_name: z.string().optional(),
603
+ pipeline_schedule_state: z
604
+ .enum(MaterializedFeature_PipelineScheduleState)
605
+ .optional(),
606
+ last_materialization_time: z
607
+ .string()
608
+ .transform(s => Temporal.Instant.from(s))
609
+ .optional(),
610
+ cron_schedule: z.string().optional(),
611
+ is_online: z.boolean().optional(),
612
+ cron_schedule_trigger: z
613
+ .lazy(() => unmarshalCronScheduleSchema)
614
+ .optional(),
615
+ table_trigger: z.lazy(() => unmarshalTableTriggerSchema).optional(),
616
+ streaming_mode: z.lazy(() => unmarshalStreamingModeSchema).optional(),
617
+ })
618
+ .transform(d => ({
619
+ materializedFeatureId: d.materialized_feature_id,
620
+ featureName: d.feature_name,
621
+ destination: d.offline_store_config !== undefined
622
+ ? {
623
+ $case: 'offlineStoreConfig',
624
+ offlineStoreConfig: d.offline_store_config,
625
+ }
626
+ : d.online_store_config !== undefined
627
+ ? {
628
+ $case: 'onlineStoreConfig',
629
+ onlineStoreConfig: d.online_store_config,
630
+ }
631
+ : undefined,
632
+ tableName: d.table_name,
633
+ pipelineScheduleState: d.pipeline_schedule_state,
634
+ lastMaterializationTime: d.last_materialization_time,
635
+ cronSchedule: d.cron_schedule,
636
+ isOnline: d.is_online,
637
+ trigger: d.cron_schedule_trigger !== undefined
638
+ ? {
639
+ $case: 'cronScheduleTrigger',
640
+ cronScheduleTrigger: d.cron_schedule_trigger,
641
+ }
642
+ : d.table_trigger !== undefined
643
+ ? { $case: 'tableTrigger', tableTrigger: d.table_trigger }
644
+ : d.streaming_mode !== undefined
645
+ ? {
646
+ $case: 'streamingMode',
647
+ streamingMode: d.streaming_mode,
648
+ }
649
+ : undefined,
650
+ }));
651
+ export const unmarshalMaxFunctionSchema = z
652
+ .object({
653
+ input: z.string().optional(),
654
+ })
655
+ .transform(d => ({
656
+ input: d.input,
657
+ }));
658
+ export const unmarshalMinFunctionSchema = z
659
+ .object({
660
+ input: z.string().optional(),
661
+ })
662
+ .transform(d => ({
663
+ input: d.input,
664
+ }));
665
+ export const unmarshalMtlsConfigSchema = z
666
+ .object({
667
+ keystore_location: z.string().optional(),
668
+ keystore_password_ref: z
669
+ .lazy(() => unmarshalSecretScopeReferenceSchema)
670
+ .optional(),
671
+ key_password_ref: z
672
+ .lazy(() => unmarshalSecretScopeReferenceSchema)
673
+ .optional(),
674
+ truststore_location: z.string().optional(),
675
+ truststore_password_ref: z
676
+ .lazy(() => unmarshalSecretScopeReferenceSchema)
677
+ .optional(),
678
+ disable_hostname_verification: z.boolean().optional(),
679
+ })
680
+ .transform(d => ({
681
+ keystoreLocation: d.keystore_location,
682
+ keystorePasswordRef: d.keystore_password_ref,
683
+ keyPasswordRef: d.key_password_ref,
684
+ truststoreLocation: d.truststore_location,
685
+ truststorePasswordRef: d.truststore_password_ref,
686
+ disableHostnameVerification: d.disable_hostname_verification,
687
+ }));
688
+ export const unmarshalOfflineStoreConfigSchema = z
689
+ .object({
690
+ catalog_name: z.string().optional(),
691
+ schema_name: z.string().optional(),
692
+ table_name_prefix: z.string().optional(),
693
+ })
694
+ .transform(d => ({
695
+ catalogName: d.catalog_name,
696
+ schemaName: d.schema_name,
697
+ tableNamePrefix: d.table_name_prefix,
698
+ }));
699
+ export const unmarshalOnlineStoreConfigSchema = z
700
+ .object({
701
+ catalog_name: z.string().optional(),
702
+ schema_name: z.string().optional(),
703
+ table_name_prefix: z.string().optional(),
704
+ online_store_name: z.string().optional(),
705
+ })
706
+ .transform(d => ({
707
+ catalogName: d.catalog_name,
708
+ schemaName: d.schema_name,
709
+ tableNamePrefix: d.table_name_prefix,
710
+ onlineStoreName: d.online_store_name,
711
+ }));
712
+ export const unmarshalRequestSourceSchema = z
713
+ .object({
714
+ flat_schema: z.lazy(() => unmarshalFlatSchemaSchema).optional(),
715
+ })
716
+ .transform(d => ({
717
+ schema: d.flat_schema !== undefined
718
+ ? { $case: 'flatSchema', flatSchema: d.flat_schema }
719
+ : undefined,
720
+ }));
721
+ export const unmarshalRollingWindowSchema = z
722
+ .object({
723
+ window_duration: z
724
+ .string()
725
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
726
+ .optional(),
727
+ delay: z
728
+ .string()
729
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
730
+ .optional(),
731
+ })
732
+ .transform(d => ({
733
+ windowDuration: d.window_duration,
734
+ delay: d.delay,
735
+ }));
736
+ export const unmarshalSchemaConfigSchema = z
737
+ .object({
738
+ json_schema: z.string().optional(),
739
+ })
740
+ .transform(d => ({
741
+ schema: d.json_schema !== undefined
742
+ ? { $case: 'jsonSchema', jsonSchema: d.json_schema }
743
+ : undefined,
744
+ }));
745
+ export const unmarshalSecretScopeReferenceSchema = z
746
+ .object({
747
+ scope: z.string().optional(),
748
+ key: z.string().optional(),
749
+ })
750
+ .transform(d => ({
751
+ scope: d.scope,
752
+ key: d.key,
753
+ }));
754
+ export const unmarshalSlidingWindowSchema = z
755
+ .object({
756
+ window_duration: z
757
+ .string()
758
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
759
+ .optional(),
760
+ slide_duration: z
761
+ .string()
762
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
763
+ .optional(),
764
+ })
765
+ .transform(d => ({
766
+ windowDuration: d.window_duration,
767
+ slideDuration: d.slide_duration,
768
+ }));
769
+ export const unmarshalStddevPopFunctionSchema = z
770
+ .object({
771
+ input: z.string().optional(),
772
+ })
773
+ .transform(d => ({
774
+ input: d.input,
775
+ }));
776
+ export const unmarshalStddevSampFunctionSchema = z
777
+ .object({
778
+ input: z.string().optional(),
779
+ })
780
+ .transform(d => ({
781
+ input: d.input,
782
+ }));
783
+ export const unmarshalStreamSchema = z
784
+ .object({
785
+ name: z.string().optional(),
786
+ description: z.string().optional(),
787
+ source_config: z.lazy(() => unmarshalStreamSourceConfigSchema).optional(),
788
+ connection_config: z
789
+ .lazy(() => unmarshalStreamConnectionConfigSchema)
790
+ .optional(),
791
+ schema_config: z.lazy(() => unmarshalStreamSchemaConfigSchema).optional(),
792
+ ingestion_config: z.lazy(() => unmarshalIngestionConfigSchema).optional(),
793
+ create_time: z
794
+ .string()
795
+ .transform(s => Temporal.Instant.from(s))
796
+ .optional(),
797
+ created_by: z.string().optional(),
798
+ update_time: z
799
+ .string()
800
+ .transform(s => Temporal.Instant.from(s))
801
+ .optional(),
802
+ updated_by: z.string().optional(),
803
+ browse_only: z.boolean().optional(),
804
+ })
805
+ .transform(d => ({
806
+ name: d.name,
807
+ description: d.description,
808
+ sourceConfig: d.source_config,
809
+ connectionConfig: d.connection_config,
810
+ schemaConfig: d.schema_config,
811
+ ingestionConfig: d.ingestion_config,
812
+ createTime: d.create_time,
813
+ createdBy: d.created_by,
814
+ updateTime: d.update_time,
815
+ updatedBy: d.updated_by,
816
+ browseOnly: d.browse_only,
817
+ }));
818
+ export const unmarshalStreamConnectionConfigSchema = z
819
+ .object({
820
+ uc_connection_name: z.string().optional(),
821
+ direct_mtls_config: z
822
+ .lazy(() => unmarshalDirectMtlsConfigSchema)
823
+ .optional(),
824
+ })
825
+ .transform(d => ({
826
+ connectionConfig: d.uc_connection_name !== undefined
827
+ ? {
828
+ $case: 'ucConnectionName',
829
+ ucConnectionName: d.uc_connection_name,
830
+ }
831
+ : d.direct_mtls_config !== undefined
832
+ ? {
833
+ $case: 'directMtlsConfig',
834
+ directMtlsConfig: d.direct_mtls_config,
835
+ }
836
+ : undefined,
837
+ }));
838
+ export const unmarshalStreamSchemaConfigSchema = z
839
+ .object({
840
+ direct_schemas: z.lazy(() => unmarshalDirectSchemasSchema).optional(),
841
+ })
842
+ .transform(d => ({
843
+ schemaConfig: d.direct_schemas !== undefined
844
+ ? { $case: 'directSchemas', directSchemas: d.direct_schemas }
845
+ : undefined,
846
+ }));
847
+ export const unmarshalStreamSourceConfigSchema = z
848
+ .object({
849
+ kafka_stream_config: z
850
+ .lazy(() => unmarshalKafkaStreamConfigSchema)
851
+ .optional(),
852
+ })
853
+ .transform(d => ({
854
+ sourceConfig: d.kafka_stream_config !== undefined
855
+ ? {
856
+ $case: 'kafkaStreamConfig',
857
+ kafkaStreamConfig: d.kafka_stream_config,
858
+ }
859
+ : undefined,
860
+ }));
861
+ export const unmarshalStreamingModeSchema = z
862
+ .object({
863
+ mode: z.enum(StreamingMode_StreamingModeType).optional(),
864
+ })
865
+ .transform(d => ({
866
+ mode: d.mode,
867
+ }));
868
+ export const unmarshalSubscriptionModeSchema = z
869
+ .object({
870
+ assign: z.string().optional(),
871
+ subscribe: z.string().optional(),
872
+ subscribe_pattern: z.string().optional(),
873
+ })
874
+ .transform(d => ({
875
+ subscriptionMode: d.assign !== undefined
876
+ ? { $case: 'assign', assign: d.assign }
877
+ : d.subscribe !== undefined
878
+ ? { $case: 'subscribe', subscribe: d.subscribe }
879
+ : d.subscribe_pattern !== undefined
880
+ ? {
881
+ $case: 'subscribePattern',
882
+ subscribePattern: d.subscribe_pattern,
883
+ }
884
+ : undefined,
885
+ }));
886
+ export const unmarshalSumFunctionSchema = z
887
+ .object({
888
+ input: z.string().optional(),
889
+ })
890
+ .transform(d => ({
891
+ input: d.input,
892
+ }));
893
+ export const unmarshalTableTriggerSchema = z.object({});
894
+ export const unmarshalTimeWindowSchema = z
895
+ .object({
896
+ continuous: z.lazy(() => unmarshalContinuousWindowSchema).optional(),
897
+ tumbling: z.lazy(() => unmarshalTumblingWindowSchema).optional(),
898
+ sliding: z.lazy(() => unmarshalSlidingWindowSchema).optional(),
899
+ rolling: z.lazy(() => unmarshalRollingWindowSchema).optional(),
900
+ })
901
+ .transform(d => ({
902
+ windowType: d.continuous !== undefined
903
+ ? { $case: 'continuous', continuous: d.continuous }
904
+ : d.tumbling !== undefined
905
+ ? { $case: 'tumbling', tumbling: d.tumbling }
906
+ : d.sliding !== undefined
907
+ ? { $case: 'sliding', sliding: d.sliding }
908
+ : d.rolling !== undefined
909
+ ? { $case: 'rolling', rolling: d.rolling }
910
+ : undefined,
911
+ }));
912
+ export const unmarshalTimeseriesColumnSchema = z
913
+ .object({
914
+ name: z.string().optional(),
915
+ })
916
+ .transform(d => ({
917
+ name: d.name,
918
+ }));
919
+ export const unmarshalTumblingWindowSchema = z
920
+ .object({
921
+ window_duration: z
922
+ .string()
923
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
924
+ .optional(),
925
+ })
926
+ .transform(d => ({
927
+ windowDuration: d.window_duration,
928
+ }));
929
+ export const unmarshalVarPopFunctionSchema = z
930
+ .object({
931
+ input: z.string().optional(),
932
+ })
933
+ .transform(d => ({
934
+ input: d.input,
935
+ }));
936
+ export const unmarshalVarSampFunctionSchema = z
937
+ .object({
938
+ input: z.string().optional(),
939
+ })
940
+ .transform(d => ({
941
+ input: d.input,
942
+ }));
943
+ export const marshalAggregationFunctionSchema = z
944
+ .object({
945
+ operation: z
946
+ .discriminatedUnion('$case', [
947
+ z.object({
948
+ $case: z.literal('avg'),
949
+ avg: z.lazy(() => marshalAvgFunctionSchema),
950
+ }),
951
+ z.object({
952
+ $case: z.literal('countFunction'),
953
+ countFunction: z.lazy(() => marshalCountFunctionSchema),
954
+ }),
955
+ z.object({
956
+ $case: z.literal('sum'),
957
+ sum: z.lazy(() => marshalSumFunctionSchema),
958
+ }),
959
+ z.object({
960
+ $case: z.literal('min'),
961
+ min: z.lazy(() => marshalMinFunctionSchema),
962
+ }),
963
+ z.object({
964
+ $case: z.literal('max'),
965
+ max: z.lazy(() => marshalMaxFunctionSchema),
966
+ }),
967
+ z.object({
968
+ $case: z.literal('first'),
969
+ first: z.lazy(() => marshalFirstFunctionSchema),
970
+ }),
971
+ z.object({
972
+ $case: z.literal('last'),
973
+ last: z.lazy(() => marshalLastFunctionSchema),
974
+ }),
975
+ z.object({
976
+ $case: z.literal('approxCountDistinct'),
977
+ approxCountDistinct: z.lazy(() => marshalApproxCountDistinctFunctionSchema),
978
+ }),
979
+ z.object({
980
+ $case: z.literal('approxPercentile'),
981
+ approxPercentile: z.lazy(() => marshalApproxPercentileFunctionSchema),
982
+ }),
983
+ z.object({
984
+ $case: z.literal('stddevPop'),
985
+ stddevPop: z.lazy(() => marshalStddevPopFunctionSchema),
986
+ }),
987
+ z.object({
988
+ $case: z.literal('stddevSamp'),
989
+ stddevSamp: z.lazy(() => marshalStddevSampFunctionSchema),
990
+ }),
991
+ z.object({
992
+ $case: z.literal('varPop'),
993
+ varPop: z.lazy(() => marshalVarPopFunctionSchema),
994
+ }),
995
+ z.object({
996
+ $case: z.literal('varSamp'),
997
+ varSamp: z.lazy(() => marshalVarSampFunctionSchema),
998
+ }),
999
+ ])
1000
+ .optional(),
1001
+ timeWindow: z.lazy(() => marshalTimeWindowSchema).optional(),
1002
+ })
1003
+ .transform(d => ({
1004
+ ...(d.operation?.$case === 'avg' && { avg: d.operation.avg }),
1005
+ ...(d.operation?.$case === 'countFunction' && {
1006
+ count_function: d.operation.countFunction,
1007
+ }),
1008
+ ...(d.operation?.$case === 'sum' && { sum: d.operation.sum }),
1009
+ ...(d.operation?.$case === 'min' && { min: d.operation.min }),
1010
+ ...(d.operation?.$case === 'max' && { max: d.operation.max }),
1011
+ ...(d.operation?.$case === 'first' && { first: d.operation.first }),
1012
+ ...(d.operation?.$case === 'last' && { last: d.operation.last }),
1013
+ ...(d.operation?.$case === 'approxCountDistinct' && {
1014
+ approx_count_distinct: d.operation.approxCountDistinct,
1015
+ }),
1016
+ ...(d.operation?.$case === 'approxPercentile' && {
1017
+ approx_percentile: d.operation.approxPercentile,
1018
+ }),
1019
+ ...(d.operation?.$case === 'stddevPop' && {
1020
+ stddev_pop: d.operation.stddevPop,
1021
+ }),
1022
+ ...(d.operation?.$case === 'stddevSamp' && {
1023
+ stddev_samp: d.operation.stddevSamp,
1024
+ }),
1025
+ ...(d.operation?.$case === 'varPop' && { var_pop: d.operation.varPop }),
1026
+ ...(d.operation?.$case === 'varSamp' && { var_samp: d.operation.varSamp }),
1027
+ time_window: d.timeWindow,
1028
+ }));
1029
+ export const marshalApproxCountDistinctFunctionSchema = z
1030
+ .object({
1031
+ input: z.string().optional(),
1032
+ relativeSd: z.number().optional(),
1033
+ })
1034
+ .transform(d => ({
1035
+ input: d.input,
1036
+ relative_sd: d.relativeSd,
1037
+ }));
1038
+ export const marshalApproxPercentileFunctionSchema = z
1039
+ .object({
1040
+ input: z.string().optional(),
1041
+ percentile: z.number().optional(),
1042
+ accuracy: z.bigint().optional(),
1043
+ })
1044
+ .transform(d => ({
1045
+ input: d.input,
1046
+ percentile: d.percentile,
1047
+ accuracy: d.accuracy,
1048
+ }));
1049
+ export const marshalAuthConfigSchema = z
1050
+ .object({
1051
+ authConfig: z
1052
+ .discriminatedUnion('$case', [
1053
+ z.object({
1054
+ $case: z.literal('ucServiceCredentialName'),
1055
+ ucServiceCredentialName: z.string(),
1056
+ }),
1057
+ z.object({
1058
+ $case: z.literal('mtlsConfig'),
1059
+ mtlsConfig: z.lazy(() => marshalMtlsConfigSchema),
1060
+ }),
1061
+ ])
1062
+ .optional(),
1063
+ })
1064
+ .transform(d => ({
1065
+ ...(d.authConfig?.$case === 'ucServiceCredentialName' && {
1066
+ uc_service_credential_name: d.authConfig.ucServiceCredentialName,
1067
+ }),
1068
+ ...(d.authConfig?.$case === 'mtlsConfig' && {
1069
+ mtls_config: d.authConfig.mtlsConfig,
1070
+ }),
1071
+ }));
1072
+ export const marshalAvgFunctionSchema = z
1073
+ .object({
1074
+ input: z.string().optional(),
1075
+ })
1076
+ .transform(d => ({
1077
+ input: d.input,
1078
+ }));
1079
+ export const marshalBackfillSourceSchema = z
1080
+ .object({
1081
+ backfillSource: z
1082
+ .discriminatedUnion('$case', [
1083
+ z.object({
1084
+ $case: z.literal('deltaTableSource'),
1085
+ deltaTableSource: z.lazy(() => marshalDeltaTableSourceSchema),
1086
+ }),
1087
+ z.object({
1088
+ $case: z.literal('deltaTableName'),
1089
+ deltaTableName: z.string(),
1090
+ }),
1091
+ ])
1092
+ .optional(),
1093
+ })
1094
+ .transform(d => ({
1095
+ ...(d.backfillSource?.$case === 'deltaTableSource' && {
1096
+ delta_table_source: d.backfillSource.deltaTableSource,
1097
+ }),
1098
+ ...(d.backfillSource?.$case === 'deltaTableName' && {
1099
+ delta_table_name: d.backfillSource.deltaTableName,
1100
+ }),
1101
+ }));
1102
+ export const marshalBatchCreateMaterializedFeaturesRequestSchema = z
1103
+ .object({
1104
+ requests: z
1105
+ .array(z.lazy(() => marshalCreateMaterializedFeatureRequestSchema))
1106
+ .optional(),
1107
+ })
1108
+ .transform(d => ({
1109
+ requests: d.requests,
1110
+ }));
1111
+ export const marshalColumnIdentifierSchema = z
1112
+ .object({
1113
+ variantExprPath: z.string().optional(),
1114
+ })
1115
+ .transform(d => ({
1116
+ variant_expr_path: d.variantExprPath,
1117
+ }));
1118
+ export const marshalColumnSelectionSchema = z
1119
+ .object({
1120
+ column: z.string().optional(),
1121
+ })
1122
+ .transform(d => ({
1123
+ column: d.column,
1124
+ }));
1125
+ export const marshalContinuousWindowSchema = z
1126
+ .object({
1127
+ windowDuration: z
1128
+ .any()
1129
+ .transform((d) => d.toString().slice(2).toLowerCase())
1130
+ .optional(),
1131
+ offset: z
1132
+ .any()
1133
+ .transform((d) => d.toString().slice(2).toLowerCase())
1134
+ .optional(),
1135
+ })
1136
+ .transform(d => ({
1137
+ window_duration: d.windowDuration,
1138
+ offset: d.offset,
1139
+ }));
1140
+ export const marshalCountFunctionSchema = z
1141
+ .object({
1142
+ input: z.string().optional(),
1143
+ })
1144
+ .transform(d => ({
1145
+ input: d.input,
1146
+ }));
1147
+ export const marshalCreateMaterializedFeatureRequestSchema = z
1148
+ .object({
1149
+ materializedFeature: z
1150
+ .lazy(() => marshalMaterializedFeatureSchema)
1151
+ .optional(),
1152
+ })
1153
+ .transform(d => ({
1154
+ materialized_feature: d.materializedFeature,
1155
+ }));
1156
+ export const marshalCronScheduleSchema = z
1157
+ .object({
1158
+ cronExpression: z.string().optional(),
1159
+ })
1160
+ .transform(d => ({
1161
+ cron_expression: d.cronExpression,
1162
+ }));
1163
+ export const marshalDataSourceSchema = z
1164
+ .object({
1165
+ dataSource: z
1166
+ .discriminatedUnion('$case', [
1167
+ z.object({
1168
+ $case: z.literal('deltaTableSource'),
1169
+ deltaTableSource: z.lazy(() => marshalDeltaTableSourceSchema),
1170
+ }),
1171
+ z.object({
1172
+ $case: z.literal('kafkaSource'),
1173
+ kafkaSource: z.lazy(() => marshalKafkaSourceSchema),
1174
+ }),
1175
+ z.object({
1176
+ $case: z.literal('requestSource'),
1177
+ requestSource: z.lazy(() => marshalRequestSourceSchema),
1178
+ }),
1179
+ ])
1180
+ .optional(),
1181
+ })
1182
+ .transform(d => ({
1183
+ ...(d.dataSource?.$case === 'deltaTableSource' && {
1184
+ delta_table_source: d.dataSource.deltaTableSource,
1185
+ }),
1186
+ ...(d.dataSource?.$case === 'kafkaSource' && {
1187
+ kafka_source: d.dataSource.kafkaSource,
1188
+ }),
1189
+ ...(d.dataSource?.$case === 'requestSource' && {
1190
+ request_source: d.dataSource.requestSource,
1191
+ }),
1192
+ }));
1193
+ export const marshalDeltaTableSourceSchema = z
1194
+ .object({
1195
+ fullName: z.string().optional(),
1196
+ entityColumns: z.array(z.string()).optional(),
1197
+ timeseriesColumn: z.string().optional(),
1198
+ filterCondition: z.string().optional(),
1199
+ transformationSql: z.string().optional(),
1200
+ dataframeSchema: z.string().optional(),
1201
+ })
1202
+ .transform(d => ({
1203
+ full_name: d.fullName,
1204
+ entity_columns: d.entityColumns,
1205
+ timeseries_column: d.timeseriesColumn,
1206
+ filter_condition: d.filterCondition,
1207
+ transformation_sql: d.transformationSql,
1208
+ dataframe_schema: d.dataframeSchema,
1209
+ }));
1210
+ export const marshalDirectMtlsConfigSchema = z
1211
+ .object({
1212
+ bootstrapServers: z.string().optional(),
1213
+ mtlsConfig: z.lazy(() => marshalMtlsConfigSchema).optional(),
1214
+ })
1215
+ .transform(d => ({
1216
+ bootstrap_servers: d.bootstrapServers,
1217
+ mtls_config: d.mtlsConfig,
1218
+ }));
1219
+ export const marshalDirectSchemasSchema = z
1220
+ .object({
1221
+ payloadSchema: z.lazy(() => marshalSchemaConfigSchema).optional(),
1222
+ keySchema: z.lazy(() => marshalSchemaConfigSchema).optional(),
1223
+ })
1224
+ .transform(d => ({
1225
+ payload_schema: d.payloadSchema,
1226
+ key_schema: d.keySchema,
1227
+ }));
1228
+ export const marshalEntityColumnSchema = z
1229
+ .object({
1230
+ name: z.string().optional(),
1231
+ })
1232
+ .transform(d => ({
1233
+ name: d.name,
1234
+ }));
1235
+ export const marshalFeatureSchema = z
1236
+ .object({
1237
+ fullName: z.string().optional(),
1238
+ source: z.lazy(() => marshalDataSourceSchema).optional(),
1239
+ inputs: z.array(z.string()).optional(),
1240
+ function: z.lazy(() => marshalFunctionSchema).optional(),
1241
+ timeWindow: z.lazy(() => marshalTimeWindowSchema).optional(),
1242
+ description: z.string().optional(),
1243
+ filterCondition: z.string().optional(),
1244
+ lineageContext: z.lazy(() => marshalLineageContextSchema).optional(),
1245
+ entities: z.array(z.lazy(() => marshalEntityColumnSchema)).optional(),
1246
+ timeseriesColumn: z.lazy(() => marshalTimeseriesColumnSchema).optional(),
1247
+ catalogName: z.string().optional(),
1248
+ schemaName: z.string().optional(),
1249
+ name: z.string().optional(),
1250
+ createdAt: z
1251
+ .any()
1252
+ .transform((d) => d.toString())
1253
+ .optional(),
1254
+ createdBy: z.string().optional(),
1255
+ })
1256
+ .transform(d => ({
1257
+ full_name: d.fullName,
1258
+ source: d.source,
1259
+ inputs: d.inputs,
1260
+ function: d.function,
1261
+ time_window: d.timeWindow,
1262
+ description: d.description,
1263
+ filter_condition: d.filterCondition,
1264
+ lineage_context: d.lineageContext,
1265
+ entities: d.entities,
1266
+ timeseries_column: d.timeseriesColumn,
1267
+ catalog_name: d.catalogName,
1268
+ schema_name: d.schemaName,
1269
+ name: d.name,
1270
+ created_at: d.createdAt,
1271
+ created_by: d.createdBy,
1272
+ }));
1273
+ export const marshalFieldDefinitionSchema = z
1274
+ .object({
1275
+ name: z.string().optional(),
1276
+ dataType: z.enum(ScalarDataType).optional(),
1277
+ })
1278
+ .transform(d => ({
1279
+ name: d.name,
1280
+ data_type: d.dataType,
1281
+ }));
1282
+ export const marshalFirstFunctionSchema = z
1283
+ .object({
1284
+ input: z.string().optional(),
1285
+ })
1286
+ .transform(d => ({
1287
+ input: d.input,
1288
+ }));
1289
+ export const marshalFlatSchemaSchema = z
1290
+ .object({
1291
+ fields: z.array(z.lazy(() => marshalFieldDefinitionSchema)).optional(),
1292
+ })
1293
+ .transform(d => ({
1294
+ fields: d.fields,
1295
+ }));
1296
+ export const marshalFunctionSchema = z
1297
+ .object({
1298
+ functionType: z.enum(Function_FunctionType).optional(),
1299
+ extraParameters: z
1300
+ .array(z.lazy(() => marshalFunction_ExtraParameterSchema))
1301
+ .optional(),
1302
+ function: z
1303
+ .discriminatedUnion('$case', [
1304
+ z.object({
1305
+ $case: z.literal('aggregationFunction'),
1306
+ aggregationFunction: z.lazy(() => marshalAggregationFunctionSchema),
1307
+ }),
1308
+ z.object({
1309
+ $case: z.literal('columnSelection'),
1310
+ columnSelection: z.lazy(() => marshalColumnSelectionSchema),
1311
+ }),
1312
+ ])
1313
+ .optional(),
1314
+ })
1315
+ .transform(d => ({
1316
+ function_type: d.functionType,
1317
+ extra_parameters: d.extraParameters,
1318
+ ...(d.function?.$case === 'aggregationFunction' && {
1319
+ aggregation_function: d.function.aggregationFunction,
1320
+ }),
1321
+ ...(d.function?.$case === 'columnSelection' && {
1322
+ column_selection: d.function.columnSelection,
1323
+ }),
1324
+ }));
1325
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
1326
+ export const marshalFunction_ExtraParameterSchema = z
1327
+ .object({
1328
+ key: z.string().optional(),
1329
+ value: z.string().optional(),
1330
+ })
1331
+ .transform(d => ({
1332
+ key: d.key,
1333
+ value: d.value,
1334
+ }));
1335
+ export const marshalIngestionConfigSchema = z
1336
+ .object({
1337
+ ingestionDestination: z
1338
+ .lazy(() => marshalIngestionDestinationSchema)
1339
+ .optional(),
1340
+ backfillSource: z.lazy(() => marshalBackfillSourceSchema).optional(),
1341
+ deduplicationColumns: z.array(z.string()).optional(),
1342
+ ingestionPipelineId: z.string().optional(),
1343
+ ingestionJobId: z.bigint().optional(),
1344
+ backfillJobId: z.bigint().optional(),
1345
+ })
1346
+ .transform(d => ({
1347
+ ingestion_destination: d.ingestionDestination,
1348
+ backfill_source: d.backfillSource,
1349
+ deduplication_columns: d.deduplicationColumns,
1350
+ ingestion_pipeline_id: d.ingestionPipelineId,
1351
+ ingestion_job_id: d.ingestionJobId,
1352
+ backfill_job_id: d.backfillJobId,
1353
+ }));
1354
+ export const marshalIngestionDestinationSchema = z
1355
+ .object({
1356
+ ingestionDestination: z
1357
+ .discriminatedUnion('$case', [
1358
+ z.object({
1359
+ $case: z.literal('deltaTableName'),
1360
+ deltaTableName: z.string(),
1361
+ }),
1362
+ ])
1363
+ .optional(),
1364
+ })
1365
+ .transform(d => ({
1366
+ ...(d.ingestionDestination?.$case === 'deltaTableName' && {
1367
+ delta_table_name: d.ingestionDestination.deltaTableName,
1368
+ }),
1369
+ }));
1370
+ export const marshalJobContextSchema = z
1371
+ .object({
1372
+ jobId: z.bigint().optional(),
1373
+ jobRunId: z.bigint().optional(),
1374
+ })
1375
+ .transform(d => ({
1376
+ job_id: d.jobId,
1377
+ job_run_id: d.jobRunId,
1378
+ }));
1379
+ export const marshalKafkaConfigSchema = z
1380
+ .object({
1381
+ name: z.string().optional(),
1382
+ bootstrapServers: z.string().optional(),
1383
+ subscriptionMode: z.lazy(() => marshalSubscriptionModeSchema).optional(),
1384
+ authConfig: z.lazy(() => marshalAuthConfigSchema).optional(),
1385
+ keySchema: z.lazy(() => marshalSchemaConfigSchema).optional(),
1386
+ valueSchema: z.lazy(() => marshalSchemaConfigSchema).optional(),
1387
+ extraOptions: z.record(z.string(), z.string()).optional(),
1388
+ backfillSource: z.lazy(() => marshalBackfillSourceSchema).optional(),
1389
+ })
1390
+ .transform(d => ({
1391
+ name: d.name,
1392
+ bootstrap_servers: d.bootstrapServers,
1393
+ subscription_mode: d.subscriptionMode,
1394
+ auth_config: d.authConfig,
1395
+ key_schema: d.keySchema,
1396
+ value_schema: d.valueSchema,
1397
+ extra_options: d.extraOptions,
1398
+ backfill_source: d.backfillSource,
1399
+ }));
1400
+ export const marshalKafkaSourceSchema = z
1401
+ .object({
1402
+ name: z.string().optional(),
1403
+ entityColumnIdentifiers: z
1404
+ .array(z.lazy(() => marshalColumnIdentifierSchema))
1405
+ .optional(),
1406
+ timeseriesColumnIdentifier: z
1407
+ .lazy(() => marshalColumnIdentifierSchema)
1408
+ .optional(),
1409
+ filterCondition: z.string().optional(),
1410
+ })
1411
+ .transform(d => ({
1412
+ name: d.name,
1413
+ entity_column_identifiers: d.entityColumnIdentifiers,
1414
+ timeseries_column_identifier: d.timeseriesColumnIdentifier,
1415
+ filter_condition: d.filterCondition,
1416
+ }));
1417
+ export const marshalKafkaStreamConfigSchema = z
1418
+ .object({
1419
+ subscriptionMode: z
1420
+ .lazy(() => marshalKafkaSubscriptionModeSchema)
1421
+ .optional(),
1422
+ extraOptions: z.record(z.string(), z.string()).optional(),
1423
+ })
1424
+ .transform(d => ({
1425
+ subscription_mode: d.subscriptionMode,
1426
+ extra_options: d.extraOptions,
1427
+ }));
1428
+ export const marshalKafkaSubscriptionModeSchema = z
1429
+ .object({
1430
+ subscriptionMode: z
1431
+ .discriminatedUnion('$case', [
1432
+ z.object({ $case: z.literal('assign'), assign: z.string() }),
1433
+ z.object({ $case: z.literal('subscribe'), subscribe: z.string() }),
1434
+ z.object({
1435
+ $case: z.literal('subscribePattern'),
1436
+ subscribePattern: z.string(),
1437
+ }),
1438
+ ])
1439
+ .optional(),
1440
+ })
1441
+ .transform(d => ({
1442
+ ...(d.subscriptionMode?.$case === 'assign' && {
1443
+ assign: d.subscriptionMode.assign,
1444
+ }),
1445
+ ...(d.subscriptionMode?.$case === 'subscribe' && {
1446
+ subscribe: d.subscriptionMode.subscribe,
1447
+ }),
1448
+ ...(d.subscriptionMode?.$case === 'subscribePattern' && {
1449
+ subscribe_pattern: d.subscriptionMode.subscribePattern,
1450
+ }),
1451
+ }));
1452
+ export const marshalLastFunctionSchema = z
1453
+ .object({
1454
+ input: z.string().optional(),
1455
+ })
1456
+ .transform(d => ({
1457
+ input: d.input,
1458
+ }));
1459
+ export const marshalLineageContextSchema = z
1460
+ .object({
1461
+ notebookId: z.bigint().optional(),
1462
+ jobContext: z.lazy(() => marshalJobContextSchema).optional(),
1463
+ })
1464
+ .transform(d => ({
1465
+ notebook_id: d.notebookId,
1466
+ job_context: d.jobContext,
1467
+ }));
1468
+ export const marshalMaterializedFeatureSchema = z
1469
+ .object({
1470
+ materializedFeatureId: z.string().optional(),
1471
+ featureName: z.string().optional(),
1472
+ destination: z
1473
+ .discriminatedUnion('$case', [
1474
+ z.object({
1475
+ $case: z.literal('offlineStoreConfig'),
1476
+ offlineStoreConfig: z.lazy(() => marshalOfflineStoreConfigSchema),
1477
+ }),
1478
+ z.object({
1479
+ $case: z.literal('onlineStoreConfig'),
1480
+ onlineStoreConfig: z.lazy(() => marshalOnlineStoreConfigSchema),
1481
+ }),
1482
+ ])
1483
+ .optional(),
1484
+ tableName: z.string().optional(),
1485
+ pipelineScheduleState: z
1486
+ .enum(MaterializedFeature_PipelineScheduleState)
1487
+ .optional(),
1488
+ lastMaterializationTime: z
1489
+ .any()
1490
+ .transform((d) => d.toString())
1491
+ .optional(),
1492
+ cronSchedule: z.string().optional(),
1493
+ isOnline: z.boolean().optional(),
1494
+ trigger: z
1495
+ .discriminatedUnion('$case', [
1496
+ z.object({
1497
+ $case: z.literal('cronScheduleTrigger'),
1498
+ cronScheduleTrigger: z.lazy(() => marshalCronScheduleSchema),
1499
+ }),
1500
+ z.object({
1501
+ $case: z.literal('tableTrigger'),
1502
+ tableTrigger: z.lazy(() => marshalTableTriggerSchema),
1503
+ }),
1504
+ z.object({
1505
+ $case: z.literal('streamingMode'),
1506
+ streamingMode: z.lazy(() => marshalStreamingModeSchema),
1507
+ }),
1508
+ ])
1509
+ .optional(),
1510
+ })
1511
+ .transform(d => ({
1512
+ materialized_feature_id: d.materializedFeatureId,
1513
+ feature_name: d.featureName,
1514
+ ...(d.destination?.$case === 'offlineStoreConfig' && {
1515
+ offline_store_config: d.destination.offlineStoreConfig,
1516
+ }),
1517
+ ...(d.destination?.$case === 'onlineStoreConfig' && {
1518
+ online_store_config: d.destination.onlineStoreConfig,
1519
+ }),
1520
+ table_name: d.tableName,
1521
+ pipeline_schedule_state: d.pipelineScheduleState,
1522
+ last_materialization_time: d.lastMaterializationTime,
1523
+ cron_schedule: d.cronSchedule,
1524
+ is_online: d.isOnline,
1525
+ ...(d.trigger?.$case === 'cronScheduleTrigger' && {
1526
+ cron_schedule_trigger: d.trigger.cronScheduleTrigger,
1527
+ }),
1528
+ ...(d.trigger?.$case === 'tableTrigger' && {
1529
+ table_trigger: d.trigger.tableTrigger,
1530
+ }),
1531
+ ...(d.trigger?.$case === 'streamingMode' && {
1532
+ streaming_mode: d.trigger.streamingMode,
1533
+ }),
1534
+ }));
1535
+ export const marshalMaxFunctionSchema = z
1536
+ .object({
1537
+ input: z.string().optional(),
1538
+ })
1539
+ .transform(d => ({
1540
+ input: d.input,
1541
+ }));
1542
+ export const marshalMinFunctionSchema = z
1543
+ .object({
1544
+ input: z.string().optional(),
1545
+ })
1546
+ .transform(d => ({
1547
+ input: d.input,
1548
+ }));
1549
+ export const marshalMtlsConfigSchema = z
1550
+ .object({
1551
+ keystoreLocation: z.string().optional(),
1552
+ keystorePasswordRef: z
1553
+ .lazy(() => marshalSecretScopeReferenceSchema)
1554
+ .optional(),
1555
+ keyPasswordRef: z.lazy(() => marshalSecretScopeReferenceSchema).optional(),
1556
+ truststoreLocation: z.string().optional(),
1557
+ truststorePasswordRef: z
1558
+ .lazy(() => marshalSecretScopeReferenceSchema)
1559
+ .optional(),
1560
+ disableHostnameVerification: z.boolean().optional(),
1561
+ })
1562
+ .transform(d => ({
1563
+ keystore_location: d.keystoreLocation,
1564
+ keystore_password_ref: d.keystorePasswordRef,
1565
+ key_password_ref: d.keyPasswordRef,
1566
+ truststore_location: d.truststoreLocation,
1567
+ truststore_password_ref: d.truststorePasswordRef,
1568
+ disable_hostname_verification: d.disableHostnameVerification,
1569
+ }));
1570
+ export const marshalOfflineStoreConfigSchema = z
1571
+ .object({
1572
+ catalogName: z.string().optional(),
1573
+ schemaName: z.string().optional(),
1574
+ tableNamePrefix: z.string().optional(),
1575
+ })
1576
+ .transform(d => ({
1577
+ catalog_name: d.catalogName,
1578
+ schema_name: d.schemaName,
1579
+ table_name_prefix: d.tableNamePrefix,
1580
+ }));
1581
+ export const marshalOnlineStoreConfigSchema = z
1582
+ .object({
1583
+ catalogName: z.string().optional(),
1584
+ schemaName: z.string().optional(),
1585
+ tableNamePrefix: z.string().optional(),
1586
+ onlineStoreName: z.string().optional(),
1587
+ })
1588
+ .transform(d => ({
1589
+ catalog_name: d.catalogName,
1590
+ schema_name: d.schemaName,
1591
+ table_name_prefix: d.tableNamePrefix,
1592
+ online_store_name: d.onlineStoreName,
1593
+ }));
1594
+ export const marshalRequestSourceSchema = z
1595
+ .object({
1596
+ schema: z
1597
+ .discriminatedUnion('$case', [
1598
+ z.object({
1599
+ $case: z.literal('flatSchema'),
1600
+ flatSchema: z.lazy(() => marshalFlatSchemaSchema),
1601
+ }),
1602
+ ])
1603
+ .optional(),
1604
+ })
1605
+ .transform(d => ({
1606
+ ...(d.schema?.$case === 'flatSchema' && { flat_schema: d.schema.flatSchema }),
1607
+ }));
1608
+ export const marshalRollingWindowSchema = z
1609
+ .object({
1610
+ windowDuration: z
1611
+ .any()
1612
+ .transform((d) => d.toString().slice(2).toLowerCase())
1613
+ .optional(),
1614
+ delay: z
1615
+ .any()
1616
+ .transform((d) => d.toString().slice(2).toLowerCase())
1617
+ .optional(),
1618
+ })
1619
+ .transform(d => ({
1620
+ window_duration: d.windowDuration,
1621
+ delay: d.delay,
1622
+ }));
1623
+ export const marshalSchemaConfigSchema = z
1624
+ .object({
1625
+ schema: z
1626
+ .discriminatedUnion('$case', [
1627
+ z.object({ $case: z.literal('jsonSchema'), jsonSchema: z.string() }),
1628
+ ])
1629
+ .optional(),
1630
+ })
1631
+ .transform(d => ({
1632
+ ...(d.schema?.$case === 'jsonSchema' && { json_schema: d.schema.jsonSchema }),
1633
+ }));
1634
+ export const marshalSecretScopeReferenceSchema = z
1635
+ .object({
1636
+ scope: z.string().optional(),
1637
+ key: z.string().optional(),
1638
+ })
1639
+ .transform(d => ({
1640
+ scope: d.scope,
1641
+ key: d.key,
1642
+ }));
1643
+ export const marshalSlidingWindowSchema = z
1644
+ .object({
1645
+ windowDuration: z
1646
+ .any()
1647
+ .transform((d) => d.toString().slice(2).toLowerCase())
1648
+ .optional(),
1649
+ slideDuration: z
1650
+ .any()
1651
+ .transform((d) => d.toString().slice(2).toLowerCase())
1652
+ .optional(),
1653
+ })
1654
+ .transform(d => ({
1655
+ window_duration: d.windowDuration,
1656
+ slide_duration: d.slideDuration,
1657
+ }));
1658
+ export const marshalStddevPopFunctionSchema = z
1659
+ .object({
1660
+ input: z.string().optional(),
1661
+ })
1662
+ .transform(d => ({
1663
+ input: d.input,
1664
+ }));
1665
+ export const marshalStddevSampFunctionSchema = z
1666
+ .object({
1667
+ input: z.string().optional(),
1668
+ })
1669
+ .transform(d => ({
1670
+ input: d.input,
1671
+ }));
1672
+ export const marshalStreamSchema = z
1673
+ .object({
1674
+ name: z.string().optional(),
1675
+ description: z.string().optional(),
1676
+ sourceConfig: z.lazy(() => marshalStreamSourceConfigSchema).optional(),
1677
+ connectionConfig: z
1678
+ .lazy(() => marshalStreamConnectionConfigSchema)
1679
+ .optional(),
1680
+ schemaConfig: z.lazy(() => marshalStreamSchemaConfigSchema).optional(),
1681
+ ingestionConfig: z.lazy(() => marshalIngestionConfigSchema).optional(),
1682
+ createTime: z
1683
+ .any()
1684
+ .transform((d) => d.toString())
1685
+ .optional(),
1686
+ createdBy: z.string().optional(),
1687
+ updateTime: z
1688
+ .any()
1689
+ .transform((d) => d.toString())
1690
+ .optional(),
1691
+ updatedBy: z.string().optional(),
1692
+ browseOnly: z.boolean().optional(),
1693
+ })
1694
+ .transform(d => ({
1695
+ name: d.name,
1696
+ description: d.description,
1697
+ source_config: d.sourceConfig,
1698
+ connection_config: d.connectionConfig,
1699
+ schema_config: d.schemaConfig,
1700
+ ingestion_config: d.ingestionConfig,
1701
+ create_time: d.createTime,
1702
+ created_by: d.createdBy,
1703
+ update_time: d.updateTime,
1704
+ updated_by: d.updatedBy,
1705
+ browse_only: d.browseOnly,
1706
+ }));
1707
+ export const marshalStreamConnectionConfigSchema = z
1708
+ .object({
1709
+ connectionConfig: z
1710
+ .discriminatedUnion('$case', [
1711
+ z.object({
1712
+ $case: z.literal('ucConnectionName'),
1713
+ ucConnectionName: z.string(),
1714
+ }),
1715
+ z.object({
1716
+ $case: z.literal('directMtlsConfig'),
1717
+ directMtlsConfig: z.lazy(() => marshalDirectMtlsConfigSchema),
1718
+ }),
1719
+ ])
1720
+ .optional(),
1721
+ })
1722
+ .transform(d => ({
1723
+ ...(d.connectionConfig?.$case === 'ucConnectionName' && {
1724
+ uc_connection_name: d.connectionConfig.ucConnectionName,
1725
+ }),
1726
+ ...(d.connectionConfig?.$case === 'directMtlsConfig' && {
1727
+ direct_mtls_config: d.connectionConfig.directMtlsConfig,
1728
+ }),
1729
+ }));
1730
+ export const marshalStreamSchemaConfigSchema = z
1731
+ .object({
1732
+ schemaConfig: z
1733
+ .discriminatedUnion('$case', [
1734
+ z.object({
1735
+ $case: z.literal('directSchemas'),
1736
+ directSchemas: z.lazy(() => marshalDirectSchemasSchema),
1737
+ }),
1738
+ ])
1739
+ .optional(),
1740
+ })
1741
+ .transform(d => ({
1742
+ ...(d.schemaConfig?.$case === 'directSchemas' && {
1743
+ direct_schemas: d.schemaConfig.directSchemas,
1744
+ }),
1745
+ }));
1746
+ export const marshalStreamSourceConfigSchema = z
1747
+ .object({
1748
+ sourceConfig: z
1749
+ .discriminatedUnion('$case', [
1750
+ z.object({
1751
+ $case: z.literal('kafkaStreamConfig'),
1752
+ kafkaStreamConfig: z.lazy(() => marshalKafkaStreamConfigSchema),
1753
+ }),
1754
+ ])
1755
+ .optional(),
1756
+ })
1757
+ .transform(d => ({
1758
+ ...(d.sourceConfig?.$case === 'kafkaStreamConfig' && {
1759
+ kafka_stream_config: d.sourceConfig.kafkaStreamConfig,
1760
+ }),
1761
+ }));
1762
+ export const marshalStreamingModeSchema = z
1763
+ .object({
1764
+ mode: z.enum(StreamingMode_StreamingModeType).optional(),
1765
+ })
1766
+ .transform(d => ({
1767
+ mode: d.mode,
1768
+ }));
1769
+ export const marshalSubscriptionModeSchema = z
1770
+ .object({
1771
+ subscriptionMode: z
1772
+ .discriminatedUnion('$case', [
1773
+ z.object({ $case: z.literal('assign'), assign: z.string() }),
1774
+ z.object({ $case: z.literal('subscribe'), subscribe: z.string() }),
1775
+ z.object({
1776
+ $case: z.literal('subscribePattern'),
1777
+ subscribePattern: z.string(),
1778
+ }),
1779
+ ])
1780
+ .optional(),
1781
+ })
1782
+ .transform(d => ({
1783
+ ...(d.subscriptionMode?.$case === 'assign' && {
1784
+ assign: d.subscriptionMode.assign,
1785
+ }),
1786
+ ...(d.subscriptionMode?.$case === 'subscribe' && {
1787
+ subscribe: d.subscriptionMode.subscribe,
1788
+ }),
1789
+ ...(d.subscriptionMode?.$case === 'subscribePattern' && {
1790
+ subscribe_pattern: d.subscriptionMode.subscribePattern,
1791
+ }),
1792
+ }));
1793
+ export const marshalSumFunctionSchema = z
1794
+ .object({
1795
+ input: z.string().optional(),
1796
+ })
1797
+ .transform(d => ({
1798
+ input: d.input,
1799
+ }));
1800
+ export const marshalTableTriggerSchema = z.object({});
1801
+ export const marshalTimeWindowSchema = z
1802
+ .object({
1803
+ windowType: z
1804
+ .discriminatedUnion('$case', [
1805
+ z.object({
1806
+ $case: z.literal('continuous'),
1807
+ continuous: z.lazy(() => marshalContinuousWindowSchema),
1808
+ }),
1809
+ z.object({
1810
+ $case: z.literal('tumbling'),
1811
+ tumbling: z.lazy(() => marshalTumblingWindowSchema),
1812
+ }),
1813
+ z.object({
1814
+ $case: z.literal('sliding'),
1815
+ sliding: z.lazy(() => marshalSlidingWindowSchema),
1816
+ }),
1817
+ z.object({
1818
+ $case: z.literal('rolling'),
1819
+ rolling: z.lazy(() => marshalRollingWindowSchema),
1820
+ }),
1821
+ ])
1822
+ .optional(),
1823
+ })
1824
+ .transform(d => ({
1825
+ ...(d.windowType?.$case === 'continuous' && {
1826
+ continuous: d.windowType.continuous,
1827
+ }),
1828
+ ...(d.windowType?.$case === 'tumbling' && {
1829
+ tumbling: d.windowType.tumbling,
1830
+ }),
1831
+ ...(d.windowType?.$case === 'sliding' && { sliding: d.windowType.sliding }),
1832
+ ...(d.windowType?.$case === 'rolling' && { rolling: d.windowType.rolling }),
1833
+ }));
1834
+ export const marshalTimeseriesColumnSchema = z
1835
+ .object({
1836
+ name: z.string().optional(),
1837
+ })
1838
+ .transform(d => ({
1839
+ name: d.name,
1840
+ }));
1841
+ export const marshalTumblingWindowSchema = z
1842
+ .object({
1843
+ windowDuration: z
1844
+ .any()
1845
+ .transform((d) => d.toString().slice(2).toLowerCase())
1846
+ .optional(),
1847
+ })
1848
+ .transform(d => ({
1849
+ window_duration: d.windowDuration,
1850
+ }));
1851
+ export const marshalVarPopFunctionSchema = z
1852
+ .object({
1853
+ input: z.string().optional(),
1854
+ })
1855
+ .transform(d => ({
1856
+ input: d.input,
1857
+ }));
1858
+ export const marshalVarSampFunctionSchema = z
1859
+ .object({
1860
+ input: z.string().optional(),
1861
+ })
1862
+ .transform(d => ({
1863
+ input: d.input,
1864
+ }));
1865
+ const aggregationFunctionFieldMaskSchema = {
1866
+ approxCountDistinct: {
1867
+ wire: 'approx_count_distinct',
1868
+ children: () => approxCountDistinctFunctionFieldMaskSchema,
1869
+ },
1870
+ approxPercentile: {
1871
+ wire: 'approx_percentile',
1872
+ children: () => approxPercentileFunctionFieldMaskSchema,
1873
+ },
1874
+ avg: { wire: 'avg', children: () => avgFunctionFieldMaskSchema },
1875
+ countFunction: {
1876
+ wire: 'count_function',
1877
+ children: () => countFunctionFieldMaskSchema,
1878
+ },
1879
+ first: { wire: 'first', children: () => firstFunctionFieldMaskSchema },
1880
+ last: { wire: 'last', children: () => lastFunctionFieldMaskSchema },
1881
+ max: { wire: 'max', children: () => maxFunctionFieldMaskSchema },
1882
+ min: { wire: 'min', children: () => minFunctionFieldMaskSchema },
1883
+ stddevPop: {
1884
+ wire: 'stddev_pop',
1885
+ children: () => stddevPopFunctionFieldMaskSchema,
1886
+ },
1887
+ stddevSamp: {
1888
+ wire: 'stddev_samp',
1889
+ children: () => stddevSampFunctionFieldMaskSchema,
1890
+ },
1891
+ sum: { wire: 'sum', children: () => sumFunctionFieldMaskSchema },
1892
+ timeWindow: { wire: 'time_window', children: () => timeWindowFieldMaskSchema },
1893
+ varPop: { wire: 'var_pop', children: () => varPopFunctionFieldMaskSchema },
1894
+ varSamp: { wire: 'var_samp', children: () => varSampFunctionFieldMaskSchema },
1895
+ };
1896
+ const approxCountDistinctFunctionFieldMaskSchema = {
1897
+ input: { wire: 'input' },
1898
+ relativeSd: { wire: 'relative_sd' },
1899
+ };
1900
+ const approxPercentileFunctionFieldMaskSchema = {
1901
+ accuracy: { wire: 'accuracy' },
1902
+ input: { wire: 'input' },
1903
+ percentile: { wire: 'percentile' },
1904
+ };
1905
+ const authConfigFieldMaskSchema = {
1906
+ mtlsConfig: { wire: 'mtls_config', children: () => mtlsConfigFieldMaskSchema },
1907
+ ucServiceCredentialName: { wire: 'uc_service_credential_name' },
1908
+ };
1909
+ const avgFunctionFieldMaskSchema = {
1910
+ input: { wire: 'input' },
1911
+ };
1912
+ const backfillSourceFieldMaskSchema = {
1913
+ deltaTableName: { wire: 'delta_table_name' },
1914
+ deltaTableSource: {
1915
+ wire: 'delta_table_source',
1916
+ children: () => deltaTableSourceFieldMaskSchema,
1917
+ },
1918
+ };
1919
+ const columnIdentifierFieldMaskSchema = {
1920
+ variantExprPath: { wire: 'variant_expr_path' },
1921
+ };
1922
+ const columnSelectionFieldMaskSchema = {
1923
+ column: { wire: 'column' },
1924
+ };
1925
+ const continuousWindowFieldMaskSchema = {
1926
+ offset: { wire: 'offset' },
1927
+ windowDuration: { wire: 'window_duration' },
1928
+ };
1929
+ const countFunctionFieldMaskSchema = {
1930
+ input: { wire: 'input' },
1931
+ };
1932
+ const cronScheduleFieldMaskSchema = {
1933
+ cronExpression: { wire: 'cron_expression' },
1934
+ };
1935
+ const dataSourceFieldMaskSchema = {
1936
+ deltaTableSource: {
1937
+ wire: 'delta_table_source',
1938
+ children: () => deltaTableSourceFieldMaskSchema,
1939
+ },
1940
+ kafkaSource: {
1941
+ wire: 'kafka_source',
1942
+ children: () => kafkaSourceFieldMaskSchema,
1943
+ },
1944
+ requestSource: {
1945
+ wire: 'request_source',
1946
+ children: () => requestSourceFieldMaskSchema,
1947
+ },
1948
+ };
1949
+ const deltaTableSourceFieldMaskSchema = {
1950
+ dataframeSchema: { wire: 'dataframe_schema' },
1951
+ entityColumns: { wire: 'entity_columns' },
1952
+ filterCondition: { wire: 'filter_condition' },
1953
+ fullName: { wire: 'full_name' },
1954
+ timeseriesColumn: { wire: 'timeseries_column' },
1955
+ transformationSql: { wire: 'transformation_sql' },
1956
+ };
1957
+ const directMtlsConfigFieldMaskSchema = {
1958
+ bootstrapServers: { wire: 'bootstrap_servers' },
1959
+ mtlsConfig: { wire: 'mtls_config', children: () => mtlsConfigFieldMaskSchema },
1960
+ };
1961
+ const directSchemasFieldMaskSchema = {
1962
+ keySchema: { wire: 'key_schema', children: () => schemaConfigFieldMaskSchema },
1963
+ payloadSchema: {
1964
+ wire: 'payload_schema',
1965
+ children: () => schemaConfigFieldMaskSchema,
1966
+ },
1967
+ };
1968
+ const featureFieldMaskSchema = {
1969
+ catalogName: { wire: 'catalog_name' },
1970
+ createdAt: { wire: 'created_at' },
1971
+ createdBy: { wire: 'created_by' },
1972
+ description: { wire: 'description' },
1973
+ entities: { wire: 'entities' },
1974
+ filterCondition: { wire: 'filter_condition' },
1975
+ fullName: { wire: 'full_name' },
1976
+ function: { wire: 'function', children: () => functionFieldMaskSchema },
1977
+ inputs: { wire: 'inputs' },
1978
+ lineageContext: {
1979
+ wire: 'lineage_context',
1980
+ children: () => lineageContextFieldMaskSchema,
1981
+ },
1982
+ name: { wire: 'name' },
1983
+ schemaName: { wire: 'schema_name' },
1984
+ source: { wire: 'source', children: () => dataSourceFieldMaskSchema },
1985
+ timeWindow: { wire: 'time_window', children: () => timeWindowFieldMaskSchema },
1986
+ timeseriesColumn: {
1987
+ wire: 'timeseries_column',
1988
+ children: () => timeseriesColumnFieldMaskSchema,
1989
+ },
1990
+ };
1991
+ export function featureFieldMask(...paths) {
1992
+ return FieldMask.build(paths, featureFieldMaskSchema);
1993
+ }
1994
+ const firstFunctionFieldMaskSchema = {
1995
+ input: { wire: 'input' },
1996
+ };
1997
+ const flatSchemaFieldMaskSchema = {
1998
+ fields: { wire: 'fields' },
1999
+ };
2000
+ const functionFieldMaskSchema = {
2001
+ aggregationFunction: {
2002
+ wire: 'aggregation_function',
2003
+ children: () => aggregationFunctionFieldMaskSchema,
2004
+ },
2005
+ columnSelection: {
2006
+ wire: 'column_selection',
2007
+ children: () => columnSelectionFieldMaskSchema,
2008
+ },
2009
+ extraParameters: { wire: 'extra_parameters' },
2010
+ functionType: { wire: 'function_type' },
2011
+ };
2012
+ const ingestionConfigFieldMaskSchema = {
2013
+ backfillJobId: { wire: 'backfill_job_id' },
2014
+ backfillSource: {
2015
+ wire: 'backfill_source',
2016
+ children: () => backfillSourceFieldMaskSchema,
2017
+ },
2018
+ deduplicationColumns: { wire: 'deduplication_columns' },
2019
+ ingestionDestination: {
2020
+ wire: 'ingestion_destination',
2021
+ children: () => ingestionDestinationFieldMaskSchema,
2022
+ },
2023
+ ingestionJobId: { wire: 'ingestion_job_id' },
2024
+ ingestionPipelineId: { wire: 'ingestion_pipeline_id' },
2025
+ };
2026
+ const ingestionDestinationFieldMaskSchema = {
2027
+ deltaTableName: { wire: 'delta_table_name' },
2028
+ };
2029
+ const jobContextFieldMaskSchema = {
2030
+ jobId: { wire: 'job_id' },
2031
+ jobRunId: { wire: 'job_run_id' },
2032
+ };
2033
+ const kafkaConfigFieldMaskSchema = {
2034
+ authConfig: { wire: 'auth_config', children: () => authConfigFieldMaskSchema },
2035
+ backfillSource: {
2036
+ wire: 'backfill_source',
2037
+ children: () => backfillSourceFieldMaskSchema,
2038
+ },
2039
+ bootstrapServers: { wire: 'bootstrap_servers' },
2040
+ extraOptions: { wire: 'extra_options' },
2041
+ keySchema: { wire: 'key_schema', children: () => schemaConfigFieldMaskSchema },
2042
+ name: { wire: 'name' },
2043
+ subscriptionMode: {
2044
+ wire: 'subscription_mode',
2045
+ children: () => subscriptionModeFieldMaskSchema,
2046
+ },
2047
+ valueSchema: {
2048
+ wire: 'value_schema',
2049
+ children: () => schemaConfigFieldMaskSchema,
2050
+ },
2051
+ };
2052
+ export function kafkaConfigFieldMask(...paths) {
2053
+ return FieldMask.build(paths, kafkaConfigFieldMaskSchema);
2054
+ }
2055
+ const kafkaSourceFieldMaskSchema = {
2056
+ entityColumnIdentifiers: { wire: 'entity_column_identifiers' },
2057
+ filterCondition: { wire: 'filter_condition' },
2058
+ name: { wire: 'name' },
2059
+ timeseriesColumnIdentifier: {
2060
+ wire: 'timeseries_column_identifier',
2061
+ children: () => columnIdentifierFieldMaskSchema,
2062
+ },
2063
+ };
2064
+ const kafkaStreamConfigFieldMaskSchema = {
2065
+ extraOptions: { wire: 'extra_options' },
2066
+ subscriptionMode: {
2067
+ wire: 'subscription_mode',
2068
+ children: () => kafkaSubscriptionModeFieldMaskSchema,
2069
+ },
2070
+ };
2071
+ const kafkaSubscriptionModeFieldMaskSchema = {
2072
+ assign: { wire: 'assign' },
2073
+ subscribe: { wire: 'subscribe' },
2074
+ subscribePattern: { wire: 'subscribe_pattern' },
2075
+ };
2076
+ const lastFunctionFieldMaskSchema = {
2077
+ input: { wire: 'input' },
2078
+ };
2079
+ const lineageContextFieldMaskSchema = {
2080
+ jobContext: { wire: 'job_context', children: () => jobContextFieldMaskSchema },
2081
+ notebookId: { wire: 'notebook_id' },
2082
+ };
2083
+ const materializedFeatureFieldMaskSchema = {
2084
+ cronSchedule: { wire: 'cron_schedule' },
2085
+ cronScheduleTrigger: {
2086
+ wire: 'cron_schedule_trigger',
2087
+ children: () => cronScheduleFieldMaskSchema,
2088
+ },
2089
+ featureName: { wire: 'feature_name' },
2090
+ isOnline: { wire: 'is_online' },
2091
+ lastMaterializationTime: { wire: 'last_materialization_time' },
2092
+ materializedFeatureId: { wire: 'materialized_feature_id' },
2093
+ offlineStoreConfig: {
2094
+ wire: 'offline_store_config',
2095
+ children: () => offlineStoreConfigFieldMaskSchema,
2096
+ },
2097
+ onlineStoreConfig: {
2098
+ wire: 'online_store_config',
2099
+ children: () => onlineStoreConfigFieldMaskSchema,
2100
+ },
2101
+ pipelineScheduleState: { wire: 'pipeline_schedule_state' },
2102
+ streamingMode: {
2103
+ wire: 'streaming_mode',
2104
+ children: () => streamingModeFieldMaskSchema,
2105
+ },
2106
+ tableName: { wire: 'table_name' },
2107
+ tableTrigger: {
2108
+ wire: 'table_trigger',
2109
+ children: () => tableTriggerFieldMaskSchema,
2110
+ },
2111
+ };
2112
+ export function materializedFeatureFieldMask(...paths) {
2113
+ return FieldMask.build(paths, materializedFeatureFieldMaskSchema);
2114
+ }
2115
+ const maxFunctionFieldMaskSchema = {
2116
+ input: { wire: 'input' },
2117
+ };
2118
+ const minFunctionFieldMaskSchema = {
2119
+ input: { wire: 'input' },
2120
+ };
2121
+ const mtlsConfigFieldMaskSchema = {
2122
+ disableHostnameVerification: { wire: 'disable_hostname_verification' },
2123
+ keyPasswordRef: {
2124
+ wire: 'key_password_ref',
2125
+ children: () => secretScopeReferenceFieldMaskSchema,
2126
+ },
2127
+ keystoreLocation: { wire: 'keystore_location' },
2128
+ keystorePasswordRef: {
2129
+ wire: 'keystore_password_ref',
2130
+ children: () => secretScopeReferenceFieldMaskSchema,
2131
+ },
2132
+ truststoreLocation: { wire: 'truststore_location' },
2133
+ truststorePasswordRef: {
2134
+ wire: 'truststore_password_ref',
2135
+ children: () => secretScopeReferenceFieldMaskSchema,
2136
+ },
2137
+ };
2138
+ const offlineStoreConfigFieldMaskSchema = {
2139
+ catalogName: { wire: 'catalog_name' },
2140
+ schemaName: { wire: 'schema_name' },
2141
+ tableNamePrefix: { wire: 'table_name_prefix' },
2142
+ };
2143
+ const onlineStoreConfigFieldMaskSchema = {
2144
+ catalogName: { wire: 'catalog_name' },
2145
+ onlineStoreName: { wire: 'online_store_name' },
2146
+ schemaName: { wire: 'schema_name' },
2147
+ tableNamePrefix: { wire: 'table_name_prefix' },
2148
+ };
2149
+ const requestSourceFieldMaskSchema = {
2150
+ flatSchema: { wire: 'flat_schema', children: () => flatSchemaFieldMaskSchema },
2151
+ };
2152
+ const rollingWindowFieldMaskSchema = {
2153
+ delay: { wire: 'delay' },
2154
+ windowDuration: { wire: 'window_duration' },
2155
+ };
2156
+ const schemaConfigFieldMaskSchema = {
2157
+ jsonSchema: { wire: 'json_schema' },
2158
+ };
2159
+ const secretScopeReferenceFieldMaskSchema = {
2160
+ key: { wire: 'key' },
2161
+ scope: { wire: 'scope' },
2162
+ };
2163
+ const slidingWindowFieldMaskSchema = {
2164
+ slideDuration: { wire: 'slide_duration' },
2165
+ windowDuration: { wire: 'window_duration' },
2166
+ };
2167
+ const stddevPopFunctionFieldMaskSchema = {
2168
+ input: { wire: 'input' },
2169
+ };
2170
+ const stddevSampFunctionFieldMaskSchema = {
2171
+ input: { wire: 'input' },
2172
+ };
2173
+ const streamFieldMaskSchema = {
2174
+ browseOnly: { wire: 'browse_only' },
2175
+ connectionConfig: {
2176
+ wire: 'connection_config',
2177
+ children: () => streamConnectionConfigFieldMaskSchema,
2178
+ },
2179
+ createTime: { wire: 'create_time' },
2180
+ createdBy: { wire: 'created_by' },
2181
+ description: { wire: 'description' },
2182
+ ingestionConfig: {
2183
+ wire: 'ingestion_config',
2184
+ children: () => ingestionConfigFieldMaskSchema,
2185
+ },
2186
+ name: { wire: 'name' },
2187
+ schemaConfig: {
2188
+ wire: 'schema_config',
2189
+ children: () => streamSchemaConfigFieldMaskSchema,
2190
+ },
2191
+ sourceConfig: {
2192
+ wire: 'source_config',
2193
+ children: () => streamSourceConfigFieldMaskSchema,
2194
+ },
2195
+ updateTime: { wire: 'update_time' },
2196
+ updatedBy: { wire: 'updated_by' },
2197
+ };
2198
+ export function streamFieldMask(...paths) {
2199
+ return FieldMask.build(paths, streamFieldMaskSchema);
2200
+ }
2201
+ const streamConnectionConfigFieldMaskSchema = {
2202
+ directMtlsConfig: {
2203
+ wire: 'direct_mtls_config',
2204
+ children: () => directMtlsConfigFieldMaskSchema,
2205
+ },
2206
+ ucConnectionName: { wire: 'uc_connection_name' },
2207
+ };
2208
+ const streamSchemaConfigFieldMaskSchema = {
2209
+ directSchemas: {
2210
+ wire: 'direct_schemas',
2211
+ children: () => directSchemasFieldMaskSchema,
2212
+ },
2213
+ };
2214
+ const streamSourceConfigFieldMaskSchema = {
2215
+ kafkaStreamConfig: {
2216
+ wire: 'kafka_stream_config',
2217
+ children: () => kafkaStreamConfigFieldMaskSchema,
2218
+ },
2219
+ };
2220
+ const streamingModeFieldMaskSchema = {
2221
+ mode: { wire: 'mode' },
2222
+ };
2223
+ const subscriptionModeFieldMaskSchema = {
2224
+ assign: { wire: 'assign' },
2225
+ subscribe: { wire: 'subscribe' },
2226
+ subscribePattern: { wire: 'subscribe_pattern' },
2227
+ };
2228
+ const sumFunctionFieldMaskSchema = {
2229
+ input: { wire: 'input' },
2230
+ };
2231
+ const tableTriggerFieldMaskSchema = {};
2232
+ const timeWindowFieldMaskSchema = {
2233
+ continuous: {
2234
+ wire: 'continuous',
2235
+ children: () => continuousWindowFieldMaskSchema,
2236
+ },
2237
+ rolling: { wire: 'rolling', children: () => rollingWindowFieldMaskSchema },
2238
+ sliding: { wire: 'sliding', children: () => slidingWindowFieldMaskSchema },
2239
+ tumbling: { wire: 'tumbling', children: () => tumblingWindowFieldMaskSchema },
2240
+ };
2241
+ const timeseriesColumnFieldMaskSchema = {
2242
+ name: { wire: 'name' },
2243
+ };
2244
+ const tumblingWindowFieldMaskSchema = {
2245
+ windowDuration: { wire: 'window_duration' },
2246
+ };
2247
+ const varPopFunctionFieldMaskSchema = {
2248
+ input: { wire: 'input' },
2249
+ };
2250
+ const varSampFunctionFieldMaskSchema = {
2251
+ input: { wire: 'input' },
2252
+ };
2253
+ //# sourceMappingURL=model.js.map