1616
1717import { z } from '@kbn/zod' ;
1818
19- import { NonEmptyString } from '../common_attributes.gen' ;
20-
19+ import {
20+ BulkActionBase ,
21+ NonEmptyString ,
22+ NonEmptyTimestamp ,
23+ BulkCrudActionSummary ,
24+ } from '../common_attributes.gen' ;
25+
26+ /**
27+ * Reason why the anonymization field was not modified.
28+ */
2129export type AnonymizationFieldsBulkActionSkipReason = z . infer <
2230 typeof AnonymizationFieldsBulkActionSkipReason
2331> ;
@@ -29,38 +37,92 @@ export type AnonymizationFieldsBulkActionSkipResult = z.infer<
2937 typeof AnonymizationFieldsBulkActionSkipResult
3038> ;
3139export const AnonymizationFieldsBulkActionSkipResult = z . object ( {
40+ /**
41+ * The ID of the anonymization field that was not modified.
42+ */
3243 id : z . string ( ) ,
44+ /**
45+ * Name of the anonymization field that was not modified.
46+ */
3347 name : z . string ( ) . optional ( ) ,
48+ /**
49+ * Reason why the anonymization field was not modified.
50+ */
3451 skip_reason : AnonymizationFieldsBulkActionSkipReason ,
3552} ) ;
3653
3754export type AnonymizationFieldDetailsInError = z . infer < typeof AnonymizationFieldDetailsInError > ;
3855export const AnonymizationFieldDetailsInError = z . object ( {
56+ /**
57+ * The ID of the anonymization field.
58+ */
3959 id : z . string ( ) ,
60+ /**
61+ * Name of the anonymization field.
62+ */
4063 name : z . string ( ) . optional ( ) ,
4164} ) ;
4265
4366export type NormalizedAnonymizationFieldError = z . infer < typeof NormalizedAnonymizationFieldError > ;
4467export const NormalizedAnonymizationFieldError = z . object ( {
68+ /**
69+ * Error message.
70+ */
4571 message : z . string ( ) ,
72+ /**
73+ * Status code of the response.
74+ */
4675 status_code : z . number ( ) . int ( ) ,
76+ /**
77+ * Error code indicating the type of failure.
78+ */
4779 err_code : z . string ( ) . optional ( ) ,
80+ /**
81+ * Array of anonymization fields that caused the error.
82+ */
4883 anonymization_fields : z . array ( AnonymizationFieldDetailsInError ) ,
4984} ) ;
5085
5186export type AnonymizationFieldResponse = z . infer < typeof AnonymizationFieldResponse > ;
5287export const AnonymizationFieldResponse = z . object ( {
88+ /**
89+ * The ID of the anonymization field.
90+ */
5391 id : NonEmptyString ,
54- timestamp : NonEmptyString . optional ( ) ,
92+ /**
93+ * Timestamp when the anonymization field was initially created.
94+ */
95+ timestamp : NonEmptyTimestamp . optional ( ) ,
96+ /**
97+ * Name of the anonymization field.
98+ */
5599 field : z . string ( ) ,
100+ /**
101+ * Whether this field is allowed to be sent to the model.
102+ */
56103 allowed : z . boolean ( ) . optional ( ) ,
104+ /**
105+ * Whether this field should be anonymized.
106+ */
57107 anonymized : z . boolean ( ) . optional ( ) ,
108+ /**
109+ * Timestamp of the last update.
110+ */
58111 updatedAt : z . string ( ) . optional ( ) ,
112+ /**
113+ * Username of the person who last updated the field.
114+ */
59115 updatedBy : z . string ( ) . optional ( ) ,
116+ /**
117+ * Timestamp of when the anonymization field was created.
118+ */
60119 createdAt : z . string ( ) . optional ( ) ,
120+ /**
121+ * Username of the person who created the anonymization field.
122+ */
61123 createdBy : z . string ( ) . optional ( ) ,
62124 /**
63- * Kibana space
125+ * Kibana space in which this anonymization field exists.
64126 */
65127 namespace : z . string ( ) . optional ( ) ,
66128} ) ;
@@ -69,67 +131,98 @@ export type AnonymizationFieldsBulkCrudActionResults = z.infer<
69131 typeof AnonymizationFieldsBulkCrudActionResults
70132> ;
71133export const AnonymizationFieldsBulkCrudActionResults = z . object ( {
134+ /**
135+ * List of anonymization fields successfully updated.
136+ */
72137 updated : z . array ( AnonymizationFieldResponse ) ,
138+ /**
139+ * List of anonymization fields successfully created.
140+ */
73141 created : z . array ( AnonymizationFieldResponse ) ,
74142 deleted : z . array ( z . string ( ) ) ,
143+ /**
144+ * List of anonymization fields that were skipped during the operation.
145+ */
75146 skipped : z . array ( AnonymizationFieldsBulkActionSkipResult ) ,
76147} ) ;
77148
78- export type BulkCrudActionSummary = z . infer < typeof BulkCrudActionSummary > ;
79- export const BulkCrudActionSummary = z . object ( {
80- failed : z . number ( ) . int ( ) ,
81- skipped : z . number ( ) . int ( ) ,
82- succeeded : z . number ( ) . int ( ) ,
83- total : z . number ( ) . int ( ) ,
84- } ) ;
85-
86149export type AnonymizationFieldsBulkCrudActionResponse = z . infer <
87150 typeof AnonymizationFieldsBulkCrudActionResponse
88151> ;
89152export const AnonymizationFieldsBulkCrudActionResponse = z . object ( {
153+ /**
154+ * Indicates if the bulk action was successful.
155+ */
90156 success : z . boolean ( ) . optional ( ) ,
157+ /**
158+ * HTTP status code returned.
159+ */
91160 status_code : z . number ( ) . int ( ) . optional ( ) ,
161+ /**
162+ * Message providing information about the bulk action result.
163+ */
92164 message : z . string ( ) . optional ( ) ,
165+ /**
166+ * Total number of anonymization fields processed.
167+ */
93168 anonymization_fields_count : z . number ( ) . int ( ) . optional ( ) ,
94169 attributes : z . object ( {
95170 results : AnonymizationFieldsBulkCrudActionResults ,
96171 summary : BulkCrudActionSummary ,
172+ /**
173+ * List of errors that occurred during the bulk operation.
174+ */
97175 errors : z . array ( NormalizedAnonymizationFieldError ) . optional ( ) ,
98176 } ) ,
99177} ) ;
100178
101- export type BulkActionBase = z . infer < typeof BulkActionBase > ;
102- export const BulkActionBase = z . object ( {
179+ export type AnonymizationFieldCreateProps = z . infer < typeof AnonymizationFieldCreateProps > ;
180+ export const AnonymizationFieldCreateProps = z . object ( {
103181 /**
104- * Query to filter anonymization fields
182+ * Name of the anonymization field to create.
105183 */
106- query : z . string ( ) . optional ( ) ,
184+ field : z . string ( ) ,
107185 /**
108- * Array of anonymization fields IDs
186+ * Whether this field is allowed to be sent to the model.
109187 */
110- ids : z . array ( z . string ( ) ) . min ( 1 ) . optional ( ) ,
111- } ) ;
112-
113- export type AnonymizationFieldCreateProps = z . infer < typeof AnonymizationFieldCreateProps > ;
114- export const AnonymizationFieldCreateProps = z . object ( {
115- field : z . string ( ) ,
116188 allowed : z . boolean ( ) . optional ( ) ,
189+ /**
190+ * Whether this field should be anonymized.
191+ */
117192 anonymized : z . boolean ( ) . optional ( ) ,
118193} ) ;
119194
120195export type AnonymizationFieldUpdateProps = z . infer < typeof AnonymizationFieldUpdateProps > ;
121196export const AnonymizationFieldUpdateProps = z . object ( {
197+ /**
198+ * The ID of the anonymization field to update.
199+ */
122200 id : z . string ( ) ,
201+ /**
202+ * Whether this field is allowed to be sent to the model.
203+ */
123204 allowed : z . boolean ( ) . optional ( ) ,
205+ /**
206+ * Whether this field should be anonymized.
207+ */
124208 anonymized : z . boolean ( ) . optional ( ) ,
125209} ) ;
126210
127211export type PerformAnonymizationFieldsBulkActionRequestBody = z . infer <
128212 typeof PerformAnonymizationFieldsBulkActionRequestBody
129213> ;
130214export const PerformAnonymizationFieldsBulkActionRequestBody = z . object ( {
215+ /**
216+ * Object containing the query to filter anonymization fields and/or an array of anonymization field IDs to delete.
217+ */
131218 delete : BulkActionBase . optional ( ) ,
219+ /**
220+ * Array of anonymization fields to create.
221+ */
132222 create : z . array ( AnonymizationFieldCreateProps ) . optional ( ) ,
223+ /**
224+ * Array of anonymization fields to update.
225+ */
133226 update : z . array ( AnonymizationFieldUpdateProps ) . optional ( ) ,
134227} ) ;
135228export type PerformAnonymizationFieldsBulkActionRequestBodyInput = z . input <
0 commit comments