google_cloud_chronicle_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_longrunning;
25extern crate google_cloud_lro;
26extern crate google_cloud_rpc;
27extern crate google_cloud_type;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Request message for CreateDataAccessLabel.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct CreateDataAccessLabelRequest {
43 /// Required. The parent resource where this Data Access Label will be created.
44 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
45 pub parent: std::string::String,
46
47 /// Required. Data access label to create.
48 pub data_access_label: std::option::Option<crate::model::DataAccessLabel>,
49
50 /// Required. The ID to use for the data access label, which will become the
51 /// label's display name and the final component of the label's resource name.
52 /// The maximum number of characters should be 63. Regex pattern is as per AIP:
53 /// <https://google.aip.dev/122#resource-id-segments>
54 pub data_access_label_id: std::string::String,
55
56 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
57}
58
59impl CreateDataAccessLabelRequest {
60 /// Creates a new default instance.
61 pub fn new() -> Self {
62 std::default::Default::default()
63 }
64
65 /// Sets the value of [parent][crate::model::CreateDataAccessLabelRequest::parent].
66 ///
67 /// # Example
68 /// ```ignore,no_run
69 /// # use google_cloud_chronicle_v1::model::CreateDataAccessLabelRequest;
70 /// let x = CreateDataAccessLabelRequest::new().set_parent("example");
71 /// ```
72 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
73 self.parent = v.into();
74 self
75 }
76
77 /// Sets the value of [data_access_label][crate::model::CreateDataAccessLabelRequest::data_access_label].
78 ///
79 /// # Example
80 /// ```ignore,no_run
81 /// # use google_cloud_chronicle_v1::model::CreateDataAccessLabelRequest;
82 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
83 /// let x = CreateDataAccessLabelRequest::new().set_data_access_label(DataAccessLabel::default()/* use setters */);
84 /// ```
85 pub fn set_data_access_label<T>(mut self, v: T) -> Self
86 where
87 T: std::convert::Into<crate::model::DataAccessLabel>,
88 {
89 self.data_access_label = std::option::Option::Some(v.into());
90 self
91 }
92
93 /// Sets or clears the value of [data_access_label][crate::model::CreateDataAccessLabelRequest::data_access_label].
94 ///
95 /// # Example
96 /// ```ignore,no_run
97 /// # use google_cloud_chronicle_v1::model::CreateDataAccessLabelRequest;
98 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
99 /// let x = CreateDataAccessLabelRequest::new().set_or_clear_data_access_label(Some(DataAccessLabel::default()/* use setters */));
100 /// let x = CreateDataAccessLabelRequest::new().set_or_clear_data_access_label(None::<DataAccessLabel>);
101 /// ```
102 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
103 where
104 T: std::convert::Into<crate::model::DataAccessLabel>,
105 {
106 self.data_access_label = v.map(|x| x.into());
107 self
108 }
109
110 /// Sets the value of [data_access_label_id][crate::model::CreateDataAccessLabelRequest::data_access_label_id].
111 ///
112 /// # Example
113 /// ```ignore,no_run
114 /// # use google_cloud_chronicle_v1::model::CreateDataAccessLabelRequest;
115 /// let x = CreateDataAccessLabelRequest::new().set_data_access_label_id("example");
116 /// ```
117 pub fn set_data_access_label_id<T: std::convert::Into<std::string::String>>(
118 mut self,
119 v: T,
120 ) -> Self {
121 self.data_access_label_id = v.into();
122 self
123 }
124}
125
126impl wkt::message::Message for CreateDataAccessLabelRequest {
127 fn typename() -> &'static str {
128 "type.googleapis.com/google.cloud.chronicle.v1.CreateDataAccessLabelRequest"
129 }
130}
131
132/// Request message to retrieve a data access label.
133#[derive(Clone, Default, PartialEq)]
134#[non_exhaustive]
135pub struct GetDataAccessLabelRequest {
136 /// Required. The ID of the data access label to retrieve.
137 /// Format:
138 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}`
139 pub name: std::string::String,
140
141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
142}
143
144impl GetDataAccessLabelRequest {
145 /// Creates a new default instance.
146 pub fn new() -> Self {
147 std::default::Default::default()
148 }
149
150 /// Sets the value of [name][crate::model::GetDataAccessLabelRequest::name].
151 ///
152 /// # Example
153 /// ```ignore,no_run
154 /// # use google_cloud_chronicle_v1::model::GetDataAccessLabelRequest;
155 /// let x = GetDataAccessLabelRequest::new().set_name("example");
156 /// ```
157 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
158 self.name = v.into();
159 self
160 }
161}
162
163impl wkt::message::Message for GetDataAccessLabelRequest {
164 fn typename() -> &'static str {
165 "type.googleapis.com/google.cloud.chronicle.v1.GetDataAccessLabelRequest"
166 }
167}
168
169/// Request message for ListDataAccessLabels.
170#[derive(Clone, Default, PartialEq)]
171#[non_exhaustive]
172pub struct ListDataAccessLabelsRequest {
173 /// Required. The parent resource where this data access label will be created.
174 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
175 pub parent: std::string::String,
176
177 /// The maximum number of data access labels to return. The service may return
178 /// fewer than this value. If unspecified, at most 100 data access labels will
179 /// be returned. The maximum value is 1000; values above 1000 will be coerced
180 /// to 1000.
181 pub page_size: i32,
182
183 /// A page token, received from a previous `ListDataAccessLabelsRequest` call.
184 /// Provide this to retrieve the subsequent page.
185 pub page_token: std::string::String,
186
187 /// Optional. A filter which should follow the guidelines of AIP-160.
188 /// Supports filtering on all fieds of DataAccessLabel and all operations as
189 /// mentioned in <https://google.aip.dev/160>.
190 /// example filter: "create_time greater than \"2023-04-21T11:30:00-04:00\" OR
191 /// display_name:\"-21-1\"".
192 pub filter: std::string::String,
193
194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
195}
196
197impl ListDataAccessLabelsRequest {
198 /// Creates a new default instance.
199 pub fn new() -> Self {
200 std::default::Default::default()
201 }
202
203 /// Sets the value of [parent][crate::model::ListDataAccessLabelsRequest::parent].
204 ///
205 /// # Example
206 /// ```ignore,no_run
207 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsRequest;
208 /// let x = ListDataAccessLabelsRequest::new().set_parent("example");
209 /// ```
210 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
211 self.parent = v.into();
212 self
213 }
214
215 /// Sets the value of [page_size][crate::model::ListDataAccessLabelsRequest::page_size].
216 ///
217 /// # Example
218 /// ```ignore,no_run
219 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsRequest;
220 /// let x = ListDataAccessLabelsRequest::new().set_page_size(42);
221 /// ```
222 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
223 self.page_size = v.into();
224 self
225 }
226
227 /// Sets the value of [page_token][crate::model::ListDataAccessLabelsRequest::page_token].
228 ///
229 /// # Example
230 /// ```ignore,no_run
231 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsRequest;
232 /// let x = ListDataAccessLabelsRequest::new().set_page_token("example");
233 /// ```
234 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
235 self.page_token = v.into();
236 self
237 }
238
239 /// Sets the value of [filter][crate::model::ListDataAccessLabelsRequest::filter].
240 ///
241 /// # Example
242 /// ```ignore,no_run
243 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsRequest;
244 /// let x = ListDataAccessLabelsRequest::new().set_filter("example");
245 /// ```
246 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
247 self.filter = v.into();
248 self
249 }
250}
251
252impl wkt::message::Message for ListDataAccessLabelsRequest {
253 fn typename() -> &'static str {
254 "type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessLabelsRequest"
255 }
256}
257
258/// Response message for ListDataAccessLabels.
259#[derive(Clone, Default, PartialEq)]
260#[non_exhaustive]
261pub struct ListDataAccessLabelsResponse {
262 /// List of data access labels.
263 pub data_access_labels: std::vec::Vec<crate::model::DataAccessLabel>,
264
265 /// A token, which can be sent as `page_token` to retrieve the next page.
266 /// If this field is omitted, there are no subsequent pages.
267 pub next_page_token: std::string::String,
268
269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
270}
271
272impl ListDataAccessLabelsResponse {
273 /// Creates a new default instance.
274 pub fn new() -> Self {
275 std::default::Default::default()
276 }
277
278 /// Sets the value of [data_access_labels][crate::model::ListDataAccessLabelsResponse::data_access_labels].
279 ///
280 /// # Example
281 /// ```ignore,no_run
282 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsResponse;
283 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
284 /// let x = ListDataAccessLabelsResponse::new()
285 /// .set_data_access_labels([
286 /// DataAccessLabel::default()/* use setters */,
287 /// DataAccessLabel::default()/* use (different) setters */,
288 /// ]);
289 /// ```
290 pub fn set_data_access_labels<T, V>(mut self, v: T) -> Self
291 where
292 T: std::iter::IntoIterator<Item = V>,
293 V: std::convert::Into<crate::model::DataAccessLabel>,
294 {
295 use std::iter::Iterator;
296 self.data_access_labels = v.into_iter().map(|i| i.into()).collect();
297 self
298 }
299
300 /// Sets the value of [next_page_token][crate::model::ListDataAccessLabelsResponse::next_page_token].
301 ///
302 /// # Example
303 /// ```ignore,no_run
304 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsResponse;
305 /// let x = ListDataAccessLabelsResponse::new().set_next_page_token("example");
306 /// ```
307 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
308 self.next_page_token = v.into();
309 self
310 }
311}
312
313impl wkt::message::Message for ListDataAccessLabelsResponse {
314 fn typename() -> &'static str {
315 "type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessLabelsResponse"
316 }
317}
318
319#[doc(hidden)]
320impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAccessLabelsResponse {
321 type PageItem = crate::model::DataAccessLabel;
322
323 fn items(self) -> std::vec::Vec<Self::PageItem> {
324 self.data_access_labels
325 }
326
327 fn next_page_token(&self) -> std::string::String {
328 use std::clone::Clone;
329 self.next_page_token.clone()
330 }
331}
332
333/// Request message for UpdateDataAccessLabel method.
334#[derive(Clone, Default, PartialEq)]
335#[non_exhaustive]
336pub struct UpdateDataAccessLabelRequest {
337 /// Required. The data access label to update.
338 ///
339 /// The label's `name` field is used to identify the label to update.
340 /// Format:
341 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}`
342 pub data_access_label: std::option::Option<crate::model::DataAccessLabel>,
343
344 /// The list of fields to update. If not included, all fields with a non-empty
345 /// value will be overwritten. Currently, only the description and definition
346 /// fields are supported for update; an update call that attempts to update any
347 /// other fields will return INVALID_ARGUMENT.
348 pub update_mask: std::option::Option<wkt::FieldMask>,
349
350 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
351}
352
353impl UpdateDataAccessLabelRequest {
354 /// Creates a new default instance.
355 pub fn new() -> Self {
356 std::default::Default::default()
357 }
358
359 /// Sets the value of [data_access_label][crate::model::UpdateDataAccessLabelRequest::data_access_label].
360 ///
361 /// # Example
362 /// ```ignore,no_run
363 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessLabelRequest;
364 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
365 /// let x = UpdateDataAccessLabelRequest::new().set_data_access_label(DataAccessLabel::default()/* use setters */);
366 /// ```
367 pub fn set_data_access_label<T>(mut self, v: T) -> Self
368 where
369 T: std::convert::Into<crate::model::DataAccessLabel>,
370 {
371 self.data_access_label = std::option::Option::Some(v.into());
372 self
373 }
374
375 /// Sets or clears the value of [data_access_label][crate::model::UpdateDataAccessLabelRequest::data_access_label].
376 ///
377 /// # Example
378 /// ```ignore,no_run
379 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessLabelRequest;
380 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
381 /// let x = UpdateDataAccessLabelRequest::new().set_or_clear_data_access_label(Some(DataAccessLabel::default()/* use setters */));
382 /// let x = UpdateDataAccessLabelRequest::new().set_or_clear_data_access_label(None::<DataAccessLabel>);
383 /// ```
384 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
385 where
386 T: std::convert::Into<crate::model::DataAccessLabel>,
387 {
388 self.data_access_label = v.map(|x| x.into());
389 self
390 }
391
392 /// Sets the value of [update_mask][crate::model::UpdateDataAccessLabelRequest::update_mask].
393 ///
394 /// # Example
395 /// ```ignore,no_run
396 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessLabelRequest;
397 /// use wkt::FieldMask;
398 /// let x = UpdateDataAccessLabelRequest::new().set_update_mask(FieldMask::default()/* use setters */);
399 /// ```
400 pub fn set_update_mask<T>(mut self, v: T) -> Self
401 where
402 T: std::convert::Into<wkt::FieldMask>,
403 {
404 self.update_mask = std::option::Option::Some(v.into());
405 self
406 }
407
408 /// Sets or clears the value of [update_mask][crate::model::UpdateDataAccessLabelRequest::update_mask].
409 ///
410 /// # Example
411 /// ```ignore,no_run
412 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessLabelRequest;
413 /// use wkt::FieldMask;
414 /// let x = UpdateDataAccessLabelRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
415 /// let x = UpdateDataAccessLabelRequest::new().set_or_clear_update_mask(None::<FieldMask>);
416 /// ```
417 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
418 where
419 T: std::convert::Into<wkt::FieldMask>,
420 {
421 self.update_mask = v.map(|x| x.into());
422 self
423 }
424}
425
426impl wkt::message::Message for UpdateDataAccessLabelRequest {
427 fn typename() -> &'static str {
428 "type.googleapis.com/google.cloud.chronicle.v1.UpdateDataAccessLabelRequest"
429 }
430}
431
432/// Request message to delete a data access label.
433#[derive(Clone, Default, PartialEq)]
434#[non_exhaustive]
435pub struct DeleteDataAccessLabelRequest {
436 /// Required. The ID of the data access label to delete.
437 /// Format:
438 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}`
439 pub name: std::string::String,
440
441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
442}
443
444impl DeleteDataAccessLabelRequest {
445 /// Creates a new default instance.
446 pub fn new() -> Self {
447 std::default::Default::default()
448 }
449
450 /// Sets the value of [name][crate::model::DeleteDataAccessLabelRequest::name].
451 ///
452 /// # Example
453 /// ```ignore,no_run
454 /// # use google_cloud_chronicle_v1::model::DeleteDataAccessLabelRequest;
455 /// let x = DeleteDataAccessLabelRequest::new().set_name("example");
456 /// ```
457 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
458 self.name = v.into();
459 self
460 }
461}
462
463impl wkt::message::Message for DeleteDataAccessLabelRequest {
464 fn typename() -> &'static str {
465 "type.googleapis.com/google.cloud.chronicle.v1.DeleteDataAccessLabelRequest"
466 }
467}
468
469/// Request message for CreateDataAccessScope.
470#[derive(Clone, Default, PartialEq)]
471#[non_exhaustive]
472pub struct CreateDataAccessScopeRequest {
473 /// Required. The parent resource where this Data Access Scope will be created.
474 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
475 pub parent: std::string::String,
476
477 /// Required. Data access scope to create.
478 pub data_access_scope: std::option::Option<crate::model::DataAccessScope>,
479
480 /// Required. The user provided scope id which will become the last part of the
481 /// name of the scope resource. Needs to be compliant with
482 /// <https://google.aip.dev/122>
483 pub data_access_scope_id: std::string::String,
484
485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
486}
487
488impl CreateDataAccessScopeRequest {
489 /// Creates a new default instance.
490 pub fn new() -> Self {
491 std::default::Default::default()
492 }
493
494 /// Sets the value of [parent][crate::model::CreateDataAccessScopeRequest::parent].
495 ///
496 /// # Example
497 /// ```ignore,no_run
498 /// # use google_cloud_chronicle_v1::model::CreateDataAccessScopeRequest;
499 /// let x = CreateDataAccessScopeRequest::new().set_parent("example");
500 /// ```
501 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
502 self.parent = v.into();
503 self
504 }
505
506 /// Sets the value of [data_access_scope][crate::model::CreateDataAccessScopeRequest::data_access_scope].
507 ///
508 /// # Example
509 /// ```ignore,no_run
510 /// # use google_cloud_chronicle_v1::model::CreateDataAccessScopeRequest;
511 /// use google_cloud_chronicle_v1::model::DataAccessScope;
512 /// let x = CreateDataAccessScopeRequest::new().set_data_access_scope(DataAccessScope::default()/* use setters */);
513 /// ```
514 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
515 where
516 T: std::convert::Into<crate::model::DataAccessScope>,
517 {
518 self.data_access_scope = std::option::Option::Some(v.into());
519 self
520 }
521
522 /// Sets or clears the value of [data_access_scope][crate::model::CreateDataAccessScopeRequest::data_access_scope].
523 ///
524 /// # Example
525 /// ```ignore,no_run
526 /// # use google_cloud_chronicle_v1::model::CreateDataAccessScopeRequest;
527 /// use google_cloud_chronicle_v1::model::DataAccessScope;
528 /// let x = CreateDataAccessScopeRequest::new().set_or_clear_data_access_scope(Some(DataAccessScope::default()/* use setters */));
529 /// let x = CreateDataAccessScopeRequest::new().set_or_clear_data_access_scope(None::<DataAccessScope>);
530 /// ```
531 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
532 where
533 T: std::convert::Into<crate::model::DataAccessScope>,
534 {
535 self.data_access_scope = v.map(|x| x.into());
536 self
537 }
538
539 /// Sets the value of [data_access_scope_id][crate::model::CreateDataAccessScopeRequest::data_access_scope_id].
540 ///
541 /// # Example
542 /// ```ignore,no_run
543 /// # use google_cloud_chronicle_v1::model::CreateDataAccessScopeRequest;
544 /// let x = CreateDataAccessScopeRequest::new().set_data_access_scope_id("example");
545 /// ```
546 pub fn set_data_access_scope_id<T: std::convert::Into<std::string::String>>(
547 mut self,
548 v: T,
549 ) -> Self {
550 self.data_access_scope_id = v.into();
551 self
552 }
553}
554
555impl wkt::message::Message for CreateDataAccessScopeRequest {
556 fn typename() -> &'static str {
557 "type.googleapis.com/google.cloud.chronicle.v1.CreateDataAccessScopeRequest"
558 }
559}
560
561/// Request message to retrieve a data access scope.
562#[derive(Clone, Default, PartialEq)]
563#[non_exhaustive]
564pub struct GetDataAccessScopeRequest {
565 /// Required. The ID of the data access scope to retrieve.
566 /// Format:
567 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}`
568 pub name: std::string::String,
569
570 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
571}
572
573impl GetDataAccessScopeRequest {
574 /// Creates a new default instance.
575 pub fn new() -> Self {
576 std::default::Default::default()
577 }
578
579 /// Sets the value of [name][crate::model::GetDataAccessScopeRequest::name].
580 ///
581 /// # Example
582 /// ```ignore,no_run
583 /// # use google_cloud_chronicle_v1::model::GetDataAccessScopeRequest;
584 /// let x = GetDataAccessScopeRequest::new().set_name("example");
585 /// ```
586 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
587 self.name = v.into();
588 self
589 }
590}
591
592impl wkt::message::Message for GetDataAccessScopeRequest {
593 fn typename() -> &'static str {
594 "type.googleapis.com/google.cloud.chronicle.v1.GetDataAccessScopeRequest"
595 }
596}
597
598/// Request message for ListDataAccessScopes.
599#[derive(Clone, Default, PartialEq)]
600#[non_exhaustive]
601pub struct ListDataAccessScopesRequest {
602 /// Required. The parent resource where this data access scope will be created.
603 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
604 pub parent: std::string::String,
605
606 /// The maximum number of data access scopes to return. The service may return
607 /// fewer than this value. If unspecified, at most 100 data access scopes will
608 /// be returned. The maximum value is 1000; values above 1000 will be coerced
609 /// to 1000.
610 pub page_size: i32,
611
612 /// A page token, received from a previous `ListDataAccessScopesRequest` call.
613 /// Provide this to retrieve the subsequent page.
614 pub page_token: std::string::String,
615
616 /// Optional. A filter which should follow the guidelines of AIP-160.
617 /// Supports filtering on all fieds of DataAccessScope and all operations as
618 /// mentioned in <https://google.aip.dev/160>.
619 /// example filter: "create_time greater than \"2023-04-21T11:30:00-04:00\" OR
620 /// display_name:\"-21-1\"".
621 pub filter: std::string::String,
622
623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
624}
625
626impl ListDataAccessScopesRequest {
627 /// Creates a new default instance.
628 pub fn new() -> Self {
629 std::default::Default::default()
630 }
631
632 /// Sets the value of [parent][crate::model::ListDataAccessScopesRequest::parent].
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesRequest;
637 /// let x = ListDataAccessScopesRequest::new().set_parent("example");
638 /// ```
639 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
640 self.parent = v.into();
641 self
642 }
643
644 /// Sets the value of [page_size][crate::model::ListDataAccessScopesRequest::page_size].
645 ///
646 /// # Example
647 /// ```ignore,no_run
648 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesRequest;
649 /// let x = ListDataAccessScopesRequest::new().set_page_size(42);
650 /// ```
651 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
652 self.page_size = v.into();
653 self
654 }
655
656 /// Sets the value of [page_token][crate::model::ListDataAccessScopesRequest::page_token].
657 ///
658 /// # Example
659 /// ```ignore,no_run
660 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesRequest;
661 /// let x = ListDataAccessScopesRequest::new().set_page_token("example");
662 /// ```
663 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
664 self.page_token = v.into();
665 self
666 }
667
668 /// Sets the value of [filter][crate::model::ListDataAccessScopesRequest::filter].
669 ///
670 /// # Example
671 /// ```ignore,no_run
672 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesRequest;
673 /// let x = ListDataAccessScopesRequest::new().set_filter("example");
674 /// ```
675 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
676 self.filter = v.into();
677 self
678 }
679}
680
681impl wkt::message::Message for ListDataAccessScopesRequest {
682 fn typename() -> &'static str {
683 "type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessScopesRequest"
684 }
685}
686
687/// Response message for ListDataAccessScopes.
688#[derive(Clone, Default, PartialEq)]
689#[non_exhaustive]
690pub struct ListDataAccessScopesResponse {
691 /// List of data access scopes.
692 pub data_access_scopes: std::vec::Vec<crate::model::DataAccessScope>,
693
694 /// Whether or not global scope is granted to the user.
695 pub global_data_access_scope_granted: std::option::Option<bool>,
696
697 /// A token, which can be sent as `page_token` to retrieve the next page.
698 /// If this field is omitted, there are no subsequent pages.
699 pub next_page_token: std::string::String,
700
701 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
702}
703
704impl ListDataAccessScopesResponse {
705 /// Creates a new default instance.
706 pub fn new() -> Self {
707 std::default::Default::default()
708 }
709
710 /// Sets the value of [data_access_scopes][crate::model::ListDataAccessScopesResponse::data_access_scopes].
711 ///
712 /// # Example
713 /// ```ignore,no_run
714 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesResponse;
715 /// use google_cloud_chronicle_v1::model::DataAccessScope;
716 /// let x = ListDataAccessScopesResponse::new()
717 /// .set_data_access_scopes([
718 /// DataAccessScope::default()/* use setters */,
719 /// DataAccessScope::default()/* use (different) setters */,
720 /// ]);
721 /// ```
722 pub fn set_data_access_scopes<T, V>(mut self, v: T) -> Self
723 where
724 T: std::iter::IntoIterator<Item = V>,
725 V: std::convert::Into<crate::model::DataAccessScope>,
726 {
727 use std::iter::Iterator;
728 self.data_access_scopes = v.into_iter().map(|i| i.into()).collect();
729 self
730 }
731
732 /// Sets the value of [global_data_access_scope_granted][crate::model::ListDataAccessScopesResponse::global_data_access_scope_granted].
733 ///
734 /// # Example
735 /// ```ignore,no_run
736 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesResponse;
737 /// let x = ListDataAccessScopesResponse::new().set_global_data_access_scope_granted(true);
738 /// ```
739 pub fn set_global_data_access_scope_granted<T>(mut self, v: T) -> Self
740 where
741 T: std::convert::Into<bool>,
742 {
743 self.global_data_access_scope_granted = std::option::Option::Some(v.into());
744 self
745 }
746
747 /// Sets or clears the value of [global_data_access_scope_granted][crate::model::ListDataAccessScopesResponse::global_data_access_scope_granted].
748 ///
749 /// # Example
750 /// ```ignore,no_run
751 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesResponse;
752 /// let x = ListDataAccessScopesResponse::new().set_or_clear_global_data_access_scope_granted(Some(false));
753 /// let x = ListDataAccessScopesResponse::new().set_or_clear_global_data_access_scope_granted(None::<bool>);
754 /// ```
755 pub fn set_or_clear_global_data_access_scope_granted<T>(
756 mut self,
757 v: std::option::Option<T>,
758 ) -> Self
759 where
760 T: std::convert::Into<bool>,
761 {
762 self.global_data_access_scope_granted = v.map(|x| x.into());
763 self
764 }
765
766 /// Sets the value of [next_page_token][crate::model::ListDataAccessScopesResponse::next_page_token].
767 ///
768 /// # Example
769 /// ```ignore,no_run
770 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesResponse;
771 /// let x = ListDataAccessScopesResponse::new().set_next_page_token("example");
772 /// ```
773 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
774 self.next_page_token = v.into();
775 self
776 }
777}
778
779impl wkt::message::Message for ListDataAccessScopesResponse {
780 fn typename() -> &'static str {
781 "type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessScopesResponse"
782 }
783}
784
785#[doc(hidden)]
786impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAccessScopesResponse {
787 type PageItem = crate::model::DataAccessScope;
788
789 fn items(self) -> std::vec::Vec<Self::PageItem> {
790 self.data_access_scopes
791 }
792
793 fn next_page_token(&self) -> std::string::String {
794 use std::clone::Clone;
795 self.next_page_token.clone()
796 }
797}
798
799/// Request message for UpdateDataAccessScope method.
800#[derive(Clone, Default, PartialEq)]
801#[non_exhaustive]
802pub struct UpdateDataAccessScopeRequest {
803 /// Required. The data access scope to update.
804 ///
805 /// The scope's `name` field is used to identify the scope to update.
806 /// Format:
807 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}`
808 pub data_access_scope: std::option::Option<crate::model::DataAccessScope>,
809
810 /// The list of fields to update. If not included, all fields with a non-empty
811 /// value will be overwritten. Currently, only the description, the allowed
812 /// and denied labels list fields are supported for update;
813 /// an update call that attempts to update any
814 /// other fields will return INVALID_ARGUMENT.
815 pub update_mask: std::option::Option<wkt::FieldMask>,
816
817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
818}
819
820impl UpdateDataAccessScopeRequest {
821 /// Creates a new default instance.
822 pub fn new() -> Self {
823 std::default::Default::default()
824 }
825
826 /// Sets the value of [data_access_scope][crate::model::UpdateDataAccessScopeRequest::data_access_scope].
827 ///
828 /// # Example
829 /// ```ignore,no_run
830 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessScopeRequest;
831 /// use google_cloud_chronicle_v1::model::DataAccessScope;
832 /// let x = UpdateDataAccessScopeRequest::new().set_data_access_scope(DataAccessScope::default()/* use setters */);
833 /// ```
834 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
835 where
836 T: std::convert::Into<crate::model::DataAccessScope>,
837 {
838 self.data_access_scope = std::option::Option::Some(v.into());
839 self
840 }
841
842 /// Sets or clears the value of [data_access_scope][crate::model::UpdateDataAccessScopeRequest::data_access_scope].
843 ///
844 /// # Example
845 /// ```ignore,no_run
846 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessScopeRequest;
847 /// use google_cloud_chronicle_v1::model::DataAccessScope;
848 /// let x = UpdateDataAccessScopeRequest::new().set_or_clear_data_access_scope(Some(DataAccessScope::default()/* use setters */));
849 /// let x = UpdateDataAccessScopeRequest::new().set_or_clear_data_access_scope(None::<DataAccessScope>);
850 /// ```
851 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
852 where
853 T: std::convert::Into<crate::model::DataAccessScope>,
854 {
855 self.data_access_scope = v.map(|x| x.into());
856 self
857 }
858
859 /// Sets the value of [update_mask][crate::model::UpdateDataAccessScopeRequest::update_mask].
860 ///
861 /// # Example
862 /// ```ignore,no_run
863 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessScopeRequest;
864 /// use wkt::FieldMask;
865 /// let x = UpdateDataAccessScopeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
866 /// ```
867 pub fn set_update_mask<T>(mut self, v: T) -> Self
868 where
869 T: std::convert::Into<wkt::FieldMask>,
870 {
871 self.update_mask = std::option::Option::Some(v.into());
872 self
873 }
874
875 /// Sets or clears the value of [update_mask][crate::model::UpdateDataAccessScopeRequest::update_mask].
876 ///
877 /// # Example
878 /// ```ignore,no_run
879 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessScopeRequest;
880 /// use wkt::FieldMask;
881 /// let x = UpdateDataAccessScopeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
882 /// let x = UpdateDataAccessScopeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
883 /// ```
884 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
885 where
886 T: std::convert::Into<wkt::FieldMask>,
887 {
888 self.update_mask = v.map(|x| x.into());
889 self
890 }
891}
892
893impl wkt::message::Message for UpdateDataAccessScopeRequest {
894 fn typename() -> &'static str {
895 "type.googleapis.com/google.cloud.chronicle.v1.UpdateDataAccessScopeRequest"
896 }
897}
898
899/// Request message to delete a data access scope.
900#[derive(Clone, Default, PartialEq)]
901#[non_exhaustive]
902pub struct DeleteDataAccessScopeRequest {
903 /// Required. The ID of the data access scope to delete.
904 /// Format:
905 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}`
906 pub name: std::string::String,
907
908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
909}
910
911impl DeleteDataAccessScopeRequest {
912 /// Creates a new default instance.
913 pub fn new() -> Self {
914 std::default::Default::default()
915 }
916
917 /// Sets the value of [name][crate::model::DeleteDataAccessScopeRequest::name].
918 ///
919 /// # Example
920 /// ```ignore,no_run
921 /// # use google_cloud_chronicle_v1::model::DeleteDataAccessScopeRequest;
922 /// let x = DeleteDataAccessScopeRequest::new().set_name("example");
923 /// ```
924 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
925 self.name = v.into();
926 self
927 }
928}
929
930impl wkt::message::Message for DeleteDataAccessScopeRequest {
931 fn typename() -> &'static str {
932 "type.googleapis.com/google.cloud.chronicle.v1.DeleteDataAccessScopeRequest"
933 }
934}
935
936/// A DataAccessLabel is a label on events to define user access to data.
937#[derive(Clone, Default, PartialEq)]
938#[non_exhaustive]
939pub struct DataAccessLabel {
940 /// The unique resource name of the data access label.
941 pub name: std::string::String,
942
943 /// Output only. The short name displayed for the label as it appears on event
944 /// data.
945 pub display_name: std::string::String,
946
947 /// Output only. The time at which the data access label was created.
948 pub create_time: std::option::Option<wkt::Timestamp>,
949
950 /// Output only. The time at which the data access label was last updated.
951 pub update_time: std::option::Option<wkt::Timestamp>,
952
953 /// Output only. The user who created the data access label.
954 pub author: std::string::String,
955
956 /// Output only. The user who last updated the data access label.
957 pub last_editor: std::string::String,
958
959 /// Optional. A description of the data access label for a human reader.
960 pub description: std::string::String,
961
962 /// Required.
963 /// The definition of the data access label that determines which
964 /// data gets tagged with this label.
965 pub definition: std::option::Option<crate::model::data_access_label::Definition>,
966
967 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
968}
969
970impl DataAccessLabel {
971 /// Creates a new default instance.
972 pub fn new() -> Self {
973 std::default::Default::default()
974 }
975
976 /// Sets the value of [name][crate::model::DataAccessLabel::name].
977 ///
978 /// # Example
979 /// ```ignore,no_run
980 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
981 /// let x = DataAccessLabel::new().set_name("example");
982 /// ```
983 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
984 self.name = v.into();
985 self
986 }
987
988 /// Sets the value of [display_name][crate::model::DataAccessLabel::display_name].
989 ///
990 /// # Example
991 /// ```ignore,no_run
992 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
993 /// let x = DataAccessLabel::new().set_display_name("example");
994 /// ```
995 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
996 self.display_name = v.into();
997 self
998 }
999
1000 /// Sets the value of [create_time][crate::model::DataAccessLabel::create_time].
1001 ///
1002 /// # Example
1003 /// ```ignore,no_run
1004 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1005 /// use wkt::Timestamp;
1006 /// let x = DataAccessLabel::new().set_create_time(Timestamp::default()/* use setters */);
1007 /// ```
1008 pub fn set_create_time<T>(mut self, v: T) -> Self
1009 where
1010 T: std::convert::Into<wkt::Timestamp>,
1011 {
1012 self.create_time = std::option::Option::Some(v.into());
1013 self
1014 }
1015
1016 /// Sets or clears the value of [create_time][crate::model::DataAccessLabel::create_time].
1017 ///
1018 /// # Example
1019 /// ```ignore,no_run
1020 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1021 /// use wkt::Timestamp;
1022 /// let x = DataAccessLabel::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1023 /// let x = DataAccessLabel::new().set_or_clear_create_time(None::<Timestamp>);
1024 /// ```
1025 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1026 where
1027 T: std::convert::Into<wkt::Timestamp>,
1028 {
1029 self.create_time = v.map(|x| x.into());
1030 self
1031 }
1032
1033 /// Sets the value of [update_time][crate::model::DataAccessLabel::update_time].
1034 ///
1035 /// # Example
1036 /// ```ignore,no_run
1037 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1038 /// use wkt::Timestamp;
1039 /// let x = DataAccessLabel::new().set_update_time(Timestamp::default()/* use setters */);
1040 /// ```
1041 pub fn set_update_time<T>(mut self, v: T) -> Self
1042 where
1043 T: std::convert::Into<wkt::Timestamp>,
1044 {
1045 self.update_time = std::option::Option::Some(v.into());
1046 self
1047 }
1048
1049 /// Sets or clears the value of [update_time][crate::model::DataAccessLabel::update_time].
1050 ///
1051 /// # Example
1052 /// ```ignore,no_run
1053 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1054 /// use wkt::Timestamp;
1055 /// let x = DataAccessLabel::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1056 /// let x = DataAccessLabel::new().set_or_clear_update_time(None::<Timestamp>);
1057 /// ```
1058 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1059 where
1060 T: std::convert::Into<wkt::Timestamp>,
1061 {
1062 self.update_time = v.map(|x| x.into());
1063 self
1064 }
1065
1066 /// Sets the value of [author][crate::model::DataAccessLabel::author].
1067 ///
1068 /// # Example
1069 /// ```ignore,no_run
1070 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1071 /// let x = DataAccessLabel::new().set_author("example");
1072 /// ```
1073 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1074 self.author = v.into();
1075 self
1076 }
1077
1078 /// Sets the value of [last_editor][crate::model::DataAccessLabel::last_editor].
1079 ///
1080 /// # Example
1081 /// ```ignore,no_run
1082 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1083 /// let x = DataAccessLabel::new().set_last_editor("example");
1084 /// ```
1085 pub fn set_last_editor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1086 self.last_editor = v.into();
1087 self
1088 }
1089
1090 /// Sets the value of [description][crate::model::DataAccessLabel::description].
1091 ///
1092 /// # Example
1093 /// ```ignore,no_run
1094 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1095 /// let x = DataAccessLabel::new().set_description("example");
1096 /// ```
1097 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1098 self.description = v.into();
1099 self
1100 }
1101
1102 /// Sets the value of [definition][crate::model::DataAccessLabel::definition].
1103 ///
1104 /// Note that all the setters affecting `definition` are mutually
1105 /// exclusive.
1106 ///
1107 /// # Example
1108 /// ```ignore,no_run
1109 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1110 /// use google_cloud_chronicle_v1::model::data_access_label::Definition;
1111 /// let x = DataAccessLabel::new().set_definition(Some(Definition::UdmQuery("example".to_string())));
1112 /// ```
1113 pub fn set_definition<
1114 T: std::convert::Into<std::option::Option<crate::model::data_access_label::Definition>>,
1115 >(
1116 mut self,
1117 v: T,
1118 ) -> Self {
1119 self.definition = v.into();
1120 self
1121 }
1122
1123 /// The value of [definition][crate::model::DataAccessLabel::definition]
1124 /// if it holds a `UdmQuery`, `None` if the field is not set or
1125 /// holds a different branch.
1126 pub fn udm_query(&self) -> std::option::Option<&std::string::String> {
1127 #[allow(unreachable_patterns)]
1128 self.definition.as_ref().and_then(|v| match v {
1129 crate::model::data_access_label::Definition::UdmQuery(v) => {
1130 std::option::Option::Some(v)
1131 }
1132 _ => std::option::Option::None,
1133 })
1134 }
1135
1136 /// Sets the value of [definition][crate::model::DataAccessLabel::definition]
1137 /// to hold a `UdmQuery`.
1138 ///
1139 /// Note that all the setters affecting `definition` are
1140 /// mutually exclusive.
1141 ///
1142 /// # Example
1143 /// ```ignore,no_run
1144 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1145 /// let x = DataAccessLabel::new().set_udm_query("example");
1146 /// assert!(x.udm_query().is_some());
1147 /// ```
1148 pub fn set_udm_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1149 self.definition = std::option::Option::Some(
1150 crate::model::data_access_label::Definition::UdmQuery(v.into()),
1151 );
1152 self
1153 }
1154}
1155
1156impl wkt::message::Message for DataAccessLabel {
1157 fn typename() -> &'static str {
1158 "type.googleapis.com/google.cloud.chronicle.v1.DataAccessLabel"
1159 }
1160}
1161
1162/// Defines additional types related to [DataAccessLabel].
1163pub mod data_access_label {
1164 #[allow(unused_imports)]
1165 use super::*;
1166
1167 /// Required.
1168 /// The definition of the data access label that determines which
1169 /// data gets tagged with this label.
1170 #[derive(Clone, Debug, PartialEq)]
1171 #[non_exhaustive]
1172 pub enum Definition {
1173 /// A UDM query over event data.
1174 UdmQuery(std::string::String),
1175 }
1176}
1177
1178/// A DataAccessScope is a boolean expression of data access labels used
1179/// to restrict access to data for users.
1180#[derive(Clone, Default, PartialEq)]
1181#[non_exhaustive]
1182pub struct DataAccessScope {
1183 /// Required. The unique full name of the data access scope.
1184 /// The name should comply with <https://google.aip.dev/122> standards.
1185 pub name: std::string::String,
1186
1187 /// Optional. The allowed labels for the scope.
1188 /// Either allow_all or allowed_data_access_labels needs to be provided.
1189 /// When provided, there has to be at least one label allowed for the scope to
1190 /// be valid.
1191 /// The logical operator for evaluation of the allowed labels is OR.
1192 /// E.g.: A customer with scope with allowed labels A and B will be able
1193 /// to see data with labeled with A or B or (A and B).
1194 pub allowed_data_access_labels: std::vec::Vec<crate::model::DataAccessLabelReference>,
1195
1196 /// Optional. The denied labels for the scope.
1197 /// The logical operator for evaluation of the denied labels is AND.
1198 /// E.g.: A customer with scope with denied labels A and B won't be able
1199 /// to see data labeled with A and data labeled with B
1200 /// and data with labels A and B.
1201 pub denied_data_access_labels: std::vec::Vec<crate::model::DataAccessLabelReference>,
1202
1203 /// Output only. The name to be used for display to customers of the data
1204 /// access scope.
1205 pub display_name: std::string::String,
1206
1207 /// Output only. The time at which the data access scope was created.
1208 pub create_time: std::option::Option<wkt::Timestamp>,
1209
1210 /// Output only. The time at which the data access scope was last updated.
1211 pub update_time: std::option::Option<wkt::Timestamp>,
1212
1213 /// Output only. The user who created the data access scope.
1214 pub author: std::string::String,
1215
1216 /// Output only. The user who last updated the data access scope.
1217 pub last_editor: std::string::String,
1218
1219 /// Optional. A description of the data access scope for a human reader.
1220 pub description: std::string::String,
1221
1222 /// Optional. Whether or not the scope allows all labels, allow_all and
1223 /// allowed_data_access_labels are mutually exclusive and one of them must be
1224 /// present. denied_data_access_labels can still be used along with allow_all.
1225 /// When combined with denied_data_access_labels, access will be granted to all
1226 /// data that doesn't have labels mentioned in denied_data_access_labels. E.g.:
1227 /// A customer with scope with denied labels A and B and allow_all will be able
1228 /// to see all data except data labeled with A and data labeled with B and data
1229 /// with labels A and B.
1230 pub allow_all: bool,
1231
1232 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1233}
1234
1235impl DataAccessScope {
1236 /// Creates a new default instance.
1237 pub fn new() -> Self {
1238 std::default::Default::default()
1239 }
1240
1241 /// Sets the value of [name][crate::model::DataAccessScope::name].
1242 ///
1243 /// # Example
1244 /// ```ignore,no_run
1245 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1246 /// let x = DataAccessScope::new().set_name("example");
1247 /// ```
1248 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1249 self.name = v.into();
1250 self
1251 }
1252
1253 /// Sets the value of [allowed_data_access_labels][crate::model::DataAccessScope::allowed_data_access_labels].
1254 ///
1255 /// # Example
1256 /// ```ignore,no_run
1257 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1258 /// use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1259 /// let x = DataAccessScope::new()
1260 /// .set_allowed_data_access_labels([
1261 /// DataAccessLabelReference::default()/* use setters */,
1262 /// DataAccessLabelReference::default()/* use (different) setters */,
1263 /// ]);
1264 /// ```
1265 pub fn set_allowed_data_access_labels<T, V>(mut self, v: T) -> Self
1266 where
1267 T: std::iter::IntoIterator<Item = V>,
1268 V: std::convert::Into<crate::model::DataAccessLabelReference>,
1269 {
1270 use std::iter::Iterator;
1271 self.allowed_data_access_labels = v.into_iter().map(|i| i.into()).collect();
1272 self
1273 }
1274
1275 /// Sets the value of [denied_data_access_labels][crate::model::DataAccessScope::denied_data_access_labels].
1276 ///
1277 /// # Example
1278 /// ```ignore,no_run
1279 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1280 /// use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1281 /// let x = DataAccessScope::new()
1282 /// .set_denied_data_access_labels([
1283 /// DataAccessLabelReference::default()/* use setters */,
1284 /// DataAccessLabelReference::default()/* use (different) setters */,
1285 /// ]);
1286 /// ```
1287 pub fn set_denied_data_access_labels<T, V>(mut self, v: T) -> Self
1288 where
1289 T: std::iter::IntoIterator<Item = V>,
1290 V: std::convert::Into<crate::model::DataAccessLabelReference>,
1291 {
1292 use std::iter::Iterator;
1293 self.denied_data_access_labels = v.into_iter().map(|i| i.into()).collect();
1294 self
1295 }
1296
1297 /// Sets the value of [display_name][crate::model::DataAccessScope::display_name].
1298 ///
1299 /// # Example
1300 /// ```ignore,no_run
1301 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1302 /// let x = DataAccessScope::new().set_display_name("example");
1303 /// ```
1304 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1305 self.display_name = v.into();
1306 self
1307 }
1308
1309 /// Sets the value of [create_time][crate::model::DataAccessScope::create_time].
1310 ///
1311 /// # Example
1312 /// ```ignore,no_run
1313 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1314 /// use wkt::Timestamp;
1315 /// let x = DataAccessScope::new().set_create_time(Timestamp::default()/* use setters */);
1316 /// ```
1317 pub fn set_create_time<T>(mut self, v: T) -> Self
1318 where
1319 T: std::convert::Into<wkt::Timestamp>,
1320 {
1321 self.create_time = std::option::Option::Some(v.into());
1322 self
1323 }
1324
1325 /// Sets or clears the value of [create_time][crate::model::DataAccessScope::create_time].
1326 ///
1327 /// # Example
1328 /// ```ignore,no_run
1329 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1330 /// use wkt::Timestamp;
1331 /// let x = DataAccessScope::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1332 /// let x = DataAccessScope::new().set_or_clear_create_time(None::<Timestamp>);
1333 /// ```
1334 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1335 where
1336 T: std::convert::Into<wkt::Timestamp>,
1337 {
1338 self.create_time = v.map(|x| x.into());
1339 self
1340 }
1341
1342 /// Sets the value of [update_time][crate::model::DataAccessScope::update_time].
1343 ///
1344 /// # Example
1345 /// ```ignore,no_run
1346 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1347 /// use wkt::Timestamp;
1348 /// let x = DataAccessScope::new().set_update_time(Timestamp::default()/* use setters */);
1349 /// ```
1350 pub fn set_update_time<T>(mut self, v: T) -> Self
1351 where
1352 T: std::convert::Into<wkt::Timestamp>,
1353 {
1354 self.update_time = std::option::Option::Some(v.into());
1355 self
1356 }
1357
1358 /// Sets or clears the value of [update_time][crate::model::DataAccessScope::update_time].
1359 ///
1360 /// # Example
1361 /// ```ignore,no_run
1362 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1363 /// use wkt::Timestamp;
1364 /// let x = DataAccessScope::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1365 /// let x = DataAccessScope::new().set_or_clear_update_time(None::<Timestamp>);
1366 /// ```
1367 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1368 where
1369 T: std::convert::Into<wkt::Timestamp>,
1370 {
1371 self.update_time = v.map(|x| x.into());
1372 self
1373 }
1374
1375 /// Sets the value of [author][crate::model::DataAccessScope::author].
1376 ///
1377 /// # Example
1378 /// ```ignore,no_run
1379 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1380 /// let x = DataAccessScope::new().set_author("example");
1381 /// ```
1382 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1383 self.author = v.into();
1384 self
1385 }
1386
1387 /// Sets the value of [last_editor][crate::model::DataAccessScope::last_editor].
1388 ///
1389 /// # Example
1390 /// ```ignore,no_run
1391 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1392 /// let x = DataAccessScope::new().set_last_editor("example");
1393 /// ```
1394 pub fn set_last_editor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1395 self.last_editor = v.into();
1396 self
1397 }
1398
1399 /// Sets the value of [description][crate::model::DataAccessScope::description].
1400 ///
1401 /// # Example
1402 /// ```ignore,no_run
1403 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1404 /// let x = DataAccessScope::new().set_description("example");
1405 /// ```
1406 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1407 self.description = v.into();
1408 self
1409 }
1410
1411 /// Sets the value of [allow_all][crate::model::DataAccessScope::allow_all].
1412 ///
1413 /// # Example
1414 /// ```ignore,no_run
1415 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1416 /// let x = DataAccessScope::new().set_allow_all(true);
1417 /// ```
1418 pub fn set_allow_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1419 self.allow_all = v.into();
1420 self
1421 }
1422}
1423
1424impl wkt::message::Message for DataAccessScope {
1425 fn typename() -> &'static str {
1426 "type.googleapis.com/google.cloud.chronicle.v1.DataAccessScope"
1427 }
1428}
1429
1430/// Reference object to a data access label.
1431#[derive(Clone, Default, PartialEq)]
1432#[non_exhaustive]
1433pub struct DataAccessLabelReference {
1434 /// Output only. The display name of the label.
1435 /// Data access label and log types's name
1436 /// will match the display name of the resource.
1437 /// The asset namespace will match the namespace itself.
1438 /// The ingestion key value pair will match the key of the tuple.
1439 pub display_name: std::string::String,
1440
1441 /// The unique identifier for the label.
1442 pub label: std::option::Option<crate::model::data_access_label_reference::Label>,
1443
1444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1445}
1446
1447impl DataAccessLabelReference {
1448 /// Creates a new default instance.
1449 pub fn new() -> Self {
1450 std::default::Default::default()
1451 }
1452
1453 /// Sets the value of [display_name][crate::model::DataAccessLabelReference::display_name].
1454 ///
1455 /// # Example
1456 /// ```ignore,no_run
1457 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1458 /// let x = DataAccessLabelReference::new().set_display_name("example");
1459 /// ```
1460 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1461 self.display_name = v.into();
1462 self
1463 }
1464
1465 /// Sets the value of [label][crate::model::DataAccessLabelReference::label].
1466 ///
1467 /// Note that all the setters affecting `label` are mutually
1468 /// exclusive.
1469 ///
1470 /// # Example
1471 /// ```ignore,no_run
1472 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1473 /// use google_cloud_chronicle_v1::model::data_access_label_reference::Label;
1474 /// let x = DataAccessLabelReference::new().set_label(Some(Label::DataAccessLabel("example".to_string())));
1475 /// ```
1476 pub fn set_label<
1477 T: std::convert::Into<std::option::Option<crate::model::data_access_label_reference::Label>>,
1478 >(
1479 mut self,
1480 v: T,
1481 ) -> Self {
1482 self.label = v.into();
1483 self
1484 }
1485
1486 /// The value of [label][crate::model::DataAccessLabelReference::label]
1487 /// if it holds a `DataAccessLabel`, `None` if the field is not set or
1488 /// holds a different branch.
1489 pub fn data_access_label(&self) -> std::option::Option<&std::string::String> {
1490 #[allow(unreachable_patterns)]
1491 self.label.as_ref().and_then(|v| match v {
1492 crate::model::data_access_label_reference::Label::DataAccessLabel(v) => {
1493 std::option::Option::Some(v)
1494 }
1495 _ => std::option::Option::None,
1496 })
1497 }
1498
1499 /// Sets the value of [label][crate::model::DataAccessLabelReference::label]
1500 /// to hold a `DataAccessLabel`.
1501 ///
1502 /// Note that all the setters affecting `label` are
1503 /// mutually exclusive.
1504 ///
1505 /// # Example
1506 /// ```ignore,no_run
1507 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1508 /// let x = DataAccessLabelReference::new().set_data_access_label("example");
1509 /// assert!(x.data_access_label().is_some());
1510 /// assert!(x.log_type().is_none());
1511 /// assert!(x.asset_namespace().is_none());
1512 /// assert!(x.ingestion_label().is_none());
1513 /// ```
1514 pub fn set_data_access_label<T: std::convert::Into<std::string::String>>(
1515 mut self,
1516 v: T,
1517 ) -> Self {
1518 self.label = std::option::Option::Some(
1519 crate::model::data_access_label_reference::Label::DataAccessLabel(v.into()),
1520 );
1521 self
1522 }
1523
1524 /// The value of [label][crate::model::DataAccessLabelReference::label]
1525 /// if it holds a `LogType`, `None` if the field is not set or
1526 /// holds a different branch.
1527 pub fn log_type(&self) -> std::option::Option<&std::string::String> {
1528 #[allow(unreachable_patterns)]
1529 self.label.as_ref().and_then(|v| match v {
1530 crate::model::data_access_label_reference::Label::LogType(v) => {
1531 std::option::Option::Some(v)
1532 }
1533 _ => std::option::Option::None,
1534 })
1535 }
1536
1537 /// Sets the value of [label][crate::model::DataAccessLabelReference::label]
1538 /// to hold a `LogType`.
1539 ///
1540 /// Note that all the setters affecting `label` are
1541 /// mutually exclusive.
1542 ///
1543 /// # Example
1544 /// ```ignore,no_run
1545 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1546 /// let x = DataAccessLabelReference::new().set_log_type("example");
1547 /// assert!(x.log_type().is_some());
1548 /// assert!(x.data_access_label().is_none());
1549 /// assert!(x.asset_namespace().is_none());
1550 /// assert!(x.ingestion_label().is_none());
1551 /// ```
1552 pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1553 self.label = std::option::Option::Some(
1554 crate::model::data_access_label_reference::Label::LogType(v.into()),
1555 );
1556 self
1557 }
1558
1559 /// The value of [label][crate::model::DataAccessLabelReference::label]
1560 /// if it holds a `AssetNamespace`, `None` if the field is not set or
1561 /// holds a different branch.
1562 pub fn asset_namespace(&self) -> std::option::Option<&std::string::String> {
1563 #[allow(unreachable_patterns)]
1564 self.label.as_ref().and_then(|v| match v {
1565 crate::model::data_access_label_reference::Label::AssetNamespace(v) => {
1566 std::option::Option::Some(v)
1567 }
1568 _ => std::option::Option::None,
1569 })
1570 }
1571
1572 /// Sets the value of [label][crate::model::DataAccessLabelReference::label]
1573 /// to hold a `AssetNamespace`.
1574 ///
1575 /// Note that all the setters affecting `label` are
1576 /// mutually exclusive.
1577 ///
1578 /// # Example
1579 /// ```ignore,no_run
1580 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1581 /// let x = DataAccessLabelReference::new().set_asset_namespace("example");
1582 /// assert!(x.asset_namespace().is_some());
1583 /// assert!(x.data_access_label().is_none());
1584 /// assert!(x.log_type().is_none());
1585 /// assert!(x.ingestion_label().is_none());
1586 /// ```
1587 pub fn set_asset_namespace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1588 self.label = std::option::Option::Some(
1589 crate::model::data_access_label_reference::Label::AssetNamespace(v.into()),
1590 );
1591 self
1592 }
1593
1594 /// The value of [label][crate::model::DataAccessLabelReference::label]
1595 /// if it holds a `IngestionLabel`, `None` if the field is not set or
1596 /// holds a different branch.
1597 pub fn ingestion_label(
1598 &self,
1599 ) -> std::option::Option<&std::boxed::Box<crate::model::IngestionLabel>> {
1600 #[allow(unreachable_patterns)]
1601 self.label.as_ref().and_then(|v| match v {
1602 crate::model::data_access_label_reference::Label::IngestionLabel(v) => {
1603 std::option::Option::Some(v)
1604 }
1605 _ => std::option::Option::None,
1606 })
1607 }
1608
1609 /// Sets the value of [label][crate::model::DataAccessLabelReference::label]
1610 /// to hold a `IngestionLabel`.
1611 ///
1612 /// Note that all the setters affecting `label` are
1613 /// mutually exclusive.
1614 ///
1615 /// # Example
1616 /// ```ignore,no_run
1617 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1618 /// use google_cloud_chronicle_v1::model::IngestionLabel;
1619 /// let x = DataAccessLabelReference::new().set_ingestion_label(IngestionLabel::default()/* use setters */);
1620 /// assert!(x.ingestion_label().is_some());
1621 /// assert!(x.data_access_label().is_none());
1622 /// assert!(x.log_type().is_none());
1623 /// assert!(x.asset_namespace().is_none());
1624 /// ```
1625 pub fn set_ingestion_label<
1626 T: std::convert::Into<std::boxed::Box<crate::model::IngestionLabel>>,
1627 >(
1628 mut self,
1629 v: T,
1630 ) -> Self {
1631 self.label = std::option::Option::Some(
1632 crate::model::data_access_label_reference::Label::IngestionLabel(v.into()),
1633 );
1634 self
1635 }
1636}
1637
1638impl wkt::message::Message for DataAccessLabelReference {
1639 fn typename() -> &'static str {
1640 "type.googleapis.com/google.cloud.chronicle.v1.DataAccessLabelReference"
1641 }
1642}
1643
1644/// Defines additional types related to [DataAccessLabelReference].
1645pub mod data_access_label_reference {
1646 #[allow(unused_imports)]
1647 use super::*;
1648
1649 /// The unique identifier for the label.
1650 #[derive(Clone, Debug, PartialEq)]
1651 #[non_exhaustive]
1652 pub enum Label {
1653 /// The name of the data access label.
1654 DataAccessLabel(std::string::String),
1655 /// The name of the log type.
1656 LogType(std::string::String),
1657 /// The asset namespace configured in the forwarder
1658 /// of the customer's events.
1659 AssetNamespace(std::string::String),
1660 /// The ingestion label configured in the forwarder of the customer's events.
1661 IngestionLabel(std::boxed::Box<crate::model::IngestionLabel>),
1662 }
1663}
1664
1665/// Representation of an ingestion label type.
1666#[derive(Clone, Default, PartialEq)]
1667#[non_exhaustive]
1668pub struct IngestionLabel {
1669 /// Required. The key of the ingestion label. Always required.
1670 pub ingestion_label_key: std::string::String,
1671
1672 /// Optional. The value of the ingestion label. Optional. An object
1673 /// with no provided value and some key provided would match
1674 /// against the given key and ANY value.
1675 pub ingestion_label_value: std::string::String,
1676
1677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1678}
1679
1680impl IngestionLabel {
1681 /// Creates a new default instance.
1682 pub fn new() -> Self {
1683 std::default::Default::default()
1684 }
1685
1686 /// Sets the value of [ingestion_label_key][crate::model::IngestionLabel::ingestion_label_key].
1687 ///
1688 /// # Example
1689 /// ```ignore,no_run
1690 /// # use google_cloud_chronicle_v1::model::IngestionLabel;
1691 /// let x = IngestionLabel::new().set_ingestion_label_key("example");
1692 /// ```
1693 pub fn set_ingestion_label_key<T: std::convert::Into<std::string::String>>(
1694 mut self,
1695 v: T,
1696 ) -> Self {
1697 self.ingestion_label_key = v.into();
1698 self
1699 }
1700
1701 /// Sets the value of [ingestion_label_value][crate::model::IngestionLabel::ingestion_label_value].
1702 ///
1703 /// # Example
1704 /// ```ignore,no_run
1705 /// # use google_cloud_chronicle_v1::model::IngestionLabel;
1706 /// let x = IngestionLabel::new().set_ingestion_label_value("example");
1707 /// ```
1708 pub fn set_ingestion_label_value<T: std::convert::Into<std::string::String>>(
1709 mut self,
1710 v: T,
1711 ) -> Self {
1712 self.ingestion_label_value = v.into();
1713 self
1714 }
1715}
1716
1717impl wkt::message::Message for IngestionLabel {
1718 fn typename() -> &'static str {
1719 "type.googleapis.com/google.cloud.chronicle.v1.IngestionLabel"
1720 }
1721}
1722
1723/// A request to create DataTable.
1724#[derive(Clone, Default, PartialEq)]
1725#[non_exhaustive]
1726pub struct CreateDataTableRequest {
1727 /// Required. The parent resource where this data table will be created.
1728 /// Format: projects/{project}/locations/{location}/instances/{instance}
1729 pub parent: std::string::String,
1730
1731 /// Required. The data table being created.
1732 pub data_table: std::option::Option<crate::model::DataTable>,
1733
1734 /// Required. The ID to use for the data table. This is also the display name
1735 /// for the data table. It must satisfy the following requirements:
1736 ///
1737 /// - Starts with letter.
1738 /// - Contains only letters, numbers and underscore.
1739 /// - Must be unique and has length < 256.
1740 pub data_table_id: std::string::String,
1741
1742 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1743}
1744
1745impl CreateDataTableRequest {
1746 /// Creates a new default instance.
1747 pub fn new() -> Self {
1748 std::default::Default::default()
1749 }
1750
1751 /// Sets the value of [parent][crate::model::CreateDataTableRequest::parent].
1752 ///
1753 /// # Example
1754 /// ```ignore,no_run
1755 /// # use google_cloud_chronicle_v1::model::CreateDataTableRequest;
1756 /// let x = CreateDataTableRequest::new().set_parent("example");
1757 /// ```
1758 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1759 self.parent = v.into();
1760 self
1761 }
1762
1763 /// Sets the value of [data_table][crate::model::CreateDataTableRequest::data_table].
1764 ///
1765 /// # Example
1766 /// ```ignore,no_run
1767 /// # use google_cloud_chronicle_v1::model::CreateDataTableRequest;
1768 /// use google_cloud_chronicle_v1::model::DataTable;
1769 /// let x = CreateDataTableRequest::new().set_data_table(DataTable::default()/* use setters */);
1770 /// ```
1771 pub fn set_data_table<T>(mut self, v: T) -> Self
1772 where
1773 T: std::convert::Into<crate::model::DataTable>,
1774 {
1775 self.data_table = std::option::Option::Some(v.into());
1776 self
1777 }
1778
1779 /// Sets or clears the value of [data_table][crate::model::CreateDataTableRequest::data_table].
1780 ///
1781 /// # Example
1782 /// ```ignore,no_run
1783 /// # use google_cloud_chronicle_v1::model::CreateDataTableRequest;
1784 /// use google_cloud_chronicle_v1::model::DataTable;
1785 /// let x = CreateDataTableRequest::new().set_or_clear_data_table(Some(DataTable::default()/* use setters */));
1786 /// let x = CreateDataTableRequest::new().set_or_clear_data_table(None::<DataTable>);
1787 /// ```
1788 pub fn set_or_clear_data_table<T>(mut self, v: std::option::Option<T>) -> Self
1789 where
1790 T: std::convert::Into<crate::model::DataTable>,
1791 {
1792 self.data_table = v.map(|x| x.into());
1793 self
1794 }
1795
1796 /// Sets the value of [data_table_id][crate::model::CreateDataTableRequest::data_table_id].
1797 ///
1798 /// # Example
1799 /// ```ignore,no_run
1800 /// # use google_cloud_chronicle_v1::model::CreateDataTableRequest;
1801 /// let x = CreateDataTableRequest::new().set_data_table_id("example");
1802 /// ```
1803 pub fn set_data_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1804 self.data_table_id = v.into();
1805 self
1806 }
1807}
1808
1809impl wkt::message::Message for CreateDataTableRequest {
1810 fn typename() -> &'static str {
1811 "type.googleapis.com/google.cloud.chronicle.v1.CreateDataTableRequest"
1812 }
1813}
1814
1815/// A request to get details about a data table.
1816#[derive(Clone, Default, PartialEq)]
1817#[non_exhaustive]
1818pub struct GetDataTableRequest {
1819 /// Required. The resource name of the data table to retrieve.
1820 /// Format:
1821 /// projects/{project}/locations/{location}/instances/{instances}/dataTables/{data_table}
1822 pub name: std::string::String,
1823
1824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1825}
1826
1827impl GetDataTableRequest {
1828 /// Creates a new default instance.
1829 pub fn new() -> Self {
1830 std::default::Default::default()
1831 }
1832
1833 /// Sets the value of [name][crate::model::GetDataTableRequest::name].
1834 ///
1835 /// # Example
1836 /// ```ignore,no_run
1837 /// # use google_cloud_chronicle_v1::model::GetDataTableRequest;
1838 /// let x = GetDataTableRequest::new().set_name("example");
1839 /// ```
1840 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1841 self.name = v.into();
1842 self
1843 }
1844}
1845
1846impl wkt::message::Message for GetDataTableRequest {
1847 fn typename() -> &'static str {
1848 "type.googleapis.com/google.cloud.chronicle.v1.GetDataTableRequest"
1849 }
1850}
1851
1852/// A request to update details of data table.
1853#[derive(Clone, Default, PartialEq)]
1854#[non_exhaustive]
1855pub struct UpdateDataTableRequest {
1856 /// Required. This field is used to identify the datatable to update.
1857 /// Format:
1858 /// projects/{project}/locations/{locations}/instances/{instance}/dataTables/{data_table}
1859 pub data_table: std::option::Option<crate::model::DataTable>,
1860
1861 /// Optional. The list of metadata fields to update. Currently data tables only
1862 /// support updating the `description`, `row_time_to_live` and `scope_info`
1863 /// fields. When no field mask is supplied, all non-empty fields will be
1864 /// updated. A field mask of "*" will update all fields, whether empty or not.
1865 pub update_mask: std::option::Option<wkt::FieldMask>,
1866
1867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1868}
1869
1870impl UpdateDataTableRequest {
1871 /// Creates a new default instance.
1872 pub fn new() -> Self {
1873 std::default::Default::default()
1874 }
1875
1876 /// Sets the value of [data_table][crate::model::UpdateDataTableRequest::data_table].
1877 ///
1878 /// # Example
1879 /// ```ignore,no_run
1880 /// # use google_cloud_chronicle_v1::model::UpdateDataTableRequest;
1881 /// use google_cloud_chronicle_v1::model::DataTable;
1882 /// let x = UpdateDataTableRequest::new().set_data_table(DataTable::default()/* use setters */);
1883 /// ```
1884 pub fn set_data_table<T>(mut self, v: T) -> Self
1885 where
1886 T: std::convert::Into<crate::model::DataTable>,
1887 {
1888 self.data_table = std::option::Option::Some(v.into());
1889 self
1890 }
1891
1892 /// Sets or clears the value of [data_table][crate::model::UpdateDataTableRequest::data_table].
1893 ///
1894 /// # Example
1895 /// ```ignore,no_run
1896 /// # use google_cloud_chronicle_v1::model::UpdateDataTableRequest;
1897 /// use google_cloud_chronicle_v1::model::DataTable;
1898 /// let x = UpdateDataTableRequest::new().set_or_clear_data_table(Some(DataTable::default()/* use setters */));
1899 /// let x = UpdateDataTableRequest::new().set_or_clear_data_table(None::<DataTable>);
1900 /// ```
1901 pub fn set_or_clear_data_table<T>(mut self, v: std::option::Option<T>) -> Self
1902 where
1903 T: std::convert::Into<crate::model::DataTable>,
1904 {
1905 self.data_table = v.map(|x| x.into());
1906 self
1907 }
1908
1909 /// Sets the value of [update_mask][crate::model::UpdateDataTableRequest::update_mask].
1910 ///
1911 /// # Example
1912 /// ```ignore,no_run
1913 /// # use google_cloud_chronicle_v1::model::UpdateDataTableRequest;
1914 /// use wkt::FieldMask;
1915 /// let x = UpdateDataTableRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1916 /// ```
1917 pub fn set_update_mask<T>(mut self, v: T) -> Self
1918 where
1919 T: std::convert::Into<wkt::FieldMask>,
1920 {
1921 self.update_mask = std::option::Option::Some(v.into());
1922 self
1923 }
1924
1925 /// Sets or clears the value of [update_mask][crate::model::UpdateDataTableRequest::update_mask].
1926 ///
1927 /// # Example
1928 /// ```ignore,no_run
1929 /// # use google_cloud_chronicle_v1::model::UpdateDataTableRequest;
1930 /// use wkt::FieldMask;
1931 /// let x = UpdateDataTableRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1932 /// let x = UpdateDataTableRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1933 /// ```
1934 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1935 where
1936 T: std::convert::Into<wkt::FieldMask>,
1937 {
1938 self.update_mask = v.map(|x| x.into());
1939 self
1940 }
1941}
1942
1943impl wkt::message::Message for UpdateDataTableRequest {
1944 fn typename() -> &'static str {
1945 "type.googleapis.com/google.cloud.chronicle.v1.UpdateDataTableRequest"
1946 }
1947}
1948
1949/// A request for a list of data tables.
1950#[derive(Clone, Default, PartialEq)]
1951#[non_exhaustive]
1952pub struct ListDataTablesRequest {
1953 /// Required. The parent resource where this data table will be created.
1954 /// Format: projects/{project}/locations/{location}/instances/{instance}
1955 pub parent: std::string::String,
1956
1957 /// Optional. The maximum number of data tables to return. The service may
1958 /// return fewer than this value. If unspecified, at most 100 data tables will
1959 /// be returned. The maximum value is 1000; values above 1000 will be coerced
1960 /// to 1000.
1961 pub page_size: i32,
1962
1963 /// Optional. A page token, received from a previous `ListDataTables` call.
1964 /// Provide this to retrieve the subsequent page.
1965 /// When paginating, all other parameters provided to
1966 /// `ListDataTables` must match the call that provided the page
1967 /// token.
1968 pub page_token: std::string::String,
1969
1970 /// Optional. Configures ordering of DataTables in the response.
1971 /// Note: Our implementation currently supports order by "create_time asc" only
1972 pub order_by: std::string::String,
1973
1974 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1975}
1976
1977impl ListDataTablesRequest {
1978 /// Creates a new default instance.
1979 pub fn new() -> Self {
1980 std::default::Default::default()
1981 }
1982
1983 /// Sets the value of [parent][crate::model::ListDataTablesRequest::parent].
1984 ///
1985 /// # Example
1986 /// ```ignore,no_run
1987 /// # use google_cloud_chronicle_v1::model::ListDataTablesRequest;
1988 /// let x = ListDataTablesRequest::new().set_parent("example");
1989 /// ```
1990 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1991 self.parent = v.into();
1992 self
1993 }
1994
1995 /// Sets the value of [page_size][crate::model::ListDataTablesRequest::page_size].
1996 ///
1997 /// # Example
1998 /// ```ignore,no_run
1999 /// # use google_cloud_chronicle_v1::model::ListDataTablesRequest;
2000 /// let x = ListDataTablesRequest::new().set_page_size(42);
2001 /// ```
2002 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2003 self.page_size = v.into();
2004 self
2005 }
2006
2007 /// Sets the value of [page_token][crate::model::ListDataTablesRequest::page_token].
2008 ///
2009 /// # Example
2010 /// ```ignore,no_run
2011 /// # use google_cloud_chronicle_v1::model::ListDataTablesRequest;
2012 /// let x = ListDataTablesRequest::new().set_page_token("example");
2013 /// ```
2014 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2015 self.page_token = v.into();
2016 self
2017 }
2018
2019 /// Sets the value of [order_by][crate::model::ListDataTablesRequest::order_by].
2020 ///
2021 /// # Example
2022 /// ```ignore,no_run
2023 /// # use google_cloud_chronicle_v1::model::ListDataTablesRequest;
2024 /// let x = ListDataTablesRequest::new().set_order_by("example");
2025 /// ```
2026 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2027 self.order_by = v.into();
2028 self
2029 }
2030}
2031
2032impl wkt::message::Message for ListDataTablesRequest {
2033 fn typename() -> &'static str {
2034 "type.googleapis.com/google.cloud.chronicle.v1.ListDataTablesRequest"
2035 }
2036}
2037
2038/// Request message for deleting data tables.
2039#[derive(Clone, Default, PartialEq)]
2040#[non_exhaustive]
2041pub struct DeleteDataTableRequest {
2042 /// Required. The resource name of the data table to delete.
2043 /// Format
2044 /// projects/{project}/locations/{location}/instances/{instances}/dataTables/{data_table}
2045 pub name: std::string::String,
2046
2047 /// Optional. If set to true, any rows under this data table will also be
2048 /// deleted. (Otherwise, the request will only work if the data table has no
2049 /// rows.)
2050 pub force: bool,
2051
2052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2053}
2054
2055impl DeleteDataTableRequest {
2056 /// Creates a new default instance.
2057 pub fn new() -> Self {
2058 std::default::Default::default()
2059 }
2060
2061 /// Sets the value of [name][crate::model::DeleteDataTableRequest::name].
2062 ///
2063 /// # Example
2064 /// ```ignore,no_run
2065 /// # use google_cloud_chronicle_v1::model::DeleteDataTableRequest;
2066 /// let x = DeleteDataTableRequest::new().set_name("example");
2067 /// ```
2068 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2069 self.name = v.into();
2070 self
2071 }
2072
2073 /// Sets the value of [force][crate::model::DeleteDataTableRequest::force].
2074 ///
2075 /// # Example
2076 /// ```ignore,no_run
2077 /// # use google_cloud_chronicle_v1::model::DeleteDataTableRequest;
2078 /// let x = DeleteDataTableRequest::new().set_force(true);
2079 /// ```
2080 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2081 self.force = v.into();
2082 self
2083 }
2084}
2085
2086impl wkt::message::Message for DeleteDataTableRequest {
2087 fn typename() -> &'static str {
2088 "type.googleapis.com/google.cloud.chronicle.v1.DeleteDataTableRequest"
2089 }
2090}
2091
2092/// Response message for listing data tables.
2093#[derive(Clone, Default, PartialEq)]
2094#[non_exhaustive]
2095pub struct ListDataTablesResponse {
2096 /// The list of the data tables returned.
2097 pub data_tables: std::vec::Vec<crate::model::DataTable>,
2098
2099 /// A token, which can be sent as `page_token` to retrieve the next page.
2100 /// If this field is omitted, there are no subsequent pages.
2101 pub next_page_token: std::string::String,
2102
2103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2104}
2105
2106impl ListDataTablesResponse {
2107 /// Creates a new default instance.
2108 pub fn new() -> Self {
2109 std::default::Default::default()
2110 }
2111
2112 /// Sets the value of [data_tables][crate::model::ListDataTablesResponse::data_tables].
2113 ///
2114 /// # Example
2115 /// ```ignore,no_run
2116 /// # use google_cloud_chronicle_v1::model::ListDataTablesResponse;
2117 /// use google_cloud_chronicle_v1::model::DataTable;
2118 /// let x = ListDataTablesResponse::new()
2119 /// .set_data_tables([
2120 /// DataTable::default()/* use setters */,
2121 /// DataTable::default()/* use (different) setters */,
2122 /// ]);
2123 /// ```
2124 pub fn set_data_tables<T, V>(mut self, v: T) -> Self
2125 where
2126 T: std::iter::IntoIterator<Item = V>,
2127 V: std::convert::Into<crate::model::DataTable>,
2128 {
2129 use std::iter::Iterator;
2130 self.data_tables = v.into_iter().map(|i| i.into()).collect();
2131 self
2132 }
2133
2134 /// Sets the value of [next_page_token][crate::model::ListDataTablesResponse::next_page_token].
2135 ///
2136 /// # Example
2137 /// ```ignore,no_run
2138 /// # use google_cloud_chronicle_v1::model::ListDataTablesResponse;
2139 /// let x = ListDataTablesResponse::new().set_next_page_token("example");
2140 /// ```
2141 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2142 self.next_page_token = v.into();
2143 self
2144 }
2145}
2146
2147impl wkt::message::Message for ListDataTablesResponse {
2148 fn typename() -> &'static str {
2149 "type.googleapis.com/google.cloud.chronicle.v1.ListDataTablesResponse"
2150 }
2151}
2152
2153#[doc(hidden)]
2154impl google_cloud_gax::paginator::internal::PageableResponse for ListDataTablesResponse {
2155 type PageItem = crate::model::DataTable;
2156
2157 fn items(self) -> std::vec::Vec<Self::PageItem> {
2158 self.data_tables
2159 }
2160
2161 fn next_page_token(&self) -> std::string::String {
2162 use std::clone::Clone;
2163 self.next_page_token.clone()
2164 }
2165}
2166
2167/// Request to create data table row.
2168#[derive(Clone, Default, PartialEq)]
2169#[non_exhaustive]
2170pub struct CreateDataTableRowRequest {
2171 /// Required. The resource id of the data table.
2172 /// Format:
2173 /// /projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}
2174 pub parent: std::string::String,
2175
2176 /// Required. The data table row to create.
2177 pub data_table_row: std::option::Option<crate::model::DataTableRow>,
2178
2179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2180}
2181
2182impl CreateDataTableRowRequest {
2183 /// Creates a new default instance.
2184 pub fn new() -> Self {
2185 std::default::Default::default()
2186 }
2187
2188 /// Sets the value of [parent][crate::model::CreateDataTableRowRequest::parent].
2189 ///
2190 /// # Example
2191 /// ```ignore,no_run
2192 /// # use google_cloud_chronicle_v1::model::CreateDataTableRowRequest;
2193 /// let x = CreateDataTableRowRequest::new().set_parent("example");
2194 /// ```
2195 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2196 self.parent = v.into();
2197 self
2198 }
2199
2200 /// Sets the value of [data_table_row][crate::model::CreateDataTableRowRequest::data_table_row].
2201 ///
2202 /// # Example
2203 /// ```ignore,no_run
2204 /// # use google_cloud_chronicle_v1::model::CreateDataTableRowRequest;
2205 /// use google_cloud_chronicle_v1::model::DataTableRow;
2206 /// let x = CreateDataTableRowRequest::new().set_data_table_row(DataTableRow::default()/* use setters */);
2207 /// ```
2208 pub fn set_data_table_row<T>(mut self, v: T) -> Self
2209 where
2210 T: std::convert::Into<crate::model::DataTableRow>,
2211 {
2212 self.data_table_row = std::option::Option::Some(v.into());
2213 self
2214 }
2215
2216 /// Sets or clears the value of [data_table_row][crate::model::CreateDataTableRowRequest::data_table_row].
2217 ///
2218 /// # Example
2219 /// ```ignore,no_run
2220 /// # use google_cloud_chronicle_v1::model::CreateDataTableRowRequest;
2221 /// use google_cloud_chronicle_v1::model::DataTableRow;
2222 /// let x = CreateDataTableRowRequest::new().set_or_clear_data_table_row(Some(DataTableRow::default()/* use setters */));
2223 /// let x = CreateDataTableRowRequest::new().set_or_clear_data_table_row(None::<DataTableRow>);
2224 /// ```
2225 pub fn set_or_clear_data_table_row<T>(mut self, v: std::option::Option<T>) -> Self
2226 where
2227 T: std::convert::Into<crate::model::DataTableRow>,
2228 {
2229 self.data_table_row = v.map(|x| x.into());
2230 self
2231 }
2232}
2233
2234impl wkt::message::Message for CreateDataTableRowRequest {
2235 fn typename() -> &'static str {
2236 "type.googleapis.com/google.cloud.chronicle.v1.CreateDataTableRowRequest"
2237 }
2238}
2239
2240/// Request to update data table row.
2241#[derive(Clone, Default, PartialEq)]
2242#[non_exhaustive]
2243pub struct UpdateDataTableRowRequest {
2244 /// Required. Format:
2245 /// projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}/dataTableRows/{data_table_row}
2246 pub data_table_row: std::option::Option<crate::model::DataTableRow>,
2247
2248 /// Optional. The list of fields to update. Currently data table rows only
2249 /// support updating the `values` field. When no field mask is supplied, all
2250 /// non-empty fields will be updated. A field mask of "*" will update all
2251 /// fields, whether empty or not.
2252 pub update_mask: std::option::Option<wkt::FieldMask>,
2253
2254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2255}
2256
2257impl UpdateDataTableRowRequest {
2258 /// Creates a new default instance.
2259 pub fn new() -> Self {
2260 std::default::Default::default()
2261 }
2262
2263 /// Sets the value of [data_table_row][crate::model::UpdateDataTableRowRequest::data_table_row].
2264 ///
2265 /// # Example
2266 /// ```ignore,no_run
2267 /// # use google_cloud_chronicle_v1::model::UpdateDataTableRowRequest;
2268 /// use google_cloud_chronicle_v1::model::DataTableRow;
2269 /// let x = UpdateDataTableRowRequest::new().set_data_table_row(DataTableRow::default()/* use setters */);
2270 /// ```
2271 pub fn set_data_table_row<T>(mut self, v: T) -> Self
2272 where
2273 T: std::convert::Into<crate::model::DataTableRow>,
2274 {
2275 self.data_table_row = std::option::Option::Some(v.into());
2276 self
2277 }
2278
2279 /// Sets or clears the value of [data_table_row][crate::model::UpdateDataTableRowRequest::data_table_row].
2280 ///
2281 /// # Example
2282 /// ```ignore,no_run
2283 /// # use google_cloud_chronicle_v1::model::UpdateDataTableRowRequest;
2284 /// use google_cloud_chronicle_v1::model::DataTableRow;
2285 /// let x = UpdateDataTableRowRequest::new().set_or_clear_data_table_row(Some(DataTableRow::default()/* use setters */));
2286 /// let x = UpdateDataTableRowRequest::new().set_or_clear_data_table_row(None::<DataTableRow>);
2287 /// ```
2288 pub fn set_or_clear_data_table_row<T>(mut self, v: std::option::Option<T>) -> Self
2289 where
2290 T: std::convert::Into<crate::model::DataTableRow>,
2291 {
2292 self.data_table_row = v.map(|x| x.into());
2293 self
2294 }
2295
2296 /// Sets the value of [update_mask][crate::model::UpdateDataTableRowRequest::update_mask].
2297 ///
2298 /// # Example
2299 /// ```ignore,no_run
2300 /// # use google_cloud_chronicle_v1::model::UpdateDataTableRowRequest;
2301 /// use wkt::FieldMask;
2302 /// let x = UpdateDataTableRowRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2303 /// ```
2304 pub fn set_update_mask<T>(mut self, v: T) -> Self
2305 where
2306 T: std::convert::Into<wkt::FieldMask>,
2307 {
2308 self.update_mask = std::option::Option::Some(v.into());
2309 self
2310 }
2311
2312 /// Sets or clears the value of [update_mask][crate::model::UpdateDataTableRowRequest::update_mask].
2313 ///
2314 /// # Example
2315 /// ```ignore,no_run
2316 /// # use google_cloud_chronicle_v1::model::UpdateDataTableRowRequest;
2317 /// use wkt::FieldMask;
2318 /// let x = UpdateDataTableRowRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2319 /// let x = UpdateDataTableRowRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2320 /// ```
2321 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2322 where
2323 T: std::convert::Into<wkt::FieldMask>,
2324 {
2325 self.update_mask = v.map(|x| x.into());
2326 self
2327 }
2328}
2329
2330impl wkt::message::Message for UpdateDataTableRowRequest {
2331 fn typename() -> &'static str {
2332 "type.googleapis.com/google.cloud.chronicle.v1.UpdateDataTableRowRequest"
2333 }
2334}
2335
2336/// Request to list data table rows.
2337#[derive(Clone, Default, PartialEq)]
2338#[non_exhaustive]
2339pub struct ListDataTableRowsRequest {
2340 /// Required. The resource id of the data table.
2341 /// Format:
2342 /// projects/{project}/locations/{locations}/instances/{instance}/dataTables/{data_table}
2343 pub parent: std::string::String,
2344
2345 /// Optional. The maximum number of data table rows to return. The service may
2346 /// return fewer than this value. If unspecified, at most 100 data table rows
2347 /// will be returned. The maximum value is 1000; values above 1000 will be
2348 /// coerced to 1000.
2349 pub page_size: i32,
2350
2351 /// Optional. A page token, received from a previous `ListDataTableRows` call.
2352 pub page_token: std::string::String,
2353
2354 /// Optional. Configures ordering of DataTables in the response.
2355 /// Note: Our implementation currently supports order by "create_time asc" only
2356 pub order_by: std::string::String,
2357
2358 /// Optional. Filter facilitating search over data table rows. This filter
2359 /// performs a case-insensitive substring match on the row values.
2360 pub filter: std::string::String,
2361
2362 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2363}
2364
2365impl ListDataTableRowsRequest {
2366 /// Creates a new default instance.
2367 pub fn new() -> Self {
2368 std::default::Default::default()
2369 }
2370
2371 /// Sets the value of [parent][crate::model::ListDataTableRowsRequest::parent].
2372 ///
2373 /// # Example
2374 /// ```ignore,no_run
2375 /// # use google_cloud_chronicle_v1::model::ListDataTableRowsRequest;
2376 /// let x = ListDataTableRowsRequest::new().set_parent("example");
2377 /// ```
2378 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2379 self.parent = v.into();
2380 self
2381 }
2382
2383 /// Sets the value of [page_size][crate::model::ListDataTableRowsRequest::page_size].
2384 ///
2385 /// # Example
2386 /// ```ignore,no_run
2387 /// # use google_cloud_chronicle_v1::model::ListDataTableRowsRequest;
2388 /// let x = ListDataTableRowsRequest::new().set_page_size(42);
2389 /// ```
2390 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2391 self.page_size = v.into();
2392 self
2393 }
2394
2395 /// Sets the value of [page_token][crate::model::ListDataTableRowsRequest::page_token].
2396 ///
2397 /// # Example
2398 /// ```ignore,no_run
2399 /// # use google_cloud_chronicle_v1::model::ListDataTableRowsRequest;
2400 /// let x = ListDataTableRowsRequest::new().set_page_token("example");
2401 /// ```
2402 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2403 self.page_token = v.into();
2404 self
2405 }
2406
2407 /// Sets the value of [order_by][crate::model::ListDataTableRowsRequest::order_by].
2408 ///
2409 /// # Example
2410 /// ```ignore,no_run
2411 /// # use google_cloud_chronicle_v1::model::ListDataTableRowsRequest;
2412 /// let x = ListDataTableRowsRequest::new().set_order_by("example");
2413 /// ```
2414 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2415 self.order_by = v.into();
2416 self
2417 }
2418
2419 /// Sets the value of [filter][crate::model::ListDataTableRowsRequest::filter].
2420 ///
2421 /// # Example
2422 /// ```ignore,no_run
2423 /// # use google_cloud_chronicle_v1::model::ListDataTableRowsRequest;
2424 /// let x = ListDataTableRowsRequest::new().set_filter("example");
2425 /// ```
2426 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2427 self.filter = v.into();
2428 self
2429 }
2430}
2431
2432impl wkt::message::Message for ListDataTableRowsRequest {
2433 fn typename() -> &'static str {
2434 "type.googleapis.com/google.cloud.chronicle.v1.ListDataTableRowsRequest"
2435 }
2436}
2437
2438/// Response message for listing data table rows.
2439#[derive(Clone, Default, PartialEq)]
2440#[non_exhaustive]
2441pub struct ListDataTableRowsResponse {
2442 /// The list of the data table rows returned.
2443 pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
2444
2445 /// Optional. A token, which can be sent as `page_token` to retrieve the next
2446 /// page. If this field is omitted, there are no subsequent pages.
2447 pub next_page_token: std::string::String,
2448
2449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2450}
2451
2452impl ListDataTableRowsResponse {
2453 /// Creates a new default instance.
2454 pub fn new() -> Self {
2455 std::default::Default::default()
2456 }
2457
2458 /// Sets the value of [data_table_rows][crate::model::ListDataTableRowsResponse::data_table_rows].
2459 ///
2460 /// # Example
2461 /// ```ignore,no_run
2462 /// # use google_cloud_chronicle_v1::model::ListDataTableRowsResponse;
2463 /// use google_cloud_chronicle_v1::model::DataTableRow;
2464 /// let x = ListDataTableRowsResponse::new()
2465 /// .set_data_table_rows([
2466 /// DataTableRow::default()/* use setters */,
2467 /// DataTableRow::default()/* use (different) setters */,
2468 /// ]);
2469 /// ```
2470 pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
2471 where
2472 T: std::iter::IntoIterator<Item = V>,
2473 V: std::convert::Into<crate::model::DataTableRow>,
2474 {
2475 use std::iter::Iterator;
2476 self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
2477 self
2478 }
2479
2480 /// Sets the value of [next_page_token][crate::model::ListDataTableRowsResponse::next_page_token].
2481 ///
2482 /// # Example
2483 /// ```ignore,no_run
2484 /// # use google_cloud_chronicle_v1::model::ListDataTableRowsResponse;
2485 /// let x = ListDataTableRowsResponse::new().set_next_page_token("example");
2486 /// ```
2487 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2488 self.next_page_token = v.into();
2489 self
2490 }
2491}
2492
2493impl wkt::message::Message for ListDataTableRowsResponse {
2494 fn typename() -> &'static str {
2495 "type.googleapis.com/google.cloud.chronicle.v1.ListDataTableRowsResponse"
2496 }
2497}
2498
2499#[doc(hidden)]
2500impl google_cloud_gax::paginator::internal::PageableResponse for ListDataTableRowsResponse {
2501 type PageItem = crate::model::DataTableRow;
2502
2503 fn items(self) -> std::vec::Vec<Self::PageItem> {
2504 self.data_table_rows
2505 }
2506
2507 fn next_page_token(&self) -> std::string::String {
2508 use std::clone::Clone;
2509 self.next_page_token.clone()
2510 }
2511}
2512
2513/// Request to get data table row.
2514#[derive(Clone, Default, PartialEq)]
2515#[non_exhaustive]
2516pub struct GetDataTableRowRequest {
2517 /// Required. The resource name of the data table row i,e row_id.
2518 /// Format:
2519 /// projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}/dataTableRows/{data_table_row}
2520 pub name: std::string::String,
2521
2522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2523}
2524
2525impl GetDataTableRowRequest {
2526 /// Creates a new default instance.
2527 pub fn new() -> Self {
2528 std::default::Default::default()
2529 }
2530
2531 /// Sets the value of [name][crate::model::GetDataTableRowRequest::name].
2532 ///
2533 /// # Example
2534 /// ```ignore,no_run
2535 /// # use google_cloud_chronicle_v1::model::GetDataTableRowRequest;
2536 /// let x = GetDataTableRowRequest::new().set_name("example");
2537 /// ```
2538 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2539 self.name = v.into();
2540 self
2541 }
2542}
2543
2544impl wkt::message::Message for GetDataTableRowRequest {
2545 fn typename() -> &'static str {
2546 "type.googleapis.com/google.cloud.chronicle.v1.GetDataTableRowRequest"
2547 }
2548}
2549
2550/// Request to delete data table row.
2551#[derive(Clone, Default, PartialEq)]
2552#[non_exhaustive]
2553pub struct DeleteDataTableRowRequest {
2554 /// Required. The resource name of the data table row i,e row_id.
2555 /// Format:
2556 /// projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}/dataTableRows/{data_table_row}
2557 pub name: std::string::String,
2558
2559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2560}
2561
2562impl DeleteDataTableRowRequest {
2563 /// Creates a new default instance.
2564 pub fn new() -> Self {
2565 std::default::Default::default()
2566 }
2567
2568 /// Sets the value of [name][crate::model::DeleteDataTableRowRequest::name].
2569 ///
2570 /// # Example
2571 /// ```ignore,no_run
2572 /// # use google_cloud_chronicle_v1::model::DeleteDataTableRowRequest;
2573 /// let x = DeleteDataTableRowRequest::new().set_name("example");
2574 /// ```
2575 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2576 self.name = v.into();
2577 self
2578 }
2579}
2580
2581impl wkt::message::Message for DeleteDataTableRowRequest {
2582 fn typename() -> &'static str {
2583 "type.googleapis.com/google.cloud.chronicle.v1.DeleteDataTableRowRequest"
2584 }
2585}
2586
2587/// Request to create data table rows in bulk.
2588#[derive(Clone, Default, PartialEq)]
2589#[non_exhaustive]
2590pub struct BulkCreateDataTableRowsRequest {
2591 /// Required. The resource id of the data table.
2592 /// Format:
2593 /// /projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}
2594 pub parent: std::string::String,
2595
2596 /// Required. Data table rows to create. A maximum of 1000 rows (for sync
2597 /// requests) or 2000 rows (for async requests) can be created in a single
2598 /// request. Total size of the rows should be less than 4MB.
2599 pub requests: std::vec::Vec<crate::model::CreateDataTableRowRequest>,
2600
2601 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2602}
2603
2604impl BulkCreateDataTableRowsRequest {
2605 /// Creates a new default instance.
2606 pub fn new() -> Self {
2607 std::default::Default::default()
2608 }
2609
2610 /// Sets the value of [parent][crate::model::BulkCreateDataTableRowsRequest::parent].
2611 ///
2612 /// # Example
2613 /// ```ignore,no_run
2614 /// # use google_cloud_chronicle_v1::model::BulkCreateDataTableRowsRequest;
2615 /// let x = BulkCreateDataTableRowsRequest::new().set_parent("example");
2616 /// ```
2617 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2618 self.parent = v.into();
2619 self
2620 }
2621
2622 /// Sets the value of [requests][crate::model::BulkCreateDataTableRowsRequest::requests].
2623 ///
2624 /// # Example
2625 /// ```ignore,no_run
2626 /// # use google_cloud_chronicle_v1::model::BulkCreateDataTableRowsRequest;
2627 /// use google_cloud_chronicle_v1::model::CreateDataTableRowRequest;
2628 /// let x = BulkCreateDataTableRowsRequest::new()
2629 /// .set_requests([
2630 /// CreateDataTableRowRequest::default()/* use setters */,
2631 /// CreateDataTableRowRequest::default()/* use (different) setters */,
2632 /// ]);
2633 /// ```
2634 pub fn set_requests<T, V>(mut self, v: T) -> Self
2635 where
2636 T: std::iter::IntoIterator<Item = V>,
2637 V: std::convert::Into<crate::model::CreateDataTableRowRequest>,
2638 {
2639 use std::iter::Iterator;
2640 self.requests = v.into_iter().map(|i| i.into()).collect();
2641 self
2642 }
2643}
2644
2645impl wkt::message::Message for BulkCreateDataTableRowsRequest {
2646 fn typename() -> &'static str {
2647 "type.googleapis.com/google.cloud.chronicle.v1.BulkCreateDataTableRowsRequest"
2648 }
2649}
2650
2651/// Response message with created data table rows.
2652#[derive(Clone, Default, PartialEq)]
2653#[non_exhaustive]
2654pub struct BulkCreateDataTableRowsResponse {
2655 /// DataTableRows created
2656 pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
2657
2658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2659}
2660
2661impl BulkCreateDataTableRowsResponse {
2662 /// Creates a new default instance.
2663 pub fn new() -> Self {
2664 std::default::Default::default()
2665 }
2666
2667 /// Sets the value of [data_table_rows][crate::model::BulkCreateDataTableRowsResponse::data_table_rows].
2668 ///
2669 /// # Example
2670 /// ```ignore,no_run
2671 /// # use google_cloud_chronicle_v1::model::BulkCreateDataTableRowsResponse;
2672 /// use google_cloud_chronicle_v1::model::DataTableRow;
2673 /// let x = BulkCreateDataTableRowsResponse::new()
2674 /// .set_data_table_rows([
2675 /// DataTableRow::default()/* use setters */,
2676 /// DataTableRow::default()/* use (different) setters */,
2677 /// ]);
2678 /// ```
2679 pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
2680 where
2681 T: std::iter::IntoIterator<Item = V>,
2682 V: std::convert::Into<crate::model::DataTableRow>,
2683 {
2684 use std::iter::Iterator;
2685 self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
2686 self
2687 }
2688}
2689
2690impl wkt::message::Message for BulkCreateDataTableRowsResponse {
2691 fn typename() -> &'static str {
2692 "type.googleapis.com/google.cloud.chronicle.v1.BulkCreateDataTableRowsResponse"
2693 }
2694}
2695
2696/// Request to get data table rows in bulk.
2697#[derive(Clone, Default, PartialEq)]
2698#[non_exhaustive]
2699pub struct BulkGetDataTableRowsRequest {
2700 /// Required. The resource id of the data table.
2701 /// Format:
2702 /// /projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}
2703 pub parent: std::string::String,
2704
2705 /// Required. Data table rows to get. At max 1,000 rows can be there in a
2706 /// request.
2707 pub requests: std::vec::Vec<crate::model::GetDataTableRowRequest>,
2708
2709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2710}
2711
2712impl BulkGetDataTableRowsRequest {
2713 /// Creates a new default instance.
2714 pub fn new() -> Self {
2715 std::default::Default::default()
2716 }
2717
2718 /// Sets the value of [parent][crate::model::BulkGetDataTableRowsRequest::parent].
2719 ///
2720 /// # Example
2721 /// ```ignore,no_run
2722 /// # use google_cloud_chronicle_v1::model::BulkGetDataTableRowsRequest;
2723 /// let x = BulkGetDataTableRowsRequest::new().set_parent("example");
2724 /// ```
2725 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2726 self.parent = v.into();
2727 self
2728 }
2729
2730 /// Sets the value of [requests][crate::model::BulkGetDataTableRowsRequest::requests].
2731 ///
2732 /// # Example
2733 /// ```ignore,no_run
2734 /// # use google_cloud_chronicle_v1::model::BulkGetDataTableRowsRequest;
2735 /// use google_cloud_chronicle_v1::model::GetDataTableRowRequest;
2736 /// let x = BulkGetDataTableRowsRequest::new()
2737 /// .set_requests([
2738 /// GetDataTableRowRequest::default()/* use setters */,
2739 /// GetDataTableRowRequest::default()/* use (different) setters */,
2740 /// ]);
2741 /// ```
2742 pub fn set_requests<T, V>(mut self, v: T) -> Self
2743 where
2744 T: std::iter::IntoIterator<Item = V>,
2745 V: std::convert::Into<crate::model::GetDataTableRowRequest>,
2746 {
2747 use std::iter::Iterator;
2748 self.requests = v.into_iter().map(|i| i.into()).collect();
2749 self
2750 }
2751}
2752
2753impl wkt::message::Message for BulkGetDataTableRowsRequest {
2754 fn typename() -> &'static str {
2755 "type.googleapis.com/google.cloud.chronicle.v1.BulkGetDataTableRowsRequest"
2756 }
2757}
2758
2759/// Response message with data table rows.
2760#[derive(Clone, Default, PartialEq)]
2761#[non_exhaustive]
2762pub struct BulkGetDataTableRowsResponse {
2763 /// The requested data table rows.
2764 pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
2765
2766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2767}
2768
2769impl BulkGetDataTableRowsResponse {
2770 /// Creates a new default instance.
2771 pub fn new() -> Self {
2772 std::default::Default::default()
2773 }
2774
2775 /// Sets the value of [data_table_rows][crate::model::BulkGetDataTableRowsResponse::data_table_rows].
2776 ///
2777 /// # Example
2778 /// ```ignore,no_run
2779 /// # use google_cloud_chronicle_v1::model::BulkGetDataTableRowsResponse;
2780 /// use google_cloud_chronicle_v1::model::DataTableRow;
2781 /// let x = BulkGetDataTableRowsResponse::new()
2782 /// .set_data_table_rows([
2783 /// DataTableRow::default()/* use setters */,
2784 /// DataTableRow::default()/* use (different) setters */,
2785 /// ]);
2786 /// ```
2787 pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
2788 where
2789 T: std::iter::IntoIterator<Item = V>,
2790 V: std::convert::Into<crate::model::DataTableRow>,
2791 {
2792 use std::iter::Iterator;
2793 self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
2794 self
2795 }
2796}
2797
2798impl wkt::message::Message for BulkGetDataTableRowsResponse {
2799 fn typename() -> &'static str {
2800 "type.googleapis.com/google.cloud.chronicle.v1.BulkGetDataTableRowsResponse"
2801 }
2802}
2803
2804/// Request to replace data table rows in bulk.
2805#[derive(Clone, Default, PartialEq)]
2806#[non_exhaustive]
2807pub struct BulkReplaceDataTableRowsRequest {
2808 /// Required. The resource id of the data table.
2809 /// Format:
2810 /// /projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}
2811 pub parent: std::string::String,
2812
2813 /// Required. Data table rows to replace the existing data table rows. A
2814 /// maximum of 1000 rows (for sync requests) or 2000 rows (for async requests)
2815 /// can be replaced in a single request. Total size of the rows should be less
2816 /// than 4MB.
2817 pub requests: std::vec::Vec<crate::model::CreateDataTableRowRequest>,
2818
2819 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2820}
2821
2822impl BulkReplaceDataTableRowsRequest {
2823 /// Creates a new default instance.
2824 pub fn new() -> Self {
2825 std::default::Default::default()
2826 }
2827
2828 /// Sets the value of [parent][crate::model::BulkReplaceDataTableRowsRequest::parent].
2829 ///
2830 /// # Example
2831 /// ```ignore,no_run
2832 /// # use google_cloud_chronicle_v1::model::BulkReplaceDataTableRowsRequest;
2833 /// let x = BulkReplaceDataTableRowsRequest::new().set_parent("example");
2834 /// ```
2835 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2836 self.parent = v.into();
2837 self
2838 }
2839
2840 /// Sets the value of [requests][crate::model::BulkReplaceDataTableRowsRequest::requests].
2841 ///
2842 /// # Example
2843 /// ```ignore,no_run
2844 /// # use google_cloud_chronicle_v1::model::BulkReplaceDataTableRowsRequest;
2845 /// use google_cloud_chronicle_v1::model::CreateDataTableRowRequest;
2846 /// let x = BulkReplaceDataTableRowsRequest::new()
2847 /// .set_requests([
2848 /// CreateDataTableRowRequest::default()/* use setters */,
2849 /// CreateDataTableRowRequest::default()/* use (different) setters */,
2850 /// ]);
2851 /// ```
2852 pub fn set_requests<T, V>(mut self, v: T) -> Self
2853 where
2854 T: std::iter::IntoIterator<Item = V>,
2855 V: std::convert::Into<crate::model::CreateDataTableRowRequest>,
2856 {
2857 use std::iter::Iterator;
2858 self.requests = v.into_iter().map(|i| i.into()).collect();
2859 self
2860 }
2861}
2862
2863impl wkt::message::Message for BulkReplaceDataTableRowsRequest {
2864 fn typename() -> &'static str {
2865 "type.googleapis.com/google.cloud.chronicle.v1.BulkReplaceDataTableRowsRequest"
2866 }
2867}
2868
2869/// Response message with data table rows that replaced existing data table rows.
2870#[derive(Clone, Default, PartialEq)]
2871#[non_exhaustive]
2872pub struct BulkReplaceDataTableRowsResponse {
2873 /// DataTableRows that replaced existing data table rows
2874 pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
2875
2876 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2877}
2878
2879impl BulkReplaceDataTableRowsResponse {
2880 /// Creates a new default instance.
2881 pub fn new() -> Self {
2882 std::default::Default::default()
2883 }
2884
2885 /// Sets the value of [data_table_rows][crate::model::BulkReplaceDataTableRowsResponse::data_table_rows].
2886 ///
2887 /// # Example
2888 /// ```ignore,no_run
2889 /// # use google_cloud_chronicle_v1::model::BulkReplaceDataTableRowsResponse;
2890 /// use google_cloud_chronicle_v1::model::DataTableRow;
2891 /// let x = BulkReplaceDataTableRowsResponse::new()
2892 /// .set_data_table_rows([
2893 /// DataTableRow::default()/* use setters */,
2894 /// DataTableRow::default()/* use (different) setters */,
2895 /// ]);
2896 /// ```
2897 pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
2898 where
2899 T: std::iter::IntoIterator<Item = V>,
2900 V: std::convert::Into<crate::model::DataTableRow>,
2901 {
2902 use std::iter::Iterator;
2903 self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
2904 self
2905 }
2906}
2907
2908impl wkt::message::Message for BulkReplaceDataTableRowsResponse {
2909 fn typename() -> &'static str {
2910 "type.googleapis.com/google.cloud.chronicle.v1.BulkReplaceDataTableRowsResponse"
2911 }
2912}
2913
2914/// Request to update data table rows in bulk.
2915#[derive(Clone, Default, PartialEq)]
2916#[non_exhaustive]
2917pub struct BulkUpdateDataTableRowsRequest {
2918 /// Required. The resource id of the data table.
2919 /// Format:
2920 /// /projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}
2921 pub parent: std::string::String,
2922
2923 /// Required. Data table rows to update. At max 1,000 rows (or rows with size
2924 /// less than 2MB) can be there in a request.
2925 pub requests: std::vec::Vec<crate::model::UpdateDataTableRowRequest>,
2926
2927 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2928}
2929
2930impl BulkUpdateDataTableRowsRequest {
2931 /// Creates a new default instance.
2932 pub fn new() -> Self {
2933 std::default::Default::default()
2934 }
2935
2936 /// Sets the value of [parent][crate::model::BulkUpdateDataTableRowsRequest::parent].
2937 ///
2938 /// # Example
2939 /// ```ignore,no_run
2940 /// # use google_cloud_chronicle_v1::model::BulkUpdateDataTableRowsRequest;
2941 /// let x = BulkUpdateDataTableRowsRequest::new().set_parent("example");
2942 /// ```
2943 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2944 self.parent = v.into();
2945 self
2946 }
2947
2948 /// Sets the value of [requests][crate::model::BulkUpdateDataTableRowsRequest::requests].
2949 ///
2950 /// # Example
2951 /// ```ignore,no_run
2952 /// # use google_cloud_chronicle_v1::model::BulkUpdateDataTableRowsRequest;
2953 /// use google_cloud_chronicle_v1::model::UpdateDataTableRowRequest;
2954 /// let x = BulkUpdateDataTableRowsRequest::new()
2955 /// .set_requests([
2956 /// UpdateDataTableRowRequest::default()/* use setters */,
2957 /// UpdateDataTableRowRequest::default()/* use (different) setters */,
2958 /// ]);
2959 /// ```
2960 pub fn set_requests<T, V>(mut self, v: T) -> Self
2961 where
2962 T: std::iter::IntoIterator<Item = V>,
2963 V: std::convert::Into<crate::model::UpdateDataTableRowRequest>,
2964 {
2965 use std::iter::Iterator;
2966 self.requests = v.into_iter().map(|i| i.into()).collect();
2967 self
2968 }
2969}
2970
2971impl wkt::message::Message for BulkUpdateDataTableRowsRequest {
2972 fn typename() -> &'static str {
2973 "type.googleapis.com/google.cloud.chronicle.v1.BulkUpdateDataTableRowsRequest"
2974 }
2975}
2976
2977/// Response message with updated data table rows.
2978#[derive(Clone, Default, PartialEq)]
2979#[non_exhaustive]
2980pub struct BulkUpdateDataTableRowsResponse {
2981 /// DataTableRows updated
2982 pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
2983
2984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2985}
2986
2987impl BulkUpdateDataTableRowsResponse {
2988 /// Creates a new default instance.
2989 pub fn new() -> Self {
2990 std::default::Default::default()
2991 }
2992
2993 /// Sets the value of [data_table_rows][crate::model::BulkUpdateDataTableRowsResponse::data_table_rows].
2994 ///
2995 /// # Example
2996 /// ```ignore,no_run
2997 /// # use google_cloud_chronicle_v1::model::BulkUpdateDataTableRowsResponse;
2998 /// use google_cloud_chronicle_v1::model::DataTableRow;
2999 /// let x = BulkUpdateDataTableRowsResponse::new()
3000 /// .set_data_table_rows([
3001 /// DataTableRow::default()/* use setters */,
3002 /// DataTableRow::default()/* use (different) setters */,
3003 /// ]);
3004 /// ```
3005 pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
3006 where
3007 T: std::iter::IntoIterator<Item = V>,
3008 V: std::convert::Into<crate::model::DataTableRow>,
3009 {
3010 use std::iter::Iterator;
3011 self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
3012 self
3013 }
3014}
3015
3016impl wkt::message::Message for BulkUpdateDataTableRowsResponse {
3017 fn typename() -> &'static str {
3018 "type.googleapis.com/google.cloud.chronicle.v1.BulkUpdateDataTableRowsResponse"
3019 }
3020}
3021
3022/// DataTableScopeInfo specifies the scope info of the data table.
3023#[derive(Clone, Default, PartialEq)]
3024#[non_exhaustive]
3025pub struct DataTableScopeInfo {
3026 /// Required. Contains the list of scope names of the data table. If the list
3027 /// is empty, the data table is treated as unscoped. The scope names should be
3028 /// full resource names and should be of the format:
3029 /// "projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{scope_name}"
3030 pub data_access_scopes: std::vec::Vec<std::string::String>,
3031
3032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3033}
3034
3035impl DataTableScopeInfo {
3036 /// Creates a new default instance.
3037 pub fn new() -> Self {
3038 std::default::Default::default()
3039 }
3040
3041 /// Sets the value of [data_access_scopes][crate::model::DataTableScopeInfo::data_access_scopes].
3042 ///
3043 /// # Example
3044 /// ```ignore,no_run
3045 /// # use google_cloud_chronicle_v1::model::DataTableScopeInfo;
3046 /// let x = DataTableScopeInfo::new().set_data_access_scopes(["a", "b", "c"]);
3047 /// ```
3048 pub fn set_data_access_scopes<T, V>(mut self, v: T) -> Self
3049 where
3050 T: std::iter::IntoIterator<Item = V>,
3051 V: std::convert::Into<std::string::String>,
3052 {
3053 use std::iter::Iterator;
3054 self.data_access_scopes = v.into_iter().map(|i| i.into()).collect();
3055 self
3056 }
3057}
3058
3059impl wkt::message::Message for DataTableScopeInfo {
3060 fn typename() -> &'static str {
3061 "type.googleapis.com/google.cloud.chronicle.v1.DataTableScopeInfo"
3062 }
3063}
3064
3065/// DataTable represents the data table resource.
3066#[derive(Clone, Default, PartialEq)]
3067#[non_exhaustive]
3068pub struct DataTable {
3069 /// Identifier. The resource name of the data table
3070 /// Format:
3071 /// "{project}/locations/{location}/instances/{instance}/dataTables/{data_table}"
3072 pub name: std::string::String,
3073
3074 /// Output only. The unique display name of the data table.
3075 pub display_name: std::string::String,
3076
3077 /// Required. A user-provided description of the data table.
3078 pub description: std::string::String,
3079
3080 /// Output only. Table create time
3081 pub create_time: std::option::Option<wkt::Timestamp>,
3082
3083 /// Output only. Table update time
3084 pub update_time: std::option::Option<wkt::Timestamp>,
3085
3086 /// Immutable. Details of all the columns in the table
3087 pub column_info: std::vec::Vec<crate::model::DataTableColumnInfo>,
3088
3089 /// Output only. Data table unique id
3090 pub data_table_uuid: std::string::String,
3091
3092 /// Output only. The resource names for the associated Rules that use this
3093 /// data table. Format:
3094 /// projects/{project}/locations/{location}/instances/{instance}/rules/{rule}.
3095 /// {rule} here refers to the rule id.
3096 pub rules: std::vec::Vec<std::string::String>,
3097
3098 /// Output only. The count of rules using the data table.
3099 pub rule_associations_count: i32,
3100
3101 /// Optional. User-provided TTL of the data table.
3102 pub row_time_to_live: std::string::String,
3103
3104 /// Output only. The count of rows in the data table.
3105 pub approximate_row_count: i64,
3106
3107 /// Optional. The scope info of the data table.
3108 /// During data table creation, if this field is not set, the data
3109 /// table without scopes (an unscoped table) will be created for a global
3110 /// user. For a scoped user, this field must be set. During data table
3111 /// update, if scope_info is requested to be updated, this field must be set.
3112 pub scope_info: std::option::Option<crate::model::DataTableScopeInfo>,
3113
3114 /// Output only. Source of the data table update.
3115 pub update_source: crate::model::DataTableUpdateSource,
3116
3117 /// Output only. Last update time of the TTL of the data table.
3118 pub row_time_to_live_update_time: std::option::Option<wkt::Timestamp>,
3119
3120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3121}
3122
3123impl DataTable {
3124 /// Creates a new default instance.
3125 pub fn new() -> Self {
3126 std::default::Default::default()
3127 }
3128
3129 /// Sets the value of [name][crate::model::DataTable::name].
3130 ///
3131 /// # Example
3132 /// ```ignore,no_run
3133 /// # use google_cloud_chronicle_v1::model::DataTable;
3134 /// let x = DataTable::new().set_name("example");
3135 /// ```
3136 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3137 self.name = v.into();
3138 self
3139 }
3140
3141 /// Sets the value of [display_name][crate::model::DataTable::display_name].
3142 ///
3143 /// # Example
3144 /// ```ignore,no_run
3145 /// # use google_cloud_chronicle_v1::model::DataTable;
3146 /// let x = DataTable::new().set_display_name("example");
3147 /// ```
3148 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3149 self.display_name = v.into();
3150 self
3151 }
3152
3153 /// Sets the value of [description][crate::model::DataTable::description].
3154 ///
3155 /// # Example
3156 /// ```ignore,no_run
3157 /// # use google_cloud_chronicle_v1::model::DataTable;
3158 /// let x = DataTable::new().set_description("example");
3159 /// ```
3160 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3161 self.description = v.into();
3162 self
3163 }
3164
3165 /// Sets the value of [create_time][crate::model::DataTable::create_time].
3166 ///
3167 /// # Example
3168 /// ```ignore,no_run
3169 /// # use google_cloud_chronicle_v1::model::DataTable;
3170 /// use wkt::Timestamp;
3171 /// let x = DataTable::new().set_create_time(Timestamp::default()/* use setters */);
3172 /// ```
3173 pub fn set_create_time<T>(mut self, v: T) -> Self
3174 where
3175 T: std::convert::Into<wkt::Timestamp>,
3176 {
3177 self.create_time = std::option::Option::Some(v.into());
3178 self
3179 }
3180
3181 /// Sets or clears the value of [create_time][crate::model::DataTable::create_time].
3182 ///
3183 /// # Example
3184 /// ```ignore,no_run
3185 /// # use google_cloud_chronicle_v1::model::DataTable;
3186 /// use wkt::Timestamp;
3187 /// let x = DataTable::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3188 /// let x = DataTable::new().set_or_clear_create_time(None::<Timestamp>);
3189 /// ```
3190 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3191 where
3192 T: std::convert::Into<wkt::Timestamp>,
3193 {
3194 self.create_time = v.map(|x| x.into());
3195 self
3196 }
3197
3198 /// Sets the value of [update_time][crate::model::DataTable::update_time].
3199 ///
3200 /// # Example
3201 /// ```ignore,no_run
3202 /// # use google_cloud_chronicle_v1::model::DataTable;
3203 /// use wkt::Timestamp;
3204 /// let x = DataTable::new().set_update_time(Timestamp::default()/* use setters */);
3205 /// ```
3206 pub fn set_update_time<T>(mut self, v: T) -> Self
3207 where
3208 T: std::convert::Into<wkt::Timestamp>,
3209 {
3210 self.update_time = std::option::Option::Some(v.into());
3211 self
3212 }
3213
3214 /// Sets or clears the value of [update_time][crate::model::DataTable::update_time].
3215 ///
3216 /// # Example
3217 /// ```ignore,no_run
3218 /// # use google_cloud_chronicle_v1::model::DataTable;
3219 /// use wkt::Timestamp;
3220 /// let x = DataTable::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3221 /// let x = DataTable::new().set_or_clear_update_time(None::<Timestamp>);
3222 /// ```
3223 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3224 where
3225 T: std::convert::Into<wkt::Timestamp>,
3226 {
3227 self.update_time = v.map(|x| x.into());
3228 self
3229 }
3230
3231 /// Sets the value of [column_info][crate::model::DataTable::column_info].
3232 ///
3233 /// # Example
3234 /// ```ignore,no_run
3235 /// # use google_cloud_chronicle_v1::model::DataTable;
3236 /// use google_cloud_chronicle_v1::model::DataTableColumnInfo;
3237 /// let x = DataTable::new()
3238 /// .set_column_info([
3239 /// DataTableColumnInfo::default()/* use setters */,
3240 /// DataTableColumnInfo::default()/* use (different) setters */,
3241 /// ]);
3242 /// ```
3243 pub fn set_column_info<T, V>(mut self, v: T) -> Self
3244 where
3245 T: std::iter::IntoIterator<Item = V>,
3246 V: std::convert::Into<crate::model::DataTableColumnInfo>,
3247 {
3248 use std::iter::Iterator;
3249 self.column_info = v.into_iter().map(|i| i.into()).collect();
3250 self
3251 }
3252
3253 /// Sets the value of [data_table_uuid][crate::model::DataTable::data_table_uuid].
3254 ///
3255 /// # Example
3256 /// ```ignore,no_run
3257 /// # use google_cloud_chronicle_v1::model::DataTable;
3258 /// let x = DataTable::new().set_data_table_uuid("example");
3259 /// ```
3260 pub fn set_data_table_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3261 self.data_table_uuid = v.into();
3262 self
3263 }
3264
3265 /// Sets the value of [rules][crate::model::DataTable::rules].
3266 ///
3267 /// # Example
3268 /// ```ignore,no_run
3269 /// # use google_cloud_chronicle_v1::model::DataTable;
3270 /// let x = DataTable::new().set_rules(["a", "b", "c"]);
3271 /// ```
3272 pub fn set_rules<T, V>(mut self, v: T) -> Self
3273 where
3274 T: std::iter::IntoIterator<Item = V>,
3275 V: std::convert::Into<std::string::String>,
3276 {
3277 use std::iter::Iterator;
3278 self.rules = v.into_iter().map(|i| i.into()).collect();
3279 self
3280 }
3281
3282 /// Sets the value of [rule_associations_count][crate::model::DataTable::rule_associations_count].
3283 ///
3284 /// # Example
3285 /// ```ignore,no_run
3286 /// # use google_cloud_chronicle_v1::model::DataTable;
3287 /// let x = DataTable::new().set_rule_associations_count(42);
3288 /// ```
3289 pub fn set_rule_associations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3290 self.rule_associations_count = v.into();
3291 self
3292 }
3293
3294 /// Sets the value of [row_time_to_live][crate::model::DataTable::row_time_to_live].
3295 ///
3296 /// # Example
3297 /// ```ignore,no_run
3298 /// # use google_cloud_chronicle_v1::model::DataTable;
3299 /// let x = DataTable::new().set_row_time_to_live("example");
3300 /// ```
3301 pub fn set_row_time_to_live<T: std::convert::Into<std::string::String>>(
3302 mut self,
3303 v: T,
3304 ) -> Self {
3305 self.row_time_to_live = v.into();
3306 self
3307 }
3308
3309 /// Sets the value of [approximate_row_count][crate::model::DataTable::approximate_row_count].
3310 ///
3311 /// # Example
3312 /// ```ignore,no_run
3313 /// # use google_cloud_chronicle_v1::model::DataTable;
3314 /// let x = DataTable::new().set_approximate_row_count(42);
3315 /// ```
3316 pub fn set_approximate_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3317 self.approximate_row_count = v.into();
3318 self
3319 }
3320
3321 /// Sets the value of [scope_info][crate::model::DataTable::scope_info].
3322 ///
3323 /// # Example
3324 /// ```ignore,no_run
3325 /// # use google_cloud_chronicle_v1::model::DataTable;
3326 /// use google_cloud_chronicle_v1::model::DataTableScopeInfo;
3327 /// let x = DataTable::new().set_scope_info(DataTableScopeInfo::default()/* use setters */);
3328 /// ```
3329 pub fn set_scope_info<T>(mut self, v: T) -> Self
3330 where
3331 T: std::convert::Into<crate::model::DataTableScopeInfo>,
3332 {
3333 self.scope_info = std::option::Option::Some(v.into());
3334 self
3335 }
3336
3337 /// Sets or clears the value of [scope_info][crate::model::DataTable::scope_info].
3338 ///
3339 /// # Example
3340 /// ```ignore,no_run
3341 /// # use google_cloud_chronicle_v1::model::DataTable;
3342 /// use google_cloud_chronicle_v1::model::DataTableScopeInfo;
3343 /// let x = DataTable::new().set_or_clear_scope_info(Some(DataTableScopeInfo::default()/* use setters */));
3344 /// let x = DataTable::new().set_or_clear_scope_info(None::<DataTableScopeInfo>);
3345 /// ```
3346 pub fn set_or_clear_scope_info<T>(mut self, v: std::option::Option<T>) -> Self
3347 where
3348 T: std::convert::Into<crate::model::DataTableScopeInfo>,
3349 {
3350 self.scope_info = v.map(|x| x.into());
3351 self
3352 }
3353
3354 /// Sets the value of [update_source][crate::model::DataTable::update_source].
3355 ///
3356 /// # Example
3357 /// ```ignore,no_run
3358 /// # use google_cloud_chronicle_v1::model::DataTable;
3359 /// use google_cloud_chronicle_v1::model::DataTableUpdateSource;
3360 /// let x0 = DataTable::new().set_update_source(DataTableUpdateSource::User);
3361 /// let x1 = DataTable::new().set_update_source(DataTableUpdateSource::Rule);
3362 /// let x2 = DataTable::new().set_update_source(DataTableUpdateSource::Search);
3363 /// ```
3364 pub fn set_update_source<T: std::convert::Into<crate::model::DataTableUpdateSource>>(
3365 mut self,
3366 v: T,
3367 ) -> Self {
3368 self.update_source = v.into();
3369 self
3370 }
3371
3372 /// Sets the value of [row_time_to_live_update_time][crate::model::DataTable::row_time_to_live_update_time].
3373 ///
3374 /// # Example
3375 /// ```ignore,no_run
3376 /// # use google_cloud_chronicle_v1::model::DataTable;
3377 /// use wkt::Timestamp;
3378 /// let x = DataTable::new().set_row_time_to_live_update_time(Timestamp::default()/* use setters */);
3379 /// ```
3380 pub fn set_row_time_to_live_update_time<T>(mut self, v: T) -> Self
3381 where
3382 T: std::convert::Into<wkt::Timestamp>,
3383 {
3384 self.row_time_to_live_update_time = std::option::Option::Some(v.into());
3385 self
3386 }
3387
3388 /// Sets or clears the value of [row_time_to_live_update_time][crate::model::DataTable::row_time_to_live_update_time].
3389 ///
3390 /// # Example
3391 /// ```ignore,no_run
3392 /// # use google_cloud_chronicle_v1::model::DataTable;
3393 /// use wkt::Timestamp;
3394 /// let x = DataTable::new().set_or_clear_row_time_to_live_update_time(Some(Timestamp::default()/* use setters */));
3395 /// let x = DataTable::new().set_or_clear_row_time_to_live_update_time(None::<Timestamp>);
3396 /// ```
3397 pub fn set_or_clear_row_time_to_live_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3398 where
3399 T: std::convert::Into<wkt::Timestamp>,
3400 {
3401 self.row_time_to_live_update_time = v.map(|x| x.into());
3402 self
3403 }
3404}
3405
3406impl wkt::message::Message for DataTable {
3407 fn typename() -> &'static str {
3408 "type.googleapis.com/google.cloud.chronicle.v1.DataTable"
3409 }
3410}
3411
3412/// DataTableRow represents a single row in a data table.
3413#[derive(Clone, Default, PartialEq)]
3414#[non_exhaustive]
3415pub struct DataTableRow {
3416 /// Identifier. The resource name of the data table
3417 /// Format:
3418 /// projects/{project}/locations/{location}/instances/{instance}/dataTables/{data_table}/dataTableRows/{data_table_row}
3419 pub name: std::string::String,
3420
3421 /// Required. All column values for a single row. The values should be in the
3422 /// same order as the columns of the data tables.
3423 pub values: std::vec::Vec<std::string::String>,
3424
3425 /// Output only. DataTableRow create time
3426 pub create_time: std::option::Option<wkt::Timestamp>,
3427
3428 /// Output only. DataTableRow update time
3429 pub update_time: std::option::Option<wkt::Timestamp>,
3430
3431 /// Optional. User-provided TTL of the data table row.
3432 pub row_time_to_live: std::string::String,
3433
3434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3435}
3436
3437impl DataTableRow {
3438 /// Creates a new default instance.
3439 pub fn new() -> Self {
3440 std::default::Default::default()
3441 }
3442
3443 /// Sets the value of [name][crate::model::DataTableRow::name].
3444 ///
3445 /// # Example
3446 /// ```ignore,no_run
3447 /// # use google_cloud_chronicle_v1::model::DataTableRow;
3448 /// let x = DataTableRow::new().set_name("example");
3449 /// ```
3450 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3451 self.name = v.into();
3452 self
3453 }
3454
3455 /// Sets the value of [values][crate::model::DataTableRow::values].
3456 ///
3457 /// # Example
3458 /// ```ignore,no_run
3459 /// # use google_cloud_chronicle_v1::model::DataTableRow;
3460 /// let x = DataTableRow::new().set_values(["a", "b", "c"]);
3461 /// ```
3462 pub fn set_values<T, V>(mut self, v: T) -> Self
3463 where
3464 T: std::iter::IntoIterator<Item = V>,
3465 V: std::convert::Into<std::string::String>,
3466 {
3467 use std::iter::Iterator;
3468 self.values = v.into_iter().map(|i| i.into()).collect();
3469 self
3470 }
3471
3472 /// Sets the value of [create_time][crate::model::DataTableRow::create_time].
3473 ///
3474 /// # Example
3475 /// ```ignore,no_run
3476 /// # use google_cloud_chronicle_v1::model::DataTableRow;
3477 /// use wkt::Timestamp;
3478 /// let x = DataTableRow::new().set_create_time(Timestamp::default()/* use setters */);
3479 /// ```
3480 pub fn set_create_time<T>(mut self, v: T) -> Self
3481 where
3482 T: std::convert::Into<wkt::Timestamp>,
3483 {
3484 self.create_time = std::option::Option::Some(v.into());
3485 self
3486 }
3487
3488 /// Sets or clears the value of [create_time][crate::model::DataTableRow::create_time].
3489 ///
3490 /// # Example
3491 /// ```ignore,no_run
3492 /// # use google_cloud_chronicle_v1::model::DataTableRow;
3493 /// use wkt::Timestamp;
3494 /// let x = DataTableRow::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3495 /// let x = DataTableRow::new().set_or_clear_create_time(None::<Timestamp>);
3496 /// ```
3497 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3498 where
3499 T: std::convert::Into<wkt::Timestamp>,
3500 {
3501 self.create_time = v.map(|x| x.into());
3502 self
3503 }
3504
3505 /// Sets the value of [update_time][crate::model::DataTableRow::update_time].
3506 ///
3507 /// # Example
3508 /// ```ignore,no_run
3509 /// # use google_cloud_chronicle_v1::model::DataTableRow;
3510 /// use wkt::Timestamp;
3511 /// let x = DataTableRow::new().set_update_time(Timestamp::default()/* use setters */);
3512 /// ```
3513 pub fn set_update_time<T>(mut self, v: T) -> Self
3514 where
3515 T: std::convert::Into<wkt::Timestamp>,
3516 {
3517 self.update_time = std::option::Option::Some(v.into());
3518 self
3519 }
3520
3521 /// Sets or clears the value of [update_time][crate::model::DataTableRow::update_time].
3522 ///
3523 /// # Example
3524 /// ```ignore,no_run
3525 /// # use google_cloud_chronicle_v1::model::DataTableRow;
3526 /// use wkt::Timestamp;
3527 /// let x = DataTableRow::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3528 /// let x = DataTableRow::new().set_or_clear_update_time(None::<Timestamp>);
3529 /// ```
3530 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3531 where
3532 T: std::convert::Into<wkt::Timestamp>,
3533 {
3534 self.update_time = v.map(|x| x.into());
3535 self
3536 }
3537
3538 /// Sets the value of [row_time_to_live][crate::model::DataTableRow::row_time_to_live].
3539 ///
3540 /// # Example
3541 /// ```ignore,no_run
3542 /// # use google_cloud_chronicle_v1::model::DataTableRow;
3543 /// let x = DataTableRow::new().set_row_time_to_live("example");
3544 /// ```
3545 pub fn set_row_time_to_live<T: std::convert::Into<std::string::String>>(
3546 mut self,
3547 v: T,
3548 ) -> Self {
3549 self.row_time_to_live = v.into();
3550 self
3551 }
3552}
3553
3554impl wkt::message::Message for DataTableRow {
3555 fn typename() -> &'static str {
3556 "type.googleapis.com/google.cloud.chronicle.v1.DataTableRow"
3557 }
3558}
3559
3560/// DataTableColumnInfo represents the column metadata of the
3561/// datatable. The column_index represents the ordering of the
3562/// values in DataTableRow.
3563#[derive(Clone, Default, PartialEq)]
3564#[non_exhaustive]
3565pub struct DataTableColumnInfo {
3566 /// Required. Column Index. 0,1,2...
3567 pub column_index: i32,
3568
3569 /// Required. Original column name of the Data Table (present in the CSV header
3570 /// in case of creation of data tables using file uploads). It must satisfy the
3571 /// following requirements:
3572 ///
3573 /// - Starts with letter.
3574 /// - Contains only letters, numbers and underscore.
3575 /// - Must be unique and has length < 256.
3576 pub original_column: std::string::String,
3577
3578 /// Optional. Whether to include this column in the calculation of the row ID.
3579 /// If no columns have key_column = true, all columns will be included in the
3580 /// calculation of the row ID.
3581 pub key_column: bool,
3582
3583 /// Optional. Whether the column is a repeated values column.
3584 pub repeated_values: bool,
3585
3586 #[allow(missing_docs)]
3587 pub path_or_type: std::option::Option<crate::model::data_table_column_info::PathOrType>,
3588
3589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3590}
3591
3592impl DataTableColumnInfo {
3593 /// Creates a new default instance.
3594 pub fn new() -> Self {
3595 std::default::Default::default()
3596 }
3597
3598 /// Sets the value of [column_index][crate::model::DataTableColumnInfo::column_index].
3599 ///
3600 /// # Example
3601 /// ```ignore,no_run
3602 /// # use google_cloud_chronicle_v1::model::DataTableColumnInfo;
3603 /// let x = DataTableColumnInfo::new().set_column_index(42);
3604 /// ```
3605 pub fn set_column_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3606 self.column_index = v.into();
3607 self
3608 }
3609
3610 /// Sets the value of [original_column][crate::model::DataTableColumnInfo::original_column].
3611 ///
3612 /// # Example
3613 /// ```ignore,no_run
3614 /// # use google_cloud_chronicle_v1::model::DataTableColumnInfo;
3615 /// let x = DataTableColumnInfo::new().set_original_column("example");
3616 /// ```
3617 pub fn set_original_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3618 self.original_column = v.into();
3619 self
3620 }
3621
3622 /// Sets the value of [key_column][crate::model::DataTableColumnInfo::key_column].
3623 ///
3624 /// # Example
3625 /// ```ignore,no_run
3626 /// # use google_cloud_chronicle_v1::model::DataTableColumnInfo;
3627 /// let x = DataTableColumnInfo::new().set_key_column(true);
3628 /// ```
3629 pub fn set_key_column<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3630 self.key_column = v.into();
3631 self
3632 }
3633
3634 /// Sets the value of [repeated_values][crate::model::DataTableColumnInfo::repeated_values].
3635 ///
3636 /// # Example
3637 /// ```ignore,no_run
3638 /// # use google_cloud_chronicle_v1::model::DataTableColumnInfo;
3639 /// let x = DataTableColumnInfo::new().set_repeated_values(true);
3640 /// ```
3641 pub fn set_repeated_values<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3642 self.repeated_values = v.into();
3643 self
3644 }
3645
3646 /// Sets the value of [path_or_type][crate::model::DataTableColumnInfo::path_or_type].
3647 ///
3648 /// Note that all the setters affecting `path_or_type` are mutually
3649 /// exclusive.
3650 ///
3651 /// # Example
3652 /// ```ignore,no_run
3653 /// # use google_cloud_chronicle_v1::model::DataTableColumnInfo;
3654 /// use google_cloud_chronicle_v1::model::data_table_column_info::PathOrType;
3655 /// let x = DataTableColumnInfo::new().set_path_or_type(Some(PathOrType::MappedColumnPath("example".to_string())));
3656 /// ```
3657 pub fn set_path_or_type<
3658 T: std::convert::Into<std::option::Option<crate::model::data_table_column_info::PathOrType>>,
3659 >(
3660 mut self,
3661 v: T,
3662 ) -> Self {
3663 self.path_or_type = v.into();
3664 self
3665 }
3666
3667 /// The value of [path_or_type][crate::model::DataTableColumnInfo::path_or_type]
3668 /// if it holds a `MappedColumnPath`, `None` if the field is not set or
3669 /// holds a different branch.
3670 pub fn mapped_column_path(&self) -> std::option::Option<&std::string::String> {
3671 #[allow(unreachable_patterns)]
3672 self.path_or_type.as_ref().and_then(|v| match v {
3673 crate::model::data_table_column_info::PathOrType::MappedColumnPath(v) => {
3674 std::option::Option::Some(v)
3675 }
3676 _ => std::option::Option::None,
3677 })
3678 }
3679
3680 /// Sets the value of [path_or_type][crate::model::DataTableColumnInfo::path_or_type]
3681 /// to hold a `MappedColumnPath`.
3682 ///
3683 /// Note that all the setters affecting `path_or_type` are
3684 /// mutually exclusive.
3685 ///
3686 /// # Example
3687 /// ```ignore,no_run
3688 /// # use google_cloud_chronicle_v1::model::DataTableColumnInfo;
3689 /// let x = DataTableColumnInfo::new().set_mapped_column_path("example");
3690 /// assert!(x.mapped_column_path().is_some());
3691 /// assert!(x.column_type().is_none());
3692 /// ```
3693 pub fn set_mapped_column_path<T: std::convert::Into<std::string::String>>(
3694 mut self,
3695 v: T,
3696 ) -> Self {
3697 self.path_or_type = std::option::Option::Some(
3698 crate::model::data_table_column_info::PathOrType::MappedColumnPath(v.into()),
3699 );
3700 self
3701 }
3702
3703 /// The value of [path_or_type][crate::model::DataTableColumnInfo::path_or_type]
3704 /// if it holds a `ColumnType`, `None` if the field is not set or
3705 /// holds a different branch.
3706 pub fn column_type(
3707 &self,
3708 ) -> std::option::Option<&crate::model::data_table_column_info::DataTableColumnType> {
3709 #[allow(unreachable_patterns)]
3710 self.path_or_type.as_ref().and_then(|v| match v {
3711 crate::model::data_table_column_info::PathOrType::ColumnType(v) => {
3712 std::option::Option::Some(v)
3713 }
3714 _ => std::option::Option::None,
3715 })
3716 }
3717
3718 /// Sets the value of [path_or_type][crate::model::DataTableColumnInfo::path_or_type]
3719 /// to hold a `ColumnType`.
3720 ///
3721 /// Note that all the setters affecting `path_or_type` are
3722 /// mutually exclusive.
3723 ///
3724 /// # Example
3725 /// ```ignore,no_run
3726 /// # use google_cloud_chronicle_v1::model::DataTableColumnInfo;
3727 /// use google_cloud_chronicle_v1::model::data_table_column_info::DataTableColumnType;
3728 /// let x0 = DataTableColumnInfo::new().set_column_type(DataTableColumnType::String);
3729 /// let x1 = DataTableColumnInfo::new().set_column_type(DataTableColumnType::Regex);
3730 /// let x2 = DataTableColumnInfo::new().set_column_type(DataTableColumnType::Cidr);
3731 /// assert!(x0.column_type().is_some());
3732 /// assert!(x0.mapped_column_path().is_none());
3733 /// assert!(x1.column_type().is_some());
3734 /// assert!(x1.mapped_column_path().is_none());
3735 /// assert!(x2.column_type().is_some());
3736 /// assert!(x2.mapped_column_path().is_none());
3737 /// ```
3738 pub fn set_column_type<
3739 T: std::convert::Into<crate::model::data_table_column_info::DataTableColumnType>,
3740 >(
3741 mut self,
3742 v: T,
3743 ) -> Self {
3744 self.path_or_type = std::option::Option::Some(
3745 crate::model::data_table_column_info::PathOrType::ColumnType(v.into()),
3746 );
3747 self
3748 }
3749}
3750
3751impl wkt::message::Message for DataTableColumnInfo {
3752 fn typename() -> &'static str {
3753 "type.googleapis.com/google.cloud.chronicle.v1.DataTableColumnInfo"
3754 }
3755}
3756
3757/// Defines additional types related to [DataTableColumnInfo].
3758pub mod data_table_column_info {
3759 #[allow(unused_imports)]
3760 use super::*;
3761
3762 /// DataTableColumnType denotes the type of the column to be referenced in the
3763 /// rule.
3764 ///
3765 /// # Working with unknown values
3766 ///
3767 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3768 /// additional enum variants at any time. Adding new variants is not considered
3769 /// a breaking change. Applications should write their code in anticipation of:
3770 ///
3771 /// - New values appearing in future releases of the client library, **and**
3772 /// - New values received dynamically, without application changes.
3773 ///
3774 /// Please consult the [Working with enums] section in the user guide for some
3775 /// guidelines.
3776 ///
3777 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3778 #[derive(Clone, Debug, PartialEq)]
3779 #[non_exhaustive]
3780 pub enum DataTableColumnType {
3781 /// The default Data Table Column Type.
3782 Unspecified,
3783 /// Denotes the type of the column as STRING.
3784 String,
3785 /// Denotes the type of the column as REGEX.
3786 Regex,
3787 /// Denotes the type of the column as CIDR.
3788 Cidr,
3789 /// Denotes the type of the column as NUMBER (includes int and float).
3790 Number,
3791 /// If set, the enum was initialized with an unknown value.
3792 ///
3793 /// Applications can examine the value using [DataTableColumnType::value] or
3794 /// [DataTableColumnType::name].
3795 UnknownValue(data_table_column_type::UnknownValue),
3796 }
3797
3798 #[doc(hidden)]
3799 pub mod data_table_column_type {
3800 #[allow(unused_imports)]
3801 use super::*;
3802 #[derive(Clone, Debug, PartialEq)]
3803 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3804 }
3805
3806 impl DataTableColumnType {
3807 /// Gets the enum value.
3808 ///
3809 /// Returns `None` if the enum contains an unknown value deserialized from
3810 /// the string representation of enums.
3811 pub fn value(&self) -> std::option::Option<i32> {
3812 match self {
3813 Self::Unspecified => std::option::Option::Some(0),
3814 Self::String => std::option::Option::Some(1),
3815 Self::Regex => std::option::Option::Some(2),
3816 Self::Cidr => std::option::Option::Some(3),
3817 Self::Number => std::option::Option::Some(4),
3818 Self::UnknownValue(u) => u.0.value(),
3819 }
3820 }
3821
3822 /// Gets the enum value as a string.
3823 ///
3824 /// Returns `None` if the enum contains an unknown value deserialized from
3825 /// the integer representation of enums.
3826 pub fn name(&self) -> std::option::Option<&str> {
3827 match self {
3828 Self::Unspecified => {
3829 std::option::Option::Some("DATA_TABLE_COLUMN_TYPE_UNSPECIFIED")
3830 }
3831 Self::String => std::option::Option::Some("STRING"),
3832 Self::Regex => std::option::Option::Some("REGEX"),
3833 Self::Cidr => std::option::Option::Some("CIDR"),
3834 Self::Number => std::option::Option::Some("NUMBER"),
3835 Self::UnknownValue(u) => u.0.name(),
3836 }
3837 }
3838 }
3839
3840 impl std::default::Default for DataTableColumnType {
3841 fn default() -> Self {
3842 use std::convert::From;
3843 Self::from(0)
3844 }
3845 }
3846
3847 impl std::fmt::Display for DataTableColumnType {
3848 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3849 wkt::internal::display_enum(f, self.name(), self.value())
3850 }
3851 }
3852
3853 impl std::convert::From<i32> for DataTableColumnType {
3854 fn from(value: i32) -> Self {
3855 match value {
3856 0 => Self::Unspecified,
3857 1 => Self::String,
3858 2 => Self::Regex,
3859 3 => Self::Cidr,
3860 4 => Self::Number,
3861 _ => Self::UnknownValue(data_table_column_type::UnknownValue(
3862 wkt::internal::UnknownEnumValue::Integer(value),
3863 )),
3864 }
3865 }
3866 }
3867
3868 impl std::convert::From<&str> for DataTableColumnType {
3869 fn from(value: &str) -> Self {
3870 use std::string::ToString;
3871 match value {
3872 "DATA_TABLE_COLUMN_TYPE_UNSPECIFIED" => Self::Unspecified,
3873 "STRING" => Self::String,
3874 "REGEX" => Self::Regex,
3875 "CIDR" => Self::Cidr,
3876 "NUMBER" => Self::Number,
3877 _ => Self::UnknownValue(data_table_column_type::UnknownValue(
3878 wkt::internal::UnknownEnumValue::String(value.to_string()),
3879 )),
3880 }
3881 }
3882 }
3883
3884 impl serde::ser::Serialize for DataTableColumnType {
3885 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3886 where
3887 S: serde::Serializer,
3888 {
3889 match self {
3890 Self::Unspecified => serializer.serialize_i32(0),
3891 Self::String => serializer.serialize_i32(1),
3892 Self::Regex => serializer.serialize_i32(2),
3893 Self::Cidr => serializer.serialize_i32(3),
3894 Self::Number => serializer.serialize_i32(4),
3895 Self::UnknownValue(u) => u.0.serialize(serializer),
3896 }
3897 }
3898 }
3899
3900 impl<'de> serde::de::Deserialize<'de> for DataTableColumnType {
3901 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3902 where
3903 D: serde::Deserializer<'de>,
3904 {
3905 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataTableColumnType>::new(
3906 ".google.cloud.chronicle.v1.DataTableColumnInfo.DataTableColumnType",
3907 ))
3908 }
3909 }
3910
3911 #[allow(missing_docs)]
3912 #[derive(Clone, Debug, PartialEq)]
3913 #[non_exhaustive]
3914 pub enum PathOrType {
3915 /// Entity proto field path that the column is mapped to
3916 MappedColumnPath(std::string::String),
3917 /// Column type can be STRING, CIDR (Ex- 10.1.1.0/24), REGEX
3918 ColumnType(crate::model::data_table_column_info::DataTableColumnType),
3919 }
3920}
3921
3922/// The request message for GetDataTableOperationErrors.
3923#[derive(Clone, Default, PartialEq)]
3924#[non_exhaustive]
3925pub struct GetDataTableOperationErrorsRequest {
3926 /// Required. Resource name for the data table operation errors.
3927 /// Format:
3928 /// projects/{project}/locations/{location}/instances/{instance}/dataTableOperationErrors/{data_table_operation_errors}
3929 pub name: std::string::String,
3930
3931 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3932}
3933
3934impl GetDataTableOperationErrorsRequest {
3935 /// Creates a new default instance.
3936 pub fn new() -> Self {
3937 std::default::Default::default()
3938 }
3939
3940 /// Sets the value of [name][crate::model::GetDataTableOperationErrorsRequest::name].
3941 ///
3942 /// # Example
3943 /// ```ignore,no_run
3944 /// # use google_cloud_chronicle_v1::model::GetDataTableOperationErrorsRequest;
3945 /// let x = GetDataTableOperationErrorsRequest::new().set_name("example");
3946 /// ```
3947 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3948 self.name = v.into();
3949 self
3950 }
3951}
3952
3953impl wkt::message::Message for GetDataTableOperationErrorsRequest {
3954 fn typename() -> &'static str {
3955 "type.googleapis.com/google.cloud.chronicle.v1.GetDataTableOperationErrorsRequest"
3956 }
3957}
3958
3959/// The message containing the errors for a data table operation.
3960#[derive(Clone, Default, PartialEq)]
3961#[non_exhaustive]
3962pub struct DataTableOperationErrors {
3963 /// Identifier. Resource name for the data table operation errors.
3964 /// Format:
3965 /// projects/{project}/locations/{location}/instances/{instance}/dataTableOperationErrors/{data_table_operation_errors}
3966 pub name: std::string::String,
3967
3968 /// The list of errors.
3969 /// Replaces the deprecated `errors` field.
3970 pub rpc_errors: std::vec::Vec<google_cloud_rpc::model::Status>,
3971
3972 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3973}
3974
3975impl DataTableOperationErrors {
3976 /// Creates a new default instance.
3977 pub fn new() -> Self {
3978 std::default::Default::default()
3979 }
3980
3981 /// Sets the value of [name][crate::model::DataTableOperationErrors::name].
3982 ///
3983 /// # Example
3984 /// ```ignore,no_run
3985 /// # use google_cloud_chronicle_v1::model::DataTableOperationErrors;
3986 /// let x = DataTableOperationErrors::new().set_name("example");
3987 /// ```
3988 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3989 self.name = v.into();
3990 self
3991 }
3992
3993 /// Sets the value of [rpc_errors][crate::model::DataTableOperationErrors::rpc_errors].
3994 ///
3995 /// # Example
3996 /// ```ignore,no_run
3997 /// # use google_cloud_chronicle_v1::model::DataTableOperationErrors;
3998 /// use google_cloud_rpc::model::Status;
3999 /// let x = DataTableOperationErrors::new()
4000 /// .set_rpc_errors([
4001 /// Status::default()/* use setters */,
4002 /// Status::default()/* use (different) setters */,
4003 /// ]);
4004 /// ```
4005 pub fn set_rpc_errors<T, V>(mut self, v: T) -> Self
4006 where
4007 T: std::iter::IntoIterator<Item = V>,
4008 V: std::convert::Into<google_cloud_rpc::model::Status>,
4009 {
4010 use std::iter::Iterator;
4011 self.rpc_errors = v.into_iter().map(|i| i.into()).collect();
4012 self
4013 }
4014}
4015
4016impl wkt::message::Message for DataTableOperationErrors {
4017 fn typename() -> &'static str {
4018 "type.googleapis.com/google.cloud.chronicle.v1.DataTableOperationErrors"
4019 }
4020}
4021
4022/// A watchlist is a list of entities that allows for bulk operations over the
4023/// included entities.
4024#[derive(Clone, Default, PartialEq)]
4025#[non_exhaustive]
4026pub struct Watchlist {
4027 /// Identifier. Resource name of the watchlist.
4028 /// Format:
4029 /// `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
4030 pub name: std::string::String,
4031
4032 /// Required. Display name of the watchlist.
4033 /// Note that it must be at least one character and less than 63 characters
4034 /// (<https://google.aip.dev/148>).
4035 pub display_name: std::string::String,
4036
4037 /// Optional. Description of the watchlist.
4038 pub description: std::string::String,
4039
4040 /// Optional. Weight applied to the risk score for entities
4041 /// in this watchlist.
4042 /// The default is 1.0 if it is not specified.
4043 pub multiplying_factor: f32,
4044
4045 /// Required. Mechanism to populate entities in the watchlist.
4046 pub entity_population_mechanism:
4047 std::option::Option<crate::model::watchlist::EntityPopulationMechanism>,
4048
4049 /// Output only. Entity count in the watchlist.
4050 pub entity_count: std::option::Option<crate::model::watchlist::EntityCount>,
4051
4052 /// Output only. Time the watchlist was created.
4053 pub create_time: std::option::Option<wkt::Timestamp>,
4054
4055 /// Output only. Time the watchlist was last updated.
4056 pub update_time: std::option::Option<wkt::Timestamp>,
4057
4058 /// Optional. User preferences for watchlist configuration.
4059 pub watchlist_user_preferences: std::option::Option<crate::model::WatchlistUserPreferences>,
4060
4061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4062}
4063
4064impl Watchlist {
4065 /// Creates a new default instance.
4066 pub fn new() -> Self {
4067 std::default::Default::default()
4068 }
4069
4070 /// Sets the value of [name][crate::model::Watchlist::name].
4071 ///
4072 /// # Example
4073 /// ```ignore,no_run
4074 /// # use google_cloud_chronicle_v1::model::Watchlist;
4075 /// let x = Watchlist::new().set_name("example");
4076 /// ```
4077 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4078 self.name = v.into();
4079 self
4080 }
4081
4082 /// Sets the value of [display_name][crate::model::Watchlist::display_name].
4083 ///
4084 /// # Example
4085 /// ```ignore,no_run
4086 /// # use google_cloud_chronicle_v1::model::Watchlist;
4087 /// let x = Watchlist::new().set_display_name("example");
4088 /// ```
4089 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4090 self.display_name = v.into();
4091 self
4092 }
4093
4094 /// Sets the value of [description][crate::model::Watchlist::description].
4095 ///
4096 /// # Example
4097 /// ```ignore,no_run
4098 /// # use google_cloud_chronicle_v1::model::Watchlist;
4099 /// let x = Watchlist::new().set_description("example");
4100 /// ```
4101 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4102 self.description = v.into();
4103 self
4104 }
4105
4106 /// Sets the value of [multiplying_factor][crate::model::Watchlist::multiplying_factor].
4107 ///
4108 /// # Example
4109 /// ```ignore,no_run
4110 /// # use google_cloud_chronicle_v1::model::Watchlist;
4111 /// let x = Watchlist::new().set_multiplying_factor(42.0);
4112 /// ```
4113 pub fn set_multiplying_factor<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4114 self.multiplying_factor = v.into();
4115 self
4116 }
4117
4118 /// Sets the value of [entity_population_mechanism][crate::model::Watchlist::entity_population_mechanism].
4119 ///
4120 /// # Example
4121 /// ```ignore,no_run
4122 /// # use google_cloud_chronicle_v1::model::Watchlist;
4123 /// use google_cloud_chronicle_v1::model::watchlist::EntityPopulationMechanism;
4124 /// let x = Watchlist::new().set_entity_population_mechanism(EntityPopulationMechanism::default()/* use setters */);
4125 /// ```
4126 pub fn set_entity_population_mechanism<T>(mut self, v: T) -> Self
4127 where
4128 T: std::convert::Into<crate::model::watchlist::EntityPopulationMechanism>,
4129 {
4130 self.entity_population_mechanism = std::option::Option::Some(v.into());
4131 self
4132 }
4133
4134 /// Sets or clears the value of [entity_population_mechanism][crate::model::Watchlist::entity_population_mechanism].
4135 ///
4136 /// # Example
4137 /// ```ignore,no_run
4138 /// # use google_cloud_chronicle_v1::model::Watchlist;
4139 /// use google_cloud_chronicle_v1::model::watchlist::EntityPopulationMechanism;
4140 /// let x = Watchlist::new().set_or_clear_entity_population_mechanism(Some(EntityPopulationMechanism::default()/* use setters */));
4141 /// let x = Watchlist::new().set_or_clear_entity_population_mechanism(None::<EntityPopulationMechanism>);
4142 /// ```
4143 pub fn set_or_clear_entity_population_mechanism<T>(mut self, v: std::option::Option<T>) -> Self
4144 where
4145 T: std::convert::Into<crate::model::watchlist::EntityPopulationMechanism>,
4146 {
4147 self.entity_population_mechanism = v.map(|x| x.into());
4148 self
4149 }
4150
4151 /// Sets the value of [entity_count][crate::model::Watchlist::entity_count].
4152 ///
4153 /// # Example
4154 /// ```ignore,no_run
4155 /// # use google_cloud_chronicle_v1::model::Watchlist;
4156 /// use google_cloud_chronicle_v1::model::watchlist::EntityCount;
4157 /// let x = Watchlist::new().set_entity_count(EntityCount::default()/* use setters */);
4158 /// ```
4159 pub fn set_entity_count<T>(mut self, v: T) -> Self
4160 where
4161 T: std::convert::Into<crate::model::watchlist::EntityCount>,
4162 {
4163 self.entity_count = std::option::Option::Some(v.into());
4164 self
4165 }
4166
4167 /// Sets or clears the value of [entity_count][crate::model::Watchlist::entity_count].
4168 ///
4169 /// # Example
4170 /// ```ignore,no_run
4171 /// # use google_cloud_chronicle_v1::model::Watchlist;
4172 /// use google_cloud_chronicle_v1::model::watchlist::EntityCount;
4173 /// let x = Watchlist::new().set_or_clear_entity_count(Some(EntityCount::default()/* use setters */));
4174 /// let x = Watchlist::new().set_or_clear_entity_count(None::<EntityCount>);
4175 /// ```
4176 pub fn set_or_clear_entity_count<T>(mut self, v: std::option::Option<T>) -> Self
4177 where
4178 T: std::convert::Into<crate::model::watchlist::EntityCount>,
4179 {
4180 self.entity_count = v.map(|x| x.into());
4181 self
4182 }
4183
4184 /// Sets the value of [create_time][crate::model::Watchlist::create_time].
4185 ///
4186 /// # Example
4187 /// ```ignore,no_run
4188 /// # use google_cloud_chronicle_v1::model::Watchlist;
4189 /// use wkt::Timestamp;
4190 /// let x = Watchlist::new().set_create_time(Timestamp::default()/* use setters */);
4191 /// ```
4192 pub fn set_create_time<T>(mut self, v: T) -> Self
4193 where
4194 T: std::convert::Into<wkt::Timestamp>,
4195 {
4196 self.create_time = std::option::Option::Some(v.into());
4197 self
4198 }
4199
4200 /// Sets or clears the value of [create_time][crate::model::Watchlist::create_time].
4201 ///
4202 /// # Example
4203 /// ```ignore,no_run
4204 /// # use google_cloud_chronicle_v1::model::Watchlist;
4205 /// use wkt::Timestamp;
4206 /// let x = Watchlist::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4207 /// let x = Watchlist::new().set_or_clear_create_time(None::<Timestamp>);
4208 /// ```
4209 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4210 where
4211 T: std::convert::Into<wkt::Timestamp>,
4212 {
4213 self.create_time = v.map(|x| x.into());
4214 self
4215 }
4216
4217 /// Sets the value of [update_time][crate::model::Watchlist::update_time].
4218 ///
4219 /// # Example
4220 /// ```ignore,no_run
4221 /// # use google_cloud_chronicle_v1::model::Watchlist;
4222 /// use wkt::Timestamp;
4223 /// let x = Watchlist::new().set_update_time(Timestamp::default()/* use setters */);
4224 /// ```
4225 pub fn set_update_time<T>(mut self, v: T) -> Self
4226 where
4227 T: std::convert::Into<wkt::Timestamp>,
4228 {
4229 self.update_time = std::option::Option::Some(v.into());
4230 self
4231 }
4232
4233 /// Sets or clears the value of [update_time][crate::model::Watchlist::update_time].
4234 ///
4235 /// # Example
4236 /// ```ignore,no_run
4237 /// # use google_cloud_chronicle_v1::model::Watchlist;
4238 /// use wkt::Timestamp;
4239 /// let x = Watchlist::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4240 /// let x = Watchlist::new().set_or_clear_update_time(None::<Timestamp>);
4241 /// ```
4242 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4243 where
4244 T: std::convert::Into<wkt::Timestamp>,
4245 {
4246 self.update_time = v.map(|x| x.into());
4247 self
4248 }
4249
4250 /// Sets the value of [watchlist_user_preferences][crate::model::Watchlist::watchlist_user_preferences].
4251 ///
4252 /// # Example
4253 /// ```ignore,no_run
4254 /// # use google_cloud_chronicle_v1::model::Watchlist;
4255 /// use google_cloud_chronicle_v1::model::WatchlistUserPreferences;
4256 /// let x = Watchlist::new().set_watchlist_user_preferences(WatchlistUserPreferences::default()/* use setters */);
4257 /// ```
4258 pub fn set_watchlist_user_preferences<T>(mut self, v: T) -> Self
4259 where
4260 T: std::convert::Into<crate::model::WatchlistUserPreferences>,
4261 {
4262 self.watchlist_user_preferences = std::option::Option::Some(v.into());
4263 self
4264 }
4265
4266 /// Sets or clears the value of [watchlist_user_preferences][crate::model::Watchlist::watchlist_user_preferences].
4267 ///
4268 /// # Example
4269 /// ```ignore,no_run
4270 /// # use google_cloud_chronicle_v1::model::Watchlist;
4271 /// use google_cloud_chronicle_v1::model::WatchlistUserPreferences;
4272 /// let x = Watchlist::new().set_or_clear_watchlist_user_preferences(Some(WatchlistUserPreferences::default()/* use setters */));
4273 /// let x = Watchlist::new().set_or_clear_watchlist_user_preferences(None::<WatchlistUserPreferences>);
4274 /// ```
4275 pub fn set_or_clear_watchlist_user_preferences<T>(mut self, v: std::option::Option<T>) -> Self
4276 where
4277 T: std::convert::Into<crate::model::WatchlistUserPreferences>,
4278 {
4279 self.watchlist_user_preferences = v.map(|x| x.into());
4280 self
4281 }
4282}
4283
4284impl wkt::message::Message for Watchlist {
4285 fn typename() -> &'static str {
4286 "type.googleapis.com/google.cloud.chronicle.v1.Watchlist"
4287 }
4288}
4289
4290/// Defines additional types related to [Watchlist].
4291pub mod watchlist {
4292 #[allow(unused_imports)]
4293 use super::*;
4294
4295 /// Mechanism to populate entities in the watchlist.
4296 #[derive(Clone, Default, PartialEq)]
4297 #[non_exhaustive]
4298 pub struct EntityPopulationMechanism {
4299 /// Ways to populate entities in watchlist.
4300 /// Currently, only manual is supported.
4301 pub mechanism:
4302 std::option::Option<crate::model::watchlist::entity_population_mechanism::Mechanism>,
4303
4304 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4305 }
4306
4307 impl EntityPopulationMechanism {
4308 /// Creates a new default instance.
4309 pub fn new() -> Self {
4310 std::default::Default::default()
4311 }
4312
4313 /// Sets the value of [mechanism][crate::model::watchlist::EntityPopulationMechanism::mechanism].
4314 ///
4315 /// Note that all the setters affecting `mechanism` are mutually
4316 /// exclusive.
4317 ///
4318 /// # Example
4319 /// ```ignore,no_run
4320 /// # use google_cloud_chronicle_v1::model::watchlist::EntityPopulationMechanism;
4321 /// use google_cloud_chronicle_v1::model::watchlist::entity_population_mechanism::Manual;
4322 /// let x = EntityPopulationMechanism::new().set_mechanism(Some(
4323 /// google_cloud_chronicle_v1::model::watchlist::entity_population_mechanism::Mechanism::Manual(Manual::default().into())));
4324 /// ```
4325 pub fn set_mechanism<
4326 T: std::convert::Into<
4327 std::option::Option<
4328 crate::model::watchlist::entity_population_mechanism::Mechanism,
4329 >,
4330 >,
4331 >(
4332 mut self,
4333 v: T,
4334 ) -> Self {
4335 self.mechanism = v.into();
4336 self
4337 }
4338
4339 /// The value of [mechanism][crate::model::watchlist::EntityPopulationMechanism::mechanism]
4340 /// if it holds a `Manual`, `None` if the field is not set or
4341 /// holds a different branch.
4342 pub fn manual(
4343 &self,
4344 ) -> std::option::Option<
4345 &std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>,
4346 > {
4347 #[allow(unreachable_patterns)]
4348 self.mechanism.as_ref().and_then(|v| match v {
4349 crate::model::watchlist::entity_population_mechanism::Mechanism::Manual(v) => {
4350 std::option::Option::Some(v)
4351 }
4352 _ => std::option::Option::None,
4353 })
4354 }
4355
4356 /// Sets the value of [mechanism][crate::model::watchlist::EntityPopulationMechanism::mechanism]
4357 /// to hold a `Manual`.
4358 ///
4359 /// Note that all the setters affecting `mechanism` are
4360 /// mutually exclusive.
4361 ///
4362 /// # Example
4363 /// ```ignore,no_run
4364 /// # use google_cloud_chronicle_v1::model::watchlist::EntityPopulationMechanism;
4365 /// use google_cloud_chronicle_v1::model::watchlist::entity_population_mechanism::Manual;
4366 /// let x = EntityPopulationMechanism::new().set_manual(Manual::default()/* use setters */);
4367 /// assert!(x.manual().is_some());
4368 /// ```
4369 pub fn set_manual<
4370 T: std::convert::Into<
4371 std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>,
4372 >,
4373 >(
4374 mut self,
4375 v: T,
4376 ) -> Self {
4377 self.mechanism = std::option::Option::Some(
4378 crate::model::watchlist::entity_population_mechanism::Mechanism::Manual(v.into()),
4379 );
4380 self
4381 }
4382 }
4383
4384 impl wkt::message::Message for EntityPopulationMechanism {
4385 fn typename() -> &'static str {
4386 "type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityPopulationMechanism"
4387 }
4388 }
4389
4390 /// Defines additional types related to [EntityPopulationMechanism].
4391 pub mod entity_population_mechanism {
4392 #[allow(unused_imports)]
4393 use super::*;
4394
4395 /// Entities are added manually.
4396 #[derive(Clone, Default, PartialEq)]
4397 #[non_exhaustive]
4398 pub struct Manual {
4399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4400 }
4401
4402 impl Manual {
4403 /// Creates a new default instance.
4404 pub fn new() -> Self {
4405 std::default::Default::default()
4406 }
4407 }
4408
4409 impl wkt::message::Message for Manual {
4410 fn typename() -> &'static str {
4411 "type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityPopulationMechanism.Manual"
4412 }
4413 }
4414
4415 /// Ways to populate entities in watchlist.
4416 /// Currently, only manual is supported.
4417 #[derive(Clone, Debug, PartialEq)]
4418 #[non_exhaustive]
4419 pub enum Mechanism {
4420 /// Optional. Entities are added manually.
4421 Manual(std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>),
4422 }
4423 }
4424
4425 /// Count of different types of entities in the watchlist.
4426 #[derive(Clone, Default, PartialEq)]
4427 #[non_exhaustive]
4428 pub struct EntityCount {
4429 /// Output only. Count of user type entities in the watchlist.
4430 pub user: i32,
4431
4432 /// Output only. Count of asset type entities in the watchlist.
4433 pub asset: i32,
4434
4435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4436 }
4437
4438 impl EntityCount {
4439 /// Creates a new default instance.
4440 pub fn new() -> Self {
4441 std::default::Default::default()
4442 }
4443
4444 /// Sets the value of [user][crate::model::watchlist::EntityCount::user].
4445 ///
4446 /// # Example
4447 /// ```ignore,no_run
4448 /// # use google_cloud_chronicle_v1::model::watchlist::EntityCount;
4449 /// let x = EntityCount::new().set_user(42);
4450 /// ```
4451 pub fn set_user<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4452 self.user = v.into();
4453 self
4454 }
4455
4456 /// Sets the value of [asset][crate::model::watchlist::EntityCount::asset].
4457 ///
4458 /// # Example
4459 /// ```ignore,no_run
4460 /// # use google_cloud_chronicle_v1::model::watchlist::EntityCount;
4461 /// let x = EntityCount::new().set_asset(42);
4462 /// ```
4463 pub fn set_asset<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4464 self.asset = v.into();
4465 self
4466 }
4467 }
4468
4469 impl wkt::message::Message for EntityCount {
4470 fn typename() -> &'static str {
4471 "type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityCount"
4472 }
4473 }
4474}
4475
4476/// A collection of user preferences for watchlist UI configuration.
4477#[derive(Clone, Default, PartialEq)]
4478#[non_exhaustive]
4479pub struct WatchlistUserPreferences {
4480 /// Optional. Whether the watchlist is pinned on the dashboard.
4481 pub pinned: bool,
4482
4483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4484}
4485
4486impl WatchlistUserPreferences {
4487 /// Creates a new default instance.
4488 pub fn new() -> Self {
4489 std::default::Default::default()
4490 }
4491
4492 /// Sets the value of [pinned][crate::model::WatchlistUserPreferences::pinned].
4493 ///
4494 /// # Example
4495 /// ```ignore,no_run
4496 /// # use google_cloud_chronicle_v1::model::WatchlistUserPreferences;
4497 /// let x = WatchlistUserPreferences::new().set_pinned(true);
4498 /// ```
4499 pub fn set_pinned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4500 self.pinned = v.into();
4501 self
4502 }
4503}
4504
4505impl wkt::message::Message for WatchlistUserPreferences {
4506 fn typename() -> &'static str {
4507 "type.googleapis.com/google.cloud.chronicle.v1.WatchlistUserPreferences"
4508 }
4509}
4510
4511/// Request message for getting a watchlist.
4512#[derive(Clone, Default, PartialEq)]
4513#[non_exhaustive]
4514pub struct GetWatchlistRequest {
4515 /// Required. The parent, which owns this collection of watchlists.
4516 /// The name of the watchlist to retrieve.
4517 /// Format:
4518 /// `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
4519 pub name: std::string::String,
4520
4521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4522}
4523
4524impl GetWatchlistRequest {
4525 /// Creates a new default instance.
4526 pub fn new() -> Self {
4527 std::default::Default::default()
4528 }
4529
4530 /// Sets the value of [name][crate::model::GetWatchlistRequest::name].
4531 ///
4532 /// # Example
4533 /// ```ignore,no_run
4534 /// # use google_cloud_chronicle_v1::model::GetWatchlistRequest;
4535 /// let x = GetWatchlistRequest::new().set_name("example");
4536 /// ```
4537 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4538 self.name = v.into();
4539 self
4540 }
4541}
4542
4543impl wkt::message::Message for GetWatchlistRequest {
4544 fn typename() -> &'static str {
4545 "type.googleapis.com/google.cloud.chronicle.v1.GetWatchlistRequest"
4546 }
4547}
4548
4549/// Request message for listing watchlists.
4550#[derive(Clone, Default, PartialEq)]
4551#[non_exhaustive]
4552pub struct ListWatchlistsRequest {
4553 /// Required. The parent, which owns this collection of watchlists.
4554 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
4555 pub parent: std::string::String,
4556
4557 /// Optional. The maximum number of watchlists to return.
4558 /// The service may return fewer than this value.
4559 /// If unspecified, at most 200 watchlists will be returned.
4560 /// The maximum value is 200; values above 200 will be coerced to 200.
4561 pub page_size: i32,
4562
4563 /// Optional. A page token, received from a previous `ListWatchlists` call.
4564 /// Provide this to retrieve the subsequent page.
4565 ///
4566 /// When paginating, all other parameters provided to
4567 /// `ListWatchlists` must match the call that provided the page
4568 /// token.
4569 pub page_token: std::string::String,
4570
4571 /// Optional. Which watchlist to return in aip.dev/160 form.
4572 /// Currently, only the following filters are supported:
4573 ///
4574 /// - `watchlist_user_preferences.pinned=true`
4575 /// - `has_entity([ENTITY_INDICATOR],[ENTITY_TYPE])`
4576 /// - `has_entity([ENTITY_INDICATOR],[ENTITY_TYPE],[NAMESPACE])`
4577 pub filter: std::string::String,
4578
4579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4580}
4581
4582impl ListWatchlistsRequest {
4583 /// Creates a new default instance.
4584 pub fn new() -> Self {
4585 std::default::Default::default()
4586 }
4587
4588 /// Sets the value of [parent][crate::model::ListWatchlistsRequest::parent].
4589 ///
4590 /// # Example
4591 /// ```ignore,no_run
4592 /// # use google_cloud_chronicle_v1::model::ListWatchlistsRequest;
4593 /// let x = ListWatchlistsRequest::new().set_parent("example");
4594 /// ```
4595 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4596 self.parent = v.into();
4597 self
4598 }
4599
4600 /// Sets the value of [page_size][crate::model::ListWatchlistsRequest::page_size].
4601 ///
4602 /// # Example
4603 /// ```ignore,no_run
4604 /// # use google_cloud_chronicle_v1::model::ListWatchlistsRequest;
4605 /// let x = ListWatchlistsRequest::new().set_page_size(42);
4606 /// ```
4607 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4608 self.page_size = v.into();
4609 self
4610 }
4611
4612 /// Sets the value of [page_token][crate::model::ListWatchlistsRequest::page_token].
4613 ///
4614 /// # Example
4615 /// ```ignore,no_run
4616 /// # use google_cloud_chronicle_v1::model::ListWatchlistsRequest;
4617 /// let x = ListWatchlistsRequest::new().set_page_token("example");
4618 /// ```
4619 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4620 self.page_token = v.into();
4621 self
4622 }
4623
4624 /// Sets the value of [filter][crate::model::ListWatchlistsRequest::filter].
4625 ///
4626 /// # Example
4627 /// ```ignore,no_run
4628 /// # use google_cloud_chronicle_v1::model::ListWatchlistsRequest;
4629 /// let x = ListWatchlistsRequest::new().set_filter("example");
4630 /// ```
4631 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4632 self.filter = v.into();
4633 self
4634 }
4635}
4636
4637impl wkt::message::Message for ListWatchlistsRequest {
4638 fn typename() -> &'static str {
4639 "type.googleapis.com/google.cloud.chronicle.v1.ListWatchlistsRequest"
4640 }
4641}
4642
4643/// Response message for listing watchlists.
4644#[derive(Clone, Default, PartialEq)]
4645#[non_exhaustive]
4646pub struct ListWatchlistsResponse {
4647 /// Optional. The watchlists from the specified instance.
4648 pub watchlists: std::vec::Vec<crate::model::Watchlist>,
4649
4650 /// Optional. A token, which can be sent as `page_token` to retrieve the next
4651 /// page. If this field is omitted, there are no subsequent pages.
4652 pub next_page_token: std::string::String,
4653
4654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4655}
4656
4657impl ListWatchlistsResponse {
4658 /// Creates a new default instance.
4659 pub fn new() -> Self {
4660 std::default::Default::default()
4661 }
4662
4663 /// Sets the value of [watchlists][crate::model::ListWatchlistsResponse::watchlists].
4664 ///
4665 /// # Example
4666 /// ```ignore,no_run
4667 /// # use google_cloud_chronicle_v1::model::ListWatchlistsResponse;
4668 /// use google_cloud_chronicle_v1::model::Watchlist;
4669 /// let x = ListWatchlistsResponse::new()
4670 /// .set_watchlists([
4671 /// Watchlist::default()/* use setters */,
4672 /// Watchlist::default()/* use (different) setters */,
4673 /// ]);
4674 /// ```
4675 pub fn set_watchlists<T, V>(mut self, v: T) -> Self
4676 where
4677 T: std::iter::IntoIterator<Item = V>,
4678 V: std::convert::Into<crate::model::Watchlist>,
4679 {
4680 use std::iter::Iterator;
4681 self.watchlists = v.into_iter().map(|i| i.into()).collect();
4682 self
4683 }
4684
4685 /// Sets the value of [next_page_token][crate::model::ListWatchlistsResponse::next_page_token].
4686 ///
4687 /// # Example
4688 /// ```ignore,no_run
4689 /// # use google_cloud_chronicle_v1::model::ListWatchlistsResponse;
4690 /// let x = ListWatchlistsResponse::new().set_next_page_token("example");
4691 /// ```
4692 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4693 self.next_page_token = v.into();
4694 self
4695 }
4696}
4697
4698impl wkt::message::Message for ListWatchlistsResponse {
4699 fn typename() -> &'static str {
4700 "type.googleapis.com/google.cloud.chronicle.v1.ListWatchlistsResponse"
4701 }
4702}
4703
4704#[doc(hidden)]
4705impl google_cloud_gax::paginator::internal::PageableResponse for ListWatchlistsResponse {
4706 type PageItem = crate::model::Watchlist;
4707
4708 fn items(self) -> std::vec::Vec<Self::PageItem> {
4709 self.watchlists
4710 }
4711
4712 fn next_page_token(&self) -> std::string::String {
4713 use std::clone::Clone;
4714 self.next_page_token.clone()
4715 }
4716}
4717
4718/// Request message for creating watchlist.
4719#[derive(Clone, Default, PartialEq)]
4720#[non_exhaustive]
4721pub struct CreateWatchlistRequest {
4722 /// Required. The parent resource where this watchlist will be created.
4723 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
4724 pub parent: std::string::String,
4725
4726 /// Optional. The ID to use for the watchlist,
4727 /// which will become the final component of the watchlist's resource name.
4728 ///
4729 /// This value should be 4-63 characters, and valid characters
4730 /// are /[a-z][0-9]-/.
4731 pub watchlist_id: std::string::String,
4732
4733 /// Required. The watchlist to create.
4734 pub watchlist: std::option::Option<crate::model::Watchlist>,
4735
4736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4737}
4738
4739impl CreateWatchlistRequest {
4740 /// Creates a new default instance.
4741 pub fn new() -> Self {
4742 std::default::Default::default()
4743 }
4744
4745 /// Sets the value of [parent][crate::model::CreateWatchlistRequest::parent].
4746 ///
4747 /// # Example
4748 /// ```ignore,no_run
4749 /// # use google_cloud_chronicle_v1::model::CreateWatchlistRequest;
4750 /// let x = CreateWatchlistRequest::new().set_parent("example");
4751 /// ```
4752 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4753 self.parent = v.into();
4754 self
4755 }
4756
4757 /// Sets the value of [watchlist_id][crate::model::CreateWatchlistRequest::watchlist_id].
4758 ///
4759 /// # Example
4760 /// ```ignore,no_run
4761 /// # use google_cloud_chronicle_v1::model::CreateWatchlistRequest;
4762 /// let x = CreateWatchlistRequest::new().set_watchlist_id("example");
4763 /// ```
4764 pub fn set_watchlist_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4765 self.watchlist_id = v.into();
4766 self
4767 }
4768
4769 /// Sets the value of [watchlist][crate::model::CreateWatchlistRequest::watchlist].
4770 ///
4771 /// # Example
4772 /// ```ignore,no_run
4773 /// # use google_cloud_chronicle_v1::model::CreateWatchlistRequest;
4774 /// use google_cloud_chronicle_v1::model::Watchlist;
4775 /// let x = CreateWatchlistRequest::new().set_watchlist(Watchlist::default()/* use setters */);
4776 /// ```
4777 pub fn set_watchlist<T>(mut self, v: T) -> Self
4778 where
4779 T: std::convert::Into<crate::model::Watchlist>,
4780 {
4781 self.watchlist = std::option::Option::Some(v.into());
4782 self
4783 }
4784
4785 /// Sets or clears the value of [watchlist][crate::model::CreateWatchlistRequest::watchlist].
4786 ///
4787 /// # Example
4788 /// ```ignore,no_run
4789 /// # use google_cloud_chronicle_v1::model::CreateWatchlistRequest;
4790 /// use google_cloud_chronicle_v1::model::Watchlist;
4791 /// let x = CreateWatchlistRequest::new().set_or_clear_watchlist(Some(Watchlist::default()/* use setters */));
4792 /// let x = CreateWatchlistRequest::new().set_or_clear_watchlist(None::<Watchlist>);
4793 /// ```
4794 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
4795 where
4796 T: std::convert::Into<crate::model::Watchlist>,
4797 {
4798 self.watchlist = v.map(|x| x.into());
4799 self
4800 }
4801}
4802
4803impl wkt::message::Message for CreateWatchlistRequest {
4804 fn typename() -> &'static str {
4805 "type.googleapis.com/google.cloud.chronicle.v1.CreateWatchlistRequest"
4806 }
4807}
4808
4809/// Request message for updating watchlist.
4810#[derive(Clone, Default, PartialEq)]
4811#[non_exhaustive]
4812pub struct UpdateWatchlistRequest {
4813 /// Required. The watchlist to update.
4814 ///
4815 /// The watchlist's `name` field is used to identify the watchlist to update.
4816 /// Format:
4817 /// `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
4818 pub watchlist: std::option::Option<crate::model::Watchlist>,
4819
4820 /// Optional. The list of fields to update.
4821 pub update_mask: std::option::Option<wkt::FieldMask>,
4822
4823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4824}
4825
4826impl UpdateWatchlistRequest {
4827 /// Creates a new default instance.
4828 pub fn new() -> Self {
4829 std::default::Default::default()
4830 }
4831
4832 /// Sets the value of [watchlist][crate::model::UpdateWatchlistRequest::watchlist].
4833 ///
4834 /// # Example
4835 /// ```ignore,no_run
4836 /// # use google_cloud_chronicle_v1::model::UpdateWatchlistRequest;
4837 /// use google_cloud_chronicle_v1::model::Watchlist;
4838 /// let x = UpdateWatchlistRequest::new().set_watchlist(Watchlist::default()/* use setters */);
4839 /// ```
4840 pub fn set_watchlist<T>(mut self, v: T) -> Self
4841 where
4842 T: std::convert::Into<crate::model::Watchlist>,
4843 {
4844 self.watchlist = std::option::Option::Some(v.into());
4845 self
4846 }
4847
4848 /// Sets or clears the value of [watchlist][crate::model::UpdateWatchlistRequest::watchlist].
4849 ///
4850 /// # Example
4851 /// ```ignore,no_run
4852 /// # use google_cloud_chronicle_v1::model::UpdateWatchlistRequest;
4853 /// use google_cloud_chronicle_v1::model::Watchlist;
4854 /// let x = UpdateWatchlistRequest::new().set_or_clear_watchlist(Some(Watchlist::default()/* use setters */));
4855 /// let x = UpdateWatchlistRequest::new().set_or_clear_watchlist(None::<Watchlist>);
4856 /// ```
4857 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
4858 where
4859 T: std::convert::Into<crate::model::Watchlist>,
4860 {
4861 self.watchlist = v.map(|x| x.into());
4862 self
4863 }
4864
4865 /// Sets the value of [update_mask][crate::model::UpdateWatchlistRequest::update_mask].
4866 ///
4867 /// # Example
4868 /// ```ignore,no_run
4869 /// # use google_cloud_chronicle_v1::model::UpdateWatchlistRequest;
4870 /// use wkt::FieldMask;
4871 /// let x = UpdateWatchlistRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4872 /// ```
4873 pub fn set_update_mask<T>(mut self, v: T) -> Self
4874 where
4875 T: std::convert::Into<wkt::FieldMask>,
4876 {
4877 self.update_mask = std::option::Option::Some(v.into());
4878 self
4879 }
4880
4881 /// Sets or clears the value of [update_mask][crate::model::UpdateWatchlistRequest::update_mask].
4882 ///
4883 /// # Example
4884 /// ```ignore,no_run
4885 /// # use google_cloud_chronicle_v1::model::UpdateWatchlistRequest;
4886 /// use wkt::FieldMask;
4887 /// let x = UpdateWatchlistRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4888 /// let x = UpdateWatchlistRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4889 /// ```
4890 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4891 where
4892 T: std::convert::Into<wkt::FieldMask>,
4893 {
4894 self.update_mask = v.map(|x| x.into());
4895 self
4896 }
4897}
4898
4899impl wkt::message::Message for UpdateWatchlistRequest {
4900 fn typename() -> &'static str {
4901 "type.googleapis.com/google.cloud.chronicle.v1.UpdateWatchlistRequest"
4902 }
4903}
4904
4905/// Request message for deleting watchlist.
4906#[derive(Clone, Default, PartialEq)]
4907#[non_exhaustive]
4908pub struct DeleteWatchlistRequest {
4909 /// Required. The name of the watchlist to delete.
4910 /// Format:
4911 /// `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
4912 pub name: std::string::String,
4913
4914 /// Optional. If set to true, any entities under this watchlist will also be
4915 /// deleted. (Otherwise, the request will only work if the watchlist has no
4916 /// entities.)
4917 pub force: bool,
4918
4919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4920}
4921
4922impl DeleteWatchlistRequest {
4923 /// Creates a new default instance.
4924 pub fn new() -> Self {
4925 std::default::Default::default()
4926 }
4927
4928 /// Sets the value of [name][crate::model::DeleteWatchlistRequest::name].
4929 ///
4930 /// # Example
4931 /// ```ignore,no_run
4932 /// # use google_cloud_chronicle_v1::model::DeleteWatchlistRequest;
4933 /// let x = DeleteWatchlistRequest::new().set_name("example");
4934 /// ```
4935 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4936 self.name = v.into();
4937 self
4938 }
4939
4940 /// Sets the value of [force][crate::model::DeleteWatchlistRequest::force].
4941 ///
4942 /// # Example
4943 /// ```ignore,no_run
4944 /// # use google_cloud_chronicle_v1::model::DeleteWatchlistRequest;
4945 /// let x = DeleteWatchlistRequest::new().set_force(true);
4946 /// ```
4947 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4948 self.force = v.into();
4949 self
4950 }
4951}
4952
4953impl wkt::message::Message for DeleteWatchlistRequest {
4954 fn typename() -> &'static str {
4955 "type.googleapis.com/google.cloud.chronicle.v1.DeleteWatchlistRequest"
4956 }
4957}
4958
4959/// A Instance represents an instantiation of the Instance product.
4960#[derive(Clone, Default, PartialEq)]
4961#[non_exhaustive]
4962pub struct Instance {
4963 /// Identifier. The resource name of this instance.
4964 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
4965 pub name: std::string::String,
4966
4967 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4968}
4969
4970impl Instance {
4971 /// Creates a new default instance.
4972 pub fn new() -> Self {
4973 std::default::Default::default()
4974 }
4975
4976 /// Sets the value of [name][crate::model::Instance::name].
4977 ///
4978 /// # Example
4979 /// ```ignore,no_run
4980 /// # use google_cloud_chronicle_v1::model::Instance;
4981 /// let x = Instance::new().set_name("example");
4982 /// ```
4983 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4984 self.name = v.into();
4985 self
4986 }
4987}
4988
4989impl wkt::message::Message for Instance {
4990 fn typename() -> &'static str {
4991 "type.googleapis.com/google.cloud.chronicle.v1.Instance"
4992 }
4993}
4994
4995/// Request to get a Instance.
4996#[derive(Clone, Default, PartialEq)]
4997#[non_exhaustive]
4998pub struct GetInstanceRequest {
4999 /// Required. The name of the instance to retrieve.
5000 /// Format:
5001 /// `projects/{project_id}/locations/{location}/instances/{instance}`
5002 pub name: std::string::String,
5003
5004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5005}
5006
5007impl GetInstanceRequest {
5008 /// Creates a new default instance.
5009 pub fn new() -> Self {
5010 std::default::Default::default()
5011 }
5012
5013 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
5014 ///
5015 /// # Example
5016 /// ```ignore,no_run
5017 /// # use google_cloud_chronicle_v1::model::GetInstanceRequest;
5018 /// let x = GetInstanceRequest::new().set_name("example");
5019 /// ```
5020 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5021 self.name = v.into();
5022 self
5023 }
5024}
5025
5026impl wkt::message::Message for GetInstanceRequest {
5027 fn typename() -> &'static str {
5028 "type.googleapis.com/google.cloud.chronicle.v1.GetInstanceRequest"
5029 }
5030}
5031
5032/// ScopeInfo specifies the scope info of the reference list.
5033#[derive(Clone, Default, PartialEq)]
5034#[non_exhaustive]
5035pub struct ScopeInfo {
5036 /// Required. The list of scope names of the reference list, if the list is
5037 /// empty the reference list is treated as unscoped.
5038 pub reference_list_scope: std::option::Option<crate::model::ReferenceListScope>,
5039
5040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5041}
5042
5043impl ScopeInfo {
5044 /// Creates a new default instance.
5045 pub fn new() -> Self {
5046 std::default::Default::default()
5047 }
5048
5049 /// Sets the value of [reference_list_scope][crate::model::ScopeInfo::reference_list_scope].
5050 ///
5051 /// # Example
5052 /// ```ignore,no_run
5053 /// # use google_cloud_chronicle_v1::model::ScopeInfo;
5054 /// use google_cloud_chronicle_v1::model::ReferenceListScope;
5055 /// let x = ScopeInfo::new().set_reference_list_scope(ReferenceListScope::default()/* use setters */);
5056 /// ```
5057 pub fn set_reference_list_scope<T>(mut self, v: T) -> Self
5058 where
5059 T: std::convert::Into<crate::model::ReferenceListScope>,
5060 {
5061 self.reference_list_scope = std::option::Option::Some(v.into());
5062 self
5063 }
5064
5065 /// Sets or clears the value of [reference_list_scope][crate::model::ScopeInfo::reference_list_scope].
5066 ///
5067 /// # Example
5068 /// ```ignore,no_run
5069 /// # use google_cloud_chronicle_v1::model::ScopeInfo;
5070 /// use google_cloud_chronicle_v1::model::ReferenceListScope;
5071 /// let x = ScopeInfo::new().set_or_clear_reference_list_scope(Some(ReferenceListScope::default()/* use setters */));
5072 /// let x = ScopeInfo::new().set_or_clear_reference_list_scope(None::<ReferenceListScope>);
5073 /// ```
5074 pub fn set_or_clear_reference_list_scope<T>(mut self, v: std::option::Option<T>) -> Self
5075 where
5076 T: std::convert::Into<crate::model::ReferenceListScope>,
5077 {
5078 self.reference_list_scope = v.map(|x| x.into());
5079 self
5080 }
5081}
5082
5083impl wkt::message::Message for ScopeInfo {
5084 fn typename() -> &'static str {
5085 "type.googleapis.com/google.cloud.chronicle.v1.ScopeInfo"
5086 }
5087}
5088
5089/// ReferenceListScope specifies the list of scope names of the reference list.
5090#[derive(Clone, Default, PartialEq)]
5091#[non_exhaustive]
5092pub struct ReferenceListScope {
5093 /// Optional. The list of scope names of the reference list. The scope names
5094 /// should be full resource names and should be of the format:
5095 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{scope_name}`.
5096 pub scope_names: std::vec::Vec<std::string::String>,
5097
5098 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5099}
5100
5101impl ReferenceListScope {
5102 /// Creates a new default instance.
5103 pub fn new() -> Self {
5104 std::default::Default::default()
5105 }
5106
5107 /// Sets the value of [scope_names][crate::model::ReferenceListScope::scope_names].
5108 ///
5109 /// # Example
5110 /// ```ignore,no_run
5111 /// # use google_cloud_chronicle_v1::model::ReferenceListScope;
5112 /// let x = ReferenceListScope::new().set_scope_names(["a", "b", "c"]);
5113 /// ```
5114 pub fn set_scope_names<T, V>(mut self, v: T) -> Self
5115 where
5116 T: std::iter::IntoIterator<Item = V>,
5117 V: std::convert::Into<std::string::String>,
5118 {
5119 use std::iter::Iterator;
5120 self.scope_names = v.into_iter().map(|i| i.into()).collect();
5121 self
5122 }
5123}
5124
5125impl wkt::message::Message for ReferenceListScope {
5126 fn typename() -> &'static str {
5127 "type.googleapis.com/google.cloud.chronicle.v1.ReferenceListScope"
5128 }
5129}
5130
5131/// A request to get details about a reference list.
5132#[derive(Clone, Default, PartialEq)]
5133#[non_exhaustive]
5134pub struct GetReferenceListRequest {
5135 /// Required. The resource name of the reference list to retrieve.
5136 /// Format:
5137 /// `projects/{project}/locations/{locations}/instances/{instance}/referenceLists/{reference_list}`
5138 pub name: std::string::String,
5139
5140 /// How much of the ReferenceList to view. Defaults to
5141 /// REFERENCE_LIST_VIEW_FULL.
5142 pub view: crate::model::ReferenceListView,
5143
5144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5145}
5146
5147impl GetReferenceListRequest {
5148 /// Creates a new default instance.
5149 pub fn new() -> Self {
5150 std::default::Default::default()
5151 }
5152
5153 /// Sets the value of [name][crate::model::GetReferenceListRequest::name].
5154 ///
5155 /// # Example
5156 /// ```ignore,no_run
5157 /// # use google_cloud_chronicle_v1::model::GetReferenceListRequest;
5158 /// let x = GetReferenceListRequest::new().set_name("example");
5159 /// ```
5160 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5161 self.name = v.into();
5162 self
5163 }
5164
5165 /// Sets the value of [view][crate::model::GetReferenceListRequest::view].
5166 ///
5167 /// # Example
5168 /// ```ignore,no_run
5169 /// # use google_cloud_chronicle_v1::model::GetReferenceListRequest;
5170 /// use google_cloud_chronicle_v1::model::ReferenceListView;
5171 /// let x0 = GetReferenceListRequest::new().set_view(ReferenceListView::Basic);
5172 /// let x1 = GetReferenceListRequest::new().set_view(ReferenceListView::Full);
5173 /// ```
5174 pub fn set_view<T: std::convert::Into<crate::model::ReferenceListView>>(
5175 mut self,
5176 v: T,
5177 ) -> Self {
5178 self.view = v.into();
5179 self
5180 }
5181}
5182
5183impl wkt::message::Message for GetReferenceListRequest {
5184 fn typename() -> &'static str {
5185 "type.googleapis.com/google.cloud.chronicle.v1.GetReferenceListRequest"
5186 }
5187}
5188
5189/// A request for a list of reference lists.
5190#[derive(Clone, Default, PartialEq)]
5191#[non_exhaustive]
5192pub struct ListReferenceListsRequest {
5193 /// Required. The parent, which owns this collection of reference lists.
5194 /// Format:
5195 /// `projects/{project}/locations/{location}/instances/{instance}`
5196 pub parent: std::string::String,
5197
5198 /// The maximum number of reference lists to return.
5199 /// The service may return fewer than this value.
5200 /// If unspecified, at most 100 reference lists will be returned.
5201 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
5202 pub page_size: i32,
5203
5204 /// A page token, received from a previous `ListReferenceLists` call.
5205 /// Provide this to retrieve the subsequent page.
5206 /// When paginating, all other parameters provided to `ListReferenceLists` must
5207 /// match the call that provided the page token.
5208 pub page_token: std::string::String,
5209
5210 /// How much of each ReferenceList to view. Defaults to
5211 /// REFERENCE_LIST_VIEW_BASIC.
5212 pub view: crate::model::ReferenceListView,
5213
5214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5215}
5216
5217impl ListReferenceListsRequest {
5218 /// Creates a new default instance.
5219 pub fn new() -> Self {
5220 std::default::Default::default()
5221 }
5222
5223 /// Sets the value of [parent][crate::model::ListReferenceListsRequest::parent].
5224 ///
5225 /// # Example
5226 /// ```ignore,no_run
5227 /// # use google_cloud_chronicle_v1::model::ListReferenceListsRequest;
5228 /// let x = ListReferenceListsRequest::new().set_parent("example");
5229 /// ```
5230 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5231 self.parent = v.into();
5232 self
5233 }
5234
5235 /// Sets the value of [page_size][crate::model::ListReferenceListsRequest::page_size].
5236 ///
5237 /// # Example
5238 /// ```ignore,no_run
5239 /// # use google_cloud_chronicle_v1::model::ListReferenceListsRequest;
5240 /// let x = ListReferenceListsRequest::new().set_page_size(42);
5241 /// ```
5242 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5243 self.page_size = v.into();
5244 self
5245 }
5246
5247 /// Sets the value of [page_token][crate::model::ListReferenceListsRequest::page_token].
5248 ///
5249 /// # Example
5250 /// ```ignore,no_run
5251 /// # use google_cloud_chronicle_v1::model::ListReferenceListsRequest;
5252 /// let x = ListReferenceListsRequest::new().set_page_token("example");
5253 /// ```
5254 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5255 self.page_token = v.into();
5256 self
5257 }
5258
5259 /// Sets the value of [view][crate::model::ListReferenceListsRequest::view].
5260 ///
5261 /// # Example
5262 /// ```ignore,no_run
5263 /// # use google_cloud_chronicle_v1::model::ListReferenceListsRequest;
5264 /// use google_cloud_chronicle_v1::model::ReferenceListView;
5265 /// let x0 = ListReferenceListsRequest::new().set_view(ReferenceListView::Basic);
5266 /// let x1 = ListReferenceListsRequest::new().set_view(ReferenceListView::Full);
5267 /// ```
5268 pub fn set_view<T: std::convert::Into<crate::model::ReferenceListView>>(
5269 mut self,
5270 v: T,
5271 ) -> Self {
5272 self.view = v.into();
5273 self
5274 }
5275}
5276
5277impl wkt::message::Message for ListReferenceListsRequest {
5278 fn typename() -> &'static str {
5279 "type.googleapis.com/google.cloud.chronicle.v1.ListReferenceListsRequest"
5280 }
5281}
5282
5283/// A response to a request for a list of reference lists.
5284#[derive(Clone, Default, PartialEq)]
5285#[non_exhaustive]
5286pub struct ListReferenceListsResponse {
5287 /// The reference lists.
5288 /// Ordered in ascending alphabetical order by name.
5289 pub reference_lists: std::vec::Vec<crate::model::ReferenceList>,
5290
5291 /// A token, which can be sent as `page_token` to retrieve the next page.
5292 /// If this field is omitted, there are no subsequent pages.
5293 pub next_page_token: std::string::String,
5294
5295 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5296}
5297
5298impl ListReferenceListsResponse {
5299 /// Creates a new default instance.
5300 pub fn new() -> Self {
5301 std::default::Default::default()
5302 }
5303
5304 /// Sets the value of [reference_lists][crate::model::ListReferenceListsResponse::reference_lists].
5305 ///
5306 /// # Example
5307 /// ```ignore,no_run
5308 /// # use google_cloud_chronicle_v1::model::ListReferenceListsResponse;
5309 /// use google_cloud_chronicle_v1::model::ReferenceList;
5310 /// let x = ListReferenceListsResponse::new()
5311 /// .set_reference_lists([
5312 /// ReferenceList::default()/* use setters */,
5313 /// ReferenceList::default()/* use (different) setters */,
5314 /// ]);
5315 /// ```
5316 pub fn set_reference_lists<T, V>(mut self, v: T) -> Self
5317 where
5318 T: std::iter::IntoIterator<Item = V>,
5319 V: std::convert::Into<crate::model::ReferenceList>,
5320 {
5321 use std::iter::Iterator;
5322 self.reference_lists = v.into_iter().map(|i| i.into()).collect();
5323 self
5324 }
5325
5326 /// Sets the value of [next_page_token][crate::model::ListReferenceListsResponse::next_page_token].
5327 ///
5328 /// # Example
5329 /// ```ignore,no_run
5330 /// # use google_cloud_chronicle_v1::model::ListReferenceListsResponse;
5331 /// let x = ListReferenceListsResponse::new().set_next_page_token("example");
5332 /// ```
5333 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5334 self.next_page_token = v.into();
5335 self
5336 }
5337}
5338
5339impl wkt::message::Message for ListReferenceListsResponse {
5340 fn typename() -> &'static str {
5341 "type.googleapis.com/google.cloud.chronicle.v1.ListReferenceListsResponse"
5342 }
5343}
5344
5345#[doc(hidden)]
5346impl google_cloud_gax::paginator::internal::PageableResponse for ListReferenceListsResponse {
5347 type PageItem = crate::model::ReferenceList;
5348
5349 fn items(self) -> std::vec::Vec<Self::PageItem> {
5350 self.reference_lists
5351 }
5352
5353 fn next_page_token(&self) -> std::string::String {
5354 use std::clone::Clone;
5355 self.next_page_token.clone()
5356 }
5357}
5358
5359/// A request to create a reference list.
5360#[derive(Clone, Default, PartialEq)]
5361#[non_exhaustive]
5362pub struct CreateReferenceListRequest {
5363 /// Required. The parent resource where this reference list will be created.
5364 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
5365 pub parent: std::string::String,
5366
5367 /// Required. The reference list to create.
5368 pub reference_list: std::option::Option<crate::model::ReferenceList>,
5369
5370 /// Required. The ID to use for the reference list. This is also the display
5371 /// name for the reference list. It must satisfy the following requirements:
5372 ///
5373 /// - Starts with letter.
5374 /// - Contains only letters, numbers and underscore.
5375 /// - Has length less than 256.
5376 /// - Must be unique.
5377 pub reference_list_id: std::string::String,
5378
5379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5380}
5381
5382impl CreateReferenceListRequest {
5383 /// Creates a new default instance.
5384 pub fn new() -> Self {
5385 std::default::Default::default()
5386 }
5387
5388 /// Sets the value of [parent][crate::model::CreateReferenceListRequest::parent].
5389 ///
5390 /// # Example
5391 /// ```ignore,no_run
5392 /// # use google_cloud_chronicle_v1::model::CreateReferenceListRequest;
5393 /// let x = CreateReferenceListRequest::new().set_parent("example");
5394 /// ```
5395 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5396 self.parent = v.into();
5397 self
5398 }
5399
5400 /// Sets the value of [reference_list][crate::model::CreateReferenceListRequest::reference_list].
5401 ///
5402 /// # Example
5403 /// ```ignore,no_run
5404 /// # use google_cloud_chronicle_v1::model::CreateReferenceListRequest;
5405 /// use google_cloud_chronicle_v1::model::ReferenceList;
5406 /// let x = CreateReferenceListRequest::new().set_reference_list(ReferenceList::default()/* use setters */);
5407 /// ```
5408 pub fn set_reference_list<T>(mut self, v: T) -> Self
5409 where
5410 T: std::convert::Into<crate::model::ReferenceList>,
5411 {
5412 self.reference_list = std::option::Option::Some(v.into());
5413 self
5414 }
5415
5416 /// Sets or clears the value of [reference_list][crate::model::CreateReferenceListRequest::reference_list].
5417 ///
5418 /// # Example
5419 /// ```ignore,no_run
5420 /// # use google_cloud_chronicle_v1::model::CreateReferenceListRequest;
5421 /// use google_cloud_chronicle_v1::model::ReferenceList;
5422 /// let x = CreateReferenceListRequest::new().set_or_clear_reference_list(Some(ReferenceList::default()/* use setters */));
5423 /// let x = CreateReferenceListRequest::new().set_or_clear_reference_list(None::<ReferenceList>);
5424 /// ```
5425 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
5426 where
5427 T: std::convert::Into<crate::model::ReferenceList>,
5428 {
5429 self.reference_list = v.map(|x| x.into());
5430 self
5431 }
5432
5433 /// Sets the value of [reference_list_id][crate::model::CreateReferenceListRequest::reference_list_id].
5434 ///
5435 /// # Example
5436 /// ```ignore,no_run
5437 /// # use google_cloud_chronicle_v1::model::CreateReferenceListRequest;
5438 /// let x = CreateReferenceListRequest::new().set_reference_list_id("example");
5439 /// ```
5440 pub fn set_reference_list_id<T: std::convert::Into<std::string::String>>(
5441 mut self,
5442 v: T,
5443 ) -> Self {
5444 self.reference_list_id = v.into();
5445 self
5446 }
5447}
5448
5449impl wkt::message::Message for CreateReferenceListRequest {
5450 fn typename() -> &'static str {
5451 "type.googleapis.com/google.cloud.chronicle.v1.CreateReferenceListRequest"
5452 }
5453}
5454
5455/// A request to update a reference list.
5456#[derive(Clone, Default, PartialEq)]
5457#[non_exhaustive]
5458pub struct UpdateReferenceListRequest {
5459 /// Required. The reference list to update.
5460 ///
5461 /// The reference list's `name` field is used to identify the reference list to
5462 /// update.
5463 /// Format:
5464 /// `projects/{project}/locations/{locations}/instances/{instance}/referenceLists/{reference_list}`
5465 pub reference_list: std::option::Option<crate::model::ReferenceList>,
5466
5467 /// The list of fields to update.
5468 /// When no field mask is supplied, all non-empty fields will be updated.
5469 /// A field mask of "*" will update all fields, whether empty or not.
5470 pub update_mask: std::option::Option<wkt::FieldMask>,
5471
5472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5473}
5474
5475impl UpdateReferenceListRequest {
5476 /// Creates a new default instance.
5477 pub fn new() -> Self {
5478 std::default::Default::default()
5479 }
5480
5481 /// Sets the value of [reference_list][crate::model::UpdateReferenceListRequest::reference_list].
5482 ///
5483 /// # Example
5484 /// ```ignore,no_run
5485 /// # use google_cloud_chronicle_v1::model::UpdateReferenceListRequest;
5486 /// use google_cloud_chronicle_v1::model::ReferenceList;
5487 /// let x = UpdateReferenceListRequest::new().set_reference_list(ReferenceList::default()/* use setters */);
5488 /// ```
5489 pub fn set_reference_list<T>(mut self, v: T) -> Self
5490 where
5491 T: std::convert::Into<crate::model::ReferenceList>,
5492 {
5493 self.reference_list = std::option::Option::Some(v.into());
5494 self
5495 }
5496
5497 /// Sets or clears the value of [reference_list][crate::model::UpdateReferenceListRequest::reference_list].
5498 ///
5499 /// # Example
5500 /// ```ignore,no_run
5501 /// # use google_cloud_chronicle_v1::model::UpdateReferenceListRequest;
5502 /// use google_cloud_chronicle_v1::model::ReferenceList;
5503 /// let x = UpdateReferenceListRequest::new().set_or_clear_reference_list(Some(ReferenceList::default()/* use setters */));
5504 /// let x = UpdateReferenceListRequest::new().set_or_clear_reference_list(None::<ReferenceList>);
5505 /// ```
5506 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
5507 where
5508 T: std::convert::Into<crate::model::ReferenceList>,
5509 {
5510 self.reference_list = v.map(|x| x.into());
5511 self
5512 }
5513
5514 /// Sets the value of [update_mask][crate::model::UpdateReferenceListRequest::update_mask].
5515 ///
5516 /// # Example
5517 /// ```ignore,no_run
5518 /// # use google_cloud_chronicle_v1::model::UpdateReferenceListRequest;
5519 /// use wkt::FieldMask;
5520 /// let x = UpdateReferenceListRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5521 /// ```
5522 pub fn set_update_mask<T>(mut self, v: T) -> Self
5523 where
5524 T: std::convert::Into<wkt::FieldMask>,
5525 {
5526 self.update_mask = std::option::Option::Some(v.into());
5527 self
5528 }
5529
5530 /// Sets or clears the value of [update_mask][crate::model::UpdateReferenceListRequest::update_mask].
5531 ///
5532 /// # Example
5533 /// ```ignore,no_run
5534 /// # use google_cloud_chronicle_v1::model::UpdateReferenceListRequest;
5535 /// use wkt::FieldMask;
5536 /// let x = UpdateReferenceListRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5537 /// let x = UpdateReferenceListRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5538 /// ```
5539 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5540 where
5541 T: std::convert::Into<wkt::FieldMask>,
5542 {
5543 self.update_mask = v.map(|x| x.into());
5544 self
5545 }
5546}
5547
5548impl wkt::message::Message for UpdateReferenceListRequest {
5549 fn typename() -> &'static str {
5550 "type.googleapis.com/google.cloud.chronicle.v1.UpdateReferenceListRequest"
5551 }
5552}
5553
5554/// A reference list.
5555/// Reference lists are user-defined lists of values which users can
5556/// use in multiple Rules.
5557#[derive(Clone, Default, PartialEq)]
5558#[non_exhaustive]
5559pub struct ReferenceList {
5560 /// Identifier. The resource name of the reference list.
5561 /// Format:
5562 /// `projects/{project}/locations/{location}/instances/{instance}/referenceLists/{reference_list}`
5563 pub name: std::string::String,
5564
5565 /// Output only. The unique display name of the reference list.
5566 pub display_name: std::string::String,
5567
5568 /// Output only. The timestamp when the reference list was last updated.
5569 pub revision_create_time: std::option::Option<wkt::Timestamp>,
5570
5571 /// Required. A user-provided description of the reference list.
5572 pub description: std::string::String,
5573
5574 /// Required. The entries of the reference list.
5575 /// When listed, they are returned in the order that was specified at creation
5576 /// or update. The combined size of the values of the reference list may not
5577 /// exceed 6MB.
5578 /// This is returned only when the view is REFERENCE_LIST_VIEW_FULL.
5579 pub entries: std::vec::Vec<crate::model::ReferenceListEntry>,
5580
5581 /// Output only. The resource names for the associated self-authored Rules that
5582 /// use this reference list. This is returned only when the view is
5583 /// REFERENCE_LIST_VIEW_FULL.
5584 pub rules: std::vec::Vec<std::string::String>,
5585
5586 /// Required. The syntax type indicating how list entries should be validated.
5587 pub syntax_type: crate::model::ReferenceListSyntaxType,
5588
5589 /// Output only. The count of self-authored rules using the reference list.
5590 pub rule_associations_count: i32,
5591
5592 /// The scope info of the reference list.
5593 /// During reference list creation, if this field is not set, the reference
5594 /// list without scopes (an unscoped list) will be created for an unscoped
5595 /// user. For a scoped user, this field must be set. During reference list
5596 /// update, if scope_info is requested to be updated, this field must be set.
5597 pub scope_info: std::option::Option<crate::model::ScopeInfo>,
5598
5599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5600}
5601
5602impl ReferenceList {
5603 /// Creates a new default instance.
5604 pub fn new() -> Self {
5605 std::default::Default::default()
5606 }
5607
5608 /// Sets the value of [name][crate::model::ReferenceList::name].
5609 ///
5610 /// # Example
5611 /// ```ignore,no_run
5612 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5613 /// let x = ReferenceList::new().set_name("example");
5614 /// ```
5615 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5616 self.name = v.into();
5617 self
5618 }
5619
5620 /// Sets the value of [display_name][crate::model::ReferenceList::display_name].
5621 ///
5622 /// # Example
5623 /// ```ignore,no_run
5624 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5625 /// let x = ReferenceList::new().set_display_name("example");
5626 /// ```
5627 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5628 self.display_name = v.into();
5629 self
5630 }
5631
5632 /// Sets the value of [revision_create_time][crate::model::ReferenceList::revision_create_time].
5633 ///
5634 /// # Example
5635 /// ```ignore,no_run
5636 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5637 /// use wkt::Timestamp;
5638 /// let x = ReferenceList::new().set_revision_create_time(Timestamp::default()/* use setters */);
5639 /// ```
5640 pub fn set_revision_create_time<T>(mut self, v: T) -> Self
5641 where
5642 T: std::convert::Into<wkt::Timestamp>,
5643 {
5644 self.revision_create_time = std::option::Option::Some(v.into());
5645 self
5646 }
5647
5648 /// Sets or clears the value of [revision_create_time][crate::model::ReferenceList::revision_create_time].
5649 ///
5650 /// # Example
5651 /// ```ignore,no_run
5652 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5653 /// use wkt::Timestamp;
5654 /// let x = ReferenceList::new().set_or_clear_revision_create_time(Some(Timestamp::default()/* use setters */));
5655 /// let x = ReferenceList::new().set_or_clear_revision_create_time(None::<Timestamp>);
5656 /// ```
5657 pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5658 where
5659 T: std::convert::Into<wkt::Timestamp>,
5660 {
5661 self.revision_create_time = v.map(|x| x.into());
5662 self
5663 }
5664
5665 /// Sets the value of [description][crate::model::ReferenceList::description].
5666 ///
5667 /// # Example
5668 /// ```ignore,no_run
5669 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5670 /// let x = ReferenceList::new().set_description("example");
5671 /// ```
5672 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5673 self.description = v.into();
5674 self
5675 }
5676
5677 /// Sets the value of [entries][crate::model::ReferenceList::entries].
5678 ///
5679 /// # Example
5680 /// ```ignore,no_run
5681 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5682 /// use google_cloud_chronicle_v1::model::ReferenceListEntry;
5683 /// let x = ReferenceList::new()
5684 /// .set_entries([
5685 /// ReferenceListEntry::default()/* use setters */,
5686 /// ReferenceListEntry::default()/* use (different) setters */,
5687 /// ]);
5688 /// ```
5689 pub fn set_entries<T, V>(mut self, v: T) -> Self
5690 where
5691 T: std::iter::IntoIterator<Item = V>,
5692 V: std::convert::Into<crate::model::ReferenceListEntry>,
5693 {
5694 use std::iter::Iterator;
5695 self.entries = v.into_iter().map(|i| i.into()).collect();
5696 self
5697 }
5698
5699 /// Sets the value of [rules][crate::model::ReferenceList::rules].
5700 ///
5701 /// # Example
5702 /// ```ignore,no_run
5703 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5704 /// let x = ReferenceList::new().set_rules(["a", "b", "c"]);
5705 /// ```
5706 pub fn set_rules<T, V>(mut self, v: T) -> Self
5707 where
5708 T: std::iter::IntoIterator<Item = V>,
5709 V: std::convert::Into<std::string::String>,
5710 {
5711 use std::iter::Iterator;
5712 self.rules = v.into_iter().map(|i| i.into()).collect();
5713 self
5714 }
5715
5716 /// Sets the value of [syntax_type][crate::model::ReferenceList::syntax_type].
5717 ///
5718 /// # Example
5719 /// ```ignore,no_run
5720 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5721 /// use google_cloud_chronicle_v1::model::ReferenceListSyntaxType;
5722 /// let x0 = ReferenceList::new().set_syntax_type(ReferenceListSyntaxType::PlainTextString);
5723 /// let x1 = ReferenceList::new().set_syntax_type(ReferenceListSyntaxType::Regex);
5724 /// let x2 = ReferenceList::new().set_syntax_type(ReferenceListSyntaxType::Cidr);
5725 /// ```
5726 pub fn set_syntax_type<T: std::convert::Into<crate::model::ReferenceListSyntaxType>>(
5727 mut self,
5728 v: T,
5729 ) -> Self {
5730 self.syntax_type = v.into();
5731 self
5732 }
5733
5734 /// Sets the value of [rule_associations_count][crate::model::ReferenceList::rule_associations_count].
5735 ///
5736 /// # Example
5737 /// ```ignore,no_run
5738 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5739 /// let x = ReferenceList::new().set_rule_associations_count(42);
5740 /// ```
5741 pub fn set_rule_associations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5742 self.rule_associations_count = v.into();
5743 self
5744 }
5745
5746 /// Sets the value of [scope_info][crate::model::ReferenceList::scope_info].
5747 ///
5748 /// # Example
5749 /// ```ignore,no_run
5750 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5751 /// use google_cloud_chronicle_v1::model::ScopeInfo;
5752 /// let x = ReferenceList::new().set_scope_info(ScopeInfo::default()/* use setters */);
5753 /// ```
5754 pub fn set_scope_info<T>(mut self, v: T) -> Self
5755 where
5756 T: std::convert::Into<crate::model::ScopeInfo>,
5757 {
5758 self.scope_info = std::option::Option::Some(v.into());
5759 self
5760 }
5761
5762 /// Sets or clears the value of [scope_info][crate::model::ReferenceList::scope_info].
5763 ///
5764 /// # Example
5765 /// ```ignore,no_run
5766 /// # use google_cloud_chronicle_v1::model::ReferenceList;
5767 /// use google_cloud_chronicle_v1::model::ScopeInfo;
5768 /// let x = ReferenceList::new().set_or_clear_scope_info(Some(ScopeInfo::default()/* use setters */));
5769 /// let x = ReferenceList::new().set_or_clear_scope_info(None::<ScopeInfo>);
5770 /// ```
5771 pub fn set_or_clear_scope_info<T>(mut self, v: std::option::Option<T>) -> Self
5772 where
5773 T: std::convert::Into<crate::model::ScopeInfo>,
5774 {
5775 self.scope_info = v.map(|x| x.into());
5776 self
5777 }
5778}
5779
5780impl wkt::message::Message for ReferenceList {
5781 fn typename() -> &'static str {
5782 "type.googleapis.com/google.cloud.chronicle.v1.ReferenceList"
5783 }
5784}
5785
5786/// An entry in a reference list.
5787#[derive(Clone, Default, PartialEq)]
5788#[non_exhaustive]
5789pub struct ReferenceListEntry {
5790 /// Required. The value of the entry. Maximum length is 512 characters.
5791 pub value: std::string::String,
5792
5793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5794}
5795
5796impl ReferenceListEntry {
5797 /// Creates a new default instance.
5798 pub fn new() -> Self {
5799 std::default::Default::default()
5800 }
5801
5802 /// Sets the value of [value][crate::model::ReferenceListEntry::value].
5803 ///
5804 /// # Example
5805 /// ```ignore,no_run
5806 /// # use google_cloud_chronicle_v1::model::ReferenceListEntry;
5807 /// let x = ReferenceListEntry::new().set_value("example");
5808 /// ```
5809 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5810 self.value = v.into();
5811 self
5812 }
5813}
5814
5815impl wkt::message::Message for ReferenceListEntry {
5816 fn typename() -> &'static str {
5817 "type.googleapis.com/google.cloud.chronicle.v1.ReferenceListEntry"
5818 }
5819}
5820
5821/// The Rule resource represents a user-created rule.
5822/// NEXT TAG: 21
5823#[derive(Clone, Default, PartialEq)]
5824#[non_exhaustive]
5825pub struct Rule {
5826 /// Identifier. Full resource name for the rule.
5827 /// Format:
5828 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
5829 pub name: std::string::String,
5830
5831 /// Output only. The revision ID of the rule.
5832 /// A new revision is created whenever the rule text is changed in any way.
5833 /// Format: `v_{10 digits}_{9 digits}`
5834 /// Populated in REVISION_METADATA_ONLY view and FULL view.
5835 pub revision_id: std::string::String,
5836
5837 /// Output only. Display name of the rule.
5838 /// Populated in BASIC view and FULL view.
5839 pub display_name: std::string::String,
5840
5841 /// The YARA-L content of the rule.
5842 /// Populated in FULL view.
5843 pub text: std::string::String,
5844
5845 /// Output only. The author of the rule. Extracted from the meta section of
5846 /// text. Populated in BASIC view and FULL view.
5847 pub author: std::string::String,
5848
5849 /// Output only. The severity of the rule as specified in the meta section of
5850 /// text. Populated in BASIC view and FULL view.
5851 pub severity: std::option::Option<crate::model::Severity>,
5852
5853 /// Output only. Additional metadata specified in the meta section of text.
5854 /// Populated in FULL view.
5855 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
5856
5857 /// Output only. The timestamp of when the rule was created.
5858 /// Populated in FULL view.
5859 pub create_time: std::option::Option<wkt::Timestamp>,
5860
5861 /// Output only. The timestamp of when the rule revision was created.
5862 /// Populated in FULL, REVISION_METADATA_ONLY views.
5863 pub revision_create_time: std::option::Option<wkt::Timestamp>,
5864
5865 /// Output only. The current compilation state of the rule.
5866 /// Populated in FULL view.
5867 pub compilation_state: crate::model::rule::CompilationState,
5868
5869 /// Output only. User-facing type of the rule. Extracted from the events
5870 /// section of rule text. Populated in BASIC view and FULL view.
5871 pub r#type: crate::model::RuleType,
5872
5873 /// Output only. Resource names of the reference lists used in this rule.
5874 /// Populated in FULL view.
5875 pub reference_lists: std::vec::Vec<std::string::String>,
5876
5877 /// Output only. The run frequencies that are allowed for the rule.
5878 /// Populated in BASIC view and FULL view.
5879 pub allowed_run_frequencies: std::vec::Vec<crate::model::RunFrequency>,
5880
5881 /// The etag for this rule.
5882 /// If this is provided on update, the request will succeed if and only if it
5883 /// matches the server-computed value, and will fail with an ABORTED error
5884 /// otherwise.
5885 /// Populated in BASIC view and FULL view.
5886 pub etag: std::string::String,
5887
5888 /// Resource name of the DataAccessScope bound to this rule.
5889 /// Populated in BASIC view and FULL view.
5890 /// If reference lists are used in the rule, validations will be performed
5891 /// against this scope to ensure that the reference lists are compatible with
5892 /// both the user's and the rule's scopes.
5893 /// The scope should be in the format:
5894 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{scope}`.
5895 pub scope: std::string::String,
5896
5897 /// Output only. A list of a rule's corresponding compilation diagnostic
5898 /// messages such as compilation errors and compilation warnings. Populated in
5899 /// FULL view.
5900 pub compilation_diagnostics: std::vec::Vec<crate::model::CompilationDiagnostic>,
5901
5902 /// Output only. Indicate the rule can run in near real time live rule.
5903 /// If this is true, the rule uses the near real time live rule when the run
5904 /// frequency is set to LIVE.
5905 pub near_real_time_live_rule_eligible: bool,
5906
5907 /// Output only. The set of inputs used in the rule. For example, if the rule
5908 /// uses $e.principal.hostname, then the uses_udm field will be true.
5909 pub inputs_used: std::option::Option<crate::model::InputsUsed>,
5910
5911 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5912}
5913
5914impl Rule {
5915 /// Creates a new default instance.
5916 pub fn new() -> Self {
5917 std::default::Default::default()
5918 }
5919
5920 /// Sets the value of [name][crate::model::Rule::name].
5921 ///
5922 /// # Example
5923 /// ```ignore,no_run
5924 /// # use google_cloud_chronicle_v1::model::Rule;
5925 /// let x = Rule::new().set_name("example");
5926 /// ```
5927 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5928 self.name = v.into();
5929 self
5930 }
5931
5932 /// Sets the value of [revision_id][crate::model::Rule::revision_id].
5933 ///
5934 /// # Example
5935 /// ```ignore,no_run
5936 /// # use google_cloud_chronicle_v1::model::Rule;
5937 /// let x = Rule::new().set_revision_id("example");
5938 /// ```
5939 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5940 self.revision_id = v.into();
5941 self
5942 }
5943
5944 /// Sets the value of [display_name][crate::model::Rule::display_name].
5945 ///
5946 /// # Example
5947 /// ```ignore,no_run
5948 /// # use google_cloud_chronicle_v1::model::Rule;
5949 /// let x = Rule::new().set_display_name("example");
5950 /// ```
5951 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5952 self.display_name = v.into();
5953 self
5954 }
5955
5956 /// Sets the value of [text][crate::model::Rule::text].
5957 ///
5958 /// # Example
5959 /// ```ignore,no_run
5960 /// # use google_cloud_chronicle_v1::model::Rule;
5961 /// let x = Rule::new().set_text("example");
5962 /// ```
5963 pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5964 self.text = v.into();
5965 self
5966 }
5967
5968 /// Sets the value of [author][crate::model::Rule::author].
5969 ///
5970 /// # Example
5971 /// ```ignore,no_run
5972 /// # use google_cloud_chronicle_v1::model::Rule;
5973 /// let x = Rule::new().set_author("example");
5974 /// ```
5975 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5976 self.author = v.into();
5977 self
5978 }
5979
5980 /// Sets the value of [severity][crate::model::Rule::severity].
5981 ///
5982 /// # Example
5983 /// ```ignore,no_run
5984 /// # use google_cloud_chronicle_v1::model::Rule;
5985 /// use google_cloud_chronicle_v1::model::Severity;
5986 /// let x = Rule::new().set_severity(Severity::default()/* use setters */);
5987 /// ```
5988 pub fn set_severity<T>(mut self, v: T) -> Self
5989 where
5990 T: std::convert::Into<crate::model::Severity>,
5991 {
5992 self.severity = std::option::Option::Some(v.into());
5993 self
5994 }
5995
5996 /// Sets or clears the value of [severity][crate::model::Rule::severity].
5997 ///
5998 /// # Example
5999 /// ```ignore,no_run
6000 /// # use google_cloud_chronicle_v1::model::Rule;
6001 /// use google_cloud_chronicle_v1::model::Severity;
6002 /// let x = Rule::new().set_or_clear_severity(Some(Severity::default()/* use setters */));
6003 /// let x = Rule::new().set_or_clear_severity(None::<Severity>);
6004 /// ```
6005 pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
6006 where
6007 T: std::convert::Into<crate::model::Severity>,
6008 {
6009 self.severity = v.map(|x| x.into());
6010 self
6011 }
6012
6013 /// Sets the value of [metadata][crate::model::Rule::metadata].
6014 ///
6015 /// # Example
6016 /// ```ignore,no_run
6017 /// # use google_cloud_chronicle_v1::model::Rule;
6018 /// let x = Rule::new().set_metadata([
6019 /// ("key0", "abc"),
6020 /// ("key1", "xyz"),
6021 /// ]);
6022 /// ```
6023 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
6024 where
6025 T: std::iter::IntoIterator<Item = (K, V)>,
6026 K: std::convert::Into<std::string::String>,
6027 V: std::convert::Into<std::string::String>,
6028 {
6029 use std::iter::Iterator;
6030 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6031 self
6032 }
6033
6034 /// Sets the value of [create_time][crate::model::Rule::create_time].
6035 ///
6036 /// # Example
6037 /// ```ignore,no_run
6038 /// # use google_cloud_chronicle_v1::model::Rule;
6039 /// use wkt::Timestamp;
6040 /// let x = Rule::new().set_create_time(Timestamp::default()/* use setters */);
6041 /// ```
6042 pub fn set_create_time<T>(mut self, v: T) -> Self
6043 where
6044 T: std::convert::Into<wkt::Timestamp>,
6045 {
6046 self.create_time = std::option::Option::Some(v.into());
6047 self
6048 }
6049
6050 /// Sets or clears the value of [create_time][crate::model::Rule::create_time].
6051 ///
6052 /// # Example
6053 /// ```ignore,no_run
6054 /// # use google_cloud_chronicle_v1::model::Rule;
6055 /// use wkt::Timestamp;
6056 /// let x = Rule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6057 /// let x = Rule::new().set_or_clear_create_time(None::<Timestamp>);
6058 /// ```
6059 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6060 where
6061 T: std::convert::Into<wkt::Timestamp>,
6062 {
6063 self.create_time = v.map(|x| x.into());
6064 self
6065 }
6066
6067 /// Sets the value of [revision_create_time][crate::model::Rule::revision_create_time].
6068 ///
6069 /// # Example
6070 /// ```ignore,no_run
6071 /// # use google_cloud_chronicle_v1::model::Rule;
6072 /// use wkt::Timestamp;
6073 /// let x = Rule::new().set_revision_create_time(Timestamp::default()/* use setters */);
6074 /// ```
6075 pub fn set_revision_create_time<T>(mut self, v: T) -> Self
6076 where
6077 T: std::convert::Into<wkt::Timestamp>,
6078 {
6079 self.revision_create_time = std::option::Option::Some(v.into());
6080 self
6081 }
6082
6083 /// Sets or clears the value of [revision_create_time][crate::model::Rule::revision_create_time].
6084 ///
6085 /// # Example
6086 /// ```ignore,no_run
6087 /// # use google_cloud_chronicle_v1::model::Rule;
6088 /// use wkt::Timestamp;
6089 /// let x = Rule::new().set_or_clear_revision_create_time(Some(Timestamp::default()/* use setters */));
6090 /// let x = Rule::new().set_or_clear_revision_create_time(None::<Timestamp>);
6091 /// ```
6092 pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6093 where
6094 T: std::convert::Into<wkt::Timestamp>,
6095 {
6096 self.revision_create_time = v.map(|x| x.into());
6097 self
6098 }
6099
6100 /// Sets the value of [compilation_state][crate::model::Rule::compilation_state].
6101 ///
6102 /// # Example
6103 /// ```ignore,no_run
6104 /// # use google_cloud_chronicle_v1::model::Rule;
6105 /// use google_cloud_chronicle_v1::model::rule::CompilationState;
6106 /// let x0 = Rule::new().set_compilation_state(CompilationState::Succeeded);
6107 /// let x1 = Rule::new().set_compilation_state(CompilationState::Failed);
6108 /// ```
6109 pub fn set_compilation_state<T: std::convert::Into<crate::model::rule::CompilationState>>(
6110 mut self,
6111 v: T,
6112 ) -> Self {
6113 self.compilation_state = v.into();
6114 self
6115 }
6116
6117 /// Sets the value of [r#type][crate::model::Rule::type].
6118 ///
6119 /// # Example
6120 /// ```ignore,no_run
6121 /// # use google_cloud_chronicle_v1::model::Rule;
6122 /// use google_cloud_chronicle_v1::model::RuleType;
6123 /// let x0 = Rule::new().set_type(RuleType::SingleEvent);
6124 /// let x1 = Rule::new().set_type(RuleType::MultiEvent);
6125 /// ```
6126 pub fn set_type<T: std::convert::Into<crate::model::RuleType>>(mut self, v: T) -> Self {
6127 self.r#type = v.into();
6128 self
6129 }
6130
6131 /// Sets the value of [reference_lists][crate::model::Rule::reference_lists].
6132 ///
6133 /// # Example
6134 /// ```ignore,no_run
6135 /// # use google_cloud_chronicle_v1::model::Rule;
6136 /// let x = Rule::new().set_reference_lists(["a", "b", "c"]);
6137 /// ```
6138 pub fn set_reference_lists<T, V>(mut self, v: T) -> Self
6139 where
6140 T: std::iter::IntoIterator<Item = V>,
6141 V: std::convert::Into<std::string::String>,
6142 {
6143 use std::iter::Iterator;
6144 self.reference_lists = v.into_iter().map(|i| i.into()).collect();
6145 self
6146 }
6147
6148 /// Sets the value of [allowed_run_frequencies][crate::model::Rule::allowed_run_frequencies].
6149 ///
6150 /// # Example
6151 /// ```ignore,no_run
6152 /// # use google_cloud_chronicle_v1::model::Rule;
6153 /// use google_cloud_chronicle_v1::model::RunFrequency;
6154 /// let x = Rule::new().set_allowed_run_frequencies([
6155 /// RunFrequency::Live,
6156 /// RunFrequency::Hourly,
6157 /// RunFrequency::Daily,
6158 /// ]);
6159 /// ```
6160 pub fn set_allowed_run_frequencies<T, V>(mut self, v: T) -> Self
6161 where
6162 T: std::iter::IntoIterator<Item = V>,
6163 V: std::convert::Into<crate::model::RunFrequency>,
6164 {
6165 use std::iter::Iterator;
6166 self.allowed_run_frequencies = v.into_iter().map(|i| i.into()).collect();
6167 self
6168 }
6169
6170 /// Sets the value of [etag][crate::model::Rule::etag].
6171 ///
6172 /// # Example
6173 /// ```ignore,no_run
6174 /// # use google_cloud_chronicle_v1::model::Rule;
6175 /// let x = Rule::new().set_etag("example");
6176 /// ```
6177 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6178 self.etag = v.into();
6179 self
6180 }
6181
6182 /// Sets the value of [scope][crate::model::Rule::scope].
6183 ///
6184 /// # Example
6185 /// ```ignore,no_run
6186 /// # use google_cloud_chronicle_v1::model::Rule;
6187 /// let x = Rule::new().set_scope("example");
6188 /// ```
6189 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6190 self.scope = v.into();
6191 self
6192 }
6193
6194 /// Sets the value of [compilation_diagnostics][crate::model::Rule::compilation_diagnostics].
6195 ///
6196 /// # Example
6197 /// ```ignore,no_run
6198 /// # use google_cloud_chronicle_v1::model::Rule;
6199 /// use google_cloud_chronicle_v1::model::CompilationDiagnostic;
6200 /// let x = Rule::new()
6201 /// .set_compilation_diagnostics([
6202 /// CompilationDiagnostic::default()/* use setters */,
6203 /// CompilationDiagnostic::default()/* use (different) setters */,
6204 /// ]);
6205 /// ```
6206 pub fn set_compilation_diagnostics<T, V>(mut self, v: T) -> Self
6207 where
6208 T: std::iter::IntoIterator<Item = V>,
6209 V: std::convert::Into<crate::model::CompilationDiagnostic>,
6210 {
6211 use std::iter::Iterator;
6212 self.compilation_diagnostics = v.into_iter().map(|i| i.into()).collect();
6213 self
6214 }
6215
6216 /// Sets the value of [near_real_time_live_rule_eligible][crate::model::Rule::near_real_time_live_rule_eligible].
6217 ///
6218 /// # Example
6219 /// ```ignore,no_run
6220 /// # use google_cloud_chronicle_v1::model::Rule;
6221 /// let x = Rule::new().set_near_real_time_live_rule_eligible(true);
6222 /// ```
6223 pub fn set_near_real_time_live_rule_eligible<T: std::convert::Into<bool>>(
6224 mut self,
6225 v: T,
6226 ) -> Self {
6227 self.near_real_time_live_rule_eligible = v.into();
6228 self
6229 }
6230
6231 /// Sets the value of [inputs_used][crate::model::Rule::inputs_used].
6232 ///
6233 /// # Example
6234 /// ```ignore,no_run
6235 /// # use google_cloud_chronicle_v1::model::Rule;
6236 /// use google_cloud_chronicle_v1::model::InputsUsed;
6237 /// let x = Rule::new().set_inputs_used(InputsUsed::default()/* use setters */);
6238 /// ```
6239 pub fn set_inputs_used<T>(mut self, v: T) -> Self
6240 where
6241 T: std::convert::Into<crate::model::InputsUsed>,
6242 {
6243 self.inputs_used = std::option::Option::Some(v.into());
6244 self
6245 }
6246
6247 /// Sets or clears the value of [inputs_used][crate::model::Rule::inputs_used].
6248 ///
6249 /// # Example
6250 /// ```ignore,no_run
6251 /// # use google_cloud_chronicle_v1::model::Rule;
6252 /// use google_cloud_chronicle_v1::model::InputsUsed;
6253 /// let x = Rule::new().set_or_clear_inputs_used(Some(InputsUsed::default()/* use setters */));
6254 /// let x = Rule::new().set_or_clear_inputs_used(None::<InputsUsed>);
6255 /// ```
6256 pub fn set_or_clear_inputs_used<T>(mut self, v: std::option::Option<T>) -> Self
6257 where
6258 T: std::convert::Into<crate::model::InputsUsed>,
6259 {
6260 self.inputs_used = v.map(|x| x.into());
6261 self
6262 }
6263}
6264
6265impl wkt::message::Message for Rule {
6266 fn typename() -> &'static str {
6267 "type.googleapis.com/google.cloud.chronicle.v1.Rule"
6268 }
6269}
6270
6271/// Defines additional types related to [Rule].
6272pub mod rule {
6273 #[allow(unused_imports)]
6274 use super::*;
6275
6276 /// The current compilation state of the rule.
6277 ///
6278 /// # Working with unknown values
6279 ///
6280 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6281 /// additional enum variants at any time. Adding new variants is not considered
6282 /// a breaking change. Applications should write their code in anticipation of:
6283 ///
6284 /// - New values appearing in future releases of the client library, **and**
6285 /// - New values received dynamically, without application changes.
6286 ///
6287 /// Please consult the [Working with enums] section in the user guide for some
6288 /// guidelines.
6289 ///
6290 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6291 #[derive(Clone, Debug, PartialEq)]
6292 #[non_exhaustive]
6293 pub enum CompilationState {
6294 /// The compilation state is unspecified/unknown.
6295 Unspecified,
6296 /// The Rule can successfully compile.
6297 Succeeded,
6298 /// The Rule cannot successfully compile.
6299 /// This is possible if a backwards-incompatible change was made to the
6300 /// compiler.
6301 Failed,
6302 /// If set, the enum was initialized with an unknown value.
6303 ///
6304 /// Applications can examine the value using [CompilationState::value] or
6305 /// [CompilationState::name].
6306 UnknownValue(compilation_state::UnknownValue),
6307 }
6308
6309 #[doc(hidden)]
6310 pub mod compilation_state {
6311 #[allow(unused_imports)]
6312 use super::*;
6313 #[derive(Clone, Debug, PartialEq)]
6314 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6315 }
6316
6317 impl CompilationState {
6318 /// Gets the enum value.
6319 ///
6320 /// Returns `None` if the enum contains an unknown value deserialized from
6321 /// the string representation of enums.
6322 pub fn value(&self) -> std::option::Option<i32> {
6323 match self {
6324 Self::Unspecified => std::option::Option::Some(0),
6325 Self::Succeeded => std::option::Option::Some(1),
6326 Self::Failed => std::option::Option::Some(2),
6327 Self::UnknownValue(u) => u.0.value(),
6328 }
6329 }
6330
6331 /// Gets the enum value as a string.
6332 ///
6333 /// Returns `None` if the enum contains an unknown value deserialized from
6334 /// the integer representation of enums.
6335 pub fn name(&self) -> std::option::Option<&str> {
6336 match self {
6337 Self::Unspecified => std::option::Option::Some("COMPILATION_STATE_UNSPECIFIED"),
6338 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
6339 Self::Failed => std::option::Option::Some("FAILED"),
6340 Self::UnknownValue(u) => u.0.name(),
6341 }
6342 }
6343 }
6344
6345 impl std::default::Default for CompilationState {
6346 fn default() -> Self {
6347 use std::convert::From;
6348 Self::from(0)
6349 }
6350 }
6351
6352 impl std::fmt::Display for CompilationState {
6353 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6354 wkt::internal::display_enum(f, self.name(), self.value())
6355 }
6356 }
6357
6358 impl std::convert::From<i32> for CompilationState {
6359 fn from(value: i32) -> Self {
6360 match value {
6361 0 => Self::Unspecified,
6362 1 => Self::Succeeded,
6363 2 => Self::Failed,
6364 _ => Self::UnknownValue(compilation_state::UnknownValue(
6365 wkt::internal::UnknownEnumValue::Integer(value),
6366 )),
6367 }
6368 }
6369 }
6370
6371 impl std::convert::From<&str> for CompilationState {
6372 fn from(value: &str) -> Self {
6373 use std::string::ToString;
6374 match value {
6375 "COMPILATION_STATE_UNSPECIFIED" => Self::Unspecified,
6376 "SUCCEEDED" => Self::Succeeded,
6377 "FAILED" => Self::Failed,
6378 _ => Self::UnknownValue(compilation_state::UnknownValue(
6379 wkt::internal::UnknownEnumValue::String(value.to_string()),
6380 )),
6381 }
6382 }
6383 }
6384
6385 impl serde::ser::Serialize for CompilationState {
6386 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6387 where
6388 S: serde::Serializer,
6389 {
6390 match self {
6391 Self::Unspecified => serializer.serialize_i32(0),
6392 Self::Succeeded => serializer.serialize_i32(1),
6393 Self::Failed => serializer.serialize_i32(2),
6394 Self::UnknownValue(u) => u.0.serialize(serializer),
6395 }
6396 }
6397 }
6398
6399 impl<'de> serde::de::Deserialize<'de> for CompilationState {
6400 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6401 where
6402 D: serde::Deserializer<'de>,
6403 {
6404 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CompilationState>::new(
6405 ".google.cloud.chronicle.v1.Rule.CompilationState",
6406 ))
6407 }
6408 }
6409}
6410
6411/// The RuleDeployment resource represents the deployment state of a Rule.
6412#[derive(Clone, Default, PartialEq)]
6413#[non_exhaustive]
6414pub struct RuleDeployment {
6415 /// Required. The resource name of the rule deployment.
6416 /// Note that RuleDeployment is a child of the overall Rule, not any individual
6417 /// revision, so the resource ID segment for the Rule resource must not
6418 /// reference a specific revision.
6419 /// Format:
6420 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/deployment`
6421 pub name: std::string::String,
6422
6423 /// Whether the rule is currently deployed continuously against incoming data.
6424 pub enabled: bool,
6425
6426 /// Whether detections resulting from this deployment should be considered
6427 /// alerts.
6428 pub alerting: bool,
6429
6430 /// The archive state of the rule deployment.
6431 /// Cannot be set to true unless enabled is set to false.
6432 /// If set to true, alerting will automatically be set to false.
6433 /// If currently set to true, enabled, alerting, and run_frequency cannot be
6434 /// updated.
6435 pub archived: bool,
6436
6437 /// Output only. The timestamp when the rule deployment archive state was last
6438 /// set to true. If the rule deployment's current archive state is not set to
6439 /// true, the field will be empty.
6440 pub archive_time: std::option::Option<wkt::Timestamp>,
6441
6442 /// The run frequency of the rule deployment.
6443 pub run_frequency: crate::model::RunFrequency,
6444
6445 /// Output only. The execution state of the rule deployment.
6446 pub execution_state: crate::model::rule_deployment::ExecutionState,
6447
6448 /// Output only. The names of the associated/chained producer rules. Rules are
6449 /// considered producers for this rule if this rule explicitly filters on their
6450 /// ruleid. Format:
6451 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
6452 pub producer_rules: std::vec::Vec<std::string::String>,
6453
6454 /// Output only. The names of the associated/chained consumer rules. Rules are
6455 /// considered consumers of this rule if their rule text explicitly filters on
6456 /// this rule's ruleid. Format:
6457 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
6458 pub consumer_rules: std::vec::Vec<std::string::String>,
6459
6460 /// Output only. The timestamp when the rule deployment alert state was lastly
6461 /// changed. This is filled regardless of the current alert state. E.g. if the
6462 /// current alert status is false, this timestamp will be the timestamp when
6463 /// the alert status was changed to false.
6464 pub last_alert_status_change_time: std::option::Option<wkt::Timestamp>,
6465
6466 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6467}
6468
6469impl RuleDeployment {
6470 /// Creates a new default instance.
6471 pub fn new() -> Self {
6472 std::default::Default::default()
6473 }
6474
6475 /// Sets the value of [name][crate::model::RuleDeployment::name].
6476 ///
6477 /// # Example
6478 /// ```ignore,no_run
6479 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6480 /// let x = RuleDeployment::new().set_name("example");
6481 /// ```
6482 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6483 self.name = v.into();
6484 self
6485 }
6486
6487 /// Sets the value of [enabled][crate::model::RuleDeployment::enabled].
6488 ///
6489 /// # Example
6490 /// ```ignore,no_run
6491 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6492 /// let x = RuleDeployment::new().set_enabled(true);
6493 /// ```
6494 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6495 self.enabled = v.into();
6496 self
6497 }
6498
6499 /// Sets the value of [alerting][crate::model::RuleDeployment::alerting].
6500 ///
6501 /// # Example
6502 /// ```ignore,no_run
6503 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6504 /// let x = RuleDeployment::new().set_alerting(true);
6505 /// ```
6506 pub fn set_alerting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6507 self.alerting = v.into();
6508 self
6509 }
6510
6511 /// Sets the value of [archived][crate::model::RuleDeployment::archived].
6512 ///
6513 /// # Example
6514 /// ```ignore,no_run
6515 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6516 /// let x = RuleDeployment::new().set_archived(true);
6517 /// ```
6518 pub fn set_archived<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6519 self.archived = v.into();
6520 self
6521 }
6522
6523 /// Sets the value of [archive_time][crate::model::RuleDeployment::archive_time].
6524 ///
6525 /// # Example
6526 /// ```ignore,no_run
6527 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6528 /// use wkt::Timestamp;
6529 /// let x = RuleDeployment::new().set_archive_time(Timestamp::default()/* use setters */);
6530 /// ```
6531 pub fn set_archive_time<T>(mut self, v: T) -> Self
6532 where
6533 T: std::convert::Into<wkt::Timestamp>,
6534 {
6535 self.archive_time = std::option::Option::Some(v.into());
6536 self
6537 }
6538
6539 /// Sets or clears the value of [archive_time][crate::model::RuleDeployment::archive_time].
6540 ///
6541 /// # Example
6542 /// ```ignore,no_run
6543 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6544 /// use wkt::Timestamp;
6545 /// let x = RuleDeployment::new().set_or_clear_archive_time(Some(Timestamp::default()/* use setters */));
6546 /// let x = RuleDeployment::new().set_or_clear_archive_time(None::<Timestamp>);
6547 /// ```
6548 pub fn set_or_clear_archive_time<T>(mut self, v: std::option::Option<T>) -> Self
6549 where
6550 T: std::convert::Into<wkt::Timestamp>,
6551 {
6552 self.archive_time = v.map(|x| x.into());
6553 self
6554 }
6555
6556 /// Sets the value of [run_frequency][crate::model::RuleDeployment::run_frequency].
6557 ///
6558 /// # Example
6559 /// ```ignore,no_run
6560 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6561 /// use google_cloud_chronicle_v1::model::RunFrequency;
6562 /// let x0 = RuleDeployment::new().set_run_frequency(RunFrequency::Live);
6563 /// let x1 = RuleDeployment::new().set_run_frequency(RunFrequency::Hourly);
6564 /// let x2 = RuleDeployment::new().set_run_frequency(RunFrequency::Daily);
6565 /// ```
6566 pub fn set_run_frequency<T: std::convert::Into<crate::model::RunFrequency>>(
6567 mut self,
6568 v: T,
6569 ) -> Self {
6570 self.run_frequency = v.into();
6571 self
6572 }
6573
6574 /// Sets the value of [execution_state][crate::model::RuleDeployment::execution_state].
6575 ///
6576 /// # Example
6577 /// ```ignore,no_run
6578 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6579 /// use google_cloud_chronicle_v1::model::rule_deployment::ExecutionState;
6580 /// let x0 = RuleDeployment::new().set_execution_state(ExecutionState::Default);
6581 /// let x1 = RuleDeployment::new().set_execution_state(ExecutionState::Limited);
6582 /// let x2 = RuleDeployment::new().set_execution_state(ExecutionState::Paused);
6583 /// ```
6584 pub fn set_execution_state<
6585 T: std::convert::Into<crate::model::rule_deployment::ExecutionState>,
6586 >(
6587 mut self,
6588 v: T,
6589 ) -> Self {
6590 self.execution_state = v.into();
6591 self
6592 }
6593
6594 /// Sets the value of [producer_rules][crate::model::RuleDeployment::producer_rules].
6595 ///
6596 /// # Example
6597 /// ```ignore,no_run
6598 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6599 /// let x = RuleDeployment::new().set_producer_rules(["a", "b", "c"]);
6600 /// ```
6601 pub fn set_producer_rules<T, V>(mut self, v: T) -> Self
6602 where
6603 T: std::iter::IntoIterator<Item = V>,
6604 V: std::convert::Into<std::string::String>,
6605 {
6606 use std::iter::Iterator;
6607 self.producer_rules = v.into_iter().map(|i| i.into()).collect();
6608 self
6609 }
6610
6611 /// Sets the value of [consumer_rules][crate::model::RuleDeployment::consumer_rules].
6612 ///
6613 /// # Example
6614 /// ```ignore,no_run
6615 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6616 /// let x = RuleDeployment::new().set_consumer_rules(["a", "b", "c"]);
6617 /// ```
6618 pub fn set_consumer_rules<T, V>(mut self, v: T) -> Self
6619 where
6620 T: std::iter::IntoIterator<Item = V>,
6621 V: std::convert::Into<std::string::String>,
6622 {
6623 use std::iter::Iterator;
6624 self.consumer_rules = v.into_iter().map(|i| i.into()).collect();
6625 self
6626 }
6627
6628 /// Sets the value of [last_alert_status_change_time][crate::model::RuleDeployment::last_alert_status_change_time].
6629 ///
6630 /// # Example
6631 /// ```ignore,no_run
6632 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6633 /// use wkt::Timestamp;
6634 /// let x = RuleDeployment::new().set_last_alert_status_change_time(Timestamp::default()/* use setters */);
6635 /// ```
6636 pub fn set_last_alert_status_change_time<T>(mut self, v: T) -> Self
6637 where
6638 T: std::convert::Into<wkt::Timestamp>,
6639 {
6640 self.last_alert_status_change_time = std::option::Option::Some(v.into());
6641 self
6642 }
6643
6644 /// Sets or clears the value of [last_alert_status_change_time][crate::model::RuleDeployment::last_alert_status_change_time].
6645 ///
6646 /// # Example
6647 /// ```ignore,no_run
6648 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
6649 /// use wkt::Timestamp;
6650 /// let x = RuleDeployment::new().set_or_clear_last_alert_status_change_time(Some(Timestamp::default()/* use setters */));
6651 /// let x = RuleDeployment::new().set_or_clear_last_alert_status_change_time(None::<Timestamp>);
6652 /// ```
6653 pub fn set_or_clear_last_alert_status_change_time<T>(
6654 mut self,
6655 v: std::option::Option<T>,
6656 ) -> Self
6657 where
6658 T: std::convert::Into<wkt::Timestamp>,
6659 {
6660 self.last_alert_status_change_time = v.map(|x| x.into());
6661 self
6662 }
6663}
6664
6665impl wkt::message::Message for RuleDeployment {
6666 fn typename() -> &'static str {
6667 "type.googleapis.com/google.cloud.chronicle.v1.RuleDeployment"
6668 }
6669}
6670
6671/// Defines additional types related to [RuleDeployment].
6672pub mod rule_deployment {
6673 #[allow(unused_imports)]
6674 use super::*;
6675
6676 /// The possible execution states the rule deployment can be in.
6677 ///
6678 /// # Working with unknown values
6679 ///
6680 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6681 /// additional enum variants at any time. Adding new variants is not considered
6682 /// a breaking change. Applications should write their code in anticipation of:
6683 ///
6684 /// - New values appearing in future releases of the client library, **and**
6685 /// - New values received dynamically, without application changes.
6686 ///
6687 /// Please consult the [Working with enums] section in the user guide for some
6688 /// guidelines.
6689 ///
6690 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6691 #[derive(Clone, Debug, PartialEq)]
6692 #[non_exhaustive]
6693 pub enum ExecutionState {
6694 /// Unspecified or unknown execution state.
6695 Unspecified,
6696 /// Default execution state.
6697 Default,
6698 /// Rules in limited state may not have their executions guaranteed.
6699 Limited,
6700 /// Paused rules are not executed at all.
6701 Paused,
6702 /// If set, the enum was initialized with an unknown value.
6703 ///
6704 /// Applications can examine the value using [ExecutionState::value] or
6705 /// [ExecutionState::name].
6706 UnknownValue(execution_state::UnknownValue),
6707 }
6708
6709 #[doc(hidden)]
6710 pub mod execution_state {
6711 #[allow(unused_imports)]
6712 use super::*;
6713 #[derive(Clone, Debug, PartialEq)]
6714 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6715 }
6716
6717 impl ExecutionState {
6718 /// Gets the enum value.
6719 ///
6720 /// Returns `None` if the enum contains an unknown value deserialized from
6721 /// the string representation of enums.
6722 pub fn value(&self) -> std::option::Option<i32> {
6723 match self {
6724 Self::Unspecified => std::option::Option::Some(0),
6725 Self::Default => std::option::Option::Some(1),
6726 Self::Limited => std::option::Option::Some(2),
6727 Self::Paused => std::option::Option::Some(3),
6728 Self::UnknownValue(u) => u.0.value(),
6729 }
6730 }
6731
6732 /// Gets the enum value as a string.
6733 ///
6734 /// Returns `None` if the enum contains an unknown value deserialized from
6735 /// the integer representation of enums.
6736 pub fn name(&self) -> std::option::Option<&str> {
6737 match self {
6738 Self::Unspecified => std::option::Option::Some("EXECUTION_STATE_UNSPECIFIED"),
6739 Self::Default => std::option::Option::Some("DEFAULT"),
6740 Self::Limited => std::option::Option::Some("LIMITED"),
6741 Self::Paused => std::option::Option::Some("PAUSED"),
6742 Self::UnknownValue(u) => u.0.name(),
6743 }
6744 }
6745 }
6746
6747 impl std::default::Default for ExecutionState {
6748 fn default() -> Self {
6749 use std::convert::From;
6750 Self::from(0)
6751 }
6752 }
6753
6754 impl std::fmt::Display for ExecutionState {
6755 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6756 wkt::internal::display_enum(f, self.name(), self.value())
6757 }
6758 }
6759
6760 impl std::convert::From<i32> for ExecutionState {
6761 fn from(value: i32) -> Self {
6762 match value {
6763 0 => Self::Unspecified,
6764 1 => Self::Default,
6765 2 => Self::Limited,
6766 3 => Self::Paused,
6767 _ => Self::UnknownValue(execution_state::UnknownValue(
6768 wkt::internal::UnknownEnumValue::Integer(value),
6769 )),
6770 }
6771 }
6772 }
6773
6774 impl std::convert::From<&str> for ExecutionState {
6775 fn from(value: &str) -> Self {
6776 use std::string::ToString;
6777 match value {
6778 "EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
6779 "DEFAULT" => Self::Default,
6780 "LIMITED" => Self::Limited,
6781 "PAUSED" => Self::Paused,
6782 _ => Self::UnknownValue(execution_state::UnknownValue(
6783 wkt::internal::UnknownEnumValue::String(value.to_string()),
6784 )),
6785 }
6786 }
6787 }
6788
6789 impl serde::ser::Serialize for ExecutionState {
6790 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6791 where
6792 S: serde::Serializer,
6793 {
6794 match self {
6795 Self::Unspecified => serializer.serialize_i32(0),
6796 Self::Default => serializer.serialize_i32(1),
6797 Self::Limited => serializer.serialize_i32(2),
6798 Self::Paused => serializer.serialize_i32(3),
6799 Self::UnknownValue(u) => u.0.serialize(serializer),
6800 }
6801 }
6802 }
6803
6804 impl<'de> serde::de::Deserialize<'de> for ExecutionState {
6805 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6806 where
6807 D: serde::Deserializer<'de>,
6808 {
6809 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionState>::new(
6810 ".google.cloud.chronicle.v1.RuleDeployment.ExecutionState",
6811 ))
6812 }
6813 }
6814}
6815
6816/// Retrohunt is an execution of a Rule over a time range in the past.
6817#[derive(Clone, Default, PartialEq)]
6818#[non_exhaustive]
6819pub struct Retrohunt {
6820 /// The resource name of the retrohunt.
6821 /// Retrohunt is the child of a rule revision. {rule} in the format below is
6822 /// structured as {rule_id@revision_id}.
6823 /// Format:
6824 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/retrohunts/{retrohunt}`
6825 pub name: std::string::String,
6826
6827 /// Required. The start and end time of the event time range this retrohunt
6828 /// processes.
6829 pub process_interval: std::option::Option<google_cloud_type::model::Interval>,
6830
6831 /// Output only. The start and end time of the retrohunt execution. If the
6832 /// retrohunt is not yet finished, the end time of the interval will not be
6833 /// populated.
6834 pub execution_interval: std::option::Option<google_cloud_type::model::Interval>,
6835
6836 /// Output only. The state of the retrohunt.
6837 pub state: crate::model::retrohunt::State,
6838
6839 /// Output only. Percent progress of the retrohunt towards completion, from
6840 /// 0.00 to 100.00.
6841 pub progress_percentage: f32,
6842
6843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6844}
6845
6846impl Retrohunt {
6847 /// Creates a new default instance.
6848 pub fn new() -> Self {
6849 std::default::Default::default()
6850 }
6851
6852 /// Sets the value of [name][crate::model::Retrohunt::name].
6853 ///
6854 /// # Example
6855 /// ```ignore,no_run
6856 /// # use google_cloud_chronicle_v1::model::Retrohunt;
6857 /// let x = Retrohunt::new().set_name("example");
6858 /// ```
6859 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6860 self.name = v.into();
6861 self
6862 }
6863
6864 /// Sets the value of [process_interval][crate::model::Retrohunt::process_interval].
6865 ///
6866 /// # Example
6867 /// ```ignore,no_run
6868 /// # use google_cloud_chronicle_v1::model::Retrohunt;
6869 /// use google_cloud_type::model::Interval;
6870 /// let x = Retrohunt::new().set_process_interval(Interval::default()/* use setters */);
6871 /// ```
6872 pub fn set_process_interval<T>(mut self, v: T) -> Self
6873 where
6874 T: std::convert::Into<google_cloud_type::model::Interval>,
6875 {
6876 self.process_interval = std::option::Option::Some(v.into());
6877 self
6878 }
6879
6880 /// Sets or clears the value of [process_interval][crate::model::Retrohunt::process_interval].
6881 ///
6882 /// # Example
6883 /// ```ignore,no_run
6884 /// # use google_cloud_chronicle_v1::model::Retrohunt;
6885 /// use google_cloud_type::model::Interval;
6886 /// let x = Retrohunt::new().set_or_clear_process_interval(Some(Interval::default()/* use setters */));
6887 /// let x = Retrohunt::new().set_or_clear_process_interval(None::<Interval>);
6888 /// ```
6889 pub fn set_or_clear_process_interval<T>(mut self, v: std::option::Option<T>) -> Self
6890 where
6891 T: std::convert::Into<google_cloud_type::model::Interval>,
6892 {
6893 self.process_interval = v.map(|x| x.into());
6894 self
6895 }
6896
6897 /// Sets the value of [execution_interval][crate::model::Retrohunt::execution_interval].
6898 ///
6899 /// # Example
6900 /// ```ignore,no_run
6901 /// # use google_cloud_chronicle_v1::model::Retrohunt;
6902 /// use google_cloud_type::model::Interval;
6903 /// let x = Retrohunt::new().set_execution_interval(Interval::default()/* use setters */);
6904 /// ```
6905 pub fn set_execution_interval<T>(mut self, v: T) -> Self
6906 where
6907 T: std::convert::Into<google_cloud_type::model::Interval>,
6908 {
6909 self.execution_interval = std::option::Option::Some(v.into());
6910 self
6911 }
6912
6913 /// Sets or clears the value of [execution_interval][crate::model::Retrohunt::execution_interval].
6914 ///
6915 /// # Example
6916 /// ```ignore,no_run
6917 /// # use google_cloud_chronicle_v1::model::Retrohunt;
6918 /// use google_cloud_type::model::Interval;
6919 /// let x = Retrohunt::new().set_or_clear_execution_interval(Some(Interval::default()/* use setters */));
6920 /// let x = Retrohunt::new().set_or_clear_execution_interval(None::<Interval>);
6921 /// ```
6922 pub fn set_or_clear_execution_interval<T>(mut self, v: std::option::Option<T>) -> Self
6923 where
6924 T: std::convert::Into<google_cloud_type::model::Interval>,
6925 {
6926 self.execution_interval = v.map(|x| x.into());
6927 self
6928 }
6929
6930 /// Sets the value of [state][crate::model::Retrohunt::state].
6931 ///
6932 /// # Example
6933 /// ```ignore,no_run
6934 /// # use google_cloud_chronicle_v1::model::Retrohunt;
6935 /// use google_cloud_chronicle_v1::model::retrohunt::State;
6936 /// let x0 = Retrohunt::new().set_state(State::Running);
6937 /// let x1 = Retrohunt::new().set_state(State::Done);
6938 /// let x2 = Retrohunt::new().set_state(State::Cancelled);
6939 /// ```
6940 pub fn set_state<T: std::convert::Into<crate::model::retrohunt::State>>(
6941 mut self,
6942 v: T,
6943 ) -> Self {
6944 self.state = v.into();
6945 self
6946 }
6947
6948 /// Sets the value of [progress_percentage][crate::model::Retrohunt::progress_percentage].
6949 ///
6950 /// # Example
6951 /// ```ignore,no_run
6952 /// # use google_cloud_chronicle_v1::model::Retrohunt;
6953 /// let x = Retrohunt::new().set_progress_percentage(42.0);
6954 /// ```
6955 pub fn set_progress_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
6956 self.progress_percentage = v.into();
6957 self
6958 }
6959}
6960
6961impl wkt::message::Message for Retrohunt {
6962 fn typename() -> &'static str {
6963 "type.googleapis.com/google.cloud.chronicle.v1.Retrohunt"
6964 }
6965}
6966
6967/// Defines additional types related to [Retrohunt].
6968pub mod retrohunt {
6969 #[allow(unused_imports)]
6970 use super::*;
6971
6972 /// The possible states a retrohunt can be in.
6973 ///
6974 /// # Working with unknown values
6975 ///
6976 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6977 /// additional enum variants at any time. Adding new variants is not considered
6978 /// a breaking change. Applications should write their code in anticipation of:
6979 ///
6980 /// - New values appearing in future releases of the client library, **and**
6981 /// - New values received dynamically, without application changes.
6982 ///
6983 /// Please consult the [Working with enums] section in the user guide for some
6984 /// guidelines.
6985 ///
6986 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6987 #[derive(Clone, Debug, PartialEq)]
6988 #[non_exhaustive]
6989 pub enum State {
6990 /// Unspecified or unknown retrohunt state.
6991 Unspecified,
6992 /// Running state.
6993 Running,
6994 /// Done state.
6995 Done,
6996 /// Cancelled state.
6997 Cancelled,
6998 /// Failed state.
6999 Failed,
7000 /// If set, the enum was initialized with an unknown value.
7001 ///
7002 /// Applications can examine the value using [State::value] or
7003 /// [State::name].
7004 UnknownValue(state::UnknownValue),
7005 }
7006
7007 #[doc(hidden)]
7008 pub mod state {
7009 #[allow(unused_imports)]
7010 use super::*;
7011 #[derive(Clone, Debug, PartialEq)]
7012 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7013 }
7014
7015 impl State {
7016 /// Gets the enum value.
7017 ///
7018 /// Returns `None` if the enum contains an unknown value deserialized from
7019 /// the string representation of enums.
7020 pub fn value(&self) -> std::option::Option<i32> {
7021 match self {
7022 Self::Unspecified => std::option::Option::Some(0),
7023 Self::Running => std::option::Option::Some(1),
7024 Self::Done => std::option::Option::Some(2),
7025 Self::Cancelled => std::option::Option::Some(3),
7026 Self::Failed => std::option::Option::Some(4),
7027 Self::UnknownValue(u) => u.0.value(),
7028 }
7029 }
7030
7031 /// Gets the enum value as a string.
7032 ///
7033 /// Returns `None` if the enum contains an unknown value deserialized from
7034 /// the integer representation of enums.
7035 pub fn name(&self) -> std::option::Option<&str> {
7036 match self {
7037 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7038 Self::Running => std::option::Option::Some("RUNNING"),
7039 Self::Done => std::option::Option::Some("DONE"),
7040 Self::Cancelled => std::option::Option::Some("CANCELLED"),
7041 Self::Failed => std::option::Option::Some("FAILED"),
7042 Self::UnknownValue(u) => u.0.name(),
7043 }
7044 }
7045 }
7046
7047 impl std::default::Default for State {
7048 fn default() -> Self {
7049 use std::convert::From;
7050 Self::from(0)
7051 }
7052 }
7053
7054 impl std::fmt::Display for State {
7055 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7056 wkt::internal::display_enum(f, self.name(), self.value())
7057 }
7058 }
7059
7060 impl std::convert::From<i32> for State {
7061 fn from(value: i32) -> Self {
7062 match value {
7063 0 => Self::Unspecified,
7064 1 => Self::Running,
7065 2 => Self::Done,
7066 3 => Self::Cancelled,
7067 4 => Self::Failed,
7068 _ => Self::UnknownValue(state::UnknownValue(
7069 wkt::internal::UnknownEnumValue::Integer(value),
7070 )),
7071 }
7072 }
7073 }
7074
7075 impl std::convert::From<&str> for State {
7076 fn from(value: &str) -> Self {
7077 use std::string::ToString;
7078 match value {
7079 "STATE_UNSPECIFIED" => Self::Unspecified,
7080 "RUNNING" => Self::Running,
7081 "DONE" => Self::Done,
7082 "CANCELLED" => Self::Cancelled,
7083 "FAILED" => Self::Failed,
7084 _ => Self::UnknownValue(state::UnknownValue(
7085 wkt::internal::UnknownEnumValue::String(value.to_string()),
7086 )),
7087 }
7088 }
7089 }
7090
7091 impl serde::ser::Serialize for State {
7092 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7093 where
7094 S: serde::Serializer,
7095 {
7096 match self {
7097 Self::Unspecified => serializer.serialize_i32(0),
7098 Self::Running => serializer.serialize_i32(1),
7099 Self::Done => serializer.serialize_i32(2),
7100 Self::Cancelled => serializer.serialize_i32(3),
7101 Self::Failed => serializer.serialize_i32(4),
7102 Self::UnknownValue(u) => u.0.serialize(serializer),
7103 }
7104 }
7105 }
7106
7107 impl<'de> serde::de::Deserialize<'de> for State {
7108 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7109 where
7110 D: serde::Deserializer<'de>,
7111 {
7112 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7113 ".google.cloud.chronicle.v1.Retrohunt.State",
7114 ))
7115 }
7116 }
7117}
7118
7119/// Request message for CreateRule method.
7120#[derive(Clone, Default, PartialEq)]
7121#[non_exhaustive]
7122pub struct CreateRuleRequest {
7123 /// Required. The parent resource where this rule will be created.
7124 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
7125 pub parent: std::string::String,
7126
7127 /// Required. The rule to create.
7128 pub rule: std::option::Option<crate::model::Rule>,
7129
7130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7131}
7132
7133impl CreateRuleRequest {
7134 /// Creates a new default instance.
7135 pub fn new() -> Self {
7136 std::default::Default::default()
7137 }
7138
7139 /// Sets the value of [parent][crate::model::CreateRuleRequest::parent].
7140 ///
7141 /// # Example
7142 /// ```ignore,no_run
7143 /// # use google_cloud_chronicle_v1::model::CreateRuleRequest;
7144 /// let x = CreateRuleRequest::new().set_parent("example");
7145 /// ```
7146 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7147 self.parent = v.into();
7148 self
7149 }
7150
7151 /// Sets the value of [rule][crate::model::CreateRuleRequest::rule].
7152 ///
7153 /// # Example
7154 /// ```ignore,no_run
7155 /// # use google_cloud_chronicle_v1::model::CreateRuleRequest;
7156 /// use google_cloud_chronicle_v1::model::Rule;
7157 /// let x = CreateRuleRequest::new().set_rule(Rule::default()/* use setters */);
7158 /// ```
7159 pub fn set_rule<T>(mut self, v: T) -> Self
7160 where
7161 T: std::convert::Into<crate::model::Rule>,
7162 {
7163 self.rule = std::option::Option::Some(v.into());
7164 self
7165 }
7166
7167 /// Sets or clears the value of [rule][crate::model::CreateRuleRequest::rule].
7168 ///
7169 /// # Example
7170 /// ```ignore,no_run
7171 /// # use google_cloud_chronicle_v1::model::CreateRuleRequest;
7172 /// use google_cloud_chronicle_v1::model::Rule;
7173 /// let x = CreateRuleRequest::new().set_or_clear_rule(Some(Rule::default()/* use setters */));
7174 /// let x = CreateRuleRequest::new().set_or_clear_rule(None::<Rule>);
7175 /// ```
7176 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
7177 where
7178 T: std::convert::Into<crate::model::Rule>,
7179 {
7180 self.rule = v.map(|x| x.into());
7181 self
7182 }
7183}
7184
7185impl wkt::message::Message for CreateRuleRequest {
7186 fn typename() -> &'static str {
7187 "type.googleapis.com/google.cloud.chronicle.v1.CreateRuleRequest"
7188 }
7189}
7190
7191/// Request message for GetRule method.
7192#[derive(Clone, Default, PartialEq)]
7193#[non_exhaustive]
7194pub struct GetRuleRequest {
7195 /// Required. The name of the rule to retrieve.
7196 /// Format:
7197 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
7198 pub name: std::string::String,
7199
7200 /// The view field indicates the scope of fields to populate for the Rule being
7201 /// returned. If unspecified, defaults to FULL.
7202 pub view: crate::model::RuleView,
7203
7204 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7205}
7206
7207impl GetRuleRequest {
7208 /// Creates a new default instance.
7209 pub fn new() -> Self {
7210 std::default::Default::default()
7211 }
7212
7213 /// Sets the value of [name][crate::model::GetRuleRequest::name].
7214 ///
7215 /// # Example
7216 /// ```ignore,no_run
7217 /// # use google_cloud_chronicle_v1::model::GetRuleRequest;
7218 /// let x = GetRuleRequest::new().set_name("example");
7219 /// ```
7220 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7221 self.name = v.into();
7222 self
7223 }
7224
7225 /// Sets the value of [view][crate::model::GetRuleRequest::view].
7226 ///
7227 /// # Example
7228 /// ```ignore,no_run
7229 /// # use google_cloud_chronicle_v1::model::GetRuleRequest;
7230 /// use google_cloud_chronicle_v1::model::RuleView;
7231 /// let x0 = GetRuleRequest::new().set_view(RuleView::Basic);
7232 /// let x1 = GetRuleRequest::new().set_view(RuleView::Full);
7233 /// let x2 = GetRuleRequest::new().set_view(RuleView::RevisionMetadataOnly);
7234 /// ```
7235 pub fn set_view<T: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
7236 self.view = v.into();
7237 self
7238 }
7239}
7240
7241impl wkt::message::Message for GetRuleRequest {
7242 fn typename() -> &'static str {
7243 "type.googleapis.com/google.cloud.chronicle.v1.GetRuleRequest"
7244 }
7245}
7246
7247/// Request message for ListRules method.
7248#[derive(Clone, Default, PartialEq)]
7249#[non_exhaustive]
7250pub struct ListRulesRequest {
7251 /// Required. The parent, which owns this collection of rules.
7252 /// Format:
7253 /// `projects/{project}/locations/{location}/instances/{instance}`
7254 pub parent: std::string::String,
7255
7256 /// The maximum number of rules to return. The service may return fewer than
7257 /// this value. If unspecified, at most 100 rules will be returned. The
7258 /// maximum value is 1000; values above 1000 will be coerced to 1000.
7259 pub page_size: i32,
7260
7261 /// A page token, received from a previous `ListRules` call.
7262 /// Provide this to retrieve the subsequent page.
7263 ///
7264 /// When paginating, all other parameters provided to `ListRules`
7265 /// must match the call that provided the page token.
7266 pub page_token: std::string::String,
7267
7268 /// view indicates the scope of fields to populate for the Rule being returned.
7269 /// If unspecified, defaults to BASIC.
7270 pub view: crate::model::RuleView,
7271
7272 /// Only the following filters are allowed:
7273 /// "reference_lists:{reference_list_name}"
7274 /// "data_tables:{data_table_name}"
7275 /// "display_name:{display_name}"
7276 pub filter: std::string::String,
7277
7278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7279}
7280
7281impl ListRulesRequest {
7282 /// Creates a new default instance.
7283 pub fn new() -> Self {
7284 std::default::Default::default()
7285 }
7286
7287 /// Sets the value of [parent][crate::model::ListRulesRequest::parent].
7288 ///
7289 /// # Example
7290 /// ```ignore,no_run
7291 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
7292 /// let x = ListRulesRequest::new().set_parent("example");
7293 /// ```
7294 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7295 self.parent = v.into();
7296 self
7297 }
7298
7299 /// Sets the value of [page_size][crate::model::ListRulesRequest::page_size].
7300 ///
7301 /// # Example
7302 /// ```ignore,no_run
7303 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
7304 /// let x = ListRulesRequest::new().set_page_size(42);
7305 /// ```
7306 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7307 self.page_size = v.into();
7308 self
7309 }
7310
7311 /// Sets the value of [page_token][crate::model::ListRulesRequest::page_token].
7312 ///
7313 /// # Example
7314 /// ```ignore,no_run
7315 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
7316 /// let x = ListRulesRequest::new().set_page_token("example");
7317 /// ```
7318 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7319 self.page_token = v.into();
7320 self
7321 }
7322
7323 /// Sets the value of [view][crate::model::ListRulesRequest::view].
7324 ///
7325 /// # Example
7326 /// ```ignore,no_run
7327 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
7328 /// use google_cloud_chronicle_v1::model::RuleView;
7329 /// let x0 = ListRulesRequest::new().set_view(RuleView::Basic);
7330 /// let x1 = ListRulesRequest::new().set_view(RuleView::Full);
7331 /// let x2 = ListRulesRequest::new().set_view(RuleView::RevisionMetadataOnly);
7332 /// ```
7333 pub fn set_view<T: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
7334 self.view = v.into();
7335 self
7336 }
7337
7338 /// Sets the value of [filter][crate::model::ListRulesRequest::filter].
7339 ///
7340 /// # Example
7341 /// ```ignore,no_run
7342 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
7343 /// let x = ListRulesRequest::new().set_filter("example");
7344 /// ```
7345 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7346 self.filter = v.into();
7347 self
7348 }
7349}
7350
7351impl wkt::message::Message for ListRulesRequest {
7352 fn typename() -> &'static str {
7353 "type.googleapis.com/google.cloud.chronicle.v1.ListRulesRequest"
7354 }
7355}
7356
7357/// Response message for ListRules method.
7358#[derive(Clone, Default, PartialEq)]
7359#[non_exhaustive]
7360pub struct ListRulesResponse {
7361 /// The rules from the specified instance.
7362 pub rules: std::vec::Vec<crate::model::Rule>,
7363
7364 /// A token, which can be sent as `page_token` to retrieve the next page.
7365 /// If this field is omitted, there are no subsequent pages.
7366 pub next_page_token: std::string::String,
7367
7368 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7369}
7370
7371impl ListRulesResponse {
7372 /// Creates a new default instance.
7373 pub fn new() -> Self {
7374 std::default::Default::default()
7375 }
7376
7377 /// Sets the value of [rules][crate::model::ListRulesResponse::rules].
7378 ///
7379 /// # Example
7380 /// ```ignore,no_run
7381 /// # use google_cloud_chronicle_v1::model::ListRulesResponse;
7382 /// use google_cloud_chronicle_v1::model::Rule;
7383 /// let x = ListRulesResponse::new()
7384 /// .set_rules([
7385 /// Rule::default()/* use setters */,
7386 /// Rule::default()/* use (different) setters */,
7387 /// ]);
7388 /// ```
7389 pub fn set_rules<T, V>(mut self, v: T) -> Self
7390 where
7391 T: std::iter::IntoIterator<Item = V>,
7392 V: std::convert::Into<crate::model::Rule>,
7393 {
7394 use std::iter::Iterator;
7395 self.rules = v.into_iter().map(|i| i.into()).collect();
7396 self
7397 }
7398
7399 /// Sets the value of [next_page_token][crate::model::ListRulesResponse::next_page_token].
7400 ///
7401 /// # Example
7402 /// ```ignore,no_run
7403 /// # use google_cloud_chronicle_v1::model::ListRulesResponse;
7404 /// let x = ListRulesResponse::new().set_next_page_token("example");
7405 /// ```
7406 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7407 self.next_page_token = v.into();
7408 self
7409 }
7410}
7411
7412impl wkt::message::Message for ListRulesResponse {
7413 fn typename() -> &'static str {
7414 "type.googleapis.com/google.cloud.chronicle.v1.ListRulesResponse"
7415 }
7416}
7417
7418#[doc(hidden)]
7419impl google_cloud_gax::paginator::internal::PageableResponse for ListRulesResponse {
7420 type PageItem = crate::model::Rule;
7421
7422 fn items(self) -> std::vec::Vec<Self::PageItem> {
7423 self.rules
7424 }
7425
7426 fn next_page_token(&self) -> std::string::String {
7427 use std::clone::Clone;
7428 self.next_page_token.clone()
7429 }
7430}
7431
7432/// Request message for UpdateRule method.
7433#[derive(Clone, Default, PartialEq)]
7434#[non_exhaustive]
7435pub struct UpdateRuleRequest {
7436 /// Required. The rule to update.
7437 ///
7438 /// The rule's `name` field is used to identify the rule to update.
7439 /// Format:
7440 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
7441 pub rule: std::option::Option<crate::model::Rule>,
7442
7443 /// The list of fields to update. If not included, all fields with a non-empty
7444 /// value will be overwritten.
7445 pub update_mask: std::option::Option<wkt::FieldMask>,
7446
7447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7448}
7449
7450impl UpdateRuleRequest {
7451 /// Creates a new default instance.
7452 pub fn new() -> Self {
7453 std::default::Default::default()
7454 }
7455
7456 /// Sets the value of [rule][crate::model::UpdateRuleRequest::rule].
7457 ///
7458 /// # Example
7459 /// ```ignore,no_run
7460 /// # use google_cloud_chronicle_v1::model::UpdateRuleRequest;
7461 /// use google_cloud_chronicle_v1::model::Rule;
7462 /// let x = UpdateRuleRequest::new().set_rule(Rule::default()/* use setters */);
7463 /// ```
7464 pub fn set_rule<T>(mut self, v: T) -> Self
7465 where
7466 T: std::convert::Into<crate::model::Rule>,
7467 {
7468 self.rule = std::option::Option::Some(v.into());
7469 self
7470 }
7471
7472 /// Sets or clears the value of [rule][crate::model::UpdateRuleRequest::rule].
7473 ///
7474 /// # Example
7475 /// ```ignore,no_run
7476 /// # use google_cloud_chronicle_v1::model::UpdateRuleRequest;
7477 /// use google_cloud_chronicle_v1::model::Rule;
7478 /// let x = UpdateRuleRequest::new().set_or_clear_rule(Some(Rule::default()/* use setters */));
7479 /// let x = UpdateRuleRequest::new().set_or_clear_rule(None::<Rule>);
7480 /// ```
7481 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
7482 where
7483 T: std::convert::Into<crate::model::Rule>,
7484 {
7485 self.rule = v.map(|x| x.into());
7486 self
7487 }
7488
7489 /// Sets the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
7490 ///
7491 /// # Example
7492 /// ```ignore,no_run
7493 /// # use google_cloud_chronicle_v1::model::UpdateRuleRequest;
7494 /// use wkt::FieldMask;
7495 /// let x = UpdateRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7496 /// ```
7497 pub fn set_update_mask<T>(mut self, v: T) -> Self
7498 where
7499 T: std::convert::Into<wkt::FieldMask>,
7500 {
7501 self.update_mask = std::option::Option::Some(v.into());
7502 self
7503 }
7504
7505 /// Sets or clears the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
7506 ///
7507 /// # Example
7508 /// ```ignore,no_run
7509 /// # use google_cloud_chronicle_v1::model::UpdateRuleRequest;
7510 /// use wkt::FieldMask;
7511 /// let x = UpdateRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7512 /// let x = UpdateRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7513 /// ```
7514 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7515 where
7516 T: std::convert::Into<wkt::FieldMask>,
7517 {
7518 self.update_mask = v.map(|x| x.into());
7519 self
7520 }
7521}
7522
7523impl wkt::message::Message for UpdateRuleRequest {
7524 fn typename() -> &'static str {
7525 "type.googleapis.com/google.cloud.chronicle.v1.UpdateRuleRequest"
7526 }
7527}
7528
7529/// Request message for the DeleteRule method.
7530#[derive(Clone, Default, PartialEq)]
7531#[non_exhaustive]
7532pub struct DeleteRuleRequest {
7533 /// Required. The name of the rule to delete. A rule revision timestamp cannot
7534 /// be specified as part of the name, as deleting specific revisions is not
7535 /// supported.
7536 /// Format:
7537 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
7538 pub name: std::string::String,
7539
7540 /// Optional. If set to true, any retrohunts and any detections associated with
7541 /// the rule will also be deleted. If set to false, the call will only succeed
7542 /// if the rule has no associated retrohunts, including completed retrohunts,
7543 /// and no associated detections. Regardless of this field's value, the rule
7544 /// deployment associated with this rule will also be deleted.
7545 pub force: bool,
7546
7547 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7548}
7549
7550impl DeleteRuleRequest {
7551 /// Creates a new default instance.
7552 pub fn new() -> Self {
7553 std::default::Default::default()
7554 }
7555
7556 /// Sets the value of [name][crate::model::DeleteRuleRequest::name].
7557 ///
7558 /// # Example
7559 /// ```ignore,no_run
7560 /// # use google_cloud_chronicle_v1::model::DeleteRuleRequest;
7561 /// let x = DeleteRuleRequest::new().set_name("example");
7562 /// ```
7563 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7564 self.name = v.into();
7565 self
7566 }
7567
7568 /// Sets the value of [force][crate::model::DeleteRuleRequest::force].
7569 ///
7570 /// # Example
7571 /// ```ignore,no_run
7572 /// # use google_cloud_chronicle_v1::model::DeleteRuleRequest;
7573 /// let x = DeleteRuleRequest::new().set_force(true);
7574 /// ```
7575 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7576 self.force = v.into();
7577 self
7578 }
7579}
7580
7581impl wkt::message::Message for DeleteRuleRequest {
7582 fn typename() -> &'static str {
7583 "type.googleapis.com/google.cloud.chronicle.v1.DeleteRuleRequest"
7584 }
7585}
7586
7587/// Request message for ListRuleRevisions method.
7588#[derive(Clone, Default, PartialEq)]
7589#[non_exhaustive]
7590pub struct ListRuleRevisionsRequest {
7591 /// Required. The name of the rule to list revisions for.
7592 /// Format:
7593 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
7594 pub name: std::string::String,
7595
7596 /// The maximum number of revisions to return per page. The service may return
7597 /// fewer than this value. If unspecified, at most 100 revisions will be
7598 /// returned. The maximum value is 1000; values above 1000 will be coerced to
7599 /// 1000.
7600 pub page_size: i32,
7601
7602 /// The page token, received from a previous `ListRuleRevisions` call.
7603 /// Provide this to retrieve the subsequent page.
7604 ///
7605 /// When paginating, all other parameters provided to `ListRuleRevisions`
7606 /// must match the call that provided the page token.
7607 pub page_token: std::string::String,
7608
7609 /// The view field indicates the scope of fields to populate for the revision
7610 /// being returned. If unspecified, defaults to BASIC.
7611 pub view: crate::model::RuleView,
7612
7613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7614}
7615
7616impl ListRuleRevisionsRequest {
7617 /// Creates a new default instance.
7618 pub fn new() -> Self {
7619 std::default::Default::default()
7620 }
7621
7622 /// Sets the value of [name][crate::model::ListRuleRevisionsRequest::name].
7623 ///
7624 /// # Example
7625 /// ```ignore,no_run
7626 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsRequest;
7627 /// let x = ListRuleRevisionsRequest::new().set_name("example");
7628 /// ```
7629 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7630 self.name = v.into();
7631 self
7632 }
7633
7634 /// Sets the value of [page_size][crate::model::ListRuleRevisionsRequest::page_size].
7635 ///
7636 /// # Example
7637 /// ```ignore,no_run
7638 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsRequest;
7639 /// let x = ListRuleRevisionsRequest::new().set_page_size(42);
7640 /// ```
7641 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7642 self.page_size = v.into();
7643 self
7644 }
7645
7646 /// Sets the value of [page_token][crate::model::ListRuleRevisionsRequest::page_token].
7647 ///
7648 /// # Example
7649 /// ```ignore,no_run
7650 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsRequest;
7651 /// let x = ListRuleRevisionsRequest::new().set_page_token("example");
7652 /// ```
7653 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7654 self.page_token = v.into();
7655 self
7656 }
7657
7658 /// Sets the value of [view][crate::model::ListRuleRevisionsRequest::view].
7659 ///
7660 /// # Example
7661 /// ```ignore,no_run
7662 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsRequest;
7663 /// use google_cloud_chronicle_v1::model::RuleView;
7664 /// let x0 = ListRuleRevisionsRequest::new().set_view(RuleView::Basic);
7665 /// let x1 = ListRuleRevisionsRequest::new().set_view(RuleView::Full);
7666 /// let x2 = ListRuleRevisionsRequest::new().set_view(RuleView::RevisionMetadataOnly);
7667 /// ```
7668 pub fn set_view<T: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
7669 self.view = v.into();
7670 self
7671 }
7672}
7673
7674impl wkt::message::Message for ListRuleRevisionsRequest {
7675 fn typename() -> &'static str {
7676 "type.googleapis.com/google.cloud.chronicle.v1.ListRuleRevisionsRequest"
7677 }
7678}
7679
7680/// Response message for ListRuleRevisions method.
7681#[derive(Clone, Default, PartialEq)]
7682#[non_exhaustive]
7683pub struct ListRuleRevisionsResponse {
7684 /// The revisions of the rule.
7685 pub rules: std::vec::Vec<crate::model::Rule>,
7686
7687 /// A token that can be sent as `page_token` to retrieve the next page.
7688 /// If this field is omitted, there are no subsequent pages.
7689 pub next_page_token: std::string::String,
7690
7691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7692}
7693
7694impl ListRuleRevisionsResponse {
7695 /// Creates a new default instance.
7696 pub fn new() -> Self {
7697 std::default::Default::default()
7698 }
7699
7700 /// Sets the value of [rules][crate::model::ListRuleRevisionsResponse::rules].
7701 ///
7702 /// # Example
7703 /// ```ignore,no_run
7704 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsResponse;
7705 /// use google_cloud_chronicle_v1::model::Rule;
7706 /// let x = ListRuleRevisionsResponse::new()
7707 /// .set_rules([
7708 /// Rule::default()/* use setters */,
7709 /// Rule::default()/* use (different) setters */,
7710 /// ]);
7711 /// ```
7712 pub fn set_rules<T, V>(mut self, v: T) -> Self
7713 where
7714 T: std::iter::IntoIterator<Item = V>,
7715 V: std::convert::Into<crate::model::Rule>,
7716 {
7717 use std::iter::Iterator;
7718 self.rules = v.into_iter().map(|i| i.into()).collect();
7719 self
7720 }
7721
7722 /// Sets the value of [next_page_token][crate::model::ListRuleRevisionsResponse::next_page_token].
7723 ///
7724 /// # Example
7725 /// ```ignore,no_run
7726 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsResponse;
7727 /// let x = ListRuleRevisionsResponse::new().set_next_page_token("example");
7728 /// ```
7729 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7730 self.next_page_token = v.into();
7731 self
7732 }
7733}
7734
7735impl wkt::message::Message for ListRuleRevisionsResponse {
7736 fn typename() -> &'static str {
7737 "type.googleapis.com/google.cloud.chronicle.v1.ListRuleRevisionsResponse"
7738 }
7739}
7740
7741#[doc(hidden)]
7742impl google_cloud_gax::paginator::internal::PageableResponse for ListRuleRevisionsResponse {
7743 type PageItem = crate::model::Rule;
7744
7745 fn items(self) -> std::vec::Vec<Self::PageItem> {
7746 self.rules
7747 }
7748
7749 fn next_page_token(&self) -> std::string::String {
7750 use std::clone::Clone;
7751 self.next_page_token.clone()
7752 }
7753}
7754
7755/// Request message for CreateRetrohunt method.
7756#[derive(Clone, Default, PartialEq)]
7757#[non_exhaustive]
7758pub struct CreateRetrohuntRequest {
7759 /// Required. The parent of retrohunt, which is a rule.
7760 /// Format:
7761 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
7762 pub parent: std::string::String,
7763
7764 /// Required. The retrohunt to create.
7765 pub retrohunt: std::option::Option<crate::model::Retrohunt>,
7766
7767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7768}
7769
7770impl CreateRetrohuntRequest {
7771 /// Creates a new default instance.
7772 pub fn new() -> Self {
7773 std::default::Default::default()
7774 }
7775
7776 /// Sets the value of [parent][crate::model::CreateRetrohuntRequest::parent].
7777 ///
7778 /// # Example
7779 /// ```ignore,no_run
7780 /// # use google_cloud_chronicle_v1::model::CreateRetrohuntRequest;
7781 /// let x = CreateRetrohuntRequest::new().set_parent("example");
7782 /// ```
7783 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7784 self.parent = v.into();
7785 self
7786 }
7787
7788 /// Sets the value of [retrohunt][crate::model::CreateRetrohuntRequest::retrohunt].
7789 ///
7790 /// # Example
7791 /// ```ignore,no_run
7792 /// # use google_cloud_chronicle_v1::model::CreateRetrohuntRequest;
7793 /// use google_cloud_chronicle_v1::model::Retrohunt;
7794 /// let x = CreateRetrohuntRequest::new().set_retrohunt(Retrohunt::default()/* use setters */);
7795 /// ```
7796 pub fn set_retrohunt<T>(mut self, v: T) -> Self
7797 where
7798 T: std::convert::Into<crate::model::Retrohunt>,
7799 {
7800 self.retrohunt = std::option::Option::Some(v.into());
7801 self
7802 }
7803
7804 /// Sets or clears the value of [retrohunt][crate::model::CreateRetrohuntRequest::retrohunt].
7805 ///
7806 /// # Example
7807 /// ```ignore,no_run
7808 /// # use google_cloud_chronicle_v1::model::CreateRetrohuntRequest;
7809 /// use google_cloud_chronicle_v1::model::Retrohunt;
7810 /// let x = CreateRetrohuntRequest::new().set_or_clear_retrohunt(Some(Retrohunt::default()/* use setters */));
7811 /// let x = CreateRetrohuntRequest::new().set_or_clear_retrohunt(None::<Retrohunt>);
7812 /// ```
7813 pub fn set_or_clear_retrohunt<T>(mut self, v: std::option::Option<T>) -> Self
7814 where
7815 T: std::convert::Into<crate::model::Retrohunt>,
7816 {
7817 self.retrohunt = v.map(|x| x.into());
7818 self
7819 }
7820}
7821
7822impl wkt::message::Message for CreateRetrohuntRequest {
7823 fn typename() -> &'static str {
7824 "type.googleapis.com/google.cloud.chronicle.v1.CreateRetrohuntRequest"
7825 }
7826}
7827
7828/// Request message for GetRetrohunt method.
7829#[derive(Clone, Default, PartialEq)]
7830#[non_exhaustive]
7831pub struct GetRetrohuntRequest {
7832 /// Required. The name of the retrohunt to retrieve.
7833 /// Format:
7834 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/retrohunts/{retrohunt}`
7835 pub name: std::string::String,
7836
7837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7838}
7839
7840impl GetRetrohuntRequest {
7841 /// Creates a new default instance.
7842 pub fn new() -> Self {
7843 std::default::Default::default()
7844 }
7845
7846 /// Sets the value of [name][crate::model::GetRetrohuntRequest::name].
7847 ///
7848 /// # Example
7849 /// ```ignore,no_run
7850 /// # use google_cloud_chronicle_v1::model::GetRetrohuntRequest;
7851 /// let x = GetRetrohuntRequest::new().set_name("example");
7852 /// ```
7853 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7854 self.name = v.into();
7855 self
7856 }
7857}
7858
7859impl wkt::message::Message for GetRetrohuntRequest {
7860 fn typename() -> &'static str {
7861 "type.googleapis.com/google.cloud.chronicle.v1.GetRetrohuntRequest"
7862 }
7863}
7864
7865/// Request message for ListRetrohunts method.
7866#[derive(Clone, Default, PartialEq)]
7867#[non_exhaustive]
7868pub struct ListRetrohuntsRequest {
7869 /// Required. The rule that the retrohunts belong to.
7870 /// Format:
7871 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
7872 pub parent: std::string::String,
7873
7874 /// The maximum number of retrohunt to return. The service may return fewer
7875 /// than this value. If unspecified, at most 100 retrohunts will be returned.
7876 /// The maximum value is 1000; values above 1000 will be coerced to
7877 /// 1000.
7878 pub page_size: i32,
7879
7880 /// A page token, received from a previous `ListRetrohunts` call.
7881 /// Provide this to retrieve the subsequent page.
7882 ///
7883 /// When paginating, all other parameters provided to `ListRetrohunts` must
7884 /// match the call that provided the page token.
7885 pub page_token: std::string::String,
7886
7887 /// A filter that can be used to retrieve specific rule deployments.
7888 /// The following fields are filterable:
7889 /// state
7890 pub filter: std::string::String,
7891
7892 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7893}
7894
7895impl ListRetrohuntsRequest {
7896 /// Creates a new default instance.
7897 pub fn new() -> Self {
7898 std::default::Default::default()
7899 }
7900
7901 /// Sets the value of [parent][crate::model::ListRetrohuntsRequest::parent].
7902 ///
7903 /// # Example
7904 /// ```ignore,no_run
7905 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsRequest;
7906 /// let x = ListRetrohuntsRequest::new().set_parent("example");
7907 /// ```
7908 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7909 self.parent = v.into();
7910 self
7911 }
7912
7913 /// Sets the value of [page_size][crate::model::ListRetrohuntsRequest::page_size].
7914 ///
7915 /// # Example
7916 /// ```ignore,no_run
7917 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsRequest;
7918 /// let x = ListRetrohuntsRequest::new().set_page_size(42);
7919 /// ```
7920 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7921 self.page_size = v.into();
7922 self
7923 }
7924
7925 /// Sets the value of [page_token][crate::model::ListRetrohuntsRequest::page_token].
7926 ///
7927 /// # Example
7928 /// ```ignore,no_run
7929 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsRequest;
7930 /// let x = ListRetrohuntsRequest::new().set_page_token("example");
7931 /// ```
7932 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7933 self.page_token = v.into();
7934 self
7935 }
7936
7937 /// Sets the value of [filter][crate::model::ListRetrohuntsRequest::filter].
7938 ///
7939 /// # Example
7940 /// ```ignore,no_run
7941 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsRequest;
7942 /// let x = ListRetrohuntsRequest::new().set_filter("example");
7943 /// ```
7944 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7945 self.filter = v.into();
7946 self
7947 }
7948}
7949
7950impl wkt::message::Message for ListRetrohuntsRequest {
7951 fn typename() -> &'static str {
7952 "type.googleapis.com/google.cloud.chronicle.v1.ListRetrohuntsRequest"
7953 }
7954}
7955
7956/// Response message for ListRetrohunts method.
7957#[derive(Clone, Default, PartialEq)]
7958#[non_exhaustive]
7959pub struct ListRetrohuntsResponse {
7960 /// The retrohunts from the specified rule.
7961 pub retrohunts: std::vec::Vec<crate::model::Retrohunt>,
7962
7963 /// A token, which can be sent as `page_token` to retrieve the next page.
7964 /// If this field is omitted, there are no subsequent pages.
7965 pub next_page_token: std::string::String,
7966
7967 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7968}
7969
7970impl ListRetrohuntsResponse {
7971 /// Creates a new default instance.
7972 pub fn new() -> Self {
7973 std::default::Default::default()
7974 }
7975
7976 /// Sets the value of [retrohunts][crate::model::ListRetrohuntsResponse::retrohunts].
7977 ///
7978 /// # Example
7979 /// ```ignore,no_run
7980 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsResponse;
7981 /// use google_cloud_chronicle_v1::model::Retrohunt;
7982 /// let x = ListRetrohuntsResponse::new()
7983 /// .set_retrohunts([
7984 /// Retrohunt::default()/* use setters */,
7985 /// Retrohunt::default()/* use (different) setters */,
7986 /// ]);
7987 /// ```
7988 pub fn set_retrohunts<T, V>(mut self, v: T) -> Self
7989 where
7990 T: std::iter::IntoIterator<Item = V>,
7991 V: std::convert::Into<crate::model::Retrohunt>,
7992 {
7993 use std::iter::Iterator;
7994 self.retrohunts = v.into_iter().map(|i| i.into()).collect();
7995 self
7996 }
7997
7998 /// Sets the value of [next_page_token][crate::model::ListRetrohuntsResponse::next_page_token].
7999 ///
8000 /// # Example
8001 /// ```ignore,no_run
8002 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsResponse;
8003 /// let x = ListRetrohuntsResponse::new().set_next_page_token("example");
8004 /// ```
8005 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8006 self.next_page_token = v.into();
8007 self
8008 }
8009}
8010
8011impl wkt::message::Message for ListRetrohuntsResponse {
8012 fn typename() -> &'static str {
8013 "type.googleapis.com/google.cloud.chronicle.v1.ListRetrohuntsResponse"
8014 }
8015}
8016
8017#[doc(hidden)]
8018impl google_cloud_gax::paginator::internal::PageableResponse for ListRetrohuntsResponse {
8019 type PageItem = crate::model::Retrohunt;
8020
8021 fn items(self) -> std::vec::Vec<Self::PageItem> {
8022 self.retrohunts
8023 }
8024
8025 fn next_page_token(&self) -> std::string::String {
8026 use std::clone::Clone;
8027 self.next_page_token.clone()
8028 }
8029}
8030
8031/// Request message for GetRuleDeployment.
8032#[derive(Clone, Default, PartialEq)]
8033#[non_exhaustive]
8034pub struct GetRuleDeploymentRequest {
8035 /// Required. The name of the rule deployment to retrieve.
8036 /// Format:
8037 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/deployment`
8038 pub name: std::string::String,
8039
8040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8041}
8042
8043impl GetRuleDeploymentRequest {
8044 /// Creates a new default instance.
8045 pub fn new() -> Self {
8046 std::default::Default::default()
8047 }
8048
8049 /// Sets the value of [name][crate::model::GetRuleDeploymentRequest::name].
8050 ///
8051 /// # Example
8052 /// ```ignore,no_run
8053 /// # use google_cloud_chronicle_v1::model::GetRuleDeploymentRequest;
8054 /// let x = GetRuleDeploymentRequest::new().set_name("example");
8055 /// ```
8056 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8057 self.name = v.into();
8058 self
8059 }
8060}
8061
8062impl wkt::message::Message for GetRuleDeploymentRequest {
8063 fn typename() -> &'static str {
8064 "type.googleapis.com/google.cloud.chronicle.v1.GetRuleDeploymentRequest"
8065 }
8066}
8067
8068/// Request message for ListRuleDeployments.
8069#[derive(Clone, Default, PartialEq)]
8070#[non_exhaustive]
8071pub struct ListRuleDeploymentsRequest {
8072 /// Required. The collection of all parents which own all rule deployments. The
8073 /// "-" wildcard token must be used as the rule identifier in the resource
8074 /// path. Format:
8075 /// `projects/{project}/locations/{location}/instances/{instance}/rules/-`
8076 pub parent: std::string::String,
8077
8078 /// The maximum number of rule deployments to return. The service may return
8079 /// fewer than this value. If unspecified, at most 100 rule deployments will be
8080 /// returned. The maximum value is 1000; values above 1000 will be coerced to
8081 /// 1000.
8082 pub page_size: i32,
8083
8084 /// A page token, received from a previous `ListRuleDeployments` call.
8085 /// Provide this to retrieve the subsequent page.
8086 ///
8087 /// When paginating, all other parameters provided to `ListRuleDeployments`
8088 /// must match the call that provided the page token.
8089 pub page_token: std::string::String,
8090
8091 /// A filter that can be used to retrieve specific rule deployments.
8092 /// The following fields are filterable:
8093 /// archived, name
8094 pub filter: std::string::String,
8095
8096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8097}
8098
8099impl ListRuleDeploymentsRequest {
8100 /// Creates a new default instance.
8101 pub fn new() -> Self {
8102 std::default::Default::default()
8103 }
8104
8105 /// Sets the value of [parent][crate::model::ListRuleDeploymentsRequest::parent].
8106 ///
8107 /// # Example
8108 /// ```ignore,no_run
8109 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsRequest;
8110 /// let x = ListRuleDeploymentsRequest::new().set_parent("example");
8111 /// ```
8112 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8113 self.parent = v.into();
8114 self
8115 }
8116
8117 /// Sets the value of [page_size][crate::model::ListRuleDeploymentsRequest::page_size].
8118 ///
8119 /// # Example
8120 /// ```ignore,no_run
8121 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsRequest;
8122 /// let x = ListRuleDeploymentsRequest::new().set_page_size(42);
8123 /// ```
8124 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8125 self.page_size = v.into();
8126 self
8127 }
8128
8129 /// Sets the value of [page_token][crate::model::ListRuleDeploymentsRequest::page_token].
8130 ///
8131 /// # Example
8132 /// ```ignore,no_run
8133 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsRequest;
8134 /// let x = ListRuleDeploymentsRequest::new().set_page_token("example");
8135 /// ```
8136 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8137 self.page_token = v.into();
8138 self
8139 }
8140
8141 /// Sets the value of [filter][crate::model::ListRuleDeploymentsRequest::filter].
8142 ///
8143 /// # Example
8144 /// ```ignore,no_run
8145 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsRequest;
8146 /// let x = ListRuleDeploymentsRequest::new().set_filter("example");
8147 /// ```
8148 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8149 self.filter = v.into();
8150 self
8151 }
8152}
8153
8154impl wkt::message::Message for ListRuleDeploymentsRequest {
8155 fn typename() -> &'static str {
8156 "type.googleapis.com/google.cloud.chronicle.v1.ListRuleDeploymentsRequest"
8157 }
8158}
8159
8160/// Response message for ListRuleDeployments.
8161#[derive(Clone, Default, PartialEq)]
8162#[non_exhaustive]
8163pub struct ListRuleDeploymentsResponse {
8164 /// The rule deployments from all rules.
8165 pub rule_deployments: std::vec::Vec<crate::model::RuleDeployment>,
8166
8167 /// A token, which can be sent as `page_token` to retrieve the next page.
8168 /// If this field is omitted, there are no subsequent pages.
8169 pub next_page_token: std::string::String,
8170
8171 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8172}
8173
8174impl ListRuleDeploymentsResponse {
8175 /// Creates a new default instance.
8176 pub fn new() -> Self {
8177 std::default::Default::default()
8178 }
8179
8180 /// Sets the value of [rule_deployments][crate::model::ListRuleDeploymentsResponse::rule_deployments].
8181 ///
8182 /// # Example
8183 /// ```ignore,no_run
8184 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsResponse;
8185 /// use google_cloud_chronicle_v1::model::RuleDeployment;
8186 /// let x = ListRuleDeploymentsResponse::new()
8187 /// .set_rule_deployments([
8188 /// RuleDeployment::default()/* use setters */,
8189 /// RuleDeployment::default()/* use (different) setters */,
8190 /// ]);
8191 /// ```
8192 pub fn set_rule_deployments<T, V>(mut self, v: T) -> Self
8193 where
8194 T: std::iter::IntoIterator<Item = V>,
8195 V: std::convert::Into<crate::model::RuleDeployment>,
8196 {
8197 use std::iter::Iterator;
8198 self.rule_deployments = v.into_iter().map(|i| i.into()).collect();
8199 self
8200 }
8201
8202 /// Sets the value of [next_page_token][crate::model::ListRuleDeploymentsResponse::next_page_token].
8203 ///
8204 /// # Example
8205 /// ```ignore,no_run
8206 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsResponse;
8207 /// let x = ListRuleDeploymentsResponse::new().set_next_page_token("example");
8208 /// ```
8209 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8210 self.next_page_token = v.into();
8211 self
8212 }
8213}
8214
8215impl wkt::message::Message for ListRuleDeploymentsResponse {
8216 fn typename() -> &'static str {
8217 "type.googleapis.com/google.cloud.chronicle.v1.ListRuleDeploymentsResponse"
8218 }
8219}
8220
8221#[doc(hidden)]
8222impl google_cloud_gax::paginator::internal::PageableResponse for ListRuleDeploymentsResponse {
8223 type PageItem = crate::model::RuleDeployment;
8224
8225 fn items(self) -> std::vec::Vec<Self::PageItem> {
8226 self.rule_deployments
8227 }
8228
8229 fn next_page_token(&self) -> std::string::String {
8230 use std::clone::Clone;
8231 self.next_page_token.clone()
8232 }
8233}
8234
8235/// Request message for UpdateRuleDeployment.
8236#[derive(Clone, Default, PartialEq)]
8237#[non_exhaustive]
8238pub struct UpdateRuleDeploymentRequest {
8239 /// Required. The rule deployment to update.
8240 ///
8241 /// The rule deployment's `name` field is used to identify the rule deployment
8242 /// to update. Format:
8243 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/deployment`
8244 pub rule_deployment: std::option::Option<crate::model::RuleDeployment>,
8245
8246 /// Required. The list of fields to update.
8247 pub update_mask: std::option::Option<wkt::FieldMask>,
8248
8249 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8250}
8251
8252impl UpdateRuleDeploymentRequest {
8253 /// Creates a new default instance.
8254 pub fn new() -> Self {
8255 std::default::Default::default()
8256 }
8257
8258 /// Sets the value of [rule_deployment][crate::model::UpdateRuleDeploymentRequest::rule_deployment].
8259 ///
8260 /// # Example
8261 /// ```ignore,no_run
8262 /// # use google_cloud_chronicle_v1::model::UpdateRuleDeploymentRequest;
8263 /// use google_cloud_chronicle_v1::model::RuleDeployment;
8264 /// let x = UpdateRuleDeploymentRequest::new().set_rule_deployment(RuleDeployment::default()/* use setters */);
8265 /// ```
8266 pub fn set_rule_deployment<T>(mut self, v: T) -> Self
8267 where
8268 T: std::convert::Into<crate::model::RuleDeployment>,
8269 {
8270 self.rule_deployment = std::option::Option::Some(v.into());
8271 self
8272 }
8273
8274 /// Sets or clears the value of [rule_deployment][crate::model::UpdateRuleDeploymentRequest::rule_deployment].
8275 ///
8276 /// # Example
8277 /// ```ignore,no_run
8278 /// # use google_cloud_chronicle_v1::model::UpdateRuleDeploymentRequest;
8279 /// use google_cloud_chronicle_v1::model::RuleDeployment;
8280 /// let x = UpdateRuleDeploymentRequest::new().set_or_clear_rule_deployment(Some(RuleDeployment::default()/* use setters */));
8281 /// let x = UpdateRuleDeploymentRequest::new().set_or_clear_rule_deployment(None::<RuleDeployment>);
8282 /// ```
8283 pub fn set_or_clear_rule_deployment<T>(mut self, v: std::option::Option<T>) -> Self
8284 where
8285 T: std::convert::Into<crate::model::RuleDeployment>,
8286 {
8287 self.rule_deployment = v.map(|x| x.into());
8288 self
8289 }
8290
8291 /// Sets the value of [update_mask][crate::model::UpdateRuleDeploymentRequest::update_mask].
8292 ///
8293 /// # Example
8294 /// ```ignore,no_run
8295 /// # use google_cloud_chronicle_v1::model::UpdateRuleDeploymentRequest;
8296 /// use wkt::FieldMask;
8297 /// let x = UpdateRuleDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8298 /// ```
8299 pub fn set_update_mask<T>(mut self, v: T) -> Self
8300 where
8301 T: std::convert::Into<wkt::FieldMask>,
8302 {
8303 self.update_mask = std::option::Option::Some(v.into());
8304 self
8305 }
8306
8307 /// Sets or clears the value of [update_mask][crate::model::UpdateRuleDeploymentRequest::update_mask].
8308 ///
8309 /// # Example
8310 /// ```ignore,no_run
8311 /// # use google_cloud_chronicle_v1::model::UpdateRuleDeploymentRequest;
8312 /// use wkt::FieldMask;
8313 /// let x = UpdateRuleDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8314 /// let x = UpdateRuleDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8315 /// ```
8316 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8317 where
8318 T: std::convert::Into<wkt::FieldMask>,
8319 {
8320 self.update_mask = v.map(|x| x.into());
8321 self
8322 }
8323}
8324
8325impl wkt::message::Message for UpdateRuleDeploymentRequest {
8326 fn typename() -> &'static str {
8327 "type.googleapis.com/google.cloud.chronicle.v1.UpdateRuleDeploymentRequest"
8328 }
8329}
8330
8331/// CompilationPosition represents the location of a compilation diagnostic in
8332/// rule text.
8333#[derive(Clone, Default, PartialEq)]
8334#[non_exhaustive]
8335pub struct CompilationPosition {
8336 /// Output only. Start line number, beginning at 1.
8337 pub start_line: i32,
8338
8339 /// Output only. Start column number, beginning at 1.
8340 pub start_column: i32,
8341
8342 /// Output only. End line number, beginning at 1.
8343 pub end_line: i32,
8344
8345 /// Output only. End column number, beginning at 1.
8346 pub end_column: i32,
8347
8348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8349}
8350
8351impl CompilationPosition {
8352 /// Creates a new default instance.
8353 pub fn new() -> Self {
8354 std::default::Default::default()
8355 }
8356
8357 /// Sets the value of [start_line][crate::model::CompilationPosition::start_line].
8358 ///
8359 /// # Example
8360 /// ```ignore,no_run
8361 /// # use google_cloud_chronicle_v1::model::CompilationPosition;
8362 /// let x = CompilationPosition::new().set_start_line(42);
8363 /// ```
8364 pub fn set_start_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8365 self.start_line = v.into();
8366 self
8367 }
8368
8369 /// Sets the value of [start_column][crate::model::CompilationPosition::start_column].
8370 ///
8371 /// # Example
8372 /// ```ignore,no_run
8373 /// # use google_cloud_chronicle_v1::model::CompilationPosition;
8374 /// let x = CompilationPosition::new().set_start_column(42);
8375 /// ```
8376 pub fn set_start_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8377 self.start_column = v.into();
8378 self
8379 }
8380
8381 /// Sets the value of [end_line][crate::model::CompilationPosition::end_line].
8382 ///
8383 /// # Example
8384 /// ```ignore,no_run
8385 /// # use google_cloud_chronicle_v1::model::CompilationPosition;
8386 /// let x = CompilationPosition::new().set_end_line(42);
8387 /// ```
8388 pub fn set_end_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8389 self.end_line = v.into();
8390 self
8391 }
8392
8393 /// Sets the value of [end_column][crate::model::CompilationPosition::end_column].
8394 ///
8395 /// # Example
8396 /// ```ignore,no_run
8397 /// # use google_cloud_chronicle_v1::model::CompilationPosition;
8398 /// let x = CompilationPosition::new().set_end_column(42);
8399 /// ```
8400 pub fn set_end_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8401 self.end_column = v.into();
8402 self
8403 }
8404}
8405
8406impl wkt::message::Message for CompilationPosition {
8407 fn typename() -> &'static str {
8408 "type.googleapis.com/google.cloud.chronicle.v1.CompilationPosition"
8409 }
8410}
8411
8412/// CompilationDiagnostic represents a compilation diagnostic generated
8413/// during a rule's compilation, such as a compilation error or a compilation
8414/// warning.
8415#[derive(Clone, Default, PartialEq)]
8416#[non_exhaustive]
8417pub struct CompilationDiagnostic {
8418 /// Output only. The diagnostic message.
8419 pub message: std::string::String,
8420
8421 /// Output only. The approximate position in the rule text associated with the
8422 /// compilation diagnostic.
8423 /// Compilation Position may be empty.
8424 pub position: std::option::Option<crate::model::CompilationPosition>,
8425
8426 /// Output only. The severity of a rule's compilation diagnostic.
8427 pub severity: crate::model::compilation_diagnostic::Severity,
8428
8429 /// Output only. Link to documentation that describes a diagnostic in more
8430 /// detail.
8431 pub uri: std::string::String,
8432
8433 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8434}
8435
8436impl CompilationDiagnostic {
8437 /// Creates a new default instance.
8438 pub fn new() -> Self {
8439 std::default::Default::default()
8440 }
8441
8442 /// Sets the value of [message][crate::model::CompilationDiagnostic::message].
8443 ///
8444 /// # Example
8445 /// ```ignore,no_run
8446 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
8447 /// let x = CompilationDiagnostic::new().set_message("example");
8448 /// ```
8449 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8450 self.message = v.into();
8451 self
8452 }
8453
8454 /// Sets the value of [position][crate::model::CompilationDiagnostic::position].
8455 ///
8456 /// # Example
8457 /// ```ignore,no_run
8458 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
8459 /// use google_cloud_chronicle_v1::model::CompilationPosition;
8460 /// let x = CompilationDiagnostic::new().set_position(CompilationPosition::default()/* use setters */);
8461 /// ```
8462 pub fn set_position<T>(mut self, v: T) -> Self
8463 where
8464 T: std::convert::Into<crate::model::CompilationPosition>,
8465 {
8466 self.position = std::option::Option::Some(v.into());
8467 self
8468 }
8469
8470 /// Sets or clears the value of [position][crate::model::CompilationDiagnostic::position].
8471 ///
8472 /// # Example
8473 /// ```ignore,no_run
8474 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
8475 /// use google_cloud_chronicle_v1::model::CompilationPosition;
8476 /// let x = CompilationDiagnostic::new().set_or_clear_position(Some(CompilationPosition::default()/* use setters */));
8477 /// let x = CompilationDiagnostic::new().set_or_clear_position(None::<CompilationPosition>);
8478 /// ```
8479 pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
8480 where
8481 T: std::convert::Into<crate::model::CompilationPosition>,
8482 {
8483 self.position = v.map(|x| x.into());
8484 self
8485 }
8486
8487 /// Sets the value of [severity][crate::model::CompilationDiagnostic::severity].
8488 ///
8489 /// # Example
8490 /// ```ignore,no_run
8491 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
8492 /// use google_cloud_chronicle_v1::model::compilation_diagnostic::Severity;
8493 /// let x0 = CompilationDiagnostic::new().set_severity(Severity::Warning);
8494 /// let x1 = CompilationDiagnostic::new().set_severity(Severity::Error);
8495 /// ```
8496 pub fn set_severity<T: std::convert::Into<crate::model::compilation_diagnostic::Severity>>(
8497 mut self,
8498 v: T,
8499 ) -> Self {
8500 self.severity = v.into();
8501 self
8502 }
8503
8504 /// Sets the value of [uri][crate::model::CompilationDiagnostic::uri].
8505 ///
8506 /// # Example
8507 /// ```ignore,no_run
8508 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
8509 /// let x = CompilationDiagnostic::new().set_uri("example");
8510 /// ```
8511 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8512 self.uri = v.into();
8513 self
8514 }
8515}
8516
8517impl wkt::message::Message for CompilationDiagnostic {
8518 fn typename() -> &'static str {
8519 "type.googleapis.com/google.cloud.chronicle.v1.CompilationDiagnostic"
8520 }
8521}
8522
8523/// Defines additional types related to [CompilationDiagnostic].
8524pub mod compilation_diagnostic {
8525 #[allow(unused_imports)]
8526 use super::*;
8527
8528 /// The severity level of the compilation diagnostic.
8529 ///
8530 /// # Working with unknown values
8531 ///
8532 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8533 /// additional enum variants at any time. Adding new variants is not considered
8534 /// a breaking change. Applications should write their code in anticipation of:
8535 ///
8536 /// - New values appearing in future releases of the client library, **and**
8537 /// - New values received dynamically, without application changes.
8538 ///
8539 /// Please consult the [Working with enums] section in the user guide for some
8540 /// guidelines.
8541 ///
8542 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8543 #[derive(Clone, Debug, PartialEq)]
8544 #[non_exhaustive]
8545 pub enum Severity {
8546 /// An unspecified severity level.
8547 Unspecified,
8548 /// A compilation warning.
8549 Warning,
8550 /// A compilation error.
8551 Error,
8552 /// If set, the enum was initialized with an unknown value.
8553 ///
8554 /// Applications can examine the value using [Severity::value] or
8555 /// [Severity::name].
8556 UnknownValue(severity::UnknownValue),
8557 }
8558
8559 #[doc(hidden)]
8560 pub mod severity {
8561 #[allow(unused_imports)]
8562 use super::*;
8563 #[derive(Clone, Debug, PartialEq)]
8564 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8565 }
8566
8567 impl Severity {
8568 /// Gets the enum value.
8569 ///
8570 /// Returns `None` if the enum contains an unknown value deserialized from
8571 /// the string representation of enums.
8572 pub fn value(&self) -> std::option::Option<i32> {
8573 match self {
8574 Self::Unspecified => std::option::Option::Some(0),
8575 Self::Warning => std::option::Option::Some(1),
8576 Self::Error => std::option::Option::Some(2),
8577 Self::UnknownValue(u) => u.0.value(),
8578 }
8579 }
8580
8581 /// Gets the enum value as a string.
8582 ///
8583 /// Returns `None` if the enum contains an unknown value deserialized from
8584 /// the integer representation of enums.
8585 pub fn name(&self) -> std::option::Option<&str> {
8586 match self {
8587 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
8588 Self::Warning => std::option::Option::Some("WARNING"),
8589 Self::Error => std::option::Option::Some("ERROR"),
8590 Self::UnknownValue(u) => u.0.name(),
8591 }
8592 }
8593 }
8594
8595 impl std::default::Default for Severity {
8596 fn default() -> Self {
8597 use std::convert::From;
8598 Self::from(0)
8599 }
8600 }
8601
8602 impl std::fmt::Display for Severity {
8603 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8604 wkt::internal::display_enum(f, self.name(), self.value())
8605 }
8606 }
8607
8608 impl std::convert::From<i32> for Severity {
8609 fn from(value: i32) -> Self {
8610 match value {
8611 0 => Self::Unspecified,
8612 1 => Self::Warning,
8613 2 => Self::Error,
8614 _ => Self::UnknownValue(severity::UnknownValue(
8615 wkt::internal::UnknownEnumValue::Integer(value),
8616 )),
8617 }
8618 }
8619 }
8620
8621 impl std::convert::From<&str> for Severity {
8622 fn from(value: &str) -> Self {
8623 use std::string::ToString;
8624 match value {
8625 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
8626 "WARNING" => Self::Warning,
8627 "ERROR" => Self::Error,
8628 _ => Self::UnknownValue(severity::UnknownValue(
8629 wkt::internal::UnknownEnumValue::String(value.to_string()),
8630 )),
8631 }
8632 }
8633 }
8634
8635 impl serde::ser::Serialize for Severity {
8636 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8637 where
8638 S: serde::Serializer,
8639 {
8640 match self {
8641 Self::Unspecified => serializer.serialize_i32(0),
8642 Self::Warning => serializer.serialize_i32(1),
8643 Self::Error => serializer.serialize_i32(2),
8644 Self::UnknownValue(u) => u.0.serialize(serializer),
8645 }
8646 }
8647 }
8648
8649 impl<'de> serde::de::Deserialize<'de> for Severity {
8650 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8651 where
8652 D: serde::Deserializer<'de>,
8653 {
8654 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
8655 ".google.cloud.chronicle.v1.CompilationDiagnostic.Severity",
8656 ))
8657 }
8658 }
8659}
8660
8661/// Severity represents the severity level of the rule.
8662#[derive(Clone, Default, PartialEq)]
8663#[non_exhaustive]
8664pub struct Severity {
8665 /// The display name of the severity level. Extracted from the meta section of
8666 /// the rule text.
8667 pub display_name: std::string::String,
8668
8669 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8670}
8671
8672impl Severity {
8673 /// Creates a new default instance.
8674 pub fn new() -> Self {
8675 std::default::Default::default()
8676 }
8677
8678 /// Sets the value of [display_name][crate::model::Severity::display_name].
8679 ///
8680 /// # Example
8681 /// ```ignore,no_run
8682 /// # use google_cloud_chronicle_v1::model::Severity;
8683 /// let x = Severity::new().set_display_name("example");
8684 /// ```
8685 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8686 self.display_name = v.into();
8687 self
8688 }
8689}
8690
8691impl wkt::message::Message for Severity {
8692 fn typename() -> &'static str {
8693 "type.googleapis.com/google.cloud.chronicle.v1.Severity"
8694 }
8695}
8696
8697/// Operation Metadata for Retrohunts.
8698#[derive(Clone, Default, PartialEq)]
8699#[non_exhaustive]
8700pub struct RetrohuntMetadata {
8701 /// The name of the retrohunt.
8702 /// Format:
8703 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/retrohunts/{retrohunt}`
8704 pub retrohunt: std::string::String,
8705
8706 /// The start and end time of the retrohunt execution. If the retrohunt is not
8707 /// yet finished, the end time of the interval will not be filled.
8708 pub execution_interval: std::option::Option<google_cloud_type::model::Interval>,
8709
8710 /// Percent progress of the retrohunt towards completion, from 0.00 to 100.00.
8711 pub progress_percentage: f32,
8712
8713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8714}
8715
8716impl RetrohuntMetadata {
8717 /// Creates a new default instance.
8718 pub fn new() -> Self {
8719 std::default::Default::default()
8720 }
8721
8722 /// Sets the value of [retrohunt][crate::model::RetrohuntMetadata::retrohunt].
8723 ///
8724 /// # Example
8725 /// ```ignore,no_run
8726 /// # use google_cloud_chronicle_v1::model::RetrohuntMetadata;
8727 /// let x = RetrohuntMetadata::new().set_retrohunt("example");
8728 /// ```
8729 pub fn set_retrohunt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8730 self.retrohunt = v.into();
8731 self
8732 }
8733
8734 /// Sets the value of [execution_interval][crate::model::RetrohuntMetadata::execution_interval].
8735 ///
8736 /// # Example
8737 /// ```ignore,no_run
8738 /// # use google_cloud_chronicle_v1::model::RetrohuntMetadata;
8739 /// use google_cloud_type::model::Interval;
8740 /// let x = RetrohuntMetadata::new().set_execution_interval(Interval::default()/* use setters */);
8741 /// ```
8742 pub fn set_execution_interval<T>(mut self, v: T) -> Self
8743 where
8744 T: std::convert::Into<google_cloud_type::model::Interval>,
8745 {
8746 self.execution_interval = std::option::Option::Some(v.into());
8747 self
8748 }
8749
8750 /// Sets or clears the value of [execution_interval][crate::model::RetrohuntMetadata::execution_interval].
8751 ///
8752 /// # Example
8753 /// ```ignore,no_run
8754 /// # use google_cloud_chronicle_v1::model::RetrohuntMetadata;
8755 /// use google_cloud_type::model::Interval;
8756 /// let x = RetrohuntMetadata::new().set_or_clear_execution_interval(Some(Interval::default()/* use setters */));
8757 /// let x = RetrohuntMetadata::new().set_or_clear_execution_interval(None::<Interval>);
8758 /// ```
8759 pub fn set_or_clear_execution_interval<T>(mut self, v: std::option::Option<T>) -> Self
8760 where
8761 T: std::convert::Into<google_cloud_type::model::Interval>,
8762 {
8763 self.execution_interval = v.map(|x| x.into());
8764 self
8765 }
8766
8767 /// Sets the value of [progress_percentage][crate::model::RetrohuntMetadata::progress_percentage].
8768 ///
8769 /// # Example
8770 /// ```ignore,no_run
8771 /// # use google_cloud_chronicle_v1::model::RetrohuntMetadata;
8772 /// let x = RetrohuntMetadata::new().set_progress_percentage(42.0);
8773 /// ```
8774 pub fn set_progress_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
8775 self.progress_percentage = v.into();
8776 self
8777 }
8778}
8779
8780impl wkt::message::Message for RetrohuntMetadata {
8781 fn typename() -> &'static str {
8782 "type.googleapis.com/google.cloud.chronicle.v1.RetrohuntMetadata"
8783 }
8784}
8785
8786/// InputsUsed is a convenience field that tells us which sources
8787/// of events (if any) were used in the rule.
8788/// NEXT TAG: 4
8789#[derive(Clone, Default, PartialEq)]
8790#[non_exhaustive]
8791pub struct InputsUsed {
8792 /// Optional. Whether the rule queries UDM events.
8793 pub uses_udm: bool,
8794
8795 /// Optional. Whether the rule queries entity events.
8796 pub uses_entity: bool,
8797
8798 /// Optional. Whether the rule queries detections.
8799 pub uses_detection: bool,
8800
8801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8802}
8803
8804impl InputsUsed {
8805 /// Creates a new default instance.
8806 pub fn new() -> Self {
8807 std::default::Default::default()
8808 }
8809
8810 /// Sets the value of [uses_udm][crate::model::InputsUsed::uses_udm].
8811 ///
8812 /// # Example
8813 /// ```ignore,no_run
8814 /// # use google_cloud_chronicle_v1::model::InputsUsed;
8815 /// let x = InputsUsed::new().set_uses_udm(true);
8816 /// ```
8817 pub fn set_uses_udm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8818 self.uses_udm = v.into();
8819 self
8820 }
8821
8822 /// Sets the value of [uses_entity][crate::model::InputsUsed::uses_entity].
8823 ///
8824 /// # Example
8825 /// ```ignore,no_run
8826 /// # use google_cloud_chronicle_v1::model::InputsUsed;
8827 /// let x = InputsUsed::new().set_uses_entity(true);
8828 /// ```
8829 pub fn set_uses_entity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8830 self.uses_entity = v.into();
8831 self
8832 }
8833
8834 /// Sets the value of [uses_detection][crate::model::InputsUsed::uses_detection].
8835 ///
8836 /// # Example
8837 /// ```ignore,no_run
8838 /// # use google_cloud_chronicle_v1::model::InputsUsed;
8839 /// let x = InputsUsed::new().set_uses_detection(true);
8840 /// ```
8841 pub fn set_uses_detection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8842 self.uses_detection = v.into();
8843 self
8844 }
8845}
8846
8847impl wkt::message::Message for InputsUsed {
8848 fn typename() -> &'static str {
8849 "type.googleapis.com/google.cloud.chronicle.v1.InputsUsed"
8850 }
8851}
8852
8853/// DataTableUpdateSource denotes the source that updated the data table.
8854///
8855/// # Working with unknown values
8856///
8857/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8858/// additional enum variants at any time. Adding new variants is not considered
8859/// a breaking change. Applications should write their code in anticipation of:
8860///
8861/// - New values appearing in future releases of the client library, **and**
8862/// - New values received dynamically, without application changes.
8863///
8864/// Please consult the [Working with enums] section in the user guide for some
8865/// guidelines.
8866///
8867/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8868#[derive(Clone, Debug, PartialEq)]
8869#[non_exhaustive]
8870pub enum DataTableUpdateSource {
8871 /// The data table is updated by the user.
8872 Unspecified,
8873 /// The data table is updated by the user.
8874 User,
8875 /// The data table is updated by the rule.
8876 Rule,
8877 /// The data table is updated by the search.
8878 Search,
8879 /// If set, the enum was initialized with an unknown value.
8880 ///
8881 /// Applications can examine the value using [DataTableUpdateSource::value] or
8882 /// [DataTableUpdateSource::name].
8883 UnknownValue(data_table_update_source::UnknownValue),
8884}
8885
8886#[doc(hidden)]
8887pub mod data_table_update_source {
8888 #[allow(unused_imports)]
8889 use super::*;
8890 #[derive(Clone, Debug, PartialEq)]
8891 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8892}
8893
8894impl DataTableUpdateSource {
8895 /// Gets the enum value.
8896 ///
8897 /// Returns `None` if the enum contains an unknown value deserialized from
8898 /// the string representation of enums.
8899 pub fn value(&self) -> std::option::Option<i32> {
8900 match self {
8901 Self::Unspecified => std::option::Option::Some(0),
8902 Self::User => std::option::Option::Some(1),
8903 Self::Rule => std::option::Option::Some(2),
8904 Self::Search => std::option::Option::Some(3),
8905 Self::UnknownValue(u) => u.0.value(),
8906 }
8907 }
8908
8909 /// Gets the enum value as a string.
8910 ///
8911 /// Returns `None` if the enum contains an unknown value deserialized from
8912 /// the integer representation of enums.
8913 pub fn name(&self) -> std::option::Option<&str> {
8914 match self {
8915 Self::Unspecified => std::option::Option::Some("DATA_TABLE_UPDATE_SOURCE_UNSPECIFIED"),
8916 Self::User => std::option::Option::Some("USER"),
8917 Self::Rule => std::option::Option::Some("RULE"),
8918 Self::Search => std::option::Option::Some("SEARCH"),
8919 Self::UnknownValue(u) => u.0.name(),
8920 }
8921 }
8922}
8923
8924impl std::default::Default for DataTableUpdateSource {
8925 fn default() -> Self {
8926 use std::convert::From;
8927 Self::from(0)
8928 }
8929}
8930
8931impl std::fmt::Display for DataTableUpdateSource {
8932 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8933 wkt::internal::display_enum(f, self.name(), self.value())
8934 }
8935}
8936
8937impl std::convert::From<i32> for DataTableUpdateSource {
8938 fn from(value: i32) -> Self {
8939 match value {
8940 0 => Self::Unspecified,
8941 1 => Self::User,
8942 2 => Self::Rule,
8943 3 => Self::Search,
8944 _ => Self::UnknownValue(data_table_update_source::UnknownValue(
8945 wkt::internal::UnknownEnumValue::Integer(value),
8946 )),
8947 }
8948 }
8949}
8950
8951impl std::convert::From<&str> for DataTableUpdateSource {
8952 fn from(value: &str) -> Self {
8953 use std::string::ToString;
8954 match value {
8955 "DATA_TABLE_UPDATE_SOURCE_UNSPECIFIED" => Self::Unspecified,
8956 "USER" => Self::User,
8957 "RULE" => Self::Rule,
8958 "SEARCH" => Self::Search,
8959 _ => Self::UnknownValue(data_table_update_source::UnknownValue(
8960 wkt::internal::UnknownEnumValue::String(value.to_string()),
8961 )),
8962 }
8963 }
8964}
8965
8966impl serde::ser::Serialize for DataTableUpdateSource {
8967 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8968 where
8969 S: serde::Serializer,
8970 {
8971 match self {
8972 Self::Unspecified => serializer.serialize_i32(0),
8973 Self::User => serializer.serialize_i32(1),
8974 Self::Rule => serializer.serialize_i32(2),
8975 Self::Search => serializer.serialize_i32(3),
8976 Self::UnknownValue(u) => u.0.serialize(serializer),
8977 }
8978 }
8979}
8980
8981impl<'de> serde::de::Deserialize<'de> for DataTableUpdateSource {
8982 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8983 where
8984 D: serde::Deserializer<'de>,
8985 {
8986 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataTableUpdateSource>::new(
8987 ".google.cloud.chronicle.v1.DataTableUpdateSource",
8988 ))
8989 }
8990}
8991
8992/// The syntax type indicating how list entries should be validated.
8993///
8994/// # Working with unknown values
8995///
8996/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8997/// additional enum variants at any time. Adding new variants is not considered
8998/// a breaking change. Applications should write their code in anticipation of:
8999///
9000/// - New values appearing in future releases of the client library, **and**
9001/// - New values received dynamically, without application changes.
9002///
9003/// Please consult the [Working with enums] section in the user guide for some
9004/// guidelines.
9005///
9006/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9007#[derive(Clone, Debug, PartialEq)]
9008#[non_exhaustive]
9009pub enum ReferenceListSyntaxType {
9010 /// Defaults to REFERENCE_LIST_SYNTAX_TYPE_PLAIN_TEXT_STRING.
9011 Unspecified,
9012 /// List contains plain text patterns.
9013 PlainTextString,
9014 /// List contains only Regular Expression patterns.
9015 Regex,
9016 /// List contains only CIDR patterns.
9017 Cidr,
9018 /// If set, the enum was initialized with an unknown value.
9019 ///
9020 /// Applications can examine the value using [ReferenceListSyntaxType::value] or
9021 /// [ReferenceListSyntaxType::name].
9022 UnknownValue(reference_list_syntax_type::UnknownValue),
9023}
9024
9025#[doc(hidden)]
9026pub mod reference_list_syntax_type {
9027 #[allow(unused_imports)]
9028 use super::*;
9029 #[derive(Clone, Debug, PartialEq)]
9030 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9031}
9032
9033impl ReferenceListSyntaxType {
9034 /// Gets the enum value.
9035 ///
9036 /// Returns `None` if the enum contains an unknown value deserialized from
9037 /// the string representation of enums.
9038 pub fn value(&self) -> std::option::Option<i32> {
9039 match self {
9040 Self::Unspecified => std::option::Option::Some(0),
9041 Self::PlainTextString => std::option::Option::Some(1),
9042 Self::Regex => std::option::Option::Some(2),
9043 Self::Cidr => std::option::Option::Some(3),
9044 Self::UnknownValue(u) => u.0.value(),
9045 }
9046 }
9047
9048 /// Gets the enum value as a string.
9049 ///
9050 /// Returns `None` if the enum contains an unknown value deserialized from
9051 /// the integer representation of enums.
9052 pub fn name(&self) -> std::option::Option<&str> {
9053 match self {
9054 Self::Unspecified => {
9055 std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_UNSPECIFIED")
9056 }
9057 Self::PlainTextString => {
9058 std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_PLAIN_TEXT_STRING")
9059 }
9060 Self::Regex => std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_REGEX"),
9061 Self::Cidr => std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_CIDR"),
9062 Self::UnknownValue(u) => u.0.name(),
9063 }
9064 }
9065}
9066
9067impl std::default::Default for ReferenceListSyntaxType {
9068 fn default() -> Self {
9069 use std::convert::From;
9070 Self::from(0)
9071 }
9072}
9073
9074impl std::fmt::Display for ReferenceListSyntaxType {
9075 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9076 wkt::internal::display_enum(f, self.name(), self.value())
9077 }
9078}
9079
9080impl std::convert::From<i32> for ReferenceListSyntaxType {
9081 fn from(value: i32) -> Self {
9082 match value {
9083 0 => Self::Unspecified,
9084 1 => Self::PlainTextString,
9085 2 => Self::Regex,
9086 3 => Self::Cidr,
9087 _ => Self::UnknownValue(reference_list_syntax_type::UnknownValue(
9088 wkt::internal::UnknownEnumValue::Integer(value),
9089 )),
9090 }
9091 }
9092}
9093
9094impl std::convert::From<&str> for ReferenceListSyntaxType {
9095 fn from(value: &str) -> Self {
9096 use std::string::ToString;
9097 match value {
9098 "REFERENCE_LIST_SYNTAX_TYPE_UNSPECIFIED" => Self::Unspecified,
9099 "REFERENCE_LIST_SYNTAX_TYPE_PLAIN_TEXT_STRING" => Self::PlainTextString,
9100 "REFERENCE_LIST_SYNTAX_TYPE_REGEX" => Self::Regex,
9101 "REFERENCE_LIST_SYNTAX_TYPE_CIDR" => Self::Cidr,
9102 _ => Self::UnknownValue(reference_list_syntax_type::UnknownValue(
9103 wkt::internal::UnknownEnumValue::String(value.to_string()),
9104 )),
9105 }
9106 }
9107}
9108
9109impl serde::ser::Serialize for ReferenceListSyntaxType {
9110 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9111 where
9112 S: serde::Serializer,
9113 {
9114 match self {
9115 Self::Unspecified => serializer.serialize_i32(0),
9116 Self::PlainTextString => serializer.serialize_i32(1),
9117 Self::Regex => serializer.serialize_i32(2),
9118 Self::Cidr => serializer.serialize_i32(3),
9119 Self::UnknownValue(u) => u.0.serialize(serializer),
9120 }
9121 }
9122}
9123
9124impl<'de> serde::de::Deserialize<'de> for ReferenceListSyntaxType {
9125 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9126 where
9127 D: serde::Deserializer<'de>,
9128 {
9129 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReferenceListSyntaxType>::new(
9130 ".google.cloud.chronicle.v1.ReferenceListSyntaxType",
9131 ))
9132 }
9133}
9134
9135/// ReferenceListView is a mechanism for viewing partial responses of the
9136/// ReferenceList resource.
9137///
9138/// # Working with unknown values
9139///
9140/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9141/// additional enum variants at any time. Adding new variants is not considered
9142/// a breaking change. Applications should write their code in anticipation of:
9143///
9144/// - New values appearing in future releases of the client library, **and**
9145/// - New values received dynamically, without application changes.
9146///
9147/// Please consult the [Working with enums] section in the user guide for some
9148/// guidelines.
9149///
9150/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9151#[derive(Clone, Debug, PartialEq)]
9152#[non_exhaustive]
9153pub enum ReferenceListView {
9154 /// The default / unset value.
9155 /// The API will default to the BASIC view for ListReferenceLists.
9156 /// The API will default to the FULL view for methods that return a single
9157 /// ReferenceList resource.
9158 Unspecified,
9159 /// Include metadata about the ReferenceList.
9160 /// This is the default view for ListReferenceLists.
9161 Basic,
9162 /// Include all details about the ReferenceList: metadata, content lines,
9163 /// associated rule counts. This is the default view for GetReferenceList.
9164 Full,
9165 /// If set, the enum was initialized with an unknown value.
9166 ///
9167 /// Applications can examine the value using [ReferenceListView::value] or
9168 /// [ReferenceListView::name].
9169 UnknownValue(reference_list_view::UnknownValue),
9170}
9171
9172#[doc(hidden)]
9173pub mod reference_list_view {
9174 #[allow(unused_imports)]
9175 use super::*;
9176 #[derive(Clone, Debug, PartialEq)]
9177 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9178}
9179
9180impl ReferenceListView {
9181 /// Gets the enum value.
9182 ///
9183 /// Returns `None` if the enum contains an unknown value deserialized from
9184 /// the string representation of enums.
9185 pub fn value(&self) -> std::option::Option<i32> {
9186 match self {
9187 Self::Unspecified => std::option::Option::Some(0),
9188 Self::Basic => std::option::Option::Some(1),
9189 Self::Full => std::option::Option::Some(2),
9190 Self::UnknownValue(u) => u.0.value(),
9191 }
9192 }
9193
9194 /// Gets the enum value as a string.
9195 ///
9196 /// Returns `None` if the enum contains an unknown value deserialized from
9197 /// the integer representation of enums.
9198 pub fn name(&self) -> std::option::Option<&str> {
9199 match self {
9200 Self::Unspecified => std::option::Option::Some("REFERENCE_LIST_VIEW_UNSPECIFIED"),
9201 Self::Basic => std::option::Option::Some("REFERENCE_LIST_VIEW_BASIC"),
9202 Self::Full => std::option::Option::Some("REFERENCE_LIST_VIEW_FULL"),
9203 Self::UnknownValue(u) => u.0.name(),
9204 }
9205 }
9206}
9207
9208impl std::default::Default for ReferenceListView {
9209 fn default() -> Self {
9210 use std::convert::From;
9211 Self::from(0)
9212 }
9213}
9214
9215impl std::fmt::Display for ReferenceListView {
9216 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9217 wkt::internal::display_enum(f, self.name(), self.value())
9218 }
9219}
9220
9221impl std::convert::From<i32> for ReferenceListView {
9222 fn from(value: i32) -> Self {
9223 match value {
9224 0 => Self::Unspecified,
9225 1 => Self::Basic,
9226 2 => Self::Full,
9227 _ => Self::UnknownValue(reference_list_view::UnknownValue(
9228 wkt::internal::UnknownEnumValue::Integer(value),
9229 )),
9230 }
9231 }
9232}
9233
9234impl std::convert::From<&str> for ReferenceListView {
9235 fn from(value: &str) -> Self {
9236 use std::string::ToString;
9237 match value {
9238 "REFERENCE_LIST_VIEW_UNSPECIFIED" => Self::Unspecified,
9239 "REFERENCE_LIST_VIEW_BASIC" => Self::Basic,
9240 "REFERENCE_LIST_VIEW_FULL" => Self::Full,
9241 _ => Self::UnknownValue(reference_list_view::UnknownValue(
9242 wkt::internal::UnknownEnumValue::String(value.to_string()),
9243 )),
9244 }
9245 }
9246}
9247
9248impl serde::ser::Serialize for ReferenceListView {
9249 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9250 where
9251 S: serde::Serializer,
9252 {
9253 match self {
9254 Self::Unspecified => serializer.serialize_i32(0),
9255 Self::Basic => serializer.serialize_i32(1),
9256 Self::Full => serializer.serialize_i32(2),
9257 Self::UnknownValue(u) => u.0.serialize(serializer),
9258 }
9259 }
9260}
9261
9262impl<'de> serde::de::Deserialize<'de> for ReferenceListView {
9263 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9264 where
9265 D: serde::Deserializer<'de>,
9266 {
9267 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReferenceListView>::new(
9268 ".google.cloud.chronicle.v1.ReferenceListView",
9269 ))
9270 }
9271}
9272
9273/// RunFrequency indicates the run frequency at which a YARA-L 2 rule will run if
9274/// enabled.
9275///
9276/// # Working with unknown values
9277///
9278/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9279/// additional enum variants at any time. Adding new variants is not considered
9280/// a breaking change. Applications should write their code in anticipation of:
9281///
9282/// - New values appearing in future releases of the client library, **and**
9283/// - New values received dynamically, without application changes.
9284///
9285/// Please consult the [Working with enums] section in the user guide for some
9286/// guidelines.
9287///
9288/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9289#[derive(Clone, Debug, PartialEq)]
9290#[non_exhaustive]
9291pub enum RunFrequency {
9292 /// The run frequency is unspecified/unknown.
9293 Unspecified,
9294 /// Executes in real time.
9295 Live,
9296 /// Executes once per hour.
9297 Hourly,
9298 /// Executes once per day.
9299 Daily,
9300 /// If set, the enum was initialized with an unknown value.
9301 ///
9302 /// Applications can examine the value using [RunFrequency::value] or
9303 /// [RunFrequency::name].
9304 UnknownValue(run_frequency::UnknownValue),
9305}
9306
9307#[doc(hidden)]
9308pub mod run_frequency {
9309 #[allow(unused_imports)]
9310 use super::*;
9311 #[derive(Clone, Debug, PartialEq)]
9312 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9313}
9314
9315impl RunFrequency {
9316 /// Gets the enum value.
9317 ///
9318 /// Returns `None` if the enum contains an unknown value deserialized from
9319 /// the string representation of enums.
9320 pub fn value(&self) -> std::option::Option<i32> {
9321 match self {
9322 Self::Unspecified => std::option::Option::Some(0),
9323 Self::Live => std::option::Option::Some(1),
9324 Self::Hourly => std::option::Option::Some(2),
9325 Self::Daily => std::option::Option::Some(3),
9326 Self::UnknownValue(u) => u.0.value(),
9327 }
9328 }
9329
9330 /// Gets the enum value as a string.
9331 ///
9332 /// Returns `None` if the enum contains an unknown value deserialized from
9333 /// the integer representation of enums.
9334 pub fn name(&self) -> std::option::Option<&str> {
9335 match self {
9336 Self::Unspecified => std::option::Option::Some("RUN_FREQUENCY_UNSPECIFIED"),
9337 Self::Live => std::option::Option::Some("LIVE"),
9338 Self::Hourly => std::option::Option::Some("HOURLY"),
9339 Self::Daily => std::option::Option::Some("DAILY"),
9340 Self::UnknownValue(u) => u.0.name(),
9341 }
9342 }
9343}
9344
9345impl std::default::Default for RunFrequency {
9346 fn default() -> Self {
9347 use std::convert::From;
9348 Self::from(0)
9349 }
9350}
9351
9352impl std::fmt::Display for RunFrequency {
9353 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9354 wkt::internal::display_enum(f, self.name(), self.value())
9355 }
9356}
9357
9358impl std::convert::From<i32> for RunFrequency {
9359 fn from(value: i32) -> Self {
9360 match value {
9361 0 => Self::Unspecified,
9362 1 => Self::Live,
9363 2 => Self::Hourly,
9364 3 => Self::Daily,
9365 _ => Self::UnknownValue(run_frequency::UnknownValue(
9366 wkt::internal::UnknownEnumValue::Integer(value),
9367 )),
9368 }
9369 }
9370}
9371
9372impl std::convert::From<&str> for RunFrequency {
9373 fn from(value: &str) -> Self {
9374 use std::string::ToString;
9375 match value {
9376 "RUN_FREQUENCY_UNSPECIFIED" => Self::Unspecified,
9377 "LIVE" => Self::Live,
9378 "HOURLY" => Self::Hourly,
9379 "DAILY" => Self::Daily,
9380 _ => Self::UnknownValue(run_frequency::UnknownValue(
9381 wkt::internal::UnknownEnumValue::String(value.to_string()),
9382 )),
9383 }
9384 }
9385}
9386
9387impl serde::ser::Serialize for RunFrequency {
9388 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9389 where
9390 S: serde::Serializer,
9391 {
9392 match self {
9393 Self::Unspecified => serializer.serialize_i32(0),
9394 Self::Live => serializer.serialize_i32(1),
9395 Self::Hourly => serializer.serialize_i32(2),
9396 Self::Daily => serializer.serialize_i32(3),
9397 Self::UnknownValue(u) => u.0.serialize(serializer),
9398 }
9399 }
9400}
9401
9402impl<'de> serde::de::Deserialize<'de> for RunFrequency {
9403 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9404 where
9405 D: serde::Deserializer<'de>,
9406 {
9407 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RunFrequency>::new(
9408 ".google.cloud.chronicle.v1.RunFrequency",
9409 ))
9410 }
9411}
9412
9413/// RuleType indicates the YARA-L rule type of user-created and Google Cloud
9414/// Threat Intelligence (GCTI) authored rules.
9415///
9416/// # Working with unknown values
9417///
9418/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9419/// additional enum variants at any time. Adding new variants is not considered
9420/// a breaking change. Applications should write their code in anticipation of:
9421///
9422/// - New values appearing in future releases of the client library, **and**
9423/// - New values received dynamically, without application changes.
9424///
9425/// Please consult the [Working with enums] section in the user guide for some
9426/// guidelines.
9427///
9428/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9429#[derive(Clone, Debug, PartialEq)]
9430#[non_exhaustive]
9431pub enum RuleType {
9432 /// The rule type is unspecified/unknown.
9433 Unspecified,
9434 /// Rule checks for the existence of a single event.
9435 SingleEvent,
9436 /// Rule checks for correlation between multiple events
9437 MultiEvent,
9438 /// If set, the enum was initialized with an unknown value.
9439 ///
9440 /// Applications can examine the value using [RuleType::value] or
9441 /// [RuleType::name].
9442 UnknownValue(rule_type::UnknownValue),
9443}
9444
9445#[doc(hidden)]
9446pub mod rule_type {
9447 #[allow(unused_imports)]
9448 use super::*;
9449 #[derive(Clone, Debug, PartialEq)]
9450 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9451}
9452
9453impl RuleType {
9454 /// Gets the enum value.
9455 ///
9456 /// Returns `None` if the enum contains an unknown value deserialized from
9457 /// the string representation of enums.
9458 pub fn value(&self) -> std::option::Option<i32> {
9459 match self {
9460 Self::Unspecified => std::option::Option::Some(0),
9461 Self::SingleEvent => std::option::Option::Some(1),
9462 Self::MultiEvent => std::option::Option::Some(2),
9463 Self::UnknownValue(u) => u.0.value(),
9464 }
9465 }
9466
9467 /// Gets the enum value as a string.
9468 ///
9469 /// Returns `None` if the enum contains an unknown value deserialized from
9470 /// the integer representation of enums.
9471 pub fn name(&self) -> std::option::Option<&str> {
9472 match self {
9473 Self::Unspecified => std::option::Option::Some("RULE_TYPE_UNSPECIFIED"),
9474 Self::SingleEvent => std::option::Option::Some("SINGLE_EVENT"),
9475 Self::MultiEvent => std::option::Option::Some("MULTI_EVENT"),
9476 Self::UnknownValue(u) => u.0.name(),
9477 }
9478 }
9479}
9480
9481impl std::default::Default for RuleType {
9482 fn default() -> Self {
9483 use std::convert::From;
9484 Self::from(0)
9485 }
9486}
9487
9488impl std::fmt::Display for RuleType {
9489 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9490 wkt::internal::display_enum(f, self.name(), self.value())
9491 }
9492}
9493
9494impl std::convert::From<i32> for RuleType {
9495 fn from(value: i32) -> Self {
9496 match value {
9497 0 => Self::Unspecified,
9498 1 => Self::SingleEvent,
9499 2 => Self::MultiEvent,
9500 _ => Self::UnknownValue(rule_type::UnknownValue(
9501 wkt::internal::UnknownEnumValue::Integer(value),
9502 )),
9503 }
9504 }
9505}
9506
9507impl std::convert::From<&str> for RuleType {
9508 fn from(value: &str) -> Self {
9509 use std::string::ToString;
9510 match value {
9511 "RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
9512 "SINGLE_EVENT" => Self::SingleEvent,
9513 "MULTI_EVENT" => Self::MultiEvent,
9514 _ => Self::UnknownValue(rule_type::UnknownValue(
9515 wkt::internal::UnknownEnumValue::String(value.to_string()),
9516 )),
9517 }
9518 }
9519}
9520
9521impl serde::ser::Serialize for RuleType {
9522 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9523 where
9524 S: serde::Serializer,
9525 {
9526 match self {
9527 Self::Unspecified => serializer.serialize_i32(0),
9528 Self::SingleEvent => serializer.serialize_i32(1),
9529 Self::MultiEvent => serializer.serialize_i32(2),
9530 Self::UnknownValue(u) => u.0.serialize(serializer),
9531 }
9532 }
9533}
9534
9535impl<'de> serde::de::Deserialize<'de> for RuleType {
9536 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9537 where
9538 D: serde::Deserializer<'de>,
9539 {
9540 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleType>::new(
9541 ".google.cloud.chronicle.v1.RuleType",
9542 ))
9543 }
9544}
9545
9546/// RuleView indicates the scope of fields to populate when returning the Rule
9547/// resource.
9548///
9549/// # Working with unknown values
9550///
9551/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9552/// additional enum variants at any time. Adding new variants is not considered
9553/// a breaking change. Applications should write their code in anticipation of:
9554///
9555/// - New values appearing in future releases of the client library, **and**
9556/// - New values received dynamically, without application changes.
9557///
9558/// Please consult the [Working with enums] section in the user guide for some
9559/// guidelines.
9560///
9561/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9562#[derive(Clone, Debug, PartialEq)]
9563#[non_exhaustive]
9564pub enum RuleView {
9565 /// The default/unset value.
9566 /// The API will default to the BASIC view for ListRules/ListRuleRevisions.
9567 /// The API will default to the FULL view for GetRule.
9568 Unspecified,
9569 /// Include basic metadata about the rule, but not the full contents.
9570 /// Returned fields include: revision_id, revision_create_time, display_name,
9571 /// author, severity, type, allowed_run_frequency,
9572 /// near_real_time_live_rule_eligible, etag, and scope.
9573 /// This is the default value for ListRules and ListRuleRevisions.
9574 Basic,
9575 /// Include all fields.
9576 /// This is the default value for GetRule.
9577 Full,
9578 /// Include basic metadata about the rule's revision only.
9579 /// Returned fields include: revision_id and revision_create_time.
9580 RevisionMetadataOnly,
9581 /// If set, the enum was initialized with an unknown value.
9582 ///
9583 /// Applications can examine the value using [RuleView::value] or
9584 /// [RuleView::name].
9585 UnknownValue(rule_view::UnknownValue),
9586}
9587
9588#[doc(hidden)]
9589pub mod rule_view {
9590 #[allow(unused_imports)]
9591 use super::*;
9592 #[derive(Clone, Debug, PartialEq)]
9593 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9594}
9595
9596impl RuleView {
9597 /// Gets the enum value.
9598 ///
9599 /// Returns `None` if the enum contains an unknown value deserialized from
9600 /// the string representation of enums.
9601 pub fn value(&self) -> std::option::Option<i32> {
9602 match self {
9603 Self::Unspecified => std::option::Option::Some(0),
9604 Self::Basic => std::option::Option::Some(1),
9605 Self::Full => std::option::Option::Some(2),
9606 Self::RevisionMetadataOnly => std::option::Option::Some(3),
9607 Self::UnknownValue(u) => u.0.value(),
9608 }
9609 }
9610
9611 /// Gets the enum value as a string.
9612 ///
9613 /// Returns `None` if the enum contains an unknown value deserialized from
9614 /// the integer representation of enums.
9615 pub fn name(&self) -> std::option::Option<&str> {
9616 match self {
9617 Self::Unspecified => std::option::Option::Some("RULE_VIEW_UNSPECIFIED"),
9618 Self::Basic => std::option::Option::Some("BASIC"),
9619 Self::Full => std::option::Option::Some("FULL"),
9620 Self::RevisionMetadataOnly => std::option::Option::Some("REVISION_METADATA_ONLY"),
9621 Self::UnknownValue(u) => u.0.name(),
9622 }
9623 }
9624}
9625
9626impl std::default::Default for RuleView {
9627 fn default() -> Self {
9628 use std::convert::From;
9629 Self::from(0)
9630 }
9631}
9632
9633impl std::fmt::Display for RuleView {
9634 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9635 wkt::internal::display_enum(f, self.name(), self.value())
9636 }
9637}
9638
9639impl std::convert::From<i32> for RuleView {
9640 fn from(value: i32) -> Self {
9641 match value {
9642 0 => Self::Unspecified,
9643 1 => Self::Basic,
9644 2 => Self::Full,
9645 3 => Self::RevisionMetadataOnly,
9646 _ => Self::UnknownValue(rule_view::UnknownValue(
9647 wkt::internal::UnknownEnumValue::Integer(value),
9648 )),
9649 }
9650 }
9651}
9652
9653impl std::convert::From<&str> for RuleView {
9654 fn from(value: &str) -> Self {
9655 use std::string::ToString;
9656 match value {
9657 "RULE_VIEW_UNSPECIFIED" => Self::Unspecified,
9658 "BASIC" => Self::Basic,
9659 "FULL" => Self::Full,
9660 "REVISION_METADATA_ONLY" => Self::RevisionMetadataOnly,
9661 _ => Self::UnknownValue(rule_view::UnknownValue(
9662 wkt::internal::UnknownEnumValue::String(value.to_string()),
9663 )),
9664 }
9665 }
9666}
9667
9668impl serde::ser::Serialize for RuleView {
9669 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9670 where
9671 S: serde::Serializer,
9672 {
9673 match self {
9674 Self::Unspecified => serializer.serialize_i32(0),
9675 Self::Basic => serializer.serialize_i32(1),
9676 Self::Full => serializer.serialize_i32(2),
9677 Self::RevisionMetadataOnly => serializer.serialize_i32(3),
9678 Self::UnknownValue(u) => u.0.serialize(serializer),
9679 }
9680 }
9681}
9682
9683impl<'de> serde::de::Deserialize<'de> for RuleView {
9684 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9685 where
9686 D: serde::Deserializer<'de>,
9687 {
9688 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleView>::new(
9689 ".google.cloud.chronicle.v1.RuleView",
9690 ))
9691 }
9692}