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_type;
27extern crate lazy_static;
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 pub fn new() -> Self {
61 std::default::Default::default()
62 }
63
64 /// Sets the value of [parent][crate::model::CreateDataAccessLabelRequest::parent].
65 ///
66 /// # Example
67 /// ```ignore,no_run
68 /// # use google_cloud_chronicle_v1::model::CreateDataAccessLabelRequest;
69 /// let x = CreateDataAccessLabelRequest::new().set_parent("example");
70 /// ```
71 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
72 self.parent = v.into();
73 self
74 }
75
76 /// Sets the value of [data_access_label][crate::model::CreateDataAccessLabelRequest::data_access_label].
77 ///
78 /// # Example
79 /// ```ignore,no_run
80 /// # use google_cloud_chronicle_v1::model::CreateDataAccessLabelRequest;
81 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
82 /// let x = CreateDataAccessLabelRequest::new().set_data_access_label(DataAccessLabel::default()/* use setters */);
83 /// ```
84 pub fn set_data_access_label<T>(mut self, v: T) -> Self
85 where
86 T: std::convert::Into<crate::model::DataAccessLabel>,
87 {
88 self.data_access_label = std::option::Option::Some(v.into());
89 self
90 }
91
92 /// Sets or clears the value of [data_access_label][crate::model::CreateDataAccessLabelRequest::data_access_label].
93 ///
94 /// # Example
95 /// ```ignore,no_run
96 /// # use google_cloud_chronicle_v1::model::CreateDataAccessLabelRequest;
97 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
98 /// let x = CreateDataAccessLabelRequest::new().set_or_clear_data_access_label(Some(DataAccessLabel::default()/* use setters */));
99 /// let x = CreateDataAccessLabelRequest::new().set_or_clear_data_access_label(None::<DataAccessLabel>);
100 /// ```
101 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
102 where
103 T: std::convert::Into<crate::model::DataAccessLabel>,
104 {
105 self.data_access_label = v.map(|x| x.into());
106 self
107 }
108
109 /// Sets the value of [data_access_label_id][crate::model::CreateDataAccessLabelRequest::data_access_label_id].
110 ///
111 /// # Example
112 /// ```ignore,no_run
113 /// # use google_cloud_chronicle_v1::model::CreateDataAccessLabelRequest;
114 /// let x = CreateDataAccessLabelRequest::new().set_data_access_label_id("example");
115 /// ```
116 pub fn set_data_access_label_id<T: std::convert::Into<std::string::String>>(
117 mut self,
118 v: T,
119 ) -> Self {
120 self.data_access_label_id = v.into();
121 self
122 }
123}
124
125impl wkt::message::Message for CreateDataAccessLabelRequest {
126 fn typename() -> &'static str {
127 "type.googleapis.com/google.cloud.chronicle.v1.CreateDataAccessLabelRequest"
128 }
129}
130
131/// Request message to retrieve a data access label.
132#[derive(Clone, Default, PartialEq)]
133#[non_exhaustive]
134pub struct GetDataAccessLabelRequest {
135 /// Required. The ID of the data access label to retrieve.
136 /// Format:
137 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}`
138 pub name: std::string::String,
139
140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
141}
142
143impl GetDataAccessLabelRequest {
144 pub fn new() -> Self {
145 std::default::Default::default()
146 }
147
148 /// Sets the value of [name][crate::model::GetDataAccessLabelRequest::name].
149 ///
150 /// # Example
151 /// ```ignore,no_run
152 /// # use google_cloud_chronicle_v1::model::GetDataAccessLabelRequest;
153 /// let x = GetDataAccessLabelRequest::new().set_name("example");
154 /// ```
155 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
156 self.name = v.into();
157 self
158 }
159}
160
161impl wkt::message::Message for GetDataAccessLabelRequest {
162 fn typename() -> &'static str {
163 "type.googleapis.com/google.cloud.chronicle.v1.GetDataAccessLabelRequest"
164 }
165}
166
167/// Request message for ListDataAccessLabels.
168#[derive(Clone, Default, PartialEq)]
169#[non_exhaustive]
170pub struct ListDataAccessLabelsRequest {
171 /// Required. The parent resource where this data access label will be created.
172 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
173 pub parent: std::string::String,
174
175 /// The maximum number of data access labels to return. The service may return
176 /// fewer than this value. If unspecified, at most 100 data access labels will
177 /// be returned. The maximum value is 1000; values above 1000 will be coerced
178 /// to 1000.
179 pub page_size: i32,
180
181 /// A page token, received from a previous `ListDataAccessLabelsRequest` call.
182 /// Provide this to retrieve the subsequent page.
183 pub page_token: std::string::String,
184
185 /// Optional. A filter which should follow the guidelines of AIP-160.
186 /// Supports filtering on all fieds of DataAccessLabel and all operations as
187 /// mentioned in <https://google.aip.dev/160>.
188 /// example filter: "create_time greater than \"2023-04-21T11:30:00-04:00\" OR
189 /// display_name:\"-21-1\"".
190 pub filter: std::string::String,
191
192 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
193}
194
195impl ListDataAccessLabelsRequest {
196 pub fn new() -> Self {
197 std::default::Default::default()
198 }
199
200 /// Sets the value of [parent][crate::model::ListDataAccessLabelsRequest::parent].
201 ///
202 /// # Example
203 /// ```ignore,no_run
204 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsRequest;
205 /// let x = ListDataAccessLabelsRequest::new().set_parent("example");
206 /// ```
207 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
208 self.parent = v.into();
209 self
210 }
211
212 /// Sets the value of [page_size][crate::model::ListDataAccessLabelsRequest::page_size].
213 ///
214 /// # Example
215 /// ```ignore,no_run
216 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsRequest;
217 /// let x = ListDataAccessLabelsRequest::new().set_page_size(42);
218 /// ```
219 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
220 self.page_size = v.into();
221 self
222 }
223
224 /// Sets the value of [page_token][crate::model::ListDataAccessLabelsRequest::page_token].
225 ///
226 /// # Example
227 /// ```ignore,no_run
228 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsRequest;
229 /// let x = ListDataAccessLabelsRequest::new().set_page_token("example");
230 /// ```
231 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
232 self.page_token = v.into();
233 self
234 }
235
236 /// Sets the value of [filter][crate::model::ListDataAccessLabelsRequest::filter].
237 ///
238 /// # Example
239 /// ```ignore,no_run
240 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsRequest;
241 /// let x = ListDataAccessLabelsRequest::new().set_filter("example");
242 /// ```
243 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
244 self.filter = v.into();
245 self
246 }
247}
248
249impl wkt::message::Message for ListDataAccessLabelsRequest {
250 fn typename() -> &'static str {
251 "type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessLabelsRequest"
252 }
253}
254
255/// Response message for ListDataAccessLabels.
256#[derive(Clone, Default, PartialEq)]
257#[non_exhaustive]
258pub struct ListDataAccessLabelsResponse {
259 /// List of data access labels.
260 pub data_access_labels: std::vec::Vec<crate::model::DataAccessLabel>,
261
262 /// A token, which can be sent as `page_token` to retrieve the next page.
263 /// If this field is omitted, there are no subsequent pages.
264 pub next_page_token: std::string::String,
265
266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
267}
268
269impl ListDataAccessLabelsResponse {
270 pub fn new() -> Self {
271 std::default::Default::default()
272 }
273
274 /// Sets the value of [data_access_labels][crate::model::ListDataAccessLabelsResponse::data_access_labels].
275 ///
276 /// # Example
277 /// ```ignore,no_run
278 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsResponse;
279 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
280 /// let x = ListDataAccessLabelsResponse::new()
281 /// .set_data_access_labels([
282 /// DataAccessLabel::default()/* use setters */,
283 /// DataAccessLabel::default()/* use (different) setters */,
284 /// ]);
285 /// ```
286 pub fn set_data_access_labels<T, V>(mut self, v: T) -> Self
287 where
288 T: std::iter::IntoIterator<Item = V>,
289 V: std::convert::Into<crate::model::DataAccessLabel>,
290 {
291 use std::iter::Iterator;
292 self.data_access_labels = v.into_iter().map(|i| i.into()).collect();
293 self
294 }
295
296 /// Sets the value of [next_page_token][crate::model::ListDataAccessLabelsResponse::next_page_token].
297 ///
298 /// # Example
299 /// ```ignore,no_run
300 /// # use google_cloud_chronicle_v1::model::ListDataAccessLabelsResponse;
301 /// let x = ListDataAccessLabelsResponse::new().set_next_page_token("example");
302 /// ```
303 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
304 self.next_page_token = v.into();
305 self
306 }
307}
308
309impl wkt::message::Message for ListDataAccessLabelsResponse {
310 fn typename() -> &'static str {
311 "type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessLabelsResponse"
312 }
313}
314
315#[doc(hidden)]
316impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAccessLabelsResponse {
317 type PageItem = crate::model::DataAccessLabel;
318
319 fn items(self) -> std::vec::Vec<Self::PageItem> {
320 self.data_access_labels
321 }
322
323 fn next_page_token(&self) -> std::string::String {
324 use std::clone::Clone;
325 self.next_page_token.clone()
326 }
327}
328
329/// Request message for UpdateDataAccessLabel method.
330#[derive(Clone, Default, PartialEq)]
331#[non_exhaustive]
332pub struct UpdateDataAccessLabelRequest {
333 /// Required. The data access label to update.
334 ///
335 /// The label's `name` field is used to identify the label to update.
336 /// Format:
337 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}`
338 pub data_access_label: std::option::Option<crate::model::DataAccessLabel>,
339
340 /// The list of fields to update. If not included, all fields with a non-empty
341 /// value will be overwritten. Currently, only the description and definition
342 /// fields are supported for update; an update call that attempts to update any
343 /// other fields will return INVALID_ARGUMENT.
344 pub update_mask: std::option::Option<wkt::FieldMask>,
345
346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
347}
348
349impl UpdateDataAccessLabelRequest {
350 pub fn new() -> Self {
351 std::default::Default::default()
352 }
353
354 /// Sets the value of [data_access_label][crate::model::UpdateDataAccessLabelRequest::data_access_label].
355 ///
356 /// # Example
357 /// ```ignore,no_run
358 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessLabelRequest;
359 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
360 /// let x = UpdateDataAccessLabelRequest::new().set_data_access_label(DataAccessLabel::default()/* use setters */);
361 /// ```
362 pub fn set_data_access_label<T>(mut self, v: T) -> Self
363 where
364 T: std::convert::Into<crate::model::DataAccessLabel>,
365 {
366 self.data_access_label = std::option::Option::Some(v.into());
367 self
368 }
369
370 /// Sets or clears the value of [data_access_label][crate::model::UpdateDataAccessLabelRequest::data_access_label].
371 ///
372 /// # Example
373 /// ```ignore,no_run
374 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessLabelRequest;
375 /// use google_cloud_chronicle_v1::model::DataAccessLabel;
376 /// let x = UpdateDataAccessLabelRequest::new().set_or_clear_data_access_label(Some(DataAccessLabel::default()/* use setters */));
377 /// let x = UpdateDataAccessLabelRequest::new().set_or_clear_data_access_label(None::<DataAccessLabel>);
378 /// ```
379 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
380 where
381 T: std::convert::Into<crate::model::DataAccessLabel>,
382 {
383 self.data_access_label = v.map(|x| x.into());
384 self
385 }
386
387 /// Sets the value of [update_mask][crate::model::UpdateDataAccessLabelRequest::update_mask].
388 ///
389 /// # Example
390 /// ```ignore,no_run
391 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessLabelRequest;
392 /// use wkt::FieldMask;
393 /// let x = UpdateDataAccessLabelRequest::new().set_update_mask(FieldMask::default()/* use setters */);
394 /// ```
395 pub fn set_update_mask<T>(mut self, v: T) -> Self
396 where
397 T: std::convert::Into<wkt::FieldMask>,
398 {
399 self.update_mask = std::option::Option::Some(v.into());
400 self
401 }
402
403 /// Sets or clears the value of [update_mask][crate::model::UpdateDataAccessLabelRequest::update_mask].
404 ///
405 /// # Example
406 /// ```ignore,no_run
407 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessLabelRequest;
408 /// use wkt::FieldMask;
409 /// let x = UpdateDataAccessLabelRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
410 /// let x = UpdateDataAccessLabelRequest::new().set_or_clear_update_mask(None::<FieldMask>);
411 /// ```
412 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
413 where
414 T: std::convert::Into<wkt::FieldMask>,
415 {
416 self.update_mask = v.map(|x| x.into());
417 self
418 }
419}
420
421impl wkt::message::Message for UpdateDataAccessLabelRequest {
422 fn typename() -> &'static str {
423 "type.googleapis.com/google.cloud.chronicle.v1.UpdateDataAccessLabelRequest"
424 }
425}
426
427/// Request message to delete a data access label.
428#[derive(Clone, Default, PartialEq)]
429#[non_exhaustive]
430pub struct DeleteDataAccessLabelRequest {
431 /// Required. The ID of the data access label to delete.
432 /// Format:
433 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessLabels/{data_access_label}`
434 pub name: std::string::String,
435
436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
437}
438
439impl DeleteDataAccessLabelRequest {
440 pub fn new() -> Self {
441 std::default::Default::default()
442 }
443
444 /// Sets the value of [name][crate::model::DeleteDataAccessLabelRequest::name].
445 ///
446 /// # Example
447 /// ```ignore,no_run
448 /// # use google_cloud_chronicle_v1::model::DeleteDataAccessLabelRequest;
449 /// let x = DeleteDataAccessLabelRequest::new().set_name("example");
450 /// ```
451 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
452 self.name = v.into();
453 self
454 }
455}
456
457impl wkt::message::Message for DeleteDataAccessLabelRequest {
458 fn typename() -> &'static str {
459 "type.googleapis.com/google.cloud.chronicle.v1.DeleteDataAccessLabelRequest"
460 }
461}
462
463/// Request message for CreateDataAccessScope.
464#[derive(Clone, Default, PartialEq)]
465#[non_exhaustive]
466pub struct CreateDataAccessScopeRequest {
467 /// Required. The parent resource where this Data Access Scope will be created.
468 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
469 pub parent: std::string::String,
470
471 /// Required. Data access scope to create.
472 pub data_access_scope: std::option::Option<crate::model::DataAccessScope>,
473
474 /// Required. The user provided scope id which will become the last part of the
475 /// name of the scope resource. Needs to be compliant with
476 /// <https://google.aip.dev/122>
477 pub data_access_scope_id: std::string::String,
478
479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
480}
481
482impl CreateDataAccessScopeRequest {
483 pub fn new() -> Self {
484 std::default::Default::default()
485 }
486
487 /// Sets the value of [parent][crate::model::CreateDataAccessScopeRequest::parent].
488 ///
489 /// # Example
490 /// ```ignore,no_run
491 /// # use google_cloud_chronicle_v1::model::CreateDataAccessScopeRequest;
492 /// let x = CreateDataAccessScopeRequest::new().set_parent("example");
493 /// ```
494 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
495 self.parent = v.into();
496 self
497 }
498
499 /// Sets the value of [data_access_scope][crate::model::CreateDataAccessScopeRequest::data_access_scope].
500 ///
501 /// # Example
502 /// ```ignore,no_run
503 /// # use google_cloud_chronicle_v1::model::CreateDataAccessScopeRequest;
504 /// use google_cloud_chronicle_v1::model::DataAccessScope;
505 /// let x = CreateDataAccessScopeRequest::new().set_data_access_scope(DataAccessScope::default()/* use setters */);
506 /// ```
507 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
508 where
509 T: std::convert::Into<crate::model::DataAccessScope>,
510 {
511 self.data_access_scope = std::option::Option::Some(v.into());
512 self
513 }
514
515 /// Sets or clears the value of [data_access_scope][crate::model::CreateDataAccessScopeRequest::data_access_scope].
516 ///
517 /// # Example
518 /// ```ignore,no_run
519 /// # use google_cloud_chronicle_v1::model::CreateDataAccessScopeRequest;
520 /// use google_cloud_chronicle_v1::model::DataAccessScope;
521 /// let x = CreateDataAccessScopeRequest::new().set_or_clear_data_access_scope(Some(DataAccessScope::default()/* use setters */));
522 /// let x = CreateDataAccessScopeRequest::new().set_or_clear_data_access_scope(None::<DataAccessScope>);
523 /// ```
524 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
525 where
526 T: std::convert::Into<crate::model::DataAccessScope>,
527 {
528 self.data_access_scope = v.map(|x| x.into());
529 self
530 }
531
532 /// Sets the value of [data_access_scope_id][crate::model::CreateDataAccessScopeRequest::data_access_scope_id].
533 ///
534 /// # Example
535 /// ```ignore,no_run
536 /// # use google_cloud_chronicle_v1::model::CreateDataAccessScopeRequest;
537 /// let x = CreateDataAccessScopeRequest::new().set_data_access_scope_id("example");
538 /// ```
539 pub fn set_data_access_scope_id<T: std::convert::Into<std::string::String>>(
540 mut self,
541 v: T,
542 ) -> Self {
543 self.data_access_scope_id = v.into();
544 self
545 }
546}
547
548impl wkt::message::Message for CreateDataAccessScopeRequest {
549 fn typename() -> &'static str {
550 "type.googleapis.com/google.cloud.chronicle.v1.CreateDataAccessScopeRequest"
551 }
552}
553
554/// Request message to retrieve a data access scope.
555#[derive(Clone, Default, PartialEq)]
556#[non_exhaustive]
557pub struct GetDataAccessScopeRequest {
558 /// Required. The ID of the data access scope to retrieve.
559 /// Format:
560 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}`
561 pub name: std::string::String,
562
563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
564}
565
566impl GetDataAccessScopeRequest {
567 pub fn new() -> Self {
568 std::default::Default::default()
569 }
570
571 /// Sets the value of [name][crate::model::GetDataAccessScopeRequest::name].
572 ///
573 /// # Example
574 /// ```ignore,no_run
575 /// # use google_cloud_chronicle_v1::model::GetDataAccessScopeRequest;
576 /// let x = GetDataAccessScopeRequest::new().set_name("example");
577 /// ```
578 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
579 self.name = v.into();
580 self
581 }
582}
583
584impl wkt::message::Message for GetDataAccessScopeRequest {
585 fn typename() -> &'static str {
586 "type.googleapis.com/google.cloud.chronicle.v1.GetDataAccessScopeRequest"
587 }
588}
589
590/// Request message for ListDataAccessScopes.
591#[derive(Clone, Default, PartialEq)]
592#[non_exhaustive]
593pub struct ListDataAccessScopesRequest {
594 /// Required. The parent resource where this data access scope will be created.
595 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
596 pub parent: std::string::String,
597
598 /// The maximum number of data access scopes to return. The service may return
599 /// fewer than this value. If unspecified, at most 100 data access scopes will
600 /// be returned. The maximum value is 1000; values above 1000 will be coerced
601 /// to 1000.
602 pub page_size: i32,
603
604 /// A page token, received from a previous `ListDataAccessScopesRequest` call.
605 /// Provide this to retrieve the subsequent page.
606 pub page_token: std::string::String,
607
608 /// Optional. A filter which should follow the guidelines of AIP-160.
609 /// Supports filtering on all fieds of DataAccessScope and all operations as
610 /// mentioned in <https://google.aip.dev/160>.
611 /// example filter: "create_time greater than \"2023-04-21T11:30:00-04:00\" OR
612 /// display_name:\"-21-1\"".
613 pub filter: std::string::String,
614
615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
616}
617
618impl ListDataAccessScopesRequest {
619 pub fn new() -> Self {
620 std::default::Default::default()
621 }
622
623 /// Sets the value of [parent][crate::model::ListDataAccessScopesRequest::parent].
624 ///
625 /// # Example
626 /// ```ignore,no_run
627 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesRequest;
628 /// let x = ListDataAccessScopesRequest::new().set_parent("example");
629 /// ```
630 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
631 self.parent = v.into();
632 self
633 }
634
635 /// Sets the value of [page_size][crate::model::ListDataAccessScopesRequest::page_size].
636 ///
637 /// # Example
638 /// ```ignore,no_run
639 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesRequest;
640 /// let x = ListDataAccessScopesRequest::new().set_page_size(42);
641 /// ```
642 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
643 self.page_size = v.into();
644 self
645 }
646
647 /// Sets the value of [page_token][crate::model::ListDataAccessScopesRequest::page_token].
648 ///
649 /// # Example
650 /// ```ignore,no_run
651 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesRequest;
652 /// let x = ListDataAccessScopesRequest::new().set_page_token("example");
653 /// ```
654 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
655 self.page_token = v.into();
656 self
657 }
658
659 /// Sets the value of [filter][crate::model::ListDataAccessScopesRequest::filter].
660 ///
661 /// # Example
662 /// ```ignore,no_run
663 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesRequest;
664 /// let x = ListDataAccessScopesRequest::new().set_filter("example");
665 /// ```
666 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
667 self.filter = v.into();
668 self
669 }
670}
671
672impl wkt::message::Message for ListDataAccessScopesRequest {
673 fn typename() -> &'static str {
674 "type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessScopesRequest"
675 }
676}
677
678/// Response message for ListDataAccessScopes.
679#[derive(Clone, Default, PartialEq)]
680#[non_exhaustive]
681pub struct ListDataAccessScopesResponse {
682 /// List of data access scopes.
683 pub data_access_scopes: std::vec::Vec<crate::model::DataAccessScope>,
684
685 /// Whether or not global scope is granted to the user.
686 pub global_data_access_scope_granted: std::option::Option<bool>,
687
688 /// A token, which can be sent as `page_token` to retrieve the next page.
689 /// If this field is omitted, there are no subsequent pages.
690 pub next_page_token: std::string::String,
691
692 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
693}
694
695impl ListDataAccessScopesResponse {
696 pub fn new() -> Self {
697 std::default::Default::default()
698 }
699
700 /// Sets the value of [data_access_scopes][crate::model::ListDataAccessScopesResponse::data_access_scopes].
701 ///
702 /// # Example
703 /// ```ignore,no_run
704 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesResponse;
705 /// use google_cloud_chronicle_v1::model::DataAccessScope;
706 /// let x = ListDataAccessScopesResponse::new()
707 /// .set_data_access_scopes([
708 /// DataAccessScope::default()/* use setters */,
709 /// DataAccessScope::default()/* use (different) setters */,
710 /// ]);
711 /// ```
712 pub fn set_data_access_scopes<T, V>(mut self, v: T) -> Self
713 where
714 T: std::iter::IntoIterator<Item = V>,
715 V: std::convert::Into<crate::model::DataAccessScope>,
716 {
717 use std::iter::Iterator;
718 self.data_access_scopes = v.into_iter().map(|i| i.into()).collect();
719 self
720 }
721
722 /// Sets the value of [global_data_access_scope_granted][crate::model::ListDataAccessScopesResponse::global_data_access_scope_granted].
723 ///
724 /// # Example
725 /// ```ignore,no_run
726 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesResponse;
727 /// let x = ListDataAccessScopesResponse::new().set_global_data_access_scope_granted(true);
728 /// ```
729 pub fn set_global_data_access_scope_granted<T>(mut self, v: T) -> Self
730 where
731 T: std::convert::Into<bool>,
732 {
733 self.global_data_access_scope_granted = std::option::Option::Some(v.into());
734 self
735 }
736
737 /// Sets or clears the value of [global_data_access_scope_granted][crate::model::ListDataAccessScopesResponse::global_data_access_scope_granted].
738 ///
739 /// # Example
740 /// ```ignore,no_run
741 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesResponse;
742 /// let x = ListDataAccessScopesResponse::new().set_or_clear_global_data_access_scope_granted(Some(false));
743 /// let x = ListDataAccessScopesResponse::new().set_or_clear_global_data_access_scope_granted(None::<bool>);
744 /// ```
745 pub fn set_or_clear_global_data_access_scope_granted<T>(
746 mut self,
747 v: std::option::Option<T>,
748 ) -> Self
749 where
750 T: std::convert::Into<bool>,
751 {
752 self.global_data_access_scope_granted = v.map(|x| x.into());
753 self
754 }
755
756 /// Sets the value of [next_page_token][crate::model::ListDataAccessScopesResponse::next_page_token].
757 ///
758 /// # Example
759 /// ```ignore,no_run
760 /// # use google_cloud_chronicle_v1::model::ListDataAccessScopesResponse;
761 /// let x = ListDataAccessScopesResponse::new().set_next_page_token("example");
762 /// ```
763 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
764 self.next_page_token = v.into();
765 self
766 }
767}
768
769impl wkt::message::Message for ListDataAccessScopesResponse {
770 fn typename() -> &'static str {
771 "type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessScopesResponse"
772 }
773}
774
775#[doc(hidden)]
776impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAccessScopesResponse {
777 type PageItem = crate::model::DataAccessScope;
778
779 fn items(self) -> std::vec::Vec<Self::PageItem> {
780 self.data_access_scopes
781 }
782
783 fn next_page_token(&self) -> std::string::String {
784 use std::clone::Clone;
785 self.next_page_token.clone()
786 }
787}
788
789/// Request message for UpdateDataAccessScope method.
790#[derive(Clone, Default, PartialEq)]
791#[non_exhaustive]
792pub struct UpdateDataAccessScopeRequest {
793 /// Required. The data access scope to update.
794 ///
795 /// The scope's `name` field is used to identify the scope to update.
796 /// Format:
797 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}`
798 pub data_access_scope: std::option::Option<crate::model::DataAccessScope>,
799
800 /// The list of fields to update. If not included, all fields with a non-empty
801 /// value will be overwritten. Currently, only the description, the allowed
802 /// and denied labels list fields are supported for update;
803 /// an update call that attempts to update any
804 /// other fields will return INVALID_ARGUMENT.
805 pub update_mask: std::option::Option<wkt::FieldMask>,
806
807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
808}
809
810impl UpdateDataAccessScopeRequest {
811 pub fn new() -> Self {
812 std::default::Default::default()
813 }
814
815 /// Sets the value of [data_access_scope][crate::model::UpdateDataAccessScopeRequest::data_access_scope].
816 ///
817 /// # Example
818 /// ```ignore,no_run
819 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessScopeRequest;
820 /// use google_cloud_chronicle_v1::model::DataAccessScope;
821 /// let x = UpdateDataAccessScopeRequest::new().set_data_access_scope(DataAccessScope::default()/* use setters */);
822 /// ```
823 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
824 where
825 T: std::convert::Into<crate::model::DataAccessScope>,
826 {
827 self.data_access_scope = std::option::Option::Some(v.into());
828 self
829 }
830
831 /// Sets or clears the value of [data_access_scope][crate::model::UpdateDataAccessScopeRequest::data_access_scope].
832 ///
833 /// # Example
834 /// ```ignore,no_run
835 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessScopeRequest;
836 /// use google_cloud_chronicle_v1::model::DataAccessScope;
837 /// let x = UpdateDataAccessScopeRequest::new().set_or_clear_data_access_scope(Some(DataAccessScope::default()/* use setters */));
838 /// let x = UpdateDataAccessScopeRequest::new().set_or_clear_data_access_scope(None::<DataAccessScope>);
839 /// ```
840 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
841 where
842 T: std::convert::Into<crate::model::DataAccessScope>,
843 {
844 self.data_access_scope = v.map(|x| x.into());
845 self
846 }
847
848 /// Sets the value of [update_mask][crate::model::UpdateDataAccessScopeRequest::update_mask].
849 ///
850 /// # Example
851 /// ```ignore,no_run
852 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessScopeRequest;
853 /// use wkt::FieldMask;
854 /// let x = UpdateDataAccessScopeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
855 /// ```
856 pub fn set_update_mask<T>(mut self, v: T) -> Self
857 where
858 T: std::convert::Into<wkt::FieldMask>,
859 {
860 self.update_mask = std::option::Option::Some(v.into());
861 self
862 }
863
864 /// Sets or clears the value of [update_mask][crate::model::UpdateDataAccessScopeRequest::update_mask].
865 ///
866 /// # Example
867 /// ```ignore,no_run
868 /// # use google_cloud_chronicle_v1::model::UpdateDataAccessScopeRequest;
869 /// use wkt::FieldMask;
870 /// let x = UpdateDataAccessScopeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
871 /// let x = UpdateDataAccessScopeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
872 /// ```
873 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
874 where
875 T: std::convert::Into<wkt::FieldMask>,
876 {
877 self.update_mask = v.map(|x| x.into());
878 self
879 }
880}
881
882impl wkt::message::Message for UpdateDataAccessScopeRequest {
883 fn typename() -> &'static str {
884 "type.googleapis.com/google.cloud.chronicle.v1.UpdateDataAccessScopeRequest"
885 }
886}
887
888/// Request message to delete a data access scope.
889#[derive(Clone, Default, PartialEq)]
890#[non_exhaustive]
891pub struct DeleteDataAccessScopeRequest {
892 /// Required. The ID of the data access scope to delete.
893 /// Format:
894 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{data_access_scope}`
895 pub name: std::string::String,
896
897 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
898}
899
900impl DeleteDataAccessScopeRequest {
901 pub fn new() -> Self {
902 std::default::Default::default()
903 }
904
905 /// Sets the value of [name][crate::model::DeleteDataAccessScopeRequest::name].
906 ///
907 /// # Example
908 /// ```ignore,no_run
909 /// # use google_cloud_chronicle_v1::model::DeleteDataAccessScopeRequest;
910 /// let x = DeleteDataAccessScopeRequest::new().set_name("example");
911 /// ```
912 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
913 self.name = v.into();
914 self
915 }
916}
917
918impl wkt::message::Message for DeleteDataAccessScopeRequest {
919 fn typename() -> &'static str {
920 "type.googleapis.com/google.cloud.chronicle.v1.DeleteDataAccessScopeRequest"
921 }
922}
923
924/// A DataAccessLabel is a label on events to define user access to data.
925#[derive(Clone, Default, PartialEq)]
926#[non_exhaustive]
927pub struct DataAccessLabel {
928 /// The unique resource name of the data access label.
929 pub name: std::string::String,
930
931 /// Output only. The short name displayed for the label as it appears on event
932 /// data.
933 pub display_name: std::string::String,
934
935 /// Output only. The time at which the data access label was created.
936 pub create_time: std::option::Option<wkt::Timestamp>,
937
938 /// Output only. The time at which the data access label was last updated.
939 pub update_time: std::option::Option<wkt::Timestamp>,
940
941 /// Output only. The user who created the data access label.
942 pub author: std::string::String,
943
944 /// Output only. The user who last updated the data access label.
945 pub last_editor: std::string::String,
946
947 /// Optional. A description of the data access label for a human reader.
948 pub description: std::string::String,
949
950 /// Required.
951 /// The definition of the data access label that determines which
952 /// data gets tagged with this label.
953 pub definition: std::option::Option<crate::model::data_access_label::Definition>,
954
955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
956}
957
958impl DataAccessLabel {
959 pub fn new() -> Self {
960 std::default::Default::default()
961 }
962
963 /// Sets the value of [name][crate::model::DataAccessLabel::name].
964 ///
965 /// # Example
966 /// ```ignore,no_run
967 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
968 /// let x = DataAccessLabel::new().set_name("example");
969 /// ```
970 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
971 self.name = v.into();
972 self
973 }
974
975 /// Sets the value of [display_name][crate::model::DataAccessLabel::display_name].
976 ///
977 /// # Example
978 /// ```ignore,no_run
979 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
980 /// let x = DataAccessLabel::new().set_display_name("example");
981 /// ```
982 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
983 self.display_name = v.into();
984 self
985 }
986
987 /// Sets the value of [create_time][crate::model::DataAccessLabel::create_time].
988 ///
989 /// # Example
990 /// ```ignore,no_run
991 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
992 /// use wkt::Timestamp;
993 /// let x = DataAccessLabel::new().set_create_time(Timestamp::default()/* use setters */);
994 /// ```
995 pub fn set_create_time<T>(mut self, v: T) -> Self
996 where
997 T: std::convert::Into<wkt::Timestamp>,
998 {
999 self.create_time = std::option::Option::Some(v.into());
1000 self
1001 }
1002
1003 /// Sets or clears the value of [create_time][crate::model::DataAccessLabel::create_time].
1004 ///
1005 /// # Example
1006 /// ```ignore,no_run
1007 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1008 /// use wkt::Timestamp;
1009 /// let x = DataAccessLabel::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1010 /// let x = DataAccessLabel::new().set_or_clear_create_time(None::<Timestamp>);
1011 /// ```
1012 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1013 where
1014 T: std::convert::Into<wkt::Timestamp>,
1015 {
1016 self.create_time = v.map(|x| x.into());
1017 self
1018 }
1019
1020 /// Sets the value of [update_time][crate::model::DataAccessLabel::update_time].
1021 ///
1022 /// # Example
1023 /// ```ignore,no_run
1024 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1025 /// use wkt::Timestamp;
1026 /// let x = DataAccessLabel::new().set_update_time(Timestamp::default()/* use setters */);
1027 /// ```
1028 pub fn set_update_time<T>(mut self, v: T) -> Self
1029 where
1030 T: std::convert::Into<wkt::Timestamp>,
1031 {
1032 self.update_time = std::option::Option::Some(v.into());
1033 self
1034 }
1035
1036 /// Sets or clears the value of [update_time][crate::model::DataAccessLabel::update_time].
1037 ///
1038 /// # Example
1039 /// ```ignore,no_run
1040 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1041 /// use wkt::Timestamp;
1042 /// let x = DataAccessLabel::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1043 /// let x = DataAccessLabel::new().set_or_clear_update_time(None::<Timestamp>);
1044 /// ```
1045 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1046 where
1047 T: std::convert::Into<wkt::Timestamp>,
1048 {
1049 self.update_time = v.map(|x| x.into());
1050 self
1051 }
1052
1053 /// Sets the value of [author][crate::model::DataAccessLabel::author].
1054 ///
1055 /// # Example
1056 /// ```ignore,no_run
1057 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1058 /// let x = DataAccessLabel::new().set_author("example");
1059 /// ```
1060 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1061 self.author = v.into();
1062 self
1063 }
1064
1065 /// Sets the value of [last_editor][crate::model::DataAccessLabel::last_editor].
1066 ///
1067 /// # Example
1068 /// ```ignore,no_run
1069 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1070 /// let x = DataAccessLabel::new().set_last_editor("example");
1071 /// ```
1072 pub fn set_last_editor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1073 self.last_editor = v.into();
1074 self
1075 }
1076
1077 /// Sets the value of [description][crate::model::DataAccessLabel::description].
1078 ///
1079 /// # Example
1080 /// ```ignore,no_run
1081 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1082 /// let x = DataAccessLabel::new().set_description("example");
1083 /// ```
1084 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1085 self.description = v.into();
1086 self
1087 }
1088
1089 /// Sets the value of [definition][crate::model::DataAccessLabel::definition].
1090 ///
1091 /// Note that all the setters affecting `definition` are mutually
1092 /// exclusive.
1093 ///
1094 /// # Example
1095 /// ```ignore,no_run
1096 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1097 /// use google_cloud_chronicle_v1::model::data_access_label::Definition;
1098 /// let x = DataAccessLabel::new().set_definition(Some(Definition::UdmQuery("example".to_string())));
1099 /// ```
1100 pub fn set_definition<
1101 T: std::convert::Into<std::option::Option<crate::model::data_access_label::Definition>>,
1102 >(
1103 mut self,
1104 v: T,
1105 ) -> Self {
1106 self.definition = v.into();
1107 self
1108 }
1109
1110 /// The value of [definition][crate::model::DataAccessLabel::definition]
1111 /// if it holds a `UdmQuery`, `None` if the field is not set or
1112 /// holds a different branch.
1113 pub fn udm_query(&self) -> std::option::Option<&std::string::String> {
1114 #[allow(unreachable_patterns)]
1115 self.definition.as_ref().and_then(|v| match v {
1116 crate::model::data_access_label::Definition::UdmQuery(v) => {
1117 std::option::Option::Some(v)
1118 }
1119 _ => std::option::Option::None,
1120 })
1121 }
1122
1123 /// Sets the value of [definition][crate::model::DataAccessLabel::definition]
1124 /// to hold a `UdmQuery`.
1125 ///
1126 /// Note that all the setters affecting `definition` are
1127 /// mutually exclusive.
1128 ///
1129 /// # Example
1130 /// ```ignore,no_run
1131 /// # use google_cloud_chronicle_v1::model::DataAccessLabel;
1132 /// let x = DataAccessLabel::new().set_udm_query("example");
1133 /// assert!(x.udm_query().is_some());
1134 /// ```
1135 pub fn set_udm_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1136 self.definition = std::option::Option::Some(
1137 crate::model::data_access_label::Definition::UdmQuery(v.into()),
1138 );
1139 self
1140 }
1141}
1142
1143impl wkt::message::Message for DataAccessLabel {
1144 fn typename() -> &'static str {
1145 "type.googleapis.com/google.cloud.chronicle.v1.DataAccessLabel"
1146 }
1147}
1148
1149/// Defines additional types related to [DataAccessLabel].
1150pub mod data_access_label {
1151 #[allow(unused_imports)]
1152 use super::*;
1153
1154 /// Required.
1155 /// The definition of the data access label that determines which
1156 /// data gets tagged with this label.
1157 #[derive(Clone, Debug, PartialEq)]
1158 #[non_exhaustive]
1159 pub enum Definition {
1160 /// A UDM query over event data.
1161 UdmQuery(std::string::String),
1162 }
1163}
1164
1165/// A DataAccessScope is a boolean expression of data access labels used
1166/// to restrict access to data for users.
1167#[derive(Clone, Default, PartialEq)]
1168#[non_exhaustive]
1169pub struct DataAccessScope {
1170 /// Required. The unique full name of the data access scope.
1171 /// The name should comply with <https://google.aip.dev/122> standards.
1172 pub name: std::string::String,
1173
1174 /// Optional. The allowed labels for the scope.
1175 /// Either allow_all or allowed_data_access_labels needs to be provided.
1176 /// When provided, there has to be at least one label allowed for the scope to
1177 /// be valid.
1178 /// The logical operator for evaluation of the allowed labels is OR.
1179 /// E.g.: A customer with scope with allowed labels A and B will be able
1180 /// to see data with labeled with A or B or (A and B).
1181 pub allowed_data_access_labels: std::vec::Vec<crate::model::DataAccessLabelReference>,
1182
1183 /// Optional. The denied labels for the scope.
1184 /// The logical operator for evaluation of the denied labels is AND.
1185 /// E.g.: A customer with scope with denied labels A and B won't be able
1186 /// to see data labeled with A and data labeled with B
1187 /// and data with labels A and B.
1188 pub denied_data_access_labels: std::vec::Vec<crate::model::DataAccessLabelReference>,
1189
1190 /// Output only. The name to be used for display to customers of the data
1191 /// access scope.
1192 pub display_name: std::string::String,
1193
1194 /// Output only. The time at which the data access scope was created.
1195 pub create_time: std::option::Option<wkt::Timestamp>,
1196
1197 /// Output only. The time at which the data access scope was last updated.
1198 pub update_time: std::option::Option<wkt::Timestamp>,
1199
1200 /// Output only. The user who created the data access scope.
1201 pub author: std::string::String,
1202
1203 /// Output only. The user who last updated the data access scope.
1204 pub last_editor: std::string::String,
1205
1206 /// Optional. A description of the data access scope for a human reader.
1207 pub description: std::string::String,
1208
1209 /// Optional. Whether or not the scope allows all labels, allow_all and
1210 /// allowed_data_access_labels are mutually exclusive and one of them must be
1211 /// present. denied_data_access_labels can still be used along with allow_all.
1212 /// When combined with denied_data_access_labels, access will be granted to all
1213 /// data that doesn't have labels mentioned in denied_data_access_labels. E.g.:
1214 /// A customer with scope with denied labels A and B and allow_all will be able
1215 /// to see all data except data labeled with A and data labeled with B and data
1216 /// with labels A and B.
1217 pub allow_all: bool,
1218
1219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1220}
1221
1222impl DataAccessScope {
1223 pub fn new() -> Self {
1224 std::default::Default::default()
1225 }
1226
1227 /// Sets the value of [name][crate::model::DataAccessScope::name].
1228 ///
1229 /// # Example
1230 /// ```ignore,no_run
1231 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1232 /// let x = DataAccessScope::new().set_name("example");
1233 /// ```
1234 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1235 self.name = v.into();
1236 self
1237 }
1238
1239 /// Sets the value of [allowed_data_access_labels][crate::model::DataAccessScope::allowed_data_access_labels].
1240 ///
1241 /// # Example
1242 /// ```ignore,no_run
1243 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1244 /// use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1245 /// let x = DataAccessScope::new()
1246 /// .set_allowed_data_access_labels([
1247 /// DataAccessLabelReference::default()/* use setters */,
1248 /// DataAccessLabelReference::default()/* use (different) setters */,
1249 /// ]);
1250 /// ```
1251 pub fn set_allowed_data_access_labels<T, V>(mut self, v: T) -> Self
1252 where
1253 T: std::iter::IntoIterator<Item = V>,
1254 V: std::convert::Into<crate::model::DataAccessLabelReference>,
1255 {
1256 use std::iter::Iterator;
1257 self.allowed_data_access_labels = v.into_iter().map(|i| i.into()).collect();
1258 self
1259 }
1260
1261 /// Sets the value of [denied_data_access_labels][crate::model::DataAccessScope::denied_data_access_labels].
1262 ///
1263 /// # Example
1264 /// ```ignore,no_run
1265 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1266 /// use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1267 /// let x = DataAccessScope::new()
1268 /// .set_denied_data_access_labels([
1269 /// DataAccessLabelReference::default()/* use setters */,
1270 /// DataAccessLabelReference::default()/* use (different) setters */,
1271 /// ]);
1272 /// ```
1273 pub fn set_denied_data_access_labels<T, V>(mut self, v: T) -> Self
1274 where
1275 T: std::iter::IntoIterator<Item = V>,
1276 V: std::convert::Into<crate::model::DataAccessLabelReference>,
1277 {
1278 use std::iter::Iterator;
1279 self.denied_data_access_labels = v.into_iter().map(|i| i.into()).collect();
1280 self
1281 }
1282
1283 /// Sets the value of [display_name][crate::model::DataAccessScope::display_name].
1284 ///
1285 /// # Example
1286 /// ```ignore,no_run
1287 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1288 /// let x = DataAccessScope::new().set_display_name("example");
1289 /// ```
1290 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1291 self.display_name = v.into();
1292 self
1293 }
1294
1295 /// Sets the value of [create_time][crate::model::DataAccessScope::create_time].
1296 ///
1297 /// # Example
1298 /// ```ignore,no_run
1299 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1300 /// use wkt::Timestamp;
1301 /// let x = DataAccessScope::new().set_create_time(Timestamp::default()/* use setters */);
1302 /// ```
1303 pub fn set_create_time<T>(mut self, v: T) -> Self
1304 where
1305 T: std::convert::Into<wkt::Timestamp>,
1306 {
1307 self.create_time = std::option::Option::Some(v.into());
1308 self
1309 }
1310
1311 /// Sets or clears the value of [create_time][crate::model::DataAccessScope::create_time].
1312 ///
1313 /// # Example
1314 /// ```ignore,no_run
1315 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1316 /// use wkt::Timestamp;
1317 /// let x = DataAccessScope::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1318 /// let x = DataAccessScope::new().set_or_clear_create_time(None::<Timestamp>);
1319 /// ```
1320 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1321 where
1322 T: std::convert::Into<wkt::Timestamp>,
1323 {
1324 self.create_time = v.map(|x| x.into());
1325 self
1326 }
1327
1328 /// Sets the value of [update_time][crate::model::DataAccessScope::update_time].
1329 ///
1330 /// # Example
1331 /// ```ignore,no_run
1332 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1333 /// use wkt::Timestamp;
1334 /// let x = DataAccessScope::new().set_update_time(Timestamp::default()/* use setters */);
1335 /// ```
1336 pub fn set_update_time<T>(mut self, v: T) -> Self
1337 where
1338 T: std::convert::Into<wkt::Timestamp>,
1339 {
1340 self.update_time = std::option::Option::Some(v.into());
1341 self
1342 }
1343
1344 /// Sets or clears the value of [update_time][crate::model::DataAccessScope::update_time].
1345 ///
1346 /// # Example
1347 /// ```ignore,no_run
1348 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1349 /// use wkt::Timestamp;
1350 /// let x = DataAccessScope::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1351 /// let x = DataAccessScope::new().set_or_clear_update_time(None::<Timestamp>);
1352 /// ```
1353 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1354 where
1355 T: std::convert::Into<wkt::Timestamp>,
1356 {
1357 self.update_time = v.map(|x| x.into());
1358 self
1359 }
1360
1361 /// Sets the value of [author][crate::model::DataAccessScope::author].
1362 ///
1363 /// # Example
1364 /// ```ignore,no_run
1365 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1366 /// let x = DataAccessScope::new().set_author("example");
1367 /// ```
1368 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1369 self.author = v.into();
1370 self
1371 }
1372
1373 /// Sets the value of [last_editor][crate::model::DataAccessScope::last_editor].
1374 ///
1375 /// # Example
1376 /// ```ignore,no_run
1377 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1378 /// let x = DataAccessScope::new().set_last_editor("example");
1379 /// ```
1380 pub fn set_last_editor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1381 self.last_editor = v.into();
1382 self
1383 }
1384
1385 /// Sets the value of [description][crate::model::DataAccessScope::description].
1386 ///
1387 /// # Example
1388 /// ```ignore,no_run
1389 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1390 /// let x = DataAccessScope::new().set_description("example");
1391 /// ```
1392 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1393 self.description = v.into();
1394 self
1395 }
1396
1397 /// Sets the value of [allow_all][crate::model::DataAccessScope::allow_all].
1398 ///
1399 /// # Example
1400 /// ```ignore,no_run
1401 /// # use google_cloud_chronicle_v1::model::DataAccessScope;
1402 /// let x = DataAccessScope::new().set_allow_all(true);
1403 /// ```
1404 pub fn set_allow_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1405 self.allow_all = v.into();
1406 self
1407 }
1408}
1409
1410impl wkt::message::Message for DataAccessScope {
1411 fn typename() -> &'static str {
1412 "type.googleapis.com/google.cloud.chronicle.v1.DataAccessScope"
1413 }
1414}
1415
1416/// Reference object to a data access label.
1417#[derive(Clone, Default, PartialEq)]
1418#[non_exhaustive]
1419pub struct DataAccessLabelReference {
1420 /// Output only. The display name of the label.
1421 /// Data access label and log types's name
1422 /// will match the display name of the resource.
1423 /// The asset namespace will match the namespace itself.
1424 /// The ingestion key value pair will match the key of the tuple.
1425 pub display_name: std::string::String,
1426
1427 /// The unique identifier for the label.
1428 pub label: std::option::Option<crate::model::data_access_label_reference::Label>,
1429
1430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1431}
1432
1433impl DataAccessLabelReference {
1434 pub fn new() -> Self {
1435 std::default::Default::default()
1436 }
1437
1438 /// Sets the value of [display_name][crate::model::DataAccessLabelReference::display_name].
1439 ///
1440 /// # Example
1441 /// ```ignore,no_run
1442 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1443 /// let x = DataAccessLabelReference::new().set_display_name("example");
1444 /// ```
1445 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1446 self.display_name = v.into();
1447 self
1448 }
1449
1450 /// Sets the value of [label][crate::model::DataAccessLabelReference::label].
1451 ///
1452 /// Note that all the setters affecting `label` are mutually
1453 /// exclusive.
1454 ///
1455 /// # Example
1456 /// ```ignore,no_run
1457 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1458 /// use google_cloud_chronicle_v1::model::data_access_label_reference::Label;
1459 /// let x = DataAccessLabelReference::new().set_label(Some(Label::DataAccessLabel("example".to_string())));
1460 /// ```
1461 pub fn set_label<
1462 T: std::convert::Into<std::option::Option<crate::model::data_access_label_reference::Label>>,
1463 >(
1464 mut self,
1465 v: T,
1466 ) -> Self {
1467 self.label = v.into();
1468 self
1469 }
1470
1471 /// The value of [label][crate::model::DataAccessLabelReference::label]
1472 /// if it holds a `DataAccessLabel`, `None` if the field is not set or
1473 /// holds a different branch.
1474 pub fn data_access_label(&self) -> std::option::Option<&std::string::String> {
1475 #[allow(unreachable_patterns)]
1476 self.label.as_ref().and_then(|v| match v {
1477 crate::model::data_access_label_reference::Label::DataAccessLabel(v) => {
1478 std::option::Option::Some(v)
1479 }
1480 _ => std::option::Option::None,
1481 })
1482 }
1483
1484 /// Sets the value of [label][crate::model::DataAccessLabelReference::label]
1485 /// to hold a `DataAccessLabel`.
1486 ///
1487 /// Note that all the setters affecting `label` are
1488 /// mutually exclusive.
1489 ///
1490 /// # Example
1491 /// ```ignore,no_run
1492 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1493 /// let x = DataAccessLabelReference::new().set_data_access_label("example");
1494 /// assert!(x.data_access_label().is_some());
1495 /// assert!(x.log_type().is_none());
1496 /// assert!(x.asset_namespace().is_none());
1497 /// assert!(x.ingestion_label().is_none());
1498 /// ```
1499 pub fn set_data_access_label<T: std::convert::Into<std::string::String>>(
1500 mut self,
1501 v: T,
1502 ) -> Self {
1503 self.label = std::option::Option::Some(
1504 crate::model::data_access_label_reference::Label::DataAccessLabel(v.into()),
1505 );
1506 self
1507 }
1508
1509 /// The value of [label][crate::model::DataAccessLabelReference::label]
1510 /// if it holds a `LogType`, `None` if the field is not set or
1511 /// holds a different branch.
1512 pub fn log_type(&self) -> std::option::Option<&std::string::String> {
1513 #[allow(unreachable_patterns)]
1514 self.label.as_ref().and_then(|v| match v {
1515 crate::model::data_access_label_reference::Label::LogType(v) => {
1516 std::option::Option::Some(v)
1517 }
1518 _ => std::option::Option::None,
1519 })
1520 }
1521
1522 /// Sets the value of [label][crate::model::DataAccessLabelReference::label]
1523 /// to hold a `LogType`.
1524 ///
1525 /// Note that all the setters affecting `label` are
1526 /// mutually exclusive.
1527 ///
1528 /// # Example
1529 /// ```ignore,no_run
1530 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1531 /// let x = DataAccessLabelReference::new().set_log_type("example");
1532 /// assert!(x.log_type().is_some());
1533 /// assert!(x.data_access_label().is_none());
1534 /// assert!(x.asset_namespace().is_none());
1535 /// assert!(x.ingestion_label().is_none());
1536 /// ```
1537 pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1538 self.label = std::option::Option::Some(
1539 crate::model::data_access_label_reference::Label::LogType(v.into()),
1540 );
1541 self
1542 }
1543
1544 /// The value of [label][crate::model::DataAccessLabelReference::label]
1545 /// if it holds a `AssetNamespace`, `None` if the field is not set or
1546 /// holds a different branch.
1547 pub fn asset_namespace(&self) -> std::option::Option<&std::string::String> {
1548 #[allow(unreachable_patterns)]
1549 self.label.as_ref().and_then(|v| match v {
1550 crate::model::data_access_label_reference::Label::AssetNamespace(v) => {
1551 std::option::Option::Some(v)
1552 }
1553 _ => std::option::Option::None,
1554 })
1555 }
1556
1557 /// Sets the value of [label][crate::model::DataAccessLabelReference::label]
1558 /// to hold a `AssetNamespace`.
1559 ///
1560 /// Note that all the setters affecting `label` are
1561 /// mutually exclusive.
1562 ///
1563 /// # Example
1564 /// ```ignore,no_run
1565 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1566 /// let x = DataAccessLabelReference::new().set_asset_namespace("example");
1567 /// assert!(x.asset_namespace().is_some());
1568 /// assert!(x.data_access_label().is_none());
1569 /// assert!(x.log_type().is_none());
1570 /// assert!(x.ingestion_label().is_none());
1571 /// ```
1572 pub fn set_asset_namespace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1573 self.label = std::option::Option::Some(
1574 crate::model::data_access_label_reference::Label::AssetNamespace(v.into()),
1575 );
1576 self
1577 }
1578
1579 /// The value of [label][crate::model::DataAccessLabelReference::label]
1580 /// if it holds a `IngestionLabel`, `None` if the field is not set or
1581 /// holds a different branch.
1582 pub fn ingestion_label(
1583 &self,
1584 ) -> std::option::Option<&std::boxed::Box<crate::model::IngestionLabel>> {
1585 #[allow(unreachable_patterns)]
1586 self.label.as_ref().and_then(|v| match v {
1587 crate::model::data_access_label_reference::Label::IngestionLabel(v) => {
1588 std::option::Option::Some(v)
1589 }
1590 _ => std::option::Option::None,
1591 })
1592 }
1593
1594 /// Sets the value of [label][crate::model::DataAccessLabelReference::label]
1595 /// to hold a `IngestionLabel`.
1596 ///
1597 /// Note that all the setters affecting `label` are
1598 /// mutually exclusive.
1599 ///
1600 /// # Example
1601 /// ```ignore,no_run
1602 /// # use google_cloud_chronicle_v1::model::DataAccessLabelReference;
1603 /// use google_cloud_chronicle_v1::model::IngestionLabel;
1604 /// let x = DataAccessLabelReference::new().set_ingestion_label(IngestionLabel::default()/* use setters */);
1605 /// assert!(x.ingestion_label().is_some());
1606 /// assert!(x.data_access_label().is_none());
1607 /// assert!(x.log_type().is_none());
1608 /// assert!(x.asset_namespace().is_none());
1609 /// ```
1610 pub fn set_ingestion_label<
1611 T: std::convert::Into<std::boxed::Box<crate::model::IngestionLabel>>,
1612 >(
1613 mut self,
1614 v: T,
1615 ) -> Self {
1616 self.label = std::option::Option::Some(
1617 crate::model::data_access_label_reference::Label::IngestionLabel(v.into()),
1618 );
1619 self
1620 }
1621}
1622
1623impl wkt::message::Message for DataAccessLabelReference {
1624 fn typename() -> &'static str {
1625 "type.googleapis.com/google.cloud.chronicle.v1.DataAccessLabelReference"
1626 }
1627}
1628
1629/// Defines additional types related to [DataAccessLabelReference].
1630pub mod data_access_label_reference {
1631 #[allow(unused_imports)]
1632 use super::*;
1633
1634 /// The unique identifier for the label.
1635 #[derive(Clone, Debug, PartialEq)]
1636 #[non_exhaustive]
1637 pub enum Label {
1638 /// The name of the data access label.
1639 DataAccessLabel(std::string::String),
1640 /// The name of the log type.
1641 LogType(std::string::String),
1642 /// The asset namespace configured in the forwarder
1643 /// of the customer's events.
1644 AssetNamespace(std::string::String),
1645 /// The ingestion label configured in the forwarder of the customer's events.
1646 IngestionLabel(std::boxed::Box<crate::model::IngestionLabel>),
1647 }
1648}
1649
1650/// Representation of an ingestion label type.
1651#[derive(Clone, Default, PartialEq)]
1652#[non_exhaustive]
1653pub struct IngestionLabel {
1654 /// Required. The key of the ingestion label. Always required.
1655 pub ingestion_label_key: std::string::String,
1656
1657 /// Optional. The value of the ingestion label. Optional. An object
1658 /// with no provided value and some key provided would match
1659 /// against the given key and ANY value.
1660 pub ingestion_label_value: std::string::String,
1661
1662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1663}
1664
1665impl IngestionLabel {
1666 pub fn new() -> Self {
1667 std::default::Default::default()
1668 }
1669
1670 /// Sets the value of [ingestion_label_key][crate::model::IngestionLabel::ingestion_label_key].
1671 ///
1672 /// # Example
1673 /// ```ignore,no_run
1674 /// # use google_cloud_chronicle_v1::model::IngestionLabel;
1675 /// let x = IngestionLabel::new().set_ingestion_label_key("example");
1676 /// ```
1677 pub fn set_ingestion_label_key<T: std::convert::Into<std::string::String>>(
1678 mut self,
1679 v: T,
1680 ) -> Self {
1681 self.ingestion_label_key = v.into();
1682 self
1683 }
1684
1685 /// Sets the value of [ingestion_label_value][crate::model::IngestionLabel::ingestion_label_value].
1686 ///
1687 /// # Example
1688 /// ```ignore,no_run
1689 /// # use google_cloud_chronicle_v1::model::IngestionLabel;
1690 /// let x = IngestionLabel::new().set_ingestion_label_value("example");
1691 /// ```
1692 pub fn set_ingestion_label_value<T: std::convert::Into<std::string::String>>(
1693 mut self,
1694 v: T,
1695 ) -> Self {
1696 self.ingestion_label_value = v.into();
1697 self
1698 }
1699}
1700
1701impl wkt::message::Message for IngestionLabel {
1702 fn typename() -> &'static str {
1703 "type.googleapis.com/google.cloud.chronicle.v1.IngestionLabel"
1704 }
1705}
1706
1707/// A watchlist is a list of entities that allows for bulk operations over the
1708/// included entities.
1709#[derive(Clone, Default, PartialEq)]
1710#[non_exhaustive]
1711pub struct Watchlist {
1712 /// Identifier. Resource name of the watchlist.
1713 /// Format:
1714 /// `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
1715 pub name: std::string::String,
1716
1717 /// Required. Display name of the watchlist.
1718 /// Note that it must be at least one character and less than 63 characters
1719 /// (<https://google.aip.dev/148>).
1720 pub display_name: std::string::String,
1721
1722 /// Optional. Description of the watchlist.
1723 pub description: std::string::String,
1724
1725 /// Optional. Weight applied to the risk score for entities
1726 /// in this watchlist.
1727 /// The default is 1.0 if it is not specified.
1728 pub multiplying_factor: f32,
1729
1730 /// Required. Mechanism to populate entities in the watchlist.
1731 pub entity_population_mechanism:
1732 std::option::Option<crate::model::watchlist::EntityPopulationMechanism>,
1733
1734 /// Output only. Entity count in the watchlist.
1735 pub entity_count: std::option::Option<crate::model::watchlist::EntityCount>,
1736
1737 /// Output only. Time the watchlist was created.
1738 pub create_time: std::option::Option<wkt::Timestamp>,
1739
1740 /// Output only. Time the watchlist was last updated.
1741 pub update_time: std::option::Option<wkt::Timestamp>,
1742
1743 /// Optional. User preferences for watchlist configuration.
1744 pub watchlist_user_preferences: std::option::Option<crate::model::WatchlistUserPreferences>,
1745
1746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1747}
1748
1749impl Watchlist {
1750 pub fn new() -> Self {
1751 std::default::Default::default()
1752 }
1753
1754 /// Sets the value of [name][crate::model::Watchlist::name].
1755 ///
1756 /// # Example
1757 /// ```ignore,no_run
1758 /// # use google_cloud_chronicle_v1::model::Watchlist;
1759 /// let x = Watchlist::new().set_name("example");
1760 /// ```
1761 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1762 self.name = v.into();
1763 self
1764 }
1765
1766 /// Sets the value of [display_name][crate::model::Watchlist::display_name].
1767 ///
1768 /// # Example
1769 /// ```ignore,no_run
1770 /// # use google_cloud_chronicle_v1::model::Watchlist;
1771 /// let x = Watchlist::new().set_display_name("example");
1772 /// ```
1773 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1774 self.display_name = v.into();
1775 self
1776 }
1777
1778 /// Sets the value of [description][crate::model::Watchlist::description].
1779 ///
1780 /// # Example
1781 /// ```ignore,no_run
1782 /// # use google_cloud_chronicle_v1::model::Watchlist;
1783 /// let x = Watchlist::new().set_description("example");
1784 /// ```
1785 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1786 self.description = v.into();
1787 self
1788 }
1789
1790 /// Sets the value of [multiplying_factor][crate::model::Watchlist::multiplying_factor].
1791 ///
1792 /// # Example
1793 /// ```ignore,no_run
1794 /// # use google_cloud_chronicle_v1::model::Watchlist;
1795 /// let x = Watchlist::new().set_multiplying_factor(42.0);
1796 /// ```
1797 pub fn set_multiplying_factor<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
1798 self.multiplying_factor = v.into();
1799 self
1800 }
1801
1802 /// Sets the value of [entity_population_mechanism][crate::model::Watchlist::entity_population_mechanism].
1803 ///
1804 /// # Example
1805 /// ```ignore,no_run
1806 /// # use google_cloud_chronicle_v1::model::Watchlist;
1807 /// use google_cloud_chronicle_v1::model::watchlist::EntityPopulationMechanism;
1808 /// let x = Watchlist::new().set_entity_population_mechanism(EntityPopulationMechanism::default()/* use setters */);
1809 /// ```
1810 pub fn set_entity_population_mechanism<T>(mut self, v: T) -> Self
1811 where
1812 T: std::convert::Into<crate::model::watchlist::EntityPopulationMechanism>,
1813 {
1814 self.entity_population_mechanism = std::option::Option::Some(v.into());
1815 self
1816 }
1817
1818 /// Sets or clears the value of [entity_population_mechanism][crate::model::Watchlist::entity_population_mechanism].
1819 ///
1820 /// # Example
1821 /// ```ignore,no_run
1822 /// # use google_cloud_chronicle_v1::model::Watchlist;
1823 /// use google_cloud_chronicle_v1::model::watchlist::EntityPopulationMechanism;
1824 /// let x = Watchlist::new().set_or_clear_entity_population_mechanism(Some(EntityPopulationMechanism::default()/* use setters */));
1825 /// let x = Watchlist::new().set_or_clear_entity_population_mechanism(None::<EntityPopulationMechanism>);
1826 /// ```
1827 pub fn set_or_clear_entity_population_mechanism<T>(mut self, v: std::option::Option<T>) -> Self
1828 where
1829 T: std::convert::Into<crate::model::watchlist::EntityPopulationMechanism>,
1830 {
1831 self.entity_population_mechanism = v.map(|x| x.into());
1832 self
1833 }
1834
1835 /// Sets the value of [entity_count][crate::model::Watchlist::entity_count].
1836 ///
1837 /// # Example
1838 /// ```ignore,no_run
1839 /// # use google_cloud_chronicle_v1::model::Watchlist;
1840 /// use google_cloud_chronicle_v1::model::watchlist::EntityCount;
1841 /// let x = Watchlist::new().set_entity_count(EntityCount::default()/* use setters */);
1842 /// ```
1843 pub fn set_entity_count<T>(mut self, v: T) -> Self
1844 where
1845 T: std::convert::Into<crate::model::watchlist::EntityCount>,
1846 {
1847 self.entity_count = std::option::Option::Some(v.into());
1848 self
1849 }
1850
1851 /// Sets or clears the value of [entity_count][crate::model::Watchlist::entity_count].
1852 ///
1853 /// # Example
1854 /// ```ignore,no_run
1855 /// # use google_cloud_chronicle_v1::model::Watchlist;
1856 /// use google_cloud_chronicle_v1::model::watchlist::EntityCount;
1857 /// let x = Watchlist::new().set_or_clear_entity_count(Some(EntityCount::default()/* use setters */));
1858 /// let x = Watchlist::new().set_or_clear_entity_count(None::<EntityCount>);
1859 /// ```
1860 pub fn set_or_clear_entity_count<T>(mut self, v: std::option::Option<T>) -> Self
1861 where
1862 T: std::convert::Into<crate::model::watchlist::EntityCount>,
1863 {
1864 self.entity_count = v.map(|x| x.into());
1865 self
1866 }
1867
1868 /// Sets the value of [create_time][crate::model::Watchlist::create_time].
1869 ///
1870 /// # Example
1871 /// ```ignore,no_run
1872 /// # use google_cloud_chronicle_v1::model::Watchlist;
1873 /// use wkt::Timestamp;
1874 /// let x = Watchlist::new().set_create_time(Timestamp::default()/* use setters */);
1875 /// ```
1876 pub fn set_create_time<T>(mut self, v: T) -> Self
1877 where
1878 T: std::convert::Into<wkt::Timestamp>,
1879 {
1880 self.create_time = std::option::Option::Some(v.into());
1881 self
1882 }
1883
1884 /// Sets or clears the value of [create_time][crate::model::Watchlist::create_time].
1885 ///
1886 /// # Example
1887 /// ```ignore,no_run
1888 /// # use google_cloud_chronicle_v1::model::Watchlist;
1889 /// use wkt::Timestamp;
1890 /// let x = Watchlist::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1891 /// let x = Watchlist::new().set_or_clear_create_time(None::<Timestamp>);
1892 /// ```
1893 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1894 where
1895 T: std::convert::Into<wkt::Timestamp>,
1896 {
1897 self.create_time = v.map(|x| x.into());
1898 self
1899 }
1900
1901 /// Sets the value of [update_time][crate::model::Watchlist::update_time].
1902 ///
1903 /// # Example
1904 /// ```ignore,no_run
1905 /// # use google_cloud_chronicle_v1::model::Watchlist;
1906 /// use wkt::Timestamp;
1907 /// let x = Watchlist::new().set_update_time(Timestamp::default()/* use setters */);
1908 /// ```
1909 pub fn set_update_time<T>(mut self, v: T) -> Self
1910 where
1911 T: std::convert::Into<wkt::Timestamp>,
1912 {
1913 self.update_time = std::option::Option::Some(v.into());
1914 self
1915 }
1916
1917 /// Sets or clears the value of [update_time][crate::model::Watchlist::update_time].
1918 ///
1919 /// # Example
1920 /// ```ignore,no_run
1921 /// # use google_cloud_chronicle_v1::model::Watchlist;
1922 /// use wkt::Timestamp;
1923 /// let x = Watchlist::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1924 /// let x = Watchlist::new().set_or_clear_update_time(None::<Timestamp>);
1925 /// ```
1926 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1927 where
1928 T: std::convert::Into<wkt::Timestamp>,
1929 {
1930 self.update_time = v.map(|x| x.into());
1931 self
1932 }
1933
1934 /// Sets the value of [watchlist_user_preferences][crate::model::Watchlist::watchlist_user_preferences].
1935 ///
1936 /// # Example
1937 /// ```ignore,no_run
1938 /// # use google_cloud_chronicle_v1::model::Watchlist;
1939 /// use google_cloud_chronicle_v1::model::WatchlistUserPreferences;
1940 /// let x = Watchlist::new().set_watchlist_user_preferences(WatchlistUserPreferences::default()/* use setters */);
1941 /// ```
1942 pub fn set_watchlist_user_preferences<T>(mut self, v: T) -> Self
1943 where
1944 T: std::convert::Into<crate::model::WatchlistUserPreferences>,
1945 {
1946 self.watchlist_user_preferences = std::option::Option::Some(v.into());
1947 self
1948 }
1949
1950 /// Sets or clears the value of [watchlist_user_preferences][crate::model::Watchlist::watchlist_user_preferences].
1951 ///
1952 /// # Example
1953 /// ```ignore,no_run
1954 /// # use google_cloud_chronicle_v1::model::Watchlist;
1955 /// use google_cloud_chronicle_v1::model::WatchlistUserPreferences;
1956 /// let x = Watchlist::new().set_or_clear_watchlist_user_preferences(Some(WatchlistUserPreferences::default()/* use setters */));
1957 /// let x = Watchlist::new().set_or_clear_watchlist_user_preferences(None::<WatchlistUserPreferences>);
1958 /// ```
1959 pub fn set_or_clear_watchlist_user_preferences<T>(mut self, v: std::option::Option<T>) -> Self
1960 where
1961 T: std::convert::Into<crate::model::WatchlistUserPreferences>,
1962 {
1963 self.watchlist_user_preferences = v.map(|x| x.into());
1964 self
1965 }
1966}
1967
1968impl wkt::message::Message for Watchlist {
1969 fn typename() -> &'static str {
1970 "type.googleapis.com/google.cloud.chronicle.v1.Watchlist"
1971 }
1972}
1973
1974/// Defines additional types related to [Watchlist].
1975pub mod watchlist {
1976 #[allow(unused_imports)]
1977 use super::*;
1978
1979 /// Mechanism to populate entities in the watchlist.
1980 #[derive(Clone, Default, PartialEq)]
1981 #[non_exhaustive]
1982 pub struct EntityPopulationMechanism {
1983 /// Ways to populate entities in watchlist.
1984 /// Currently, only manual is supported.
1985 pub mechanism:
1986 std::option::Option<crate::model::watchlist::entity_population_mechanism::Mechanism>,
1987
1988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1989 }
1990
1991 impl EntityPopulationMechanism {
1992 pub fn new() -> Self {
1993 std::default::Default::default()
1994 }
1995
1996 /// Sets the value of [mechanism][crate::model::watchlist::EntityPopulationMechanism::mechanism].
1997 ///
1998 /// Note that all the setters affecting `mechanism` are mutually
1999 /// exclusive.
2000 ///
2001 /// # Example
2002 /// ```ignore,no_run
2003 /// # use google_cloud_chronicle_v1::model::watchlist::EntityPopulationMechanism;
2004 /// use google_cloud_chronicle_v1::model::watchlist::entity_population_mechanism::Manual;
2005 /// let x = EntityPopulationMechanism::new().set_mechanism(Some(
2006 /// google_cloud_chronicle_v1::model::watchlist::entity_population_mechanism::Mechanism::Manual(Manual::default().into())));
2007 /// ```
2008 pub fn set_mechanism<
2009 T: std::convert::Into<
2010 std::option::Option<
2011 crate::model::watchlist::entity_population_mechanism::Mechanism,
2012 >,
2013 >,
2014 >(
2015 mut self,
2016 v: T,
2017 ) -> Self {
2018 self.mechanism = v.into();
2019 self
2020 }
2021
2022 /// The value of [mechanism][crate::model::watchlist::EntityPopulationMechanism::mechanism]
2023 /// if it holds a `Manual`, `None` if the field is not set or
2024 /// holds a different branch.
2025 pub fn manual(
2026 &self,
2027 ) -> std::option::Option<
2028 &std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>,
2029 > {
2030 #[allow(unreachable_patterns)]
2031 self.mechanism.as_ref().and_then(|v| match v {
2032 crate::model::watchlist::entity_population_mechanism::Mechanism::Manual(v) => {
2033 std::option::Option::Some(v)
2034 }
2035 _ => std::option::Option::None,
2036 })
2037 }
2038
2039 /// Sets the value of [mechanism][crate::model::watchlist::EntityPopulationMechanism::mechanism]
2040 /// to hold a `Manual`.
2041 ///
2042 /// Note that all the setters affecting `mechanism` are
2043 /// mutually exclusive.
2044 ///
2045 /// # Example
2046 /// ```ignore,no_run
2047 /// # use google_cloud_chronicle_v1::model::watchlist::EntityPopulationMechanism;
2048 /// use google_cloud_chronicle_v1::model::watchlist::entity_population_mechanism::Manual;
2049 /// let x = EntityPopulationMechanism::new().set_manual(Manual::default()/* use setters */);
2050 /// assert!(x.manual().is_some());
2051 /// ```
2052 pub fn set_manual<
2053 T: std::convert::Into<
2054 std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>,
2055 >,
2056 >(
2057 mut self,
2058 v: T,
2059 ) -> Self {
2060 self.mechanism = std::option::Option::Some(
2061 crate::model::watchlist::entity_population_mechanism::Mechanism::Manual(v.into()),
2062 );
2063 self
2064 }
2065 }
2066
2067 impl wkt::message::Message for EntityPopulationMechanism {
2068 fn typename() -> &'static str {
2069 "type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityPopulationMechanism"
2070 }
2071 }
2072
2073 /// Defines additional types related to [EntityPopulationMechanism].
2074 pub mod entity_population_mechanism {
2075 #[allow(unused_imports)]
2076 use super::*;
2077
2078 /// Entities are added manually.
2079 #[derive(Clone, Default, PartialEq)]
2080 #[non_exhaustive]
2081 pub struct Manual {
2082 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2083 }
2084
2085 impl Manual {
2086 pub fn new() -> Self {
2087 std::default::Default::default()
2088 }
2089 }
2090
2091 impl wkt::message::Message for Manual {
2092 fn typename() -> &'static str {
2093 "type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityPopulationMechanism.Manual"
2094 }
2095 }
2096
2097 /// Ways to populate entities in watchlist.
2098 /// Currently, only manual is supported.
2099 #[derive(Clone, Debug, PartialEq)]
2100 #[non_exhaustive]
2101 pub enum Mechanism {
2102 /// Optional. Entities are added manually.
2103 Manual(std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>),
2104 }
2105 }
2106
2107 /// Count of different types of entities in the watchlist.
2108 #[derive(Clone, Default, PartialEq)]
2109 #[non_exhaustive]
2110 pub struct EntityCount {
2111 /// Output only. Count of user type entities in the watchlist.
2112 pub user: i32,
2113
2114 /// Output only. Count of asset type entities in the watchlist.
2115 pub asset: i32,
2116
2117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2118 }
2119
2120 impl EntityCount {
2121 pub fn new() -> Self {
2122 std::default::Default::default()
2123 }
2124
2125 /// Sets the value of [user][crate::model::watchlist::EntityCount::user].
2126 ///
2127 /// # Example
2128 /// ```ignore,no_run
2129 /// # use google_cloud_chronicle_v1::model::watchlist::EntityCount;
2130 /// let x = EntityCount::new().set_user(42);
2131 /// ```
2132 pub fn set_user<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2133 self.user = v.into();
2134 self
2135 }
2136
2137 /// Sets the value of [asset][crate::model::watchlist::EntityCount::asset].
2138 ///
2139 /// # Example
2140 /// ```ignore,no_run
2141 /// # use google_cloud_chronicle_v1::model::watchlist::EntityCount;
2142 /// let x = EntityCount::new().set_asset(42);
2143 /// ```
2144 pub fn set_asset<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2145 self.asset = v.into();
2146 self
2147 }
2148 }
2149
2150 impl wkt::message::Message for EntityCount {
2151 fn typename() -> &'static str {
2152 "type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityCount"
2153 }
2154 }
2155}
2156
2157/// A collection of user preferences for watchlist UI configuration.
2158#[derive(Clone, Default, PartialEq)]
2159#[non_exhaustive]
2160pub struct WatchlistUserPreferences {
2161 /// Optional. Whether the watchlist is pinned on the dashboard.
2162 pub pinned: bool,
2163
2164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2165}
2166
2167impl WatchlistUserPreferences {
2168 pub fn new() -> Self {
2169 std::default::Default::default()
2170 }
2171
2172 /// Sets the value of [pinned][crate::model::WatchlistUserPreferences::pinned].
2173 ///
2174 /// # Example
2175 /// ```ignore,no_run
2176 /// # use google_cloud_chronicle_v1::model::WatchlistUserPreferences;
2177 /// let x = WatchlistUserPreferences::new().set_pinned(true);
2178 /// ```
2179 pub fn set_pinned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2180 self.pinned = v.into();
2181 self
2182 }
2183}
2184
2185impl wkt::message::Message for WatchlistUserPreferences {
2186 fn typename() -> &'static str {
2187 "type.googleapis.com/google.cloud.chronicle.v1.WatchlistUserPreferences"
2188 }
2189}
2190
2191/// Request message for getting a watchlist.
2192#[derive(Clone, Default, PartialEq)]
2193#[non_exhaustive]
2194pub struct GetWatchlistRequest {
2195 /// Required. The parent, which owns this collection of watchlists.
2196 /// The name of the watchlist to retrieve.
2197 /// Format:
2198 /// `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
2199 pub name: std::string::String,
2200
2201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2202}
2203
2204impl GetWatchlistRequest {
2205 pub fn new() -> Self {
2206 std::default::Default::default()
2207 }
2208
2209 /// Sets the value of [name][crate::model::GetWatchlistRequest::name].
2210 ///
2211 /// # Example
2212 /// ```ignore,no_run
2213 /// # use google_cloud_chronicle_v1::model::GetWatchlistRequest;
2214 /// let x = GetWatchlistRequest::new().set_name("example");
2215 /// ```
2216 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2217 self.name = v.into();
2218 self
2219 }
2220}
2221
2222impl wkt::message::Message for GetWatchlistRequest {
2223 fn typename() -> &'static str {
2224 "type.googleapis.com/google.cloud.chronicle.v1.GetWatchlistRequest"
2225 }
2226}
2227
2228/// Request message for listing watchlists.
2229#[derive(Clone, Default, PartialEq)]
2230#[non_exhaustive]
2231pub struct ListWatchlistsRequest {
2232 /// Required. The parent, which owns this collection of watchlists.
2233 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
2234 pub parent: std::string::String,
2235
2236 /// Optional. The maximum number of watchlists to return.
2237 /// The service may return fewer than this value.
2238 /// If unspecified, at most 200 watchlists will be returned.
2239 /// The maximum value is 200; values above 200 will be coerced to 200.
2240 pub page_size: i32,
2241
2242 /// Optional. A page token, received from a previous `ListWatchlists` call.
2243 /// Provide this to retrieve the subsequent page.
2244 ///
2245 /// When paginating, all other parameters provided to
2246 /// `ListWatchlists` must match the call that provided the page
2247 /// token.
2248 pub page_token: std::string::String,
2249
2250 /// Optional. Which watchlist to return in aip.dev/160 form.
2251 /// Currently, only the following filters are supported:
2252 ///
2253 /// - `watchlist_user_preferences.pinned=true`
2254 /// - `has_entity([ENTITY_INDICATOR],[ENTITY_TYPE])`
2255 /// - `has_entity([ENTITY_INDICATOR],[ENTITY_TYPE],[NAMESPACE])`
2256 pub filter: std::string::String,
2257
2258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2259}
2260
2261impl ListWatchlistsRequest {
2262 pub fn new() -> Self {
2263 std::default::Default::default()
2264 }
2265
2266 /// Sets the value of [parent][crate::model::ListWatchlistsRequest::parent].
2267 ///
2268 /// # Example
2269 /// ```ignore,no_run
2270 /// # use google_cloud_chronicle_v1::model::ListWatchlistsRequest;
2271 /// let x = ListWatchlistsRequest::new().set_parent("example");
2272 /// ```
2273 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2274 self.parent = v.into();
2275 self
2276 }
2277
2278 /// Sets the value of [page_size][crate::model::ListWatchlistsRequest::page_size].
2279 ///
2280 /// # Example
2281 /// ```ignore,no_run
2282 /// # use google_cloud_chronicle_v1::model::ListWatchlistsRequest;
2283 /// let x = ListWatchlistsRequest::new().set_page_size(42);
2284 /// ```
2285 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2286 self.page_size = v.into();
2287 self
2288 }
2289
2290 /// Sets the value of [page_token][crate::model::ListWatchlistsRequest::page_token].
2291 ///
2292 /// # Example
2293 /// ```ignore,no_run
2294 /// # use google_cloud_chronicle_v1::model::ListWatchlistsRequest;
2295 /// let x = ListWatchlistsRequest::new().set_page_token("example");
2296 /// ```
2297 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2298 self.page_token = v.into();
2299 self
2300 }
2301
2302 /// Sets the value of [filter][crate::model::ListWatchlistsRequest::filter].
2303 ///
2304 /// # Example
2305 /// ```ignore,no_run
2306 /// # use google_cloud_chronicle_v1::model::ListWatchlistsRequest;
2307 /// let x = ListWatchlistsRequest::new().set_filter("example");
2308 /// ```
2309 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2310 self.filter = v.into();
2311 self
2312 }
2313}
2314
2315impl wkt::message::Message for ListWatchlistsRequest {
2316 fn typename() -> &'static str {
2317 "type.googleapis.com/google.cloud.chronicle.v1.ListWatchlistsRequest"
2318 }
2319}
2320
2321/// Response message for listing watchlists.
2322#[derive(Clone, Default, PartialEq)]
2323#[non_exhaustive]
2324pub struct ListWatchlistsResponse {
2325 /// Optional. The watchlists from the specified instance.
2326 pub watchlists: std::vec::Vec<crate::model::Watchlist>,
2327
2328 /// Optional. A token, which can be sent as `page_token` to retrieve the next
2329 /// page. If this field is omitted, there are no subsequent pages.
2330 pub next_page_token: std::string::String,
2331
2332 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2333}
2334
2335impl ListWatchlistsResponse {
2336 pub fn new() -> Self {
2337 std::default::Default::default()
2338 }
2339
2340 /// Sets the value of [watchlists][crate::model::ListWatchlistsResponse::watchlists].
2341 ///
2342 /// # Example
2343 /// ```ignore,no_run
2344 /// # use google_cloud_chronicle_v1::model::ListWatchlistsResponse;
2345 /// use google_cloud_chronicle_v1::model::Watchlist;
2346 /// let x = ListWatchlistsResponse::new()
2347 /// .set_watchlists([
2348 /// Watchlist::default()/* use setters */,
2349 /// Watchlist::default()/* use (different) setters */,
2350 /// ]);
2351 /// ```
2352 pub fn set_watchlists<T, V>(mut self, v: T) -> Self
2353 where
2354 T: std::iter::IntoIterator<Item = V>,
2355 V: std::convert::Into<crate::model::Watchlist>,
2356 {
2357 use std::iter::Iterator;
2358 self.watchlists = v.into_iter().map(|i| i.into()).collect();
2359 self
2360 }
2361
2362 /// Sets the value of [next_page_token][crate::model::ListWatchlistsResponse::next_page_token].
2363 ///
2364 /// # Example
2365 /// ```ignore,no_run
2366 /// # use google_cloud_chronicle_v1::model::ListWatchlistsResponse;
2367 /// let x = ListWatchlistsResponse::new().set_next_page_token("example");
2368 /// ```
2369 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2370 self.next_page_token = v.into();
2371 self
2372 }
2373}
2374
2375impl wkt::message::Message for ListWatchlistsResponse {
2376 fn typename() -> &'static str {
2377 "type.googleapis.com/google.cloud.chronicle.v1.ListWatchlistsResponse"
2378 }
2379}
2380
2381#[doc(hidden)]
2382impl google_cloud_gax::paginator::internal::PageableResponse for ListWatchlistsResponse {
2383 type PageItem = crate::model::Watchlist;
2384
2385 fn items(self) -> std::vec::Vec<Self::PageItem> {
2386 self.watchlists
2387 }
2388
2389 fn next_page_token(&self) -> std::string::String {
2390 use std::clone::Clone;
2391 self.next_page_token.clone()
2392 }
2393}
2394
2395/// Request message for creating watchlist.
2396#[derive(Clone, Default, PartialEq)]
2397#[non_exhaustive]
2398pub struct CreateWatchlistRequest {
2399 /// Required. The parent resource where this watchlist will be created.
2400 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
2401 pub parent: std::string::String,
2402
2403 /// Optional. The ID to use for the watchlist,
2404 /// which will become the final component of the watchlist's resource name.
2405 ///
2406 /// This value should be 4-63 characters, and valid characters
2407 /// are /[a-z][0-9]-/.
2408 pub watchlist_id: std::string::String,
2409
2410 /// Required. The watchlist to create.
2411 pub watchlist: std::option::Option<crate::model::Watchlist>,
2412
2413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2414}
2415
2416impl CreateWatchlistRequest {
2417 pub fn new() -> Self {
2418 std::default::Default::default()
2419 }
2420
2421 /// Sets the value of [parent][crate::model::CreateWatchlistRequest::parent].
2422 ///
2423 /// # Example
2424 /// ```ignore,no_run
2425 /// # use google_cloud_chronicle_v1::model::CreateWatchlistRequest;
2426 /// let x = CreateWatchlistRequest::new().set_parent("example");
2427 /// ```
2428 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2429 self.parent = v.into();
2430 self
2431 }
2432
2433 /// Sets the value of [watchlist_id][crate::model::CreateWatchlistRequest::watchlist_id].
2434 ///
2435 /// # Example
2436 /// ```ignore,no_run
2437 /// # use google_cloud_chronicle_v1::model::CreateWatchlistRequest;
2438 /// let x = CreateWatchlistRequest::new().set_watchlist_id("example");
2439 /// ```
2440 pub fn set_watchlist_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2441 self.watchlist_id = v.into();
2442 self
2443 }
2444
2445 /// Sets the value of [watchlist][crate::model::CreateWatchlistRequest::watchlist].
2446 ///
2447 /// # Example
2448 /// ```ignore,no_run
2449 /// # use google_cloud_chronicle_v1::model::CreateWatchlistRequest;
2450 /// use google_cloud_chronicle_v1::model::Watchlist;
2451 /// let x = CreateWatchlistRequest::new().set_watchlist(Watchlist::default()/* use setters */);
2452 /// ```
2453 pub fn set_watchlist<T>(mut self, v: T) -> Self
2454 where
2455 T: std::convert::Into<crate::model::Watchlist>,
2456 {
2457 self.watchlist = std::option::Option::Some(v.into());
2458 self
2459 }
2460
2461 /// Sets or clears the value of [watchlist][crate::model::CreateWatchlistRequest::watchlist].
2462 ///
2463 /// # Example
2464 /// ```ignore,no_run
2465 /// # use google_cloud_chronicle_v1::model::CreateWatchlistRequest;
2466 /// use google_cloud_chronicle_v1::model::Watchlist;
2467 /// let x = CreateWatchlistRequest::new().set_or_clear_watchlist(Some(Watchlist::default()/* use setters */));
2468 /// let x = CreateWatchlistRequest::new().set_or_clear_watchlist(None::<Watchlist>);
2469 /// ```
2470 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
2471 where
2472 T: std::convert::Into<crate::model::Watchlist>,
2473 {
2474 self.watchlist = v.map(|x| x.into());
2475 self
2476 }
2477}
2478
2479impl wkt::message::Message for CreateWatchlistRequest {
2480 fn typename() -> &'static str {
2481 "type.googleapis.com/google.cloud.chronicle.v1.CreateWatchlistRequest"
2482 }
2483}
2484
2485/// Request message for updating watchlist.
2486#[derive(Clone, Default, PartialEq)]
2487#[non_exhaustive]
2488pub struct UpdateWatchlistRequest {
2489 /// Required. The watchlist to update.
2490 ///
2491 /// The watchlist's `name` field is used to identify the watchlist to update.
2492 /// Format:
2493 /// `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
2494 pub watchlist: std::option::Option<crate::model::Watchlist>,
2495
2496 /// Optional. The list of fields to update.
2497 pub update_mask: std::option::Option<wkt::FieldMask>,
2498
2499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2500}
2501
2502impl UpdateWatchlistRequest {
2503 pub fn new() -> Self {
2504 std::default::Default::default()
2505 }
2506
2507 /// Sets the value of [watchlist][crate::model::UpdateWatchlistRequest::watchlist].
2508 ///
2509 /// # Example
2510 /// ```ignore,no_run
2511 /// # use google_cloud_chronicle_v1::model::UpdateWatchlistRequest;
2512 /// use google_cloud_chronicle_v1::model::Watchlist;
2513 /// let x = UpdateWatchlistRequest::new().set_watchlist(Watchlist::default()/* use setters */);
2514 /// ```
2515 pub fn set_watchlist<T>(mut self, v: T) -> Self
2516 where
2517 T: std::convert::Into<crate::model::Watchlist>,
2518 {
2519 self.watchlist = std::option::Option::Some(v.into());
2520 self
2521 }
2522
2523 /// Sets or clears the value of [watchlist][crate::model::UpdateWatchlistRequest::watchlist].
2524 ///
2525 /// # Example
2526 /// ```ignore,no_run
2527 /// # use google_cloud_chronicle_v1::model::UpdateWatchlistRequest;
2528 /// use google_cloud_chronicle_v1::model::Watchlist;
2529 /// let x = UpdateWatchlistRequest::new().set_or_clear_watchlist(Some(Watchlist::default()/* use setters */));
2530 /// let x = UpdateWatchlistRequest::new().set_or_clear_watchlist(None::<Watchlist>);
2531 /// ```
2532 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
2533 where
2534 T: std::convert::Into<crate::model::Watchlist>,
2535 {
2536 self.watchlist = v.map(|x| x.into());
2537 self
2538 }
2539
2540 /// Sets the value of [update_mask][crate::model::UpdateWatchlistRequest::update_mask].
2541 ///
2542 /// # Example
2543 /// ```ignore,no_run
2544 /// # use google_cloud_chronicle_v1::model::UpdateWatchlistRequest;
2545 /// use wkt::FieldMask;
2546 /// let x = UpdateWatchlistRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2547 /// ```
2548 pub fn set_update_mask<T>(mut self, v: T) -> Self
2549 where
2550 T: std::convert::Into<wkt::FieldMask>,
2551 {
2552 self.update_mask = std::option::Option::Some(v.into());
2553 self
2554 }
2555
2556 /// Sets or clears the value of [update_mask][crate::model::UpdateWatchlistRequest::update_mask].
2557 ///
2558 /// # Example
2559 /// ```ignore,no_run
2560 /// # use google_cloud_chronicle_v1::model::UpdateWatchlistRequest;
2561 /// use wkt::FieldMask;
2562 /// let x = UpdateWatchlistRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2563 /// let x = UpdateWatchlistRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2564 /// ```
2565 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2566 where
2567 T: std::convert::Into<wkt::FieldMask>,
2568 {
2569 self.update_mask = v.map(|x| x.into());
2570 self
2571 }
2572}
2573
2574impl wkt::message::Message for UpdateWatchlistRequest {
2575 fn typename() -> &'static str {
2576 "type.googleapis.com/google.cloud.chronicle.v1.UpdateWatchlistRequest"
2577 }
2578}
2579
2580/// Request message for deleting watchlist.
2581#[derive(Clone, Default, PartialEq)]
2582#[non_exhaustive]
2583pub struct DeleteWatchlistRequest {
2584 /// Required. The name of the watchlist to delete.
2585 /// Format:
2586 /// `projects/{project}/locations/{location}/instances/{instance}/watchlists/{watchlist}`
2587 pub name: std::string::String,
2588
2589 /// Optional. If set to true, any entities under this watchlist will also be
2590 /// deleted. (Otherwise, the request will only work if the watchlist has no
2591 /// entities.)
2592 pub force: bool,
2593
2594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2595}
2596
2597impl DeleteWatchlistRequest {
2598 pub fn new() -> Self {
2599 std::default::Default::default()
2600 }
2601
2602 /// Sets the value of [name][crate::model::DeleteWatchlistRequest::name].
2603 ///
2604 /// # Example
2605 /// ```ignore,no_run
2606 /// # use google_cloud_chronicle_v1::model::DeleteWatchlistRequest;
2607 /// let x = DeleteWatchlistRequest::new().set_name("example");
2608 /// ```
2609 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2610 self.name = v.into();
2611 self
2612 }
2613
2614 /// Sets the value of [force][crate::model::DeleteWatchlistRequest::force].
2615 ///
2616 /// # Example
2617 /// ```ignore,no_run
2618 /// # use google_cloud_chronicle_v1::model::DeleteWatchlistRequest;
2619 /// let x = DeleteWatchlistRequest::new().set_force(true);
2620 /// ```
2621 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2622 self.force = v.into();
2623 self
2624 }
2625}
2626
2627impl wkt::message::Message for DeleteWatchlistRequest {
2628 fn typename() -> &'static str {
2629 "type.googleapis.com/google.cloud.chronicle.v1.DeleteWatchlistRequest"
2630 }
2631}
2632
2633/// A Instance represents an instantiation of the Instance product.
2634#[derive(Clone, Default, PartialEq)]
2635#[non_exhaustive]
2636pub struct Instance {
2637 /// Identifier. The resource name of this instance.
2638 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
2639 pub name: std::string::String,
2640
2641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2642}
2643
2644impl Instance {
2645 pub fn new() -> Self {
2646 std::default::Default::default()
2647 }
2648
2649 /// Sets the value of [name][crate::model::Instance::name].
2650 ///
2651 /// # Example
2652 /// ```ignore,no_run
2653 /// # use google_cloud_chronicle_v1::model::Instance;
2654 /// let x = Instance::new().set_name("example");
2655 /// ```
2656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2657 self.name = v.into();
2658 self
2659 }
2660}
2661
2662impl wkt::message::Message for Instance {
2663 fn typename() -> &'static str {
2664 "type.googleapis.com/google.cloud.chronicle.v1.Instance"
2665 }
2666}
2667
2668/// Request to get a Instance.
2669#[derive(Clone, Default, PartialEq)]
2670#[non_exhaustive]
2671pub struct GetInstanceRequest {
2672 /// Required. The name of the instance to retrieve.
2673 /// Format:
2674 /// `projects/{project_id}/locations/{location}/instances/{instance}`
2675 pub name: std::string::String,
2676
2677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2678}
2679
2680impl GetInstanceRequest {
2681 pub fn new() -> Self {
2682 std::default::Default::default()
2683 }
2684
2685 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2686 ///
2687 /// # Example
2688 /// ```ignore,no_run
2689 /// # use google_cloud_chronicle_v1::model::GetInstanceRequest;
2690 /// let x = GetInstanceRequest::new().set_name("example");
2691 /// ```
2692 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2693 self.name = v.into();
2694 self
2695 }
2696}
2697
2698impl wkt::message::Message for GetInstanceRequest {
2699 fn typename() -> &'static str {
2700 "type.googleapis.com/google.cloud.chronicle.v1.GetInstanceRequest"
2701 }
2702}
2703
2704/// ScopeInfo specifies the scope info of the reference list.
2705#[derive(Clone, Default, PartialEq)]
2706#[non_exhaustive]
2707pub struct ScopeInfo {
2708 /// Required. The list of scope names of the reference list, if the list is
2709 /// empty the reference list is treated as unscoped.
2710 pub reference_list_scope: std::option::Option<crate::model::ReferenceListScope>,
2711
2712 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2713}
2714
2715impl ScopeInfo {
2716 pub fn new() -> Self {
2717 std::default::Default::default()
2718 }
2719
2720 /// Sets the value of [reference_list_scope][crate::model::ScopeInfo::reference_list_scope].
2721 ///
2722 /// # Example
2723 /// ```ignore,no_run
2724 /// # use google_cloud_chronicle_v1::model::ScopeInfo;
2725 /// use google_cloud_chronicle_v1::model::ReferenceListScope;
2726 /// let x = ScopeInfo::new().set_reference_list_scope(ReferenceListScope::default()/* use setters */);
2727 /// ```
2728 pub fn set_reference_list_scope<T>(mut self, v: T) -> Self
2729 where
2730 T: std::convert::Into<crate::model::ReferenceListScope>,
2731 {
2732 self.reference_list_scope = std::option::Option::Some(v.into());
2733 self
2734 }
2735
2736 /// Sets or clears the value of [reference_list_scope][crate::model::ScopeInfo::reference_list_scope].
2737 ///
2738 /// # Example
2739 /// ```ignore,no_run
2740 /// # use google_cloud_chronicle_v1::model::ScopeInfo;
2741 /// use google_cloud_chronicle_v1::model::ReferenceListScope;
2742 /// let x = ScopeInfo::new().set_or_clear_reference_list_scope(Some(ReferenceListScope::default()/* use setters */));
2743 /// let x = ScopeInfo::new().set_or_clear_reference_list_scope(None::<ReferenceListScope>);
2744 /// ```
2745 pub fn set_or_clear_reference_list_scope<T>(mut self, v: std::option::Option<T>) -> Self
2746 where
2747 T: std::convert::Into<crate::model::ReferenceListScope>,
2748 {
2749 self.reference_list_scope = v.map(|x| x.into());
2750 self
2751 }
2752}
2753
2754impl wkt::message::Message for ScopeInfo {
2755 fn typename() -> &'static str {
2756 "type.googleapis.com/google.cloud.chronicle.v1.ScopeInfo"
2757 }
2758}
2759
2760/// ReferenceListScope specifies the list of scope names of the reference list.
2761#[derive(Clone, Default, PartialEq)]
2762#[non_exhaustive]
2763pub struct ReferenceListScope {
2764 /// Optional. The list of scope names of the reference list. The scope names
2765 /// should be full resource names and should be of the format:
2766 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{scope_name}`.
2767 pub scope_names: std::vec::Vec<std::string::String>,
2768
2769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2770}
2771
2772impl ReferenceListScope {
2773 pub fn new() -> Self {
2774 std::default::Default::default()
2775 }
2776
2777 /// Sets the value of [scope_names][crate::model::ReferenceListScope::scope_names].
2778 ///
2779 /// # Example
2780 /// ```ignore,no_run
2781 /// # use google_cloud_chronicle_v1::model::ReferenceListScope;
2782 /// let x = ReferenceListScope::new().set_scope_names(["a", "b", "c"]);
2783 /// ```
2784 pub fn set_scope_names<T, V>(mut self, v: T) -> Self
2785 where
2786 T: std::iter::IntoIterator<Item = V>,
2787 V: std::convert::Into<std::string::String>,
2788 {
2789 use std::iter::Iterator;
2790 self.scope_names = v.into_iter().map(|i| i.into()).collect();
2791 self
2792 }
2793}
2794
2795impl wkt::message::Message for ReferenceListScope {
2796 fn typename() -> &'static str {
2797 "type.googleapis.com/google.cloud.chronicle.v1.ReferenceListScope"
2798 }
2799}
2800
2801/// A request to get details about a reference list.
2802#[derive(Clone, Default, PartialEq)]
2803#[non_exhaustive]
2804pub struct GetReferenceListRequest {
2805 /// Required. The resource name of the reference list to retrieve.
2806 /// Format:
2807 /// `projects/{project}/locations/{locations}/instances/{instance}/referenceLists/{reference_list}`
2808 pub name: std::string::String,
2809
2810 /// How much of the ReferenceList to view. Defaults to
2811 /// REFERENCE_LIST_VIEW_FULL.
2812 pub view: crate::model::ReferenceListView,
2813
2814 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2815}
2816
2817impl GetReferenceListRequest {
2818 pub fn new() -> Self {
2819 std::default::Default::default()
2820 }
2821
2822 /// Sets the value of [name][crate::model::GetReferenceListRequest::name].
2823 ///
2824 /// # Example
2825 /// ```ignore,no_run
2826 /// # use google_cloud_chronicle_v1::model::GetReferenceListRequest;
2827 /// let x = GetReferenceListRequest::new().set_name("example");
2828 /// ```
2829 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2830 self.name = v.into();
2831 self
2832 }
2833
2834 /// Sets the value of [view][crate::model::GetReferenceListRequest::view].
2835 ///
2836 /// # Example
2837 /// ```ignore,no_run
2838 /// # use google_cloud_chronicle_v1::model::GetReferenceListRequest;
2839 /// use google_cloud_chronicle_v1::model::ReferenceListView;
2840 /// let x0 = GetReferenceListRequest::new().set_view(ReferenceListView::Basic);
2841 /// let x1 = GetReferenceListRequest::new().set_view(ReferenceListView::Full);
2842 /// ```
2843 pub fn set_view<T: std::convert::Into<crate::model::ReferenceListView>>(
2844 mut self,
2845 v: T,
2846 ) -> Self {
2847 self.view = v.into();
2848 self
2849 }
2850}
2851
2852impl wkt::message::Message for GetReferenceListRequest {
2853 fn typename() -> &'static str {
2854 "type.googleapis.com/google.cloud.chronicle.v1.GetReferenceListRequest"
2855 }
2856}
2857
2858/// A request for a list of reference lists.
2859#[derive(Clone, Default, PartialEq)]
2860#[non_exhaustive]
2861pub struct ListReferenceListsRequest {
2862 /// Required. The parent, which owns this collection of reference lists.
2863 /// Format:
2864 /// `projects/{project}/locations/{location}/instances/{instance}`
2865 pub parent: std::string::String,
2866
2867 /// The maximum number of reference lists to return.
2868 /// The service may return fewer than this value.
2869 /// If unspecified, at most 100 reference lists will be returned.
2870 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
2871 pub page_size: i32,
2872
2873 /// A page token, received from a previous `ListReferenceLists` call.
2874 /// Provide this to retrieve the subsequent page.
2875 /// When paginating, all other parameters provided to `ListReferenceLists` must
2876 /// match the call that provided the page token.
2877 pub page_token: std::string::String,
2878
2879 /// How much of each ReferenceList to view. Defaults to
2880 /// REFERENCE_LIST_VIEW_BASIC.
2881 pub view: crate::model::ReferenceListView,
2882
2883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2884}
2885
2886impl ListReferenceListsRequest {
2887 pub fn new() -> Self {
2888 std::default::Default::default()
2889 }
2890
2891 /// Sets the value of [parent][crate::model::ListReferenceListsRequest::parent].
2892 ///
2893 /// # Example
2894 /// ```ignore,no_run
2895 /// # use google_cloud_chronicle_v1::model::ListReferenceListsRequest;
2896 /// let x = ListReferenceListsRequest::new().set_parent("example");
2897 /// ```
2898 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2899 self.parent = v.into();
2900 self
2901 }
2902
2903 /// Sets the value of [page_size][crate::model::ListReferenceListsRequest::page_size].
2904 ///
2905 /// # Example
2906 /// ```ignore,no_run
2907 /// # use google_cloud_chronicle_v1::model::ListReferenceListsRequest;
2908 /// let x = ListReferenceListsRequest::new().set_page_size(42);
2909 /// ```
2910 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2911 self.page_size = v.into();
2912 self
2913 }
2914
2915 /// Sets the value of [page_token][crate::model::ListReferenceListsRequest::page_token].
2916 ///
2917 /// # Example
2918 /// ```ignore,no_run
2919 /// # use google_cloud_chronicle_v1::model::ListReferenceListsRequest;
2920 /// let x = ListReferenceListsRequest::new().set_page_token("example");
2921 /// ```
2922 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2923 self.page_token = v.into();
2924 self
2925 }
2926
2927 /// Sets the value of [view][crate::model::ListReferenceListsRequest::view].
2928 ///
2929 /// # Example
2930 /// ```ignore,no_run
2931 /// # use google_cloud_chronicle_v1::model::ListReferenceListsRequest;
2932 /// use google_cloud_chronicle_v1::model::ReferenceListView;
2933 /// let x0 = ListReferenceListsRequest::new().set_view(ReferenceListView::Basic);
2934 /// let x1 = ListReferenceListsRequest::new().set_view(ReferenceListView::Full);
2935 /// ```
2936 pub fn set_view<T: std::convert::Into<crate::model::ReferenceListView>>(
2937 mut self,
2938 v: T,
2939 ) -> Self {
2940 self.view = v.into();
2941 self
2942 }
2943}
2944
2945impl wkt::message::Message for ListReferenceListsRequest {
2946 fn typename() -> &'static str {
2947 "type.googleapis.com/google.cloud.chronicle.v1.ListReferenceListsRequest"
2948 }
2949}
2950
2951/// A response to a request for a list of reference lists.
2952#[derive(Clone, Default, PartialEq)]
2953#[non_exhaustive]
2954pub struct ListReferenceListsResponse {
2955 /// The reference lists.
2956 /// Ordered in ascending alphabetical order by name.
2957 pub reference_lists: std::vec::Vec<crate::model::ReferenceList>,
2958
2959 /// A token, which can be sent as `page_token` to retrieve the next page.
2960 /// If this field is omitted, there are no subsequent pages.
2961 pub next_page_token: std::string::String,
2962
2963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2964}
2965
2966impl ListReferenceListsResponse {
2967 pub fn new() -> Self {
2968 std::default::Default::default()
2969 }
2970
2971 /// Sets the value of [reference_lists][crate::model::ListReferenceListsResponse::reference_lists].
2972 ///
2973 /// # Example
2974 /// ```ignore,no_run
2975 /// # use google_cloud_chronicle_v1::model::ListReferenceListsResponse;
2976 /// use google_cloud_chronicle_v1::model::ReferenceList;
2977 /// let x = ListReferenceListsResponse::new()
2978 /// .set_reference_lists([
2979 /// ReferenceList::default()/* use setters */,
2980 /// ReferenceList::default()/* use (different) setters */,
2981 /// ]);
2982 /// ```
2983 pub fn set_reference_lists<T, V>(mut self, v: T) -> Self
2984 where
2985 T: std::iter::IntoIterator<Item = V>,
2986 V: std::convert::Into<crate::model::ReferenceList>,
2987 {
2988 use std::iter::Iterator;
2989 self.reference_lists = v.into_iter().map(|i| i.into()).collect();
2990 self
2991 }
2992
2993 /// Sets the value of [next_page_token][crate::model::ListReferenceListsResponse::next_page_token].
2994 ///
2995 /// # Example
2996 /// ```ignore,no_run
2997 /// # use google_cloud_chronicle_v1::model::ListReferenceListsResponse;
2998 /// let x = ListReferenceListsResponse::new().set_next_page_token("example");
2999 /// ```
3000 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3001 self.next_page_token = v.into();
3002 self
3003 }
3004}
3005
3006impl wkt::message::Message for ListReferenceListsResponse {
3007 fn typename() -> &'static str {
3008 "type.googleapis.com/google.cloud.chronicle.v1.ListReferenceListsResponse"
3009 }
3010}
3011
3012#[doc(hidden)]
3013impl google_cloud_gax::paginator::internal::PageableResponse for ListReferenceListsResponse {
3014 type PageItem = crate::model::ReferenceList;
3015
3016 fn items(self) -> std::vec::Vec<Self::PageItem> {
3017 self.reference_lists
3018 }
3019
3020 fn next_page_token(&self) -> std::string::String {
3021 use std::clone::Clone;
3022 self.next_page_token.clone()
3023 }
3024}
3025
3026/// A request to create a reference list.
3027#[derive(Clone, Default, PartialEq)]
3028#[non_exhaustive]
3029pub struct CreateReferenceListRequest {
3030 /// Required. The parent resource where this reference list will be created.
3031 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
3032 pub parent: std::string::String,
3033
3034 /// Required. The reference list to create.
3035 pub reference_list: std::option::Option<crate::model::ReferenceList>,
3036
3037 /// Required. The ID to use for the reference list. This is also the display
3038 /// name for the reference list. It must satisfy the following requirements:
3039 ///
3040 /// - Starts with letter.
3041 /// - Contains only letters, numbers and underscore.
3042 /// - Has length less than 256.
3043 /// - Must be unique.
3044 pub reference_list_id: std::string::String,
3045
3046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3047}
3048
3049impl CreateReferenceListRequest {
3050 pub fn new() -> Self {
3051 std::default::Default::default()
3052 }
3053
3054 /// Sets the value of [parent][crate::model::CreateReferenceListRequest::parent].
3055 ///
3056 /// # Example
3057 /// ```ignore,no_run
3058 /// # use google_cloud_chronicle_v1::model::CreateReferenceListRequest;
3059 /// let x = CreateReferenceListRequest::new().set_parent("example");
3060 /// ```
3061 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3062 self.parent = v.into();
3063 self
3064 }
3065
3066 /// Sets the value of [reference_list][crate::model::CreateReferenceListRequest::reference_list].
3067 ///
3068 /// # Example
3069 /// ```ignore,no_run
3070 /// # use google_cloud_chronicle_v1::model::CreateReferenceListRequest;
3071 /// use google_cloud_chronicle_v1::model::ReferenceList;
3072 /// let x = CreateReferenceListRequest::new().set_reference_list(ReferenceList::default()/* use setters */);
3073 /// ```
3074 pub fn set_reference_list<T>(mut self, v: T) -> Self
3075 where
3076 T: std::convert::Into<crate::model::ReferenceList>,
3077 {
3078 self.reference_list = std::option::Option::Some(v.into());
3079 self
3080 }
3081
3082 /// Sets or clears the value of [reference_list][crate::model::CreateReferenceListRequest::reference_list].
3083 ///
3084 /// # Example
3085 /// ```ignore,no_run
3086 /// # use google_cloud_chronicle_v1::model::CreateReferenceListRequest;
3087 /// use google_cloud_chronicle_v1::model::ReferenceList;
3088 /// let x = CreateReferenceListRequest::new().set_or_clear_reference_list(Some(ReferenceList::default()/* use setters */));
3089 /// let x = CreateReferenceListRequest::new().set_or_clear_reference_list(None::<ReferenceList>);
3090 /// ```
3091 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
3092 where
3093 T: std::convert::Into<crate::model::ReferenceList>,
3094 {
3095 self.reference_list = v.map(|x| x.into());
3096 self
3097 }
3098
3099 /// Sets the value of [reference_list_id][crate::model::CreateReferenceListRequest::reference_list_id].
3100 ///
3101 /// # Example
3102 /// ```ignore,no_run
3103 /// # use google_cloud_chronicle_v1::model::CreateReferenceListRequest;
3104 /// let x = CreateReferenceListRequest::new().set_reference_list_id("example");
3105 /// ```
3106 pub fn set_reference_list_id<T: std::convert::Into<std::string::String>>(
3107 mut self,
3108 v: T,
3109 ) -> Self {
3110 self.reference_list_id = v.into();
3111 self
3112 }
3113}
3114
3115impl wkt::message::Message for CreateReferenceListRequest {
3116 fn typename() -> &'static str {
3117 "type.googleapis.com/google.cloud.chronicle.v1.CreateReferenceListRequest"
3118 }
3119}
3120
3121/// A request to update a reference list.
3122#[derive(Clone, Default, PartialEq)]
3123#[non_exhaustive]
3124pub struct UpdateReferenceListRequest {
3125 /// Required. The reference list to update.
3126 ///
3127 /// The reference list's `name` field is used to identify the reference list to
3128 /// update.
3129 /// Format:
3130 /// `projects/{project}/locations/{locations}/instances/{instance}/referenceLists/{reference_list}`
3131 pub reference_list: std::option::Option<crate::model::ReferenceList>,
3132
3133 /// The list of fields to update.
3134 /// When no field mask is supplied, all non-empty fields will be updated.
3135 /// A field mask of "*" will update all fields, whether empty or not.
3136 pub update_mask: std::option::Option<wkt::FieldMask>,
3137
3138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3139}
3140
3141impl UpdateReferenceListRequest {
3142 pub fn new() -> Self {
3143 std::default::Default::default()
3144 }
3145
3146 /// Sets the value of [reference_list][crate::model::UpdateReferenceListRequest::reference_list].
3147 ///
3148 /// # Example
3149 /// ```ignore,no_run
3150 /// # use google_cloud_chronicle_v1::model::UpdateReferenceListRequest;
3151 /// use google_cloud_chronicle_v1::model::ReferenceList;
3152 /// let x = UpdateReferenceListRequest::new().set_reference_list(ReferenceList::default()/* use setters */);
3153 /// ```
3154 pub fn set_reference_list<T>(mut self, v: T) -> Self
3155 where
3156 T: std::convert::Into<crate::model::ReferenceList>,
3157 {
3158 self.reference_list = std::option::Option::Some(v.into());
3159 self
3160 }
3161
3162 /// Sets or clears the value of [reference_list][crate::model::UpdateReferenceListRequest::reference_list].
3163 ///
3164 /// # Example
3165 /// ```ignore,no_run
3166 /// # use google_cloud_chronicle_v1::model::UpdateReferenceListRequest;
3167 /// use google_cloud_chronicle_v1::model::ReferenceList;
3168 /// let x = UpdateReferenceListRequest::new().set_or_clear_reference_list(Some(ReferenceList::default()/* use setters */));
3169 /// let x = UpdateReferenceListRequest::new().set_or_clear_reference_list(None::<ReferenceList>);
3170 /// ```
3171 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
3172 where
3173 T: std::convert::Into<crate::model::ReferenceList>,
3174 {
3175 self.reference_list = v.map(|x| x.into());
3176 self
3177 }
3178
3179 /// Sets the value of [update_mask][crate::model::UpdateReferenceListRequest::update_mask].
3180 ///
3181 /// # Example
3182 /// ```ignore,no_run
3183 /// # use google_cloud_chronicle_v1::model::UpdateReferenceListRequest;
3184 /// use wkt::FieldMask;
3185 /// let x = UpdateReferenceListRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3186 /// ```
3187 pub fn set_update_mask<T>(mut self, v: T) -> Self
3188 where
3189 T: std::convert::Into<wkt::FieldMask>,
3190 {
3191 self.update_mask = std::option::Option::Some(v.into());
3192 self
3193 }
3194
3195 /// Sets or clears the value of [update_mask][crate::model::UpdateReferenceListRequest::update_mask].
3196 ///
3197 /// # Example
3198 /// ```ignore,no_run
3199 /// # use google_cloud_chronicle_v1::model::UpdateReferenceListRequest;
3200 /// use wkt::FieldMask;
3201 /// let x = UpdateReferenceListRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3202 /// let x = UpdateReferenceListRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3203 /// ```
3204 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3205 where
3206 T: std::convert::Into<wkt::FieldMask>,
3207 {
3208 self.update_mask = v.map(|x| x.into());
3209 self
3210 }
3211}
3212
3213impl wkt::message::Message for UpdateReferenceListRequest {
3214 fn typename() -> &'static str {
3215 "type.googleapis.com/google.cloud.chronicle.v1.UpdateReferenceListRequest"
3216 }
3217}
3218
3219/// A reference list.
3220/// Reference lists are user-defined lists of values which users can
3221/// use in multiple Rules.
3222#[derive(Clone, Default, PartialEq)]
3223#[non_exhaustive]
3224pub struct ReferenceList {
3225 /// Identifier. The resource name of the reference list.
3226 /// Format:
3227 /// `projects/{project}/locations/{location}/instances/{instance}/referenceLists/{reference_list}`
3228 pub name: std::string::String,
3229
3230 /// Output only. The unique display name of the reference list.
3231 pub display_name: std::string::String,
3232
3233 /// Output only. The timestamp when the reference list was last updated.
3234 pub revision_create_time: std::option::Option<wkt::Timestamp>,
3235
3236 /// Required. A user-provided description of the reference list.
3237 pub description: std::string::String,
3238
3239 /// Required. The entries of the reference list.
3240 /// When listed, they are returned in the order that was specified at creation
3241 /// or update. The combined size of the values of the reference list may not
3242 /// exceed 6MB.
3243 /// This is returned only when the view is REFERENCE_LIST_VIEW_FULL.
3244 pub entries: std::vec::Vec<crate::model::ReferenceListEntry>,
3245
3246 /// Output only. The resource names for the associated self-authored Rules that
3247 /// use this reference list. This is returned only when the view is
3248 /// REFERENCE_LIST_VIEW_FULL.
3249 pub rules: std::vec::Vec<std::string::String>,
3250
3251 /// Required. The syntax type indicating how list entries should be validated.
3252 pub syntax_type: crate::model::ReferenceListSyntaxType,
3253
3254 /// Output only. The count of self-authored rules using the reference list.
3255 pub rule_associations_count: i32,
3256
3257 /// The scope info of the reference list.
3258 /// During reference list creation, if this field is not set, the reference
3259 /// list without scopes (an unscoped list) will be created for an unscoped
3260 /// user. For a scoped user, this field must be set. During reference list
3261 /// update, if scope_info is requested to be updated, this field must be set.
3262 pub scope_info: std::option::Option<crate::model::ScopeInfo>,
3263
3264 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3265}
3266
3267impl ReferenceList {
3268 pub fn new() -> Self {
3269 std::default::Default::default()
3270 }
3271
3272 /// Sets the value of [name][crate::model::ReferenceList::name].
3273 ///
3274 /// # Example
3275 /// ```ignore,no_run
3276 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3277 /// let x = ReferenceList::new().set_name("example");
3278 /// ```
3279 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3280 self.name = v.into();
3281 self
3282 }
3283
3284 /// Sets the value of [display_name][crate::model::ReferenceList::display_name].
3285 ///
3286 /// # Example
3287 /// ```ignore,no_run
3288 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3289 /// let x = ReferenceList::new().set_display_name("example");
3290 /// ```
3291 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3292 self.display_name = v.into();
3293 self
3294 }
3295
3296 /// Sets the value of [revision_create_time][crate::model::ReferenceList::revision_create_time].
3297 ///
3298 /// # Example
3299 /// ```ignore,no_run
3300 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3301 /// use wkt::Timestamp;
3302 /// let x = ReferenceList::new().set_revision_create_time(Timestamp::default()/* use setters */);
3303 /// ```
3304 pub fn set_revision_create_time<T>(mut self, v: T) -> Self
3305 where
3306 T: std::convert::Into<wkt::Timestamp>,
3307 {
3308 self.revision_create_time = std::option::Option::Some(v.into());
3309 self
3310 }
3311
3312 /// Sets or clears the value of [revision_create_time][crate::model::ReferenceList::revision_create_time].
3313 ///
3314 /// # Example
3315 /// ```ignore,no_run
3316 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3317 /// use wkt::Timestamp;
3318 /// let x = ReferenceList::new().set_or_clear_revision_create_time(Some(Timestamp::default()/* use setters */));
3319 /// let x = ReferenceList::new().set_or_clear_revision_create_time(None::<Timestamp>);
3320 /// ```
3321 pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3322 where
3323 T: std::convert::Into<wkt::Timestamp>,
3324 {
3325 self.revision_create_time = v.map(|x| x.into());
3326 self
3327 }
3328
3329 /// Sets the value of [description][crate::model::ReferenceList::description].
3330 ///
3331 /// # Example
3332 /// ```ignore,no_run
3333 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3334 /// let x = ReferenceList::new().set_description("example");
3335 /// ```
3336 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3337 self.description = v.into();
3338 self
3339 }
3340
3341 /// Sets the value of [entries][crate::model::ReferenceList::entries].
3342 ///
3343 /// # Example
3344 /// ```ignore,no_run
3345 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3346 /// use google_cloud_chronicle_v1::model::ReferenceListEntry;
3347 /// let x = ReferenceList::new()
3348 /// .set_entries([
3349 /// ReferenceListEntry::default()/* use setters */,
3350 /// ReferenceListEntry::default()/* use (different) setters */,
3351 /// ]);
3352 /// ```
3353 pub fn set_entries<T, V>(mut self, v: T) -> Self
3354 where
3355 T: std::iter::IntoIterator<Item = V>,
3356 V: std::convert::Into<crate::model::ReferenceListEntry>,
3357 {
3358 use std::iter::Iterator;
3359 self.entries = v.into_iter().map(|i| i.into()).collect();
3360 self
3361 }
3362
3363 /// Sets the value of [rules][crate::model::ReferenceList::rules].
3364 ///
3365 /// # Example
3366 /// ```ignore,no_run
3367 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3368 /// let x = ReferenceList::new().set_rules(["a", "b", "c"]);
3369 /// ```
3370 pub fn set_rules<T, V>(mut self, v: T) -> Self
3371 where
3372 T: std::iter::IntoIterator<Item = V>,
3373 V: std::convert::Into<std::string::String>,
3374 {
3375 use std::iter::Iterator;
3376 self.rules = v.into_iter().map(|i| i.into()).collect();
3377 self
3378 }
3379
3380 /// Sets the value of [syntax_type][crate::model::ReferenceList::syntax_type].
3381 ///
3382 /// # Example
3383 /// ```ignore,no_run
3384 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3385 /// use google_cloud_chronicle_v1::model::ReferenceListSyntaxType;
3386 /// let x0 = ReferenceList::new().set_syntax_type(ReferenceListSyntaxType::PlainTextString);
3387 /// let x1 = ReferenceList::new().set_syntax_type(ReferenceListSyntaxType::Regex);
3388 /// let x2 = ReferenceList::new().set_syntax_type(ReferenceListSyntaxType::Cidr);
3389 /// ```
3390 pub fn set_syntax_type<T: std::convert::Into<crate::model::ReferenceListSyntaxType>>(
3391 mut self,
3392 v: T,
3393 ) -> Self {
3394 self.syntax_type = v.into();
3395 self
3396 }
3397
3398 /// Sets the value of [rule_associations_count][crate::model::ReferenceList::rule_associations_count].
3399 ///
3400 /// # Example
3401 /// ```ignore,no_run
3402 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3403 /// let x = ReferenceList::new().set_rule_associations_count(42);
3404 /// ```
3405 pub fn set_rule_associations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3406 self.rule_associations_count = v.into();
3407 self
3408 }
3409
3410 /// Sets the value of [scope_info][crate::model::ReferenceList::scope_info].
3411 ///
3412 /// # Example
3413 /// ```ignore,no_run
3414 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3415 /// use google_cloud_chronicle_v1::model::ScopeInfo;
3416 /// let x = ReferenceList::new().set_scope_info(ScopeInfo::default()/* use setters */);
3417 /// ```
3418 pub fn set_scope_info<T>(mut self, v: T) -> Self
3419 where
3420 T: std::convert::Into<crate::model::ScopeInfo>,
3421 {
3422 self.scope_info = std::option::Option::Some(v.into());
3423 self
3424 }
3425
3426 /// Sets or clears the value of [scope_info][crate::model::ReferenceList::scope_info].
3427 ///
3428 /// # Example
3429 /// ```ignore,no_run
3430 /// # use google_cloud_chronicle_v1::model::ReferenceList;
3431 /// use google_cloud_chronicle_v1::model::ScopeInfo;
3432 /// let x = ReferenceList::new().set_or_clear_scope_info(Some(ScopeInfo::default()/* use setters */));
3433 /// let x = ReferenceList::new().set_or_clear_scope_info(None::<ScopeInfo>);
3434 /// ```
3435 pub fn set_or_clear_scope_info<T>(mut self, v: std::option::Option<T>) -> Self
3436 where
3437 T: std::convert::Into<crate::model::ScopeInfo>,
3438 {
3439 self.scope_info = v.map(|x| x.into());
3440 self
3441 }
3442}
3443
3444impl wkt::message::Message for ReferenceList {
3445 fn typename() -> &'static str {
3446 "type.googleapis.com/google.cloud.chronicle.v1.ReferenceList"
3447 }
3448}
3449
3450/// An entry in a reference list.
3451#[derive(Clone, Default, PartialEq)]
3452#[non_exhaustive]
3453pub struct ReferenceListEntry {
3454 /// Required. The value of the entry. Maximum length is 512 characters.
3455 pub value: std::string::String,
3456
3457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3458}
3459
3460impl ReferenceListEntry {
3461 pub fn new() -> Self {
3462 std::default::Default::default()
3463 }
3464
3465 /// Sets the value of [value][crate::model::ReferenceListEntry::value].
3466 ///
3467 /// # Example
3468 /// ```ignore,no_run
3469 /// # use google_cloud_chronicle_v1::model::ReferenceListEntry;
3470 /// let x = ReferenceListEntry::new().set_value("example");
3471 /// ```
3472 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3473 self.value = v.into();
3474 self
3475 }
3476}
3477
3478impl wkt::message::Message for ReferenceListEntry {
3479 fn typename() -> &'static str {
3480 "type.googleapis.com/google.cloud.chronicle.v1.ReferenceListEntry"
3481 }
3482}
3483
3484/// The Rule resource represents a user-created rule.
3485/// NEXT TAG: 21
3486#[derive(Clone, Default, PartialEq)]
3487#[non_exhaustive]
3488pub struct Rule {
3489 /// Identifier. Full resource name for the rule.
3490 /// Format:
3491 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
3492 pub name: std::string::String,
3493
3494 /// Output only. The revision ID of the rule.
3495 /// A new revision is created whenever the rule text is changed in any way.
3496 /// Format: `v_{10 digits}_{9 digits}`
3497 /// Populated in REVISION_METADATA_ONLY view and FULL view.
3498 pub revision_id: std::string::String,
3499
3500 /// Output only. Display name of the rule.
3501 /// Populated in BASIC view and FULL view.
3502 pub display_name: std::string::String,
3503
3504 /// The YARA-L content of the rule.
3505 /// Populated in FULL view.
3506 pub text: std::string::String,
3507
3508 /// Output only. The author of the rule. Extracted from the meta section of
3509 /// text. Populated in BASIC view and FULL view.
3510 pub author: std::string::String,
3511
3512 /// Output only. The severity of the rule as specified in the meta section of
3513 /// text. Populated in BASIC view and FULL view.
3514 pub severity: std::option::Option<crate::model::Severity>,
3515
3516 /// Output only. Additional metadata specified in the meta section of text.
3517 /// Populated in FULL view.
3518 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
3519
3520 /// Output only. The timestamp of when the rule was created.
3521 /// Populated in FULL view.
3522 pub create_time: std::option::Option<wkt::Timestamp>,
3523
3524 /// Output only. The timestamp of when the rule revision was created.
3525 /// Populated in FULL, REVISION_METADATA_ONLY views.
3526 pub revision_create_time: std::option::Option<wkt::Timestamp>,
3527
3528 /// Output only. The current compilation state of the rule.
3529 /// Populated in FULL view.
3530 pub compilation_state: crate::model::rule::CompilationState,
3531
3532 /// Output only. User-facing type of the rule. Extracted from the events
3533 /// section of rule text. Populated in BASIC view and FULL view.
3534 pub r#type: crate::model::RuleType,
3535
3536 /// Output only. Resource names of the reference lists used in this rule.
3537 /// Populated in FULL view.
3538 pub reference_lists: std::vec::Vec<std::string::String>,
3539
3540 /// Output only. The run frequencies that are allowed for the rule.
3541 /// Populated in BASIC view and FULL view.
3542 pub allowed_run_frequencies: std::vec::Vec<crate::model::RunFrequency>,
3543
3544 /// The etag for this rule.
3545 /// If this is provided on update, the request will succeed if and only if it
3546 /// matches the server-computed value, and will fail with an ABORTED error
3547 /// otherwise.
3548 /// Populated in BASIC view and FULL view.
3549 pub etag: std::string::String,
3550
3551 /// Resource name of the DataAccessScope bound to this rule.
3552 /// Populated in BASIC view and FULL view.
3553 /// If reference lists are used in the rule, validations will be performed
3554 /// against this scope to ensure that the reference lists are compatible with
3555 /// both the user's and the rule's scopes.
3556 /// The scope should be in the format:
3557 /// `projects/{project}/locations/{location}/instances/{instance}/dataAccessScopes/{scope}`.
3558 pub scope: std::string::String,
3559
3560 /// Output only. A list of a rule's corresponding compilation diagnostic
3561 /// messages such as compilation errors and compilation warnings. Populated in
3562 /// FULL view.
3563 pub compilation_diagnostics: std::vec::Vec<crate::model::CompilationDiagnostic>,
3564
3565 /// Output only. Indicate the rule can run in near real time live rule.
3566 /// If this is true, the rule uses the near real time live rule when the run
3567 /// frequency is set to LIVE.
3568 pub near_real_time_live_rule_eligible: bool,
3569
3570 /// Output only. The set of inputs used in the rule. For example, if the rule
3571 /// uses $e.principal.hostname, then the uses_udm field will be true.
3572 pub inputs_used: std::option::Option<crate::model::InputsUsed>,
3573
3574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3575}
3576
3577impl Rule {
3578 pub fn new() -> Self {
3579 std::default::Default::default()
3580 }
3581
3582 /// Sets the value of [name][crate::model::Rule::name].
3583 ///
3584 /// # Example
3585 /// ```ignore,no_run
3586 /// # use google_cloud_chronicle_v1::model::Rule;
3587 /// let x = Rule::new().set_name("example");
3588 /// ```
3589 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3590 self.name = v.into();
3591 self
3592 }
3593
3594 /// Sets the value of [revision_id][crate::model::Rule::revision_id].
3595 ///
3596 /// # Example
3597 /// ```ignore,no_run
3598 /// # use google_cloud_chronicle_v1::model::Rule;
3599 /// let x = Rule::new().set_revision_id("example");
3600 /// ```
3601 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3602 self.revision_id = v.into();
3603 self
3604 }
3605
3606 /// Sets the value of [display_name][crate::model::Rule::display_name].
3607 ///
3608 /// # Example
3609 /// ```ignore,no_run
3610 /// # use google_cloud_chronicle_v1::model::Rule;
3611 /// let x = Rule::new().set_display_name("example");
3612 /// ```
3613 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3614 self.display_name = v.into();
3615 self
3616 }
3617
3618 /// Sets the value of [text][crate::model::Rule::text].
3619 ///
3620 /// # Example
3621 /// ```ignore,no_run
3622 /// # use google_cloud_chronicle_v1::model::Rule;
3623 /// let x = Rule::new().set_text("example");
3624 /// ```
3625 pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3626 self.text = v.into();
3627 self
3628 }
3629
3630 /// Sets the value of [author][crate::model::Rule::author].
3631 ///
3632 /// # Example
3633 /// ```ignore,no_run
3634 /// # use google_cloud_chronicle_v1::model::Rule;
3635 /// let x = Rule::new().set_author("example");
3636 /// ```
3637 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3638 self.author = v.into();
3639 self
3640 }
3641
3642 /// Sets the value of [severity][crate::model::Rule::severity].
3643 ///
3644 /// # Example
3645 /// ```ignore,no_run
3646 /// # use google_cloud_chronicle_v1::model::Rule;
3647 /// use google_cloud_chronicle_v1::model::Severity;
3648 /// let x = Rule::new().set_severity(Severity::default()/* use setters */);
3649 /// ```
3650 pub fn set_severity<T>(mut self, v: T) -> Self
3651 where
3652 T: std::convert::Into<crate::model::Severity>,
3653 {
3654 self.severity = std::option::Option::Some(v.into());
3655 self
3656 }
3657
3658 /// Sets or clears the value of [severity][crate::model::Rule::severity].
3659 ///
3660 /// # Example
3661 /// ```ignore,no_run
3662 /// # use google_cloud_chronicle_v1::model::Rule;
3663 /// use google_cloud_chronicle_v1::model::Severity;
3664 /// let x = Rule::new().set_or_clear_severity(Some(Severity::default()/* use setters */));
3665 /// let x = Rule::new().set_or_clear_severity(None::<Severity>);
3666 /// ```
3667 pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
3668 where
3669 T: std::convert::Into<crate::model::Severity>,
3670 {
3671 self.severity = v.map(|x| x.into());
3672 self
3673 }
3674
3675 /// Sets the value of [metadata][crate::model::Rule::metadata].
3676 ///
3677 /// # Example
3678 /// ```ignore,no_run
3679 /// # use google_cloud_chronicle_v1::model::Rule;
3680 /// let x = Rule::new().set_metadata([
3681 /// ("key0", "abc"),
3682 /// ("key1", "xyz"),
3683 /// ]);
3684 /// ```
3685 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
3686 where
3687 T: std::iter::IntoIterator<Item = (K, V)>,
3688 K: std::convert::Into<std::string::String>,
3689 V: std::convert::Into<std::string::String>,
3690 {
3691 use std::iter::Iterator;
3692 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3693 self
3694 }
3695
3696 /// Sets the value of [create_time][crate::model::Rule::create_time].
3697 ///
3698 /// # Example
3699 /// ```ignore,no_run
3700 /// # use google_cloud_chronicle_v1::model::Rule;
3701 /// use wkt::Timestamp;
3702 /// let x = Rule::new().set_create_time(Timestamp::default()/* use setters */);
3703 /// ```
3704 pub fn set_create_time<T>(mut self, v: T) -> Self
3705 where
3706 T: std::convert::Into<wkt::Timestamp>,
3707 {
3708 self.create_time = std::option::Option::Some(v.into());
3709 self
3710 }
3711
3712 /// Sets or clears the value of [create_time][crate::model::Rule::create_time].
3713 ///
3714 /// # Example
3715 /// ```ignore,no_run
3716 /// # use google_cloud_chronicle_v1::model::Rule;
3717 /// use wkt::Timestamp;
3718 /// let x = Rule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3719 /// let x = Rule::new().set_or_clear_create_time(None::<Timestamp>);
3720 /// ```
3721 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3722 where
3723 T: std::convert::Into<wkt::Timestamp>,
3724 {
3725 self.create_time = v.map(|x| x.into());
3726 self
3727 }
3728
3729 /// Sets the value of [revision_create_time][crate::model::Rule::revision_create_time].
3730 ///
3731 /// # Example
3732 /// ```ignore,no_run
3733 /// # use google_cloud_chronicle_v1::model::Rule;
3734 /// use wkt::Timestamp;
3735 /// let x = Rule::new().set_revision_create_time(Timestamp::default()/* use setters */);
3736 /// ```
3737 pub fn set_revision_create_time<T>(mut self, v: T) -> Self
3738 where
3739 T: std::convert::Into<wkt::Timestamp>,
3740 {
3741 self.revision_create_time = std::option::Option::Some(v.into());
3742 self
3743 }
3744
3745 /// Sets or clears the value of [revision_create_time][crate::model::Rule::revision_create_time].
3746 ///
3747 /// # Example
3748 /// ```ignore,no_run
3749 /// # use google_cloud_chronicle_v1::model::Rule;
3750 /// use wkt::Timestamp;
3751 /// let x = Rule::new().set_or_clear_revision_create_time(Some(Timestamp::default()/* use setters */));
3752 /// let x = Rule::new().set_or_clear_revision_create_time(None::<Timestamp>);
3753 /// ```
3754 pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3755 where
3756 T: std::convert::Into<wkt::Timestamp>,
3757 {
3758 self.revision_create_time = v.map(|x| x.into());
3759 self
3760 }
3761
3762 /// Sets the value of [compilation_state][crate::model::Rule::compilation_state].
3763 ///
3764 /// # Example
3765 /// ```ignore,no_run
3766 /// # use google_cloud_chronicle_v1::model::Rule;
3767 /// use google_cloud_chronicle_v1::model::rule::CompilationState;
3768 /// let x0 = Rule::new().set_compilation_state(CompilationState::Succeeded);
3769 /// let x1 = Rule::new().set_compilation_state(CompilationState::Failed);
3770 /// ```
3771 pub fn set_compilation_state<T: std::convert::Into<crate::model::rule::CompilationState>>(
3772 mut self,
3773 v: T,
3774 ) -> Self {
3775 self.compilation_state = v.into();
3776 self
3777 }
3778
3779 /// Sets the value of [r#type][crate::model::Rule::type].
3780 ///
3781 /// # Example
3782 /// ```ignore,no_run
3783 /// # use google_cloud_chronicle_v1::model::Rule;
3784 /// use google_cloud_chronicle_v1::model::RuleType;
3785 /// let x0 = Rule::new().set_type(RuleType::SingleEvent);
3786 /// let x1 = Rule::new().set_type(RuleType::MultiEvent);
3787 /// ```
3788 pub fn set_type<T: std::convert::Into<crate::model::RuleType>>(mut self, v: T) -> Self {
3789 self.r#type = v.into();
3790 self
3791 }
3792
3793 /// Sets the value of [reference_lists][crate::model::Rule::reference_lists].
3794 ///
3795 /// # Example
3796 /// ```ignore,no_run
3797 /// # use google_cloud_chronicle_v1::model::Rule;
3798 /// let x = Rule::new().set_reference_lists(["a", "b", "c"]);
3799 /// ```
3800 pub fn set_reference_lists<T, V>(mut self, v: T) -> Self
3801 where
3802 T: std::iter::IntoIterator<Item = V>,
3803 V: std::convert::Into<std::string::String>,
3804 {
3805 use std::iter::Iterator;
3806 self.reference_lists = v.into_iter().map(|i| i.into()).collect();
3807 self
3808 }
3809
3810 /// Sets the value of [allowed_run_frequencies][crate::model::Rule::allowed_run_frequencies].
3811 ///
3812 /// # Example
3813 /// ```ignore,no_run
3814 /// # use google_cloud_chronicle_v1::model::Rule;
3815 /// use google_cloud_chronicle_v1::model::RunFrequency;
3816 /// let x = Rule::new().set_allowed_run_frequencies([
3817 /// RunFrequency::Live,
3818 /// RunFrequency::Hourly,
3819 /// RunFrequency::Daily,
3820 /// ]);
3821 /// ```
3822 pub fn set_allowed_run_frequencies<T, V>(mut self, v: T) -> Self
3823 where
3824 T: std::iter::IntoIterator<Item = V>,
3825 V: std::convert::Into<crate::model::RunFrequency>,
3826 {
3827 use std::iter::Iterator;
3828 self.allowed_run_frequencies = v.into_iter().map(|i| i.into()).collect();
3829 self
3830 }
3831
3832 /// Sets the value of [etag][crate::model::Rule::etag].
3833 ///
3834 /// # Example
3835 /// ```ignore,no_run
3836 /// # use google_cloud_chronicle_v1::model::Rule;
3837 /// let x = Rule::new().set_etag("example");
3838 /// ```
3839 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3840 self.etag = v.into();
3841 self
3842 }
3843
3844 /// Sets the value of [scope][crate::model::Rule::scope].
3845 ///
3846 /// # Example
3847 /// ```ignore,no_run
3848 /// # use google_cloud_chronicle_v1::model::Rule;
3849 /// let x = Rule::new().set_scope("example");
3850 /// ```
3851 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3852 self.scope = v.into();
3853 self
3854 }
3855
3856 /// Sets the value of [compilation_diagnostics][crate::model::Rule::compilation_diagnostics].
3857 ///
3858 /// # Example
3859 /// ```ignore,no_run
3860 /// # use google_cloud_chronicle_v1::model::Rule;
3861 /// use google_cloud_chronicle_v1::model::CompilationDiagnostic;
3862 /// let x = Rule::new()
3863 /// .set_compilation_diagnostics([
3864 /// CompilationDiagnostic::default()/* use setters */,
3865 /// CompilationDiagnostic::default()/* use (different) setters */,
3866 /// ]);
3867 /// ```
3868 pub fn set_compilation_diagnostics<T, V>(mut self, v: T) -> Self
3869 where
3870 T: std::iter::IntoIterator<Item = V>,
3871 V: std::convert::Into<crate::model::CompilationDiagnostic>,
3872 {
3873 use std::iter::Iterator;
3874 self.compilation_diagnostics = v.into_iter().map(|i| i.into()).collect();
3875 self
3876 }
3877
3878 /// Sets the value of [near_real_time_live_rule_eligible][crate::model::Rule::near_real_time_live_rule_eligible].
3879 ///
3880 /// # Example
3881 /// ```ignore,no_run
3882 /// # use google_cloud_chronicle_v1::model::Rule;
3883 /// let x = Rule::new().set_near_real_time_live_rule_eligible(true);
3884 /// ```
3885 pub fn set_near_real_time_live_rule_eligible<T: std::convert::Into<bool>>(
3886 mut self,
3887 v: T,
3888 ) -> Self {
3889 self.near_real_time_live_rule_eligible = v.into();
3890 self
3891 }
3892
3893 /// Sets the value of [inputs_used][crate::model::Rule::inputs_used].
3894 ///
3895 /// # Example
3896 /// ```ignore,no_run
3897 /// # use google_cloud_chronicle_v1::model::Rule;
3898 /// use google_cloud_chronicle_v1::model::InputsUsed;
3899 /// let x = Rule::new().set_inputs_used(InputsUsed::default()/* use setters */);
3900 /// ```
3901 pub fn set_inputs_used<T>(mut self, v: T) -> Self
3902 where
3903 T: std::convert::Into<crate::model::InputsUsed>,
3904 {
3905 self.inputs_used = std::option::Option::Some(v.into());
3906 self
3907 }
3908
3909 /// Sets or clears the value of [inputs_used][crate::model::Rule::inputs_used].
3910 ///
3911 /// # Example
3912 /// ```ignore,no_run
3913 /// # use google_cloud_chronicle_v1::model::Rule;
3914 /// use google_cloud_chronicle_v1::model::InputsUsed;
3915 /// let x = Rule::new().set_or_clear_inputs_used(Some(InputsUsed::default()/* use setters */));
3916 /// let x = Rule::new().set_or_clear_inputs_used(None::<InputsUsed>);
3917 /// ```
3918 pub fn set_or_clear_inputs_used<T>(mut self, v: std::option::Option<T>) -> Self
3919 where
3920 T: std::convert::Into<crate::model::InputsUsed>,
3921 {
3922 self.inputs_used = v.map(|x| x.into());
3923 self
3924 }
3925}
3926
3927impl wkt::message::Message for Rule {
3928 fn typename() -> &'static str {
3929 "type.googleapis.com/google.cloud.chronicle.v1.Rule"
3930 }
3931}
3932
3933/// Defines additional types related to [Rule].
3934pub mod rule {
3935 #[allow(unused_imports)]
3936 use super::*;
3937
3938 /// The current compilation state of the rule.
3939 ///
3940 /// # Working with unknown values
3941 ///
3942 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3943 /// additional enum variants at any time. Adding new variants is not considered
3944 /// a breaking change. Applications should write their code in anticipation of:
3945 ///
3946 /// - New values appearing in future releases of the client library, **and**
3947 /// - New values received dynamically, without application changes.
3948 ///
3949 /// Please consult the [Working with enums] section in the user guide for some
3950 /// guidelines.
3951 ///
3952 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3953 #[derive(Clone, Debug, PartialEq)]
3954 #[non_exhaustive]
3955 pub enum CompilationState {
3956 /// The compilation state is unspecified/unknown.
3957 Unspecified,
3958 /// The Rule can successfully compile.
3959 Succeeded,
3960 /// The Rule cannot successfully compile.
3961 /// This is possible if a backwards-incompatible change was made to the
3962 /// compiler.
3963 Failed,
3964 /// If set, the enum was initialized with an unknown value.
3965 ///
3966 /// Applications can examine the value using [CompilationState::value] or
3967 /// [CompilationState::name].
3968 UnknownValue(compilation_state::UnknownValue),
3969 }
3970
3971 #[doc(hidden)]
3972 pub mod compilation_state {
3973 #[allow(unused_imports)]
3974 use super::*;
3975 #[derive(Clone, Debug, PartialEq)]
3976 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3977 }
3978
3979 impl CompilationState {
3980 /// Gets the enum value.
3981 ///
3982 /// Returns `None` if the enum contains an unknown value deserialized from
3983 /// the string representation of enums.
3984 pub fn value(&self) -> std::option::Option<i32> {
3985 match self {
3986 Self::Unspecified => std::option::Option::Some(0),
3987 Self::Succeeded => std::option::Option::Some(1),
3988 Self::Failed => std::option::Option::Some(2),
3989 Self::UnknownValue(u) => u.0.value(),
3990 }
3991 }
3992
3993 /// Gets the enum value as a string.
3994 ///
3995 /// Returns `None` if the enum contains an unknown value deserialized from
3996 /// the integer representation of enums.
3997 pub fn name(&self) -> std::option::Option<&str> {
3998 match self {
3999 Self::Unspecified => std::option::Option::Some("COMPILATION_STATE_UNSPECIFIED"),
4000 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
4001 Self::Failed => std::option::Option::Some("FAILED"),
4002 Self::UnknownValue(u) => u.0.name(),
4003 }
4004 }
4005 }
4006
4007 impl std::default::Default for CompilationState {
4008 fn default() -> Self {
4009 use std::convert::From;
4010 Self::from(0)
4011 }
4012 }
4013
4014 impl std::fmt::Display for CompilationState {
4015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4016 wkt::internal::display_enum(f, self.name(), self.value())
4017 }
4018 }
4019
4020 impl std::convert::From<i32> for CompilationState {
4021 fn from(value: i32) -> Self {
4022 match value {
4023 0 => Self::Unspecified,
4024 1 => Self::Succeeded,
4025 2 => Self::Failed,
4026 _ => Self::UnknownValue(compilation_state::UnknownValue(
4027 wkt::internal::UnknownEnumValue::Integer(value),
4028 )),
4029 }
4030 }
4031 }
4032
4033 impl std::convert::From<&str> for CompilationState {
4034 fn from(value: &str) -> Self {
4035 use std::string::ToString;
4036 match value {
4037 "COMPILATION_STATE_UNSPECIFIED" => Self::Unspecified,
4038 "SUCCEEDED" => Self::Succeeded,
4039 "FAILED" => Self::Failed,
4040 _ => Self::UnknownValue(compilation_state::UnknownValue(
4041 wkt::internal::UnknownEnumValue::String(value.to_string()),
4042 )),
4043 }
4044 }
4045 }
4046
4047 impl serde::ser::Serialize for CompilationState {
4048 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4049 where
4050 S: serde::Serializer,
4051 {
4052 match self {
4053 Self::Unspecified => serializer.serialize_i32(0),
4054 Self::Succeeded => serializer.serialize_i32(1),
4055 Self::Failed => serializer.serialize_i32(2),
4056 Self::UnknownValue(u) => u.0.serialize(serializer),
4057 }
4058 }
4059 }
4060
4061 impl<'de> serde::de::Deserialize<'de> for CompilationState {
4062 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4063 where
4064 D: serde::Deserializer<'de>,
4065 {
4066 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CompilationState>::new(
4067 ".google.cloud.chronicle.v1.Rule.CompilationState",
4068 ))
4069 }
4070 }
4071}
4072
4073/// The RuleDeployment resource represents the deployment state of a Rule.
4074#[derive(Clone, Default, PartialEq)]
4075#[non_exhaustive]
4076pub struct RuleDeployment {
4077 /// Required. The resource name of the rule deployment.
4078 /// Note that RuleDeployment is a child of the overall Rule, not any individual
4079 /// revision, so the resource ID segment for the Rule resource must not
4080 /// reference a specific revision.
4081 /// Format:
4082 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/deployment`
4083 pub name: std::string::String,
4084
4085 /// Whether the rule is currently deployed continuously against incoming data.
4086 pub enabled: bool,
4087
4088 /// Whether detections resulting from this deployment should be considered
4089 /// alerts.
4090 pub alerting: bool,
4091
4092 /// The archive state of the rule deployment.
4093 /// Cannot be set to true unless enabled is set to false.
4094 /// If set to true, alerting will automatically be set to false.
4095 /// If currently set to true, enabled, alerting, and run_frequency cannot be
4096 /// updated.
4097 pub archived: bool,
4098
4099 /// Output only. The timestamp when the rule deployment archive state was last
4100 /// set to true. If the rule deployment's current archive state is not set to
4101 /// true, the field will be empty.
4102 pub archive_time: std::option::Option<wkt::Timestamp>,
4103
4104 /// The run frequency of the rule deployment.
4105 pub run_frequency: crate::model::RunFrequency,
4106
4107 /// Output only. The execution state of the rule deployment.
4108 pub execution_state: crate::model::rule_deployment::ExecutionState,
4109
4110 /// Output only. The names of the associated/chained producer rules. Rules are
4111 /// considered producers for this rule if this rule explicitly filters on their
4112 /// ruleid. Format:
4113 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
4114 pub producer_rules: std::vec::Vec<std::string::String>,
4115
4116 /// Output only. The names of the associated/chained consumer rules. Rules are
4117 /// considered consumers of this rule if their rule text explicitly filters on
4118 /// this rule's ruleid. Format:
4119 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
4120 pub consumer_rules: std::vec::Vec<std::string::String>,
4121
4122 /// Output only. The timestamp when the rule deployment alert state was lastly
4123 /// changed. This is filled regardless of the current alert state. E.g. if the
4124 /// current alert status is false, this timestamp will be the timestamp when
4125 /// the alert status was changed to false.
4126 pub last_alert_status_change_time: std::option::Option<wkt::Timestamp>,
4127
4128 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4129}
4130
4131impl RuleDeployment {
4132 pub fn new() -> Self {
4133 std::default::Default::default()
4134 }
4135
4136 /// Sets the value of [name][crate::model::RuleDeployment::name].
4137 ///
4138 /// # Example
4139 /// ```ignore,no_run
4140 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4141 /// let x = RuleDeployment::new().set_name("example");
4142 /// ```
4143 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4144 self.name = v.into();
4145 self
4146 }
4147
4148 /// Sets the value of [enabled][crate::model::RuleDeployment::enabled].
4149 ///
4150 /// # Example
4151 /// ```ignore,no_run
4152 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4153 /// let x = RuleDeployment::new().set_enabled(true);
4154 /// ```
4155 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4156 self.enabled = v.into();
4157 self
4158 }
4159
4160 /// Sets the value of [alerting][crate::model::RuleDeployment::alerting].
4161 ///
4162 /// # Example
4163 /// ```ignore,no_run
4164 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4165 /// let x = RuleDeployment::new().set_alerting(true);
4166 /// ```
4167 pub fn set_alerting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4168 self.alerting = v.into();
4169 self
4170 }
4171
4172 /// Sets the value of [archived][crate::model::RuleDeployment::archived].
4173 ///
4174 /// # Example
4175 /// ```ignore,no_run
4176 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4177 /// let x = RuleDeployment::new().set_archived(true);
4178 /// ```
4179 pub fn set_archived<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4180 self.archived = v.into();
4181 self
4182 }
4183
4184 /// Sets the value of [archive_time][crate::model::RuleDeployment::archive_time].
4185 ///
4186 /// # Example
4187 /// ```ignore,no_run
4188 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4189 /// use wkt::Timestamp;
4190 /// let x = RuleDeployment::new().set_archive_time(Timestamp::default()/* use setters */);
4191 /// ```
4192 pub fn set_archive_time<T>(mut self, v: T) -> Self
4193 where
4194 T: std::convert::Into<wkt::Timestamp>,
4195 {
4196 self.archive_time = std::option::Option::Some(v.into());
4197 self
4198 }
4199
4200 /// Sets or clears the value of [archive_time][crate::model::RuleDeployment::archive_time].
4201 ///
4202 /// # Example
4203 /// ```ignore,no_run
4204 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4205 /// use wkt::Timestamp;
4206 /// let x = RuleDeployment::new().set_or_clear_archive_time(Some(Timestamp::default()/* use setters */));
4207 /// let x = RuleDeployment::new().set_or_clear_archive_time(None::<Timestamp>);
4208 /// ```
4209 pub fn set_or_clear_archive_time<T>(mut self, v: std::option::Option<T>) -> Self
4210 where
4211 T: std::convert::Into<wkt::Timestamp>,
4212 {
4213 self.archive_time = v.map(|x| x.into());
4214 self
4215 }
4216
4217 /// Sets the value of [run_frequency][crate::model::RuleDeployment::run_frequency].
4218 ///
4219 /// # Example
4220 /// ```ignore,no_run
4221 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4222 /// use google_cloud_chronicle_v1::model::RunFrequency;
4223 /// let x0 = RuleDeployment::new().set_run_frequency(RunFrequency::Live);
4224 /// let x1 = RuleDeployment::new().set_run_frequency(RunFrequency::Hourly);
4225 /// let x2 = RuleDeployment::new().set_run_frequency(RunFrequency::Daily);
4226 /// ```
4227 pub fn set_run_frequency<T: std::convert::Into<crate::model::RunFrequency>>(
4228 mut self,
4229 v: T,
4230 ) -> Self {
4231 self.run_frequency = v.into();
4232 self
4233 }
4234
4235 /// Sets the value of [execution_state][crate::model::RuleDeployment::execution_state].
4236 ///
4237 /// # Example
4238 /// ```ignore,no_run
4239 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4240 /// use google_cloud_chronicle_v1::model::rule_deployment::ExecutionState;
4241 /// let x0 = RuleDeployment::new().set_execution_state(ExecutionState::Default);
4242 /// let x1 = RuleDeployment::new().set_execution_state(ExecutionState::Limited);
4243 /// let x2 = RuleDeployment::new().set_execution_state(ExecutionState::Paused);
4244 /// ```
4245 pub fn set_execution_state<
4246 T: std::convert::Into<crate::model::rule_deployment::ExecutionState>,
4247 >(
4248 mut self,
4249 v: T,
4250 ) -> Self {
4251 self.execution_state = v.into();
4252 self
4253 }
4254
4255 /// Sets the value of [producer_rules][crate::model::RuleDeployment::producer_rules].
4256 ///
4257 /// # Example
4258 /// ```ignore,no_run
4259 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4260 /// let x = RuleDeployment::new().set_producer_rules(["a", "b", "c"]);
4261 /// ```
4262 pub fn set_producer_rules<T, V>(mut self, v: T) -> Self
4263 where
4264 T: std::iter::IntoIterator<Item = V>,
4265 V: std::convert::Into<std::string::String>,
4266 {
4267 use std::iter::Iterator;
4268 self.producer_rules = v.into_iter().map(|i| i.into()).collect();
4269 self
4270 }
4271
4272 /// Sets the value of [consumer_rules][crate::model::RuleDeployment::consumer_rules].
4273 ///
4274 /// # Example
4275 /// ```ignore,no_run
4276 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4277 /// let x = RuleDeployment::new().set_consumer_rules(["a", "b", "c"]);
4278 /// ```
4279 pub fn set_consumer_rules<T, V>(mut self, v: T) -> Self
4280 where
4281 T: std::iter::IntoIterator<Item = V>,
4282 V: std::convert::Into<std::string::String>,
4283 {
4284 use std::iter::Iterator;
4285 self.consumer_rules = v.into_iter().map(|i| i.into()).collect();
4286 self
4287 }
4288
4289 /// Sets the value of [last_alert_status_change_time][crate::model::RuleDeployment::last_alert_status_change_time].
4290 ///
4291 /// # Example
4292 /// ```ignore,no_run
4293 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4294 /// use wkt::Timestamp;
4295 /// let x = RuleDeployment::new().set_last_alert_status_change_time(Timestamp::default()/* use setters */);
4296 /// ```
4297 pub fn set_last_alert_status_change_time<T>(mut self, v: T) -> Self
4298 where
4299 T: std::convert::Into<wkt::Timestamp>,
4300 {
4301 self.last_alert_status_change_time = std::option::Option::Some(v.into());
4302 self
4303 }
4304
4305 /// Sets or clears the value of [last_alert_status_change_time][crate::model::RuleDeployment::last_alert_status_change_time].
4306 ///
4307 /// # Example
4308 /// ```ignore,no_run
4309 /// # use google_cloud_chronicle_v1::model::RuleDeployment;
4310 /// use wkt::Timestamp;
4311 /// let x = RuleDeployment::new().set_or_clear_last_alert_status_change_time(Some(Timestamp::default()/* use setters */));
4312 /// let x = RuleDeployment::new().set_or_clear_last_alert_status_change_time(None::<Timestamp>);
4313 /// ```
4314 pub fn set_or_clear_last_alert_status_change_time<T>(
4315 mut self,
4316 v: std::option::Option<T>,
4317 ) -> Self
4318 where
4319 T: std::convert::Into<wkt::Timestamp>,
4320 {
4321 self.last_alert_status_change_time = v.map(|x| x.into());
4322 self
4323 }
4324}
4325
4326impl wkt::message::Message for RuleDeployment {
4327 fn typename() -> &'static str {
4328 "type.googleapis.com/google.cloud.chronicle.v1.RuleDeployment"
4329 }
4330}
4331
4332/// Defines additional types related to [RuleDeployment].
4333pub mod rule_deployment {
4334 #[allow(unused_imports)]
4335 use super::*;
4336
4337 /// The possible execution states the rule deployment can be in.
4338 ///
4339 /// # Working with unknown values
4340 ///
4341 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4342 /// additional enum variants at any time. Adding new variants is not considered
4343 /// a breaking change. Applications should write their code in anticipation of:
4344 ///
4345 /// - New values appearing in future releases of the client library, **and**
4346 /// - New values received dynamically, without application changes.
4347 ///
4348 /// Please consult the [Working with enums] section in the user guide for some
4349 /// guidelines.
4350 ///
4351 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4352 #[derive(Clone, Debug, PartialEq)]
4353 #[non_exhaustive]
4354 pub enum ExecutionState {
4355 /// Unspecified or unknown execution state.
4356 Unspecified,
4357 /// Default execution state.
4358 Default,
4359 /// Rules in limited state may not have their executions guaranteed.
4360 Limited,
4361 /// Paused rules are not executed at all.
4362 Paused,
4363 /// If set, the enum was initialized with an unknown value.
4364 ///
4365 /// Applications can examine the value using [ExecutionState::value] or
4366 /// [ExecutionState::name].
4367 UnknownValue(execution_state::UnknownValue),
4368 }
4369
4370 #[doc(hidden)]
4371 pub mod execution_state {
4372 #[allow(unused_imports)]
4373 use super::*;
4374 #[derive(Clone, Debug, PartialEq)]
4375 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4376 }
4377
4378 impl ExecutionState {
4379 /// Gets the enum value.
4380 ///
4381 /// Returns `None` if the enum contains an unknown value deserialized from
4382 /// the string representation of enums.
4383 pub fn value(&self) -> std::option::Option<i32> {
4384 match self {
4385 Self::Unspecified => std::option::Option::Some(0),
4386 Self::Default => std::option::Option::Some(1),
4387 Self::Limited => std::option::Option::Some(2),
4388 Self::Paused => std::option::Option::Some(3),
4389 Self::UnknownValue(u) => u.0.value(),
4390 }
4391 }
4392
4393 /// Gets the enum value as a string.
4394 ///
4395 /// Returns `None` if the enum contains an unknown value deserialized from
4396 /// the integer representation of enums.
4397 pub fn name(&self) -> std::option::Option<&str> {
4398 match self {
4399 Self::Unspecified => std::option::Option::Some("EXECUTION_STATE_UNSPECIFIED"),
4400 Self::Default => std::option::Option::Some("DEFAULT"),
4401 Self::Limited => std::option::Option::Some("LIMITED"),
4402 Self::Paused => std::option::Option::Some("PAUSED"),
4403 Self::UnknownValue(u) => u.0.name(),
4404 }
4405 }
4406 }
4407
4408 impl std::default::Default for ExecutionState {
4409 fn default() -> Self {
4410 use std::convert::From;
4411 Self::from(0)
4412 }
4413 }
4414
4415 impl std::fmt::Display for ExecutionState {
4416 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4417 wkt::internal::display_enum(f, self.name(), self.value())
4418 }
4419 }
4420
4421 impl std::convert::From<i32> for ExecutionState {
4422 fn from(value: i32) -> Self {
4423 match value {
4424 0 => Self::Unspecified,
4425 1 => Self::Default,
4426 2 => Self::Limited,
4427 3 => Self::Paused,
4428 _ => Self::UnknownValue(execution_state::UnknownValue(
4429 wkt::internal::UnknownEnumValue::Integer(value),
4430 )),
4431 }
4432 }
4433 }
4434
4435 impl std::convert::From<&str> for ExecutionState {
4436 fn from(value: &str) -> Self {
4437 use std::string::ToString;
4438 match value {
4439 "EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
4440 "DEFAULT" => Self::Default,
4441 "LIMITED" => Self::Limited,
4442 "PAUSED" => Self::Paused,
4443 _ => Self::UnknownValue(execution_state::UnknownValue(
4444 wkt::internal::UnknownEnumValue::String(value.to_string()),
4445 )),
4446 }
4447 }
4448 }
4449
4450 impl serde::ser::Serialize for ExecutionState {
4451 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4452 where
4453 S: serde::Serializer,
4454 {
4455 match self {
4456 Self::Unspecified => serializer.serialize_i32(0),
4457 Self::Default => serializer.serialize_i32(1),
4458 Self::Limited => serializer.serialize_i32(2),
4459 Self::Paused => serializer.serialize_i32(3),
4460 Self::UnknownValue(u) => u.0.serialize(serializer),
4461 }
4462 }
4463 }
4464
4465 impl<'de> serde::de::Deserialize<'de> for ExecutionState {
4466 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4467 where
4468 D: serde::Deserializer<'de>,
4469 {
4470 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionState>::new(
4471 ".google.cloud.chronicle.v1.RuleDeployment.ExecutionState",
4472 ))
4473 }
4474 }
4475}
4476
4477/// Retrohunt is an execution of a Rule over a time range in the past.
4478#[derive(Clone, Default, PartialEq)]
4479#[non_exhaustive]
4480pub struct Retrohunt {
4481 /// The resource name of the retrohunt.
4482 /// Retrohunt is the child of a rule revision. {rule} in the format below is
4483 /// structured as {rule_id@revision_id}.
4484 /// Format:
4485 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/retrohunts/{retrohunt}`
4486 pub name: std::string::String,
4487
4488 /// Required. The start and end time of the event time range this retrohunt
4489 /// processes.
4490 pub process_interval: std::option::Option<google_cloud_type::model::Interval>,
4491
4492 /// Output only. The start and end time of the retrohunt execution. If the
4493 /// retrohunt is not yet finished, the end time of the interval will not be
4494 /// populated.
4495 pub execution_interval: std::option::Option<google_cloud_type::model::Interval>,
4496
4497 /// Output only. The state of the retrohunt.
4498 pub state: crate::model::retrohunt::State,
4499
4500 /// Output only. Percent progress of the retrohunt towards completion, from
4501 /// 0.00 to 100.00.
4502 pub progress_percentage: f32,
4503
4504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4505}
4506
4507impl Retrohunt {
4508 pub fn new() -> Self {
4509 std::default::Default::default()
4510 }
4511
4512 /// Sets the value of [name][crate::model::Retrohunt::name].
4513 ///
4514 /// # Example
4515 /// ```ignore,no_run
4516 /// # use google_cloud_chronicle_v1::model::Retrohunt;
4517 /// let x = Retrohunt::new().set_name("example");
4518 /// ```
4519 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4520 self.name = v.into();
4521 self
4522 }
4523
4524 /// Sets the value of [process_interval][crate::model::Retrohunt::process_interval].
4525 ///
4526 /// # Example
4527 /// ```ignore,no_run
4528 /// # use google_cloud_chronicle_v1::model::Retrohunt;
4529 /// use google_cloud_type::model::Interval;
4530 /// let x = Retrohunt::new().set_process_interval(Interval::default()/* use setters */);
4531 /// ```
4532 pub fn set_process_interval<T>(mut self, v: T) -> Self
4533 where
4534 T: std::convert::Into<google_cloud_type::model::Interval>,
4535 {
4536 self.process_interval = std::option::Option::Some(v.into());
4537 self
4538 }
4539
4540 /// Sets or clears the value of [process_interval][crate::model::Retrohunt::process_interval].
4541 ///
4542 /// # Example
4543 /// ```ignore,no_run
4544 /// # use google_cloud_chronicle_v1::model::Retrohunt;
4545 /// use google_cloud_type::model::Interval;
4546 /// let x = Retrohunt::new().set_or_clear_process_interval(Some(Interval::default()/* use setters */));
4547 /// let x = Retrohunt::new().set_or_clear_process_interval(None::<Interval>);
4548 /// ```
4549 pub fn set_or_clear_process_interval<T>(mut self, v: std::option::Option<T>) -> Self
4550 where
4551 T: std::convert::Into<google_cloud_type::model::Interval>,
4552 {
4553 self.process_interval = v.map(|x| x.into());
4554 self
4555 }
4556
4557 /// Sets the value of [execution_interval][crate::model::Retrohunt::execution_interval].
4558 ///
4559 /// # Example
4560 /// ```ignore,no_run
4561 /// # use google_cloud_chronicle_v1::model::Retrohunt;
4562 /// use google_cloud_type::model::Interval;
4563 /// let x = Retrohunt::new().set_execution_interval(Interval::default()/* use setters */);
4564 /// ```
4565 pub fn set_execution_interval<T>(mut self, v: T) -> Self
4566 where
4567 T: std::convert::Into<google_cloud_type::model::Interval>,
4568 {
4569 self.execution_interval = std::option::Option::Some(v.into());
4570 self
4571 }
4572
4573 /// Sets or clears the value of [execution_interval][crate::model::Retrohunt::execution_interval].
4574 ///
4575 /// # Example
4576 /// ```ignore,no_run
4577 /// # use google_cloud_chronicle_v1::model::Retrohunt;
4578 /// use google_cloud_type::model::Interval;
4579 /// let x = Retrohunt::new().set_or_clear_execution_interval(Some(Interval::default()/* use setters */));
4580 /// let x = Retrohunt::new().set_or_clear_execution_interval(None::<Interval>);
4581 /// ```
4582 pub fn set_or_clear_execution_interval<T>(mut self, v: std::option::Option<T>) -> Self
4583 where
4584 T: std::convert::Into<google_cloud_type::model::Interval>,
4585 {
4586 self.execution_interval = v.map(|x| x.into());
4587 self
4588 }
4589
4590 /// Sets the value of [state][crate::model::Retrohunt::state].
4591 ///
4592 /// # Example
4593 /// ```ignore,no_run
4594 /// # use google_cloud_chronicle_v1::model::Retrohunt;
4595 /// use google_cloud_chronicle_v1::model::retrohunt::State;
4596 /// let x0 = Retrohunt::new().set_state(State::Running);
4597 /// let x1 = Retrohunt::new().set_state(State::Done);
4598 /// let x2 = Retrohunt::new().set_state(State::Cancelled);
4599 /// ```
4600 pub fn set_state<T: std::convert::Into<crate::model::retrohunt::State>>(
4601 mut self,
4602 v: T,
4603 ) -> Self {
4604 self.state = v.into();
4605 self
4606 }
4607
4608 /// Sets the value of [progress_percentage][crate::model::Retrohunt::progress_percentage].
4609 ///
4610 /// # Example
4611 /// ```ignore,no_run
4612 /// # use google_cloud_chronicle_v1::model::Retrohunt;
4613 /// let x = Retrohunt::new().set_progress_percentage(42.0);
4614 /// ```
4615 pub fn set_progress_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4616 self.progress_percentage = v.into();
4617 self
4618 }
4619}
4620
4621impl wkt::message::Message for Retrohunt {
4622 fn typename() -> &'static str {
4623 "type.googleapis.com/google.cloud.chronicle.v1.Retrohunt"
4624 }
4625}
4626
4627/// Defines additional types related to [Retrohunt].
4628pub mod retrohunt {
4629 #[allow(unused_imports)]
4630 use super::*;
4631
4632 /// The possible states a retrohunt can be in.
4633 ///
4634 /// # Working with unknown values
4635 ///
4636 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4637 /// additional enum variants at any time. Adding new variants is not considered
4638 /// a breaking change. Applications should write their code in anticipation of:
4639 ///
4640 /// - New values appearing in future releases of the client library, **and**
4641 /// - New values received dynamically, without application changes.
4642 ///
4643 /// Please consult the [Working with enums] section in the user guide for some
4644 /// guidelines.
4645 ///
4646 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4647 #[derive(Clone, Debug, PartialEq)]
4648 #[non_exhaustive]
4649 pub enum State {
4650 /// Unspecified or unknown retrohunt state.
4651 Unspecified,
4652 /// Running state.
4653 Running,
4654 /// Done state.
4655 Done,
4656 /// Cancelled state.
4657 Cancelled,
4658 /// Failed state.
4659 Failed,
4660 /// If set, the enum was initialized with an unknown value.
4661 ///
4662 /// Applications can examine the value using [State::value] or
4663 /// [State::name].
4664 UnknownValue(state::UnknownValue),
4665 }
4666
4667 #[doc(hidden)]
4668 pub mod state {
4669 #[allow(unused_imports)]
4670 use super::*;
4671 #[derive(Clone, Debug, PartialEq)]
4672 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4673 }
4674
4675 impl State {
4676 /// Gets the enum value.
4677 ///
4678 /// Returns `None` if the enum contains an unknown value deserialized from
4679 /// the string representation of enums.
4680 pub fn value(&self) -> std::option::Option<i32> {
4681 match self {
4682 Self::Unspecified => std::option::Option::Some(0),
4683 Self::Running => std::option::Option::Some(1),
4684 Self::Done => std::option::Option::Some(2),
4685 Self::Cancelled => std::option::Option::Some(3),
4686 Self::Failed => std::option::Option::Some(4),
4687 Self::UnknownValue(u) => u.0.value(),
4688 }
4689 }
4690
4691 /// Gets the enum value as a string.
4692 ///
4693 /// Returns `None` if the enum contains an unknown value deserialized from
4694 /// the integer representation of enums.
4695 pub fn name(&self) -> std::option::Option<&str> {
4696 match self {
4697 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4698 Self::Running => std::option::Option::Some("RUNNING"),
4699 Self::Done => std::option::Option::Some("DONE"),
4700 Self::Cancelled => std::option::Option::Some("CANCELLED"),
4701 Self::Failed => std::option::Option::Some("FAILED"),
4702 Self::UnknownValue(u) => u.0.name(),
4703 }
4704 }
4705 }
4706
4707 impl std::default::Default for State {
4708 fn default() -> Self {
4709 use std::convert::From;
4710 Self::from(0)
4711 }
4712 }
4713
4714 impl std::fmt::Display for State {
4715 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4716 wkt::internal::display_enum(f, self.name(), self.value())
4717 }
4718 }
4719
4720 impl std::convert::From<i32> for State {
4721 fn from(value: i32) -> Self {
4722 match value {
4723 0 => Self::Unspecified,
4724 1 => Self::Running,
4725 2 => Self::Done,
4726 3 => Self::Cancelled,
4727 4 => Self::Failed,
4728 _ => Self::UnknownValue(state::UnknownValue(
4729 wkt::internal::UnknownEnumValue::Integer(value),
4730 )),
4731 }
4732 }
4733 }
4734
4735 impl std::convert::From<&str> for State {
4736 fn from(value: &str) -> Self {
4737 use std::string::ToString;
4738 match value {
4739 "STATE_UNSPECIFIED" => Self::Unspecified,
4740 "RUNNING" => Self::Running,
4741 "DONE" => Self::Done,
4742 "CANCELLED" => Self::Cancelled,
4743 "FAILED" => Self::Failed,
4744 _ => Self::UnknownValue(state::UnknownValue(
4745 wkt::internal::UnknownEnumValue::String(value.to_string()),
4746 )),
4747 }
4748 }
4749 }
4750
4751 impl serde::ser::Serialize for State {
4752 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4753 where
4754 S: serde::Serializer,
4755 {
4756 match self {
4757 Self::Unspecified => serializer.serialize_i32(0),
4758 Self::Running => serializer.serialize_i32(1),
4759 Self::Done => serializer.serialize_i32(2),
4760 Self::Cancelled => serializer.serialize_i32(3),
4761 Self::Failed => serializer.serialize_i32(4),
4762 Self::UnknownValue(u) => u.0.serialize(serializer),
4763 }
4764 }
4765 }
4766
4767 impl<'de> serde::de::Deserialize<'de> for State {
4768 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4769 where
4770 D: serde::Deserializer<'de>,
4771 {
4772 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4773 ".google.cloud.chronicle.v1.Retrohunt.State",
4774 ))
4775 }
4776 }
4777}
4778
4779/// Request message for CreateRule method.
4780#[derive(Clone, Default, PartialEq)]
4781#[non_exhaustive]
4782pub struct CreateRuleRequest {
4783 /// Required. The parent resource where this rule will be created.
4784 /// Format: `projects/{project}/locations/{location}/instances/{instance}`
4785 pub parent: std::string::String,
4786
4787 /// Required. The rule to create.
4788 pub rule: std::option::Option<crate::model::Rule>,
4789
4790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4791}
4792
4793impl CreateRuleRequest {
4794 pub fn new() -> Self {
4795 std::default::Default::default()
4796 }
4797
4798 /// Sets the value of [parent][crate::model::CreateRuleRequest::parent].
4799 ///
4800 /// # Example
4801 /// ```ignore,no_run
4802 /// # use google_cloud_chronicle_v1::model::CreateRuleRequest;
4803 /// let x = CreateRuleRequest::new().set_parent("example");
4804 /// ```
4805 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4806 self.parent = v.into();
4807 self
4808 }
4809
4810 /// Sets the value of [rule][crate::model::CreateRuleRequest::rule].
4811 ///
4812 /// # Example
4813 /// ```ignore,no_run
4814 /// # use google_cloud_chronicle_v1::model::CreateRuleRequest;
4815 /// use google_cloud_chronicle_v1::model::Rule;
4816 /// let x = CreateRuleRequest::new().set_rule(Rule::default()/* use setters */);
4817 /// ```
4818 pub fn set_rule<T>(mut self, v: T) -> Self
4819 where
4820 T: std::convert::Into<crate::model::Rule>,
4821 {
4822 self.rule = std::option::Option::Some(v.into());
4823 self
4824 }
4825
4826 /// Sets or clears the value of [rule][crate::model::CreateRuleRequest::rule].
4827 ///
4828 /// # Example
4829 /// ```ignore,no_run
4830 /// # use google_cloud_chronicle_v1::model::CreateRuleRequest;
4831 /// use google_cloud_chronicle_v1::model::Rule;
4832 /// let x = CreateRuleRequest::new().set_or_clear_rule(Some(Rule::default()/* use setters */));
4833 /// let x = CreateRuleRequest::new().set_or_clear_rule(None::<Rule>);
4834 /// ```
4835 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
4836 where
4837 T: std::convert::Into<crate::model::Rule>,
4838 {
4839 self.rule = v.map(|x| x.into());
4840 self
4841 }
4842}
4843
4844impl wkt::message::Message for CreateRuleRequest {
4845 fn typename() -> &'static str {
4846 "type.googleapis.com/google.cloud.chronicle.v1.CreateRuleRequest"
4847 }
4848}
4849
4850/// Request message for GetRule method.
4851#[derive(Clone, Default, PartialEq)]
4852#[non_exhaustive]
4853pub struct GetRuleRequest {
4854 /// Required. The name of the rule to retrieve.
4855 /// Format:
4856 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
4857 pub name: std::string::String,
4858
4859 /// The view field indicates the scope of fields to populate for the Rule being
4860 /// returned. If unspecified, defaults to FULL.
4861 pub view: crate::model::RuleView,
4862
4863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4864}
4865
4866impl GetRuleRequest {
4867 pub fn new() -> Self {
4868 std::default::Default::default()
4869 }
4870
4871 /// Sets the value of [name][crate::model::GetRuleRequest::name].
4872 ///
4873 /// # Example
4874 /// ```ignore,no_run
4875 /// # use google_cloud_chronicle_v1::model::GetRuleRequest;
4876 /// let x = GetRuleRequest::new().set_name("example");
4877 /// ```
4878 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4879 self.name = v.into();
4880 self
4881 }
4882
4883 /// Sets the value of [view][crate::model::GetRuleRequest::view].
4884 ///
4885 /// # Example
4886 /// ```ignore,no_run
4887 /// # use google_cloud_chronicle_v1::model::GetRuleRequest;
4888 /// use google_cloud_chronicle_v1::model::RuleView;
4889 /// let x0 = GetRuleRequest::new().set_view(RuleView::Basic);
4890 /// let x1 = GetRuleRequest::new().set_view(RuleView::Full);
4891 /// let x2 = GetRuleRequest::new().set_view(RuleView::RevisionMetadataOnly);
4892 /// ```
4893 pub fn set_view<T: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
4894 self.view = v.into();
4895 self
4896 }
4897}
4898
4899impl wkt::message::Message for GetRuleRequest {
4900 fn typename() -> &'static str {
4901 "type.googleapis.com/google.cloud.chronicle.v1.GetRuleRequest"
4902 }
4903}
4904
4905/// Request message for ListRules method.
4906#[derive(Clone, Default, PartialEq)]
4907#[non_exhaustive]
4908pub struct ListRulesRequest {
4909 /// Required. The parent, which owns this collection of rules.
4910 /// Format:
4911 /// `projects/{project}/locations/{location}/instances/{instance}`
4912 pub parent: std::string::String,
4913
4914 /// The maximum number of rules to return. The service may return fewer than
4915 /// this value. If unspecified, at most 100 rules will be returned. The
4916 /// maximum value is 1000; values above 1000 will be coerced to 1000.
4917 pub page_size: i32,
4918
4919 /// A page token, received from a previous `ListRules` call.
4920 /// Provide this to retrieve the subsequent page.
4921 ///
4922 /// When paginating, all other parameters provided to `ListRules`
4923 /// must match the call that provided the page token.
4924 pub page_token: std::string::String,
4925
4926 /// view indicates the scope of fields to populate for the Rule being returned.
4927 /// If unspecified, defaults to BASIC.
4928 pub view: crate::model::RuleView,
4929
4930 /// Only the following filters are allowed:
4931 /// "reference_lists:{reference_list_name}"
4932 /// "data_tables:{data_table_name}"
4933 /// "display_name:{display_name}"
4934 pub filter: std::string::String,
4935
4936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4937}
4938
4939impl ListRulesRequest {
4940 pub fn new() -> Self {
4941 std::default::Default::default()
4942 }
4943
4944 /// Sets the value of [parent][crate::model::ListRulesRequest::parent].
4945 ///
4946 /// # Example
4947 /// ```ignore,no_run
4948 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
4949 /// let x = ListRulesRequest::new().set_parent("example");
4950 /// ```
4951 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4952 self.parent = v.into();
4953 self
4954 }
4955
4956 /// Sets the value of [page_size][crate::model::ListRulesRequest::page_size].
4957 ///
4958 /// # Example
4959 /// ```ignore,no_run
4960 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
4961 /// let x = ListRulesRequest::new().set_page_size(42);
4962 /// ```
4963 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4964 self.page_size = v.into();
4965 self
4966 }
4967
4968 /// Sets the value of [page_token][crate::model::ListRulesRequest::page_token].
4969 ///
4970 /// # Example
4971 /// ```ignore,no_run
4972 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
4973 /// let x = ListRulesRequest::new().set_page_token("example");
4974 /// ```
4975 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4976 self.page_token = v.into();
4977 self
4978 }
4979
4980 /// Sets the value of [view][crate::model::ListRulesRequest::view].
4981 ///
4982 /// # Example
4983 /// ```ignore,no_run
4984 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
4985 /// use google_cloud_chronicle_v1::model::RuleView;
4986 /// let x0 = ListRulesRequest::new().set_view(RuleView::Basic);
4987 /// let x1 = ListRulesRequest::new().set_view(RuleView::Full);
4988 /// let x2 = ListRulesRequest::new().set_view(RuleView::RevisionMetadataOnly);
4989 /// ```
4990 pub fn set_view<T: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
4991 self.view = v.into();
4992 self
4993 }
4994
4995 /// Sets the value of [filter][crate::model::ListRulesRequest::filter].
4996 ///
4997 /// # Example
4998 /// ```ignore,no_run
4999 /// # use google_cloud_chronicle_v1::model::ListRulesRequest;
5000 /// let x = ListRulesRequest::new().set_filter("example");
5001 /// ```
5002 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5003 self.filter = v.into();
5004 self
5005 }
5006}
5007
5008impl wkt::message::Message for ListRulesRequest {
5009 fn typename() -> &'static str {
5010 "type.googleapis.com/google.cloud.chronicle.v1.ListRulesRequest"
5011 }
5012}
5013
5014/// Response message for ListRules method.
5015#[derive(Clone, Default, PartialEq)]
5016#[non_exhaustive]
5017pub struct ListRulesResponse {
5018 /// The rules from the specified instance.
5019 pub rules: std::vec::Vec<crate::model::Rule>,
5020
5021 /// A token, which can be sent as `page_token` to retrieve the next page.
5022 /// If this field is omitted, there are no subsequent pages.
5023 pub next_page_token: std::string::String,
5024
5025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5026}
5027
5028impl ListRulesResponse {
5029 pub fn new() -> Self {
5030 std::default::Default::default()
5031 }
5032
5033 /// Sets the value of [rules][crate::model::ListRulesResponse::rules].
5034 ///
5035 /// # Example
5036 /// ```ignore,no_run
5037 /// # use google_cloud_chronicle_v1::model::ListRulesResponse;
5038 /// use google_cloud_chronicle_v1::model::Rule;
5039 /// let x = ListRulesResponse::new()
5040 /// .set_rules([
5041 /// Rule::default()/* use setters */,
5042 /// Rule::default()/* use (different) setters */,
5043 /// ]);
5044 /// ```
5045 pub fn set_rules<T, V>(mut self, v: T) -> Self
5046 where
5047 T: std::iter::IntoIterator<Item = V>,
5048 V: std::convert::Into<crate::model::Rule>,
5049 {
5050 use std::iter::Iterator;
5051 self.rules = v.into_iter().map(|i| i.into()).collect();
5052 self
5053 }
5054
5055 /// Sets the value of [next_page_token][crate::model::ListRulesResponse::next_page_token].
5056 ///
5057 /// # Example
5058 /// ```ignore,no_run
5059 /// # use google_cloud_chronicle_v1::model::ListRulesResponse;
5060 /// let x = ListRulesResponse::new().set_next_page_token("example");
5061 /// ```
5062 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5063 self.next_page_token = v.into();
5064 self
5065 }
5066}
5067
5068impl wkt::message::Message for ListRulesResponse {
5069 fn typename() -> &'static str {
5070 "type.googleapis.com/google.cloud.chronicle.v1.ListRulesResponse"
5071 }
5072}
5073
5074#[doc(hidden)]
5075impl google_cloud_gax::paginator::internal::PageableResponse for ListRulesResponse {
5076 type PageItem = crate::model::Rule;
5077
5078 fn items(self) -> std::vec::Vec<Self::PageItem> {
5079 self.rules
5080 }
5081
5082 fn next_page_token(&self) -> std::string::String {
5083 use std::clone::Clone;
5084 self.next_page_token.clone()
5085 }
5086}
5087
5088/// Request message for UpdateRule method.
5089#[derive(Clone, Default, PartialEq)]
5090#[non_exhaustive]
5091pub struct UpdateRuleRequest {
5092 /// Required. The rule to update.
5093 ///
5094 /// The rule's `name` field is used to identify the rule to update.
5095 /// Format:
5096 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
5097 pub rule: std::option::Option<crate::model::Rule>,
5098
5099 /// The list of fields to update. If not included, all fields with a non-empty
5100 /// value will be overwritten.
5101 pub update_mask: std::option::Option<wkt::FieldMask>,
5102
5103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5104}
5105
5106impl UpdateRuleRequest {
5107 pub fn new() -> Self {
5108 std::default::Default::default()
5109 }
5110
5111 /// Sets the value of [rule][crate::model::UpdateRuleRequest::rule].
5112 ///
5113 /// # Example
5114 /// ```ignore,no_run
5115 /// # use google_cloud_chronicle_v1::model::UpdateRuleRequest;
5116 /// use google_cloud_chronicle_v1::model::Rule;
5117 /// let x = UpdateRuleRequest::new().set_rule(Rule::default()/* use setters */);
5118 /// ```
5119 pub fn set_rule<T>(mut self, v: T) -> Self
5120 where
5121 T: std::convert::Into<crate::model::Rule>,
5122 {
5123 self.rule = std::option::Option::Some(v.into());
5124 self
5125 }
5126
5127 /// Sets or clears the value of [rule][crate::model::UpdateRuleRequest::rule].
5128 ///
5129 /// # Example
5130 /// ```ignore,no_run
5131 /// # use google_cloud_chronicle_v1::model::UpdateRuleRequest;
5132 /// use google_cloud_chronicle_v1::model::Rule;
5133 /// let x = UpdateRuleRequest::new().set_or_clear_rule(Some(Rule::default()/* use setters */));
5134 /// let x = UpdateRuleRequest::new().set_or_clear_rule(None::<Rule>);
5135 /// ```
5136 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
5137 where
5138 T: std::convert::Into<crate::model::Rule>,
5139 {
5140 self.rule = v.map(|x| x.into());
5141 self
5142 }
5143
5144 /// Sets the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
5145 ///
5146 /// # Example
5147 /// ```ignore,no_run
5148 /// # use google_cloud_chronicle_v1::model::UpdateRuleRequest;
5149 /// use wkt::FieldMask;
5150 /// let x = UpdateRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5151 /// ```
5152 pub fn set_update_mask<T>(mut self, v: T) -> Self
5153 where
5154 T: std::convert::Into<wkt::FieldMask>,
5155 {
5156 self.update_mask = std::option::Option::Some(v.into());
5157 self
5158 }
5159
5160 /// Sets or clears the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
5161 ///
5162 /// # Example
5163 /// ```ignore,no_run
5164 /// # use google_cloud_chronicle_v1::model::UpdateRuleRequest;
5165 /// use wkt::FieldMask;
5166 /// let x = UpdateRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5167 /// let x = UpdateRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5168 /// ```
5169 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5170 where
5171 T: std::convert::Into<wkt::FieldMask>,
5172 {
5173 self.update_mask = v.map(|x| x.into());
5174 self
5175 }
5176}
5177
5178impl wkt::message::Message for UpdateRuleRequest {
5179 fn typename() -> &'static str {
5180 "type.googleapis.com/google.cloud.chronicle.v1.UpdateRuleRequest"
5181 }
5182}
5183
5184/// Request message for the DeleteRule method.
5185#[derive(Clone, Default, PartialEq)]
5186#[non_exhaustive]
5187pub struct DeleteRuleRequest {
5188 /// Required. The name of the rule to delete. A rule revision timestamp cannot
5189 /// be specified as part of the name, as deleting specific revisions is not
5190 /// supported.
5191 /// Format:
5192 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
5193 pub name: std::string::String,
5194
5195 /// Optional. If set to true, any retrohunts and any detections associated with
5196 /// the rule will also be deleted. If set to false, the call will only succeed
5197 /// if the rule has no associated retrohunts, including completed retrohunts,
5198 /// and no associated detections. Regardless of this field's value, the rule
5199 /// deployment associated with this rule will also be deleted.
5200 pub force: bool,
5201
5202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5203}
5204
5205impl DeleteRuleRequest {
5206 pub fn new() -> Self {
5207 std::default::Default::default()
5208 }
5209
5210 /// Sets the value of [name][crate::model::DeleteRuleRequest::name].
5211 ///
5212 /// # Example
5213 /// ```ignore,no_run
5214 /// # use google_cloud_chronicle_v1::model::DeleteRuleRequest;
5215 /// let x = DeleteRuleRequest::new().set_name("example");
5216 /// ```
5217 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5218 self.name = v.into();
5219 self
5220 }
5221
5222 /// Sets the value of [force][crate::model::DeleteRuleRequest::force].
5223 ///
5224 /// # Example
5225 /// ```ignore,no_run
5226 /// # use google_cloud_chronicle_v1::model::DeleteRuleRequest;
5227 /// let x = DeleteRuleRequest::new().set_force(true);
5228 /// ```
5229 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5230 self.force = v.into();
5231 self
5232 }
5233}
5234
5235impl wkt::message::Message for DeleteRuleRequest {
5236 fn typename() -> &'static str {
5237 "type.googleapis.com/google.cloud.chronicle.v1.DeleteRuleRequest"
5238 }
5239}
5240
5241/// Request message for ListRuleRevisions method.
5242#[derive(Clone, Default, PartialEq)]
5243#[non_exhaustive]
5244pub struct ListRuleRevisionsRequest {
5245 /// Required. The name of the rule to list revisions for.
5246 /// Format:
5247 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
5248 pub name: std::string::String,
5249
5250 /// The maximum number of revisions to return per page. The service may return
5251 /// fewer than this value. If unspecified, at most 100 revisions will be
5252 /// returned. The maximum value is 1000; values above 1000 will be coerced to
5253 /// 1000.
5254 pub page_size: i32,
5255
5256 /// The page token, received from a previous `ListRuleRevisions` call.
5257 /// Provide this to retrieve the subsequent page.
5258 ///
5259 /// When paginating, all other parameters provided to `ListRuleRevisions`
5260 /// must match the call that provided the page token.
5261 pub page_token: std::string::String,
5262
5263 /// The view field indicates the scope of fields to populate for the revision
5264 /// being returned. If unspecified, defaults to BASIC.
5265 pub view: crate::model::RuleView,
5266
5267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5268}
5269
5270impl ListRuleRevisionsRequest {
5271 pub fn new() -> Self {
5272 std::default::Default::default()
5273 }
5274
5275 /// Sets the value of [name][crate::model::ListRuleRevisionsRequest::name].
5276 ///
5277 /// # Example
5278 /// ```ignore,no_run
5279 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsRequest;
5280 /// let x = ListRuleRevisionsRequest::new().set_name("example");
5281 /// ```
5282 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5283 self.name = v.into();
5284 self
5285 }
5286
5287 /// Sets the value of [page_size][crate::model::ListRuleRevisionsRequest::page_size].
5288 ///
5289 /// # Example
5290 /// ```ignore,no_run
5291 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsRequest;
5292 /// let x = ListRuleRevisionsRequest::new().set_page_size(42);
5293 /// ```
5294 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5295 self.page_size = v.into();
5296 self
5297 }
5298
5299 /// Sets the value of [page_token][crate::model::ListRuleRevisionsRequest::page_token].
5300 ///
5301 /// # Example
5302 /// ```ignore,no_run
5303 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsRequest;
5304 /// let x = ListRuleRevisionsRequest::new().set_page_token("example");
5305 /// ```
5306 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5307 self.page_token = v.into();
5308 self
5309 }
5310
5311 /// Sets the value of [view][crate::model::ListRuleRevisionsRequest::view].
5312 ///
5313 /// # Example
5314 /// ```ignore,no_run
5315 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsRequest;
5316 /// use google_cloud_chronicle_v1::model::RuleView;
5317 /// let x0 = ListRuleRevisionsRequest::new().set_view(RuleView::Basic);
5318 /// let x1 = ListRuleRevisionsRequest::new().set_view(RuleView::Full);
5319 /// let x2 = ListRuleRevisionsRequest::new().set_view(RuleView::RevisionMetadataOnly);
5320 /// ```
5321 pub fn set_view<T: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
5322 self.view = v.into();
5323 self
5324 }
5325}
5326
5327impl wkt::message::Message for ListRuleRevisionsRequest {
5328 fn typename() -> &'static str {
5329 "type.googleapis.com/google.cloud.chronicle.v1.ListRuleRevisionsRequest"
5330 }
5331}
5332
5333/// Response message for ListRuleRevisions method.
5334#[derive(Clone, Default, PartialEq)]
5335#[non_exhaustive]
5336pub struct ListRuleRevisionsResponse {
5337 /// The revisions of the rule.
5338 pub rules: std::vec::Vec<crate::model::Rule>,
5339
5340 /// A token that can be sent as `page_token` to retrieve the next page.
5341 /// If this field is omitted, there are no subsequent pages.
5342 pub next_page_token: std::string::String,
5343
5344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5345}
5346
5347impl ListRuleRevisionsResponse {
5348 pub fn new() -> Self {
5349 std::default::Default::default()
5350 }
5351
5352 /// Sets the value of [rules][crate::model::ListRuleRevisionsResponse::rules].
5353 ///
5354 /// # Example
5355 /// ```ignore,no_run
5356 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsResponse;
5357 /// use google_cloud_chronicle_v1::model::Rule;
5358 /// let x = ListRuleRevisionsResponse::new()
5359 /// .set_rules([
5360 /// Rule::default()/* use setters */,
5361 /// Rule::default()/* use (different) setters */,
5362 /// ]);
5363 /// ```
5364 pub fn set_rules<T, V>(mut self, v: T) -> Self
5365 where
5366 T: std::iter::IntoIterator<Item = V>,
5367 V: std::convert::Into<crate::model::Rule>,
5368 {
5369 use std::iter::Iterator;
5370 self.rules = v.into_iter().map(|i| i.into()).collect();
5371 self
5372 }
5373
5374 /// Sets the value of [next_page_token][crate::model::ListRuleRevisionsResponse::next_page_token].
5375 ///
5376 /// # Example
5377 /// ```ignore,no_run
5378 /// # use google_cloud_chronicle_v1::model::ListRuleRevisionsResponse;
5379 /// let x = ListRuleRevisionsResponse::new().set_next_page_token("example");
5380 /// ```
5381 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5382 self.next_page_token = v.into();
5383 self
5384 }
5385}
5386
5387impl wkt::message::Message for ListRuleRevisionsResponse {
5388 fn typename() -> &'static str {
5389 "type.googleapis.com/google.cloud.chronicle.v1.ListRuleRevisionsResponse"
5390 }
5391}
5392
5393#[doc(hidden)]
5394impl google_cloud_gax::paginator::internal::PageableResponse for ListRuleRevisionsResponse {
5395 type PageItem = crate::model::Rule;
5396
5397 fn items(self) -> std::vec::Vec<Self::PageItem> {
5398 self.rules
5399 }
5400
5401 fn next_page_token(&self) -> std::string::String {
5402 use std::clone::Clone;
5403 self.next_page_token.clone()
5404 }
5405}
5406
5407/// Request message for CreateRetrohunt method.
5408#[derive(Clone, Default, PartialEq)]
5409#[non_exhaustive]
5410pub struct CreateRetrohuntRequest {
5411 /// Required. The parent of retrohunt, which is a rule.
5412 /// Format:
5413 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
5414 pub parent: std::string::String,
5415
5416 /// Required. The retrohunt to create.
5417 pub retrohunt: std::option::Option<crate::model::Retrohunt>,
5418
5419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5420}
5421
5422impl CreateRetrohuntRequest {
5423 pub fn new() -> Self {
5424 std::default::Default::default()
5425 }
5426
5427 /// Sets the value of [parent][crate::model::CreateRetrohuntRequest::parent].
5428 ///
5429 /// # Example
5430 /// ```ignore,no_run
5431 /// # use google_cloud_chronicle_v1::model::CreateRetrohuntRequest;
5432 /// let x = CreateRetrohuntRequest::new().set_parent("example");
5433 /// ```
5434 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5435 self.parent = v.into();
5436 self
5437 }
5438
5439 /// Sets the value of [retrohunt][crate::model::CreateRetrohuntRequest::retrohunt].
5440 ///
5441 /// # Example
5442 /// ```ignore,no_run
5443 /// # use google_cloud_chronicle_v1::model::CreateRetrohuntRequest;
5444 /// use google_cloud_chronicle_v1::model::Retrohunt;
5445 /// let x = CreateRetrohuntRequest::new().set_retrohunt(Retrohunt::default()/* use setters */);
5446 /// ```
5447 pub fn set_retrohunt<T>(mut self, v: T) -> Self
5448 where
5449 T: std::convert::Into<crate::model::Retrohunt>,
5450 {
5451 self.retrohunt = std::option::Option::Some(v.into());
5452 self
5453 }
5454
5455 /// Sets or clears the value of [retrohunt][crate::model::CreateRetrohuntRequest::retrohunt].
5456 ///
5457 /// # Example
5458 /// ```ignore,no_run
5459 /// # use google_cloud_chronicle_v1::model::CreateRetrohuntRequest;
5460 /// use google_cloud_chronicle_v1::model::Retrohunt;
5461 /// let x = CreateRetrohuntRequest::new().set_or_clear_retrohunt(Some(Retrohunt::default()/* use setters */));
5462 /// let x = CreateRetrohuntRequest::new().set_or_clear_retrohunt(None::<Retrohunt>);
5463 /// ```
5464 pub fn set_or_clear_retrohunt<T>(mut self, v: std::option::Option<T>) -> Self
5465 where
5466 T: std::convert::Into<crate::model::Retrohunt>,
5467 {
5468 self.retrohunt = v.map(|x| x.into());
5469 self
5470 }
5471}
5472
5473impl wkt::message::Message for CreateRetrohuntRequest {
5474 fn typename() -> &'static str {
5475 "type.googleapis.com/google.cloud.chronicle.v1.CreateRetrohuntRequest"
5476 }
5477}
5478
5479/// Request message for GetRetrohunt method.
5480#[derive(Clone, Default, PartialEq)]
5481#[non_exhaustive]
5482pub struct GetRetrohuntRequest {
5483 /// Required. The name of the retrohunt to retrieve.
5484 /// Format:
5485 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/retrohunts/{retrohunt}`
5486 pub name: std::string::String,
5487
5488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5489}
5490
5491impl GetRetrohuntRequest {
5492 pub fn new() -> Self {
5493 std::default::Default::default()
5494 }
5495
5496 /// Sets the value of [name][crate::model::GetRetrohuntRequest::name].
5497 ///
5498 /// # Example
5499 /// ```ignore,no_run
5500 /// # use google_cloud_chronicle_v1::model::GetRetrohuntRequest;
5501 /// let x = GetRetrohuntRequest::new().set_name("example");
5502 /// ```
5503 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5504 self.name = v.into();
5505 self
5506 }
5507}
5508
5509impl wkt::message::Message for GetRetrohuntRequest {
5510 fn typename() -> &'static str {
5511 "type.googleapis.com/google.cloud.chronicle.v1.GetRetrohuntRequest"
5512 }
5513}
5514
5515/// Request message for ListRetrohunts method.
5516#[derive(Clone, Default, PartialEq)]
5517#[non_exhaustive]
5518pub struct ListRetrohuntsRequest {
5519 /// Required. The rule that the retrohunts belong to.
5520 /// Format:
5521 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}`
5522 pub parent: std::string::String,
5523
5524 /// The maximum number of retrohunt to return. The service may return fewer
5525 /// than this value. If unspecified, at most 100 retrohunts will be returned.
5526 /// The maximum value is 1000; values above 1000 will be coerced to
5527 /// 1000.
5528 pub page_size: i32,
5529
5530 /// A page token, received from a previous `ListRetrohunts` call.
5531 /// Provide this to retrieve the subsequent page.
5532 ///
5533 /// When paginating, all other parameters provided to `ListRetrohunts` must
5534 /// match the call that provided the page token.
5535 pub page_token: std::string::String,
5536
5537 /// A filter that can be used to retrieve specific rule deployments.
5538 /// The following fields are filterable:
5539 /// state
5540 pub filter: std::string::String,
5541
5542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5543}
5544
5545impl ListRetrohuntsRequest {
5546 pub fn new() -> Self {
5547 std::default::Default::default()
5548 }
5549
5550 /// Sets the value of [parent][crate::model::ListRetrohuntsRequest::parent].
5551 ///
5552 /// # Example
5553 /// ```ignore,no_run
5554 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsRequest;
5555 /// let x = ListRetrohuntsRequest::new().set_parent("example");
5556 /// ```
5557 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5558 self.parent = v.into();
5559 self
5560 }
5561
5562 /// Sets the value of [page_size][crate::model::ListRetrohuntsRequest::page_size].
5563 ///
5564 /// # Example
5565 /// ```ignore,no_run
5566 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsRequest;
5567 /// let x = ListRetrohuntsRequest::new().set_page_size(42);
5568 /// ```
5569 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5570 self.page_size = v.into();
5571 self
5572 }
5573
5574 /// Sets the value of [page_token][crate::model::ListRetrohuntsRequest::page_token].
5575 ///
5576 /// # Example
5577 /// ```ignore,no_run
5578 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsRequest;
5579 /// let x = ListRetrohuntsRequest::new().set_page_token("example");
5580 /// ```
5581 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5582 self.page_token = v.into();
5583 self
5584 }
5585
5586 /// Sets the value of [filter][crate::model::ListRetrohuntsRequest::filter].
5587 ///
5588 /// # Example
5589 /// ```ignore,no_run
5590 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsRequest;
5591 /// let x = ListRetrohuntsRequest::new().set_filter("example");
5592 /// ```
5593 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5594 self.filter = v.into();
5595 self
5596 }
5597}
5598
5599impl wkt::message::Message for ListRetrohuntsRequest {
5600 fn typename() -> &'static str {
5601 "type.googleapis.com/google.cloud.chronicle.v1.ListRetrohuntsRequest"
5602 }
5603}
5604
5605/// Response message for ListRetrohunts method.
5606#[derive(Clone, Default, PartialEq)]
5607#[non_exhaustive]
5608pub struct ListRetrohuntsResponse {
5609 /// The retrohunts from the specified rule.
5610 pub retrohunts: std::vec::Vec<crate::model::Retrohunt>,
5611
5612 /// A token, which can be sent as `page_token` to retrieve the next page.
5613 /// If this field is omitted, there are no subsequent pages.
5614 pub next_page_token: std::string::String,
5615
5616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5617}
5618
5619impl ListRetrohuntsResponse {
5620 pub fn new() -> Self {
5621 std::default::Default::default()
5622 }
5623
5624 /// Sets the value of [retrohunts][crate::model::ListRetrohuntsResponse::retrohunts].
5625 ///
5626 /// # Example
5627 /// ```ignore,no_run
5628 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsResponse;
5629 /// use google_cloud_chronicle_v1::model::Retrohunt;
5630 /// let x = ListRetrohuntsResponse::new()
5631 /// .set_retrohunts([
5632 /// Retrohunt::default()/* use setters */,
5633 /// Retrohunt::default()/* use (different) setters */,
5634 /// ]);
5635 /// ```
5636 pub fn set_retrohunts<T, V>(mut self, v: T) -> Self
5637 where
5638 T: std::iter::IntoIterator<Item = V>,
5639 V: std::convert::Into<crate::model::Retrohunt>,
5640 {
5641 use std::iter::Iterator;
5642 self.retrohunts = v.into_iter().map(|i| i.into()).collect();
5643 self
5644 }
5645
5646 /// Sets the value of [next_page_token][crate::model::ListRetrohuntsResponse::next_page_token].
5647 ///
5648 /// # Example
5649 /// ```ignore,no_run
5650 /// # use google_cloud_chronicle_v1::model::ListRetrohuntsResponse;
5651 /// let x = ListRetrohuntsResponse::new().set_next_page_token("example");
5652 /// ```
5653 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5654 self.next_page_token = v.into();
5655 self
5656 }
5657}
5658
5659impl wkt::message::Message for ListRetrohuntsResponse {
5660 fn typename() -> &'static str {
5661 "type.googleapis.com/google.cloud.chronicle.v1.ListRetrohuntsResponse"
5662 }
5663}
5664
5665#[doc(hidden)]
5666impl google_cloud_gax::paginator::internal::PageableResponse for ListRetrohuntsResponse {
5667 type PageItem = crate::model::Retrohunt;
5668
5669 fn items(self) -> std::vec::Vec<Self::PageItem> {
5670 self.retrohunts
5671 }
5672
5673 fn next_page_token(&self) -> std::string::String {
5674 use std::clone::Clone;
5675 self.next_page_token.clone()
5676 }
5677}
5678
5679/// Request message for GetRuleDeployment.
5680#[derive(Clone, Default, PartialEq)]
5681#[non_exhaustive]
5682pub struct GetRuleDeploymentRequest {
5683 /// Required. The name of the rule deployment to retrieve.
5684 /// Format:
5685 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/deployment`
5686 pub name: std::string::String,
5687
5688 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5689}
5690
5691impl GetRuleDeploymentRequest {
5692 pub fn new() -> Self {
5693 std::default::Default::default()
5694 }
5695
5696 /// Sets the value of [name][crate::model::GetRuleDeploymentRequest::name].
5697 ///
5698 /// # Example
5699 /// ```ignore,no_run
5700 /// # use google_cloud_chronicle_v1::model::GetRuleDeploymentRequest;
5701 /// let x = GetRuleDeploymentRequest::new().set_name("example");
5702 /// ```
5703 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5704 self.name = v.into();
5705 self
5706 }
5707}
5708
5709impl wkt::message::Message for GetRuleDeploymentRequest {
5710 fn typename() -> &'static str {
5711 "type.googleapis.com/google.cloud.chronicle.v1.GetRuleDeploymentRequest"
5712 }
5713}
5714
5715/// Request message for ListRuleDeployments.
5716#[derive(Clone, Default, PartialEq)]
5717#[non_exhaustive]
5718pub struct ListRuleDeploymentsRequest {
5719 /// Required. The collection of all parents which own all rule deployments. The
5720 /// "-" wildcard token must be used as the rule identifier in the resource
5721 /// path. Format:
5722 /// `projects/{project}/locations/{location}/instances/{instance}/rules/-`
5723 pub parent: std::string::String,
5724
5725 /// The maximum number of rule deployments to return. The service may return
5726 /// fewer than this value. If unspecified, at most 100 rule deployments will be
5727 /// returned. The maximum value is 1000; values above 1000 will be coerced to
5728 /// 1000.
5729 pub page_size: i32,
5730
5731 /// A page token, received from a previous `ListRuleDeployments` call.
5732 /// Provide this to retrieve the subsequent page.
5733 ///
5734 /// When paginating, all other parameters provided to `ListRuleDeployments`
5735 /// must match the call that provided the page token.
5736 pub page_token: std::string::String,
5737
5738 /// A filter that can be used to retrieve specific rule deployments.
5739 /// The following fields are filterable:
5740 /// archived, name
5741 pub filter: std::string::String,
5742
5743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5744}
5745
5746impl ListRuleDeploymentsRequest {
5747 pub fn new() -> Self {
5748 std::default::Default::default()
5749 }
5750
5751 /// Sets the value of [parent][crate::model::ListRuleDeploymentsRequest::parent].
5752 ///
5753 /// # Example
5754 /// ```ignore,no_run
5755 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsRequest;
5756 /// let x = ListRuleDeploymentsRequest::new().set_parent("example");
5757 /// ```
5758 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5759 self.parent = v.into();
5760 self
5761 }
5762
5763 /// Sets the value of [page_size][crate::model::ListRuleDeploymentsRequest::page_size].
5764 ///
5765 /// # Example
5766 /// ```ignore,no_run
5767 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsRequest;
5768 /// let x = ListRuleDeploymentsRequest::new().set_page_size(42);
5769 /// ```
5770 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5771 self.page_size = v.into();
5772 self
5773 }
5774
5775 /// Sets the value of [page_token][crate::model::ListRuleDeploymentsRequest::page_token].
5776 ///
5777 /// # Example
5778 /// ```ignore,no_run
5779 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsRequest;
5780 /// let x = ListRuleDeploymentsRequest::new().set_page_token("example");
5781 /// ```
5782 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5783 self.page_token = v.into();
5784 self
5785 }
5786
5787 /// Sets the value of [filter][crate::model::ListRuleDeploymentsRequest::filter].
5788 ///
5789 /// # Example
5790 /// ```ignore,no_run
5791 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsRequest;
5792 /// let x = ListRuleDeploymentsRequest::new().set_filter("example");
5793 /// ```
5794 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5795 self.filter = v.into();
5796 self
5797 }
5798}
5799
5800impl wkt::message::Message for ListRuleDeploymentsRequest {
5801 fn typename() -> &'static str {
5802 "type.googleapis.com/google.cloud.chronicle.v1.ListRuleDeploymentsRequest"
5803 }
5804}
5805
5806/// Response message for ListRuleDeployments.
5807#[derive(Clone, Default, PartialEq)]
5808#[non_exhaustive]
5809pub struct ListRuleDeploymentsResponse {
5810 /// The rule deployments from all rules.
5811 pub rule_deployments: std::vec::Vec<crate::model::RuleDeployment>,
5812
5813 /// A token, which can be sent as `page_token` to retrieve the next page.
5814 /// If this field is omitted, there are no subsequent pages.
5815 pub next_page_token: std::string::String,
5816
5817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5818}
5819
5820impl ListRuleDeploymentsResponse {
5821 pub fn new() -> Self {
5822 std::default::Default::default()
5823 }
5824
5825 /// Sets the value of [rule_deployments][crate::model::ListRuleDeploymentsResponse::rule_deployments].
5826 ///
5827 /// # Example
5828 /// ```ignore,no_run
5829 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsResponse;
5830 /// use google_cloud_chronicle_v1::model::RuleDeployment;
5831 /// let x = ListRuleDeploymentsResponse::new()
5832 /// .set_rule_deployments([
5833 /// RuleDeployment::default()/* use setters */,
5834 /// RuleDeployment::default()/* use (different) setters */,
5835 /// ]);
5836 /// ```
5837 pub fn set_rule_deployments<T, V>(mut self, v: T) -> Self
5838 where
5839 T: std::iter::IntoIterator<Item = V>,
5840 V: std::convert::Into<crate::model::RuleDeployment>,
5841 {
5842 use std::iter::Iterator;
5843 self.rule_deployments = v.into_iter().map(|i| i.into()).collect();
5844 self
5845 }
5846
5847 /// Sets the value of [next_page_token][crate::model::ListRuleDeploymentsResponse::next_page_token].
5848 ///
5849 /// # Example
5850 /// ```ignore,no_run
5851 /// # use google_cloud_chronicle_v1::model::ListRuleDeploymentsResponse;
5852 /// let x = ListRuleDeploymentsResponse::new().set_next_page_token("example");
5853 /// ```
5854 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5855 self.next_page_token = v.into();
5856 self
5857 }
5858}
5859
5860impl wkt::message::Message for ListRuleDeploymentsResponse {
5861 fn typename() -> &'static str {
5862 "type.googleapis.com/google.cloud.chronicle.v1.ListRuleDeploymentsResponse"
5863 }
5864}
5865
5866#[doc(hidden)]
5867impl google_cloud_gax::paginator::internal::PageableResponse for ListRuleDeploymentsResponse {
5868 type PageItem = crate::model::RuleDeployment;
5869
5870 fn items(self) -> std::vec::Vec<Self::PageItem> {
5871 self.rule_deployments
5872 }
5873
5874 fn next_page_token(&self) -> std::string::String {
5875 use std::clone::Clone;
5876 self.next_page_token.clone()
5877 }
5878}
5879
5880/// Request message for UpdateRuleDeployment.
5881#[derive(Clone, Default, PartialEq)]
5882#[non_exhaustive]
5883pub struct UpdateRuleDeploymentRequest {
5884 /// Required. The rule deployment to update.
5885 ///
5886 /// The rule deployment's `name` field is used to identify the rule deployment
5887 /// to update. Format:
5888 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/deployment`
5889 pub rule_deployment: std::option::Option<crate::model::RuleDeployment>,
5890
5891 /// Required. The list of fields to update.
5892 pub update_mask: std::option::Option<wkt::FieldMask>,
5893
5894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5895}
5896
5897impl UpdateRuleDeploymentRequest {
5898 pub fn new() -> Self {
5899 std::default::Default::default()
5900 }
5901
5902 /// Sets the value of [rule_deployment][crate::model::UpdateRuleDeploymentRequest::rule_deployment].
5903 ///
5904 /// # Example
5905 /// ```ignore,no_run
5906 /// # use google_cloud_chronicle_v1::model::UpdateRuleDeploymentRequest;
5907 /// use google_cloud_chronicle_v1::model::RuleDeployment;
5908 /// let x = UpdateRuleDeploymentRequest::new().set_rule_deployment(RuleDeployment::default()/* use setters */);
5909 /// ```
5910 pub fn set_rule_deployment<T>(mut self, v: T) -> Self
5911 where
5912 T: std::convert::Into<crate::model::RuleDeployment>,
5913 {
5914 self.rule_deployment = std::option::Option::Some(v.into());
5915 self
5916 }
5917
5918 /// Sets or clears the value of [rule_deployment][crate::model::UpdateRuleDeploymentRequest::rule_deployment].
5919 ///
5920 /// # Example
5921 /// ```ignore,no_run
5922 /// # use google_cloud_chronicle_v1::model::UpdateRuleDeploymentRequest;
5923 /// use google_cloud_chronicle_v1::model::RuleDeployment;
5924 /// let x = UpdateRuleDeploymentRequest::new().set_or_clear_rule_deployment(Some(RuleDeployment::default()/* use setters */));
5925 /// let x = UpdateRuleDeploymentRequest::new().set_or_clear_rule_deployment(None::<RuleDeployment>);
5926 /// ```
5927 pub fn set_or_clear_rule_deployment<T>(mut self, v: std::option::Option<T>) -> Self
5928 where
5929 T: std::convert::Into<crate::model::RuleDeployment>,
5930 {
5931 self.rule_deployment = v.map(|x| x.into());
5932 self
5933 }
5934
5935 /// Sets the value of [update_mask][crate::model::UpdateRuleDeploymentRequest::update_mask].
5936 ///
5937 /// # Example
5938 /// ```ignore,no_run
5939 /// # use google_cloud_chronicle_v1::model::UpdateRuleDeploymentRequest;
5940 /// use wkt::FieldMask;
5941 /// let x = UpdateRuleDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5942 /// ```
5943 pub fn set_update_mask<T>(mut self, v: T) -> Self
5944 where
5945 T: std::convert::Into<wkt::FieldMask>,
5946 {
5947 self.update_mask = std::option::Option::Some(v.into());
5948 self
5949 }
5950
5951 /// Sets or clears the value of [update_mask][crate::model::UpdateRuleDeploymentRequest::update_mask].
5952 ///
5953 /// # Example
5954 /// ```ignore,no_run
5955 /// # use google_cloud_chronicle_v1::model::UpdateRuleDeploymentRequest;
5956 /// use wkt::FieldMask;
5957 /// let x = UpdateRuleDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5958 /// let x = UpdateRuleDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5959 /// ```
5960 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5961 where
5962 T: std::convert::Into<wkt::FieldMask>,
5963 {
5964 self.update_mask = v.map(|x| x.into());
5965 self
5966 }
5967}
5968
5969impl wkt::message::Message for UpdateRuleDeploymentRequest {
5970 fn typename() -> &'static str {
5971 "type.googleapis.com/google.cloud.chronicle.v1.UpdateRuleDeploymentRequest"
5972 }
5973}
5974
5975/// CompilationPosition represents the location of a compilation diagnostic in
5976/// rule text.
5977#[derive(Clone, Default, PartialEq)]
5978#[non_exhaustive]
5979pub struct CompilationPosition {
5980 /// Output only. Start line number, beginning at 1.
5981 pub start_line: i32,
5982
5983 /// Output only. Start column number, beginning at 1.
5984 pub start_column: i32,
5985
5986 /// Output only. End line number, beginning at 1.
5987 pub end_line: i32,
5988
5989 /// Output only. End column number, beginning at 1.
5990 pub end_column: i32,
5991
5992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5993}
5994
5995impl CompilationPosition {
5996 pub fn new() -> Self {
5997 std::default::Default::default()
5998 }
5999
6000 /// Sets the value of [start_line][crate::model::CompilationPosition::start_line].
6001 ///
6002 /// # Example
6003 /// ```ignore,no_run
6004 /// # use google_cloud_chronicle_v1::model::CompilationPosition;
6005 /// let x = CompilationPosition::new().set_start_line(42);
6006 /// ```
6007 pub fn set_start_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6008 self.start_line = v.into();
6009 self
6010 }
6011
6012 /// Sets the value of [start_column][crate::model::CompilationPosition::start_column].
6013 ///
6014 /// # Example
6015 /// ```ignore,no_run
6016 /// # use google_cloud_chronicle_v1::model::CompilationPosition;
6017 /// let x = CompilationPosition::new().set_start_column(42);
6018 /// ```
6019 pub fn set_start_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6020 self.start_column = v.into();
6021 self
6022 }
6023
6024 /// Sets the value of [end_line][crate::model::CompilationPosition::end_line].
6025 ///
6026 /// # Example
6027 /// ```ignore,no_run
6028 /// # use google_cloud_chronicle_v1::model::CompilationPosition;
6029 /// let x = CompilationPosition::new().set_end_line(42);
6030 /// ```
6031 pub fn set_end_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6032 self.end_line = v.into();
6033 self
6034 }
6035
6036 /// Sets the value of [end_column][crate::model::CompilationPosition::end_column].
6037 ///
6038 /// # Example
6039 /// ```ignore,no_run
6040 /// # use google_cloud_chronicle_v1::model::CompilationPosition;
6041 /// let x = CompilationPosition::new().set_end_column(42);
6042 /// ```
6043 pub fn set_end_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6044 self.end_column = v.into();
6045 self
6046 }
6047}
6048
6049impl wkt::message::Message for CompilationPosition {
6050 fn typename() -> &'static str {
6051 "type.googleapis.com/google.cloud.chronicle.v1.CompilationPosition"
6052 }
6053}
6054
6055/// CompilationDiagnostic represents a compilation diagnostic generated
6056/// during a rule's compilation, such as a compilation error or a compilation
6057/// warning.
6058#[derive(Clone, Default, PartialEq)]
6059#[non_exhaustive]
6060pub struct CompilationDiagnostic {
6061 /// Output only. The diagnostic message.
6062 pub message: std::string::String,
6063
6064 /// Output only. The approximate position in the rule text associated with the
6065 /// compilation diagnostic.
6066 /// Compilation Position may be empty.
6067 pub position: std::option::Option<crate::model::CompilationPosition>,
6068
6069 /// Output only. The severity of a rule's compilation diagnostic.
6070 pub severity: crate::model::compilation_diagnostic::Severity,
6071
6072 /// Output only. Link to documentation that describes a diagnostic in more
6073 /// detail.
6074 pub uri: std::string::String,
6075
6076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6077}
6078
6079impl CompilationDiagnostic {
6080 pub fn new() -> Self {
6081 std::default::Default::default()
6082 }
6083
6084 /// Sets the value of [message][crate::model::CompilationDiagnostic::message].
6085 ///
6086 /// # Example
6087 /// ```ignore,no_run
6088 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
6089 /// let x = CompilationDiagnostic::new().set_message("example");
6090 /// ```
6091 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6092 self.message = v.into();
6093 self
6094 }
6095
6096 /// Sets the value of [position][crate::model::CompilationDiagnostic::position].
6097 ///
6098 /// # Example
6099 /// ```ignore,no_run
6100 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
6101 /// use google_cloud_chronicle_v1::model::CompilationPosition;
6102 /// let x = CompilationDiagnostic::new().set_position(CompilationPosition::default()/* use setters */);
6103 /// ```
6104 pub fn set_position<T>(mut self, v: T) -> Self
6105 where
6106 T: std::convert::Into<crate::model::CompilationPosition>,
6107 {
6108 self.position = std::option::Option::Some(v.into());
6109 self
6110 }
6111
6112 /// Sets or clears the value of [position][crate::model::CompilationDiagnostic::position].
6113 ///
6114 /// # Example
6115 /// ```ignore,no_run
6116 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
6117 /// use google_cloud_chronicle_v1::model::CompilationPosition;
6118 /// let x = CompilationDiagnostic::new().set_or_clear_position(Some(CompilationPosition::default()/* use setters */));
6119 /// let x = CompilationDiagnostic::new().set_or_clear_position(None::<CompilationPosition>);
6120 /// ```
6121 pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
6122 where
6123 T: std::convert::Into<crate::model::CompilationPosition>,
6124 {
6125 self.position = v.map(|x| x.into());
6126 self
6127 }
6128
6129 /// Sets the value of [severity][crate::model::CompilationDiagnostic::severity].
6130 ///
6131 /// # Example
6132 /// ```ignore,no_run
6133 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
6134 /// use google_cloud_chronicle_v1::model::compilation_diagnostic::Severity;
6135 /// let x0 = CompilationDiagnostic::new().set_severity(Severity::Warning);
6136 /// let x1 = CompilationDiagnostic::new().set_severity(Severity::Error);
6137 /// ```
6138 pub fn set_severity<T: std::convert::Into<crate::model::compilation_diagnostic::Severity>>(
6139 mut self,
6140 v: T,
6141 ) -> Self {
6142 self.severity = v.into();
6143 self
6144 }
6145
6146 /// Sets the value of [uri][crate::model::CompilationDiagnostic::uri].
6147 ///
6148 /// # Example
6149 /// ```ignore,no_run
6150 /// # use google_cloud_chronicle_v1::model::CompilationDiagnostic;
6151 /// let x = CompilationDiagnostic::new().set_uri("example");
6152 /// ```
6153 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6154 self.uri = v.into();
6155 self
6156 }
6157}
6158
6159impl wkt::message::Message for CompilationDiagnostic {
6160 fn typename() -> &'static str {
6161 "type.googleapis.com/google.cloud.chronicle.v1.CompilationDiagnostic"
6162 }
6163}
6164
6165/// Defines additional types related to [CompilationDiagnostic].
6166pub mod compilation_diagnostic {
6167 #[allow(unused_imports)]
6168 use super::*;
6169
6170 /// The severity level of the compilation diagnostic.
6171 ///
6172 /// # Working with unknown values
6173 ///
6174 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6175 /// additional enum variants at any time. Adding new variants is not considered
6176 /// a breaking change. Applications should write their code in anticipation of:
6177 ///
6178 /// - New values appearing in future releases of the client library, **and**
6179 /// - New values received dynamically, without application changes.
6180 ///
6181 /// Please consult the [Working with enums] section in the user guide for some
6182 /// guidelines.
6183 ///
6184 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6185 #[derive(Clone, Debug, PartialEq)]
6186 #[non_exhaustive]
6187 pub enum Severity {
6188 /// An unspecified severity level.
6189 Unspecified,
6190 /// A compilation warning.
6191 Warning,
6192 /// A compilation error.
6193 Error,
6194 /// If set, the enum was initialized with an unknown value.
6195 ///
6196 /// Applications can examine the value using [Severity::value] or
6197 /// [Severity::name].
6198 UnknownValue(severity::UnknownValue),
6199 }
6200
6201 #[doc(hidden)]
6202 pub mod severity {
6203 #[allow(unused_imports)]
6204 use super::*;
6205 #[derive(Clone, Debug, PartialEq)]
6206 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6207 }
6208
6209 impl Severity {
6210 /// Gets the enum value.
6211 ///
6212 /// Returns `None` if the enum contains an unknown value deserialized from
6213 /// the string representation of enums.
6214 pub fn value(&self) -> std::option::Option<i32> {
6215 match self {
6216 Self::Unspecified => std::option::Option::Some(0),
6217 Self::Warning => std::option::Option::Some(1),
6218 Self::Error => std::option::Option::Some(2),
6219 Self::UnknownValue(u) => u.0.value(),
6220 }
6221 }
6222
6223 /// Gets the enum value as a string.
6224 ///
6225 /// Returns `None` if the enum contains an unknown value deserialized from
6226 /// the integer representation of enums.
6227 pub fn name(&self) -> std::option::Option<&str> {
6228 match self {
6229 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
6230 Self::Warning => std::option::Option::Some("WARNING"),
6231 Self::Error => std::option::Option::Some("ERROR"),
6232 Self::UnknownValue(u) => u.0.name(),
6233 }
6234 }
6235 }
6236
6237 impl std::default::Default for Severity {
6238 fn default() -> Self {
6239 use std::convert::From;
6240 Self::from(0)
6241 }
6242 }
6243
6244 impl std::fmt::Display for Severity {
6245 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6246 wkt::internal::display_enum(f, self.name(), self.value())
6247 }
6248 }
6249
6250 impl std::convert::From<i32> for Severity {
6251 fn from(value: i32) -> Self {
6252 match value {
6253 0 => Self::Unspecified,
6254 1 => Self::Warning,
6255 2 => Self::Error,
6256 _ => Self::UnknownValue(severity::UnknownValue(
6257 wkt::internal::UnknownEnumValue::Integer(value),
6258 )),
6259 }
6260 }
6261 }
6262
6263 impl std::convert::From<&str> for Severity {
6264 fn from(value: &str) -> Self {
6265 use std::string::ToString;
6266 match value {
6267 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
6268 "WARNING" => Self::Warning,
6269 "ERROR" => Self::Error,
6270 _ => Self::UnknownValue(severity::UnknownValue(
6271 wkt::internal::UnknownEnumValue::String(value.to_string()),
6272 )),
6273 }
6274 }
6275 }
6276
6277 impl serde::ser::Serialize for Severity {
6278 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6279 where
6280 S: serde::Serializer,
6281 {
6282 match self {
6283 Self::Unspecified => serializer.serialize_i32(0),
6284 Self::Warning => serializer.serialize_i32(1),
6285 Self::Error => serializer.serialize_i32(2),
6286 Self::UnknownValue(u) => u.0.serialize(serializer),
6287 }
6288 }
6289 }
6290
6291 impl<'de> serde::de::Deserialize<'de> for Severity {
6292 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6293 where
6294 D: serde::Deserializer<'de>,
6295 {
6296 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
6297 ".google.cloud.chronicle.v1.CompilationDiagnostic.Severity",
6298 ))
6299 }
6300 }
6301}
6302
6303/// Severity represents the severity level of the rule.
6304#[derive(Clone, Default, PartialEq)]
6305#[non_exhaustive]
6306pub struct Severity {
6307 /// The display name of the severity level. Extracted from the meta section of
6308 /// the rule text.
6309 pub display_name: std::string::String,
6310
6311 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6312}
6313
6314impl Severity {
6315 pub fn new() -> Self {
6316 std::default::Default::default()
6317 }
6318
6319 /// Sets the value of [display_name][crate::model::Severity::display_name].
6320 ///
6321 /// # Example
6322 /// ```ignore,no_run
6323 /// # use google_cloud_chronicle_v1::model::Severity;
6324 /// let x = Severity::new().set_display_name("example");
6325 /// ```
6326 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6327 self.display_name = v.into();
6328 self
6329 }
6330}
6331
6332impl wkt::message::Message for Severity {
6333 fn typename() -> &'static str {
6334 "type.googleapis.com/google.cloud.chronicle.v1.Severity"
6335 }
6336}
6337
6338/// Operation Metadata for Retrohunts.
6339#[derive(Clone, Default, PartialEq)]
6340#[non_exhaustive]
6341pub struct RetrohuntMetadata {
6342 /// The name of the retrohunt.
6343 /// Format:
6344 /// `projects/{project}/locations/{location}/instances/{instance}/rules/{rule}/retrohunts/{retrohunt}`
6345 pub retrohunt: std::string::String,
6346
6347 /// The start and end time of the retrohunt execution. If the retrohunt is not
6348 /// yet finished, the end time of the interval will not be filled.
6349 pub execution_interval: std::option::Option<google_cloud_type::model::Interval>,
6350
6351 /// Percent progress of the retrohunt towards completion, from 0.00 to 100.00.
6352 pub progress_percentage: f32,
6353
6354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6355}
6356
6357impl RetrohuntMetadata {
6358 pub fn new() -> Self {
6359 std::default::Default::default()
6360 }
6361
6362 /// Sets the value of [retrohunt][crate::model::RetrohuntMetadata::retrohunt].
6363 ///
6364 /// # Example
6365 /// ```ignore,no_run
6366 /// # use google_cloud_chronicle_v1::model::RetrohuntMetadata;
6367 /// let x = RetrohuntMetadata::new().set_retrohunt("example");
6368 /// ```
6369 pub fn set_retrohunt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6370 self.retrohunt = v.into();
6371 self
6372 }
6373
6374 /// Sets the value of [execution_interval][crate::model::RetrohuntMetadata::execution_interval].
6375 ///
6376 /// # Example
6377 /// ```ignore,no_run
6378 /// # use google_cloud_chronicle_v1::model::RetrohuntMetadata;
6379 /// use google_cloud_type::model::Interval;
6380 /// let x = RetrohuntMetadata::new().set_execution_interval(Interval::default()/* use setters */);
6381 /// ```
6382 pub fn set_execution_interval<T>(mut self, v: T) -> Self
6383 where
6384 T: std::convert::Into<google_cloud_type::model::Interval>,
6385 {
6386 self.execution_interval = std::option::Option::Some(v.into());
6387 self
6388 }
6389
6390 /// Sets or clears the value of [execution_interval][crate::model::RetrohuntMetadata::execution_interval].
6391 ///
6392 /// # Example
6393 /// ```ignore,no_run
6394 /// # use google_cloud_chronicle_v1::model::RetrohuntMetadata;
6395 /// use google_cloud_type::model::Interval;
6396 /// let x = RetrohuntMetadata::new().set_or_clear_execution_interval(Some(Interval::default()/* use setters */));
6397 /// let x = RetrohuntMetadata::new().set_or_clear_execution_interval(None::<Interval>);
6398 /// ```
6399 pub fn set_or_clear_execution_interval<T>(mut self, v: std::option::Option<T>) -> Self
6400 where
6401 T: std::convert::Into<google_cloud_type::model::Interval>,
6402 {
6403 self.execution_interval = v.map(|x| x.into());
6404 self
6405 }
6406
6407 /// Sets the value of [progress_percentage][crate::model::RetrohuntMetadata::progress_percentage].
6408 ///
6409 /// # Example
6410 /// ```ignore,no_run
6411 /// # use google_cloud_chronicle_v1::model::RetrohuntMetadata;
6412 /// let x = RetrohuntMetadata::new().set_progress_percentage(42.0);
6413 /// ```
6414 pub fn set_progress_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
6415 self.progress_percentage = v.into();
6416 self
6417 }
6418}
6419
6420impl wkt::message::Message for RetrohuntMetadata {
6421 fn typename() -> &'static str {
6422 "type.googleapis.com/google.cloud.chronicle.v1.RetrohuntMetadata"
6423 }
6424}
6425
6426/// InputsUsed is a convenience field that tells us which sources
6427/// of events (if any) were used in the rule.
6428/// NEXT TAG: 4
6429#[derive(Clone, Default, PartialEq)]
6430#[non_exhaustive]
6431pub struct InputsUsed {
6432 /// Optional. Whether the rule queries UDM events.
6433 pub uses_udm: bool,
6434
6435 /// Optional. Whether the rule queries entity events.
6436 pub uses_entity: bool,
6437
6438 /// Optional. Whether the rule queries detections.
6439 pub uses_detection: bool,
6440
6441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6442}
6443
6444impl InputsUsed {
6445 pub fn new() -> Self {
6446 std::default::Default::default()
6447 }
6448
6449 /// Sets the value of [uses_udm][crate::model::InputsUsed::uses_udm].
6450 ///
6451 /// # Example
6452 /// ```ignore,no_run
6453 /// # use google_cloud_chronicle_v1::model::InputsUsed;
6454 /// let x = InputsUsed::new().set_uses_udm(true);
6455 /// ```
6456 pub fn set_uses_udm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6457 self.uses_udm = v.into();
6458 self
6459 }
6460
6461 /// Sets the value of [uses_entity][crate::model::InputsUsed::uses_entity].
6462 ///
6463 /// # Example
6464 /// ```ignore,no_run
6465 /// # use google_cloud_chronicle_v1::model::InputsUsed;
6466 /// let x = InputsUsed::new().set_uses_entity(true);
6467 /// ```
6468 pub fn set_uses_entity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6469 self.uses_entity = v.into();
6470 self
6471 }
6472
6473 /// Sets the value of [uses_detection][crate::model::InputsUsed::uses_detection].
6474 ///
6475 /// # Example
6476 /// ```ignore,no_run
6477 /// # use google_cloud_chronicle_v1::model::InputsUsed;
6478 /// let x = InputsUsed::new().set_uses_detection(true);
6479 /// ```
6480 pub fn set_uses_detection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6481 self.uses_detection = v.into();
6482 self
6483 }
6484}
6485
6486impl wkt::message::Message for InputsUsed {
6487 fn typename() -> &'static str {
6488 "type.googleapis.com/google.cloud.chronicle.v1.InputsUsed"
6489 }
6490}
6491
6492/// The syntax type indicating how list entries should be validated.
6493///
6494/// # Working with unknown values
6495///
6496/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6497/// additional enum variants at any time. Adding new variants is not considered
6498/// a breaking change. Applications should write their code in anticipation of:
6499///
6500/// - New values appearing in future releases of the client library, **and**
6501/// - New values received dynamically, without application changes.
6502///
6503/// Please consult the [Working with enums] section in the user guide for some
6504/// guidelines.
6505///
6506/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6507#[derive(Clone, Debug, PartialEq)]
6508#[non_exhaustive]
6509pub enum ReferenceListSyntaxType {
6510 /// Defaults to REFERENCE_LIST_SYNTAX_TYPE_PLAIN_TEXT_STRING.
6511 Unspecified,
6512 /// List contains plain text patterns.
6513 PlainTextString,
6514 /// List contains only Regular Expression patterns.
6515 Regex,
6516 /// List contains only CIDR patterns.
6517 Cidr,
6518 /// If set, the enum was initialized with an unknown value.
6519 ///
6520 /// Applications can examine the value using [ReferenceListSyntaxType::value] or
6521 /// [ReferenceListSyntaxType::name].
6522 UnknownValue(reference_list_syntax_type::UnknownValue),
6523}
6524
6525#[doc(hidden)]
6526pub mod reference_list_syntax_type {
6527 #[allow(unused_imports)]
6528 use super::*;
6529 #[derive(Clone, Debug, PartialEq)]
6530 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6531}
6532
6533impl ReferenceListSyntaxType {
6534 /// Gets the enum value.
6535 ///
6536 /// Returns `None` if the enum contains an unknown value deserialized from
6537 /// the string representation of enums.
6538 pub fn value(&self) -> std::option::Option<i32> {
6539 match self {
6540 Self::Unspecified => std::option::Option::Some(0),
6541 Self::PlainTextString => std::option::Option::Some(1),
6542 Self::Regex => std::option::Option::Some(2),
6543 Self::Cidr => std::option::Option::Some(3),
6544 Self::UnknownValue(u) => u.0.value(),
6545 }
6546 }
6547
6548 /// Gets the enum value as a string.
6549 ///
6550 /// Returns `None` if the enum contains an unknown value deserialized from
6551 /// the integer representation of enums.
6552 pub fn name(&self) -> std::option::Option<&str> {
6553 match self {
6554 Self::Unspecified => {
6555 std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_UNSPECIFIED")
6556 }
6557 Self::PlainTextString => {
6558 std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_PLAIN_TEXT_STRING")
6559 }
6560 Self::Regex => std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_REGEX"),
6561 Self::Cidr => std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_CIDR"),
6562 Self::UnknownValue(u) => u.0.name(),
6563 }
6564 }
6565}
6566
6567impl std::default::Default for ReferenceListSyntaxType {
6568 fn default() -> Self {
6569 use std::convert::From;
6570 Self::from(0)
6571 }
6572}
6573
6574impl std::fmt::Display for ReferenceListSyntaxType {
6575 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6576 wkt::internal::display_enum(f, self.name(), self.value())
6577 }
6578}
6579
6580impl std::convert::From<i32> for ReferenceListSyntaxType {
6581 fn from(value: i32) -> Self {
6582 match value {
6583 0 => Self::Unspecified,
6584 1 => Self::PlainTextString,
6585 2 => Self::Regex,
6586 3 => Self::Cidr,
6587 _ => Self::UnknownValue(reference_list_syntax_type::UnknownValue(
6588 wkt::internal::UnknownEnumValue::Integer(value),
6589 )),
6590 }
6591 }
6592}
6593
6594impl std::convert::From<&str> for ReferenceListSyntaxType {
6595 fn from(value: &str) -> Self {
6596 use std::string::ToString;
6597 match value {
6598 "REFERENCE_LIST_SYNTAX_TYPE_UNSPECIFIED" => Self::Unspecified,
6599 "REFERENCE_LIST_SYNTAX_TYPE_PLAIN_TEXT_STRING" => Self::PlainTextString,
6600 "REFERENCE_LIST_SYNTAX_TYPE_REGEX" => Self::Regex,
6601 "REFERENCE_LIST_SYNTAX_TYPE_CIDR" => Self::Cidr,
6602 _ => Self::UnknownValue(reference_list_syntax_type::UnknownValue(
6603 wkt::internal::UnknownEnumValue::String(value.to_string()),
6604 )),
6605 }
6606 }
6607}
6608
6609impl serde::ser::Serialize for ReferenceListSyntaxType {
6610 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6611 where
6612 S: serde::Serializer,
6613 {
6614 match self {
6615 Self::Unspecified => serializer.serialize_i32(0),
6616 Self::PlainTextString => serializer.serialize_i32(1),
6617 Self::Regex => serializer.serialize_i32(2),
6618 Self::Cidr => serializer.serialize_i32(3),
6619 Self::UnknownValue(u) => u.0.serialize(serializer),
6620 }
6621 }
6622}
6623
6624impl<'de> serde::de::Deserialize<'de> for ReferenceListSyntaxType {
6625 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6626 where
6627 D: serde::Deserializer<'de>,
6628 {
6629 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReferenceListSyntaxType>::new(
6630 ".google.cloud.chronicle.v1.ReferenceListSyntaxType",
6631 ))
6632 }
6633}
6634
6635/// ReferenceListView is a mechanism for viewing partial responses of the
6636/// ReferenceList resource.
6637///
6638/// # Working with unknown values
6639///
6640/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6641/// additional enum variants at any time. Adding new variants is not considered
6642/// a breaking change. Applications should write their code in anticipation of:
6643///
6644/// - New values appearing in future releases of the client library, **and**
6645/// - New values received dynamically, without application changes.
6646///
6647/// Please consult the [Working with enums] section in the user guide for some
6648/// guidelines.
6649///
6650/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6651#[derive(Clone, Debug, PartialEq)]
6652#[non_exhaustive]
6653pub enum ReferenceListView {
6654 /// The default / unset value.
6655 /// The API will default to the BASIC view for ListReferenceLists.
6656 /// The API will default to the FULL view for methods that return a single
6657 /// ReferenceList resource.
6658 Unspecified,
6659 /// Include metadata about the ReferenceList.
6660 /// This is the default view for ListReferenceLists.
6661 Basic,
6662 /// Include all details about the ReferenceList: metadata, content lines,
6663 /// associated rule counts. This is the default view for GetReferenceList.
6664 Full,
6665 /// If set, the enum was initialized with an unknown value.
6666 ///
6667 /// Applications can examine the value using [ReferenceListView::value] or
6668 /// [ReferenceListView::name].
6669 UnknownValue(reference_list_view::UnknownValue),
6670}
6671
6672#[doc(hidden)]
6673pub mod reference_list_view {
6674 #[allow(unused_imports)]
6675 use super::*;
6676 #[derive(Clone, Debug, PartialEq)]
6677 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6678}
6679
6680impl ReferenceListView {
6681 /// Gets the enum value.
6682 ///
6683 /// Returns `None` if the enum contains an unknown value deserialized from
6684 /// the string representation of enums.
6685 pub fn value(&self) -> std::option::Option<i32> {
6686 match self {
6687 Self::Unspecified => std::option::Option::Some(0),
6688 Self::Basic => std::option::Option::Some(1),
6689 Self::Full => std::option::Option::Some(2),
6690 Self::UnknownValue(u) => u.0.value(),
6691 }
6692 }
6693
6694 /// Gets the enum value as a string.
6695 ///
6696 /// Returns `None` if the enum contains an unknown value deserialized from
6697 /// the integer representation of enums.
6698 pub fn name(&self) -> std::option::Option<&str> {
6699 match self {
6700 Self::Unspecified => std::option::Option::Some("REFERENCE_LIST_VIEW_UNSPECIFIED"),
6701 Self::Basic => std::option::Option::Some("REFERENCE_LIST_VIEW_BASIC"),
6702 Self::Full => std::option::Option::Some("REFERENCE_LIST_VIEW_FULL"),
6703 Self::UnknownValue(u) => u.0.name(),
6704 }
6705 }
6706}
6707
6708impl std::default::Default for ReferenceListView {
6709 fn default() -> Self {
6710 use std::convert::From;
6711 Self::from(0)
6712 }
6713}
6714
6715impl std::fmt::Display for ReferenceListView {
6716 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6717 wkt::internal::display_enum(f, self.name(), self.value())
6718 }
6719}
6720
6721impl std::convert::From<i32> for ReferenceListView {
6722 fn from(value: i32) -> Self {
6723 match value {
6724 0 => Self::Unspecified,
6725 1 => Self::Basic,
6726 2 => Self::Full,
6727 _ => Self::UnknownValue(reference_list_view::UnknownValue(
6728 wkt::internal::UnknownEnumValue::Integer(value),
6729 )),
6730 }
6731 }
6732}
6733
6734impl std::convert::From<&str> for ReferenceListView {
6735 fn from(value: &str) -> Self {
6736 use std::string::ToString;
6737 match value {
6738 "REFERENCE_LIST_VIEW_UNSPECIFIED" => Self::Unspecified,
6739 "REFERENCE_LIST_VIEW_BASIC" => Self::Basic,
6740 "REFERENCE_LIST_VIEW_FULL" => Self::Full,
6741 _ => Self::UnknownValue(reference_list_view::UnknownValue(
6742 wkt::internal::UnknownEnumValue::String(value.to_string()),
6743 )),
6744 }
6745 }
6746}
6747
6748impl serde::ser::Serialize for ReferenceListView {
6749 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6750 where
6751 S: serde::Serializer,
6752 {
6753 match self {
6754 Self::Unspecified => serializer.serialize_i32(0),
6755 Self::Basic => serializer.serialize_i32(1),
6756 Self::Full => serializer.serialize_i32(2),
6757 Self::UnknownValue(u) => u.0.serialize(serializer),
6758 }
6759 }
6760}
6761
6762impl<'de> serde::de::Deserialize<'de> for ReferenceListView {
6763 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6764 where
6765 D: serde::Deserializer<'de>,
6766 {
6767 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReferenceListView>::new(
6768 ".google.cloud.chronicle.v1.ReferenceListView",
6769 ))
6770 }
6771}
6772
6773/// RunFrequency indicates the run frequency at which a YARA-L 2 rule will run if
6774/// enabled.
6775///
6776/// # Working with unknown values
6777///
6778/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6779/// additional enum variants at any time. Adding new variants is not considered
6780/// a breaking change. Applications should write their code in anticipation of:
6781///
6782/// - New values appearing in future releases of the client library, **and**
6783/// - New values received dynamically, without application changes.
6784///
6785/// Please consult the [Working with enums] section in the user guide for some
6786/// guidelines.
6787///
6788/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6789#[derive(Clone, Debug, PartialEq)]
6790#[non_exhaustive]
6791pub enum RunFrequency {
6792 /// The run frequency is unspecified/unknown.
6793 Unspecified,
6794 /// Executes in real time.
6795 Live,
6796 /// Executes once per hour.
6797 Hourly,
6798 /// Executes once per day.
6799 Daily,
6800 /// If set, the enum was initialized with an unknown value.
6801 ///
6802 /// Applications can examine the value using [RunFrequency::value] or
6803 /// [RunFrequency::name].
6804 UnknownValue(run_frequency::UnknownValue),
6805}
6806
6807#[doc(hidden)]
6808pub mod run_frequency {
6809 #[allow(unused_imports)]
6810 use super::*;
6811 #[derive(Clone, Debug, PartialEq)]
6812 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6813}
6814
6815impl RunFrequency {
6816 /// Gets the enum value.
6817 ///
6818 /// Returns `None` if the enum contains an unknown value deserialized from
6819 /// the string representation of enums.
6820 pub fn value(&self) -> std::option::Option<i32> {
6821 match self {
6822 Self::Unspecified => std::option::Option::Some(0),
6823 Self::Live => std::option::Option::Some(1),
6824 Self::Hourly => std::option::Option::Some(2),
6825 Self::Daily => std::option::Option::Some(3),
6826 Self::UnknownValue(u) => u.0.value(),
6827 }
6828 }
6829
6830 /// Gets the enum value as a string.
6831 ///
6832 /// Returns `None` if the enum contains an unknown value deserialized from
6833 /// the integer representation of enums.
6834 pub fn name(&self) -> std::option::Option<&str> {
6835 match self {
6836 Self::Unspecified => std::option::Option::Some("RUN_FREQUENCY_UNSPECIFIED"),
6837 Self::Live => std::option::Option::Some("LIVE"),
6838 Self::Hourly => std::option::Option::Some("HOURLY"),
6839 Self::Daily => std::option::Option::Some("DAILY"),
6840 Self::UnknownValue(u) => u.0.name(),
6841 }
6842 }
6843}
6844
6845impl std::default::Default for RunFrequency {
6846 fn default() -> Self {
6847 use std::convert::From;
6848 Self::from(0)
6849 }
6850}
6851
6852impl std::fmt::Display for RunFrequency {
6853 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6854 wkt::internal::display_enum(f, self.name(), self.value())
6855 }
6856}
6857
6858impl std::convert::From<i32> for RunFrequency {
6859 fn from(value: i32) -> Self {
6860 match value {
6861 0 => Self::Unspecified,
6862 1 => Self::Live,
6863 2 => Self::Hourly,
6864 3 => Self::Daily,
6865 _ => Self::UnknownValue(run_frequency::UnknownValue(
6866 wkt::internal::UnknownEnumValue::Integer(value),
6867 )),
6868 }
6869 }
6870}
6871
6872impl std::convert::From<&str> for RunFrequency {
6873 fn from(value: &str) -> Self {
6874 use std::string::ToString;
6875 match value {
6876 "RUN_FREQUENCY_UNSPECIFIED" => Self::Unspecified,
6877 "LIVE" => Self::Live,
6878 "HOURLY" => Self::Hourly,
6879 "DAILY" => Self::Daily,
6880 _ => Self::UnknownValue(run_frequency::UnknownValue(
6881 wkt::internal::UnknownEnumValue::String(value.to_string()),
6882 )),
6883 }
6884 }
6885}
6886
6887impl serde::ser::Serialize for RunFrequency {
6888 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6889 where
6890 S: serde::Serializer,
6891 {
6892 match self {
6893 Self::Unspecified => serializer.serialize_i32(0),
6894 Self::Live => serializer.serialize_i32(1),
6895 Self::Hourly => serializer.serialize_i32(2),
6896 Self::Daily => serializer.serialize_i32(3),
6897 Self::UnknownValue(u) => u.0.serialize(serializer),
6898 }
6899 }
6900}
6901
6902impl<'de> serde::de::Deserialize<'de> for RunFrequency {
6903 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6904 where
6905 D: serde::Deserializer<'de>,
6906 {
6907 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RunFrequency>::new(
6908 ".google.cloud.chronicle.v1.RunFrequency",
6909 ))
6910 }
6911}
6912
6913/// RuleType indicates the YARA-L rule type of user-created and Google Cloud
6914/// Threat Intelligence (GCTI) authored rules.
6915///
6916/// # Working with unknown values
6917///
6918/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6919/// additional enum variants at any time. Adding new variants is not considered
6920/// a breaking change. Applications should write their code in anticipation of:
6921///
6922/// - New values appearing in future releases of the client library, **and**
6923/// - New values received dynamically, without application changes.
6924///
6925/// Please consult the [Working with enums] section in the user guide for some
6926/// guidelines.
6927///
6928/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6929#[derive(Clone, Debug, PartialEq)]
6930#[non_exhaustive]
6931pub enum RuleType {
6932 /// The rule type is unspecified/unknown.
6933 Unspecified,
6934 /// Rule checks for the existence of a single event.
6935 SingleEvent,
6936 /// Rule checks for correlation between multiple events
6937 MultiEvent,
6938 /// If set, the enum was initialized with an unknown value.
6939 ///
6940 /// Applications can examine the value using [RuleType::value] or
6941 /// [RuleType::name].
6942 UnknownValue(rule_type::UnknownValue),
6943}
6944
6945#[doc(hidden)]
6946pub mod rule_type {
6947 #[allow(unused_imports)]
6948 use super::*;
6949 #[derive(Clone, Debug, PartialEq)]
6950 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6951}
6952
6953impl RuleType {
6954 /// Gets the enum value.
6955 ///
6956 /// Returns `None` if the enum contains an unknown value deserialized from
6957 /// the string representation of enums.
6958 pub fn value(&self) -> std::option::Option<i32> {
6959 match self {
6960 Self::Unspecified => std::option::Option::Some(0),
6961 Self::SingleEvent => std::option::Option::Some(1),
6962 Self::MultiEvent => std::option::Option::Some(2),
6963 Self::UnknownValue(u) => u.0.value(),
6964 }
6965 }
6966
6967 /// Gets the enum value as a string.
6968 ///
6969 /// Returns `None` if the enum contains an unknown value deserialized from
6970 /// the integer representation of enums.
6971 pub fn name(&self) -> std::option::Option<&str> {
6972 match self {
6973 Self::Unspecified => std::option::Option::Some("RULE_TYPE_UNSPECIFIED"),
6974 Self::SingleEvent => std::option::Option::Some("SINGLE_EVENT"),
6975 Self::MultiEvent => std::option::Option::Some("MULTI_EVENT"),
6976 Self::UnknownValue(u) => u.0.name(),
6977 }
6978 }
6979}
6980
6981impl std::default::Default for RuleType {
6982 fn default() -> Self {
6983 use std::convert::From;
6984 Self::from(0)
6985 }
6986}
6987
6988impl std::fmt::Display for RuleType {
6989 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6990 wkt::internal::display_enum(f, self.name(), self.value())
6991 }
6992}
6993
6994impl std::convert::From<i32> for RuleType {
6995 fn from(value: i32) -> Self {
6996 match value {
6997 0 => Self::Unspecified,
6998 1 => Self::SingleEvent,
6999 2 => Self::MultiEvent,
7000 _ => Self::UnknownValue(rule_type::UnknownValue(
7001 wkt::internal::UnknownEnumValue::Integer(value),
7002 )),
7003 }
7004 }
7005}
7006
7007impl std::convert::From<&str> for RuleType {
7008 fn from(value: &str) -> Self {
7009 use std::string::ToString;
7010 match value {
7011 "RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
7012 "SINGLE_EVENT" => Self::SingleEvent,
7013 "MULTI_EVENT" => Self::MultiEvent,
7014 _ => Self::UnknownValue(rule_type::UnknownValue(
7015 wkt::internal::UnknownEnumValue::String(value.to_string()),
7016 )),
7017 }
7018 }
7019}
7020
7021impl serde::ser::Serialize for RuleType {
7022 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7023 where
7024 S: serde::Serializer,
7025 {
7026 match self {
7027 Self::Unspecified => serializer.serialize_i32(0),
7028 Self::SingleEvent => serializer.serialize_i32(1),
7029 Self::MultiEvent => serializer.serialize_i32(2),
7030 Self::UnknownValue(u) => u.0.serialize(serializer),
7031 }
7032 }
7033}
7034
7035impl<'de> serde::de::Deserialize<'de> for RuleType {
7036 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7037 where
7038 D: serde::Deserializer<'de>,
7039 {
7040 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleType>::new(
7041 ".google.cloud.chronicle.v1.RuleType",
7042 ))
7043 }
7044}
7045
7046/// RuleView indicates the scope of fields to populate when returning the Rule
7047/// resource.
7048///
7049/// # Working with unknown values
7050///
7051/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7052/// additional enum variants at any time. Adding new variants is not considered
7053/// a breaking change. Applications should write their code in anticipation of:
7054///
7055/// - New values appearing in future releases of the client library, **and**
7056/// - New values received dynamically, without application changes.
7057///
7058/// Please consult the [Working with enums] section in the user guide for some
7059/// guidelines.
7060///
7061/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7062#[derive(Clone, Debug, PartialEq)]
7063#[non_exhaustive]
7064pub enum RuleView {
7065 /// The default/unset value.
7066 /// The API will default to the BASIC view for ListRules/ListRuleRevisions.
7067 /// The API will default to the FULL view for GetRule.
7068 Unspecified,
7069 /// Include basic metadata about the rule, but not the full contents.
7070 /// Returned fields include: revision_id, revision_create_time, display_name,
7071 /// author, severity, type, allowed_run_frequency,
7072 /// near_real_time_live_rule_eligible, etag, and scope.
7073 /// This is the default value for ListRules and ListRuleRevisions.
7074 Basic,
7075 /// Include all fields.
7076 /// This is the default value for GetRule.
7077 Full,
7078 /// Include basic metadata about the rule's revision only.
7079 /// Returned fields include: revision_id and revision_create_time.
7080 RevisionMetadataOnly,
7081 /// If set, the enum was initialized with an unknown value.
7082 ///
7083 /// Applications can examine the value using [RuleView::value] or
7084 /// [RuleView::name].
7085 UnknownValue(rule_view::UnknownValue),
7086}
7087
7088#[doc(hidden)]
7089pub mod rule_view {
7090 #[allow(unused_imports)]
7091 use super::*;
7092 #[derive(Clone, Debug, PartialEq)]
7093 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7094}
7095
7096impl RuleView {
7097 /// Gets the enum value.
7098 ///
7099 /// Returns `None` if the enum contains an unknown value deserialized from
7100 /// the string representation of enums.
7101 pub fn value(&self) -> std::option::Option<i32> {
7102 match self {
7103 Self::Unspecified => std::option::Option::Some(0),
7104 Self::Basic => std::option::Option::Some(1),
7105 Self::Full => std::option::Option::Some(2),
7106 Self::RevisionMetadataOnly => std::option::Option::Some(3),
7107 Self::UnknownValue(u) => u.0.value(),
7108 }
7109 }
7110
7111 /// Gets the enum value as a string.
7112 ///
7113 /// Returns `None` if the enum contains an unknown value deserialized from
7114 /// the integer representation of enums.
7115 pub fn name(&self) -> std::option::Option<&str> {
7116 match self {
7117 Self::Unspecified => std::option::Option::Some("RULE_VIEW_UNSPECIFIED"),
7118 Self::Basic => std::option::Option::Some("BASIC"),
7119 Self::Full => std::option::Option::Some("FULL"),
7120 Self::RevisionMetadataOnly => std::option::Option::Some("REVISION_METADATA_ONLY"),
7121 Self::UnknownValue(u) => u.0.name(),
7122 }
7123 }
7124}
7125
7126impl std::default::Default for RuleView {
7127 fn default() -> Self {
7128 use std::convert::From;
7129 Self::from(0)
7130 }
7131}
7132
7133impl std::fmt::Display for RuleView {
7134 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7135 wkt::internal::display_enum(f, self.name(), self.value())
7136 }
7137}
7138
7139impl std::convert::From<i32> for RuleView {
7140 fn from(value: i32) -> Self {
7141 match value {
7142 0 => Self::Unspecified,
7143 1 => Self::Basic,
7144 2 => Self::Full,
7145 3 => Self::RevisionMetadataOnly,
7146 _ => Self::UnknownValue(rule_view::UnknownValue(
7147 wkt::internal::UnknownEnumValue::Integer(value),
7148 )),
7149 }
7150 }
7151}
7152
7153impl std::convert::From<&str> for RuleView {
7154 fn from(value: &str) -> Self {
7155 use std::string::ToString;
7156 match value {
7157 "RULE_VIEW_UNSPECIFIED" => Self::Unspecified,
7158 "BASIC" => Self::Basic,
7159 "FULL" => Self::Full,
7160 "REVISION_METADATA_ONLY" => Self::RevisionMetadataOnly,
7161 _ => Self::UnknownValue(rule_view::UnknownValue(
7162 wkt::internal::UnknownEnumValue::String(value.to_string()),
7163 )),
7164 }
7165 }
7166}
7167
7168impl serde::ser::Serialize for RuleView {
7169 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7170 where
7171 S: serde::Serializer,
7172 {
7173 match self {
7174 Self::Unspecified => serializer.serialize_i32(0),
7175 Self::Basic => serializer.serialize_i32(1),
7176 Self::Full => serializer.serialize_i32(2),
7177 Self::RevisionMetadataOnly => serializer.serialize_i32(3),
7178 Self::UnknownValue(u) => u.0.serialize(serializer),
7179 }
7180 }
7181}
7182
7183impl<'de> serde::de::Deserialize<'de> for RuleView {
7184 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7185 where
7186 D: serde::Deserializer<'de>,
7187 {
7188 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleView>::new(
7189 ".google.cloud.chronicle.v1.RuleView",
7190 ))
7191 }
7192}