@databricks/sdk-alerts 0.34.0 → 0.35.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.
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/v1/client.d.ts +25 -21
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +146 -185
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +3 -8
- package/dist/v1/index.js +4 -8
- package/dist/v1/model.d.ts +219 -216
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +288 -360
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +21 -17
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +60 -69
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts +18 -14
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +76 -103
- package/dist/v1/utils.js.map +1 -1
- package/dist/v2/client.d.ts +25 -21
- package/dist/v2/client.d.ts.map +1 -1
- package/dist/v2/client.js +154 -197
- package/dist/v2/client.js.map +1 -1
- package/dist/v2/index.d.ts +3 -8
- package/dist/v2/index.js +4 -8
- package/dist/v2/model.d.ts +224 -224
- package/dist/v2/model.d.ts.map +1 -1
- package/dist/v2/model.js +375 -449
- package/dist/v2/model.js.map +1 -1
- package/dist/v2/transport.d.ts +21 -17
- package/dist/v2/transport.d.ts.map +1 -1
- package/dist/v2/transport.js +60 -69
- package/dist/v2/transport.js.map +1 -1
- package/dist/v2/utils.d.ts +18 -14
- package/dist/v2/utils.d.ts.map +1 -1
- package/dist/v2/utils.js +76 -103
- package/dist/v2/utils.js.map +1 -1
- package/package.json +5 -5
- package/dist/v1/index.d.ts.map +0 -1
- package/dist/v1/index.js.map +0 -1
- package/dist/v2/index.d.ts.map +0 -1
- package/dist/v2/index.js.map +0 -1
package/dist/v2/model.js
CHANGED
|
@@ -1,490 +1,416 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
DELETED: 'DELETED',
|
|
29
|
+
const AlertLifecycleState = {
|
|
30
|
+
ACTIVE: "ACTIVE",
|
|
31
|
+
DELETED: "DELETED"
|
|
35
32
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
PAUSED: 'PAUSED',
|
|
43
|
+
const SchedulePauseStatus = {
|
|
44
|
+
UNPAUSED: "UNPAUSED",
|
|
45
|
+
PAUSED: "PAUSED"
|
|
51
46
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
})
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
})
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
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
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
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
|
-
|
|
448
|
-
|
|
358
|
+
function alertFieldMask(...paths) {
|
|
359
|
+
return FieldMask.build(paths, alertFieldMaskSchema);
|
|
449
360
|
}
|
|
450
361
|
const alertEvaluationFieldMaskSchema = {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
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
|
-
|
|
464
|
-
|
|
465
|
-
|
|
380
|
+
notifyOnOk: { wire: "notify_on_ok" },
|
|
381
|
+
retriggerSeconds: { wire: "retrigger_seconds" },
|
|
382
|
+
subscriptions: { wire: "subscriptions" }
|
|
466
383
|
};
|
|
467
384
|
const alertOperandFieldMaskSchema = {
|
|
468
|
-
|
|
469
|
-
|
|
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
|
-
|
|
473
|
-
|
|
474
|
-
|
|
395
|
+
aggregation: { wire: "aggregation" },
|
|
396
|
+
display: { wire: "display" },
|
|
397
|
+
name: { wire: "name" }
|
|
475
398
|
};
|
|
476
399
|
const alertOperandValueFieldMaskSchema = {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
400
|
+
boolValue: { wire: "bool_value" },
|
|
401
|
+
doubleValue: { wire: "double_value" },
|
|
402
|
+
stringValue: { wire: "string_value" }
|
|
480
403
|
};
|
|
481
404
|
const alertRunAsFieldMaskSchema = {
|
|
482
|
-
|
|
483
|
-
|
|
405
|
+
servicePrincipalName: { wire: "service_principal_name" },
|
|
406
|
+
userName: { wire: "user_name" }
|
|
484
407
|
};
|
|
485
408
|
const cronScheduleFieldMaskSchema = {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
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
|