@databricks/sdk-alerts 0.1.0-dev.2 → 0.1.0-dev.4

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/v2/model.ts DELETED
@@ -1,669 +0,0 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
-
3
- import {Temporal} from '@js-temporal/polyfill';
4
- import {FieldMask} from '@databricks/sdk-core/wkt';
5
- import type {FieldMaskSchema} from '@databricks/sdk-core/wkt';
6
- import {z} from 'zod';
7
-
8
- export enum Aggregation {
9
- SUM = 'SUM',
10
- COUNT = 'COUNT',
11
- COUNT_DISTINCT = 'COUNT_DISTINCT',
12
- AVG = 'AVG',
13
- MEDIAN = 'MEDIAN',
14
- MIN = 'MIN',
15
- MAX = 'MAX',
16
- STDDEV = 'STDDEV',
17
- }
18
-
19
- /**
20
- * UNSPECIFIED - default unspecify value for proto enum, do not use it in the code
21
- * UNKNOWN - alert not yet evaluated
22
- * TRIGGERED - alert is triggered
23
- * OK - alert is not triggered
24
- * ERROR - alert evaluation failed
25
- */
26
- export enum AlertEvaluationState {
27
- /** Deprecated. Please avoid using `UNKNOWN` as empty_result_state. */
28
- UNKNOWN = 'UNKNOWN',
29
- TRIGGERED = 'TRIGGERED',
30
- OK = 'OK',
31
- ERROR = 'ERROR',
32
- }
33
-
34
- export enum AlertLifecycleState {
35
- ACTIVE = 'ACTIVE',
36
- DELETED = 'DELETED',
37
- }
38
-
39
- export enum ComparisonOperator {
40
- LESS_THAN = 'LESS_THAN',
41
- GREATER_THAN = 'GREATER_THAN',
42
- EQUAL = 'EQUAL',
43
- NOT_EQUAL = 'NOT_EQUAL',
44
- GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL',
45
- LESS_THAN_OR_EQUAL = 'LESS_THAN_OR_EQUAL',
46
- IS_NULL = 'IS_NULL',
47
- IS_NOT_NULL = 'IS_NOT_NULL',
48
- }
49
-
50
- export enum SchedulePauseStatus {
51
- UNPAUSED = 'UNPAUSED',
52
- PAUSED = 'PAUSED',
53
- }
54
-
55
- export interface Alert {
56
- /** UUID identifying the alert. */
57
- id?: string | undefined;
58
- /** The display name of the alert. */
59
- displayName?: string | undefined;
60
- /** The owner's username. This field is set to "Unavailable" if the user has been deleted. */
61
- ownerUserName?: string | undefined;
62
- /** The timestamp indicating when the alert was created. */
63
- createTime?: Temporal.Instant | undefined;
64
- /** The timestamp indicating when the alert was updated. */
65
- updateTime?: Temporal.Instant | undefined;
66
- /** The workspace path of the folder containing the alert. Can only be set on create, and cannot be updated. */
67
- parentPath?: string | undefined;
68
- /** Text of the query to be run. */
69
- queryText?: string | undefined;
70
- /** ID of the SQL warehouse attached to the alert. */
71
- warehouseId?: string | undefined;
72
- /**
73
- * The run as username or application ID of service principal.
74
- * On Create and Update, this field can be set to application ID of an active service principal. Setting this field requires the servicePrincipal/user role.
75
- * Deprecated: Use `run_as` field instead. This field will be removed in a future release.
76
- */
77
- runAsUserName?: string | undefined;
78
- evaluation?: AlertEvaluation | undefined;
79
- schedule?: CronSchedule | undefined;
80
- /** Indicates whether the query is trashed. */
81
- lifecycleState?: AlertLifecycleState | undefined;
82
- /** Custom summary for the alert. support mustache template. */
83
- customSummary?: string | undefined;
84
- /** Custom description for the alert. support mustache template. */
85
- customDescription?: string | undefined;
86
- /**
87
- * Specifies the identity that will be used to run the alert.
88
- * This field allows you to configure alerts to run as a specific user or service principal.
89
- * - For user identity: Set `user_name` to the email of an active workspace user. Users can only set this to their own email.
90
- * - For service principal: Set `service_principal_name` to the application ID. Requires the `servicePrincipal/user` role.
91
- * If not specified, the alert will run as the request user.
92
- */
93
- runAs?: AlertRunAs | undefined;
94
- /**
95
- * The actual identity that will be used to execute the alert.
96
- * This is an output-only field that shows the resolved run-as identity after applying
97
- * permissions and defaults.
98
- */
99
- effectiveRunAs?: AlertRunAs | undefined;
100
- }
101
-
102
- export interface AlertEvaluation {
103
- /** Source column from result to use to evaluate alert */
104
- source?: AlertOperandColumn | undefined;
105
- /** Operator used for comparison in alert evaluation. */
106
- comparisonOperator?: ComparisonOperator | undefined;
107
- /** Threshold to user for alert evaluation, can be a column or a value. */
108
- threshold?: AlertOperand | undefined;
109
- /** User or Notification Destination to notify when alert is triggered. */
110
- notification?: AlertNotification | undefined;
111
- /** Latest state of alert evaluation. */
112
- state?: AlertEvaluationState | undefined;
113
- /** Timestamp of the last evaluation. */
114
- lastEvaluatedAt?: Temporal.Instant | undefined;
115
- /** Alert state if result is empty. Please avoid setting this field to be `UNKNOWN` because `UNKNOWN` state is planned to be deprecated. */
116
- emptyResultState?: AlertEvaluationState | undefined;
117
- }
118
-
119
- export interface AlertNotification {
120
- subscriptions?: AlertSubscription[] | undefined;
121
- /**
122
- * Number of seconds an alert waits after being triggered before it is allowed to send another notification.
123
- * If set to 0 or omitted, the alert will not send any further notifications after the first trigger
124
- * Setting this value to 1 allows the alert to send a notification on every evaluation where the condition is met, effectively making it always retrigger for notification purposes.
125
- */
126
- retriggerSeconds?: number | undefined;
127
- /** Whether to notify alert subscribers when alert returns back to normal. */
128
- notifyOnOk?: boolean | undefined;
129
- }
130
-
131
- export interface AlertOperand {
132
- /** Only one of the following fields may be set, depending on the type of operand/threshold. */
133
- operand?:
134
- | {$case: 'column'; column: AlertOperandColumn}
135
- | {$case: 'value'; value: AlertOperandValue}
136
- | undefined;
137
- }
138
-
139
- export interface AlertOperandColumn {
140
- name?: string | undefined;
141
- display?: string | undefined;
142
- /** If not set, the behavior is equivalent to using `First row` in the UI. */
143
- aggregation?: Aggregation | undefined;
144
- }
145
-
146
- export interface AlertOperandValue {
147
- /** Only one of the following fields may be set, depending on the type of threshold value. */
148
- value?:
149
- | {$case: 'stringValue'; stringValue: string}
150
- | {$case: 'doubleValue'; doubleValue: number}
151
- | {$case: 'boolValue'; boolValue: boolean}
152
- | undefined;
153
- }
154
-
155
- export interface AlertRunAs {
156
- identity?:
157
- | {
158
- $case: 'userName';
159
- /** The email of an active workspace user. Can only set this field to their own email. */
160
- userName: string;
161
- }
162
- | {
163
- $case: 'servicePrincipalName';
164
- /** Application ID of an active service principal. Setting this field requires the `servicePrincipal/user` role. */
165
- servicePrincipalName: string;
166
- }
167
- | undefined;
168
- }
169
-
170
- export interface AlertSubscription {
171
- subscriptionType?:
172
- | {$case: 'userEmail'; userEmail: string}
173
- | {$case: 'destinationId'; destinationId: string}
174
- | undefined;
175
- }
176
-
177
- export interface CreateAlertRequest {
178
- alert?: Alert | undefined;
179
- }
180
-
181
- export interface CronSchedule {
182
- /**
183
- * A cron expression using quartz syntax that specifies the schedule for this pipeline.
184
- * Should use the quartz format described here: http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-06.html
185
- */
186
- quartzCronSchedule?: string | undefined;
187
- /**
188
- * A Java timezone id. The schedule will be resolved using this timezone.
189
- * This will be combined with the quartz_cron_schedule to determine the schedule.
190
- * See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details.
191
- */
192
- timezoneId?: string | undefined;
193
- /** Indicate whether this schedule is paused or not. */
194
- pauseStatus?: SchedulePauseStatus | undefined;
195
- }
196
-
197
- /**
198
- * Represents an empty message, similar to google.protobuf.Empty, which is not available in the firm
199
- * right now.
200
- */
201
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
202
- export interface Empty {}
203
-
204
- export interface GetAlertRequest {
205
- id?: string | undefined;
206
- }
207
-
208
- export interface ListAlertsRequest {
209
- pageToken?: string | undefined;
210
- pageSize?: number | undefined;
211
- }
212
-
213
- export interface ListAlertsResponse {
214
- alerts?: Alert[] | undefined;
215
- nextPageToken?: string | undefined;
216
- }
217
-
218
- export interface TrashAlertRequest {
219
- id?: string | undefined;
220
- /** Whether to permanently delete the alert. If not set, the alert will only be soft deleted. */
221
- purge?: boolean | undefined;
222
- }
223
-
224
- export interface UpdateAlertRequest {
225
- alert?: Alert | undefined;
226
- updateMask?: FieldMask<Alert> | undefined;
227
- }
228
-
229
- export const unmarshalAlertSchema: z.ZodType<Alert> = z
230
- .object({
231
- id: z.string().optional(),
232
- display_name: z.string().optional(),
233
- owner_user_name: z.string().optional(),
234
- create_time: z
235
- .string()
236
- .transform(s => Temporal.Instant.from(s))
237
- .optional(),
238
- update_time: z
239
- .string()
240
- .transform(s => Temporal.Instant.from(s))
241
- .optional(),
242
- parent_path: z.string().optional(),
243
- query_text: z.string().optional(),
244
- warehouse_id: z.string().optional(),
245
- run_as_user_name: z.string().optional(),
246
- evaluation: z.lazy(() => unmarshalAlertEvaluationSchema).optional(),
247
- schedule: z.lazy(() => unmarshalCronScheduleSchema).optional(),
248
- lifecycle_state: z.enum(AlertLifecycleState).optional(),
249
- custom_summary: z.string().optional(),
250
- custom_description: z.string().optional(),
251
- run_as: z.lazy(() => unmarshalAlertRunAsSchema).optional(),
252
- effective_run_as: z.lazy(() => unmarshalAlertRunAsSchema).optional(),
253
- })
254
- .transform(d => ({
255
- id: d.id,
256
- displayName: d.display_name,
257
- ownerUserName: d.owner_user_name,
258
- createTime: d.create_time,
259
- updateTime: d.update_time,
260
- parentPath: d.parent_path,
261
- queryText: d.query_text,
262
- warehouseId: d.warehouse_id,
263
- runAsUserName: d.run_as_user_name,
264
- evaluation: d.evaluation,
265
- schedule: d.schedule,
266
- lifecycleState: d.lifecycle_state,
267
- customSummary: d.custom_summary,
268
- customDescription: d.custom_description,
269
- runAs: d.run_as,
270
- effectiveRunAs: d.effective_run_as,
271
- }));
272
-
273
- export const unmarshalAlertEvaluationSchema: z.ZodType<AlertEvaluation> = z
274
- .object({
275
- source: z.lazy(() => unmarshalAlertOperandColumnSchema).optional(),
276
- comparison_operator: z.enum(ComparisonOperator).optional(),
277
- threshold: z.lazy(() => unmarshalAlertOperandSchema).optional(),
278
- notification: z.lazy(() => unmarshalAlertNotificationSchema).optional(),
279
- state: z.enum(AlertEvaluationState).optional(),
280
- last_evaluated_at: z
281
- .string()
282
- .transform(s => Temporal.Instant.from(s))
283
- .optional(),
284
- empty_result_state: z.enum(AlertEvaluationState).optional(),
285
- })
286
- .transform(d => ({
287
- source: d.source,
288
- comparisonOperator: d.comparison_operator,
289
- threshold: d.threshold,
290
- notification: d.notification,
291
- state: d.state,
292
- lastEvaluatedAt: d.last_evaluated_at,
293
- emptyResultState: d.empty_result_state,
294
- }));
295
-
296
- export const unmarshalAlertNotificationSchema: z.ZodType<AlertNotification> = z
297
- .object({
298
- subscriptions: z
299
- .array(z.lazy(() => unmarshalAlertSubscriptionSchema))
300
- .optional(),
301
- retrigger_seconds: z.number().optional(),
302
- notify_on_ok: z.boolean().optional(),
303
- })
304
- .transform(d => ({
305
- subscriptions: d.subscriptions,
306
- retriggerSeconds: d.retrigger_seconds,
307
- notifyOnOk: d.notify_on_ok,
308
- }));
309
-
310
- export const unmarshalAlertOperandSchema: z.ZodType<AlertOperand> = z
311
- .object({
312
- column: z.lazy(() => unmarshalAlertOperandColumnSchema).optional(),
313
- value: z.lazy(() => unmarshalAlertOperandValueSchema).optional(),
314
- })
315
- .transform(d => ({
316
- operand:
317
- d.column !== undefined
318
- ? {$case: 'column' as const, column: d.column}
319
- : d.value !== undefined
320
- ? {$case: 'value' as const, value: d.value}
321
- : undefined,
322
- }));
323
-
324
- export const unmarshalAlertOperandColumnSchema: z.ZodType<AlertOperandColumn> =
325
- z
326
- .object({
327
- name: z.string().optional(),
328
- display: z.string().optional(),
329
- aggregation: z.enum(Aggregation).optional(),
330
- })
331
- .transform(d => ({
332
- name: d.name,
333
- display: d.display,
334
- aggregation: d.aggregation,
335
- }));
336
-
337
- export const unmarshalAlertOperandValueSchema: z.ZodType<AlertOperandValue> = z
338
- .object({
339
- string_value: z.string().optional(),
340
- double_value: z.number().optional(),
341
- bool_value: z.boolean().optional(),
342
- })
343
- .transform(d => ({
344
- value:
345
- d.string_value !== undefined
346
- ? {$case: 'stringValue' as const, stringValue: d.string_value}
347
- : d.double_value !== undefined
348
- ? {$case: 'doubleValue' as const, doubleValue: d.double_value}
349
- : d.bool_value !== undefined
350
- ? {$case: 'boolValue' as const, boolValue: d.bool_value}
351
- : undefined,
352
- }));
353
-
354
- export const unmarshalAlertRunAsSchema: z.ZodType<AlertRunAs> = z
355
- .object({
356
- user_name: z.string().optional(),
357
- service_principal_name: z.string().optional(),
358
- })
359
- .transform(d => ({
360
- identity:
361
- d.user_name !== undefined
362
- ? {$case: 'userName' as const, userName: d.user_name}
363
- : d.service_principal_name !== undefined
364
- ? {
365
- $case: 'servicePrincipalName' as const,
366
- servicePrincipalName: d.service_principal_name,
367
- }
368
- : undefined,
369
- }));
370
-
371
- export const unmarshalAlertSubscriptionSchema: z.ZodType<AlertSubscription> = z
372
- .object({
373
- user_email: z.string().optional(),
374
- destination_id: z.string().optional(),
375
- })
376
- .transform(d => ({
377
- subscriptionType:
378
- d.user_email !== undefined
379
- ? {$case: 'userEmail' as const, userEmail: d.user_email}
380
- : d.destination_id !== undefined
381
- ? {$case: 'destinationId' as const, destinationId: d.destination_id}
382
- : undefined,
383
- }));
384
-
385
- export const unmarshalCronScheduleSchema: z.ZodType<CronSchedule> = z
386
- .object({
387
- quartz_cron_schedule: z.string().optional(),
388
- timezone_id: z.string().optional(),
389
- pause_status: z.enum(SchedulePauseStatus).optional(),
390
- })
391
- .transform(d => ({
392
- quartzCronSchedule: d.quartz_cron_schedule,
393
- timezoneId: d.timezone_id,
394
- pauseStatus: d.pause_status,
395
- }));
396
-
397
- export const unmarshalEmptySchema: z.ZodType<Empty> = z.object({});
398
-
399
- export const unmarshalListAlertsResponseSchema: z.ZodType<ListAlertsResponse> =
400
- z
401
- .object({
402
- alerts: z.array(z.lazy(() => unmarshalAlertSchema)).optional(),
403
- next_page_token: z.string().optional(),
404
- })
405
- .transform(d => ({
406
- alerts: d.alerts,
407
- nextPageToken: d.next_page_token,
408
- }));
409
-
410
- export const marshalAlertSchema: z.ZodType = z
411
- .object({
412
- id: z.string().optional(),
413
- displayName: z.string().optional(),
414
- ownerUserName: z.string().optional(),
415
- createTime: z
416
- .any()
417
- .transform((d: Temporal.Instant) => d.toString())
418
- .optional(),
419
- updateTime: z
420
- .any()
421
- .transform((d: Temporal.Instant) => d.toString())
422
- .optional(),
423
- parentPath: z.string().optional(),
424
- queryText: z.string().optional(),
425
- warehouseId: z.string().optional(),
426
- runAsUserName: z.string().optional(),
427
- evaluation: z.lazy(() => marshalAlertEvaluationSchema).optional(),
428
- schedule: z.lazy(() => marshalCronScheduleSchema).optional(),
429
- lifecycleState: z.enum(AlertLifecycleState).optional(),
430
- customSummary: z.string().optional(),
431
- customDescription: z.string().optional(),
432
- runAs: z.lazy(() => marshalAlertRunAsSchema).optional(),
433
- effectiveRunAs: z.lazy(() => marshalAlertRunAsSchema).optional(),
434
- })
435
- .transform(d => ({
436
- id: d.id,
437
- display_name: d.displayName,
438
- owner_user_name: d.ownerUserName,
439
- create_time: d.createTime,
440
- update_time: d.updateTime,
441
- parent_path: d.parentPath,
442
- query_text: d.queryText,
443
- warehouse_id: d.warehouseId,
444
- run_as_user_name: d.runAsUserName,
445
- evaluation: d.evaluation,
446
- schedule: d.schedule,
447
- lifecycle_state: d.lifecycleState,
448
- custom_summary: d.customSummary,
449
- custom_description: d.customDescription,
450
- run_as: d.runAs,
451
- effective_run_as: d.effectiveRunAs,
452
- }));
453
-
454
- export const marshalAlertEvaluationSchema: z.ZodType = z
455
- .object({
456
- source: z.lazy(() => marshalAlertOperandColumnSchema).optional(),
457
- comparisonOperator: z.enum(ComparisonOperator).optional(),
458
- threshold: z.lazy(() => marshalAlertOperandSchema).optional(),
459
- notification: z.lazy(() => marshalAlertNotificationSchema).optional(),
460
- state: z.enum(AlertEvaluationState).optional(),
461
- lastEvaluatedAt: z
462
- .any()
463
- .transform((d: Temporal.Instant) => d.toString())
464
- .optional(),
465
- emptyResultState: z.enum(AlertEvaluationState).optional(),
466
- })
467
- .transform(d => ({
468
- source: d.source,
469
- comparison_operator: d.comparisonOperator,
470
- threshold: d.threshold,
471
- notification: d.notification,
472
- state: d.state,
473
- last_evaluated_at: d.lastEvaluatedAt,
474
- empty_result_state: d.emptyResultState,
475
- }));
476
-
477
- export const marshalAlertNotificationSchema: z.ZodType = z
478
- .object({
479
- subscriptions: z
480
- .array(z.lazy(() => marshalAlertSubscriptionSchema))
481
- .optional(),
482
- retriggerSeconds: z.number().optional(),
483
- notifyOnOk: z.boolean().optional(),
484
- })
485
- .transform(d => ({
486
- subscriptions: d.subscriptions,
487
- retrigger_seconds: d.retriggerSeconds,
488
- notify_on_ok: d.notifyOnOk,
489
- }));
490
-
491
- export const marshalAlertOperandSchema: z.ZodType = z
492
- .object({
493
- operand: z
494
- .discriminatedUnion('$case', [
495
- z.object({
496
- $case: z.literal('column'),
497
- column: z.lazy(() => marshalAlertOperandColumnSchema),
498
- }),
499
- z.object({
500
- $case: z.literal('value'),
501
- value: z.lazy(() => marshalAlertOperandValueSchema),
502
- }),
503
- ])
504
- .optional(),
505
- })
506
- .transform(d => ({
507
- ...(d.operand?.$case === 'column' && {column: d.operand.column}),
508
- ...(d.operand?.$case === 'value' && {value: d.operand.value}),
509
- }));
510
-
511
- export const marshalAlertOperandColumnSchema: z.ZodType = z
512
- .object({
513
- name: z.string().optional(),
514
- display: z.string().optional(),
515
- aggregation: z.enum(Aggregation).optional(),
516
- })
517
- .transform(d => ({
518
- name: d.name,
519
- display: d.display,
520
- aggregation: d.aggregation,
521
- }));
522
-
523
- export const marshalAlertOperandValueSchema: z.ZodType = z
524
- .object({
525
- value: z
526
- .discriminatedUnion('$case', [
527
- z.object({$case: z.literal('stringValue'), stringValue: z.string()}),
528
- z.object({$case: z.literal('doubleValue'), doubleValue: z.number()}),
529
- z.object({$case: z.literal('boolValue'), boolValue: z.boolean()}),
530
- ])
531
- .optional(),
532
- })
533
- .transform(d => ({
534
- ...(d.value?.$case === 'stringValue' && {
535
- string_value: d.value.stringValue,
536
- }),
537
- ...(d.value?.$case === 'doubleValue' && {
538
- double_value: d.value.doubleValue,
539
- }),
540
- ...(d.value?.$case === 'boolValue' && {bool_value: d.value.boolValue}),
541
- }));
542
-
543
- export const marshalAlertRunAsSchema: z.ZodType = z
544
- .object({
545
- identity: z
546
- .discriminatedUnion('$case', [
547
- z.object({$case: z.literal('userName'), userName: z.string()}),
548
- z.object({
549
- $case: z.literal('servicePrincipalName'),
550
- servicePrincipalName: z.string(),
551
- }),
552
- ])
553
- .optional(),
554
- })
555
- .transform(d => ({
556
- ...(d.identity?.$case === 'userName' && {user_name: d.identity.userName}),
557
- ...(d.identity?.$case === 'servicePrincipalName' && {
558
- service_principal_name: d.identity.servicePrincipalName,
559
- }),
560
- }));
561
-
562
- export const marshalAlertSubscriptionSchema: z.ZodType = z
563
- .object({
564
- subscriptionType: z
565
- .discriminatedUnion('$case', [
566
- z.object({$case: z.literal('userEmail'), userEmail: z.string()}),
567
- z.object({
568
- $case: z.literal('destinationId'),
569
- destinationId: z.string(),
570
- }),
571
- ])
572
- .optional(),
573
- })
574
- .transform(d => ({
575
- ...(d.subscriptionType?.$case === 'userEmail' && {
576
- user_email: d.subscriptionType.userEmail,
577
- }),
578
- ...(d.subscriptionType?.$case === 'destinationId' && {
579
- destination_id: d.subscriptionType.destinationId,
580
- }),
581
- }));
582
-
583
- export const marshalCronScheduleSchema: z.ZodType = z
584
- .object({
585
- quartzCronSchedule: z.string().optional(),
586
- timezoneId: z.string().optional(),
587
- pauseStatus: z.enum(SchedulePauseStatus).optional(),
588
- })
589
- .transform(d => ({
590
- quartz_cron_schedule: d.quartzCronSchedule,
591
- timezone_id: d.timezoneId,
592
- pause_status: d.pauseStatus,
593
- }));
594
-
595
- const alertFieldMaskSchema: FieldMaskSchema = {
596
- createTime: {wire: 'create_time'},
597
- customDescription: {wire: 'custom_description'},
598
- customSummary: {wire: 'custom_summary'},
599
- displayName: {wire: 'display_name'},
600
- effectiveRunAs: {
601
- wire: 'effective_run_as',
602
- children: () => alertRunAsFieldMaskSchema,
603
- },
604
- evaluation: {
605
- wire: 'evaluation',
606
- children: () => alertEvaluationFieldMaskSchema,
607
- },
608
- id: {wire: 'id'},
609
- lifecycleState: {wire: 'lifecycle_state'},
610
- ownerUserName: {wire: 'owner_user_name'},
611
- parentPath: {wire: 'parent_path'},
612
- queryText: {wire: 'query_text'},
613
- runAs: {wire: 'run_as', children: () => alertRunAsFieldMaskSchema},
614
- runAsUserName: {wire: 'run_as_user_name'},
615
- schedule: {wire: 'schedule', children: () => cronScheduleFieldMaskSchema},
616
- updateTime: {wire: 'update_time'},
617
- warehouseId: {wire: 'warehouse_id'},
618
- };
619
-
620
- export function alertFieldMask(...paths: string[]): FieldMask<Alert> {
621
- return FieldMask.build<Alert>(paths, alertFieldMaskSchema);
622
- }
623
-
624
- const alertEvaluationFieldMaskSchema: FieldMaskSchema = {
625
- comparisonOperator: {wire: 'comparison_operator'},
626
- emptyResultState: {wire: 'empty_result_state'},
627
- lastEvaluatedAt: {wire: 'last_evaluated_at'},
628
- notification: {
629
- wire: 'notification',
630
- children: () => alertNotificationFieldMaskSchema,
631
- },
632
- source: {wire: 'source', children: () => alertOperandColumnFieldMaskSchema},
633
- state: {wire: 'state'},
634
- threshold: {wire: 'threshold', children: () => alertOperandFieldMaskSchema},
635
- };
636
-
637
- const alertNotificationFieldMaskSchema: FieldMaskSchema = {
638
- notifyOnOk: {wire: 'notify_on_ok'},
639
- retriggerSeconds: {wire: 'retrigger_seconds'},
640
- subscriptions: {wire: 'subscriptions'},
641
- };
642
-
643
- const alertOperandFieldMaskSchema: FieldMaskSchema = {
644
- column: {wire: 'column', children: () => alertOperandColumnFieldMaskSchema},
645
- value: {wire: 'value', children: () => alertOperandValueFieldMaskSchema},
646
- };
647
-
648
- const alertOperandColumnFieldMaskSchema: FieldMaskSchema = {
649
- aggregation: {wire: 'aggregation'},
650
- display: {wire: 'display'},
651
- name: {wire: 'name'},
652
- };
653
-
654
- const alertOperandValueFieldMaskSchema: FieldMaskSchema = {
655
- boolValue: {wire: 'bool_value'},
656
- doubleValue: {wire: 'double_value'},
657
- stringValue: {wire: 'string_value'},
658
- };
659
-
660
- const alertRunAsFieldMaskSchema: FieldMaskSchema = {
661
- servicePrincipalName: {wire: 'service_principal_name'},
662
- userName: {wire: 'user_name'},
663
- };
664
-
665
- const cronScheduleFieldMaskSchema: FieldMaskSchema = {
666
- pauseStatus: {wire: 'pause_status'},
667
- quartzCronSchedule: {wire: 'quartz_cron_schedule'},
668
- timezoneId: {wire: 'timezone_id'},
669
- };