@databricks/sdk-alerts 0.34.0 → 0.36.0

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.
Files changed (43) hide show
  1. package/dist/package.js +7 -0
  2. package/dist/package.js.map +1 -0
  3. package/dist/v1/client.d.ts +25 -21
  4. package/dist/v1/client.d.ts.map +1 -1
  5. package/dist/v1/client.js +146 -185
  6. package/dist/v1/client.js.map +1 -1
  7. package/dist/v1/index.d.ts +3 -8
  8. package/dist/v1/index.js +4 -8
  9. package/dist/v1/model.d.ts +219 -216
  10. package/dist/v1/model.d.ts.map +1 -1
  11. package/dist/v1/model.js +288 -360
  12. package/dist/v1/model.js.map +1 -1
  13. package/dist/v1/transport.d.ts +21 -17
  14. package/dist/v1/transport.d.ts.map +1 -1
  15. package/dist/v1/transport.js +60 -69
  16. package/dist/v1/transport.js.map +1 -1
  17. package/dist/v1/utils.d.ts +18 -14
  18. package/dist/v1/utils.d.ts.map +1 -1
  19. package/dist/v1/utils.js +76 -103
  20. package/dist/v1/utils.js.map +1 -1
  21. package/dist/v2/client.d.ts +25 -21
  22. package/dist/v2/client.d.ts.map +1 -1
  23. package/dist/v2/client.js +154 -197
  24. package/dist/v2/client.js.map +1 -1
  25. package/dist/v2/index.d.ts +3 -8
  26. package/dist/v2/index.js +4 -8
  27. package/dist/v2/model.d.ts +224 -224
  28. package/dist/v2/model.d.ts.map +1 -1
  29. package/dist/v2/model.js +375 -449
  30. package/dist/v2/model.js.map +1 -1
  31. package/dist/v2/transport.d.ts +21 -17
  32. package/dist/v2/transport.d.ts.map +1 -1
  33. package/dist/v2/transport.js +60 -69
  34. package/dist/v2/transport.js.map +1 -1
  35. package/dist/v2/utils.d.ts +18 -14
  36. package/dist/v2/utils.d.ts.map +1 -1
  37. package/dist/v2/utils.js +76 -103
  38. package/dist/v2/utils.js.map +1 -1
  39. package/package.json +5 -5
  40. package/dist/v1/index.d.ts.map +0 -1
  41. package/dist/v1/index.js.map +0 -1
  42. package/dist/v2/index.d.ts.map +0 -1
  43. package/dist/v2/index.js.map +0 -1
package/dist/v2/model.js CHANGED
@@ -1,490 +1,416 @@
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
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
6
- export const Aggregation = {
7
- SUM: 'SUM',
8
- COUNT: 'COUNT',
9
- COUNT_DISTINCT: 'COUNT_DISTINCT',
10
- AVG: 'AVG',
11
- MEDIAN: 'MEDIAN',
12
- MIN: 'MIN',
13
- MAX: 'MAX',
14
- STDDEV: 'STDDEV',
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { FieldMask } from "@databricks/sdk-core/wkt";
3
+ import { z } from "zod";
4
+
5
+ //#region src/v2/model.ts
6
+ const Aggregation = {
7
+ SUM: "SUM",
8
+ COUNT: "COUNT",
9
+ COUNT_DISTINCT: "COUNT_DISTINCT",
10
+ AVG: "AVG",
11
+ MEDIAN: "MEDIAN",
12
+ MIN: "MIN",
13
+ MAX: "MAX",
14
+ STDDEV: "STDDEV"
15
15
  };
16
16
  /**
17
- * UNSPECIFIED - default unspecify value for proto enum, do not use it in the code
18
- * UNKNOWN - alert not yet evaluated
19
- * TRIGGERED - alert is triggered
20
- * OK - alert is not triggered
21
- * ERROR - alert evaluation failed
22
- */
23
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
24
- export const AlertEvaluationState = {
25
- /** Deprecated. Please avoid using `UNKNOWN` as empty_result_state. */
26
- UNKNOWN: 'UNKNOWN',
27
- TRIGGERED: 'TRIGGERED',
28
- OK: 'OK',
29
- ERROR: 'ERROR',
17
+ * UNSPECIFIED - default unspecify value for proto enum, do not use it in the code
18
+ * UNKNOWN - alert not yet evaluated
19
+ * TRIGGERED - alert is triggered
20
+ * OK - alert is not triggered
21
+ * ERROR - alert evaluation failed
22
+ */
23
+ const AlertEvaluationState = {
24
+ UNKNOWN: "UNKNOWN",
25
+ TRIGGERED: "TRIGGERED",
26
+ OK: "OK",
27
+ ERROR: "ERROR"
30
28
  };
31
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
32
- export const AlertLifecycleState = {
33
- ACTIVE: 'ACTIVE',
34
- DELETED: 'DELETED',
29
+ const AlertLifecycleState = {
30
+ ACTIVE: "ACTIVE",
31
+ DELETED: "DELETED"
35
32
  };
36
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
37
- export const ComparisonOperator = {
38
- LESS_THAN: 'LESS_THAN',
39
- GREATER_THAN: 'GREATER_THAN',
40
- EQUAL: 'EQUAL',
41
- NOT_EQUAL: 'NOT_EQUAL',
42
- GREATER_THAN_OR_EQUAL: 'GREATER_THAN_OR_EQUAL',
43
- LESS_THAN_OR_EQUAL: 'LESS_THAN_OR_EQUAL',
44
- IS_NULL: 'IS_NULL',
45
- IS_NOT_NULL: 'IS_NOT_NULL',
33
+ const ComparisonOperator = {
34
+ LESS_THAN: "LESS_THAN",
35
+ GREATER_THAN: "GREATER_THAN",
36
+ EQUAL: "EQUAL",
37
+ NOT_EQUAL: "NOT_EQUAL",
38
+ GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL",
39
+ LESS_THAN_OR_EQUAL: "LESS_THAN_OR_EQUAL",
40
+ IS_NULL: "IS_NULL",
41
+ IS_NOT_NULL: "IS_NOT_NULL"
46
42
  };
47
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
48
- export const SchedulePauseStatus = {
49
- UNPAUSED: 'UNPAUSED',
50
- PAUSED: 'PAUSED',
43
+ const SchedulePauseStatus = {
44
+ UNPAUSED: "UNPAUSED",
45
+ PAUSED: "PAUSED"
51
46
  };
52
- export const unmarshalAlertSchema = z
53
- .object({
54
- id: z.string().optional(),
55
- display_name: z.string().optional(),
56
- owner_user_name: z.string().optional(),
57
- create_time: z
58
- .string()
59
- .transform(s => Temporal.Instant.from(s))
60
- .optional(),
61
- update_time: z
62
- .string()
63
- .transform(s => Temporal.Instant.from(s))
64
- .optional(),
65
- parent_path: z.string().optional(),
66
- query_text: z.string().optional(),
67
- warehouse_id: z.string().optional(),
68
- run_as_user_name: z.string().optional(),
69
- evaluation: z.lazy(() => unmarshalAlertEvaluationSchema).optional(),
70
- schedule: z.lazy(() => unmarshalCronScheduleSchema).optional(),
71
- lifecycle_state: z.string().optional(),
72
- custom_summary: z.string().optional(),
73
- custom_description: z.string().optional(),
74
- run_as: z.lazy(() => unmarshalAlertRunAsSchema).optional(),
75
- effective_run_as: z.lazy(() => unmarshalAlertRunAsSchema).optional(),
76
- parameters: z
77
- .array(z.lazy(() => unmarshalAlertStatementParameterSchema))
78
- .optional(),
79
- })
80
- .transform(d => ({
81
- id: d.id,
82
- displayName: d.display_name,
83
- ownerUserName: d.owner_user_name,
84
- createTime: d.create_time,
85
- updateTime: d.update_time,
86
- parentPath: d.parent_path,
87
- queryText: d.query_text,
88
- warehouseId: d.warehouse_id,
89
- runAsUserName: d.run_as_user_name,
90
- evaluation: d.evaluation,
91
- schedule: d.schedule,
92
- lifecycleState: d.lifecycle_state,
93
- customSummary: d.custom_summary,
94
- customDescription: d.custom_description,
95
- runAs: d.run_as,
96
- effectiveRunAs: d.effective_run_as,
97
- parameters: d.parameters,
47
+ const unmarshalAlertSchema = z.object({
48
+ id: z.string().optional(),
49
+ display_name: z.string().optional(),
50
+ owner_user_name: z.string().optional(),
51
+ create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
52
+ update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
53
+ parent_path: z.string().optional(),
54
+ query_text: z.string().optional(),
55
+ warehouse_id: z.string().optional(),
56
+ run_as_user_name: z.string().optional(),
57
+ evaluation: z.lazy(() => unmarshalAlertEvaluationSchema).optional(),
58
+ schedule: z.lazy(() => unmarshalCronScheduleSchema).optional(),
59
+ lifecycle_state: z.string().optional(),
60
+ custom_summary: z.string().optional(),
61
+ custom_description: z.string().optional(),
62
+ run_as: z.lazy(() => unmarshalAlertRunAsSchema).optional(),
63
+ effective_run_as: z.lazy(() => unmarshalAlertRunAsSchema).optional(),
64
+ parameters: z.array(z.lazy(() => unmarshalAlertStatementParameterSchema)).optional()
65
+ }).transform((d) => ({
66
+ id: d.id,
67
+ displayName: d.display_name,
68
+ ownerUserName: d.owner_user_name,
69
+ createTime: d.create_time,
70
+ updateTime: d.update_time,
71
+ parentPath: d.parent_path,
72
+ queryText: d.query_text,
73
+ warehouseId: d.warehouse_id,
74
+ runAsUserName: d.run_as_user_name,
75
+ evaluation: d.evaluation,
76
+ schedule: d.schedule,
77
+ lifecycleState: d.lifecycle_state,
78
+ customSummary: d.custom_summary,
79
+ customDescription: d.custom_description,
80
+ runAs: d.run_as,
81
+ effectiveRunAs: d.effective_run_as,
82
+ parameters: d.parameters
98
83
  }));
99
- export const unmarshalAlertEvaluationSchema = z
100
- .object({
101
- source: z.lazy(() => unmarshalAlertOperandColumnSchema).optional(),
102
- comparison_operator: z.string().optional(),
103
- threshold: z.lazy(() => unmarshalAlertOperandSchema).optional(),
104
- notification: z.lazy(() => unmarshalAlertNotificationSchema).optional(),
105
- state: z.string().optional(),
106
- last_evaluated_at: z
107
- .string()
108
- .transform(s => Temporal.Instant.from(s))
109
- .optional(),
110
- empty_result_state: z.string().optional(),
111
- })
112
- .transform(d => ({
113
- source: d.source,
114
- comparisonOperator: d.comparison_operator,
115
- threshold: d.threshold,
116
- notification: d.notification,
117
- state: d.state,
118
- lastEvaluatedAt: d.last_evaluated_at,
119
- emptyResultState: d.empty_result_state,
84
+ const unmarshalAlertEvaluationSchema = z.object({
85
+ source: z.lazy(() => unmarshalAlertOperandColumnSchema).optional(),
86
+ comparison_operator: z.string().optional(),
87
+ threshold: z.lazy(() => unmarshalAlertOperandSchema).optional(),
88
+ notification: z.lazy(() => unmarshalAlertNotificationSchema).optional(),
89
+ state: z.string().optional(),
90
+ last_evaluated_at: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
91
+ empty_result_state: z.string().optional()
92
+ }).transform((d) => ({
93
+ source: d.source,
94
+ comparisonOperator: d.comparison_operator,
95
+ threshold: d.threshold,
96
+ notification: d.notification,
97
+ state: d.state,
98
+ lastEvaluatedAt: d.last_evaluated_at,
99
+ emptyResultState: d.empty_result_state
120
100
  }));
121
- export const unmarshalAlertNotificationSchema = z
122
- .object({
123
- subscriptions: z
124
- .array(z.lazy(() => unmarshalAlertSubscriptionSchema))
125
- .optional(),
126
- retrigger_seconds: z.number().optional(),
127
- notify_on_ok: z.boolean().optional(),
128
- })
129
- .transform(d => ({
130
- subscriptions: d.subscriptions,
131
- retriggerSeconds: d.retrigger_seconds,
132
- notifyOnOk: d.notify_on_ok,
101
+ const unmarshalAlertNotificationSchema = z.object({
102
+ subscriptions: z.array(z.lazy(() => unmarshalAlertSubscriptionSchema)).optional(),
103
+ retrigger_seconds: z.number().optional(),
104
+ notify_on_ok: z.boolean().optional()
105
+ }).transform((d) => ({
106
+ subscriptions: d.subscriptions,
107
+ retriggerSeconds: d.retrigger_seconds,
108
+ notifyOnOk: d.notify_on_ok
133
109
  }));
134
- export const unmarshalAlertOperandSchema = z
135
- .object({
136
- column: z.lazy(() => unmarshalAlertOperandColumnSchema).optional(),
137
- value: z.lazy(() => unmarshalAlertOperandValueSchema).optional(),
138
- })
139
- .transform(d => ({
140
- operand: d.column !== undefined
141
- ? { $case: 'column', column: d.column }
142
- : d.value !== undefined
143
- ? { $case: 'value', value: d.value }
144
- : undefined,
110
+ const unmarshalAlertOperandSchema = z.object({
111
+ column: z.lazy(() => unmarshalAlertOperandColumnSchema).optional(),
112
+ value: z.lazy(() => unmarshalAlertOperandValueSchema).optional()
113
+ }).transform((d) => ({ operand: d.column !== void 0 ? {
114
+ $case: "column",
115
+ column: d.column
116
+ } : d.value !== void 0 ? {
117
+ $case: "value",
118
+ value: d.value
119
+ } : void 0 }));
120
+ const unmarshalAlertOperandColumnSchema = z.object({
121
+ name: z.string().optional(),
122
+ display: z.string().optional(),
123
+ aggregation: z.string().optional()
124
+ }).transform((d) => ({
125
+ name: d.name,
126
+ display: d.display,
127
+ aggregation: d.aggregation
145
128
  }));
146
- export const unmarshalAlertOperandColumnSchema = z
147
- .object({
148
- name: z.string().optional(),
149
- display: z.string().optional(),
150
- aggregation: z.string().optional(),
151
- })
152
- .transform(d => ({
153
- name: d.name,
154
- display: d.display,
155
- aggregation: d.aggregation,
129
+ const unmarshalAlertOperandValueSchema = z.object({
130
+ string_value: z.string().optional(),
131
+ double_value: z.number().optional(),
132
+ bool_value: z.boolean().optional()
133
+ }).transform((d) => ({ value: d.string_value !== void 0 ? {
134
+ $case: "stringValue",
135
+ stringValue: d.string_value
136
+ } : d.double_value !== void 0 ? {
137
+ $case: "doubleValue",
138
+ doubleValue: d.double_value
139
+ } : d.bool_value !== void 0 ? {
140
+ $case: "boolValue",
141
+ boolValue: d.bool_value
142
+ } : void 0 }));
143
+ const unmarshalAlertRunAsSchema = z.object({
144
+ user_name: z.string().optional(),
145
+ service_principal_name: z.string().optional()
146
+ }).transform((d) => ({ identity: d.user_name !== void 0 ? {
147
+ $case: "userName",
148
+ userName: d.user_name
149
+ } : d.service_principal_name !== void 0 ? {
150
+ $case: "servicePrincipalName",
151
+ servicePrincipalName: d.service_principal_name
152
+ } : void 0 }));
153
+ const unmarshalAlertStatementParameterSchema = z.object({
154
+ name: z.string().optional(),
155
+ value: z.string().optional(),
156
+ type: z.string().optional()
157
+ }).transform((d) => ({
158
+ name: d.name,
159
+ value: d.value,
160
+ type: d.type
156
161
  }));
157
- export const unmarshalAlertOperandValueSchema = z
158
- .object({
159
- string_value: z.string().optional(),
160
- double_value: z.number().optional(),
161
- bool_value: z.boolean().optional(),
162
- })
163
- .transform(d => ({
164
- value: d.string_value !== undefined
165
- ? { $case: 'stringValue', stringValue: d.string_value }
166
- : d.double_value !== undefined
167
- ? { $case: 'doubleValue', doubleValue: d.double_value }
168
- : d.bool_value !== undefined
169
- ? { $case: 'boolValue', boolValue: d.bool_value }
170
- : undefined,
162
+ const unmarshalAlertSubscriptionSchema = z.object({
163
+ user_email: z.string().optional(),
164
+ destination_id: z.string().optional()
165
+ }).transform((d) => ({ subscriptionType: d.user_email !== void 0 ? {
166
+ $case: "userEmail",
167
+ userEmail: d.user_email
168
+ } : d.destination_id !== void 0 ? {
169
+ $case: "destinationId",
170
+ destinationId: d.destination_id
171
+ } : void 0 }));
172
+ const unmarshalCronScheduleSchema = z.object({
173
+ quartz_cron_schedule: z.string().optional(),
174
+ timezone_id: z.string().optional(),
175
+ pause_status: z.string().optional()
176
+ }).transform((d) => ({
177
+ quartzCronSchedule: d.quartz_cron_schedule,
178
+ timezoneId: d.timezone_id,
179
+ pauseStatus: d.pause_status
171
180
  }));
172
- export const unmarshalAlertRunAsSchema = z
173
- .object({
174
- user_name: z.string().optional(),
175
- service_principal_name: z.string().optional(),
176
- })
177
- .transform(d => ({
178
- identity: d.user_name !== undefined
179
- ? { $case: 'userName', userName: d.user_name }
180
- : d.service_principal_name !== undefined
181
- ? {
182
- $case: 'servicePrincipalName',
183
- servicePrincipalName: d.service_principal_name,
184
- }
185
- : undefined,
181
+ const unmarshalEmptySchema = z.object({});
182
+ const unmarshalListAlertsResponseSchema = z.object({
183
+ alerts: z.array(z.lazy(() => unmarshalAlertSchema)).optional(),
184
+ next_page_token: z.string().optional()
185
+ }).transform((d) => ({
186
+ alerts: d.alerts,
187
+ nextPageToken: d.next_page_token
186
188
  }));
187
- export const unmarshalAlertStatementParameterSchema = z
188
- .object({
189
- name: z.string().optional(),
190
- value: z.string().optional(),
191
- type: z.string().optional(),
192
- })
193
- .transform(d => ({
194
- name: d.name,
195
- value: d.value,
196
- type: d.type,
189
+ const marshalAlertSchema = z.object({
190
+ id: z.string().optional(),
191
+ displayName: z.string().optional(),
192
+ ownerUserName: z.string().optional(),
193
+ createTime: z.any().transform((d) => d.toString()).optional(),
194
+ updateTime: z.any().transform((d) => d.toString()).optional(),
195
+ parentPath: z.string().optional(),
196
+ queryText: z.string().optional(),
197
+ warehouseId: z.string().optional(),
198
+ runAsUserName: z.string().optional(),
199
+ evaluation: z.lazy(() => marshalAlertEvaluationSchema).optional(),
200
+ schedule: z.lazy(() => marshalCronScheduleSchema).optional(),
201
+ lifecycleState: z.string().optional(),
202
+ customSummary: z.string().optional(),
203
+ customDescription: z.string().optional(),
204
+ runAs: z.lazy(() => marshalAlertRunAsSchema).optional(),
205
+ effectiveRunAs: z.lazy(() => marshalAlertRunAsSchema).optional(),
206
+ parameters: z.array(z.lazy(() => marshalAlertStatementParameterSchema)).optional()
207
+ }).transform((d) => ({
208
+ id: d.id,
209
+ display_name: d.displayName,
210
+ owner_user_name: d.ownerUserName,
211
+ create_time: d.createTime,
212
+ update_time: d.updateTime,
213
+ parent_path: d.parentPath,
214
+ query_text: d.queryText,
215
+ warehouse_id: d.warehouseId,
216
+ run_as_user_name: d.runAsUserName,
217
+ evaluation: d.evaluation,
218
+ schedule: d.schedule,
219
+ lifecycle_state: d.lifecycleState,
220
+ custom_summary: d.customSummary,
221
+ custom_description: d.customDescription,
222
+ run_as: d.runAs,
223
+ effective_run_as: d.effectiveRunAs,
224
+ parameters: d.parameters
197
225
  }));
198
- export const unmarshalAlertSubscriptionSchema = z
199
- .object({
200
- user_email: z.string().optional(),
201
- destination_id: z.string().optional(),
202
- })
203
- .transform(d => ({
204
- subscriptionType: d.user_email !== undefined
205
- ? { $case: 'userEmail', userEmail: d.user_email }
206
- : d.destination_id !== undefined
207
- ? { $case: 'destinationId', destinationId: d.destination_id }
208
- : undefined,
226
+ const marshalAlertEvaluationSchema = z.object({
227
+ source: z.lazy(() => marshalAlertOperandColumnSchema).optional(),
228
+ comparisonOperator: z.string().optional(),
229
+ threshold: z.lazy(() => marshalAlertOperandSchema).optional(),
230
+ notification: z.lazy(() => marshalAlertNotificationSchema).optional(),
231
+ state: z.string().optional(),
232
+ lastEvaluatedAt: z.any().transform((d) => d.toString()).optional(),
233
+ emptyResultState: z.string().optional()
234
+ }).transform((d) => ({
235
+ source: d.source,
236
+ comparison_operator: d.comparisonOperator,
237
+ threshold: d.threshold,
238
+ notification: d.notification,
239
+ state: d.state,
240
+ last_evaluated_at: d.lastEvaluatedAt,
241
+ empty_result_state: d.emptyResultState
209
242
  }));
210
- export const unmarshalCronScheduleSchema = z
211
- .object({
212
- quartz_cron_schedule: z.string().optional(),
213
- timezone_id: z.string().optional(),
214
- pause_status: z.string().optional(),
215
- })
216
- .transform(d => ({
217
- quartzCronSchedule: d.quartz_cron_schedule,
218
- timezoneId: d.timezone_id,
219
- pauseStatus: d.pause_status,
243
+ const marshalAlertNotificationSchema = z.object({
244
+ subscriptions: z.array(z.lazy(() => marshalAlertSubscriptionSchema)).optional(),
245
+ retriggerSeconds: z.number().optional(),
246
+ notifyOnOk: z.boolean().optional()
247
+ }).transform((d) => ({
248
+ subscriptions: d.subscriptions,
249
+ retrigger_seconds: d.retriggerSeconds,
250
+ notify_on_ok: d.notifyOnOk
220
251
  }));
221
- export const unmarshalEmptySchema = z.object({});
222
- export const unmarshalListAlertsResponseSchema = z
223
- .object({
224
- alerts: z.array(z.lazy(() => unmarshalAlertSchema)).optional(),
225
- next_page_token: z.string().optional(),
226
- })
227
- .transform(d => ({
228
- alerts: d.alerts,
229
- nextPageToken: d.next_page_token,
252
+ const marshalAlertOperandSchema = z.object({ operand: z.discriminatedUnion("$case", [z.object({
253
+ $case: z.literal("column"),
254
+ column: z.lazy(() => marshalAlertOperandColumnSchema)
255
+ }), z.object({
256
+ $case: z.literal("value"),
257
+ value: z.lazy(() => marshalAlertOperandValueSchema)
258
+ })]).optional() }).transform((d) => ({
259
+ ...d.operand?.$case === "column" && { column: d.operand.column },
260
+ ...d.operand?.$case === "value" && { value: d.operand.value }
230
261
  }));
231
- export const marshalAlertSchema = z
232
- .object({
233
- id: z.string().optional(),
234
- displayName: z.string().optional(),
235
- ownerUserName: z.string().optional(),
236
- createTime: z
237
- .any()
238
- .transform((d) => d.toString())
239
- .optional(),
240
- updateTime: z
241
- .any()
242
- .transform((d) => d.toString())
243
- .optional(),
244
- parentPath: z.string().optional(),
245
- queryText: z.string().optional(),
246
- warehouseId: z.string().optional(),
247
- runAsUserName: z.string().optional(),
248
- evaluation: z.lazy(() => marshalAlertEvaluationSchema).optional(),
249
- schedule: z.lazy(() => marshalCronScheduleSchema).optional(),
250
- lifecycleState: z.string().optional(),
251
- customSummary: z.string().optional(),
252
- customDescription: z.string().optional(),
253
- runAs: z.lazy(() => marshalAlertRunAsSchema).optional(),
254
- effectiveRunAs: z.lazy(() => marshalAlertRunAsSchema).optional(),
255
- parameters: z
256
- .array(z.lazy(() => marshalAlertStatementParameterSchema))
257
- .optional(),
258
- })
259
- .transform(d => ({
260
- id: d.id,
261
- display_name: d.displayName,
262
- owner_user_name: d.ownerUserName,
263
- create_time: d.createTime,
264
- update_time: d.updateTime,
265
- parent_path: d.parentPath,
266
- query_text: d.queryText,
267
- warehouse_id: d.warehouseId,
268
- run_as_user_name: d.runAsUserName,
269
- evaluation: d.evaluation,
270
- schedule: d.schedule,
271
- lifecycle_state: d.lifecycleState,
272
- custom_summary: d.customSummary,
273
- custom_description: d.customDescription,
274
- run_as: d.runAs,
275
- effective_run_as: d.effectiveRunAs,
276
- parameters: d.parameters,
262
+ const marshalAlertOperandColumnSchema = z.object({
263
+ name: z.string().optional(),
264
+ display: z.string().optional(),
265
+ aggregation: z.string().optional()
266
+ }).transform((d) => ({
267
+ name: d.name,
268
+ display: d.display,
269
+ aggregation: d.aggregation
277
270
  }));
278
- export const marshalAlertEvaluationSchema = z
279
- .object({
280
- source: z.lazy(() => marshalAlertOperandColumnSchema).optional(),
281
- comparisonOperator: z.string().optional(),
282
- threshold: z.lazy(() => marshalAlertOperandSchema).optional(),
283
- notification: z.lazy(() => marshalAlertNotificationSchema).optional(),
284
- state: z.string().optional(),
285
- lastEvaluatedAt: z
286
- .any()
287
- .transform((d) => d.toString())
288
- .optional(),
289
- emptyResultState: z.string().optional(),
290
- })
291
- .transform(d => ({
292
- source: d.source,
293
- comparison_operator: d.comparisonOperator,
294
- threshold: d.threshold,
295
- notification: d.notification,
296
- state: d.state,
297
- last_evaluated_at: d.lastEvaluatedAt,
298
- empty_result_state: d.emptyResultState,
271
+ const marshalAlertOperandValueSchema = z.object({ value: z.discriminatedUnion("$case", [
272
+ z.object({
273
+ $case: z.literal("stringValue"),
274
+ stringValue: z.string()
275
+ }),
276
+ z.object({
277
+ $case: z.literal("doubleValue"),
278
+ doubleValue: z.number()
279
+ }),
280
+ z.object({
281
+ $case: z.literal("boolValue"),
282
+ boolValue: z.boolean()
283
+ })
284
+ ]).optional() }).transform((d) => ({
285
+ ...d.value?.$case === "stringValue" && { string_value: d.value.stringValue },
286
+ ...d.value?.$case === "doubleValue" && { double_value: d.value.doubleValue },
287
+ ...d.value?.$case === "boolValue" && { bool_value: d.value.boolValue }
299
288
  }));
300
- export const marshalAlertNotificationSchema = z
301
- .object({
302
- subscriptions: z
303
- .array(z.lazy(() => marshalAlertSubscriptionSchema))
304
- .optional(),
305
- retriggerSeconds: z.number().optional(),
306
- notifyOnOk: z.boolean().optional(),
307
- })
308
- .transform(d => ({
309
- subscriptions: d.subscriptions,
310
- retrigger_seconds: d.retriggerSeconds,
311
- notify_on_ok: d.notifyOnOk,
289
+ const marshalAlertRunAsSchema = z.object({ identity: z.discriminatedUnion("$case", [z.object({
290
+ $case: z.literal("userName"),
291
+ userName: z.string()
292
+ }), z.object({
293
+ $case: z.literal("servicePrincipalName"),
294
+ servicePrincipalName: z.string()
295
+ })]).optional() }).transform((d) => ({
296
+ ...d.identity?.$case === "userName" && { user_name: d.identity.userName },
297
+ ...d.identity?.$case === "servicePrincipalName" && { service_principal_name: d.identity.servicePrincipalName }
312
298
  }));
313
- export const marshalAlertOperandSchema = z
314
- .object({
315
- operand: z
316
- .discriminatedUnion('$case', [
317
- z.object({
318
- $case: z.literal('column'),
319
- column: z.lazy(() => marshalAlertOperandColumnSchema),
320
- }),
321
- z.object({
322
- $case: z.literal('value'),
323
- value: z.lazy(() => marshalAlertOperandValueSchema),
324
- }),
325
- ])
326
- .optional(),
327
- })
328
- .transform(d => ({
329
- ...(d.operand?.$case === 'column' && { column: d.operand.column }),
330
- ...(d.operand?.$case === 'value' && { value: d.operand.value }),
299
+ const marshalAlertStatementParameterSchema = z.object({
300
+ name: z.string().optional(),
301
+ value: z.string().optional(),
302
+ type: z.string().optional()
303
+ }).transform((d) => ({
304
+ name: d.name,
305
+ value: d.value,
306
+ type: d.type
331
307
  }));
332
- export const marshalAlertOperandColumnSchema = z
333
- .object({
334
- name: z.string().optional(),
335
- display: z.string().optional(),
336
- aggregation: z.string().optional(),
337
- })
338
- .transform(d => ({
339
- name: d.name,
340
- display: d.display,
341
- aggregation: d.aggregation,
308
+ const marshalAlertSubscriptionSchema = z.object({ subscriptionType: z.discriminatedUnion("$case", [z.object({
309
+ $case: z.literal("userEmail"),
310
+ userEmail: z.string()
311
+ }), z.object({
312
+ $case: z.literal("destinationId"),
313
+ destinationId: z.string()
314
+ })]).optional() }).transform((d) => ({
315
+ ...d.subscriptionType?.$case === "userEmail" && { user_email: d.subscriptionType.userEmail },
316
+ ...d.subscriptionType?.$case === "destinationId" && { destination_id: d.subscriptionType.destinationId }
342
317
  }));
343
- export const marshalAlertOperandValueSchema = z
344
- .object({
345
- value: z
346
- .discriminatedUnion('$case', [
347
- z.object({ $case: z.literal('stringValue'), stringValue: z.string() }),
348
- z.object({ $case: z.literal('doubleValue'), doubleValue: z.number() }),
349
- z.object({ $case: z.literal('boolValue'), boolValue: z.boolean() }),
350
- ])
351
- .optional(),
352
- })
353
- .transform(d => ({
354
- ...(d.value?.$case === 'stringValue' && {
355
- string_value: d.value.stringValue,
356
- }),
357
- ...(d.value?.$case === 'doubleValue' && {
358
- double_value: d.value.doubleValue,
359
- }),
360
- ...(d.value?.$case === 'boolValue' && { bool_value: d.value.boolValue }),
361
- }));
362
- export const marshalAlertRunAsSchema = z
363
- .object({
364
- identity: z
365
- .discriminatedUnion('$case', [
366
- z.object({ $case: z.literal('userName'), userName: z.string() }),
367
- z.object({
368
- $case: z.literal('servicePrincipalName'),
369
- servicePrincipalName: z.string(),
370
- }),
371
- ])
372
- .optional(),
373
- })
374
- .transform(d => ({
375
- ...(d.identity?.$case === 'userName' && { user_name: d.identity.userName }),
376
- ...(d.identity?.$case === 'servicePrincipalName' && {
377
- service_principal_name: d.identity.servicePrincipalName,
378
- }),
379
- }));
380
- export const marshalAlertStatementParameterSchema = z
381
- .object({
382
- name: z.string().optional(),
383
- value: z.string().optional(),
384
- type: z.string().optional(),
385
- })
386
- .transform(d => ({
387
- name: d.name,
388
- value: d.value,
389
- type: d.type,
390
- }));
391
- export const marshalAlertSubscriptionSchema = z
392
- .object({
393
- subscriptionType: z
394
- .discriminatedUnion('$case', [
395
- z.object({ $case: z.literal('userEmail'), userEmail: z.string() }),
396
- z.object({
397
- $case: z.literal('destinationId'),
398
- destinationId: z.string(),
399
- }),
400
- ])
401
- .optional(),
402
- })
403
- .transform(d => ({
404
- ...(d.subscriptionType?.$case === 'userEmail' && {
405
- user_email: d.subscriptionType.userEmail,
406
- }),
407
- ...(d.subscriptionType?.$case === 'destinationId' && {
408
- destination_id: d.subscriptionType.destinationId,
409
- }),
410
- }));
411
- export const marshalCronScheduleSchema = z
412
- .object({
413
- quartzCronSchedule: z.string().optional(),
414
- timezoneId: z.string().optional(),
415
- pauseStatus: z.string().optional(),
416
- })
417
- .transform(d => ({
418
- quartz_cron_schedule: d.quartzCronSchedule,
419
- timezone_id: d.timezoneId,
420
- pause_status: d.pauseStatus,
318
+ const marshalCronScheduleSchema = z.object({
319
+ quartzCronSchedule: z.string().optional(),
320
+ timezoneId: z.string().optional(),
321
+ pauseStatus: z.string().optional()
322
+ }).transform((d) => ({
323
+ quartz_cron_schedule: d.quartzCronSchedule,
324
+ timezone_id: d.timezoneId,
325
+ pause_status: d.pauseStatus
421
326
  }));
422
327
  const alertFieldMaskSchema = {
423
- createTime: { wire: 'create_time' },
424
- customDescription: { wire: 'custom_description' },
425
- customSummary: { wire: 'custom_summary' },
426
- displayName: { wire: 'display_name' },
427
- effectiveRunAs: {
428
- wire: 'effective_run_as',
429
- children: () => alertRunAsFieldMaskSchema,
430
- },
431
- evaluation: {
432
- wire: 'evaluation',
433
- children: () => alertEvaluationFieldMaskSchema,
434
- },
435
- id: { wire: 'id' },
436
- lifecycleState: { wire: 'lifecycle_state' },
437
- ownerUserName: { wire: 'owner_user_name' },
438
- parameters: { wire: 'parameters' },
439
- parentPath: { wire: 'parent_path' },
440
- queryText: { wire: 'query_text' },
441
- runAs: { wire: 'run_as', children: () => alertRunAsFieldMaskSchema },
442
- runAsUserName: { wire: 'run_as_user_name' },
443
- schedule: { wire: 'schedule', children: () => cronScheduleFieldMaskSchema },
444
- updateTime: { wire: 'update_time' },
445
- warehouseId: { wire: 'warehouse_id' },
328
+ createTime: { wire: "create_time" },
329
+ customDescription: { wire: "custom_description" },
330
+ customSummary: { wire: "custom_summary" },
331
+ displayName: { wire: "display_name" },
332
+ effectiveRunAs: {
333
+ wire: "effective_run_as",
334
+ children: () => alertRunAsFieldMaskSchema
335
+ },
336
+ evaluation: {
337
+ wire: "evaluation",
338
+ children: () => alertEvaluationFieldMaskSchema
339
+ },
340
+ id: { wire: "id" },
341
+ lifecycleState: { wire: "lifecycle_state" },
342
+ ownerUserName: { wire: "owner_user_name" },
343
+ parameters: { wire: "parameters" },
344
+ parentPath: { wire: "parent_path" },
345
+ queryText: { wire: "query_text" },
346
+ runAs: {
347
+ wire: "run_as",
348
+ children: () => alertRunAsFieldMaskSchema
349
+ },
350
+ runAsUserName: { wire: "run_as_user_name" },
351
+ schedule: {
352
+ wire: "schedule",
353
+ children: () => cronScheduleFieldMaskSchema
354
+ },
355
+ updateTime: { wire: "update_time" },
356
+ warehouseId: { wire: "warehouse_id" }
446
357
  };
447
- export function alertFieldMask(...paths) {
448
- return FieldMask.build(paths, alertFieldMaskSchema);
358
+ function alertFieldMask(...paths) {
359
+ return FieldMask.build(paths, alertFieldMaskSchema);
449
360
  }
450
361
  const alertEvaluationFieldMaskSchema = {
451
- comparisonOperator: { wire: 'comparison_operator' },
452
- emptyResultState: { wire: 'empty_result_state' },
453
- lastEvaluatedAt: { wire: 'last_evaluated_at' },
454
- notification: {
455
- wire: 'notification',
456
- children: () => alertNotificationFieldMaskSchema,
457
- },
458
- source: { wire: 'source', children: () => alertOperandColumnFieldMaskSchema },
459
- state: { wire: 'state' },
460
- threshold: { wire: 'threshold', children: () => alertOperandFieldMaskSchema },
362
+ comparisonOperator: { wire: "comparison_operator" },
363
+ emptyResultState: { wire: "empty_result_state" },
364
+ lastEvaluatedAt: { wire: "last_evaluated_at" },
365
+ notification: {
366
+ wire: "notification",
367
+ children: () => alertNotificationFieldMaskSchema
368
+ },
369
+ source: {
370
+ wire: "source",
371
+ children: () => alertOperandColumnFieldMaskSchema
372
+ },
373
+ state: { wire: "state" },
374
+ threshold: {
375
+ wire: "threshold",
376
+ children: () => alertOperandFieldMaskSchema
377
+ }
461
378
  };
462
379
  const alertNotificationFieldMaskSchema = {
463
- notifyOnOk: { wire: 'notify_on_ok' },
464
- retriggerSeconds: { wire: 'retrigger_seconds' },
465
- subscriptions: { wire: 'subscriptions' },
380
+ notifyOnOk: { wire: "notify_on_ok" },
381
+ retriggerSeconds: { wire: "retrigger_seconds" },
382
+ subscriptions: { wire: "subscriptions" }
466
383
  };
467
384
  const alertOperandFieldMaskSchema = {
468
- column: { wire: 'column', children: () => alertOperandColumnFieldMaskSchema },
469
- value: { wire: 'value', children: () => alertOperandValueFieldMaskSchema },
385
+ column: {
386
+ wire: "column",
387
+ children: () => alertOperandColumnFieldMaskSchema
388
+ },
389
+ value: {
390
+ wire: "value",
391
+ children: () => alertOperandValueFieldMaskSchema
392
+ }
470
393
  };
471
394
  const alertOperandColumnFieldMaskSchema = {
472
- aggregation: { wire: 'aggregation' },
473
- display: { wire: 'display' },
474
- name: { wire: 'name' },
395
+ aggregation: { wire: "aggregation" },
396
+ display: { wire: "display" },
397
+ name: { wire: "name" }
475
398
  };
476
399
  const alertOperandValueFieldMaskSchema = {
477
- boolValue: { wire: 'bool_value' },
478
- doubleValue: { wire: 'double_value' },
479
- stringValue: { wire: 'string_value' },
400
+ boolValue: { wire: "bool_value" },
401
+ doubleValue: { wire: "double_value" },
402
+ stringValue: { wire: "string_value" }
480
403
  };
481
404
  const alertRunAsFieldMaskSchema = {
482
- servicePrincipalName: { wire: 'service_principal_name' },
483
- userName: { wire: 'user_name' },
405
+ servicePrincipalName: { wire: "service_principal_name" },
406
+ userName: { wire: "user_name" }
484
407
  };
485
408
  const cronScheduleFieldMaskSchema = {
486
- pauseStatus: { wire: 'pause_status' },
487
- quartzCronSchedule: { wire: 'quartz_cron_schedule' },
488
- timezoneId: { wire: 'timezone_id' },
409
+ pauseStatus: { wire: "pause_status" },
410
+ quartzCronSchedule: { wire: "quartz_cron_schedule" },
411
+ timezoneId: { wire: "timezone_id" }
489
412
  };
413
+
414
+ //#endregion
415
+ export { Aggregation, AlertEvaluationState, AlertLifecycleState, ComparisonOperator, SchedulePauseStatus, alertFieldMask, marshalAlertEvaluationSchema, marshalAlertNotificationSchema, marshalAlertOperandColumnSchema, marshalAlertOperandSchema, marshalAlertOperandValueSchema, marshalAlertRunAsSchema, marshalAlertSchema, marshalAlertStatementParameterSchema, marshalAlertSubscriptionSchema, marshalCronScheduleSchema, unmarshalAlertEvaluationSchema, unmarshalAlertNotificationSchema, unmarshalAlertOperandColumnSchema, unmarshalAlertOperandSchema, unmarshalAlertOperandValueSchema, unmarshalAlertRunAsSchema, unmarshalAlertSchema, unmarshalAlertStatementParameterSchema, unmarshalAlertSubscriptionSchema, unmarshalCronScheduleSchema, unmarshalEmptySchema, unmarshalListAlertsResponseSchema };
490
416
  //# sourceMappingURL=model.js.map