@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/v1/model.js CHANGED
@@ -1,384 +1,312 @@
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 AlertOperator = {
7
- GREATER_THAN: 'GREATER_THAN',
8
- GREATER_THAN_OR_EQUAL: 'GREATER_THAN_OR_EQUAL',
9
- LESS_THAN: 'LESS_THAN',
10
- LESS_THAN_OR_EQUAL: 'LESS_THAN_OR_EQUAL',
11
- EQUAL: 'EQUAL',
12
- NOT_EQUAL: 'NOT_EQUAL',
13
- IS_NULL: 'IS_NULL',
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { FieldMask } from "@databricks/sdk-core/wkt";
3
+ import { z } from "zod";
4
+
5
+ //#region src/v1/model.ts
6
+ const AlertOperator = {
7
+ GREATER_THAN: "GREATER_THAN",
8
+ GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL",
9
+ LESS_THAN: "LESS_THAN",
10
+ LESS_THAN_OR_EQUAL: "LESS_THAN_OR_EQUAL",
11
+ EQUAL: "EQUAL",
12
+ NOT_EQUAL: "NOT_EQUAL",
13
+ IS_NULL: "IS_NULL"
14
14
  };
15
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
16
- export const AlertState = {
17
- UNKNOWN: 'UNKNOWN',
18
- OK: 'OK',
19
- TRIGGERED: 'TRIGGERED',
15
+ const AlertState = {
16
+ UNKNOWN: "UNKNOWN",
17
+ OK: "OK",
18
+ TRIGGERED: "TRIGGERED"
20
19
  };
21
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
22
- export const LifecycleState = {
23
- ACTIVE: 'ACTIVE',
24
- TRASHED: 'TRASHED',
20
+ const LifecycleState = {
21
+ ACTIVE: "ACTIVE",
22
+ TRASHED: "TRASHED"
25
23
  };
26
- export const unmarshalAlertSchema = z
27
- .object({
28
- id: z.string().optional(),
29
- display_name: z.string().optional(),
30
- query_id: z.string().optional(),
31
- state: z.string().optional(),
32
- seconds_to_retrigger: z.number().optional(),
33
- lifecycle_state: z.string().optional(),
34
- trigger_time: z
35
- .string()
36
- .transform(s => Temporal.Instant.from(s))
37
- .optional(),
38
- custom_body: z.string().optional(),
39
- custom_subject: z.string().optional(),
40
- condition: z.lazy(() => unmarshalAlertConditionSchema).optional(),
41
- owner_user_name: z.string().optional(),
42
- parent_path: z.string().optional(),
43
- create_time: z
44
- .string()
45
- .transform(s => Temporal.Instant.from(s))
46
- .optional(),
47
- update_time: z
48
- .string()
49
- .transform(s => Temporal.Instant.from(s))
50
- .optional(),
51
- notify_on_ok: z.boolean().optional(),
52
- })
53
- .transform(d => ({
54
- id: d.id,
55
- displayName: d.display_name,
56
- queryId: d.query_id,
57
- state: d.state,
58
- secondsToRetrigger: d.seconds_to_retrigger,
59
- lifecycleState: d.lifecycle_state,
60
- triggerTime: d.trigger_time,
61
- customBody: d.custom_body,
62
- customSubject: d.custom_subject,
63
- condition: d.condition,
64
- ownerUserName: d.owner_user_name,
65
- parentPath: d.parent_path,
66
- createTime: d.create_time,
67
- updateTime: d.update_time,
68
- notifyOnOk: d.notify_on_ok,
24
+ const unmarshalAlertSchema = z.object({
25
+ id: z.string().optional(),
26
+ display_name: z.string().optional(),
27
+ query_id: z.string().optional(),
28
+ state: z.string().optional(),
29
+ seconds_to_retrigger: z.number().optional(),
30
+ lifecycle_state: z.string().optional(),
31
+ trigger_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
32
+ custom_body: z.string().optional(),
33
+ custom_subject: z.string().optional(),
34
+ condition: z.lazy(() => unmarshalAlertConditionSchema).optional(),
35
+ owner_user_name: z.string().optional(),
36
+ parent_path: z.string().optional(),
37
+ create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
38
+ update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
39
+ notify_on_ok: z.boolean().optional()
40
+ }).transform((d) => ({
41
+ id: d.id,
42
+ displayName: d.display_name,
43
+ queryId: d.query_id,
44
+ state: d.state,
45
+ secondsToRetrigger: d.seconds_to_retrigger,
46
+ lifecycleState: d.lifecycle_state,
47
+ triggerTime: d.trigger_time,
48
+ customBody: d.custom_body,
49
+ customSubject: d.custom_subject,
50
+ condition: d.condition,
51
+ ownerUserName: d.owner_user_name,
52
+ parentPath: d.parent_path,
53
+ createTime: d.create_time,
54
+ updateTime: d.update_time,
55
+ notifyOnOk: d.notify_on_ok
69
56
  }));
70
- export const unmarshalAlertConditionSchema = z
71
- .object({
72
- op: z.string().optional(),
73
- operand: z.lazy(() => unmarshalAlertOperandSchema).optional(),
74
- threshold: z.lazy(() => unmarshalAlertOperandSchema).optional(),
75
- empty_result_state: z.string().optional(),
76
- })
77
- .transform(d => ({
78
- op: d.op,
79
- operand: d.operand,
80
- threshold: d.threshold,
81
- emptyResultState: d.empty_result_state,
57
+ const unmarshalAlertConditionSchema = z.object({
58
+ op: z.string().optional(),
59
+ operand: z.lazy(() => unmarshalAlertOperandSchema).optional(),
60
+ threshold: z.lazy(() => unmarshalAlertOperandSchema).optional(),
61
+ empty_result_state: z.string().optional()
62
+ }).transform((d) => ({
63
+ op: d.op,
64
+ operand: d.operand,
65
+ threshold: d.threshold,
66
+ emptyResultState: d.empty_result_state
82
67
  }));
83
- export const unmarshalAlertOperandSchema = z
84
- .object({
85
- value: z.lazy(() => unmarshalAlertOperandValueSchema).optional(),
86
- column: z.lazy(() => unmarshalAlertOperandColumnSchema).optional(),
87
- })
88
- .transform(d => ({
89
- operand: d.value !== undefined
90
- ? { $case: 'value', value: d.value }
91
- : d.column !== undefined
92
- ? { $case: 'column', column: d.column }
93
- : undefined,
68
+ const unmarshalAlertOperandSchema = z.object({
69
+ value: z.lazy(() => unmarshalAlertOperandValueSchema).optional(),
70
+ column: z.lazy(() => unmarshalAlertOperandColumnSchema).optional()
71
+ }).transform((d) => ({ operand: d.value !== void 0 ? {
72
+ $case: "value",
73
+ value: d.value
74
+ } : d.column !== void 0 ? {
75
+ $case: "column",
76
+ column: d.column
77
+ } : void 0 }));
78
+ const unmarshalAlertOperandColumnSchema = z.object({ name: z.string().optional() }).transform((d) => ({ name: d.name }));
79
+ const unmarshalAlertOperandValueSchema = z.object({
80
+ string_value: z.string().optional(),
81
+ double_value: z.number().optional(),
82
+ bool_value: z.boolean().optional()
83
+ }).transform((d) => ({ thresholdValue: d.string_value !== void 0 ? {
84
+ $case: "stringValue",
85
+ stringValue: d.string_value
86
+ } : d.double_value !== void 0 ? {
87
+ $case: "doubleValue",
88
+ doubleValue: d.double_value
89
+ } : d.bool_value !== void 0 ? {
90
+ $case: "boolValue",
91
+ boolValue: d.bool_value
92
+ } : void 0 }));
93
+ const unmarshalEmptySchema = z.object({});
94
+ const unmarshalListAlertsResponseSchema = z.object({
95
+ results: z.array(z.lazy(() => unmarshalListAlertsResponseAlertSchema)).optional(),
96
+ next_page_token: z.string().optional()
97
+ }).transform((d) => ({
98
+ results: d.results,
99
+ nextPageToken: d.next_page_token
94
100
  }));
95
- export const unmarshalAlertOperandColumnSchema = z
96
- .object({
97
- name: z.string().optional(),
98
- })
99
- .transform(d => ({
100
- name: d.name,
101
+ const unmarshalListAlertsResponseAlertSchema = z.object({
102
+ id: z.string().optional(),
103
+ display_name: z.string().optional(),
104
+ query_id: z.string().optional(),
105
+ state: z.string().optional(),
106
+ seconds_to_retrigger: z.number().optional(),
107
+ lifecycle_state: z.string().optional(),
108
+ trigger_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
109
+ custom_body: z.string().optional(),
110
+ custom_subject: z.string().optional(),
111
+ condition: z.lazy(() => unmarshalAlertConditionSchema).optional(),
112
+ owner_user_name: z.string().optional(),
113
+ parent_path: z.string().optional(),
114
+ create_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
115
+ update_time: z.string().transform((s) => Temporal.Instant.from(s)).optional(),
116
+ notify_on_ok: z.boolean().optional()
117
+ }).transform((d) => ({
118
+ id: d.id,
119
+ displayName: d.display_name,
120
+ queryId: d.query_id,
121
+ state: d.state,
122
+ secondsToRetrigger: d.seconds_to_retrigger,
123
+ lifecycleState: d.lifecycle_state,
124
+ triggerTime: d.trigger_time,
125
+ customBody: d.custom_body,
126
+ customSubject: d.custom_subject,
127
+ condition: d.condition,
128
+ ownerUserName: d.owner_user_name,
129
+ parentPath: d.parent_path,
130
+ createTime: d.create_time,
131
+ updateTime: d.update_time,
132
+ notifyOnOk: d.notify_on_ok
101
133
  }));
102
- export const unmarshalAlertOperandValueSchema = z
103
- .object({
104
- string_value: z.string().optional(),
105
- double_value: z.number().optional(),
106
- bool_value: z.boolean().optional(),
107
- })
108
- .transform(d => ({
109
- thresholdValue: d.string_value !== undefined
110
- ? { $case: 'stringValue', stringValue: d.string_value }
111
- : d.double_value !== undefined
112
- ? { $case: 'doubleValue', doubleValue: d.double_value }
113
- : d.bool_value !== undefined
114
- ? { $case: 'boolValue', boolValue: d.bool_value }
115
- : undefined,
134
+ const marshalAlertConditionSchema = z.object({
135
+ op: z.string().optional(),
136
+ operand: z.lazy(() => marshalAlertOperandSchema).optional(),
137
+ threshold: z.lazy(() => marshalAlertOperandSchema).optional(),
138
+ emptyResultState: z.string().optional()
139
+ }).transform((d) => ({
140
+ op: d.op,
141
+ operand: d.operand,
142
+ threshold: d.threshold,
143
+ empty_result_state: d.emptyResultState
116
144
  }));
117
- export const unmarshalEmptySchema = z.object({});
118
- export const unmarshalListAlertsResponseSchema = z
119
- .object({
120
- results: z
121
- .array(z.lazy(() => unmarshalListAlertsResponseAlertSchema))
122
- .optional(),
123
- next_page_token: z.string().optional(),
124
- })
125
- .transform(d => ({
126
- results: d.results,
127
- nextPageToken: d.next_page_token,
145
+ const marshalAlertOperandSchema = z.object({ operand: z.discriminatedUnion("$case", [z.object({
146
+ $case: z.literal("value"),
147
+ value: z.lazy(() => marshalAlertOperandValueSchema)
148
+ }), z.object({
149
+ $case: z.literal("column"),
150
+ column: z.lazy(() => marshalAlertOperandColumnSchema)
151
+ })]).optional() }).transform((d) => ({
152
+ ...d.operand?.$case === "value" && { value: d.operand.value },
153
+ ...d.operand?.$case === "column" && { column: d.operand.column }
128
154
  }));
129
- export const unmarshalListAlertsResponseAlertSchema = z
130
- .object({
131
- id: z.string().optional(),
132
- display_name: z.string().optional(),
133
- query_id: z.string().optional(),
134
- state: z.string().optional(),
135
- seconds_to_retrigger: z.number().optional(),
136
- lifecycle_state: z.string().optional(),
137
- trigger_time: z
138
- .string()
139
- .transform(s => Temporal.Instant.from(s))
140
- .optional(),
141
- custom_body: z.string().optional(),
142
- custom_subject: z.string().optional(),
143
- condition: z.lazy(() => unmarshalAlertConditionSchema).optional(),
144
- owner_user_name: z.string().optional(),
145
- parent_path: z.string().optional(),
146
- create_time: z
147
- .string()
148
- .transform(s => Temporal.Instant.from(s))
149
- .optional(),
150
- update_time: z
151
- .string()
152
- .transform(s => Temporal.Instant.from(s))
153
- .optional(),
154
- notify_on_ok: z.boolean().optional(),
155
- })
156
- .transform(d => ({
157
- id: d.id,
158
- displayName: d.display_name,
159
- queryId: d.query_id,
160
- state: d.state,
161
- secondsToRetrigger: d.seconds_to_retrigger,
162
- lifecycleState: d.lifecycle_state,
163
- triggerTime: d.trigger_time,
164
- customBody: d.custom_body,
165
- customSubject: d.custom_subject,
166
- condition: d.condition,
167
- ownerUserName: d.owner_user_name,
168
- parentPath: d.parent_path,
169
- createTime: d.create_time,
170
- updateTime: d.update_time,
171
- notifyOnOk: d.notify_on_ok,
155
+ const marshalAlertOperandColumnSchema = z.object({ name: z.string().optional() }).transform((d) => ({ name: d.name }));
156
+ const marshalAlertOperandValueSchema = z.object({ thresholdValue: z.discriminatedUnion("$case", [
157
+ z.object({
158
+ $case: z.literal("stringValue"),
159
+ stringValue: z.string()
160
+ }),
161
+ z.object({
162
+ $case: z.literal("doubleValue"),
163
+ doubleValue: z.number()
164
+ }),
165
+ z.object({
166
+ $case: z.literal("boolValue"),
167
+ boolValue: z.boolean()
168
+ })
169
+ ]).optional() }).transform((d) => ({
170
+ ...d.thresholdValue?.$case === "stringValue" && { string_value: d.thresholdValue.stringValue },
171
+ ...d.thresholdValue?.$case === "doubleValue" && { double_value: d.thresholdValue.doubleValue },
172
+ ...d.thresholdValue?.$case === "boolValue" && { bool_value: d.thresholdValue.boolValue }
172
173
  }));
173
- export const marshalAlertConditionSchema = z
174
- .object({
175
- op: z.string().optional(),
176
- operand: z.lazy(() => marshalAlertOperandSchema).optional(),
177
- threshold: z.lazy(() => marshalAlertOperandSchema).optional(),
178
- emptyResultState: z.string().optional(),
179
- })
180
- .transform(d => ({
181
- op: d.op,
182
- operand: d.operand,
183
- threshold: d.threshold,
184
- empty_result_state: d.emptyResultState,
174
+ const marshalCreateAlertRequestSchema = z.object({
175
+ alert: z.lazy(() => marshalCreateAlertRequestAlertSchema).optional(),
176
+ autoResolveDisplayName: z.boolean().optional()
177
+ }).transform((d) => ({
178
+ alert: d.alert,
179
+ auto_resolve_display_name: d.autoResolveDisplayName
185
180
  }));
186
- export const marshalAlertOperandSchema = z
187
- .object({
188
- operand: z
189
- .discriminatedUnion('$case', [
190
- z.object({
191
- $case: z.literal('value'),
192
- value: z.lazy(() => marshalAlertOperandValueSchema),
193
- }),
194
- z.object({
195
- $case: z.literal('column'),
196
- column: z.lazy(() => marshalAlertOperandColumnSchema),
197
- }),
198
- ])
199
- .optional(),
200
- })
201
- .transform(d => ({
202
- ...(d.operand?.$case === 'value' && { value: d.operand.value }),
203
- ...(d.operand?.$case === 'column' && { column: d.operand.column }),
181
+ const marshalCreateAlertRequestAlertSchema = z.object({
182
+ id: z.string().optional(),
183
+ displayName: z.string().optional(),
184
+ queryId: z.string().optional(),
185
+ state: z.string().optional(),
186
+ secondsToRetrigger: z.number().optional(),
187
+ lifecycleState: z.string().optional(),
188
+ triggerTime: z.any().transform((d) => d.toString()).optional(),
189
+ customBody: z.string().optional(),
190
+ customSubject: z.string().optional(),
191
+ condition: z.lazy(() => marshalAlertConditionSchema).optional(),
192
+ ownerUserName: z.string().optional(),
193
+ parentPath: z.string().optional(),
194
+ createTime: z.any().transform((d) => d.toString()).optional(),
195
+ updateTime: z.any().transform((d) => d.toString()).optional(),
196
+ notifyOnOk: z.boolean().optional()
197
+ }).transform((d) => ({
198
+ id: d.id,
199
+ display_name: d.displayName,
200
+ query_id: d.queryId,
201
+ state: d.state,
202
+ seconds_to_retrigger: d.secondsToRetrigger,
203
+ lifecycle_state: d.lifecycleState,
204
+ trigger_time: d.triggerTime,
205
+ custom_body: d.customBody,
206
+ custom_subject: d.customSubject,
207
+ condition: d.condition,
208
+ owner_user_name: d.ownerUserName,
209
+ parent_path: d.parentPath,
210
+ create_time: d.createTime,
211
+ update_time: d.updateTime,
212
+ notify_on_ok: d.notifyOnOk
204
213
  }));
205
- export const marshalAlertOperandColumnSchema = z
206
- .object({
207
- name: z.string().optional(),
208
- })
209
- .transform(d => ({
210
- name: d.name,
214
+ const marshalUpdateAlertRequestSchema = z.object({
215
+ alert: z.lazy(() => marshalUpdateAlertRequestAlertSchema).optional(),
216
+ updateMask: z.any().transform((m) => m.toString()).optional(),
217
+ id: z.string().optional(),
218
+ autoResolveDisplayName: z.boolean().optional()
219
+ }).transform((d) => ({
220
+ alert: d.alert,
221
+ update_mask: d.updateMask,
222
+ id: d.id,
223
+ auto_resolve_display_name: d.autoResolveDisplayName
211
224
  }));
212
- export const marshalAlertOperandValueSchema = z
213
- .object({
214
- thresholdValue: z
215
- .discriminatedUnion('$case', [
216
- z.object({ $case: z.literal('stringValue'), stringValue: z.string() }),
217
- z.object({ $case: z.literal('doubleValue'), doubleValue: z.number() }),
218
- z.object({ $case: z.literal('boolValue'), boolValue: z.boolean() }),
219
- ])
220
- .optional(),
221
- })
222
- .transform(d => ({
223
- ...(d.thresholdValue?.$case === 'stringValue' && {
224
- string_value: d.thresholdValue.stringValue,
225
- }),
226
- ...(d.thresholdValue?.$case === 'doubleValue' && {
227
- double_value: d.thresholdValue.doubleValue,
228
- }),
229
- ...(d.thresholdValue?.$case === 'boolValue' && {
230
- bool_value: d.thresholdValue.boolValue,
231
- }),
232
- }));
233
- export const marshalCreateAlertRequestSchema = z
234
- .object({
235
- alert: z.lazy(() => marshalCreateAlertRequestAlertSchema).optional(),
236
- autoResolveDisplayName: z.boolean().optional(),
237
- })
238
- .transform(d => ({
239
- alert: d.alert,
240
- auto_resolve_display_name: d.autoResolveDisplayName,
241
- }));
242
- export const marshalCreateAlertRequestAlertSchema = z
243
- .object({
244
- id: z.string().optional(),
245
- displayName: z.string().optional(),
246
- queryId: z.string().optional(),
247
- state: z.string().optional(),
248
- secondsToRetrigger: z.number().optional(),
249
- lifecycleState: z.string().optional(),
250
- triggerTime: z
251
- .any()
252
- .transform((d) => d.toString())
253
- .optional(),
254
- customBody: z.string().optional(),
255
- customSubject: z.string().optional(),
256
- condition: z.lazy(() => marshalAlertConditionSchema).optional(),
257
- ownerUserName: z.string().optional(),
258
- parentPath: z.string().optional(),
259
- createTime: z
260
- .any()
261
- .transform((d) => d.toString())
262
- .optional(),
263
- updateTime: z
264
- .any()
265
- .transform((d) => d.toString())
266
- .optional(),
267
- notifyOnOk: z.boolean().optional(),
268
- })
269
- .transform(d => ({
270
- id: d.id,
271
- display_name: d.displayName,
272
- query_id: d.queryId,
273
- state: d.state,
274
- seconds_to_retrigger: d.secondsToRetrigger,
275
- lifecycle_state: d.lifecycleState,
276
- trigger_time: d.triggerTime,
277
- custom_body: d.customBody,
278
- custom_subject: d.customSubject,
279
- condition: d.condition,
280
- owner_user_name: d.ownerUserName,
281
- parent_path: d.parentPath,
282
- create_time: d.createTime,
283
- update_time: d.updateTime,
284
- notify_on_ok: d.notifyOnOk,
285
- }));
286
- export const marshalUpdateAlertRequestSchema = z
287
- .object({
288
- alert: z.lazy(() => marshalUpdateAlertRequestAlertSchema).optional(),
289
- updateMask: z
290
- .any()
291
- .transform((m) => m.toString())
292
- .optional(),
293
- id: z.string().optional(),
294
- autoResolveDisplayName: z.boolean().optional(),
295
- })
296
- .transform(d => ({
297
- alert: d.alert,
298
- update_mask: d.updateMask,
299
- id: d.id,
300
- auto_resolve_display_name: d.autoResolveDisplayName,
301
- }));
302
- export const marshalUpdateAlertRequestAlertSchema = z
303
- .object({
304
- id: z.string().optional(),
305
- displayName: z.string().optional(),
306
- queryId: z.string().optional(),
307
- state: z.string().optional(),
308
- secondsToRetrigger: z.number().optional(),
309
- lifecycleState: z.string().optional(),
310
- triggerTime: z
311
- .any()
312
- .transform((d) => d.toString())
313
- .optional(),
314
- customBody: z.string().optional(),
315
- customSubject: z.string().optional(),
316
- condition: z.lazy(() => marshalAlertConditionSchema).optional(),
317
- ownerUserName: z.string().optional(),
318
- parentPath: z.string().optional(),
319
- createTime: z
320
- .any()
321
- .transform((d) => d.toString())
322
- .optional(),
323
- updateTime: z
324
- .any()
325
- .transform((d) => d.toString())
326
- .optional(),
327
- notifyOnOk: z.boolean().optional(),
328
- })
329
- .transform(d => ({
330
- id: d.id,
331
- display_name: d.displayName,
332
- query_id: d.queryId,
333
- state: d.state,
334
- seconds_to_retrigger: d.secondsToRetrigger,
335
- lifecycle_state: d.lifecycleState,
336
- trigger_time: d.triggerTime,
337
- custom_body: d.customBody,
338
- custom_subject: d.customSubject,
339
- condition: d.condition,
340
- owner_user_name: d.ownerUserName,
341
- parent_path: d.parentPath,
342
- create_time: d.createTime,
343
- update_time: d.updateTime,
344
- notify_on_ok: d.notifyOnOk,
225
+ const marshalUpdateAlertRequestAlertSchema = z.object({
226
+ id: z.string().optional(),
227
+ displayName: z.string().optional(),
228
+ queryId: z.string().optional(),
229
+ state: z.string().optional(),
230
+ secondsToRetrigger: z.number().optional(),
231
+ lifecycleState: z.string().optional(),
232
+ triggerTime: z.any().transform((d) => d.toString()).optional(),
233
+ customBody: z.string().optional(),
234
+ customSubject: z.string().optional(),
235
+ condition: z.lazy(() => marshalAlertConditionSchema).optional(),
236
+ ownerUserName: z.string().optional(),
237
+ parentPath: z.string().optional(),
238
+ createTime: z.any().transform((d) => d.toString()).optional(),
239
+ updateTime: z.any().transform((d) => d.toString()).optional(),
240
+ notifyOnOk: z.boolean().optional()
241
+ }).transform((d) => ({
242
+ id: d.id,
243
+ display_name: d.displayName,
244
+ query_id: d.queryId,
245
+ state: d.state,
246
+ seconds_to_retrigger: d.secondsToRetrigger,
247
+ lifecycle_state: d.lifecycleState,
248
+ trigger_time: d.triggerTime,
249
+ custom_body: d.customBody,
250
+ custom_subject: d.customSubject,
251
+ condition: d.condition,
252
+ owner_user_name: d.ownerUserName,
253
+ parent_path: d.parentPath,
254
+ create_time: d.createTime,
255
+ update_time: d.updateTime,
256
+ notify_on_ok: d.notifyOnOk
345
257
  }));
346
258
  const alertConditionFieldMaskSchema = {
347
- emptyResultState: { wire: 'empty_result_state' },
348
- op: { wire: 'op' },
349
- operand: { wire: 'operand', children: () => alertOperandFieldMaskSchema },
350
- threshold: { wire: 'threshold', children: () => alertOperandFieldMaskSchema },
259
+ emptyResultState: { wire: "empty_result_state" },
260
+ op: { wire: "op" },
261
+ operand: {
262
+ wire: "operand",
263
+ children: () => alertOperandFieldMaskSchema
264
+ },
265
+ threshold: {
266
+ wire: "threshold",
267
+ children: () => alertOperandFieldMaskSchema
268
+ }
351
269
  };
352
270
  const alertOperandFieldMaskSchema = {
353
- column: { wire: 'column', children: () => alertOperandColumnFieldMaskSchema },
354
- value: { wire: 'value', children: () => alertOperandValueFieldMaskSchema },
355
- };
356
- const alertOperandColumnFieldMaskSchema = {
357
- name: { wire: 'name' },
271
+ column: {
272
+ wire: "column",
273
+ children: () => alertOperandColumnFieldMaskSchema
274
+ },
275
+ value: {
276
+ wire: "value",
277
+ children: () => alertOperandValueFieldMaskSchema
278
+ }
358
279
  };
280
+ const alertOperandColumnFieldMaskSchema = { name: { wire: "name" } };
359
281
  const alertOperandValueFieldMaskSchema = {
360
- boolValue: { wire: 'bool_value' },
361
- doubleValue: { wire: 'double_value' },
362
- stringValue: { wire: 'string_value' },
282
+ boolValue: { wire: "bool_value" },
283
+ doubleValue: { wire: "double_value" },
284
+ stringValue: { wire: "string_value" }
363
285
  };
364
286
  const updateAlertRequestAlertFieldMaskSchema = {
365
- condition: { wire: 'condition', children: () => alertConditionFieldMaskSchema },
366
- createTime: { wire: 'create_time' },
367
- customBody: { wire: 'custom_body' },
368
- customSubject: { wire: 'custom_subject' },
369
- displayName: { wire: 'display_name' },
370
- id: { wire: 'id' },
371
- lifecycleState: { wire: 'lifecycle_state' },
372
- notifyOnOk: { wire: 'notify_on_ok' },
373
- ownerUserName: { wire: 'owner_user_name' },
374
- parentPath: { wire: 'parent_path' },
375
- queryId: { wire: 'query_id' },
376
- secondsToRetrigger: { wire: 'seconds_to_retrigger' },
377
- state: { wire: 'state' },
378
- triggerTime: { wire: 'trigger_time' },
379
- updateTime: { wire: 'update_time' },
287
+ condition: {
288
+ wire: "condition",
289
+ children: () => alertConditionFieldMaskSchema
290
+ },
291
+ createTime: { wire: "create_time" },
292
+ customBody: { wire: "custom_body" },
293
+ customSubject: { wire: "custom_subject" },
294
+ displayName: { wire: "display_name" },
295
+ id: { wire: "id" },
296
+ lifecycleState: { wire: "lifecycle_state" },
297
+ notifyOnOk: { wire: "notify_on_ok" },
298
+ ownerUserName: { wire: "owner_user_name" },
299
+ parentPath: { wire: "parent_path" },
300
+ queryId: { wire: "query_id" },
301
+ secondsToRetrigger: { wire: "seconds_to_retrigger" },
302
+ state: { wire: "state" },
303
+ triggerTime: { wire: "trigger_time" },
304
+ updateTime: { wire: "update_time" }
380
305
  };
381
- export function updateAlertRequestAlertFieldMask(...paths) {
382
- return FieldMask.build(paths, updateAlertRequestAlertFieldMaskSchema);
306
+ function updateAlertRequestAlertFieldMask(...paths) {
307
+ return FieldMask.build(paths, updateAlertRequestAlertFieldMaskSchema);
383
308
  }
309
+
310
+ //#endregion
311
+ export { AlertOperator, AlertState, LifecycleState, marshalAlertConditionSchema, marshalAlertOperandColumnSchema, marshalAlertOperandSchema, marshalAlertOperandValueSchema, marshalCreateAlertRequestAlertSchema, marshalCreateAlertRequestSchema, marshalUpdateAlertRequestAlertSchema, marshalUpdateAlertRequestSchema, unmarshalAlertConditionSchema, unmarshalAlertOperandColumnSchema, unmarshalAlertOperandSchema, unmarshalAlertOperandValueSchema, unmarshalAlertSchema, unmarshalEmptySchema, unmarshalListAlertsResponseAlertSchema, unmarshalListAlertsResponseSchema, updateAlertRequestAlertFieldMask };
384
312
  //# sourceMappingURL=model.js.map