google_cloud_storage/generated/gapic_control/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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21
22mod debug;
23mod deserialize;
24mod serialize;
25
26/// Contains information about a pending rename operation.
27#[derive(Clone, Default, PartialEq)]
28#[non_exhaustive]
29pub struct PendingRenameInfo {
30 /// Output only. The name of the rename operation.
31 pub operation: std::string::String,
32
33 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34}
35
36impl PendingRenameInfo {
37 /// Creates a new default instance.
38 pub fn new() -> Self {
39 std::default::Default::default()
40 }
41
42 /// Sets the value of [operation][crate::model::PendingRenameInfo::operation].
43 ///
44 /// # Example
45 /// ```ignore,no_run
46 /// # use google_cloud_storage::model::PendingRenameInfo;
47 /// let x = PendingRenameInfo::new().set_operation("example");
48 /// ```
49 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
50 self.operation = v.into();
51 self
52 }
53}
54
55impl wkt::message::Message for PendingRenameInfo {
56 fn typename() -> &'static str {
57 "type.googleapis.com/google.storage.control.v2.PendingRenameInfo"
58 }
59}
60
61/// A folder resource. This resource can only exist in a hierarchical namespace
62/// enabled bucket.
63#[derive(Clone, Default, PartialEq)]
64#[non_exhaustive]
65pub struct Folder {
66 /// Identifier. The name of this folder.
67 /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
68 pub name: std::string::String,
69
70 /// Output only. The version of the metadata for this folder. Used for
71 /// preconditions and for detecting changes in metadata.
72 pub metageneration: i64,
73
74 /// Output only. The creation time of the folder.
75 pub create_time: std::option::Option<wkt::Timestamp>,
76
77 /// Output only. The modification time of the folder.
78 pub update_time: std::option::Option<wkt::Timestamp>,
79
80 /// Output only. Only present if the folder is part of an ongoing RenameFolder
81 /// operation. Contains information which can be used to query the operation
82 /// status. The presence of this field also indicates all write operations are
83 /// blocked for this folder, including folder, managed folder, and object
84 /// operations.
85 pub pending_rename_info: std::option::Option<crate::model::PendingRenameInfo>,
86
87 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
88}
89
90impl Folder {
91 /// Creates a new default instance.
92 pub fn new() -> Self {
93 std::default::Default::default()
94 }
95
96 /// Sets the value of [name][crate::model::Folder::name].
97 ///
98 /// # Example
99 /// ```ignore,no_run
100 /// # use google_cloud_storage::model::Folder;
101 /// # let project_id = "project_id";
102 /// # let bucket_id = "bucket_id";
103 /// # let folder_id = "folder_id";
104 /// let x = Folder::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
105 /// ```
106 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
107 self.name = v.into();
108 self
109 }
110
111 /// Sets the value of [metageneration][crate::model::Folder::metageneration].
112 ///
113 /// # Example
114 /// ```ignore,no_run
115 /// # use google_cloud_storage::model::Folder;
116 /// let x = Folder::new().set_metageneration(42);
117 /// ```
118 pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
119 self.metageneration = v.into();
120 self
121 }
122
123 /// Sets the value of [create_time][crate::model::Folder::create_time].
124 ///
125 /// # Example
126 /// ```ignore,no_run
127 /// # use google_cloud_storage::model::Folder;
128 /// use wkt::Timestamp;
129 /// let x = Folder::new().set_create_time(Timestamp::default()/* use setters */);
130 /// ```
131 pub fn set_create_time<T>(mut self, v: T) -> Self
132 where
133 T: std::convert::Into<wkt::Timestamp>,
134 {
135 self.create_time = std::option::Option::Some(v.into());
136 self
137 }
138
139 /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
140 ///
141 /// # Example
142 /// ```ignore,no_run
143 /// # use google_cloud_storage::model::Folder;
144 /// use wkt::Timestamp;
145 /// let x = Folder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
146 /// let x = Folder::new().set_or_clear_create_time(None::<Timestamp>);
147 /// ```
148 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
149 where
150 T: std::convert::Into<wkt::Timestamp>,
151 {
152 self.create_time = v.map(|x| x.into());
153 self
154 }
155
156 /// Sets the value of [update_time][crate::model::Folder::update_time].
157 ///
158 /// # Example
159 /// ```ignore,no_run
160 /// # use google_cloud_storage::model::Folder;
161 /// use wkt::Timestamp;
162 /// let x = Folder::new().set_update_time(Timestamp::default()/* use setters */);
163 /// ```
164 pub fn set_update_time<T>(mut self, v: T) -> Self
165 where
166 T: std::convert::Into<wkt::Timestamp>,
167 {
168 self.update_time = std::option::Option::Some(v.into());
169 self
170 }
171
172 /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
173 ///
174 /// # Example
175 /// ```ignore,no_run
176 /// # use google_cloud_storage::model::Folder;
177 /// use wkt::Timestamp;
178 /// let x = Folder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
179 /// let x = Folder::new().set_or_clear_update_time(None::<Timestamp>);
180 /// ```
181 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
182 where
183 T: std::convert::Into<wkt::Timestamp>,
184 {
185 self.update_time = v.map(|x| x.into());
186 self
187 }
188
189 /// Sets the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
190 ///
191 /// # Example
192 /// ```ignore,no_run
193 /// # use google_cloud_storage::model::Folder;
194 /// use google_cloud_storage::model::PendingRenameInfo;
195 /// let x = Folder::new().set_pending_rename_info(PendingRenameInfo::default()/* use setters */);
196 /// ```
197 pub fn set_pending_rename_info<T>(mut self, v: T) -> Self
198 where
199 T: std::convert::Into<crate::model::PendingRenameInfo>,
200 {
201 self.pending_rename_info = std::option::Option::Some(v.into());
202 self
203 }
204
205 /// Sets or clears the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
206 ///
207 /// # Example
208 /// ```ignore,no_run
209 /// # use google_cloud_storage::model::Folder;
210 /// use google_cloud_storage::model::PendingRenameInfo;
211 /// let x = Folder::new().set_or_clear_pending_rename_info(Some(PendingRenameInfo::default()/* use setters */));
212 /// let x = Folder::new().set_or_clear_pending_rename_info(None::<PendingRenameInfo>);
213 /// ```
214 pub fn set_or_clear_pending_rename_info<T>(mut self, v: std::option::Option<T>) -> Self
215 where
216 T: std::convert::Into<crate::model::PendingRenameInfo>,
217 {
218 self.pending_rename_info = v.map(|x| x.into());
219 self
220 }
221}
222
223impl wkt::message::Message for Folder {
224 fn typename() -> &'static str {
225 "type.googleapis.com/google.storage.control.v2.Folder"
226 }
227}
228
229/// Request message for GetFolder. This operation is only applicable to a
230/// hierarchical namespace enabled bucket.
231#[derive(Clone, Default, PartialEq)]
232#[non_exhaustive]
233pub struct GetFolderRequest {
234 /// Required. Name of the folder.
235 /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
236 pub name: std::string::String,
237
238 /// Makes the operation only succeed conditional on whether the folder's
239 /// current metageneration matches the given value.
240 pub if_metageneration_match: std::option::Option<i64>,
241
242 /// Makes the operation only succeed conditional on whether the folder's
243 /// current metageneration does not match the given value.
244 pub if_metageneration_not_match: std::option::Option<i64>,
245
246 /// Optional. A unique identifier for this request. UUID is the recommended
247 /// format, but other formats are still accepted.
248 pub request_id: std::string::String,
249
250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
251}
252
253impl GetFolderRequest {
254 /// Creates a new default instance.
255 pub fn new() -> Self {
256 std::default::Default::default()
257 }
258
259 /// Sets the value of [name][crate::model::GetFolderRequest::name].
260 ///
261 /// # Example
262 /// ```ignore,no_run
263 /// # use google_cloud_storage::model::GetFolderRequest;
264 /// # let project_id = "project_id";
265 /// # let bucket_id = "bucket_id";
266 /// # let folder_id = "folder_id";
267 /// let x = GetFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
268 /// ```
269 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
270 self.name = v.into();
271 self
272 }
273
274 /// Sets the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
275 ///
276 /// # Example
277 /// ```ignore,no_run
278 /// # use google_cloud_storage::model::GetFolderRequest;
279 /// let x = GetFolderRequest::new().set_if_metageneration_match(42);
280 /// ```
281 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
282 where
283 T: std::convert::Into<i64>,
284 {
285 self.if_metageneration_match = std::option::Option::Some(v.into());
286 self
287 }
288
289 /// Sets or clears the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
290 ///
291 /// # Example
292 /// ```ignore,no_run
293 /// # use google_cloud_storage::model::GetFolderRequest;
294 /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
295 /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
296 /// ```
297 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
298 where
299 T: std::convert::Into<i64>,
300 {
301 self.if_metageneration_match = v.map(|x| x.into());
302 self
303 }
304
305 /// Sets the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
306 ///
307 /// # Example
308 /// ```ignore,no_run
309 /// # use google_cloud_storage::model::GetFolderRequest;
310 /// let x = GetFolderRequest::new().set_if_metageneration_not_match(42);
311 /// ```
312 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
313 where
314 T: std::convert::Into<i64>,
315 {
316 self.if_metageneration_not_match = std::option::Option::Some(v.into());
317 self
318 }
319
320 /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
321 ///
322 /// # Example
323 /// ```ignore,no_run
324 /// # use google_cloud_storage::model::GetFolderRequest;
325 /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
326 /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
327 /// ```
328 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
329 where
330 T: std::convert::Into<i64>,
331 {
332 self.if_metageneration_not_match = v.map(|x| x.into());
333 self
334 }
335
336 /// Sets the value of [request_id][crate::model::GetFolderRequest::request_id].
337 ///
338 /// # Example
339 /// ```ignore,no_run
340 /// # use google_cloud_storage::model::GetFolderRequest;
341 /// let x = GetFolderRequest::new().set_request_id("example");
342 /// ```
343 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
344 self.request_id = v.into();
345 self
346 }
347}
348
349impl wkt::message::Message for GetFolderRequest {
350 fn typename() -> &'static str {
351 "type.googleapis.com/google.storage.control.v2.GetFolderRequest"
352 }
353}
354
355/// Request message for CreateFolder. This operation is only applicable to a
356/// hierarchical namespace enabled bucket.
357#[derive(Clone, Default, PartialEq)]
358#[non_exhaustive]
359pub struct CreateFolderRequest {
360 /// Required. Name of the bucket in which the folder will reside. The bucket
361 /// must be a hierarchical namespace enabled bucket.
362 pub parent: std::string::String,
363
364 /// Required. Properties of the new folder being created.
365 /// The bucket and name of the folder are specified in the parent and folder_id
366 /// fields, respectively. Populating those fields in `folder` will result in an
367 /// error.
368 pub folder: std::option::Option<crate::model::Folder>,
369
370 /// Required. The full name of a folder, including all its parent folders.
371 /// Folders use single '/' characters as a delimiter.
372 /// The folder_id must end with a slash.
373 /// For example, the folder_id of "books/biographies/" would create a new
374 /// "biographies/" folder under the "books/" folder.
375 pub folder_id: std::string::String,
376
377 /// Optional. If true, parent folder doesn't have to be present and all missing
378 /// ancestor folders will be created atomically.
379 pub recursive: bool,
380
381 /// Optional. A unique identifier for this request. UUID is the recommended
382 /// format, but other formats are still accepted.
383 pub request_id: std::string::String,
384
385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
386}
387
388impl CreateFolderRequest {
389 /// Creates a new default instance.
390 pub fn new() -> Self {
391 std::default::Default::default()
392 }
393
394 /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
395 ///
396 /// # Example
397 /// ```ignore,no_run
398 /// # use google_cloud_storage::model::CreateFolderRequest;
399 /// # let project_id = "project_id";
400 /// # let bucket_id = "bucket_id";
401 /// let x = CreateFolderRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
402 /// ```
403 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
404 self.parent = v.into();
405 self
406 }
407
408 /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
409 ///
410 /// # Example
411 /// ```ignore,no_run
412 /// # use google_cloud_storage::model::CreateFolderRequest;
413 /// use google_cloud_storage::model::Folder;
414 /// let x = CreateFolderRequest::new().set_folder(Folder::default()/* use setters */);
415 /// ```
416 pub fn set_folder<T>(mut self, v: T) -> Self
417 where
418 T: std::convert::Into<crate::model::Folder>,
419 {
420 self.folder = std::option::Option::Some(v.into());
421 self
422 }
423
424 /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_storage::model::CreateFolderRequest;
429 /// use google_cloud_storage::model::Folder;
430 /// let x = CreateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
431 /// let x = CreateFolderRequest::new().set_or_clear_folder(None::<Folder>);
432 /// ```
433 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
434 where
435 T: std::convert::Into<crate::model::Folder>,
436 {
437 self.folder = v.map(|x| x.into());
438 self
439 }
440
441 /// Sets the value of [folder_id][crate::model::CreateFolderRequest::folder_id].
442 ///
443 /// # Example
444 /// ```ignore,no_run
445 /// # use google_cloud_storage::model::CreateFolderRequest;
446 /// let x = CreateFolderRequest::new().set_folder_id("example");
447 /// ```
448 pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
449 self.folder_id = v.into();
450 self
451 }
452
453 /// Sets the value of [recursive][crate::model::CreateFolderRequest::recursive].
454 ///
455 /// # Example
456 /// ```ignore,no_run
457 /// # use google_cloud_storage::model::CreateFolderRequest;
458 /// let x = CreateFolderRequest::new().set_recursive(true);
459 /// ```
460 pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
461 self.recursive = v.into();
462 self
463 }
464
465 /// Sets the value of [request_id][crate::model::CreateFolderRequest::request_id].
466 ///
467 /// # Example
468 /// ```ignore,no_run
469 /// # use google_cloud_storage::model::CreateFolderRequest;
470 /// let x = CreateFolderRequest::new().set_request_id("example");
471 /// ```
472 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
473 self.request_id = v.into();
474 self
475 }
476}
477
478impl wkt::message::Message for CreateFolderRequest {
479 fn typename() -> &'static str {
480 "type.googleapis.com/google.storage.control.v2.CreateFolderRequest"
481 }
482}
483
484/// Request message for DeleteFolder. This operation is only applicable to a
485/// hierarchical namespace enabled bucket.
486#[derive(Clone, Default, PartialEq)]
487#[non_exhaustive]
488pub struct DeleteFolderRequest {
489 /// Required. Name of the folder.
490 /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
491 pub name: std::string::String,
492
493 /// Makes the operation only succeed conditional on whether the folder's
494 /// current metageneration matches the given value.
495 pub if_metageneration_match: std::option::Option<i64>,
496
497 /// Makes the operation only succeed conditional on whether the folder's
498 /// current metageneration does not match the given value.
499 pub if_metageneration_not_match: std::option::Option<i64>,
500
501 /// Optional. A unique identifier for this request. UUID is the recommended
502 /// format, but other formats are still accepted.
503 pub request_id: std::string::String,
504
505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
506}
507
508impl DeleteFolderRequest {
509 /// Creates a new default instance.
510 pub fn new() -> Self {
511 std::default::Default::default()
512 }
513
514 /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
515 ///
516 /// # Example
517 /// ```ignore,no_run
518 /// # use google_cloud_storage::model::DeleteFolderRequest;
519 /// # let project_id = "project_id";
520 /// # let bucket_id = "bucket_id";
521 /// # let folder_id = "folder_id";
522 /// let x = DeleteFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
523 /// ```
524 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
525 self.name = v.into();
526 self
527 }
528
529 /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
530 ///
531 /// # Example
532 /// ```ignore,no_run
533 /// # use google_cloud_storage::model::DeleteFolderRequest;
534 /// let x = DeleteFolderRequest::new().set_if_metageneration_match(42);
535 /// ```
536 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
537 where
538 T: std::convert::Into<i64>,
539 {
540 self.if_metageneration_match = std::option::Option::Some(v.into());
541 self
542 }
543
544 /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
545 ///
546 /// # Example
547 /// ```ignore,no_run
548 /// # use google_cloud_storage::model::DeleteFolderRequest;
549 /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
550 /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
551 /// ```
552 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
553 where
554 T: std::convert::Into<i64>,
555 {
556 self.if_metageneration_match = v.map(|x| x.into());
557 self
558 }
559
560 /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
561 ///
562 /// # Example
563 /// ```ignore,no_run
564 /// # use google_cloud_storage::model::DeleteFolderRequest;
565 /// let x = DeleteFolderRequest::new().set_if_metageneration_not_match(42);
566 /// ```
567 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
568 where
569 T: std::convert::Into<i64>,
570 {
571 self.if_metageneration_not_match = std::option::Option::Some(v.into());
572 self
573 }
574
575 /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
576 ///
577 /// # Example
578 /// ```ignore,no_run
579 /// # use google_cloud_storage::model::DeleteFolderRequest;
580 /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
581 /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
582 /// ```
583 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
584 where
585 T: std::convert::Into<i64>,
586 {
587 self.if_metageneration_not_match = v.map(|x| x.into());
588 self
589 }
590
591 /// Sets the value of [request_id][crate::model::DeleteFolderRequest::request_id].
592 ///
593 /// # Example
594 /// ```ignore,no_run
595 /// # use google_cloud_storage::model::DeleteFolderRequest;
596 /// let x = DeleteFolderRequest::new().set_request_id("example");
597 /// ```
598 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
599 self.request_id = v.into();
600 self
601 }
602}
603
604impl wkt::message::Message for DeleteFolderRequest {
605 fn typename() -> &'static str {
606 "type.googleapis.com/google.storage.control.v2.DeleteFolderRequest"
607 }
608}
609
610/// Request message for ListFolders. This operation is only applicable to a
611/// hierarchical namespace enabled bucket.
612#[derive(Clone, Default, PartialEq)]
613#[non_exhaustive]
614pub struct ListFoldersRequest {
615 /// Required. Name of the bucket in which to look for folders. The bucket must
616 /// be a hierarchical namespace enabled bucket.
617 pub parent: std::string::String,
618
619 /// Optional. Maximum number of folders to return in a single response. The
620 /// service will use this parameter or 1,000 items, whichever is smaller.
621 pub page_size: i32,
622
623 /// Optional. A previously-returned page token representing part of the larger
624 /// set of results to view.
625 pub page_token: std::string::String,
626
627 /// Optional. Filter results to folders whose names begin with this prefix.
628 /// If set, the value must either be an empty string or end with a '/'.
629 pub prefix: std::string::String,
630
631 /// Optional. If set, returns results in a directory-like mode. The results
632 /// will only include folders that either exactly match the above prefix, or
633 /// are one level below the prefix. The only supported value is '/'.
634 pub delimiter: std::string::String,
635
636 /// Optional. Filter results to folders whose names are lexicographically equal
637 /// to or after lexicographic_start. If lexicographic_end is also set, the
638 /// folders listed have names between lexicographic_start (inclusive) and
639 /// lexicographic_end (exclusive).
640 pub lexicographic_start: std::string::String,
641
642 /// Optional. Filter results to folders whose names are lexicographically
643 /// before lexicographic_end. If lexicographic_start is also set, the folders
644 /// listed have names between lexicographic_start (inclusive) and
645 /// lexicographic_end (exclusive).
646 pub lexicographic_end: std::string::String,
647
648 /// Optional. A unique identifier for this request. UUID is the recommended
649 /// format, but other formats are still accepted.
650 pub request_id: std::string::String,
651
652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
653}
654
655impl ListFoldersRequest {
656 /// Creates a new default instance.
657 pub fn new() -> Self {
658 std::default::Default::default()
659 }
660
661 /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
662 ///
663 /// # Example
664 /// ```ignore,no_run
665 /// # use google_cloud_storage::model::ListFoldersRequest;
666 /// # let project_id = "project_id";
667 /// # let bucket_id = "bucket_id";
668 /// let x = ListFoldersRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
669 /// ```
670 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
671 self.parent = v.into();
672 self
673 }
674
675 /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
676 ///
677 /// # Example
678 /// ```ignore,no_run
679 /// # use google_cloud_storage::model::ListFoldersRequest;
680 /// let x = ListFoldersRequest::new().set_page_size(42);
681 /// ```
682 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
683 self.page_size = v.into();
684 self
685 }
686
687 /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
688 ///
689 /// # Example
690 /// ```ignore,no_run
691 /// # use google_cloud_storage::model::ListFoldersRequest;
692 /// let x = ListFoldersRequest::new().set_page_token("example");
693 /// ```
694 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
695 self.page_token = v.into();
696 self
697 }
698
699 /// Sets the value of [prefix][crate::model::ListFoldersRequest::prefix].
700 ///
701 /// # Example
702 /// ```ignore,no_run
703 /// # use google_cloud_storage::model::ListFoldersRequest;
704 /// let x = ListFoldersRequest::new().set_prefix("example");
705 /// ```
706 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
707 self.prefix = v.into();
708 self
709 }
710
711 /// Sets the value of [delimiter][crate::model::ListFoldersRequest::delimiter].
712 ///
713 /// # Example
714 /// ```ignore,no_run
715 /// # use google_cloud_storage::model::ListFoldersRequest;
716 /// let x = ListFoldersRequest::new().set_delimiter("example");
717 /// ```
718 pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
719 self.delimiter = v.into();
720 self
721 }
722
723 /// Sets the value of [lexicographic_start][crate::model::ListFoldersRequest::lexicographic_start].
724 ///
725 /// # Example
726 /// ```ignore,no_run
727 /// # use google_cloud_storage::model::ListFoldersRequest;
728 /// let x = ListFoldersRequest::new().set_lexicographic_start("example");
729 /// ```
730 pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
731 mut self,
732 v: T,
733 ) -> Self {
734 self.lexicographic_start = v.into();
735 self
736 }
737
738 /// Sets the value of [lexicographic_end][crate::model::ListFoldersRequest::lexicographic_end].
739 ///
740 /// # Example
741 /// ```ignore,no_run
742 /// # use google_cloud_storage::model::ListFoldersRequest;
743 /// let x = ListFoldersRequest::new().set_lexicographic_end("example");
744 /// ```
745 pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
746 mut self,
747 v: T,
748 ) -> Self {
749 self.lexicographic_end = v.into();
750 self
751 }
752
753 /// Sets the value of [request_id][crate::model::ListFoldersRequest::request_id].
754 ///
755 /// # Example
756 /// ```ignore,no_run
757 /// # use google_cloud_storage::model::ListFoldersRequest;
758 /// let x = ListFoldersRequest::new().set_request_id("example");
759 /// ```
760 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
761 self.request_id = v.into();
762 self
763 }
764}
765
766impl wkt::message::Message for ListFoldersRequest {
767 fn typename() -> &'static str {
768 "type.googleapis.com/google.storage.control.v2.ListFoldersRequest"
769 }
770}
771
772/// Response message for ListFolders.
773#[derive(Clone, Default, PartialEq)]
774#[non_exhaustive]
775pub struct ListFoldersResponse {
776 /// The list of child folders
777 pub folders: std::vec::Vec<crate::model::Folder>,
778
779 /// The continuation token, used to page through large result sets. Provide
780 /// this value in a subsequent request to return the next page of results.
781 pub next_page_token: std::string::String,
782
783 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
784}
785
786impl ListFoldersResponse {
787 /// Creates a new default instance.
788 pub fn new() -> Self {
789 std::default::Default::default()
790 }
791
792 /// Sets the value of [folders][crate::model::ListFoldersResponse::folders].
793 ///
794 /// # Example
795 /// ```ignore,no_run
796 /// # use google_cloud_storage::model::ListFoldersResponse;
797 /// use google_cloud_storage::model::Folder;
798 /// let x = ListFoldersResponse::new()
799 /// .set_folders([
800 /// Folder::default()/* use setters */,
801 /// Folder::default()/* use (different) setters */,
802 /// ]);
803 /// ```
804 pub fn set_folders<T, V>(mut self, v: T) -> Self
805 where
806 T: std::iter::IntoIterator<Item = V>,
807 V: std::convert::Into<crate::model::Folder>,
808 {
809 use std::iter::Iterator;
810 self.folders = v.into_iter().map(|i| i.into()).collect();
811 self
812 }
813
814 /// Sets the value of [next_page_token][crate::model::ListFoldersResponse::next_page_token].
815 ///
816 /// # Example
817 /// ```ignore,no_run
818 /// # use google_cloud_storage::model::ListFoldersResponse;
819 /// let x = ListFoldersResponse::new().set_next_page_token("example");
820 /// ```
821 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
822 self.next_page_token = v.into();
823 self
824 }
825}
826
827impl wkt::message::Message for ListFoldersResponse {
828 fn typename() -> &'static str {
829 "type.googleapis.com/google.storage.control.v2.ListFoldersResponse"
830 }
831}
832
833#[doc(hidden)]
834impl google_cloud_gax::paginator::internal::PageableResponse for ListFoldersResponse {
835 type PageItem = crate::model::Folder;
836
837 fn items(self) -> std::vec::Vec<Self::PageItem> {
838 self.folders
839 }
840
841 fn next_page_token(&self) -> std::string::String {
842 use std::clone::Clone;
843 self.next_page_token.clone()
844 }
845}
846
847/// Request message for RenameFolder. This operation is only applicable to a
848/// hierarchical namespace enabled bucket.
849#[derive(Clone, Default, PartialEq)]
850#[non_exhaustive]
851pub struct RenameFolderRequest {
852 /// Required. Name of the source folder being renamed.
853 /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
854 pub name: std::string::String,
855
856 /// Required. The destination folder ID, e.g. `foo/bar/`.
857 pub destination_folder_id: std::string::String,
858
859 /// Makes the operation only succeed conditional on whether the source
860 /// folder's current metageneration matches the given value.
861 pub if_metageneration_match: std::option::Option<i64>,
862
863 /// Makes the operation only succeed conditional on whether the source
864 /// folder's current metageneration does not match the given value.
865 pub if_metageneration_not_match: std::option::Option<i64>,
866
867 /// Optional. A unique identifier for this request. UUID is the recommended
868 /// format, but other formats are still accepted. This request is only
869 /// idempotent if a `request_id` is provided.
870 pub request_id: std::string::String,
871
872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
873}
874
875impl RenameFolderRequest {
876 /// Creates a new default instance.
877 pub fn new() -> Self {
878 std::default::Default::default()
879 }
880
881 /// Sets the value of [name][crate::model::RenameFolderRequest::name].
882 ///
883 /// # Example
884 /// ```ignore,no_run
885 /// # use google_cloud_storage::model::RenameFolderRequest;
886 /// # let project_id = "project_id";
887 /// # let bucket_id = "bucket_id";
888 /// # let folder_id = "folder_id";
889 /// let x = RenameFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
890 /// ```
891 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
892 self.name = v.into();
893 self
894 }
895
896 /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
897 ///
898 /// # Example
899 /// ```ignore,no_run
900 /// # use google_cloud_storage::model::RenameFolderRequest;
901 /// let x = RenameFolderRequest::new().set_destination_folder_id("example");
902 /// ```
903 pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
904 mut self,
905 v: T,
906 ) -> Self {
907 self.destination_folder_id = v.into();
908 self
909 }
910
911 /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
912 ///
913 /// # Example
914 /// ```ignore,no_run
915 /// # use google_cloud_storage::model::RenameFolderRequest;
916 /// let x = RenameFolderRequest::new().set_if_metageneration_match(42);
917 /// ```
918 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
919 where
920 T: std::convert::Into<i64>,
921 {
922 self.if_metageneration_match = std::option::Option::Some(v.into());
923 self
924 }
925
926 /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
927 ///
928 /// # Example
929 /// ```ignore,no_run
930 /// # use google_cloud_storage::model::RenameFolderRequest;
931 /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
932 /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
933 /// ```
934 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
935 where
936 T: std::convert::Into<i64>,
937 {
938 self.if_metageneration_match = v.map(|x| x.into());
939 self
940 }
941
942 /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
943 ///
944 /// # Example
945 /// ```ignore,no_run
946 /// # use google_cloud_storage::model::RenameFolderRequest;
947 /// let x = RenameFolderRequest::new().set_if_metageneration_not_match(42);
948 /// ```
949 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
950 where
951 T: std::convert::Into<i64>,
952 {
953 self.if_metageneration_not_match = std::option::Option::Some(v.into());
954 self
955 }
956
957 /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
958 ///
959 /// # Example
960 /// ```ignore,no_run
961 /// # use google_cloud_storage::model::RenameFolderRequest;
962 /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
963 /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
964 /// ```
965 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
966 where
967 T: std::convert::Into<i64>,
968 {
969 self.if_metageneration_not_match = v.map(|x| x.into());
970 self
971 }
972
973 /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
974 ///
975 /// # Example
976 /// ```ignore,no_run
977 /// # use google_cloud_storage::model::RenameFolderRequest;
978 /// let x = RenameFolderRequest::new().set_request_id("example");
979 /// ```
980 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
981 self.request_id = v.into();
982 self
983 }
984}
985
986impl wkt::message::Message for RenameFolderRequest {
987 fn typename() -> &'static str {
988 "type.googleapis.com/google.storage.control.v2.RenameFolderRequest"
989 }
990}
991
992/// Request message for DeleteFolderRecursive.
993#[derive(Clone, Default, PartialEq)]
994#[non_exhaustive]
995pub struct DeleteFolderRecursiveRequest {
996 /// Required. Name of the folder being deleted, however all of its contents
997 /// will be deleted too. Format:
998 /// `projects/{project}/buckets/{bucket}/folders/{folder}`
999 pub name: std::string::String,
1000
1001 /// Optional. Makes the operation only succeed conditional on whether the root
1002 /// folder's current metageneration matches the given value.
1003 pub if_metageneration_match: std::option::Option<i64>,
1004
1005 /// Optional. Makes the operation only succeed conditional on whether the root
1006 /// folder's current metageneration does not match the given value.
1007 pub if_metageneration_not_match: std::option::Option<i64>,
1008
1009 /// Optional. A unique identifier for this request. UUID is the recommended
1010 /// format, but other formats are still accepted.
1011 pub request_id: std::string::String,
1012
1013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1014}
1015
1016impl DeleteFolderRecursiveRequest {
1017 /// Creates a new default instance.
1018 pub fn new() -> Self {
1019 std::default::Default::default()
1020 }
1021
1022 /// Sets the value of [name][crate::model::DeleteFolderRecursiveRequest::name].
1023 ///
1024 /// # Example
1025 /// ```ignore,no_run
1026 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1027 /// # let project_id = "project_id";
1028 /// # let bucket_id = "bucket_id";
1029 /// # let folder_id = "folder_id";
1030 /// let x = DeleteFolderRecursiveRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
1031 /// ```
1032 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1033 self.name = v.into();
1034 self
1035 }
1036
1037 /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_match].
1038 ///
1039 /// # Example
1040 /// ```ignore,no_run
1041 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1042 /// let x = DeleteFolderRecursiveRequest::new().set_if_metageneration_match(42);
1043 /// ```
1044 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1045 where
1046 T: std::convert::Into<i64>,
1047 {
1048 self.if_metageneration_match = std::option::Option::Some(v.into());
1049 self
1050 }
1051
1052 /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_match].
1053 ///
1054 /// # Example
1055 /// ```ignore,no_run
1056 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1057 /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_match(Some(42));
1058 /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1059 /// ```
1060 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1061 where
1062 T: std::convert::Into<i64>,
1063 {
1064 self.if_metageneration_match = v.map(|x| x.into());
1065 self
1066 }
1067
1068 /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_not_match].
1069 ///
1070 /// # Example
1071 /// ```ignore,no_run
1072 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1073 /// let x = DeleteFolderRecursiveRequest::new().set_if_metageneration_not_match(42);
1074 /// ```
1075 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1076 where
1077 T: std::convert::Into<i64>,
1078 {
1079 self.if_metageneration_not_match = std::option::Option::Some(v.into());
1080 self
1081 }
1082
1083 /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_not_match].
1084 ///
1085 /// # Example
1086 /// ```ignore,no_run
1087 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1088 /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1089 /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1090 /// ```
1091 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1092 where
1093 T: std::convert::Into<i64>,
1094 {
1095 self.if_metageneration_not_match = v.map(|x| x.into());
1096 self
1097 }
1098
1099 /// Sets the value of [request_id][crate::model::DeleteFolderRecursiveRequest::request_id].
1100 ///
1101 /// # Example
1102 /// ```ignore,no_run
1103 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1104 /// let x = DeleteFolderRecursiveRequest::new().set_request_id("example");
1105 /// ```
1106 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1107 self.request_id = v.into();
1108 self
1109 }
1110}
1111
1112impl wkt::message::Message for DeleteFolderRecursiveRequest {
1113 fn typename() -> &'static str {
1114 "type.googleapis.com/google.storage.control.v2.DeleteFolderRecursiveRequest"
1115 }
1116}
1117
1118/// The message contains metadata that is common to all Storage Control
1119/// long-running operations, present in its `google.longrunning.Operation`
1120/// messages, and accessible via `metadata.common_metadata`.
1121#[derive(Clone, Default, PartialEq)]
1122#[non_exhaustive]
1123pub struct CommonLongRunningOperationMetadata {
1124 /// Output only. The time the operation was created.
1125 pub create_time: std::option::Option<wkt::Timestamp>,
1126
1127 /// Output only. The time the operation finished running.
1128 pub end_time: std::option::Option<wkt::Timestamp>,
1129
1130 /// Output only. The time the operation was last modified.
1131 pub update_time: std::option::Option<wkt::Timestamp>,
1132
1133 /// Output only. The type of operation invoked.
1134 pub r#type: std::string::String,
1135
1136 /// Output only. Identifies whether the user has requested cancellation.
1137 pub requested_cancellation: bool,
1138
1139 /// Output only. The estimated progress of the operation in percentage [0,
1140 /// 100]. The value -1 means the progress is unknown.
1141 pub progress_percent: i32,
1142
1143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1144}
1145
1146impl CommonLongRunningOperationMetadata {
1147 /// Creates a new default instance.
1148 pub fn new() -> Self {
1149 std::default::Default::default()
1150 }
1151
1152 /// Sets the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
1153 ///
1154 /// # Example
1155 /// ```ignore,no_run
1156 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1157 /// use wkt::Timestamp;
1158 /// let x = CommonLongRunningOperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1159 /// ```
1160 pub fn set_create_time<T>(mut self, v: T) -> Self
1161 where
1162 T: std::convert::Into<wkt::Timestamp>,
1163 {
1164 self.create_time = std::option::Option::Some(v.into());
1165 self
1166 }
1167
1168 /// Sets or clears the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
1169 ///
1170 /// # Example
1171 /// ```ignore,no_run
1172 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1173 /// use wkt::Timestamp;
1174 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1175 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1176 /// ```
1177 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1178 where
1179 T: std::convert::Into<wkt::Timestamp>,
1180 {
1181 self.create_time = v.map(|x| x.into());
1182 self
1183 }
1184
1185 /// Sets the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
1186 ///
1187 /// # Example
1188 /// ```ignore,no_run
1189 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1190 /// use wkt::Timestamp;
1191 /// let x = CommonLongRunningOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1192 /// ```
1193 pub fn set_end_time<T>(mut self, v: T) -> Self
1194 where
1195 T: std::convert::Into<wkt::Timestamp>,
1196 {
1197 self.end_time = std::option::Option::Some(v.into());
1198 self
1199 }
1200
1201 /// Sets or clears the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
1202 ///
1203 /// # Example
1204 /// ```ignore,no_run
1205 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1206 /// use wkt::Timestamp;
1207 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1208 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1209 /// ```
1210 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1211 where
1212 T: std::convert::Into<wkt::Timestamp>,
1213 {
1214 self.end_time = v.map(|x| x.into());
1215 self
1216 }
1217
1218 /// Sets the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
1219 ///
1220 /// # Example
1221 /// ```ignore,no_run
1222 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1223 /// use wkt::Timestamp;
1224 /// let x = CommonLongRunningOperationMetadata::new().set_update_time(Timestamp::default()/* use setters */);
1225 /// ```
1226 pub fn set_update_time<T>(mut self, v: T) -> Self
1227 where
1228 T: std::convert::Into<wkt::Timestamp>,
1229 {
1230 self.update_time = std::option::Option::Some(v.into());
1231 self
1232 }
1233
1234 /// Sets or clears the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
1235 ///
1236 /// # Example
1237 /// ```ignore,no_run
1238 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1239 /// use wkt::Timestamp;
1240 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1241 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_update_time(None::<Timestamp>);
1242 /// ```
1243 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1244 where
1245 T: std::convert::Into<wkt::Timestamp>,
1246 {
1247 self.update_time = v.map(|x| x.into());
1248 self
1249 }
1250
1251 /// Sets the value of [r#type][crate::model::CommonLongRunningOperationMetadata::type].
1252 ///
1253 /// # Example
1254 /// ```ignore,no_run
1255 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1256 /// let x = CommonLongRunningOperationMetadata::new().set_type("example");
1257 /// ```
1258 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1259 self.r#type = v.into();
1260 self
1261 }
1262
1263 /// Sets the value of [requested_cancellation][crate::model::CommonLongRunningOperationMetadata::requested_cancellation].
1264 ///
1265 /// # Example
1266 /// ```ignore,no_run
1267 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1268 /// let x = CommonLongRunningOperationMetadata::new().set_requested_cancellation(true);
1269 /// ```
1270 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1271 self.requested_cancellation = v.into();
1272 self
1273 }
1274
1275 /// Sets the value of [progress_percent][crate::model::CommonLongRunningOperationMetadata::progress_percent].
1276 ///
1277 /// # Example
1278 /// ```ignore,no_run
1279 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1280 /// let x = CommonLongRunningOperationMetadata::new().set_progress_percent(42);
1281 /// ```
1282 pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1283 self.progress_percent = v.into();
1284 self
1285 }
1286}
1287
1288impl wkt::message::Message for CommonLongRunningOperationMetadata {
1289 fn typename() -> &'static str {
1290 "type.googleapis.com/google.storage.control.v2.CommonLongRunningOperationMetadata"
1291 }
1292}
1293
1294/// Message returned in the metadata field of the Operation resource for
1295/// RenameFolder operations.
1296#[derive(Clone, Default, PartialEq)]
1297#[non_exhaustive]
1298pub struct RenameFolderMetadata {
1299 /// Generic metadata for the long running operation.
1300 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1301
1302 /// The path of the source folder.
1303 pub source_folder_id: std::string::String,
1304
1305 /// The path of the destination folder.
1306 pub destination_folder_id: std::string::String,
1307
1308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1309}
1310
1311impl RenameFolderMetadata {
1312 /// Creates a new default instance.
1313 pub fn new() -> Self {
1314 std::default::Default::default()
1315 }
1316
1317 /// Sets the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
1318 ///
1319 /// # Example
1320 /// ```ignore,no_run
1321 /// # use google_cloud_storage::model::RenameFolderMetadata;
1322 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1323 /// let x = RenameFolderMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
1324 /// ```
1325 pub fn set_common_metadata<T>(mut self, v: T) -> Self
1326 where
1327 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1328 {
1329 self.common_metadata = std::option::Option::Some(v.into());
1330 self
1331 }
1332
1333 /// Sets or clears the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
1334 ///
1335 /// # Example
1336 /// ```ignore,no_run
1337 /// # use google_cloud_storage::model::RenameFolderMetadata;
1338 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1339 /// let x = RenameFolderMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
1340 /// let x = RenameFolderMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
1341 /// ```
1342 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1343 where
1344 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1345 {
1346 self.common_metadata = v.map(|x| x.into());
1347 self
1348 }
1349
1350 /// Sets the value of [source_folder_id][crate::model::RenameFolderMetadata::source_folder_id].
1351 ///
1352 /// # Example
1353 /// ```ignore,no_run
1354 /// # use google_cloud_storage::model::RenameFolderMetadata;
1355 /// let x = RenameFolderMetadata::new().set_source_folder_id("example");
1356 /// ```
1357 pub fn set_source_folder_id<T: std::convert::Into<std::string::String>>(
1358 mut self,
1359 v: T,
1360 ) -> Self {
1361 self.source_folder_id = v.into();
1362 self
1363 }
1364
1365 /// Sets the value of [destination_folder_id][crate::model::RenameFolderMetadata::destination_folder_id].
1366 ///
1367 /// # Example
1368 /// ```ignore,no_run
1369 /// # use google_cloud_storage::model::RenameFolderMetadata;
1370 /// let x = RenameFolderMetadata::new().set_destination_folder_id("example");
1371 /// ```
1372 pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
1373 mut self,
1374 v: T,
1375 ) -> Self {
1376 self.destination_folder_id = v.into();
1377 self
1378 }
1379}
1380
1381impl wkt::message::Message for RenameFolderMetadata {
1382 fn typename() -> &'static str {
1383 "type.googleapis.com/google.storage.control.v2.RenameFolderMetadata"
1384 }
1385}
1386
1387/// Message returned in the metadata field of the Operation resource for
1388/// DeleteFolderRecursive operations.
1389#[derive(Clone, Default, PartialEq)]
1390#[non_exhaustive]
1391pub struct DeleteFolderRecursiveMetadata {
1392 /// Generic metadata for the long running operation.
1393 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1394
1395 /// The path of the folder recursively deleted.
1396 pub folder_id: std::string::String,
1397
1398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1399}
1400
1401impl DeleteFolderRecursiveMetadata {
1402 /// Creates a new default instance.
1403 pub fn new() -> Self {
1404 std::default::Default::default()
1405 }
1406
1407 /// Sets the value of [common_metadata][crate::model::DeleteFolderRecursiveMetadata::common_metadata].
1408 ///
1409 /// # Example
1410 /// ```ignore,no_run
1411 /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1412 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1413 /// let x = DeleteFolderRecursiveMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
1414 /// ```
1415 pub fn set_common_metadata<T>(mut self, v: T) -> Self
1416 where
1417 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1418 {
1419 self.common_metadata = std::option::Option::Some(v.into());
1420 self
1421 }
1422
1423 /// Sets or clears the value of [common_metadata][crate::model::DeleteFolderRecursiveMetadata::common_metadata].
1424 ///
1425 /// # Example
1426 /// ```ignore,no_run
1427 /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1428 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1429 /// let x = DeleteFolderRecursiveMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
1430 /// let x = DeleteFolderRecursiveMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
1431 /// ```
1432 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1433 where
1434 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1435 {
1436 self.common_metadata = v.map(|x| x.into());
1437 self
1438 }
1439
1440 /// Sets the value of [folder_id][crate::model::DeleteFolderRecursiveMetadata::folder_id].
1441 ///
1442 /// # Example
1443 /// ```ignore,no_run
1444 /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1445 /// let x = DeleteFolderRecursiveMetadata::new().set_folder_id("example");
1446 /// ```
1447 pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1448 self.folder_id = v.into();
1449 self
1450 }
1451}
1452
1453impl wkt::message::Message for DeleteFolderRecursiveMetadata {
1454 fn typename() -> &'static str {
1455 "type.googleapis.com/google.storage.control.v2.DeleteFolderRecursiveMetadata"
1456 }
1457}
1458
1459/// The storage layout configuration of a bucket.
1460#[derive(Clone, Default, PartialEq)]
1461#[non_exhaustive]
1462pub struct StorageLayout {
1463 /// Output only. The name of the StorageLayout resource.
1464 /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1465 pub name: std::string::String,
1466
1467 /// Output only. The location of the bucket.
1468 pub location: std::string::String,
1469
1470 /// Output only. The location type of the bucket (region, dual-region,
1471 /// multi-region, etc).
1472 pub location_type: std::string::String,
1473
1474 /// Output only. The data placement configuration for custom dual region. If
1475 /// there is no configuration, this is not a custom dual region bucket.
1476 pub custom_placement_config:
1477 std::option::Option<crate::model::storage_layout::CustomPlacementConfig>,
1478
1479 /// Output only. The bucket's hierarchical namespace configuration. If there is
1480 /// no configuration, the hierarchical namespace is disabled.
1481 pub hierarchical_namespace:
1482 std::option::Option<crate::model::storage_layout::HierarchicalNamespace>,
1483
1484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1485}
1486
1487impl StorageLayout {
1488 /// Creates a new default instance.
1489 pub fn new() -> Self {
1490 std::default::Default::default()
1491 }
1492
1493 /// Sets the value of [name][crate::model::StorageLayout::name].
1494 ///
1495 /// # Example
1496 /// ```ignore,no_run
1497 /// # use google_cloud_storage::model::StorageLayout;
1498 /// # let project_id = "project_id";
1499 /// # let bucket_id = "bucket_id";
1500 /// let x = StorageLayout::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/storageLayout"));
1501 /// ```
1502 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1503 self.name = v.into();
1504 self
1505 }
1506
1507 /// Sets the value of [location][crate::model::StorageLayout::location].
1508 ///
1509 /// # Example
1510 /// ```ignore,no_run
1511 /// # use google_cloud_storage::model::StorageLayout;
1512 /// let x = StorageLayout::new().set_location("example");
1513 /// ```
1514 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1515 self.location = v.into();
1516 self
1517 }
1518
1519 /// Sets the value of [location_type][crate::model::StorageLayout::location_type].
1520 ///
1521 /// # Example
1522 /// ```ignore,no_run
1523 /// # use google_cloud_storage::model::StorageLayout;
1524 /// let x = StorageLayout::new().set_location_type("example");
1525 /// ```
1526 pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1527 self.location_type = v.into();
1528 self
1529 }
1530
1531 /// Sets the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
1532 ///
1533 /// # Example
1534 /// ```ignore,no_run
1535 /// # use google_cloud_storage::model::StorageLayout;
1536 /// use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1537 /// let x = StorageLayout::new().set_custom_placement_config(CustomPlacementConfig::default()/* use setters */);
1538 /// ```
1539 pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
1540 where
1541 T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
1542 {
1543 self.custom_placement_config = std::option::Option::Some(v.into());
1544 self
1545 }
1546
1547 /// Sets or clears the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
1548 ///
1549 /// # Example
1550 /// ```ignore,no_run
1551 /// # use google_cloud_storage::model::StorageLayout;
1552 /// use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1553 /// let x = StorageLayout::new().set_or_clear_custom_placement_config(Some(CustomPlacementConfig::default()/* use setters */));
1554 /// let x = StorageLayout::new().set_or_clear_custom_placement_config(None::<CustomPlacementConfig>);
1555 /// ```
1556 pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
1557 where
1558 T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
1559 {
1560 self.custom_placement_config = v.map(|x| x.into());
1561 self
1562 }
1563
1564 /// Sets the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
1565 ///
1566 /// # Example
1567 /// ```ignore,no_run
1568 /// # use google_cloud_storage::model::StorageLayout;
1569 /// use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1570 /// let x = StorageLayout::new().set_hierarchical_namespace(HierarchicalNamespace::default()/* use setters */);
1571 /// ```
1572 pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
1573 where
1574 T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
1575 {
1576 self.hierarchical_namespace = std::option::Option::Some(v.into());
1577 self
1578 }
1579
1580 /// Sets or clears the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
1581 ///
1582 /// # Example
1583 /// ```ignore,no_run
1584 /// # use google_cloud_storage::model::StorageLayout;
1585 /// use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1586 /// let x = StorageLayout::new().set_or_clear_hierarchical_namespace(Some(HierarchicalNamespace::default()/* use setters */));
1587 /// let x = StorageLayout::new().set_or_clear_hierarchical_namespace(None::<HierarchicalNamespace>);
1588 /// ```
1589 pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
1590 where
1591 T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
1592 {
1593 self.hierarchical_namespace = v.map(|x| x.into());
1594 self
1595 }
1596}
1597
1598impl wkt::message::Message for StorageLayout {
1599 fn typename() -> &'static str {
1600 "type.googleapis.com/google.storage.control.v2.StorageLayout"
1601 }
1602}
1603
1604/// Defines additional types related to [StorageLayout].
1605pub mod storage_layout {
1606 #[allow(unused_imports)]
1607 use super::*;
1608
1609 /// Configuration for Custom Dual Regions. It should specify precisely two
1610 /// eligible regions within the same Multiregion. More information on regions
1611 /// may be found [here](https://cloud.google.com/storage/docs/locations).
1612 #[derive(Clone, Default, PartialEq)]
1613 #[non_exhaustive]
1614 pub struct CustomPlacementConfig {
1615 /// List of locations to use for data placement.
1616 pub data_locations: std::vec::Vec<std::string::String>,
1617
1618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1619 }
1620
1621 impl CustomPlacementConfig {
1622 /// Creates a new default instance.
1623 pub fn new() -> Self {
1624 std::default::Default::default()
1625 }
1626
1627 /// Sets the value of [data_locations][crate::model::storage_layout::CustomPlacementConfig::data_locations].
1628 ///
1629 /// # Example
1630 /// ```ignore,no_run
1631 /// # use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1632 /// let x = CustomPlacementConfig::new().set_data_locations(["a", "b", "c"]);
1633 /// ```
1634 pub fn set_data_locations<T, V>(mut self, v: T) -> Self
1635 where
1636 T: std::iter::IntoIterator<Item = V>,
1637 V: std::convert::Into<std::string::String>,
1638 {
1639 use std::iter::Iterator;
1640 self.data_locations = v.into_iter().map(|i| i.into()).collect();
1641 self
1642 }
1643 }
1644
1645 impl wkt::message::Message for CustomPlacementConfig {
1646 fn typename() -> &'static str {
1647 "type.googleapis.com/google.storage.control.v2.StorageLayout.CustomPlacementConfig"
1648 }
1649 }
1650
1651 /// Configuration for a bucket's hierarchical namespace feature.
1652 #[derive(Clone, Default, PartialEq)]
1653 #[non_exhaustive]
1654 pub struct HierarchicalNamespace {
1655 /// Enables the hierarchical namespace feature.
1656 pub enabled: bool,
1657
1658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1659 }
1660
1661 impl HierarchicalNamespace {
1662 /// Creates a new default instance.
1663 pub fn new() -> Self {
1664 std::default::Default::default()
1665 }
1666
1667 /// Sets the value of [enabled][crate::model::storage_layout::HierarchicalNamespace::enabled].
1668 ///
1669 /// # Example
1670 /// ```ignore,no_run
1671 /// # use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1672 /// let x = HierarchicalNamespace::new().set_enabled(true);
1673 /// ```
1674 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1675 self.enabled = v.into();
1676 self
1677 }
1678 }
1679
1680 impl wkt::message::Message for HierarchicalNamespace {
1681 fn typename() -> &'static str {
1682 "type.googleapis.com/google.storage.control.v2.StorageLayout.HierarchicalNamespace"
1683 }
1684 }
1685}
1686
1687/// Request message for GetStorageLayout.
1688#[derive(Clone, Default, PartialEq)]
1689#[non_exhaustive]
1690pub struct GetStorageLayoutRequest {
1691 /// Required. The name of the StorageLayout resource.
1692 /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1693 pub name: std::string::String,
1694
1695 /// An optional prefix used for permission check. It is useful when the caller
1696 /// only has limited permissions under a specific prefix.
1697 pub prefix: std::string::String,
1698
1699 /// Optional. A unique identifier for this request. UUID is the recommended
1700 /// format, but other formats are still accepted.
1701 pub request_id: std::string::String,
1702
1703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1704}
1705
1706impl GetStorageLayoutRequest {
1707 /// Creates a new default instance.
1708 pub fn new() -> Self {
1709 std::default::Default::default()
1710 }
1711
1712 /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
1713 ///
1714 /// # Example
1715 /// ```ignore,no_run
1716 /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1717 /// # let project_id = "project_id";
1718 /// # let bucket_id = "bucket_id";
1719 /// let x = GetStorageLayoutRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/storageLayout"));
1720 /// ```
1721 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1722 self.name = v.into();
1723 self
1724 }
1725
1726 /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
1727 ///
1728 /// # Example
1729 /// ```ignore,no_run
1730 /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1731 /// let x = GetStorageLayoutRequest::new().set_prefix("example");
1732 /// ```
1733 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1734 self.prefix = v.into();
1735 self
1736 }
1737
1738 /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
1739 ///
1740 /// # Example
1741 /// ```ignore,no_run
1742 /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1743 /// let x = GetStorageLayoutRequest::new().set_request_id("example");
1744 /// ```
1745 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1746 self.request_id = v.into();
1747 self
1748 }
1749}
1750
1751impl wkt::message::Message for GetStorageLayoutRequest {
1752 fn typename() -> &'static str {
1753 "type.googleapis.com/google.storage.control.v2.GetStorageLayoutRequest"
1754 }
1755}
1756
1757/// A managed folder.
1758#[derive(Clone, Default, PartialEq)]
1759#[non_exhaustive]
1760pub struct ManagedFolder {
1761 /// Identifier. The name of this managed folder.
1762 /// Format:
1763 /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1764 pub name: std::string::String,
1765
1766 /// Output only. The metadata version of this managed folder. It increases
1767 /// whenever the metadata is updated. Used for preconditions and for detecting
1768 /// changes in metadata. Managed folders don't have a generation number.
1769 pub metageneration: i64,
1770
1771 /// Output only. The creation time of the managed folder.
1772 pub create_time: std::option::Option<wkt::Timestamp>,
1773
1774 /// Output only. The modification time of the managed folder.
1775 pub update_time: std::option::Option<wkt::Timestamp>,
1776
1777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1778}
1779
1780impl ManagedFolder {
1781 /// Creates a new default instance.
1782 pub fn new() -> Self {
1783 std::default::Default::default()
1784 }
1785
1786 /// Sets the value of [name][crate::model::ManagedFolder::name].
1787 ///
1788 /// # Example
1789 /// ```ignore,no_run
1790 /// # use google_cloud_storage::model::ManagedFolder;
1791 /// # let project_id = "project_id";
1792 /// # let bucket_id = "bucket_id";
1793 /// # let managed_folder_id = "managed_folder_id";
1794 /// let x = ManagedFolder::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/managedFolders/{managed_folder_id}"));
1795 /// ```
1796 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.name = v.into();
1798 self
1799 }
1800
1801 /// Sets the value of [metageneration][crate::model::ManagedFolder::metageneration].
1802 ///
1803 /// # Example
1804 /// ```ignore,no_run
1805 /// # use google_cloud_storage::model::ManagedFolder;
1806 /// let x = ManagedFolder::new().set_metageneration(42);
1807 /// ```
1808 pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1809 self.metageneration = v.into();
1810 self
1811 }
1812
1813 /// Sets the value of [create_time][crate::model::ManagedFolder::create_time].
1814 ///
1815 /// # Example
1816 /// ```ignore,no_run
1817 /// # use google_cloud_storage::model::ManagedFolder;
1818 /// use wkt::Timestamp;
1819 /// let x = ManagedFolder::new().set_create_time(Timestamp::default()/* use setters */);
1820 /// ```
1821 pub fn set_create_time<T>(mut self, v: T) -> Self
1822 where
1823 T: std::convert::Into<wkt::Timestamp>,
1824 {
1825 self.create_time = std::option::Option::Some(v.into());
1826 self
1827 }
1828
1829 /// Sets or clears the value of [create_time][crate::model::ManagedFolder::create_time].
1830 ///
1831 /// # Example
1832 /// ```ignore,no_run
1833 /// # use google_cloud_storage::model::ManagedFolder;
1834 /// use wkt::Timestamp;
1835 /// let x = ManagedFolder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1836 /// let x = ManagedFolder::new().set_or_clear_create_time(None::<Timestamp>);
1837 /// ```
1838 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1839 where
1840 T: std::convert::Into<wkt::Timestamp>,
1841 {
1842 self.create_time = v.map(|x| x.into());
1843 self
1844 }
1845
1846 /// Sets the value of [update_time][crate::model::ManagedFolder::update_time].
1847 ///
1848 /// # Example
1849 /// ```ignore,no_run
1850 /// # use google_cloud_storage::model::ManagedFolder;
1851 /// use wkt::Timestamp;
1852 /// let x = ManagedFolder::new().set_update_time(Timestamp::default()/* use setters */);
1853 /// ```
1854 pub fn set_update_time<T>(mut self, v: T) -> Self
1855 where
1856 T: std::convert::Into<wkt::Timestamp>,
1857 {
1858 self.update_time = std::option::Option::Some(v.into());
1859 self
1860 }
1861
1862 /// Sets or clears the value of [update_time][crate::model::ManagedFolder::update_time].
1863 ///
1864 /// # Example
1865 /// ```ignore,no_run
1866 /// # use google_cloud_storage::model::ManagedFolder;
1867 /// use wkt::Timestamp;
1868 /// let x = ManagedFolder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1869 /// let x = ManagedFolder::new().set_or_clear_update_time(None::<Timestamp>);
1870 /// ```
1871 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1872 where
1873 T: std::convert::Into<wkt::Timestamp>,
1874 {
1875 self.update_time = v.map(|x| x.into());
1876 self
1877 }
1878}
1879
1880impl wkt::message::Message for ManagedFolder {
1881 fn typename() -> &'static str {
1882 "type.googleapis.com/google.storage.control.v2.ManagedFolder"
1883 }
1884}
1885
1886/// Request message for GetManagedFolder.
1887#[derive(Clone, Default, PartialEq)]
1888#[non_exhaustive]
1889pub struct GetManagedFolderRequest {
1890 /// Required. Name of the managed folder.
1891 /// Format:
1892 /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1893 pub name: std::string::String,
1894
1895 /// The operation succeeds conditional on the managed folder's current
1896 /// metageneration matching the value here specified.
1897 pub if_metageneration_match: std::option::Option<i64>,
1898
1899 /// The operation succeeds conditional on the managed folder's current
1900 /// metageneration NOT matching the value here specified.
1901 pub if_metageneration_not_match: std::option::Option<i64>,
1902
1903 /// Optional. A unique identifier for this request. UUID is the recommended
1904 /// format, but other formats are still accepted.
1905 pub request_id: std::string::String,
1906
1907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1908}
1909
1910impl GetManagedFolderRequest {
1911 /// Creates a new default instance.
1912 pub fn new() -> Self {
1913 std::default::Default::default()
1914 }
1915
1916 /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
1917 ///
1918 /// # Example
1919 /// ```ignore,no_run
1920 /// # use google_cloud_storage::model::GetManagedFolderRequest;
1921 /// # let project_id = "project_id";
1922 /// # let bucket_id = "bucket_id";
1923 /// # let managed_folder_id = "managed_folder_id";
1924 /// let x = GetManagedFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/managedFolders/{managed_folder_id}"));
1925 /// ```
1926 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1927 self.name = v.into();
1928 self
1929 }
1930
1931 /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1932 ///
1933 /// # Example
1934 /// ```ignore,no_run
1935 /// # use google_cloud_storage::model::GetManagedFolderRequest;
1936 /// let x = GetManagedFolderRequest::new().set_if_metageneration_match(42);
1937 /// ```
1938 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1939 where
1940 T: std::convert::Into<i64>,
1941 {
1942 self.if_metageneration_match = std::option::Option::Some(v.into());
1943 self
1944 }
1945
1946 /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1947 ///
1948 /// # Example
1949 /// ```ignore,no_run
1950 /// # use google_cloud_storage::model::GetManagedFolderRequest;
1951 /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
1952 /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1953 /// ```
1954 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1955 where
1956 T: std::convert::Into<i64>,
1957 {
1958 self.if_metageneration_match = v.map(|x| x.into());
1959 self
1960 }
1961
1962 /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1963 ///
1964 /// # Example
1965 /// ```ignore,no_run
1966 /// # use google_cloud_storage::model::GetManagedFolderRequest;
1967 /// let x = GetManagedFolderRequest::new().set_if_metageneration_not_match(42);
1968 /// ```
1969 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1970 where
1971 T: std::convert::Into<i64>,
1972 {
1973 self.if_metageneration_not_match = std::option::Option::Some(v.into());
1974 self
1975 }
1976
1977 /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1978 ///
1979 /// # Example
1980 /// ```ignore,no_run
1981 /// # use google_cloud_storage::model::GetManagedFolderRequest;
1982 /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1983 /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1984 /// ```
1985 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1986 where
1987 T: std::convert::Into<i64>,
1988 {
1989 self.if_metageneration_not_match = v.map(|x| x.into());
1990 self
1991 }
1992
1993 /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
1994 ///
1995 /// # Example
1996 /// ```ignore,no_run
1997 /// # use google_cloud_storage::model::GetManagedFolderRequest;
1998 /// let x = GetManagedFolderRequest::new().set_request_id("example");
1999 /// ```
2000 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2001 self.request_id = v.into();
2002 self
2003 }
2004}
2005
2006impl wkt::message::Message for GetManagedFolderRequest {
2007 fn typename() -> &'static str {
2008 "type.googleapis.com/google.storage.control.v2.GetManagedFolderRequest"
2009 }
2010}
2011
2012/// Request message for CreateManagedFolder.
2013#[derive(Clone, Default, PartialEq)]
2014#[non_exhaustive]
2015pub struct CreateManagedFolderRequest {
2016 /// Required. Name of the bucket this managed folder belongs to.
2017 pub parent: std::string::String,
2018
2019 /// Required. Properties of the managed folder being created.
2020 /// The bucket and managed folder names are specified in the `parent` and
2021 /// `managed_folder_id` fields. Populating these fields in `managed_folder`
2022 /// will result in an error.
2023 pub managed_folder: std::option::Option<crate::model::ManagedFolder>,
2024
2025 /// Required. The name of the managed folder. It uses a single `/` as delimiter
2026 /// and leading and trailing `/` are allowed.
2027 pub managed_folder_id: std::string::String,
2028
2029 /// Optional. A unique identifier for this request. UUID is the recommended
2030 /// format, but other formats are still accepted.
2031 pub request_id: std::string::String,
2032
2033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2034}
2035
2036impl CreateManagedFolderRequest {
2037 /// Creates a new default instance.
2038 pub fn new() -> Self {
2039 std::default::Default::default()
2040 }
2041
2042 /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
2043 ///
2044 /// # Example
2045 /// ```ignore,no_run
2046 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2047 /// # let project_id = "project_id";
2048 /// # let bucket_id = "bucket_id";
2049 /// let x = CreateManagedFolderRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
2050 /// ```
2051 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2052 self.parent = v.into();
2053 self
2054 }
2055
2056 /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
2057 ///
2058 /// # Example
2059 /// ```ignore,no_run
2060 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2061 /// use google_cloud_storage::model::ManagedFolder;
2062 /// let x = CreateManagedFolderRequest::new().set_managed_folder(ManagedFolder::default()/* use setters */);
2063 /// ```
2064 pub fn set_managed_folder<T>(mut self, v: T) -> Self
2065 where
2066 T: std::convert::Into<crate::model::ManagedFolder>,
2067 {
2068 self.managed_folder = std::option::Option::Some(v.into());
2069 self
2070 }
2071
2072 /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
2073 ///
2074 /// # Example
2075 /// ```ignore,no_run
2076 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2077 /// use google_cloud_storage::model::ManagedFolder;
2078 /// let x = CreateManagedFolderRequest::new().set_or_clear_managed_folder(Some(ManagedFolder::default()/* use setters */));
2079 /// let x = CreateManagedFolderRequest::new().set_or_clear_managed_folder(None::<ManagedFolder>);
2080 /// ```
2081 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
2082 where
2083 T: std::convert::Into<crate::model::ManagedFolder>,
2084 {
2085 self.managed_folder = v.map(|x| x.into());
2086 self
2087 }
2088
2089 /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
2090 ///
2091 /// # Example
2092 /// ```ignore,no_run
2093 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2094 /// let x = CreateManagedFolderRequest::new().set_managed_folder_id("example");
2095 /// ```
2096 pub fn set_managed_folder_id<T: std::convert::Into<std::string::String>>(
2097 mut self,
2098 v: T,
2099 ) -> Self {
2100 self.managed_folder_id = v.into();
2101 self
2102 }
2103
2104 /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
2105 ///
2106 /// # Example
2107 /// ```ignore,no_run
2108 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2109 /// let x = CreateManagedFolderRequest::new().set_request_id("example");
2110 /// ```
2111 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2112 self.request_id = v.into();
2113 self
2114 }
2115}
2116
2117impl wkt::message::Message for CreateManagedFolderRequest {
2118 fn typename() -> &'static str {
2119 "type.googleapis.com/google.storage.control.v2.CreateManagedFolderRequest"
2120 }
2121}
2122
2123/// DeleteManagedFolder RPC request message.
2124#[derive(Clone, Default, PartialEq)]
2125#[non_exhaustive]
2126pub struct DeleteManagedFolderRequest {
2127 /// Required. Name of the managed folder.
2128 /// Format:
2129 /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
2130 pub name: std::string::String,
2131
2132 /// The operation succeeds conditional on the managed folder's current
2133 /// metageneration matching the value here specified.
2134 pub if_metageneration_match: std::option::Option<i64>,
2135
2136 /// The operation succeeds conditional on the managed folder's current
2137 /// metageneration NOT matching the value here specified.
2138 pub if_metageneration_not_match: std::option::Option<i64>,
2139
2140 /// Allows deletion of a managed folder even if it is not empty.
2141 /// A managed folder is empty if it manages no child managed folders or
2142 /// objects. Caller must have permission for
2143 /// storage.managedFolders.setIamPolicy.
2144 pub allow_non_empty: bool,
2145
2146 /// Optional. A unique identifier for this request. UUID is the recommended
2147 /// format, but other formats are still accepted.
2148 pub request_id: std::string::String,
2149
2150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2151}
2152
2153impl DeleteManagedFolderRequest {
2154 /// Creates a new default instance.
2155 pub fn new() -> Self {
2156 std::default::Default::default()
2157 }
2158
2159 /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
2160 ///
2161 /// # Example
2162 /// ```ignore,no_run
2163 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2164 /// # let project_id = "project_id";
2165 /// # let bucket_id = "bucket_id";
2166 /// # let managed_folder_id = "managed_folder_id";
2167 /// let x = DeleteManagedFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/managedFolders/{managed_folder_id}"));
2168 /// ```
2169 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2170 self.name = v.into();
2171 self
2172 }
2173
2174 /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
2175 ///
2176 /// # Example
2177 /// ```ignore,no_run
2178 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2179 /// let x = DeleteManagedFolderRequest::new().set_if_metageneration_match(42);
2180 /// ```
2181 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2182 where
2183 T: std::convert::Into<i64>,
2184 {
2185 self.if_metageneration_match = std::option::Option::Some(v.into());
2186 self
2187 }
2188
2189 /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
2190 ///
2191 /// # Example
2192 /// ```ignore,no_run
2193 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2194 /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
2195 /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
2196 /// ```
2197 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2198 where
2199 T: std::convert::Into<i64>,
2200 {
2201 self.if_metageneration_match = v.map(|x| x.into());
2202 self
2203 }
2204
2205 /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
2206 ///
2207 /// # Example
2208 /// ```ignore,no_run
2209 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2210 /// let x = DeleteManagedFolderRequest::new().set_if_metageneration_not_match(42);
2211 /// ```
2212 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2213 where
2214 T: std::convert::Into<i64>,
2215 {
2216 self.if_metageneration_not_match = std::option::Option::Some(v.into());
2217 self
2218 }
2219
2220 /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
2221 ///
2222 /// # Example
2223 /// ```ignore,no_run
2224 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2225 /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
2226 /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
2227 /// ```
2228 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2229 where
2230 T: std::convert::Into<i64>,
2231 {
2232 self.if_metageneration_not_match = v.map(|x| x.into());
2233 self
2234 }
2235
2236 /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
2237 ///
2238 /// # Example
2239 /// ```ignore,no_run
2240 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2241 /// let x = DeleteManagedFolderRequest::new().set_allow_non_empty(true);
2242 /// ```
2243 pub fn set_allow_non_empty<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2244 self.allow_non_empty = v.into();
2245 self
2246 }
2247
2248 /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
2249 ///
2250 /// # Example
2251 /// ```ignore,no_run
2252 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2253 /// let x = DeleteManagedFolderRequest::new().set_request_id("example");
2254 /// ```
2255 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2256 self.request_id = v.into();
2257 self
2258 }
2259}
2260
2261impl wkt::message::Message for DeleteManagedFolderRequest {
2262 fn typename() -> &'static str {
2263 "type.googleapis.com/google.storage.control.v2.DeleteManagedFolderRequest"
2264 }
2265}
2266
2267/// Request message for ListManagedFolders.
2268#[derive(Clone, Default, PartialEq)]
2269#[non_exhaustive]
2270pub struct ListManagedFoldersRequest {
2271 /// Required. Name of the bucket this managed folder belongs to.
2272 pub parent: std::string::String,
2273
2274 /// Optional. Maximum number of managed folders to return in a single response.
2275 /// The service will use this parameter or 1,000 items, whichever is smaller.
2276 pub page_size: i32,
2277
2278 /// Optional. A previously-returned page token representing part of the larger
2279 /// set of results to view.
2280 pub page_token: std::string::String,
2281
2282 /// Optional. Filter results to match managed folders with name starting with
2283 /// this prefix.
2284 pub prefix: std::string::String,
2285
2286 /// Optional. A unique identifier for this request. UUID is the recommended
2287 /// format, but other formats are still accepted.
2288 pub request_id: std::string::String,
2289
2290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2291}
2292
2293impl ListManagedFoldersRequest {
2294 /// Creates a new default instance.
2295 pub fn new() -> Self {
2296 std::default::Default::default()
2297 }
2298
2299 /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
2300 ///
2301 /// # Example
2302 /// ```ignore,no_run
2303 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2304 /// # let project_id = "project_id";
2305 /// # let bucket_id = "bucket_id";
2306 /// let x = ListManagedFoldersRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
2307 /// ```
2308 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2309 self.parent = v.into();
2310 self
2311 }
2312
2313 /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
2314 ///
2315 /// # Example
2316 /// ```ignore,no_run
2317 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2318 /// let x = ListManagedFoldersRequest::new().set_page_size(42);
2319 /// ```
2320 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2321 self.page_size = v.into();
2322 self
2323 }
2324
2325 /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
2326 ///
2327 /// # Example
2328 /// ```ignore,no_run
2329 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2330 /// let x = ListManagedFoldersRequest::new().set_page_token("example");
2331 /// ```
2332 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2333 self.page_token = v.into();
2334 self
2335 }
2336
2337 /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
2338 ///
2339 /// # Example
2340 /// ```ignore,no_run
2341 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2342 /// let x = ListManagedFoldersRequest::new().set_prefix("example");
2343 /// ```
2344 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2345 self.prefix = v.into();
2346 self
2347 }
2348
2349 /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
2350 ///
2351 /// # Example
2352 /// ```ignore,no_run
2353 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2354 /// let x = ListManagedFoldersRequest::new().set_request_id("example");
2355 /// ```
2356 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2357 self.request_id = v.into();
2358 self
2359 }
2360}
2361
2362impl wkt::message::Message for ListManagedFoldersRequest {
2363 fn typename() -> &'static str {
2364 "type.googleapis.com/google.storage.control.v2.ListManagedFoldersRequest"
2365 }
2366}
2367
2368/// Response message for ListManagedFolders.
2369#[derive(Clone, Default, PartialEq)]
2370#[non_exhaustive]
2371pub struct ListManagedFoldersResponse {
2372 /// The list of matching managed folders
2373 pub managed_folders: std::vec::Vec<crate::model::ManagedFolder>,
2374
2375 /// The continuation token, used to page through large result sets. Provide
2376 /// this value in a subsequent request to return the next page of results.
2377 pub next_page_token: std::string::String,
2378
2379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2380}
2381
2382impl ListManagedFoldersResponse {
2383 /// Creates a new default instance.
2384 pub fn new() -> Self {
2385 std::default::Default::default()
2386 }
2387
2388 /// Sets the value of [managed_folders][crate::model::ListManagedFoldersResponse::managed_folders].
2389 ///
2390 /// # Example
2391 /// ```ignore,no_run
2392 /// # use google_cloud_storage::model::ListManagedFoldersResponse;
2393 /// use google_cloud_storage::model::ManagedFolder;
2394 /// let x = ListManagedFoldersResponse::new()
2395 /// .set_managed_folders([
2396 /// ManagedFolder::default()/* use setters */,
2397 /// ManagedFolder::default()/* use (different) setters */,
2398 /// ]);
2399 /// ```
2400 pub fn set_managed_folders<T, V>(mut self, v: T) -> Self
2401 where
2402 T: std::iter::IntoIterator<Item = V>,
2403 V: std::convert::Into<crate::model::ManagedFolder>,
2404 {
2405 use std::iter::Iterator;
2406 self.managed_folders = v.into_iter().map(|i| i.into()).collect();
2407 self
2408 }
2409
2410 /// Sets the value of [next_page_token][crate::model::ListManagedFoldersResponse::next_page_token].
2411 ///
2412 /// # Example
2413 /// ```ignore,no_run
2414 /// # use google_cloud_storage::model::ListManagedFoldersResponse;
2415 /// let x = ListManagedFoldersResponse::new().set_next_page_token("example");
2416 /// ```
2417 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2418 self.next_page_token = v.into();
2419 self
2420 }
2421}
2422
2423impl wkt::message::Message for ListManagedFoldersResponse {
2424 fn typename() -> &'static str {
2425 "type.googleapis.com/google.storage.control.v2.ListManagedFoldersResponse"
2426 }
2427}
2428
2429#[doc(hidden)]
2430impl google_cloud_gax::paginator::internal::PageableResponse for ListManagedFoldersResponse {
2431 type PageItem = crate::model::ManagedFolder;
2432
2433 fn items(self) -> std::vec::Vec<Self::PageItem> {
2434 self.managed_folders
2435 }
2436
2437 fn next_page_token(&self) -> std::string::String {
2438 use std::clone::Clone;
2439 self.next_page_token.clone()
2440 }
2441}
2442
2443/// Message returned in the metadata field of the Operation resource for
2444/// CreateAnywhereCache operations.
2445#[derive(Clone, Default, PartialEq)]
2446#[non_exhaustive]
2447pub struct CreateAnywhereCacheMetadata {
2448 /// Generic metadata for the long running operation.
2449 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
2450
2451 /// Anywhere Cache ID.
2452 pub anywhere_cache_id: std::option::Option<std::string::String>,
2453
2454 /// The zone in which the cache instance is running. For example,
2455 /// us-central1-a.
2456 pub zone: std::option::Option<std::string::String>,
2457
2458 /// Anywhere Cache entry's TTL. A cache-level config that is applied to all new
2459 /// cache entries on admission. Default ttl value (24hrs) is applied if not
2460 /// specified in the create request.
2461 pub ttl: std::option::Option<wkt::Duration>,
2462
2463 /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
2464 /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
2465 /// applied if not specified in the create request.
2466 pub admission_policy: std::option::Option<std::string::String>,
2467
2468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2469}
2470
2471impl CreateAnywhereCacheMetadata {
2472 /// Creates a new default instance.
2473 pub fn new() -> Self {
2474 std::default::Default::default()
2475 }
2476
2477 /// Sets the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
2478 ///
2479 /// # Example
2480 /// ```ignore,no_run
2481 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2482 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2483 /// let x = CreateAnywhereCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
2484 /// ```
2485 pub fn set_common_metadata<T>(mut self, v: T) -> Self
2486 where
2487 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2488 {
2489 self.common_metadata = std::option::Option::Some(v.into());
2490 self
2491 }
2492
2493 /// Sets or clears the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
2494 ///
2495 /// # Example
2496 /// ```ignore,no_run
2497 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2498 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2499 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
2500 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
2501 /// ```
2502 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2503 where
2504 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2505 {
2506 self.common_metadata = v.map(|x| x.into());
2507 self
2508 }
2509
2510 /// Sets the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
2511 ///
2512 /// # Example
2513 /// ```ignore,no_run
2514 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2515 /// let x = CreateAnywhereCacheMetadata::new().set_anywhere_cache_id("example");
2516 /// ```
2517 pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
2518 where
2519 T: std::convert::Into<std::string::String>,
2520 {
2521 self.anywhere_cache_id = std::option::Option::Some(v.into());
2522 self
2523 }
2524
2525 /// Sets or clears the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
2526 ///
2527 /// # Example
2528 /// ```ignore,no_run
2529 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2530 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(Some("example"));
2531 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(None::<String>);
2532 /// ```
2533 pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
2534 where
2535 T: std::convert::Into<std::string::String>,
2536 {
2537 self.anywhere_cache_id = v.map(|x| x.into());
2538 self
2539 }
2540
2541 /// Sets the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
2542 ///
2543 /// # Example
2544 /// ```ignore,no_run
2545 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2546 /// let x = CreateAnywhereCacheMetadata::new().set_zone("example");
2547 /// ```
2548 pub fn set_zone<T>(mut self, v: T) -> Self
2549 where
2550 T: std::convert::Into<std::string::String>,
2551 {
2552 self.zone = std::option::Option::Some(v.into());
2553 self
2554 }
2555
2556 /// Sets or clears the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
2557 ///
2558 /// # Example
2559 /// ```ignore,no_run
2560 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2561 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_zone(Some("example"));
2562 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_zone(None::<String>);
2563 /// ```
2564 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
2565 where
2566 T: std::convert::Into<std::string::String>,
2567 {
2568 self.zone = v.map(|x| x.into());
2569 self
2570 }
2571
2572 /// Sets the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
2573 ///
2574 /// # Example
2575 /// ```ignore,no_run
2576 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2577 /// use wkt::Duration;
2578 /// let x = CreateAnywhereCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
2579 /// ```
2580 pub fn set_ttl<T>(mut self, v: T) -> Self
2581 where
2582 T: std::convert::Into<wkt::Duration>,
2583 {
2584 self.ttl = std::option::Option::Some(v.into());
2585 self
2586 }
2587
2588 /// Sets or clears the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
2589 ///
2590 /// # Example
2591 /// ```ignore,no_run
2592 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2593 /// use wkt::Duration;
2594 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2595 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
2596 /// ```
2597 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2598 where
2599 T: std::convert::Into<wkt::Duration>,
2600 {
2601 self.ttl = v.map(|x| x.into());
2602 self
2603 }
2604
2605 /// Sets the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
2606 ///
2607 /// # Example
2608 /// ```ignore,no_run
2609 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2610 /// let x = CreateAnywhereCacheMetadata::new().set_admission_policy("example");
2611 /// ```
2612 pub fn set_admission_policy<T>(mut self, v: T) -> Self
2613 where
2614 T: std::convert::Into<std::string::String>,
2615 {
2616 self.admission_policy = std::option::Option::Some(v.into());
2617 self
2618 }
2619
2620 /// Sets or clears the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
2621 ///
2622 /// # Example
2623 /// ```ignore,no_run
2624 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2625 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
2626 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
2627 /// ```
2628 pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
2629 where
2630 T: std::convert::Into<std::string::String>,
2631 {
2632 self.admission_policy = v.map(|x| x.into());
2633 self
2634 }
2635}
2636
2637impl wkt::message::Message for CreateAnywhereCacheMetadata {
2638 fn typename() -> &'static str {
2639 "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheMetadata"
2640 }
2641}
2642
2643/// Message returned in the metadata field of the Operation resource for
2644/// UpdateAnywhereCache operation.
2645#[derive(Clone, Default, PartialEq)]
2646#[non_exhaustive]
2647pub struct UpdateAnywhereCacheMetadata {
2648 /// Generic metadata for the long running operation.
2649 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
2650
2651 /// Anywhere Cache ID.
2652 pub anywhere_cache_id: std::option::Option<std::string::String>,
2653
2654 /// The zone in which the cache instance is running. For example,
2655 /// us-central1-a.
2656 pub zone: std::option::Option<std::string::String>,
2657
2658 /// Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that
2659 /// is applied to all new cache entries on admission. If `ttl` is pending
2660 /// update, this field equals to the new value specified in the Update request.
2661 pub ttl: std::option::Option<wkt::Duration>,
2662
2663 /// L4 Cache entry Admission Policy in kebab-case (e.g.,
2664 /// "admit-on-first-miss"). If `admission_policy` is pending
2665 /// update, this field equals to the new value specified in the Update request.
2666 pub admission_policy: std::option::Option<std::string::String>,
2667
2668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2669}
2670
2671impl UpdateAnywhereCacheMetadata {
2672 /// Creates a new default instance.
2673 pub fn new() -> Self {
2674 std::default::Default::default()
2675 }
2676
2677 /// Sets the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
2678 ///
2679 /// # Example
2680 /// ```ignore,no_run
2681 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2682 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2683 /// let x = UpdateAnywhereCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
2684 /// ```
2685 pub fn set_common_metadata<T>(mut self, v: T) -> Self
2686 where
2687 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2688 {
2689 self.common_metadata = std::option::Option::Some(v.into());
2690 self
2691 }
2692
2693 /// Sets or clears the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
2694 ///
2695 /// # Example
2696 /// ```ignore,no_run
2697 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2698 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2699 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
2700 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
2701 /// ```
2702 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2703 where
2704 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2705 {
2706 self.common_metadata = v.map(|x| x.into());
2707 self
2708 }
2709
2710 /// Sets the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
2711 ///
2712 /// # Example
2713 /// ```ignore,no_run
2714 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2715 /// let x = UpdateAnywhereCacheMetadata::new().set_anywhere_cache_id("example");
2716 /// ```
2717 pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
2718 where
2719 T: std::convert::Into<std::string::String>,
2720 {
2721 self.anywhere_cache_id = std::option::Option::Some(v.into());
2722 self
2723 }
2724
2725 /// Sets or clears the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
2726 ///
2727 /// # Example
2728 /// ```ignore,no_run
2729 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2730 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(Some("example"));
2731 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(None::<String>);
2732 /// ```
2733 pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
2734 where
2735 T: std::convert::Into<std::string::String>,
2736 {
2737 self.anywhere_cache_id = v.map(|x| x.into());
2738 self
2739 }
2740
2741 /// Sets the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
2742 ///
2743 /// # Example
2744 /// ```ignore,no_run
2745 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2746 /// let x = UpdateAnywhereCacheMetadata::new().set_zone("example");
2747 /// ```
2748 pub fn set_zone<T>(mut self, v: T) -> Self
2749 where
2750 T: std::convert::Into<std::string::String>,
2751 {
2752 self.zone = std::option::Option::Some(v.into());
2753 self
2754 }
2755
2756 /// Sets or clears the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
2757 ///
2758 /// # Example
2759 /// ```ignore,no_run
2760 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2761 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_zone(Some("example"));
2762 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_zone(None::<String>);
2763 /// ```
2764 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
2765 where
2766 T: std::convert::Into<std::string::String>,
2767 {
2768 self.zone = v.map(|x| x.into());
2769 self
2770 }
2771
2772 /// Sets the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
2773 ///
2774 /// # Example
2775 /// ```ignore,no_run
2776 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2777 /// use wkt::Duration;
2778 /// let x = UpdateAnywhereCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
2779 /// ```
2780 pub fn set_ttl<T>(mut self, v: T) -> Self
2781 where
2782 T: std::convert::Into<wkt::Duration>,
2783 {
2784 self.ttl = std::option::Option::Some(v.into());
2785 self
2786 }
2787
2788 /// Sets or clears the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
2789 ///
2790 /// # Example
2791 /// ```ignore,no_run
2792 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2793 /// use wkt::Duration;
2794 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2795 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
2796 /// ```
2797 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2798 where
2799 T: std::convert::Into<wkt::Duration>,
2800 {
2801 self.ttl = v.map(|x| x.into());
2802 self
2803 }
2804
2805 /// Sets the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
2806 ///
2807 /// # Example
2808 /// ```ignore,no_run
2809 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2810 /// let x = UpdateAnywhereCacheMetadata::new().set_admission_policy("example");
2811 /// ```
2812 pub fn set_admission_policy<T>(mut self, v: T) -> Self
2813 where
2814 T: std::convert::Into<std::string::String>,
2815 {
2816 self.admission_policy = std::option::Option::Some(v.into());
2817 self
2818 }
2819
2820 /// Sets or clears the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
2821 ///
2822 /// # Example
2823 /// ```ignore,no_run
2824 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2825 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
2826 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
2827 /// ```
2828 pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
2829 where
2830 T: std::convert::Into<std::string::String>,
2831 {
2832 self.admission_policy = v.map(|x| x.into());
2833 self
2834 }
2835}
2836
2837impl wkt::message::Message for UpdateAnywhereCacheMetadata {
2838 fn typename() -> &'static str {
2839 "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheMetadata"
2840 }
2841}
2842
2843/// An Anywhere Cache Instance.
2844#[derive(Clone, Default, PartialEq)]
2845#[non_exhaustive]
2846pub struct AnywhereCache {
2847 /// Immutable. The resource name of this AnywhereCache.
2848 /// Format:
2849 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
2850 pub name: std::string::String,
2851
2852 /// Immutable. The zone in which the cache instance is running. For example,
2853 /// us-central1-a.
2854 pub zone: std::string::String,
2855
2856 /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
2857 /// that defines how long a cache entry can live. Default ttl value (24hrs)
2858 /// is applied if not specified in the create request. TTL must be in whole
2859 /// seconds.
2860 pub ttl: std::option::Option<wkt::Duration>,
2861
2862 /// Cache admission policy. Valid policies includes:
2863 /// `admit-on-first-miss` and `admit-on-second-miss`. Defaults to
2864 /// `admit-on-first-miss`. Default value is applied if not specified in the
2865 /// create request.
2866 pub admission_policy: std::string::String,
2867
2868 /// Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED.
2869 pub state: std::string::String,
2870
2871 /// Output only. Time when Anywhere cache instance is allocated.
2872 pub create_time: std::option::Option<wkt::Timestamp>,
2873
2874 /// Output only. Time when Anywhere cache instance is last updated, including
2875 /// creation.
2876 pub update_time: std::option::Option<wkt::Timestamp>,
2877
2878 /// Output only. True if there is an active update operation against this cache
2879 /// instance. Subsequential update requests will be rejected if this field is
2880 /// true. Output only.
2881 pub pending_update: bool,
2882
2883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2884}
2885
2886impl AnywhereCache {
2887 /// Creates a new default instance.
2888 pub fn new() -> Self {
2889 std::default::Default::default()
2890 }
2891
2892 /// Sets the value of [name][crate::model::AnywhereCache::name].
2893 ///
2894 /// # Example
2895 /// ```ignore,no_run
2896 /// # use google_cloud_storage::model::AnywhereCache;
2897 /// # let project_id = "project_id";
2898 /// # let bucket_id = "bucket_id";
2899 /// # let anywhere_cache_id = "anywhere_cache_id";
2900 /// let x = AnywhereCache::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
2901 /// ```
2902 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2903 self.name = v.into();
2904 self
2905 }
2906
2907 /// Sets the value of [zone][crate::model::AnywhereCache::zone].
2908 ///
2909 /// # Example
2910 /// ```ignore,no_run
2911 /// # use google_cloud_storage::model::AnywhereCache;
2912 /// let x = AnywhereCache::new().set_zone("example");
2913 /// ```
2914 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2915 self.zone = v.into();
2916 self
2917 }
2918
2919 /// Sets the value of [ttl][crate::model::AnywhereCache::ttl].
2920 ///
2921 /// # Example
2922 /// ```ignore,no_run
2923 /// # use google_cloud_storage::model::AnywhereCache;
2924 /// use wkt::Duration;
2925 /// let x = AnywhereCache::new().set_ttl(Duration::default()/* use setters */);
2926 /// ```
2927 pub fn set_ttl<T>(mut self, v: T) -> Self
2928 where
2929 T: std::convert::Into<wkt::Duration>,
2930 {
2931 self.ttl = std::option::Option::Some(v.into());
2932 self
2933 }
2934
2935 /// Sets or clears the value of [ttl][crate::model::AnywhereCache::ttl].
2936 ///
2937 /// # Example
2938 /// ```ignore,no_run
2939 /// # use google_cloud_storage::model::AnywhereCache;
2940 /// use wkt::Duration;
2941 /// let x = AnywhereCache::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2942 /// let x = AnywhereCache::new().set_or_clear_ttl(None::<Duration>);
2943 /// ```
2944 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2945 where
2946 T: std::convert::Into<wkt::Duration>,
2947 {
2948 self.ttl = v.map(|x| x.into());
2949 self
2950 }
2951
2952 /// Sets the value of [admission_policy][crate::model::AnywhereCache::admission_policy].
2953 ///
2954 /// # Example
2955 /// ```ignore,no_run
2956 /// # use google_cloud_storage::model::AnywhereCache;
2957 /// let x = AnywhereCache::new().set_admission_policy("example");
2958 /// ```
2959 pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
2960 mut self,
2961 v: T,
2962 ) -> Self {
2963 self.admission_policy = v.into();
2964 self
2965 }
2966
2967 /// Sets the value of [state][crate::model::AnywhereCache::state].
2968 ///
2969 /// # Example
2970 /// ```ignore,no_run
2971 /// # use google_cloud_storage::model::AnywhereCache;
2972 /// let x = AnywhereCache::new().set_state("example");
2973 /// ```
2974 pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2975 self.state = v.into();
2976 self
2977 }
2978
2979 /// Sets the value of [create_time][crate::model::AnywhereCache::create_time].
2980 ///
2981 /// # Example
2982 /// ```ignore,no_run
2983 /// # use google_cloud_storage::model::AnywhereCache;
2984 /// use wkt::Timestamp;
2985 /// let x = AnywhereCache::new().set_create_time(Timestamp::default()/* use setters */);
2986 /// ```
2987 pub fn set_create_time<T>(mut self, v: T) -> Self
2988 where
2989 T: std::convert::Into<wkt::Timestamp>,
2990 {
2991 self.create_time = std::option::Option::Some(v.into());
2992 self
2993 }
2994
2995 /// Sets or clears the value of [create_time][crate::model::AnywhereCache::create_time].
2996 ///
2997 /// # Example
2998 /// ```ignore,no_run
2999 /// # use google_cloud_storage::model::AnywhereCache;
3000 /// use wkt::Timestamp;
3001 /// let x = AnywhereCache::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3002 /// let x = AnywhereCache::new().set_or_clear_create_time(None::<Timestamp>);
3003 /// ```
3004 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3005 where
3006 T: std::convert::Into<wkt::Timestamp>,
3007 {
3008 self.create_time = v.map(|x| x.into());
3009 self
3010 }
3011
3012 /// Sets the value of [update_time][crate::model::AnywhereCache::update_time].
3013 ///
3014 /// # Example
3015 /// ```ignore,no_run
3016 /// # use google_cloud_storage::model::AnywhereCache;
3017 /// use wkt::Timestamp;
3018 /// let x = AnywhereCache::new().set_update_time(Timestamp::default()/* use setters */);
3019 /// ```
3020 pub fn set_update_time<T>(mut self, v: T) -> Self
3021 where
3022 T: std::convert::Into<wkt::Timestamp>,
3023 {
3024 self.update_time = std::option::Option::Some(v.into());
3025 self
3026 }
3027
3028 /// Sets or clears the value of [update_time][crate::model::AnywhereCache::update_time].
3029 ///
3030 /// # Example
3031 /// ```ignore,no_run
3032 /// # use google_cloud_storage::model::AnywhereCache;
3033 /// use wkt::Timestamp;
3034 /// let x = AnywhereCache::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3035 /// let x = AnywhereCache::new().set_or_clear_update_time(None::<Timestamp>);
3036 /// ```
3037 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3038 where
3039 T: std::convert::Into<wkt::Timestamp>,
3040 {
3041 self.update_time = v.map(|x| x.into());
3042 self
3043 }
3044
3045 /// Sets the value of [pending_update][crate::model::AnywhereCache::pending_update].
3046 ///
3047 /// # Example
3048 /// ```ignore,no_run
3049 /// # use google_cloud_storage::model::AnywhereCache;
3050 /// let x = AnywhereCache::new().set_pending_update(true);
3051 /// ```
3052 pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3053 self.pending_update = v.into();
3054 self
3055 }
3056}
3057
3058impl wkt::message::Message for AnywhereCache {
3059 fn typename() -> &'static str {
3060 "type.googleapis.com/google.storage.control.v2.AnywhereCache"
3061 }
3062}
3063
3064/// Request message for CreateAnywhereCache.
3065#[derive(Clone, Default, PartialEq)]
3066#[non_exhaustive]
3067pub struct CreateAnywhereCacheRequest {
3068 /// Required. The bucket to which this cache belongs.
3069 /// Format: `projects/{project}/buckets/{bucket}`
3070 pub parent: std::string::String,
3071
3072 /// Required. Properties of the Anywhere Cache instance being created.
3073 /// The parent bucket name is specified in the `parent` field. Server uses the
3074 /// default value of `ttl` or `admission_policy` if not specified in
3075 /// request.
3076 pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
3077
3078 /// Optional. A unique identifier for this request. UUID is the recommended
3079 /// format, but other formats are still accepted. This request is only
3080 /// idempotent if a `request_id` is provided.
3081 pub request_id: std::string::String,
3082
3083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3084}
3085
3086impl CreateAnywhereCacheRequest {
3087 /// Creates a new default instance.
3088 pub fn new() -> Self {
3089 std::default::Default::default()
3090 }
3091
3092 /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
3093 ///
3094 /// # Example
3095 /// ```ignore,no_run
3096 /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
3097 /// # let project_id = "project_id";
3098 /// # let bucket_id = "bucket_id";
3099 /// let x = CreateAnywhereCacheRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
3100 /// ```
3101 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3102 self.parent = v.into();
3103 self
3104 }
3105
3106 /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
3107 ///
3108 /// # Example
3109 /// ```ignore,no_run
3110 /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
3111 /// use google_cloud_storage::model::AnywhereCache;
3112 /// let x = CreateAnywhereCacheRequest::new().set_anywhere_cache(AnywhereCache::default()/* use setters */);
3113 /// ```
3114 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
3115 where
3116 T: std::convert::Into<crate::model::AnywhereCache>,
3117 {
3118 self.anywhere_cache = std::option::Option::Some(v.into());
3119 self
3120 }
3121
3122 /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
3123 ///
3124 /// # Example
3125 /// ```ignore,no_run
3126 /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
3127 /// use google_cloud_storage::model::AnywhereCache;
3128 /// let x = CreateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(Some(AnywhereCache::default()/* use setters */));
3129 /// let x = CreateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(None::<AnywhereCache>);
3130 /// ```
3131 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
3132 where
3133 T: std::convert::Into<crate::model::AnywhereCache>,
3134 {
3135 self.anywhere_cache = v.map(|x| x.into());
3136 self
3137 }
3138
3139 /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
3140 ///
3141 /// # Example
3142 /// ```ignore,no_run
3143 /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
3144 /// let x = CreateAnywhereCacheRequest::new().set_request_id("example");
3145 /// ```
3146 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3147 self.request_id = v.into();
3148 self
3149 }
3150}
3151
3152impl wkt::message::Message for CreateAnywhereCacheRequest {
3153 fn typename() -> &'static str {
3154 "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheRequest"
3155 }
3156}
3157
3158/// Request message for UpdateAnywhereCache.
3159#[derive(Clone, Default, PartialEq)]
3160#[non_exhaustive]
3161pub struct UpdateAnywhereCacheRequest {
3162 /// Required. The Anywhere Cache instance to be updated.
3163 pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
3164
3165 /// Required. List of fields to be updated. Mutable fields of AnywhereCache
3166 /// include `ttl` and `admission_policy`.
3167 ///
3168 /// To specify ALL fields, specify a single field with the value `*`. Note: We
3169 /// recommend against doing this. If a new field is introduced at a later time,
3170 /// an older client updating with the `*` may accidentally reset the new
3171 /// field's value.
3172 ///
3173 /// Not specifying any fields is an error.
3174 pub update_mask: std::option::Option<wkt::FieldMask>,
3175
3176 /// Optional. A unique identifier for this request. UUID is the recommended
3177 /// format, but other formats are still accepted. This request is only
3178 /// idempotent if a `request_id` is provided.
3179 pub request_id: std::string::String,
3180
3181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3182}
3183
3184impl UpdateAnywhereCacheRequest {
3185 /// Creates a new default instance.
3186 pub fn new() -> Self {
3187 std::default::Default::default()
3188 }
3189
3190 /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
3191 ///
3192 /// # Example
3193 /// ```ignore,no_run
3194 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3195 /// use google_cloud_storage::model::AnywhereCache;
3196 /// let x = UpdateAnywhereCacheRequest::new().set_anywhere_cache(AnywhereCache::default()/* use setters */);
3197 /// ```
3198 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
3199 where
3200 T: std::convert::Into<crate::model::AnywhereCache>,
3201 {
3202 self.anywhere_cache = std::option::Option::Some(v.into());
3203 self
3204 }
3205
3206 /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
3207 ///
3208 /// # Example
3209 /// ```ignore,no_run
3210 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3211 /// use google_cloud_storage::model::AnywhereCache;
3212 /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(Some(AnywhereCache::default()/* use setters */));
3213 /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(None::<AnywhereCache>);
3214 /// ```
3215 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
3216 where
3217 T: std::convert::Into<crate::model::AnywhereCache>,
3218 {
3219 self.anywhere_cache = v.map(|x| x.into());
3220 self
3221 }
3222
3223 /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
3224 ///
3225 /// # Example
3226 /// ```ignore,no_run
3227 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3228 /// use wkt::FieldMask;
3229 /// let x = UpdateAnywhereCacheRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3230 /// ```
3231 pub fn set_update_mask<T>(mut self, v: T) -> Self
3232 where
3233 T: std::convert::Into<wkt::FieldMask>,
3234 {
3235 self.update_mask = std::option::Option::Some(v.into());
3236 self
3237 }
3238
3239 /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
3240 ///
3241 /// # Example
3242 /// ```ignore,no_run
3243 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3244 /// use wkt::FieldMask;
3245 /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3246 /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3247 /// ```
3248 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3249 where
3250 T: std::convert::Into<wkt::FieldMask>,
3251 {
3252 self.update_mask = v.map(|x| x.into());
3253 self
3254 }
3255
3256 /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
3257 ///
3258 /// # Example
3259 /// ```ignore,no_run
3260 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3261 /// let x = UpdateAnywhereCacheRequest::new().set_request_id("example");
3262 /// ```
3263 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3264 self.request_id = v.into();
3265 self
3266 }
3267}
3268
3269impl wkt::message::Message for UpdateAnywhereCacheRequest {
3270 fn typename() -> &'static str {
3271 "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheRequest"
3272 }
3273}
3274
3275/// Request message for DisableAnywhereCache.
3276#[derive(Clone, Default, PartialEq)]
3277#[non_exhaustive]
3278pub struct DisableAnywhereCacheRequest {
3279 /// Required. The name field in the request should be:
3280 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3281 pub name: std::string::String,
3282
3283 /// Optional. A unique identifier for this request. UUID is the recommended
3284 /// format, but other formats are still accepted. This request is only
3285 /// idempotent if a `request_id` is provided.
3286 pub request_id: std::string::String,
3287
3288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3289}
3290
3291impl DisableAnywhereCacheRequest {
3292 /// Creates a new default instance.
3293 pub fn new() -> Self {
3294 std::default::Default::default()
3295 }
3296
3297 /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
3298 ///
3299 /// # Example
3300 /// ```ignore,no_run
3301 /// # use google_cloud_storage::model::DisableAnywhereCacheRequest;
3302 /// # let project_id = "project_id";
3303 /// # let bucket_id = "bucket_id";
3304 /// # let anywhere_cache_id = "anywhere_cache_id";
3305 /// let x = DisableAnywhereCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
3306 /// ```
3307 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3308 self.name = v.into();
3309 self
3310 }
3311
3312 /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
3313 ///
3314 /// # Example
3315 /// ```ignore,no_run
3316 /// # use google_cloud_storage::model::DisableAnywhereCacheRequest;
3317 /// let x = DisableAnywhereCacheRequest::new().set_request_id("example");
3318 /// ```
3319 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3320 self.request_id = v.into();
3321 self
3322 }
3323}
3324
3325impl wkt::message::Message for DisableAnywhereCacheRequest {
3326 fn typename() -> &'static str {
3327 "type.googleapis.com/google.storage.control.v2.DisableAnywhereCacheRequest"
3328 }
3329}
3330
3331/// Request message for PauseAnywhereCache.
3332#[derive(Clone, Default, PartialEq)]
3333#[non_exhaustive]
3334pub struct PauseAnywhereCacheRequest {
3335 /// Required. The name field in the request should be:
3336 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3337 pub name: std::string::String,
3338
3339 /// Optional. A unique identifier for this request. UUID is the recommended
3340 /// format, but other formats are still accepted. This request is only
3341 /// idempotent if a `request_id` is provided.
3342 pub request_id: std::string::String,
3343
3344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3345}
3346
3347impl PauseAnywhereCacheRequest {
3348 /// Creates a new default instance.
3349 pub fn new() -> Self {
3350 std::default::Default::default()
3351 }
3352
3353 /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
3354 ///
3355 /// # Example
3356 /// ```ignore,no_run
3357 /// # use google_cloud_storage::model::PauseAnywhereCacheRequest;
3358 /// # let project_id = "project_id";
3359 /// # let bucket_id = "bucket_id";
3360 /// # let anywhere_cache_id = "anywhere_cache_id";
3361 /// let x = PauseAnywhereCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
3362 /// ```
3363 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3364 self.name = v.into();
3365 self
3366 }
3367
3368 /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
3369 ///
3370 /// # Example
3371 /// ```ignore,no_run
3372 /// # use google_cloud_storage::model::PauseAnywhereCacheRequest;
3373 /// let x = PauseAnywhereCacheRequest::new().set_request_id("example");
3374 /// ```
3375 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3376 self.request_id = v.into();
3377 self
3378 }
3379}
3380
3381impl wkt::message::Message for PauseAnywhereCacheRequest {
3382 fn typename() -> &'static str {
3383 "type.googleapis.com/google.storage.control.v2.PauseAnywhereCacheRequest"
3384 }
3385}
3386
3387/// Request message for ResumeAnywhereCache.
3388#[derive(Clone, Default, PartialEq)]
3389#[non_exhaustive]
3390pub struct ResumeAnywhereCacheRequest {
3391 /// Required. The name field in the request should be:
3392 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3393 pub name: std::string::String,
3394
3395 /// Optional. A unique identifier for this request. UUID is the recommended
3396 /// format, but other formats are still accepted. This request is only
3397 /// idempotent if a `request_id` is provided.
3398 pub request_id: std::string::String,
3399
3400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3401}
3402
3403impl ResumeAnywhereCacheRequest {
3404 /// Creates a new default instance.
3405 pub fn new() -> Self {
3406 std::default::Default::default()
3407 }
3408
3409 /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
3410 ///
3411 /// # Example
3412 /// ```ignore,no_run
3413 /// # use google_cloud_storage::model::ResumeAnywhereCacheRequest;
3414 /// # let project_id = "project_id";
3415 /// # let bucket_id = "bucket_id";
3416 /// # let anywhere_cache_id = "anywhere_cache_id";
3417 /// let x = ResumeAnywhereCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
3418 /// ```
3419 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3420 self.name = v.into();
3421 self
3422 }
3423
3424 /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
3425 ///
3426 /// # Example
3427 /// ```ignore,no_run
3428 /// # use google_cloud_storage::model::ResumeAnywhereCacheRequest;
3429 /// let x = ResumeAnywhereCacheRequest::new().set_request_id("example");
3430 /// ```
3431 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3432 self.request_id = v.into();
3433 self
3434 }
3435}
3436
3437impl wkt::message::Message for ResumeAnywhereCacheRequest {
3438 fn typename() -> &'static str {
3439 "type.googleapis.com/google.storage.control.v2.ResumeAnywhereCacheRequest"
3440 }
3441}
3442
3443/// Request message for GetAnywhereCache.
3444#[derive(Clone, Default, PartialEq)]
3445#[non_exhaustive]
3446pub struct GetAnywhereCacheRequest {
3447 /// Required. The name field in the request should be:
3448 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3449 pub name: std::string::String,
3450
3451 /// Optional. A unique identifier for this request. UUID is the recommended
3452 /// format, but other formats are still accepted.
3453 pub request_id: std::string::String,
3454
3455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3456}
3457
3458impl GetAnywhereCacheRequest {
3459 /// Creates a new default instance.
3460 pub fn new() -> Self {
3461 std::default::Default::default()
3462 }
3463
3464 /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
3465 ///
3466 /// # Example
3467 /// ```ignore,no_run
3468 /// # use google_cloud_storage::model::GetAnywhereCacheRequest;
3469 /// # let project_id = "project_id";
3470 /// # let bucket_id = "bucket_id";
3471 /// # let anywhere_cache_id = "anywhere_cache_id";
3472 /// let x = GetAnywhereCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
3473 /// ```
3474 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3475 self.name = v.into();
3476 self
3477 }
3478
3479 /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
3480 ///
3481 /// # Example
3482 /// ```ignore,no_run
3483 /// # use google_cloud_storage::model::GetAnywhereCacheRequest;
3484 /// let x = GetAnywhereCacheRequest::new().set_request_id("example");
3485 /// ```
3486 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3487 self.request_id = v.into();
3488 self
3489 }
3490}
3491
3492impl wkt::message::Message for GetAnywhereCacheRequest {
3493 fn typename() -> &'static str {
3494 "type.googleapis.com/google.storage.control.v2.GetAnywhereCacheRequest"
3495 }
3496}
3497
3498/// Request message for ListAnywhereCaches.
3499#[derive(Clone, Default, PartialEq)]
3500#[non_exhaustive]
3501pub struct ListAnywhereCachesRequest {
3502 /// Required. The bucket to which this cache belongs.
3503 pub parent: std::string::String,
3504
3505 /// Maximum number of caches to return in a single response.
3506 /// The service will use this parameter or 1,000 items, whichever is smaller.
3507 pub page_size: i32,
3508
3509 /// A previously-returned page token representing part of the larger set of
3510 /// results to view.
3511 pub page_token: std::string::String,
3512
3513 /// Optional. A unique identifier for this request. UUID is the recommended
3514 /// format, but other formats are still accepted.
3515 pub request_id: std::string::String,
3516
3517 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3518}
3519
3520impl ListAnywhereCachesRequest {
3521 /// Creates a new default instance.
3522 pub fn new() -> Self {
3523 std::default::Default::default()
3524 }
3525
3526 /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
3527 ///
3528 /// # Example
3529 /// ```ignore,no_run
3530 /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3531 /// # let project_id = "project_id";
3532 /// # let bucket_id = "bucket_id";
3533 /// let x = ListAnywhereCachesRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
3534 /// ```
3535 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3536 self.parent = v.into();
3537 self
3538 }
3539
3540 /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
3541 ///
3542 /// # Example
3543 /// ```ignore,no_run
3544 /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3545 /// let x = ListAnywhereCachesRequest::new().set_page_size(42);
3546 /// ```
3547 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3548 self.page_size = v.into();
3549 self
3550 }
3551
3552 /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
3553 ///
3554 /// # Example
3555 /// ```ignore,no_run
3556 /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3557 /// let x = ListAnywhereCachesRequest::new().set_page_token("example");
3558 /// ```
3559 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3560 self.page_token = v.into();
3561 self
3562 }
3563
3564 /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
3565 ///
3566 /// # Example
3567 /// ```ignore,no_run
3568 /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3569 /// let x = ListAnywhereCachesRequest::new().set_request_id("example");
3570 /// ```
3571 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3572 self.request_id = v.into();
3573 self
3574 }
3575}
3576
3577impl wkt::message::Message for ListAnywhereCachesRequest {
3578 fn typename() -> &'static str {
3579 "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesRequest"
3580 }
3581}
3582
3583/// Response message for ListAnywhereCaches.
3584#[derive(Clone, Default, PartialEq)]
3585#[non_exhaustive]
3586pub struct ListAnywhereCachesResponse {
3587 /// The list of items.
3588 pub anywhere_caches: std::vec::Vec<crate::model::AnywhereCache>,
3589
3590 /// A token, which can be sent as `page_token` to retrieve the next page.
3591 /// If this field is omitted, there are no subsequent pages.
3592 pub next_page_token: std::string::String,
3593
3594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3595}
3596
3597impl ListAnywhereCachesResponse {
3598 /// Creates a new default instance.
3599 pub fn new() -> Self {
3600 std::default::Default::default()
3601 }
3602
3603 /// Sets the value of [anywhere_caches][crate::model::ListAnywhereCachesResponse::anywhere_caches].
3604 ///
3605 /// # Example
3606 /// ```ignore,no_run
3607 /// # use google_cloud_storage::model::ListAnywhereCachesResponse;
3608 /// use google_cloud_storage::model::AnywhereCache;
3609 /// let x = ListAnywhereCachesResponse::new()
3610 /// .set_anywhere_caches([
3611 /// AnywhereCache::default()/* use setters */,
3612 /// AnywhereCache::default()/* use (different) setters */,
3613 /// ]);
3614 /// ```
3615 pub fn set_anywhere_caches<T, V>(mut self, v: T) -> Self
3616 where
3617 T: std::iter::IntoIterator<Item = V>,
3618 V: std::convert::Into<crate::model::AnywhereCache>,
3619 {
3620 use std::iter::Iterator;
3621 self.anywhere_caches = v.into_iter().map(|i| i.into()).collect();
3622 self
3623 }
3624
3625 /// Sets the value of [next_page_token][crate::model::ListAnywhereCachesResponse::next_page_token].
3626 ///
3627 /// # Example
3628 /// ```ignore,no_run
3629 /// # use google_cloud_storage::model::ListAnywhereCachesResponse;
3630 /// let x = ListAnywhereCachesResponse::new().set_next_page_token("example");
3631 /// ```
3632 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3633 self.next_page_token = v.into();
3634 self
3635 }
3636}
3637
3638impl wkt::message::Message for ListAnywhereCachesResponse {
3639 fn typename() -> &'static str {
3640 "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesResponse"
3641 }
3642}
3643
3644#[doc(hidden)]
3645impl google_cloud_gax::paginator::internal::PageableResponse for ListAnywhereCachesResponse {
3646 type PageItem = crate::model::AnywhereCache;
3647
3648 fn items(self) -> std::vec::Vec<Self::PageItem> {
3649 self.anywhere_caches
3650 }
3651
3652 fn next_page_token(&self) -> std::string::String {
3653 use std::clone::Clone;
3654 self.next_page_token.clone()
3655 }
3656}
3657
3658/// The `IntelligenceConfig` resource associated with your organization, folder,
3659/// or project.
3660#[derive(Clone, Default, PartialEq)]
3661#[non_exhaustive]
3662pub struct IntelligenceConfig {
3663 /// Identifier. The name of the `IntelligenceConfig` resource associated with
3664 /// your organization, folder, or project.
3665 ///
3666 /// The name format varies based on the GCP resource hierarchy as follows:
3667 ///
3668 /// * For project:
3669 /// `projects/{project_number}/locations/global/intelligenceConfig`
3670 /// * For organization:
3671 /// `organizations/{org_id}/locations/global/intelligenceConfig`
3672 /// * For folder: `folders/{folder_id}/locations/global/intelligenceConfig`
3673 pub name: std::string::String,
3674
3675 /// Optional. The edition configuration of the `IntelligenceConfig` resource.
3676 pub edition_config: crate::model::intelligence_config::EditionConfig,
3677
3678 /// Output only. The time at which the `IntelligenceConfig` resource is last
3679 /// updated.
3680 pub update_time: std::option::Option<wkt::Timestamp>,
3681
3682 /// Optional. Filter over location and bucket.
3683 pub filter: std::option::Option<crate::model::intelligence_config::Filter>,
3684
3685 /// Output only. The `IntelligenceConfig` resource that is applicable for the
3686 /// resource.
3687 pub effective_intelligence_config:
3688 std::option::Option<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3689
3690 /// The trial configuration of the `IntelligenceConfig` resource.
3691 pub trial_config: std::option::Option<crate::model::intelligence_config::TrialConfig>,
3692
3693 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3694}
3695
3696impl IntelligenceConfig {
3697 /// Creates a new default instance.
3698 pub fn new() -> Self {
3699 std::default::Default::default()
3700 }
3701
3702 /// Sets the value of [name][crate::model::IntelligenceConfig::name].
3703 ///
3704 /// # Example
3705 /// ```ignore,no_run
3706 /// # use google_cloud_storage::model::IntelligenceConfig;
3707 /// # let folder_id = "folder_id";
3708 /// # let location_id = "location_id";
3709 /// let x = IntelligenceConfig::new().set_name(format!("folders/{folder_id}/locations/{location_id}/intelligenceConfig"));
3710 /// ```
3711 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3712 self.name = v.into();
3713 self
3714 }
3715
3716 /// Sets the value of [edition_config][crate::model::IntelligenceConfig::edition_config].
3717 ///
3718 /// # Example
3719 /// ```ignore,no_run
3720 /// # use google_cloud_storage::model::IntelligenceConfig;
3721 /// use google_cloud_storage::model::intelligence_config::EditionConfig;
3722 /// let x0 = IntelligenceConfig::new().set_edition_config(EditionConfig::Inherit);
3723 /// let x1 = IntelligenceConfig::new().set_edition_config(EditionConfig::Disabled);
3724 /// let x2 = IntelligenceConfig::new().set_edition_config(EditionConfig::Standard);
3725 /// ```
3726 pub fn set_edition_config<
3727 T: std::convert::Into<crate::model::intelligence_config::EditionConfig>,
3728 >(
3729 mut self,
3730 v: T,
3731 ) -> Self {
3732 self.edition_config = v.into();
3733 self
3734 }
3735
3736 /// Sets the value of [update_time][crate::model::IntelligenceConfig::update_time].
3737 ///
3738 /// # Example
3739 /// ```ignore,no_run
3740 /// # use google_cloud_storage::model::IntelligenceConfig;
3741 /// use wkt::Timestamp;
3742 /// let x = IntelligenceConfig::new().set_update_time(Timestamp::default()/* use setters */);
3743 /// ```
3744 pub fn set_update_time<T>(mut self, v: T) -> Self
3745 where
3746 T: std::convert::Into<wkt::Timestamp>,
3747 {
3748 self.update_time = std::option::Option::Some(v.into());
3749 self
3750 }
3751
3752 /// Sets or clears the value of [update_time][crate::model::IntelligenceConfig::update_time].
3753 ///
3754 /// # Example
3755 /// ```ignore,no_run
3756 /// # use google_cloud_storage::model::IntelligenceConfig;
3757 /// use wkt::Timestamp;
3758 /// let x = IntelligenceConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3759 /// let x = IntelligenceConfig::new().set_or_clear_update_time(None::<Timestamp>);
3760 /// ```
3761 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3762 where
3763 T: std::convert::Into<wkt::Timestamp>,
3764 {
3765 self.update_time = v.map(|x| x.into());
3766 self
3767 }
3768
3769 /// Sets the value of [filter][crate::model::IntelligenceConfig::filter].
3770 ///
3771 /// # Example
3772 /// ```ignore,no_run
3773 /// # use google_cloud_storage::model::IntelligenceConfig;
3774 /// use google_cloud_storage::model::intelligence_config::Filter;
3775 /// let x = IntelligenceConfig::new().set_filter(Filter::default()/* use setters */);
3776 /// ```
3777 pub fn set_filter<T>(mut self, v: T) -> Self
3778 where
3779 T: std::convert::Into<crate::model::intelligence_config::Filter>,
3780 {
3781 self.filter = std::option::Option::Some(v.into());
3782 self
3783 }
3784
3785 /// Sets or clears the value of [filter][crate::model::IntelligenceConfig::filter].
3786 ///
3787 /// # Example
3788 /// ```ignore,no_run
3789 /// # use google_cloud_storage::model::IntelligenceConfig;
3790 /// use google_cloud_storage::model::intelligence_config::Filter;
3791 /// let x = IntelligenceConfig::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
3792 /// let x = IntelligenceConfig::new().set_or_clear_filter(None::<Filter>);
3793 /// ```
3794 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3795 where
3796 T: std::convert::Into<crate::model::intelligence_config::Filter>,
3797 {
3798 self.filter = v.map(|x| x.into());
3799 self
3800 }
3801
3802 /// Sets the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
3803 ///
3804 /// # Example
3805 /// ```ignore,no_run
3806 /// # use google_cloud_storage::model::IntelligenceConfig;
3807 /// use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
3808 /// let x = IntelligenceConfig::new().set_effective_intelligence_config(EffectiveIntelligenceConfig::default()/* use setters */);
3809 /// ```
3810 pub fn set_effective_intelligence_config<T>(mut self, v: T) -> Self
3811 where
3812 T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3813 {
3814 self.effective_intelligence_config = std::option::Option::Some(v.into());
3815 self
3816 }
3817
3818 /// Sets or clears the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
3819 ///
3820 /// # Example
3821 /// ```ignore,no_run
3822 /// # use google_cloud_storage::model::IntelligenceConfig;
3823 /// use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
3824 /// let x = IntelligenceConfig::new().set_or_clear_effective_intelligence_config(Some(EffectiveIntelligenceConfig::default()/* use setters */));
3825 /// let x = IntelligenceConfig::new().set_or_clear_effective_intelligence_config(None::<EffectiveIntelligenceConfig>);
3826 /// ```
3827 pub fn set_or_clear_effective_intelligence_config<T>(
3828 mut self,
3829 v: std::option::Option<T>,
3830 ) -> Self
3831 where
3832 T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3833 {
3834 self.effective_intelligence_config = v.map(|x| x.into());
3835 self
3836 }
3837
3838 /// Sets the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
3839 ///
3840 /// # Example
3841 /// ```ignore,no_run
3842 /// # use google_cloud_storage::model::IntelligenceConfig;
3843 /// use google_cloud_storage::model::intelligence_config::TrialConfig;
3844 /// let x = IntelligenceConfig::new().set_trial_config(TrialConfig::default()/* use setters */);
3845 /// ```
3846 pub fn set_trial_config<T>(mut self, v: T) -> Self
3847 where
3848 T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
3849 {
3850 self.trial_config = std::option::Option::Some(v.into());
3851 self
3852 }
3853
3854 /// Sets or clears the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
3855 ///
3856 /// # Example
3857 /// ```ignore,no_run
3858 /// # use google_cloud_storage::model::IntelligenceConfig;
3859 /// use google_cloud_storage::model::intelligence_config::TrialConfig;
3860 /// let x = IntelligenceConfig::new().set_or_clear_trial_config(Some(TrialConfig::default()/* use setters */));
3861 /// let x = IntelligenceConfig::new().set_or_clear_trial_config(None::<TrialConfig>);
3862 /// ```
3863 pub fn set_or_clear_trial_config<T>(mut self, v: std::option::Option<T>) -> Self
3864 where
3865 T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
3866 {
3867 self.trial_config = v.map(|x| x.into());
3868 self
3869 }
3870}
3871
3872impl wkt::message::Message for IntelligenceConfig {
3873 fn typename() -> &'static str {
3874 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig"
3875 }
3876}
3877
3878/// Defines additional types related to [IntelligenceConfig].
3879pub mod intelligence_config {
3880 #[allow(unused_imports)]
3881 use super::*;
3882
3883 /// Filter over location and bucket using include or exclude semantics.
3884 /// Resources that match the include or exclude filter are exclusively included
3885 /// or excluded from the Storage Intelligence plan.
3886 #[derive(Clone, Default, PartialEq)]
3887 #[non_exhaustive]
3888 pub struct Filter {
3889 /// Bucket locations to include or exclude.
3890 pub cloud_storage_locations: std::option::Option<
3891 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
3892 >,
3893
3894 /// Buckets to include or exclude.
3895 pub cloud_storage_buckets: std::option::Option<
3896 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
3897 >,
3898
3899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3900 }
3901
3902 impl Filter {
3903 /// Creates a new default instance.
3904 pub fn new() -> Self {
3905 std::default::Default::default()
3906 }
3907
3908 /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations].
3909 ///
3910 /// Note that all the setters affecting `cloud_storage_locations` are mutually
3911 /// exclusive.
3912 ///
3913 /// # Example
3914 /// ```ignore,no_run
3915 /// # use google_cloud_storage::model::intelligence_config::Filter;
3916 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3917 /// let x = Filter::new().set_cloud_storage_locations(Some(
3918 /// google_cloud_storage::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(CloudStorageLocations::default().into())));
3919 /// ```
3920 pub fn set_cloud_storage_locations<
3921 T: std::convert::Into<
3922 std::option::Option<
3923 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
3924 >,
3925 >,
3926 >(
3927 mut self,
3928 v: T,
3929 ) -> Self {
3930 self.cloud_storage_locations = v.into();
3931 self
3932 }
3933
3934 /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3935 /// if it holds a `IncludedCloudStorageLocations`, `None` if the field is not set or
3936 /// holds a different branch.
3937 pub fn included_cloud_storage_locations(
3938 &self,
3939 ) -> std::option::Option<
3940 &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
3941 > {
3942 #[allow(unreachable_patterns)]
3943 self.cloud_storage_locations.as_ref().and_then(|v| match v {
3944 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(v) => std::option::Option::Some(v),
3945 _ => std::option::Option::None,
3946 })
3947 }
3948
3949 /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3950 /// to hold a `IncludedCloudStorageLocations`.
3951 ///
3952 /// Note that all the setters affecting `cloud_storage_locations` are
3953 /// mutually exclusive.
3954 ///
3955 /// # Example
3956 /// ```ignore,no_run
3957 /// # use google_cloud_storage::model::intelligence_config::Filter;
3958 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3959 /// let x = Filter::new().set_included_cloud_storage_locations(CloudStorageLocations::default()/* use setters */);
3960 /// assert!(x.included_cloud_storage_locations().is_some());
3961 /// assert!(x.excluded_cloud_storage_locations().is_none());
3962 /// ```
3963 pub fn set_included_cloud_storage_locations<
3964 T: std::convert::Into<
3965 std::boxed::Box<
3966 crate::model::intelligence_config::filter::CloudStorageLocations,
3967 >,
3968 >,
3969 >(
3970 mut self,
3971 v: T,
3972 ) -> Self {
3973 self.cloud_storage_locations = std::option::Option::Some(
3974 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
3975 v.into()
3976 )
3977 );
3978 self
3979 }
3980
3981 /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3982 /// if it holds a `ExcludedCloudStorageLocations`, `None` if the field is not set or
3983 /// holds a different branch.
3984 pub fn excluded_cloud_storage_locations(
3985 &self,
3986 ) -> std::option::Option<
3987 &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
3988 > {
3989 #[allow(unreachable_patterns)]
3990 self.cloud_storage_locations.as_ref().and_then(|v| match v {
3991 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(v) => std::option::Option::Some(v),
3992 _ => std::option::Option::None,
3993 })
3994 }
3995
3996 /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3997 /// to hold a `ExcludedCloudStorageLocations`.
3998 ///
3999 /// Note that all the setters affecting `cloud_storage_locations` are
4000 /// mutually exclusive.
4001 ///
4002 /// # Example
4003 /// ```ignore,no_run
4004 /// # use google_cloud_storage::model::intelligence_config::Filter;
4005 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
4006 /// let x = Filter::new().set_excluded_cloud_storage_locations(CloudStorageLocations::default()/* use setters */);
4007 /// assert!(x.excluded_cloud_storage_locations().is_some());
4008 /// assert!(x.included_cloud_storage_locations().is_none());
4009 /// ```
4010 pub fn set_excluded_cloud_storage_locations<
4011 T: std::convert::Into<
4012 std::boxed::Box<
4013 crate::model::intelligence_config::filter::CloudStorageLocations,
4014 >,
4015 >,
4016 >(
4017 mut self,
4018 v: T,
4019 ) -> Self {
4020 self.cloud_storage_locations = std::option::Option::Some(
4021 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
4022 v.into()
4023 )
4024 );
4025 self
4026 }
4027
4028 /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets].
4029 ///
4030 /// Note that all the setters affecting `cloud_storage_buckets` are mutually
4031 /// exclusive.
4032 ///
4033 /// # Example
4034 /// ```ignore,no_run
4035 /// # use google_cloud_storage::model::intelligence_config::Filter;
4036 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
4037 /// let x = Filter::new().set_cloud_storage_buckets(Some(
4038 /// google_cloud_storage::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(CloudStorageBuckets::default().into())));
4039 /// ```
4040 pub fn set_cloud_storage_buckets<
4041 T: std::convert::Into<
4042 std::option::Option<
4043 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
4044 >,
4045 >,
4046 >(
4047 mut self,
4048 v: T,
4049 ) -> Self {
4050 self.cloud_storage_buckets = v.into();
4051 self
4052 }
4053
4054 /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
4055 /// if it holds a `IncludedCloudStorageBuckets`, `None` if the field is not set or
4056 /// holds a different branch.
4057 pub fn included_cloud_storage_buckets(
4058 &self,
4059 ) -> std::option::Option<
4060 &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4061 > {
4062 #[allow(unreachable_patterns)]
4063 self.cloud_storage_buckets.as_ref().and_then(|v| match v {
4064 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(v) => std::option::Option::Some(v),
4065 _ => std::option::Option::None,
4066 })
4067 }
4068
4069 /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
4070 /// to hold a `IncludedCloudStorageBuckets`.
4071 ///
4072 /// Note that all the setters affecting `cloud_storage_buckets` are
4073 /// mutually exclusive.
4074 ///
4075 /// # Example
4076 /// ```ignore,no_run
4077 /// # use google_cloud_storage::model::intelligence_config::Filter;
4078 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
4079 /// let x = Filter::new().set_included_cloud_storage_buckets(CloudStorageBuckets::default()/* use setters */);
4080 /// assert!(x.included_cloud_storage_buckets().is_some());
4081 /// assert!(x.excluded_cloud_storage_buckets().is_none());
4082 /// ```
4083 pub fn set_included_cloud_storage_buckets<
4084 T: std::convert::Into<
4085 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4086 >,
4087 >(
4088 mut self,
4089 v: T,
4090 ) -> Self {
4091 self.cloud_storage_buckets = std::option::Option::Some(
4092 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
4093 v.into()
4094 )
4095 );
4096 self
4097 }
4098
4099 /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
4100 /// if it holds a `ExcludedCloudStorageBuckets`, `None` if the field is not set or
4101 /// holds a different branch.
4102 pub fn excluded_cloud_storage_buckets(
4103 &self,
4104 ) -> std::option::Option<
4105 &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4106 > {
4107 #[allow(unreachable_patterns)]
4108 self.cloud_storage_buckets.as_ref().and_then(|v| match v {
4109 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(v) => std::option::Option::Some(v),
4110 _ => std::option::Option::None,
4111 })
4112 }
4113
4114 /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
4115 /// to hold a `ExcludedCloudStorageBuckets`.
4116 ///
4117 /// Note that all the setters affecting `cloud_storage_buckets` are
4118 /// mutually exclusive.
4119 ///
4120 /// # Example
4121 /// ```ignore,no_run
4122 /// # use google_cloud_storage::model::intelligence_config::Filter;
4123 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
4124 /// let x = Filter::new().set_excluded_cloud_storage_buckets(CloudStorageBuckets::default()/* use setters */);
4125 /// assert!(x.excluded_cloud_storage_buckets().is_some());
4126 /// assert!(x.included_cloud_storage_buckets().is_none());
4127 /// ```
4128 pub fn set_excluded_cloud_storage_buckets<
4129 T: std::convert::Into<
4130 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4131 >,
4132 >(
4133 mut self,
4134 v: T,
4135 ) -> Self {
4136 self.cloud_storage_buckets = std::option::Option::Some(
4137 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
4138 v.into()
4139 )
4140 );
4141 self
4142 }
4143 }
4144
4145 impl wkt::message::Message for Filter {
4146 fn typename() -> &'static str {
4147 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter"
4148 }
4149 }
4150
4151 /// Defines additional types related to [Filter].
4152 pub mod filter {
4153 #[allow(unused_imports)]
4154 use super::*;
4155
4156 /// Collection of bucket locations.
4157 #[derive(Clone, Default, PartialEq)]
4158 #[non_exhaustive]
4159 pub struct CloudStorageLocations {
4160 /// Optional. Bucket locations. Location can be any of the Cloud Storage
4161 /// regions specified in lower case format. For example, `us-east1`,
4162 /// `us-west1`.
4163 pub locations: std::vec::Vec<std::string::String>,
4164
4165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4166 }
4167
4168 impl CloudStorageLocations {
4169 /// Creates a new default instance.
4170 pub fn new() -> Self {
4171 std::default::Default::default()
4172 }
4173
4174 /// Sets the value of [locations][crate::model::intelligence_config::filter::CloudStorageLocations::locations].
4175 ///
4176 /// # Example
4177 /// ```ignore,no_run
4178 /// # use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
4179 /// let x = CloudStorageLocations::new().set_locations(["a", "b", "c"]);
4180 /// ```
4181 pub fn set_locations<T, V>(mut self, v: T) -> Self
4182 where
4183 T: std::iter::IntoIterator<Item = V>,
4184 V: std::convert::Into<std::string::String>,
4185 {
4186 use std::iter::Iterator;
4187 self.locations = v.into_iter().map(|i| i.into()).collect();
4188 self
4189 }
4190 }
4191
4192 impl wkt::message::Message for CloudStorageLocations {
4193 fn typename() -> &'static str {
4194 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"
4195 }
4196 }
4197
4198 /// Collection of buckets.
4199 #[derive(Clone, Default, PartialEq)]
4200 #[non_exhaustive]
4201 pub struct CloudStorageBuckets {
4202 /// Optional. A regex pattern for matching bucket names. Regex should
4203 /// follow the syntax specified in
4204 /// [google/re2](https://github.com/google/re2). For example,
4205 /// `^sample_.*` matches all buckets of the form
4206 /// `gs://sample_bucket-1`, `gs://sample_bucket-2`,
4207 /// `gs://sample_bucket-n` but not `gs://test_sample_bucket`.
4208 /// If you want to match a single bucket, say `gs://sample_bucket`,
4209 /// use `sample_bucket`.
4210 pub bucket_id_regexes: std::vec::Vec<std::string::String>,
4211
4212 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4213 }
4214
4215 impl CloudStorageBuckets {
4216 /// Creates a new default instance.
4217 pub fn new() -> Self {
4218 std::default::Default::default()
4219 }
4220
4221 /// Sets the value of [bucket_id_regexes][crate::model::intelligence_config::filter::CloudStorageBuckets::bucket_id_regexes].
4222 ///
4223 /// # Example
4224 /// ```ignore,no_run
4225 /// # use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
4226 /// let x = CloudStorageBuckets::new().set_bucket_id_regexes(["a", "b", "c"]);
4227 /// ```
4228 pub fn set_bucket_id_regexes<T, V>(mut self, v: T) -> Self
4229 where
4230 T: std::iter::IntoIterator<Item = V>,
4231 V: std::convert::Into<std::string::String>,
4232 {
4233 use std::iter::Iterator;
4234 self.bucket_id_regexes = v.into_iter().map(|i| i.into()).collect();
4235 self
4236 }
4237 }
4238
4239 impl wkt::message::Message for CloudStorageBuckets {
4240 fn typename() -> &'static str {
4241 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"
4242 }
4243 }
4244
4245 /// Bucket locations to include or exclude.
4246 #[derive(Clone, Debug, PartialEq)]
4247 #[non_exhaustive]
4248 pub enum CloudStorageLocationsOneOf {
4249 /// Bucket locations to include.
4250 IncludedCloudStorageLocations(
4251 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
4252 ),
4253 /// Bucket locations to exclude.
4254 ExcludedCloudStorageLocations(
4255 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
4256 ),
4257 }
4258
4259 impl CloudStorageLocationsOneOf {
4260 /// Initializes the enum to the [IncludedCloudStorageLocations](Self::IncludedCloudStorageLocations) branch.
4261 pub fn from_included_cloud_storage_locations(
4262 value: impl std::convert::Into<
4263 std::boxed::Box<
4264 crate::model::intelligence_config::filter::CloudStorageLocations,
4265 >,
4266 >,
4267 ) -> Self {
4268 Self::IncludedCloudStorageLocations(value.into())
4269 }
4270 /// Initializes the enum to the [ExcludedCloudStorageLocations](Self::ExcludedCloudStorageLocations) branch.
4271 pub fn from_excluded_cloud_storage_locations(
4272 value: impl std::convert::Into<
4273 std::boxed::Box<
4274 crate::model::intelligence_config::filter::CloudStorageLocations,
4275 >,
4276 >,
4277 ) -> Self {
4278 Self::ExcludedCloudStorageLocations(value.into())
4279 }
4280 }
4281
4282 /// Buckets to include or exclude.
4283 #[derive(Clone, Debug, PartialEq)]
4284 #[non_exhaustive]
4285 pub enum CloudStorageBucketsOneOf {
4286 /// Buckets to include.
4287 IncludedCloudStorageBuckets(
4288 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4289 ),
4290 /// Buckets to exclude.
4291 ExcludedCloudStorageBuckets(
4292 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4293 ),
4294 }
4295
4296 impl CloudStorageBucketsOneOf {
4297 /// Initializes the enum to the [IncludedCloudStorageBuckets](Self::IncludedCloudStorageBuckets) branch.
4298 pub fn from_included_cloud_storage_buckets(
4299 value: impl std::convert::Into<
4300 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4301 >,
4302 ) -> Self {
4303 Self::IncludedCloudStorageBuckets(value.into())
4304 }
4305 /// Initializes the enum to the [ExcludedCloudStorageBuckets](Self::ExcludedCloudStorageBuckets) branch.
4306 pub fn from_excluded_cloud_storage_buckets(
4307 value: impl std::convert::Into<
4308 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4309 >,
4310 ) -> Self {
4311 Self::ExcludedCloudStorageBuckets(value.into())
4312 }
4313 }
4314 }
4315
4316 /// The effective `IntelligenceConfig` for the resource.
4317 #[derive(Clone, Default, PartialEq)]
4318 #[non_exhaustive]
4319 pub struct EffectiveIntelligenceConfig {
4320 /// Output only. The `IntelligenceConfig` edition that is applicable for the
4321 /// resource.
4322 pub effective_edition:
4323 crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition,
4324
4325 /// Output only. The `IntelligenceConfig` resource that is applied for the
4326 /// target resource. Format:
4327 /// `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig`
4328 pub intelligence_config: std::string::String,
4329
4330 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4331 }
4332
4333 impl EffectiveIntelligenceConfig {
4334 /// Creates a new default instance.
4335 pub fn new() -> Self {
4336 std::default::Default::default()
4337 }
4338
4339 /// Sets the value of [effective_edition][crate::model::intelligence_config::EffectiveIntelligenceConfig::effective_edition].
4340 ///
4341 /// # Example
4342 /// ```ignore,no_run
4343 /// # use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
4344 /// use google_cloud_storage::model::intelligence_config::effective_intelligence_config::EffectiveEdition;
4345 /// let x0 = EffectiveIntelligenceConfig::new().set_effective_edition(EffectiveEdition::None);
4346 /// let x1 = EffectiveIntelligenceConfig::new().set_effective_edition(EffectiveEdition::Standard);
4347 /// ```
4348 pub fn set_effective_edition<T: std::convert::Into<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>(mut self, v: T) -> Self{
4349 self.effective_edition = v.into();
4350 self
4351 }
4352
4353 /// Sets the value of [intelligence_config][crate::model::intelligence_config::EffectiveIntelligenceConfig::intelligence_config].
4354 ///
4355 /// # Example
4356 /// ```ignore,no_run
4357 /// # use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
4358 /// let x = EffectiveIntelligenceConfig::new().set_intelligence_config("example");
4359 /// ```
4360 pub fn set_intelligence_config<T: std::convert::Into<std::string::String>>(
4361 mut self,
4362 v: T,
4363 ) -> Self {
4364 self.intelligence_config = v.into();
4365 self
4366 }
4367 }
4368
4369 impl wkt::message::Message for EffectiveIntelligenceConfig {
4370 fn typename() -> &'static str {
4371 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"
4372 }
4373 }
4374
4375 /// Defines additional types related to [EffectiveIntelligenceConfig].
4376 pub mod effective_intelligence_config {
4377 #[allow(unused_imports)]
4378 use super::*;
4379
4380 /// The effective edition of the `IntelligenceConfig` resource.
4381 ///
4382 /// # Working with unknown values
4383 ///
4384 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4385 /// additional enum variants at any time. Adding new variants is not considered
4386 /// a breaking change. Applications should write their code in anticipation of:
4387 ///
4388 /// - New values appearing in future releases of the client library, **and**
4389 /// - New values received dynamically, without application changes.
4390 ///
4391 /// Please consult the [Working with enums] section in the user guide for some
4392 /// guidelines.
4393 ///
4394 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4395 #[derive(Clone, Debug, PartialEq)]
4396 #[non_exhaustive]
4397 pub enum EffectiveEdition {
4398 /// This is an unknown edition of the resource.
4399 Unspecified,
4400 /// No edition.
4401 None,
4402 /// The `IntelligenceConfig` resource is of STANDARD edition.
4403 Standard,
4404 /// If set, the enum was initialized with an unknown value.
4405 ///
4406 /// Applications can examine the value using [EffectiveEdition::value] or
4407 /// [EffectiveEdition::name].
4408 UnknownValue(effective_edition::UnknownValue),
4409 }
4410
4411 #[doc(hidden)]
4412 pub mod effective_edition {
4413 #[allow(unused_imports)]
4414 use super::*;
4415 #[derive(Clone, Debug, PartialEq)]
4416 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4417 }
4418
4419 impl EffectiveEdition {
4420 /// Gets the enum value.
4421 ///
4422 /// Returns `None` if the enum contains an unknown value deserialized from
4423 /// the string representation of enums.
4424 pub fn value(&self) -> std::option::Option<i32> {
4425 match self {
4426 Self::Unspecified => std::option::Option::Some(0),
4427 Self::None => std::option::Option::Some(1),
4428 Self::Standard => std::option::Option::Some(2),
4429 Self::UnknownValue(u) => u.0.value(),
4430 }
4431 }
4432
4433 /// Gets the enum value as a string.
4434 ///
4435 /// Returns `None` if the enum contains an unknown value deserialized from
4436 /// the integer representation of enums.
4437 pub fn name(&self) -> std::option::Option<&str> {
4438 match self {
4439 Self::Unspecified => std::option::Option::Some("EFFECTIVE_EDITION_UNSPECIFIED"),
4440 Self::None => std::option::Option::Some("NONE"),
4441 Self::Standard => std::option::Option::Some("STANDARD"),
4442 Self::UnknownValue(u) => u.0.name(),
4443 }
4444 }
4445 }
4446
4447 impl std::default::Default for EffectiveEdition {
4448 fn default() -> Self {
4449 use std::convert::From;
4450 Self::from(0)
4451 }
4452 }
4453
4454 impl std::fmt::Display for EffectiveEdition {
4455 fn fmt(
4456 &self,
4457 f: &mut std::fmt::Formatter<'_>,
4458 ) -> std::result::Result<(), std::fmt::Error> {
4459 wkt::internal::display_enum(f, self.name(), self.value())
4460 }
4461 }
4462
4463 impl std::convert::From<i32> for EffectiveEdition {
4464 fn from(value: i32) -> Self {
4465 match value {
4466 0 => Self::Unspecified,
4467 1 => Self::None,
4468 2 => Self::Standard,
4469 _ => Self::UnknownValue(effective_edition::UnknownValue(
4470 wkt::internal::UnknownEnumValue::Integer(value),
4471 )),
4472 }
4473 }
4474 }
4475
4476 impl std::convert::From<&str> for EffectiveEdition {
4477 fn from(value: &str) -> Self {
4478 use std::string::ToString;
4479 match value {
4480 "EFFECTIVE_EDITION_UNSPECIFIED" => Self::Unspecified,
4481 "NONE" => Self::None,
4482 "STANDARD" => Self::Standard,
4483 _ => Self::UnknownValue(effective_edition::UnknownValue(
4484 wkt::internal::UnknownEnumValue::String(value.to_string()),
4485 )),
4486 }
4487 }
4488 }
4489
4490 impl serde::ser::Serialize for EffectiveEdition {
4491 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4492 where
4493 S: serde::Serializer,
4494 {
4495 match self {
4496 Self::Unspecified => serializer.serialize_i32(0),
4497 Self::None => serializer.serialize_i32(1),
4498 Self::Standard => serializer.serialize_i32(2),
4499 Self::UnknownValue(u) => u.0.serialize(serializer),
4500 }
4501 }
4502 }
4503
4504 impl<'de> serde::de::Deserialize<'de> for EffectiveEdition {
4505 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4506 where
4507 D: serde::Deserializer<'de>,
4508 {
4509 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveEdition>::new(
4510 ".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition"))
4511 }
4512 }
4513 }
4514
4515 /// The trial configuration of the `IntelligenceConfig` resource.
4516 #[derive(Clone, Default, PartialEq)]
4517 #[non_exhaustive]
4518 pub struct TrialConfig {
4519 /// Output only. The time at which the trial expires.
4520 pub expire_time: std::option::Option<wkt::Timestamp>,
4521
4522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4523 }
4524
4525 impl TrialConfig {
4526 /// Creates a new default instance.
4527 pub fn new() -> Self {
4528 std::default::Default::default()
4529 }
4530
4531 /// Sets the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
4532 ///
4533 /// # Example
4534 /// ```ignore,no_run
4535 /// # use google_cloud_storage::model::intelligence_config::TrialConfig;
4536 /// use wkt::Timestamp;
4537 /// let x = TrialConfig::new().set_expire_time(Timestamp::default()/* use setters */);
4538 /// ```
4539 pub fn set_expire_time<T>(mut self, v: T) -> Self
4540 where
4541 T: std::convert::Into<wkt::Timestamp>,
4542 {
4543 self.expire_time = std::option::Option::Some(v.into());
4544 self
4545 }
4546
4547 /// Sets or clears the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
4548 ///
4549 /// # Example
4550 /// ```ignore,no_run
4551 /// # use google_cloud_storage::model::intelligence_config::TrialConfig;
4552 /// use wkt::Timestamp;
4553 /// let x = TrialConfig::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
4554 /// let x = TrialConfig::new().set_or_clear_expire_time(None::<Timestamp>);
4555 /// ```
4556 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4557 where
4558 T: std::convert::Into<wkt::Timestamp>,
4559 {
4560 self.expire_time = v.map(|x| x.into());
4561 self
4562 }
4563 }
4564
4565 impl wkt::message::Message for TrialConfig {
4566 fn typename() -> &'static str {
4567 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.TrialConfig"
4568 }
4569 }
4570
4571 /// The edition configuration of the `IntelligenceConfig` resource. This
4572 /// signifies the edition used for configuring the `IntelligenceConfig`
4573 /// resource and can only take the following values:
4574 /// `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and
4575 /// `TRIAL`.
4576 ///
4577 /// # Working with unknown values
4578 ///
4579 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4580 /// additional enum variants at any time. Adding new variants is not considered
4581 /// a breaking change. Applications should write their code in anticipation of:
4582 ///
4583 /// - New values appearing in future releases of the client library, **and**
4584 /// - New values received dynamically, without application changes.
4585 ///
4586 /// Please consult the [Working with enums] section in the user guide for some
4587 /// guidelines.
4588 ///
4589 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4590 #[derive(Clone, Debug, PartialEq)]
4591 #[non_exhaustive]
4592 pub enum EditionConfig {
4593 /// This is an unknown edition of the resource.
4594 Unspecified,
4595 /// The inherited edition from the parent and filters. This is the default
4596 /// edition when there is no `IntelligenceConfig` setup for a GCP resource.
4597 Inherit,
4598 /// The edition configuration is disabled for the `IntelligenceConfig`
4599 /// resource and its children. Filters are not applicable.
4600 Disabled,
4601 /// The `IntelligenceConfig` resource is of STANDARD edition.
4602 Standard,
4603 /// The `IntelligenceConfig` resource is available in `TRIAL` edition. During
4604 /// the trial period, Cloud Storage does not charge for Storage Intelligence
4605 /// usage. You can specify the buckets to include in the trial period by
4606 /// using filters. At the end of the trial period, the `IntelligenceConfig`
4607 /// resource is upgraded to `STANDARD` edition.
4608 Trial,
4609 /// If set, the enum was initialized with an unknown value.
4610 ///
4611 /// Applications can examine the value using [EditionConfig::value] or
4612 /// [EditionConfig::name].
4613 UnknownValue(edition_config::UnknownValue),
4614 }
4615
4616 #[doc(hidden)]
4617 pub mod edition_config {
4618 #[allow(unused_imports)]
4619 use super::*;
4620 #[derive(Clone, Debug, PartialEq)]
4621 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4622 }
4623
4624 impl EditionConfig {
4625 /// Gets the enum value.
4626 ///
4627 /// Returns `None` if the enum contains an unknown value deserialized from
4628 /// the string representation of enums.
4629 pub fn value(&self) -> std::option::Option<i32> {
4630 match self {
4631 Self::Unspecified => std::option::Option::Some(0),
4632 Self::Inherit => std::option::Option::Some(1),
4633 Self::Disabled => std::option::Option::Some(2),
4634 Self::Standard => std::option::Option::Some(3),
4635 Self::Trial => std::option::Option::Some(5),
4636 Self::UnknownValue(u) => u.0.value(),
4637 }
4638 }
4639
4640 /// Gets the enum value as a string.
4641 ///
4642 /// Returns `None` if the enum contains an unknown value deserialized from
4643 /// the integer representation of enums.
4644 pub fn name(&self) -> std::option::Option<&str> {
4645 match self {
4646 Self::Unspecified => std::option::Option::Some("EDITION_CONFIG_UNSPECIFIED"),
4647 Self::Inherit => std::option::Option::Some("INHERIT"),
4648 Self::Disabled => std::option::Option::Some("DISABLED"),
4649 Self::Standard => std::option::Option::Some("STANDARD"),
4650 Self::Trial => std::option::Option::Some("TRIAL"),
4651 Self::UnknownValue(u) => u.0.name(),
4652 }
4653 }
4654 }
4655
4656 impl std::default::Default for EditionConfig {
4657 fn default() -> Self {
4658 use std::convert::From;
4659 Self::from(0)
4660 }
4661 }
4662
4663 impl std::fmt::Display for EditionConfig {
4664 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4665 wkt::internal::display_enum(f, self.name(), self.value())
4666 }
4667 }
4668
4669 impl std::convert::From<i32> for EditionConfig {
4670 fn from(value: i32) -> Self {
4671 match value {
4672 0 => Self::Unspecified,
4673 1 => Self::Inherit,
4674 2 => Self::Disabled,
4675 3 => Self::Standard,
4676 5 => Self::Trial,
4677 _ => Self::UnknownValue(edition_config::UnknownValue(
4678 wkt::internal::UnknownEnumValue::Integer(value),
4679 )),
4680 }
4681 }
4682 }
4683
4684 impl std::convert::From<&str> for EditionConfig {
4685 fn from(value: &str) -> Self {
4686 use std::string::ToString;
4687 match value {
4688 "EDITION_CONFIG_UNSPECIFIED" => Self::Unspecified,
4689 "INHERIT" => Self::Inherit,
4690 "DISABLED" => Self::Disabled,
4691 "STANDARD" => Self::Standard,
4692 "TRIAL" => Self::Trial,
4693 _ => Self::UnknownValue(edition_config::UnknownValue(
4694 wkt::internal::UnknownEnumValue::String(value.to_string()),
4695 )),
4696 }
4697 }
4698 }
4699
4700 impl serde::ser::Serialize for EditionConfig {
4701 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4702 where
4703 S: serde::Serializer,
4704 {
4705 match self {
4706 Self::Unspecified => serializer.serialize_i32(0),
4707 Self::Inherit => serializer.serialize_i32(1),
4708 Self::Disabled => serializer.serialize_i32(2),
4709 Self::Standard => serializer.serialize_i32(3),
4710 Self::Trial => serializer.serialize_i32(5),
4711 Self::UnknownValue(u) => u.0.serialize(serializer),
4712 }
4713 }
4714 }
4715
4716 impl<'de> serde::de::Deserialize<'de> for EditionConfig {
4717 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4718 where
4719 D: serde::Deserializer<'de>,
4720 {
4721 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EditionConfig>::new(
4722 ".google.storage.control.v2.IntelligenceConfig.EditionConfig",
4723 ))
4724 }
4725 }
4726}
4727
4728/// Request message to update the `IntelligenceConfig` resource associated with
4729/// your organization.
4730///
4731/// **IAM Permissions**:
4732///
4733/// Requires `storage.intelligenceConfigs.update`
4734/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4735/// the organization.
4736#[derive(Clone, Default, PartialEq)]
4737#[non_exhaustive]
4738pub struct UpdateOrganizationIntelligenceConfigRequest {
4739 /// Required. The `IntelligenceConfig` resource to be updated.
4740 pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4741
4742 /// Required. The `update_mask` that specifies the fields within the
4743 /// `IntelligenceConfig` resource that should be modified by this update. Only
4744 /// the listed fields are updated.
4745 pub update_mask: std::option::Option<wkt::FieldMask>,
4746
4747 /// Optional. The ID that uniquely identifies the request, preventing duplicate
4748 /// processing.
4749 pub request_id: std::string::String,
4750
4751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4752}
4753
4754impl UpdateOrganizationIntelligenceConfigRequest {
4755 /// Creates a new default instance.
4756 pub fn new() -> Self {
4757 std::default::Default::default()
4758 }
4759
4760 /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
4761 ///
4762 /// # Example
4763 /// ```ignore,no_run
4764 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4765 /// use google_cloud_storage::model::IntelligenceConfig;
4766 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
4767 /// ```
4768 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
4769 where
4770 T: std::convert::Into<crate::model::IntelligenceConfig>,
4771 {
4772 self.intelligence_config = std::option::Option::Some(v.into());
4773 self
4774 }
4775
4776 /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
4777 ///
4778 /// # Example
4779 /// ```ignore,no_run
4780 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4781 /// use google_cloud_storage::model::IntelligenceConfig;
4782 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
4783 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
4784 /// ```
4785 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
4786 where
4787 T: std::convert::Into<crate::model::IntelligenceConfig>,
4788 {
4789 self.intelligence_config = v.map(|x| x.into());
4790 self
4791 }
4792
4793 /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
4794 ///
4795 /// # Example
4796 /// ```ignore,no_run
4797 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4798 /// use wkt::FieldMask;
4799 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4800 /// ```
4801 pub fn set_update_mask<T>(mut self, v: T) -> Self
4802 where
4803 T: std::convert::Into<wkt::FieldMask>,
4804 {
4805 self.update_mask = std::option::Option::Some(v.into());
4806 self
4807 }
4808
4809 /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
4810 ///
4811 /// # Example
4812 /// ```ignore,no_run
4813 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4814 /// use wkt::FieldMask;
4815 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4816 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4817 /// ```
4818 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4819 where
4820 T: std::convert::Into<wkt::FieldMask>,
4821 {
4822 self.update_mask = v.map(|x| x.into());
4823 self
4824 }
4825
4826 /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
4827 ///
4828 /// # Example
4829 /// ```ignore,no_run
4830 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4831 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_request_id("example");
4832 /// ```
4833 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4834 self.request_id = v.into();
4835 self
4836 }
4837}
4838
4839impl wkt::message::Message for UpdateOrganizationIntelligenceConfigRequest {
4840 fn typename() -> &'static str {
4841 "type.googleapis.com/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"
4842 }
4843}
4844
4845/// Request message to update the `IntelligenceConfig` resource associated with
4846/// your folder.
4847///
4848/// **IAM Permissions**:
4849///
4850/// Requires `storage.intelligenceConfigs.update`
4851/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4852/// the folder.
4853#[derive(Clone, Default, PartialEq)]
4854#[non_exhaustive]
4855pub struct UpdateFolderIntelligenceConfigRequest {
4856 /// Required. The `IntelligenceConfig` resource to be updated.
4857 pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4858
4859 /// Required. The `update_mask` that specifies the fields within the
4860 /// `IntelligenceConfig` resource that should be modified by this update. Only
4861 /// the listed fields are updated.
4862 pub update_mask: std::option::Option<wkt::FieldMask>,
4863
4864 /// Optional. The ID that uniquely identifies the request, preventing duplicate
4865 /// processing.
4866 pub request_id: std::string::String,
4867
4868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4869}
4870
4871impl UpdateFolderIntelligenceConfigRequest {
4872 /// Creates a new default instance.
4873 pub fn new() -> Self {
4874 std::default::Default::default()
4875 }
4876
4877 /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
4878 ///
4879 /// # Example
4880 /// ```ignore,no_run
4881 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4882 /// use google_cloud_storage::model::IntelligenceConfig;
4883 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
4884 /// ```
4885 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
4886 where
4887 T: std::convert::Into<crate::model::IntelligenceConfig>,
4888 {
4889 self.intelligence_config = std::option::Option::Some(v.into());
4890 self
4891 }
4892
4893 /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
4894 ///
4895 /// # Example
4896 /// ```ignore,no_run
4897 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4898 /// use google_cloud_storage::model::IntelligenceConfig;
4899 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
4900 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
4901 /// ```
4902 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
4903 where
4904 T: std::convert::Into<crate::model::IntelligenceConfig>,
4905 {
4906 self.intelligence_config = v.map(|x| x.into());
4907 self
4908 }
4909
4910 /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
4911 ///
4912 /// # Example
4913 /// ```ignore,no_run
4914 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4915 /// use wkt::FieldMask;
4916 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4917 /// ```
4918 pub fn set_update_mask<T>(mut self, v: T) -> Self
4919 where
4920 T: std::convert::Into<wkt::FieldMask>,
4921 {
4922 self.update_mask = std::option::Option::Some(v.into());
4923 self
4924 }
4925
4926 /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
4927 ///
4928 /// # Example
4929 /// ```ignore,no_run
4930 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4931 /// use wkt::FieldMask;
4932 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4933 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4934 /// ```
4935 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4936 where
4937 T: std::convert::Into<wkt::FieldMask>,
4938 {
4939 self.update_mask = v.map(|x| x.into());
4940 self
4941 }
4942
4943 /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
4944 ///
4945 /// # Example
4946 /// ```ignore,no_run
4947 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4948 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_request_id("example");
4949 /// ```
4950 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4951 self.request_id = v.into();
4952 self
4953 }
4954}
4955
4956impl wkt::message::Message for UpdateFolderIntelligenceConfigRequest {
4957 fn typename() -> &'static str {
4958 "type.googleapis.com/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"
4959 }
4960}
4961
4962/// Request message to update the `IntelligenceConfig` resource associated with
4963/// your project.
4964///
4965/// **IAM Permissions**:
4966///
4967/// Requires `storage.intelligenceConfigs.update`
4968/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4969/// the folder.
4970#[derive(Clone, Default, PartialEq)]
4971#[non_exhaustive]
4972pub struct UpdateProjectIntelligenceConfigRequest {
4973 /// Required. The `IntelligenceConfig` resource to be updated.
4974 pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4975
4976 /// Required. The `update_mask` that specifies the fields within the
4977 /// `IntelligenceConfig` resource that should be modified by this update. Only
4978 /// the listed fields are updated.
4979 pub update_mask: std::option::Option<wkt::FieldMask>,
4980
4981 /// Optional. The ID that uniquely identifies the request, preventing duplicate
4982 /// processing.
4983 pub request_id: std::string::String,
4984
4985 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4986}
4987
4988impl UpdateProjectIntelligenceConfigRequest {
4989 /// Creates a new default instance.
4990 pub fn new() -> Self {
4991 std::default::Default::default()
4992 }
4993
4994 /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
4995 ///
4996 /// # Example
4997 /// ```ignore,no_run
4998 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4999 /// use google_cloud_storage::model::IntelligenceConfig;
5000 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
5001 /// ```
5002 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
5003 where
5004 T: std::convert::Into<crate::model::IntelligenceConfig>,
5005 {
5006 self.intelligence_config = std::option::Option::Some(v.into());
5007 self
5008 }
5009
5010 /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
5011 ///
5012 /// # Example
5013 /// ```ignore,no_run
5014 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
5015 /// use google_cloud_storage::model::IntelligenceConfig;
5016 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
5017 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
5018 /// ```
5019 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
5020 where
5021 T: std::convert::Into<crate::model::IntelligenceConfig>,
5022 {
5023 self.intelligence_config = v.map(|x| x.into());
5024 self
5025 }
5026
5027 /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
5028 ///
5029 /// # Example
5030 /// ```ignore,no_run
5031 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
5032 /// use wkt::FieldMask;
5033 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5034 /// ```
5035 pub fn set_update_mask<T>(mut self, v: T) -> Self
5036 where
5037 T: std::convert::Into<wkt::FieldMask>,
5038 {
5039 self.update_mask = std::option::Option::Some(v.into());
5040 self
5041 }
5042
5043 /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
5044 ///
5045 /// # Example
5046 /// ```ignore,no_run
5047 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
5048 /// use wkt::FieldMask;
5049 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5050 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5051 /// ```
5052 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5053 where
5054 T: std::convert::Into<wkt::FieldMask>,
5055 {
5056 self.update_mask = v.map(|x| x.into());
5057 self
5058 }
5059
5060 /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
5061 ///
5062 /// # Example
5063 /// ```ignore,no_run
5064 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
5065 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_request_id("example");
5066 /// ```
5067 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5068 self.request_id = v.into();
5069 self
5070 }
5071}
5072
5073impl wkt::message::Message for UpdateProjectIntelligenceConfigRequest {
5074 fn typename() -> &'static str {
5075 "type.googleapis.com/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"
5076 }
5077}
5078
5079/// Request message to get the `IntelligenceConfig` resource associated with your
5080/// organization.
5081///
5082/// **IAM Permissions**
5083///
5084/// Requires `storage.intelligenceConfigs.get`
5085/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
5086/// the organization.
5087#[derive(Clone, Default, PartialEq)]
5088#[non_exhaustive]
5089pub struct GetOrganizationIntelligenceConfigRequest {
5090 /// Required. The name of the `IntelligenceConfig` resource associated with
5091 /// your organization.
5092 ///
5093 /// Format: `organizations/{org_id}/locations/global/intelligenceConfig`
5094 pub name: std::string::String,
5095
5096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5097}
5098
5099impl GetOrganizationIntelligenceConfigRequest {
5100 /// Creates a new default instance.
5101 pub fn new() -> Self {
5102 std::default::Default::default()
5103 }
5104
5105 /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
5106 ///
5107 /// # Example
5108 /// ```ignore,no_run
5109 /// # use google_cloud_storage::model::GetOrganizationIntelligenceConfigRequest;
5110 /// # let folder_id = "folder_id";
5111 /// # let location_id = "location_id";
5112 /// let x = GetOrganizationIntelligenceConfigRequest::new().set_name(format!("folders/{folder_id}/locations/{location_id}/intelligenceConfig"));
5113 /// ```
5114 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5115 self.name = v.into();
5116 self
5117 }
5118}
5119
5120impl wkt::message::Message for GetOrganizationIntelligenceConfigRequest {
5121 fn typename() -> &'static str {
5122 "type.googleapis.com/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"
5123 }
5124}
5125
5126/// Request message to get the `IntelligenceConfig` resource associated with your
5127/// folder.
5128///
5129/// **IAM Permissions**
5130///
5131/// Requires `storage.intelligenceConfigs.get`
5132/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
5133/// the folder.
5134#[derive(Clone, Default, PartialEq)]
5135#[non_exhaustive]
5136pub struct GetFolderIntelligenceConfigRequest {
5137 /// Required. The name of the `IntelligenceConfig` resource associated with
5138 /// your folder.
5139 ///
5140 /// Format: `folders/{id}/locations/global/intelligenceConfig`
5141 pub name: std::string::String,
5142
5143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5144}
5145
5146impl GetFolderIntelligenceConfigRequest {
5147 /// Creates a new default instance.
5148 pub fn new() -> Self {
5149 std::default::Default::default()
5150 }
5151
5152 /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
5153 ///
5154 /// # Example
5155 /// ```ignore,no_run
5156 /// # use google_cloud_storage::model::GetFolderIntelligenceConfigRequest;
5157 /// # let folder_id = "folder_id";
5158 /// # let location_id = "location_id";
5159 /// let x = GetFolderIntelligenceConfigRequest::new().set_name(format!("folders/{folder_id}/locations/{location_id}/intelligenceConfig"));
5160 /// ```
5161 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5162 self.name = v.into();
5163 self
5164 }
5165}
5166
5167impl wkt::message::Message for GetFolderIntelligenceConfigRequest {
5168 fn typename() -> &'static str {
5169 "type.googleapis.com/google.storage.control.v2.GetFolderIntelligenceConfigRequest"
5170 }
5171}
5172
5173/// Request message to get the `IntelligenceConfig` resource associated with your
5174/// project.
5175///
5176/// **IAM Permissions**:
5177///
5178/// Requires `storage.intelligenceConfigs.get`
5179/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission
5180/// on the project.
5181#[derive(Clone, Default, PartialEq)]
5182#[non_exhaustive]
5183pub struct GetProjectIntelligenceConfigRequest {
5184 /// Required. The name of the `IntelligenceConfig` resource associated with
5185 /// your project.
5186 ///
5187 /// Format: `projects/{id}/locations/global/intelligenceConfig`
5188 pub name: std::string::String,
5189
5190 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5191}
5192
5193impl GetProjectIntelligenceConfigRequest {
5194 /// Creates a new default instance.
5195 pub fn new() -> Self {
5196 std::default::Default::default()
5197 }
5198
5199 /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
5200 ///
5201 /// # Example
5202 /// ```ignore,no_run
5203 /// # use google_cloud_storage::model::GetProjectIntelligenceConfigRequest;
5204 /// # let folder_id = "folder_id";
5205 /// # let location_id = "location_id";
5206 /// let x = GetProjectIntelligenceConfigRequest::new().set_name(format!("folders/{folder_id}/locations/{location_id}/intelligenceConfig"));
5207 /// ```
5208 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5209 self.name = v.into();
5210 self
5211 }
5212}
5213
5214impl wkt::message::Message for GetProjectIntelligenceConfigRequest {
5215 fn typename() -> &'static str {
5216 "type.googleapis.com/google.storage.control.v2.GetProjectIntelligenceConfigRequest"
5217 }
5218}
5219
5220/// The `IntelligenceFinding` resource that represents a security, performance,
5221/// or cost-related finding about a project or bucket.
5222#[derive(Clone, Default, PartialEq)]
5223#[non_exhaustive]
5224pub struct IntelligenceFinding {
5225 /// Identifier. The resource name of `IntelligenceFinding`.
5226 /// Format:
5227 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
5228 pub name: std::string::String,
5229
5230 /// Output only. A short description about the finding.
5231 pub description: std::string::String,
5232
5233 /// Output only. Type of this finding.
5234 pub r#type: crate::model::FindingType,
5235
5236 /// Output only. Category of this finding.
5237 pub category: crate::model::FindingCategory,
5238
5239 /// Output only. Severity of the finding.
5240 pub severity: crate::model::FindingSeverity,
5241
5242 /// Output only. The time at which the finding was created.
5243 pub create_time: std::option::Option<wkt::Timestamp>,
5244
5245 /// Output only. The time at which the finding was last updated.
5246 pub update_time: std::option::Option<wkt::Timestamp>,
5247
5248 /// Output only. The fully qualified resource name of the resource that this
5249 /// `IntelligenceFinding` applies to. eg:
5250 ///
5251 /// - `storage.googleapis.com/projects/_/buckets/b1`
5252 /// - `cloudresourecemanager.googleapis.com/projects/p1`
5253 pub target_resource: std::string::String,
5254
5255 /// Output only. Contains GCP resource names that are
5256 /// relevant to this `IntelligenceFinding`. The `target_resource` is also added
5257 /// as part of `associated_resources`. eg:
5258 ///
5259 /// - `storage.googleapis.com/projects/_/buckets/b1`
5260 /// - `cloudresourecemanager.googleapis.com/projects/p1`
5261 pub associated_resources: std::vec::Vec<std::string::String>,
5262
5263 /// Output only. The time interval during which the underlying data was used to
5264 /// generate this `IntelligenceFinding`.
5265 pub observation_period: std::option::Option<google_cloud_type::model::Interval>,
5266
5267 /// The specific details of the `IntelligenceFinding`.
5268 pub intelligence_finding_details:
5269 std::option::Option<crate::model::intelligence_finding::IntelligenceFindingDetails>,
5270
5271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5272}
5273
5274impl IntelligenceFinding {
5275 /// Creates a new default instance.
5276 pub fn new() -> Self {
5277 std::default::Default::default()
5278 }
5279
5280 /// Sets the value of [name][crate::model::IntelligenceFinding::name].
5281 ///
5282 /// # Example
5283 /// ```ignore,no_run
5284 /// # use google_cloud_storage::model::IntelligenceFinding;
5285 /// # let project_id = "project_id";
5286 /// # let location_id = "location_id";
5287 /// # let intelligence_finding_id = "intelligence_finding_id";
5288 /// let x = IntelligenceFinding::new().set_name(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}"));
5289 /// ```
5290 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5291 self.name = v.into();
5292 self
5293 }
5294
5295 /// Sets the value of [description][crate::model::IntelligenceFinding::description].
5296 ///
5297 /// # Example
5298 /// ```ignore,no_run
5299 /// # use google_cloud_storage::model::IntelligenceFinding;
5300 /// let x = IntelligenceFinding::new().set_description("example");
5301 /// ```
5302 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5303 self.description = v.into();
5304 self
5305 }
5306
5307 /// Sets the value of [r#type][crate::model::IntelligenceFinding::type].
5308 ///
5309 /// # Example
5310 /// ```ignore,no_run
5311 /// # use google_cloud_storage::model::IntelligenceFinding;
5312 /// use google_cloud_storage::model::FindingType;
5313 /// let x0 = IntelligenceFinding::new().set_type(FindingType::ColdlineAndArchivalStorageOperationsSpike);
5314 /// let x1 = IntelligenceFinding::new().set_type(FindingType::ThrottledRequestSpike);
5315 /// let x2 = IntelligenceFinding::new().set_type(FindingType::CrossRegionEgressSpike);
5316 /// ```
5317 pub fn set_type<T: std::convert::Into<crate::model::FindingType>>(mut self, v: T) -> Self {
5318 self.r#type = v.into();
5319 self
5320 }
5321
5322 /// Sets the value of [category][crate::model::IntelligenceFinding::category].
5323 ///
5324 /// # Example
5325 /// ```ignore,no_run
5326 /// # use google_cloud_storage::model::IntelligenceFinding;
5327 /// use google_cloud_storage::model::FindingCategory;
5328 /// let x0 = IntelligenceFinding::new().set_category(FindingCategory::DataManagement);
5329 /// let x1 = IntelligenceFinding::new().set_category(FindingCategory::Performance);
5330 /// ```
5331 pub fn set_category<T: std::convert::Into<crate::model::FindingCategory>>(
5332 mut self,
5333 v: T,
5334 ) -> Self {
5335 self.category = v.into();
5336 self
5337 }
5338
5339 /// Sets the value of [severity][crate::model::IntelligenceFinding::severity].
5340 ///
5341 /// # Example
5342 /// ```ignore,no_run
5343 /// # use google_cloud_storage::model::IntelligenceFinding;
5344 /// use google_cloud_storage::model::FindingSeverity;
5345 /// let x0 = IntelligenceFinding::new().set_severity(FindingSeverity::Critical);
5346 /// ```
5347 pub fn set_severity<T: std::convert::Into<crate::model::FindingSeverity>>(
5348 mut self,
5349 v: T,
5350 ) -> Self {
5351 self.severity = v.into();
5352 self
5353 }
5354
5355 /// Sets the value of [create_time][crate::model::IntelligenceFinding::create_time].
5356 ///
5357 /// # Example
5358 /// ```ignore,no_run
5359 /// # use google_cloud_storage::model::IntelligenceFinding;
5360 /// use wkt::Timestamp;
5361 /// let x = IntelligenceFinding::new().set_create_time(Timestamp::default()/* use setters */);
5362 /// ```
5363 pub fn set_create_time<T>(mut self, v: T) -> Self
5364 where
5365 T: std::convert::Into<wkt::Timestamp>,
5366 {
5367 self.create_time = std::option::Option::Some(v.into());
5368 self
5369 }
5370
5371 /// Sets or clears the value of [create_time][crate::model::IntelligenceFinding::create_time].
5372 ///
5373 /// # Example
5374 /// ```ignore,no_run
5375 /// # use google_cloud_storage::model::IntelligenceFinding;
5376 /// use wkt::Timestamp;
5377 /// let x = IntelligenceFinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5378 /// let x = IntelligenceFinding::new().set_or_clear_create_time(None::<Timestamp>);
5379 /// ```
5380 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5381 where
5382 T: std::convert::Into<wkt::Timestamp>,
5383 {
5384 self.create_time = v.map(|x| x.into());
5385 self
5386 }
5387
5388 /// Sets the value of [update_time][crate::model::IntelligenceFinding::update_time].
5389 ///
5390 /// # Example
5391 /// ```ignore,no_run
5392 /// # use google_cloud_storage::model::IntelligenceFinding;
5393 /// use wkt::Timestamp;
5394 /// let x = IntelligenceFinding::new().set_update_time(Timestamp::default()/* use setters */);
5395 /// ```
5396 pub fn set_update_time<T>(mut self, v: T) -> Self
5397 where
5398 T: std::convert::Into<wkt::Timestamp>,
5399 {
5400 self.update_time = std::option::Option::Some(v.into());
5401 self
5402 }
5403
5404 /// Sets or clears the value of [update_time][crate::model::IntelligenceFinding::update_time].
5405 ///
5406 /// # Example
5407 /// ```ignore,no_run
5408 /// # use google_cloud_storage::model::IntelligenceFinding;
5409 /// use wkt::Timestamp;
5410 /// let x = IntelligenceFinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5411 /// let x = IntelligenceFinding::new().set_or_clear_update_time(None::<Timestamp>);
5412 /// ```
5413 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5414 where
5415 T: std::convert::Into<wkt::Timestamp>,
5416 {
5417 self.update_time = v.map(|x| x.into());
5418 self
5419 }
5420
5421 /// Sets the value of [target_resource][crate::model::IntelligenceFinding::target_resource].
5422 ///
5423 /// # Example
5424 /// ```ignore,no_run
5425 /// # use google_cloud_storage::model::IntelligenceFinding;
5426 /// let x = IntelligenceFinding::new().set_target_resource("example");
5427 /// ```
5428 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5429 self.target_resource = v.into();
5430 self
5431 }
5432
5433 /// Sets the value of [associated_resources][crate::model::IntelligenceFinding::associated_resources].
5434 ///
5435 /// # Example
5436 /// ```ignore,no_run
5437 /// # use google_cloud_storage::model::IntelligenceFinding;
5438 /// let x = IntelligenceFinding::new().set_associated_resources(["a", "b", "c"]);
5439 /// ```
5440 pub fn set_associated_resources<T, V>(mut self, v: T) -> Self
5441 where
5442 T: std::iter::IntoIterator<Item = V>,
5443 V: std::convert::Into<std::string::String>,
5444 {
5445 use std::iter::Iterator;
5446 self.associated_resources = v.into_iter().map(|i| i.into()).collect();
5447 self
5448 }
5449
5450 /// Sets the value of [observation_period][crate::model::IntelligenceFinding::observation_period].
5451 ///
5452 /// # Example
5453 /// ```ignore,no_run
5454 /// # use google_cloud_storage::model::IntelligenceFinding;
5455 /// use google_cloud_type::model::Interval;
5456 /// let x = IntelligenceFinding::new().set_observation_period(Interval::default()/* use setters */);
5457 /// ```
5458 pub fn set_observation_period<T>(mut self, v: T) -> Self
5459 where
5460 T: std::convert::Into<google_cloud_type::model::Interval>,
5461 {
5462 self.observation_period = std::option::Option::Some(v.into());
5463 self
5464 }
5465
5466 /// Sets or clears the value of [observation_period][crate::model::IntelligenceFinding::observation_period].
5467 ///
5468 /// # Example
5469 /// ```ignore,no_run
5470 /// # use google_cloud_storage::model::IntelligenceFinding;
5471 /// use google_cloud_type::model::Interval;
5472 /// let x = IntelligenceFinding::new().set_or_clear_observation_period(Some(Interval::default()/* use setters */));
5473 /// let x = IntelligenceFinding::new().set_or_clear_observation_period(None::<Interval>);
5474 /// ```
5475 pub fn set_or_clear_observation_period<T>(mut self, v: std::option::Option<T>) -> Self
5476 where
5477 T: std::convert::Into<google_cloud_type::model::Interval>,
5478 {
5479 self.observation_period = v.map(|x| x.into());
5480 self
5481 }
5482
5483 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details].
5484 ///
5485 /// Note that all the setters affecting `intelligence_finding_details` are mutually
5486 /// exclusive.
5487 ///
5488 /// # Example
5489 /// ```ignore,no_run
5490 /// # use google_cloud_storage::model::IntelligenceFinding;
5491 /// use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
5492 /// let x = IntelligenceFinding::new().set_intelligence_finding_details(Some(
5493 /// google_cloud_storage::model::intelligence_finding::IntelligenceFindingDetails::ColdlineAndArchivalStorageOperationsSpike(ColdlineAndArchivalStorageOperationsSpike::default().into())));
5494 /// ```
5495 pub fn set_intelligence_finding_details<
5496 T: std::convert::Into<
5497 std::option::Option<crate::model::intelligence_finding::IntelligenceFindingDetails>,
5498 >,
5499 >(
5500 mut self,
5501 v: T,
5502 ) -> Self {
5503 self.intelligence_finding_details = v.into();
5504 self
5505 }
5506
5507 /// The value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
5508 /// if it holds a `ColdlineAndArchivalStorageOperationsSpike`, `None` if the field is not set or
5509 /// holds a different branch.
5510 pub fn coldline_and_archival_storage_operations_spike(
5511 &self,
5512 ) -> std::option::Option<
5513 &std::boxed::Box<
5514 crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike,
5515 >,
5516 > {
5517 #[allow(unreachable_patterns)]
5518 self.intelligence_finding_details.as_ref().and_then(|v| match v {
5519 crate::model::intelligence_finding::IntelligenceFindingDetails::ColdlineAndArchivalStorageOperationsSpike(v) => std::option::Option::Some(v),
5520 _ => std::option::Option::None,
5521 })
5522 }
5523
5524 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
5525 /// to hold a `ColdlineAndArchivalStorageOperationsSpike`.
5526 ///
5527 /// Note that all the setters affecting `intelligence_finding_details` are
5528 /// mutually exclusive.
5529 ///
5530 /// # Example
5531 /// ```ignore,no_run
5532 /// # use google_cloud_storage::model::IntelligenceFinding;
5533 /// use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
5534 /// let x = IntelligenceFinding::new().set_coldline_and_archival_storage_operations_spike(ColdlineAndArchivalStorageOperationsSpike::default()/* use setters */);
5535 /// assert!(x.coldline_and_archival_storage_operations_spike().is_some());
5536 /// assert!(x.throttled_requests_spike().is_none());
5537 /// assert!(x.cross_region_egress_spike().is_none());
5538 /// assert!(x.storage_growth_above_trend().is_none());
5539 /// ```
5540 pub fn set_coldline_and_archival_storage_operations_spike<
5541 T: std::convert::Into<
5542 std::boxed::Box<
5543 crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike,
5544 >,
5545 >,
5546 >(
5547 mut self,
5548 v: T,
5549 ) -> Self {
5550 self.intelligence_finding_details = std::option::Option::Some(
5551 crate::model::intelligence_finding::IntelligenceFindingDetails::ColdlineAndArchivalStorageOperationsSpike(
5552 v.into()
5553 )
5554 );
5555 self
5556 }
5557
5558 /// The value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
5559 /// if it holds a `ThrottledRequestsSpike`, `None` if the field is not set or
5560 /// holds a different branch.
5561 pub fn throttled_requests_spike(
5562 &self,
5563 ) -> std::option::Option<
5564 &std::boxed::Box<crate::model::intelligence_finding::ThrottledRequestSpike>,
5565 > {
5566 #[allow(unreachable_patterns)]
5567 self.intelligence_finding_details.as_ref().and_then(|v| match v {
5568 crate::model::intelligence_finding::IntelligenceFindingDetails::ThrottledRequestsSpike(v) => std::option::Option::Some(v),
5569 _ => std::option::Option::None,
5570 })
5571 }
5572
5573 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
5574 /// to hold a `ThrottledRequestsSpike`.
5575 ///
5576 /// Note that all the setters affecting `intelligence_finding_details` are
5577 /// mutually exclusive.
5578 ///
5579 /// # Example
5580 /// ```ignore,no_run
5581 /// # use google_cloud_storage::model::IntelligenceFinding;
5582 /// use google_cloud_storage::model::intelligence_finding::ThrottledRequestSpike;
5583 /// let x = IntelligenceFinding::new().set_throttled_requests_spike(ThrottledRequestSpike::default()/* use setters */);
5584 /// assert!(x.throttled_requests_spike().is_some());
5585 /// assert!(x.coldline_and_archival_storage_operations_spike().is_none());
5586 /// assert!(x.cross_region_egress_spike().is_none());
5587 /// assert!(x.storage_growth_above_trend().is_none());
5588 /// ```
5589 pub fn set_throttled_requests_spike<
5590 T: std::convert::Into<
5591 std::boxed::Box<crate::model::intelligence_finding::ThrottledRequestSpike>,
5592 >,
5593 >(
5594 mut self,
5595 v: T,
5596 ) -> Self {
5597 self.intelligence_finding_details = std::option::Option::Some(
5598 crate::model::intelligence_finding::IntelligenceFindingDetails::ThrottledRequestsSpike(
5599 v.into(),
5600 ),
5601 );
5602 self
5603 }
5604
5605 /// The value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
5606 /// if it holds a `CrossRegionEgressSpike`, `None` if the field is not set or
5607 /// holds a different branch.
5608 pub fn cross_region_egress_spike(
5609 &self,
5610 ) -> std::option::Option<
5611 &std::boxed::Box<crate::model::intelligence_finding::CrossRegionEgressSpike>,
5612 > {
5613 #[allow(unreachable_patterns)]
5614 self.intelligence_finding_details.as_ref().and_then(|v| match v {
5615 crate::model::intelligence_finding::IntelligenceFindingDetails::CrossRegionEgressSpike(v) => std::option::Option::Some(v),
5616 _ => std::option::Option::None,
5617 })
5618 }
5619
5620 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
5621 /// to hold a `CrossRegionEgressSpike`.
5622 ///
5623 /// Note that all the setters affecting `intelligence_finding_details` are
5624 /// mutually exclusive.
5625 ///
5626 /// # Example
5627 /// ```ignore,no_run
5628 /// # use google_cloud_storage::model::IntelligenceFinding;
5629 /// use google_cloud_storage::model::intelligence_finding::CrossRegionEgressSpike;
5630 /// let x = IntelligenceFinding::new().set_cross_region_egress_spike(CrossRegionEgressSpike::default()/* use setters */);
5631 /// assert!(x.cross_region_egress_spike().is_some());
5632 /// assert!(x.coldline_and_archival_storage_operations_spike().is_none());
5633 /// assert!(x.throttled_requests_spike().is_none());
5634 /// assert!(x.storage_growth_above_trend().is_none());
5635 /// ```
5636 pub fn set_cross_region_egress_spike<
5637 T: std::convert::Into<
5638 std::boxed::Box<crate::model::intelligence_finding::CrossRegionEgressSpike>,
5639 >,
5640 >(
5641 mut self,
5642 v: T,
5643 ) -> Self {
5644 self.intelligence_finding_details = std::option::Option::Some(
5645 crate::model::intelligence_finding::IntelligenceFindingDetails::CrossRegionEgressSpike(
5646 v.into(),
5647 ),
5648 );
5649 self
5650 }
5651
5652 /// The value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
5653 /// if it holds a `StorageGrowthAboveTrend`, `None` if the field is not set or
5654 /// holds a different branch.
5655 pub fn storage_growth_above_trend(
5656 &self,
5657 ) -> std::option::Option<
5658 &std::boxed::Box<crate::model::intelligence_finding::StorageGrowthAboveTrend>,
5659 > {
5660 #[allow(unreachable_patterns)]
5661 self.intelligence_finding_details.as_ref().and_then(|v| match v {
5662 crate::model::intelligence_finding::IntelligenceFindingDetails::StorageGrowthAboveTrend(v) => std::option::Option::Some(v),
5663 _ => std::option::Option::None,
5664 })
5665 }
5666
5667 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
5668 /// to hold a `StorageGrowthAboveTrend`.
5669 ///
5670 /// Note that all the setters affecting `intelligence_finding_details` are
5671 /// mutually exclusive.
5672 ///
5673 /// # Example
5674 /// ```ignore,no_run
5675 /// # use google_cloud_storage::model::IntelligenceFinding;
5676 /// use google_cloud_storage::model::intelligence_finding::StorageGrowthAboveTrend;
5677 /// let x = IntelligenceFinding::new().set_storage_growth_above_trend(StorageGrowthAboveTrend::default()/* use setters */);
5678 /// assert!(x.storage_growth_above_trend().is_some());
5679 /// assert!(x.coldline_and_archival_storage_operations_spike().is_none());
5680 /// assert!(x.throttled_requests_spike().is_none());
5681 /// assert!(x.cross_region_egress_spike().is_none());
5682 /// ```
5683 pub fn set_storage_growth_above_trend<
5684 T: std::convert::Into<
5685 std::boxed::Box<crate::model::intelligence_finding::StorageGrowthAboveTrend>,
5686 >,
5687 >(
5688 mut self,
5689 v: T,
5690 ) -> Self {
5691 self.intelligence_finding_details = std::option::Option::Some(
5692 crate::model::intelligence_finding::IntelligenceFindingDetails::StorageGrowthAboveTrend(
5693 v.into(),
5694 ),
5695 );
5696 self
5697 }
5698}
5699
5700impl wkt::message::Message for IntelligenceFinding {
5701 fn typename() -> &'static str {
5702 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding"
5703 }
5704}
5705
5706/// Defines additional types related to [IntelligenceFinding].
5707pub mod intelligence_finding {
5708 #[allow(unused_imports)]
5709 use super::*;
5710
5711 /// Represents a finding about a spike in Class A/B operations on Coldline
5712 /// or Archive Cloud Storage objects.
5713 /// This corresponds to the `COLD_AND_ARCHIVAL_STORAGE_OPERATIONS_SPIKE`
5714 /// finding type.
5715 #[derive(Clone, Default, PartialEq)]
5716 #[non_exhaustive]
5717 pub struct ColdlineAndArchivalStorageOperationsSpike {
5718
5719 /// Output only. The percentage increase in operations across the project.
5720 pub percentage_increase: f64,
5721
5722 /// Output only. The total count of operations across the project.
5723 pub total_operations_count: i64,
5724
5725 /// Output only. A list of the top buckets driving the increase in
5726 /// operations.
5727 pub top_buckets: std::vec::Vec<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution>,
5728
5729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5730 }
5731
5732 impl ColdlineAndArchivalStorageOperationsSpike {
5733 /// Creates a new default instance.
5734 pub fn new() -> Self {
5735 std::default::Default::default()
5736 }
5737
5738 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike::percentage_increase].
5739 ///
5740 /// # Example
5741 /// ```ignore,no_run
5742 /// # use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
5743 /// let x = ColdlineAndArchivalStorageOperationsSpike::new().set_percentage_increase(42.0);
5744 /// ```
5745 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5746 self.percentage_increase = v.into();
5747 self
5748 }
5749
5750 /// Sets the value of [total_operations_count][crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike::total_operations_count].
5751 ///
5752 /// # Example
5753 /// ```ignore,no_run
5754 /// # use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
5755 /// let x = ColdlineAndArchivalStorageOperationsSpike::new().set_total_operations_count(42);
5756 /// ```
5757 pub fn set_total_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5758 self.total_operations_count = v.into();
5759 self
5760 }
5761
5762 /// Sets the value of [top_buckets][crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike::top_buckets].
5763 ///
5764 /// # Example
5765 /// ```ignore,no_run
5766 /// # use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
5767 /// use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
5768 /// let x = ColdlineAndArchivalStorageOperationsSpike::new()
5769 /// .set_top_buckets([
5770 /// BucketContribution::default()/* use setters */,
5771 /// BucketContribution::default()/* use (different) setters */,
5772 /// ]);
5773 /// ```
5774 pub fn set_top_buckets<T, V>(mut self, v: T) -> Self
5775 where
5776 T: std::iter::IntoIterator<Item = V>,
5777 V: std::convert::Into<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution>
5778 {
5779 use std::iter::Iterator;
5780 self.top_buckets = v.into_iter().map(|i| i.into()).collect();
5781 self
5782 }
5783 }
5784
5785 impl wkt::message::Message for ColdlineAndArchivalStorageOperationsSpike {
5786 fn typename() -> &'static str {
5787 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike"
5788 }
5789 }
5790
5791 /// Defines additional types related to [ColdlineAndArchivalStorageOperationsSpike].
5792 pub mod coldline_and_archival_storage_operations_spike {
5793 #[allow(unused_imports)]
5794 use super::*;
5795
5796 /// Represents the operation spike details for a bucket.
5797 #[derive(Clone, Default, PartialEq)]
5798 #[non_exhaustive]
5799 pub struct BucketContribution {
5800
5801 /// Output only. The name of the bucket.
5802 pub bucket: std::string::String,
5803
5804 /// Output only. The percentage increase in operations for the bucket.
5805 pub percentage_increase: f64,
5806
5807 /// Output only. The total count of operations for the bucket.
5808 pub total_operations_count: i64,
5809
5810 /// The details of the bucket's contribution towards the
5811 /// `IntelligenceFinding`.
5812 pub details: std::option::Option<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details>,
5813
5814 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5815 }
5816
5817 impl BucketContribution {
5818 /// Creates a new default instance.
5819 pub fn new() -> Self {
5820 std::default::Default::default()
5821 }
5822
5823 /// Sets the value of [bucket][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::bucket].
5824 ///
5825 /// # Example
5826 /// ```ignore,no_run
5827 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
5828 /// let x = BucketContribution::new().set_bucket("example");
5829 /// ```
5830 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5831 self.bucket = v.into();
5832 self
5833 }
5834
5835 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::percentage_increase].
5836 ///
5837 /// # Example
5838 /// ```ignore,no_run
5839 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
5840 /// let x = BucketContribution::new().set_percentage_increase(42.0);
5841 /// ```
5842 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5843 self.percentage_increase = v.into();
5844 self
5845 }
5846
5847 /// Sets the value of [total_operations_count][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::total_operations_count].
5848 ///
5849 /// # Example
5850 /// ```ignore,no_run
5851 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
5852 /// let x = BucketContribution::new().set_total_operations_count(42);
5853 /// ```
5854 pub fn set_total_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5855 self.total_operations_count = v.into();
5856 self
5857 }
5858
5859 /// Sets the value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details].
5860 ///
5861 /// Note that all the setters affecting `details` are mutually
5862 /// exclusive.
5863 ///
5864 /// # Example
5865 /// ```ignore,no_run
5866 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
5867 /// use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution;
5868 /// let x = BucketContribution::new().set_details(Some(
5869 /// google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Contribution(Contribution::default().into())));
5870 /// ```
5871 pub fn set_details<T: std::convert::Into<std::option::Option<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details>>>(mut self, v: T) -> Self
5872 {
5873 self.details = v.into();
5874 self
5875 }
5876
5877 /// The value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details]
5878 /// if it holds a `Contribution`, `None` if the field is not set or
5879 /// holds a different branch.
5880 pub fn contribution(&self) -> std::option::Option<&std::boxed::Box<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution>>{
5881 #[allow(unreachable_patterns)]
5882 self.details.as_ref().and_then(|v| match v {
5883 crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Contribution(v) => std::option::Option::Some(v),
5884 _ => std::option::Option::None,
5885 })
5886 }
5887
5888 /// Sets the value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details]
5889 /// to hold a `Contribution`.
5890 ///
5891 /// Note that all the setters affecting `details` are
5892 /// mutually exclusive.
5893 ///
5894 /// # Example
5895 /// ```ignore,no_run
5896 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
5897 /// use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution;
5898 /// let x = BucketContribution::new().set_contribution(Contribution::default()/* use setters */);
5899 /// assert!(x.contribution().is_some());
5900 /// assert!(x.error().is_none());
5901 /// ```
5902 pub fn set_contribution<T: std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution>>>(mut self, v: T) -> Self{
5903 self.details = std::option::Option::Some(
5904 crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Contribution(
5905 v.into()
5906 )
5907 );
5908 self
5909 }
5910
5911 /// The value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details]
5912 /// if it holds a `Error`, `None` if the field is not set or
5913 /// holds a different branch.
5914 pub fn error(
5915 &self,
5916 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>>
5917 {
5918 #[allow(unreachable_patterns)]
5919 self.details.as_ref().and_then(|v| match v {
5920 crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Error(v) => std::option::Option::Some(v),
5921 _ => std::option::Option::None,
5922 })
5923 }
5924
5925 /// Sets the value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details]
5926 /// to hold a `Error`.
5927 ///
5928 /// Note that all the setters affecting `details` are
5929 /// mutually exclusive.
5930 ///
5931 /// # Example
5932 /// ```ignore,no_run
5933 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
5934 /// use google_cloud_rpc::model::Status;
5935 /// let x = BucketContribution::new().set_error(Status::default()/* use setters */);
5936 /// assert!(x.error().is_some());
5937 /// assert!(x.contribution().is_none());
5938 /// ```
5939 pub fn set_error<
5940 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
5941 >(
5942 mut self,
5943 v: T,
5944 ) -> Self {
5945 self.details = std::option::Option::Some(
5946 crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Error(
5947 v.into()
5948 )
5949 );
5950 self
5951 }
5952 }
5953
5954 impl wkt::message::Message for BucketContribution {
5955 fn typename() -> &'static str {
5956 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution"
5957 }
5958 }
5959
5960 /// Defines additional types related to [BucketContribution].
5961 pub mod bucket_contribution {
5962 #[allow(unused_imports)]
5963 use super::*;
5964
5965 /// Represents the contribution of the bucket towards the
5966 /// `IntelligenceFinding`.
5967 #[derive(Clone, Default, PartialEq)]
5968 #[non_exhaustive]
5969 pub struct Contribution {
5970
5971 /// Output only. A list of the top object prefixes driving the increase
5972 /// in operations.
5973 pub top_prefixes: std::vec::Vec<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution>,
5974
5975 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5976 }
5977
5978 impl Contribution {
5979 /// Creates a new default instance.
5980 pub fn new() -> Self {
5981 std::default::Default::default()
5982 }
5983
5984 /// Sets the value of [top_prefixes][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution::top_prefixes].
5985 ///
5986 /// # Example
5987 /// ```ignore,no_run
5988 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution;
5989 /// use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
5990 /// let x = Contribution::new()
5991 /// .set_top_prefixes([
5992 /// PrefixContribution::default()/* use setters */,
5993 /// PrefixContribution::default()/* use (different) setters */,
5994 /// ]);
5995 /// ```
5996 pub fn set_top_prefixes<T, V>(mut self, v: T) -> Self
5997 where
5998 T: std::iter::IntoIterator<Item = V>,
5999 V: std::convert::Into<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution>
6000 {
6001 use std::iter::Iterator;
6002 self.top_prefixes = v.into_iter().map(|i| i.into()).collect();
6003 self
6004 }
6005 }
6006
6007 impl wkt::message::Message for Contribution {
6008 fn typename() -> &'static str {
6009 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution"
6010 }
6011 }
6012
6013 /// Defines additional types related to [Contribution].
6014 pub mod contribution {
6015 #[allow(unused_imports)]
6016 use super::*;
6017
6018 /// Represents the operation spike details for an object prefix.
6019 #[derive(Clone, Default, PartialEq)]
6020 #[non_exhaustive]
6021 pub struct PrefixContribution {
6022 /// Output only. The object prefix.
6023 /// Format: `a/b/c`, 'a/b/d', etc.
6024 pub prefix: std::string::String,
6025
6026 /// Output only. The percentage increase in operations for the object
6027 /// prefix.
6028 pub percentage_increase: f64,
6029
6030 /// Output only. The total count of operations for the object prefix.
6031 pub total_operations_count: i64,
6032
6033 pub(crate) _unknown_fields:
6034 serde_json::Map<std::string::String, serde_json::Value>,
6035 }
6036
6037 impl PrefixContribution {
6038 /// Creates a new default instance.
6039 pub fn new() -> Self {
6040 std::default::Default::default()
6041 }
6042
6043 /// Sets the value of [prefix][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution::prefix].
6044 ///
6045 /// # Example
6046 /// ```ignore,no_run
6047 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
6048 /// let x = PrefixContribution::new().set_prefix("example");
6049 /// ```
6050 pub fn set_prefix<T: std::convert::Into<std::string::String>>(
6051 mut self,
6052 v: T,
6053 ) -> Self {
6054 self.prefix = v.into();
6055 self
6056 }
6057
6058 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution::percentage_increase].
6059 ///
6060 /// # Example
6061 /// ```ignore,no_run
6062 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
6063 /// let x = PrefixContribution::new().set_percentage_increase(42.0);
6064 /// ```
6065 pub fn set_percentage_increase<T: std::convert::Into<f64>>(
6066 mut self,
6067 v: T,
6068 ) -> Self {
6069 self.percentage_increase = v.into();
6070 self
6071 }
6072
6073 /// Sets the value of [total_operations_count][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution::total_operations_count].
6074 ///
6075 /// # Example
6076 /// ```ignore,no_run
6077 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
6078 /// let x = PrefixContribution::new().set_total_operations_count(42);
6079 /// ```
6080 pub fn set_total_operations_count<T: std::convert::Into<i64>>(
6081 mut self,
6082 v: T,
6083 ) -> Self {
6084 self.total_operations_count = v.into();
6085 self
6086 }
6087 }
6088
6089 impl wkt::message::Message for PrefixContribution {
6090 fn typename() -> &'static str {
6091 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution"
6092 }
6093 }
6094 }
6095
6096 /// The details of the bucket's contribution towards the
6097 /// `IntelligenceFinding`.
6098 #[derive(Clone, Debug, PartialEq)]
6099 #[non_exhaustive]
6100 pub enum Details {
6101 /// Output only. The details about the contribution of the bucket.
6102 Contribution(std::boxed::Box<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution>),
6103 /// Output only. The error related to accessing the details about the
6104 /// contribution of the bucket.
6105 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
6106 }
6107
6108 impl Details {
6109 /// Initializes the enum to the [Contribution](Self::Contribution) branch.
6110 pub fn from_contribution(
6111 value: impl std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution>>,
6112 ) -> Self {
6113 Self::Contribution(value.into())
6114 }
6115 /// Initializes the enum to the [Error](Self::Error) branch.
6116 pub fn from_error(
6117 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
6118 ) -> Self {
6119 Self::Error(value.into())
6120 }
6121 }
6122 }
6123 }
6124
6125 /// Represents a finding about a spike in cross-region egress from Cloud
6126 /// Storage.
6127 /// This corresponds to the `CROSS_REGION_EGRESS_SPIKE` finding type.
6128 #[derive(Clone, Default, PartialEq)]
6129 #[non_exhaustive]
6130 pub struct CrossRegionEgressSpike {
6131 /// Output only. The total cross-region egress volume in bytes across the
6132 /// project.
6133 pub total_egress_bytes: i64,
6134
6135 /// Output only. The percentage increase in cross-region egress across the
6136 /// project.
6137 pub percentage_increase: f64,
6138
6139 /// Output only. A list of top buckets driving the increase in cross-region
6140 /// egress.
6141 pub top_buckets: std::vec::Vec<
6142 crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution,
6143 >,
6144
6145 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6146 }
6147
6148 impl CrossRegionEgressSpike {
6149 /// Creates a new default instance.
6150 pub fn new() -> Self {
6151 std::default::Default::default()
6152 }
6153
6154 /// Sets the value of [total_egress_bytes][crate::model::intelligence_finding::CrossRegionEgressSpike::total_egress_bytes].
6155 ///
6156 /// # Example
6157 /// ```ignore,no_run
6158 /// # use google_cloud_storage::model::intelligence_finding::CrossRegionEgressSpike;
6159 /// let x = CrossRegionEgressSpike::new().set_total_egress_bytes(42);
6160 /// ```
6161 pub fn set_total_egress_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6162 self.total_egress_bytes = v.into();
6163 self
6164 }
6165
6166 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::CrossRegionEgressSpike::percentage_increase].
6167 ///
6168 /// # Example
6169 /// ```ignore,no_run
6170 /// # use google_cloud_storage::model::intelligence_finding::CrossRegionEgressSpike;
6171 /// let x = CrossRegionEgressSpike::new().set_percentage_increase(42.0);
6172 /// ```
6173 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6174 self.percentage_increase = v.into();
6175 self
6176 }
6177
6178 /// Sets the value of [top_buckets][crate::model::intelligence_finding::CrossRegionEgressSpike::top_buckets].
6179 ///
6180 /// # Example
6181 /// ```ignore,no_run
6182 /// # use google_cloud_storage::model::intelligence_finding::CrossRegionEgressSpike;
6183 /// use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
6184 /// let x = CrossRegionEgressSpike::new()
6185 /// .set_top_buckets([
6186 /// BucketContribution::default()/* use setters */,
6187 /// BucketContribution::default()/* use (different) setters */,
6188 /// ]);
6189 /// ```
6190 pub fn set_top_buckets<T, V>(mut self, v: T) -> Self
6191 where
6192 T: std::iter::IntoIterator<Item = V>,
6193 V: std::convert::Into<crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution>
6194 {
6195 use std::iter::Iterator;
6196 self.top_buckets = v.into_iter().map(|i| i.into()).collect();
6197 self
6198 }
6199 }
6200
6201 impl wkt::message::Message for CrossRegionEgressSpike {
6202 fn typename() -> &'static str {
6203 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike"
6204 }
6205 }
6206
6207 /// Defines additional types related to [CrossRegionEgressSpike].
6208 pub mod cross_region_egress_spike {
6209 #[allow(unused_imports)]
6210 use super::*;
6211
6212 /// Represents the cross-region egress spike details for a bucket.
6213 #[derive(Clone, Default, PartialEq)]
6214 #[non_exhaustive]
6215 pub struct BucketContribution {
6216
6217 /// Output only. The name of the bucket.
6218 pub bucket: std::string::String,
6219
6220 /// Output only. The total cross-region egress volume in bytes for the
6221 /// bucket.
6222 pub total_egress_bytes: i64,
6223
6224 /// Output only. The percentage increase in cross-region egress for the
6225 /// bucket.
6226 pub percentage_increase: f64,
6227
6228 /// The details of the bucket's contribution towards the
6229 /// `IntelligenceFinding`.
6230 pub details: std::option::Option<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details>,
6231
6232 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6233 }
6234
6235 impl BucketContribution {
6236 /// Creates a new default instance.
6237 pub fn new() -> Self {
6238 std::default::Default::default()
6239 }
6240
6241 /// Sets the value of [bucket][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::bucket].
6242 ///
6243 /// # Example
6244 /// ```ignore,no_run
6245 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
6246 /// let x = BucketContribution::new().set_bucket("example");
6247 /// ```
6248 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6249 self.bucket = v.into();
6250 self
6251 }
6252
6253 /// Sets the value of [total_egress_bytes][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::total_egress_bytes].
6254 ///
6255 /// # Example
6256 /// ```ignore,no_run
6257 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
6258 /// let x = BucketContribution::new().set_total_egress_bytes(42);
6259 /// ```
6260 pub fn set_total_egress_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6261 self.total_egress_bytes = v.into();
6262 self
6263 }
6264
6265 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::percentage_increase].
6266 ///
6267 /// # Example
6268 /// ```ignore,no_run
6269 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
6270 /// let x = BucketContribution::new().set_percentage_increase(42.0);
6271 /// ```
6272 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6273 self.percentage_increase = v.into();
6274 self
6275 }
6276
6277 /// Sets the value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details].
6278 ///
6279 /// Note that all the setters affecting `details` are mutually
6280 /// exclusive.
6281 ///
6282 /// # Example
6283 /// ```ignore,no_run
6284 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
6285 /// use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution;
6286 /// let x = BucketContribution::new().set_details(Some(
6287 /// google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Contribution(Contribution::default().into())));
6288 /// ```
6289 pub fn set_details<T: std::convert::Into<std::option::Option<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details>>>(mut self, v: T) -> Self
6290 {
6291 self.details = v.into();
6292 self
6293 }
6294
6295 /// The value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details]
6296 /// if it holds a `Contribution`, `None` if the field is not set or
6297 /// holds a different branch.
6298 pub fn contribution(&self) -> std::option::Option<&std::boxed::Box<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution>>{
6299 #[allow(unreachable_patterns)]
6300 self.details.as_ref().and_then(|v| match v {
6301 crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Contribution(v) => std::option::Option::Some(v),
6302 _ => std::option::Option::None,
6303 })
6304 }
6305
6306 /// Sets the value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details]
6307 /// to hold a `Contribution`.
6308 ///
6309 /// Note that all the setters affecting `details` are
6310 /// mutually exclusive.
6311 ///
6312 /// # Example
6313 /// ```ignore,no_run
6314 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
6315 /// use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution;
6316 /// let x = BucketContribution::new().set_contribution(Contribution::default()/* use setters */);
6317 /// assert!(x.contribution().is_some());
6318 /// assert!(x.error().is_none());
6319 /// ```
6320 pub fn set_contribution<T: std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution>>>(mut self, v: T) -> Self{
6321 self.details = std::option::Option::Some(
6322 crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Contribution(
6323 v.into()
6324 )
6325 );
6326 self
6327 }
6328
6329 /// The value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details]
6330 /// if it holds a `Error`, `None` if the field is not set or
6331 /// holds a different branch.
6332 pub fn error(
6333 &self,
6334 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>>
6335 {
6336 #[allow(unreachable_patterns)]
6337 self.details.as_ref().and_then(|v| match v {
6338 crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Error(v) => std::option::Option::Some(v),
6339 _ => std::option::Option::None,
6340 })
6341 }
6342
6343 /// Sets the value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details]
6344 /// to hold a `Error`.
6345 ///
6346 /// Note that all the setters affecting `details` are
6347 /// mutually exclusive.
6348 ///
6349 /// # Example
6350 /// ```ignore,no_run
6351 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
6352 /// use google_cloud_rpc::model::Status;
6353 /// let x = BucketContribution::new().set_error(Status::default()/* use setters */);
6354 /// assert!(x.error().is_some());
6355 /// assert!(x.contribution().is_none());
6356 /// ```
6357 pub fn set_error<
6358 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
6359 >(
6360 mut self,
6361 v: T,
6362 ) -> Self {
6363 self.details = std::option::Option::Some(
6364 crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Error(
6365 v.into()
6366 )
6367 );
6368 self
6369 }
6370 }
6371
6372 impl wkt::message::Message for BucketContribution {
6373 fn typename() -> &'static str {
6374 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution"
6375 }
6376 }
6377
6378 /// Defines additional types related to [BucketContribution].
6379 pub mod bucket_contribution {
6380 #[allow(unused_imports)]
6381 use super::*;
6382
6383 /// Represents the contribution of the bucket towards the
6384 /// `IntelligenceFinding`.
6385 #[derive(Clone, Default, PartialEq)]
6386 #[non_exhaustive]
6387 pub struct Contribution {
6388
6389 /// Output only. A list of the top object prefixes driving the increase
6390 /// in cross-region egress.
6391 pub top_prefixes: std::vec::Vec<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution>,
6392
6393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6394 }
6395
6396 impl Contribution {
6397 /// Creates a new default instance.
6398 pub fn new() -> Self {
6399 std::default::Default::default()
6400 }
6401
6402 /// Sets the value of [top_prefixes][crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution::top_prefixes].
6403 ///
6404 /// # Example
6405 /// ```ignore,no_run
6406 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution;
6407 /// use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
6408 /// let x = Contribution::new()
6409 /// .set_top_prefixes([
6410 /// PrefixContribution::default()/* use setters */,
6411 /// PrefixContribution::default()/* use (different) setters */,
6412 /// ]);
6413 /// ```
6414 pub fn set_top_prefixes<T, V>(mut self, v: T) -> Self
6415 where
6416 T: std::iter::IntoIterator<Item = V>,
6417 V: std::convert::Into<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution>
6418 {
6419 use std::iter::Iterator;
6420 self.top_prefixes = v.into_iter().map(|i| i.into()).collect();
6421 self
6422 }
6423 }
6424
6425 impl wkt::message::Message for Contribution {
6426 fn typename() -> &'static str {
6427 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution"
6428 }
6429 }
6430
6431 /// Defines additional types related to [Contribution].
6432 pub mod contribution {
6433 #[allow(unused_imports)]
6434 use super::*;
6435
6436 /// Represents the cross-region egress spike details for an object
6437 /// prefix.
6438 #[derive(Clone, Default, PartialEq)]
6439 #[non_exhaustive]
6440 pub struct PrefixContribution {
6441 /// Output only. The object prefix.
6442 /// Format: `a/b/c`, 'a/b/d', etc.
6443 pub prefix: std::string::String,
6444
6445 /// Output only. The total cross-region egress volume in bytes from the
6446 /// object prefix.
6447 pub total_egress_bytes: i64,
6448
6449 /// Output only. The percentage increase in cross-region egress for the
6450 /// object prefix.
6451 pub percentage_increase: f64,
6452
6453 pub(crate) _unknown_fields:
6454 serde_json::Map<std::string::String, serde_json::Value>,
6455 }
6456
6457 impl PrefixContribution {
6458 /// Creates a new default instance.
6459 pub fn new() -> Self {
6460 std::default::Default::default()
6461 }
6462
6463 /// Sets the value of [prefix][crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution::prefix].
6464 ///
6465 /// # Example
6466 /// ```ignore,no_run
6467 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
6468 /// let x = PrefixContribution::new().set_prefix("example");
6469 /// ```
6470 pub fn set_prefix<T: std::convert::Into<std::string::String>>(
6471 mut self,
6472 v: T,
6473 ) -> Self {
6474 self.prefix = v.into();
6475 self
6476 }
6477
6478 /// Sets the value of [total_egress_bytes][crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution::total_egress_bytes].
6479 ///
6480 /// # Example
6481 /// ```ignore,no_run
6482 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
6483 /// let x = PrefixContribution::new().set_total_egress_bytes(42);
6484 /// ```
6485 pub fn set_total_egress_bytes<T: std::convert::Into<i64>>(
6486 mut self,
6487 v: T,
6488 ) -> Self {
6489 self.total_egress_bytes = v.into();
6490 self
6491 }
6492
6493 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution::percentage_increase].
6494 ///
6495 /// # Example
6496 /// ```ignore,no_run
6497 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
6498 /// let x = PrefixContribution::new().set_percentage_increase(42.0);
6499 /// ```
6500 pub fn set_percentage_increase<T: std::convert::Into<f64>>(
6501 mut self,
6502 v: T,
6503 ) -> Self {
6504 self.percentage_increase = v.into();
6505 self
6506 }
6507 }
6508
6509 impl wkt::message::Message for PrefixContribution {
6510 fn typename() -> &'static str {
6511 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution"
6512 }
6513 }
6514 }
6515
6516 /// The details of the bucket's contribution towards the
6517 /// `IntelligenceFinding`.
6518 #[derive(Clone, Debug, PartialEq)]
6519 #[non_exhaustive]
6520 pub enum Details {
6521 /// Output only. The details about the contribution of the bucket.
6522 Contribution(std::boxed::Box<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution>),
6523 /// Output only. The error related to accessing the details about the
6524 /// contribution of the bucket.
6525 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
6526 }
6527
6528 impl Details {
6529 /// Initializes the enum to the [Contribution](Self::Contribution) branch.
6530 pub fn from_contribution(
6531 value: impl std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution>>,
6532 ) -> Self {
6533 Self::Contribution(value.into())
6534 }
6535 /// Initializes the enum to the [Error](Self::Error) branch.
6536 pub fn from_error(
6537 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
6538 ) -> Self {
6539 Self::Error(value.into())
6540 }
6541 }
6542 }
6543 }
6544
6545 /// Represents a finding about a spike in throttled requests (429 errors)
6546 /// within a project.
6547 /// This corresponds to the `THROTTLED_REQUEST_SPIKE` finding type.
6548 #[derive(Clone, Default, PartialEq)]
6549 #[non_exhaustive]
6550 pub struct ThrottledRequestSpike {
6551 /// Output only. The count of throttled requests across the project.
6552 pub throttled_requests: i64,
6553
6554 /// Output only. The percentage increase in throttled requests across the
6555 /// project.
6556 pub percentage_increase: f64,
6557
6558 /// Output only. A list of top buckets driving the increase in throttled
6559 /// requests.
6560 pub top_buckets: std::vec::Vec<
6561 crate::model::intelligence_finding::throttled_request_spike::BucketContribution,
6562 >,
6563
6564 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6565 }
6566
6567 impl ThrottledRequestSpike {
6568 /// Creates a new default instance.
6569 pub fn new() -> Self {
6570 std::default::Default::default()
6571 }
6572
6573 /// Sets the value of [throttled_requests][crate::model::intelligence_finding::ThrottledRequestSpike::throttled_requests].
6574 ///
6575 /// # Example
6576 /// ```ignore,no_run
6577 /// # use google_cloud_storage::model::intelligence_finding::ThrottledRequestSpike;
6578 /// let x = ThrottledRequestSpike::new().set_throttled_requests(42);
6579 /// ```
6580 pub fn set_throttled_requests<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6581 self.throttled_requests = v.into();
6582 self
6583 }
6584
6585 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::ThrottledRequestSpike::percentage_increase].
6586 ///
6587 /// # Example
6588 /// ```ignore,no_run
6589 /// # use google_cloud_storage::model::intelligence_finding::ThrottledRequestSpike;
6590 /// let x = ThrottledRequestSpike::new().set_percentage_increase(42.0);
6591 /// ```
6592 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6593 self.percentage_increase = v.into();
6594 self
6595 }
6596
6597 /// Sets the value of [top_buckets][crate::model::intelligence_finding::ThrottledRequestSpike::top_buckets].
6598 ///
6599 /// # Example
6600 /// ```ignore,no_run
6601 /// # use google_cloud_storage::model::intelligence_finding::ThrottledRequestSpike;
6602 /// use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
6603 /// let x = ThrottledRequestSpike::new()
6604 /// .set_top_buckets([
6605 /// BucketContribution::default()/* use setters */,
6606 /// BucketContribution::default()/* use (different) setters */,
6607 /// ]);
6608 /// ```
6609 pub fn set_top_buckets<T, V>(mut self, v: T) -> Self
6610 where
6611 T: std::iter::IntoIterator<Item = V>,
6612 V: std::convert::Into<
6613 crate::model::intelligence_finding::throttled_request_spike::BucketContribution,
6614 >,
6615 {
6616 use std::iter::Iterator;
6617 self.top_buckets = v.into_iter().map(|i| i.into()).collect();
6618 self
6619 }
6620 }
6621
6622 impl wkt::message::Message for ThrottledRequestSpike {
6623 fn typename() -> &'static str {
6624 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike"
6625 }
6626 }
6627
6628 /// Defines additional types related to [ThrottledRequestSpike].
6629 pub mod throttled_request_spike {
6630 #[allow(unused_imports)]
6631 use super::*;
6632
6633 /// Represents the throttled requests details for a bucket.
6634 #[derive(Clone, Default, PartialEq)]
6635 #[non_exhaustive]
6636 pub struct BucketContribution {
6637
6638 /// Output only. The name of the bucket.
6639 pub bucket: std::string::String,
6640
6641 /// Output only. The count of throttled requests for the bucket.
6642 pub throttled_requests: i64,
6643
6644 /// Output only. The percentage increase in throttled requests for the
6645 /// bucket.
6646 pub percentage_increase: f64,
6647
6648 /// The details of the bucket's contribution towards the
6649 /// `IntelligenceFinding`.
6650 pub details: std::option::Option<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details>,
6651
6652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6653 }
6654
6655 impl BucketContribution {
6656 /// Creates a new default instance.
6657 pub fn new() -> Self {
6658 std::default::Default::default()
6659 }
6660
6661 /// Sets the value of [bucket][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::bucket].
6662 ///
6663 /// # Example
6664 /// ```ignore,no_run
6665 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
6666 /// let x = BucketContribution::new().set_bucket("example");
6667 /// ```
6668 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6669 self.bucket = v.into();
6670 self
6671 }
6672
6673 /// Sets the value of [throttled_requests][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::throttled_requests].
6674 ///
6675 /// # Example
6676 /// ```ignore,no_run
6677 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
6678 /// let x = BucketContribution::new().set_throttled_requests(42);
6679 /// ```
6680 pub fn set_throttled_requests<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6681 self.throttled_requests = v.into();
6682 self
6683 }
6684
6685 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::percentage_increase].
6686 ///
6687 /// # Example
6688 /// ```ignore,no_run
6689 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
6690 /// let x = BucketContribution::new().set_percentage_increase(42.0);
6691 /// ```
6692 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6693 self.percentage_increase = v.into();
6694 self
6695 }
6696
6697 /// Sets the value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details].
6698 ///
6699 /// Note that all the setters affecting `details` are mutually
6700 /// exclusive.
6701 ///
6702 /// # Example
6703 /// ```ignore,no_run
6704 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
6705 /// use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution;
6706 /// let x = BucketContribution::new().set_details(Some(
6707 /// google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Contribution(Contribution::default().into())));
6708 /// ```
6709 pub fn set_details<T: std::convert::Into<std::option::Option<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details>>>(mut self, v: T) -> Self
6710 {
6711 self.details = v.into();
6712 self
6713 }
6714
6715 /// The value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details]
6716 /// if it holds a `Contribution`, `None` if the field is not set or
6717 /// holds a different branch.
6718 pub fn contribution(&self) -> std::option::Option<&std::boxed::Box<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution>>{
6719 #[allow(unreachable_patterns)]
6720 self.details.as_ref().and_then(|v| match v {
6721 crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Contribution(v) => std::option::Option::Some(v),
6722 _ => std::option::Option::None,
6723 })
6724 }
6725
6726 /// Sets the value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details]
6727 /// to hold a `Contribution`.
6728 ///
6729 /// Note that all the setters affecting `details` are
6730 /// mutually exclusive.
6731 ///
6732 /// # Example
6733 /// ```ignore,no_run
6734 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
6735 /// use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution;
6736 /// let x = BucketContribution::new().set_contribution(Contribution::default()/* use setters */);
6737 /// assert!(x.contribution().is_some());
6738 /// assert!(x.error().is_none());
6739 /// ```
6740 pub fn set_contribution<T: std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution>>>(mut self, v: T) -> Self{
6741 self.details = std::option::Option::Some(
6742 crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Contribution(
6743 v.into()
6744 )
6745 );
6746 self
6747 }
6748
6749 /// The value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details]
6750 /// if it holds a `Error`, `None` if the field is not set or
6751 /// holds a different branch.
6752 pub fn error(
6753 &self,
6754 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>>
6755 {
6756 #[allow(unreachable_patterns)]
6757 self.details.as_ref().and_then(|v| match v {
6758 crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Error(v) => std::option::Option::Some(v),
6759 _ => std::option::Option::None,
6760 })
6761 }
6762
6763 /// Sets the value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details]
6764 /// to hold a `Error`.
6765 ///
6766 /// Note that all the setters affecting `details` are
6767 /// mutually exclusive.
6768 ///
6769 /// # Example
6770 /// ```ignore,no_run
6771 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
6772 /// use google_cloud_rpc::model::Status;
6773 /// let x = BucketContribution::new().set_error(Status::default()/* use setters */);
6774 /// assert!(x.error().is_some());
6775 /// assert!(x.contribution().is_none());
6776 /// ```
6777 pub fn set_error<
6778 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
6779 >(
6780 mut self,
6781 v: T,
6782 ) -> Self {
6783 self.details = std::option::Option::Some(
6784 crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Error(
6785 v.into()
6786 )
6787 );
6788 self
6789 }
6790 }
6791
6792 impl wkt::message::Message for BucketContribution {
6793 fn typename() -> &'static str {
6794 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution"
6795 }
6796 }
6797
6798 /// Defines additional types related to [BucketContribution].
6799 pub mod bucket_contribution {
6800 #[allow(unused_imports)]
6801 use super::*;
6802
6803 /// Represents the contribution of the bucket towards the
6804 /// `IntelligenceFinding`.
6805 #[derive(Clone, Default, PartialEq)]
6806 #[non_exhaustive]
6807 pub struct Contribution {
6808
6809 /// Output only. A list of top object prefixes driving the increase in
6810 /// throttled requests.
6811 pub top_prefixes: std::vec::Vec<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution>,
6812
6813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6814 }
6815
6816 impl Contribution {
6817 /// Creates a new default instance.
6818 pub fn new() -> Self {
6819 std::default::Default::default()
6820 }
6821
6822 /// Sets the value of [top_prefixes][crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution::top_prefixes].
6823 ///
6824 /// # Example
6825 /// ```ignore,no_run
6826 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution;
6827 /// use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
6828 /// let x = Contribution::new()
6829 /// .set_top_prefixes([
6830 /// PrefixContribution::default()/* use setters */,
6831 /// PrefixContribution::default()/* use (different) setters */,
6832 /// ]);
6833 /// ```
6834 pub fn set_top_prefixes<T, V>(mut self, v: T) -> Self
6835 where
6836 T: std::iter::IntoIterator<Item = V>,
6837 V: std::convert::Into<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution>
6838 {
6839 use std::iter::Iterator;
6840 self.top_prefixes = v.into_iter().map(|i| i.into()).collect();
6841 self
6842 }
6843 }
6844
6845 impl wkt::message::Message for Contribution {
6846 fn typename() -> &'static str {
6847 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution"
6848 }
6849 }
6850
6851 /// Defines additional types related to [Contribution].
6852 pub mod contribution {
6853 #[allow(unused_imports)]
6854 use super::*;
6855
6856 /// Represents throttled requests details for an object prefix.
6857 #[derive(Clone, Default, PartialEq)]
6858 #[non_exhaustive]
6859 pub struct PrefixContribution {
6860 /// Output only. The object prefix.
6861 /// Format: `a/b/c`, 'a/b/d', etc.
6862 pub prefix: std::string::String,
6863
6864 /// Output only. The count of throttled requests for the object prefix.
6865 pub throttled_requests: i64,
6866
6867 /// Output only. The percentage increase in throttled requests for the
6868 /// object prefix.
6869 pub percentage_increase: f64,
6870
6871 pub(crate) _unknown_fields:
6872 serde_json::Map<std::string::String, serde_json::Value>,
6873 }
6874
6875 impl PrefixContribution {
6876 /// Creates a new default instance.
6877 pub fn new() -> Self {
6878 std::default::Default::default()
6879 }
6880
6881 /// Sets the value of [prefix][crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution::prefix].
6882 ///
6883 /// # Example
6884 /// ```ignore,no_run
6885 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
6886 /// let x = PrefixContribution::new().set_prefix("example");
6887 /// ```
6888 pub fn set_prefix<T: std::convert::Into<std::string::String>>(
6889 mut self,
6890 v: T,
6891 ) -> Self {
6892 self.prefix = v.into();
6893 self
6894 }
6895
6896 /// Sets the value of [throttled_requests][crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution::throttled_requests].
6897 ///
6898 /// # Example
6899 /// ```ignore,no_run
6900 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
6901 /// let x = PrefixContribution::new().set_throttled_requests(42);
6902 /// ```
6903 pub fn set_throttled_requests<T: std::convert::Into<i64>>(
6904 mut self,
6905 v: T,
6906 ) -> Self {
6907 self.throttled_requests = v.into();
6908 self
6909 }
6910
6911 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution::percentage_increase].
6912 ///
6913 /// # Example
6914 /// ```ignore,no_run
6915 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
6916 /// let x = PrefixContribution::new().set_percentage_increase(42.0);
6917 /// ```
6918 pub fn set_percentage_increase<T: std::convert::Into<f64>>(
6919 mut self,
6920 v: T,
6921 ) -> Self {
6922 self.percentage_increase = v.into();
6923 self
6924 }
6925 }
6926
6927 impl wkt::message::Message for PrefixContribution {
6928 fn typename() -> &'static str {
6929 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution"
6930 }
6931 }
6932 }
6933
6934 /// The details of the bucket's contribution towards the
6935 /// `IntelligenceFinding`.
6936 #[derive(Clone, Debug, PartialEq)]
6937 #[non_exhaustive]
6938 pub enum Details {
6939 /// Output only. The details about the contribution of the bucket.
6940 Contribution(std::boxed::Box<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution>),
6941 /// Output only. The error related to accessing the details about the
6942 /// contribution of the bucket.
6943 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
6944 }
6945
6946 impl Details {
6947 /// Initializes the enum to the [Contribution](Self::Contribution) branch.
6948 pub fn from_contribution(
6949 value: impl std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution>>,
6950 ) -> Self {
6951 Self::Contribution(value.into())
6952 }
6953 /// Initializes the enum to the [Error](Self::Error) branch.
6954 pub fn from_error(
6955 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
6956 ) -> Self {
6957 Self::Error(value.into())
6958 }
6959 }
6960 }
6961 }
6962
6963 /// Represents a finding about a storage growth above the expected trend.
6964 /// This corresponds to the `STORAGE_GROWTH_ABOVE_TREND` finding type.
6965 #[derive(Clone, Default, PartialEq)]
6966 #[non_exhaustive]
6967 pub struct StorageGrowthAboveTrend {
6968 /// Output only. The total storage growth in bytes.
6969 pub total_storage_growth_bytes: i64,
6970
6971 /// Output only. The percentage increase in storage growth.
6972 pub percentage_increase: f64,
6973
6974 /// Output only. A list of top buckets driving the increase in storage
6975 /// growth.
6976 pub top_buckets: std::vec::Vec<
6977 crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution,
6978 >,
6979
6980 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6981 }
6982
6983 impl StorageGrowthAboveTrend {
6984 /// Creates a new default instance.
6985 pub fn new() -> Self {
6986 std::default::Default::default()
6987 }
6988
6989 /// Sets the value of [total_storage_growth_bytes][crate::model::intelligence_finding::StorageGrowthAboveTrend::total_storage_growth_bytes].
6990 ///
6991 /// # Example
6992 /// ```ignore,no_run
6993 /// # use google_cloud_storage::model::intelligence_finding::StorageGrowthAboveTrend;
6994 /// let x = StorageGrowthAboveTrend::new().set_total_storage_growth_bytes(42);
6995 /// ```
6996 pub fn set_total_storage_growth_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6997 self.total_storage_growth_bytes = v.into();
6998 self
6999 }
7000
7001 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::StorageGrowthAboveTrend::percentage_increase].
7002 ///
7003 /// # Example
7004 /// ```ignore,no_run
7005 /// # use google_cloud_storage::model::intelligence_finding::StorageGrowthAboveTrend;
7006 /// let x = StorageGrowthAboveTrend::new().set_percentage_increase(42.0);
7007 /// ```
7008 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7009 self.percentage_increase = v.into();
7010 self
7011 }
7012
7013 /// Sets the value of [top_buckets][crate::model::intelligence_finding::StorageGrowthAboveTrend::top_buckets].
7014 ///
7015 /// # Example
7016 /// ```ignore,no_run
7017 /// # use google_cloud_storage::model::intelligence_finding::StorageGrowthAboveTrend;
7018 /// use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
7019 /// let x = StorageGrowthAboveTrend::new()
7020 /// .set_top_buckets([
7021 /// BucketContribution::default()/* use setters */,
7022 /// BucketContribution::default()/* use (different) setters */,
7023 /// ]);
7024 /// ```
7025 pub fn set_top_buckets<T, V>(mut self, v: T) -> Self
7026 where
7027 T: std::iter::IntoIterator<Item = V>,
7028 V: std::convert::Into<crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution>
7029 {
7030 use std::iter::Iterator;
7031 self.top_buckets = v.into_iter().map(|i| i.into()).collect();
7032 self
7033 }
7034 }
7035
7036 impl wkt::message::Message for StorageGrowthAboveTrend {
7037 fn typename() -> &'static str {
7038 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend"
7039 }
7040 }
7041
7042 /// Defines additional types related to [StorageGrowthAboveTrend].
7043 pub mod storage_growth_above_trend {
7044 #[allow(unused_imports)]
7045 use super::*;
7046
7047 /// Represents the storage growth details for a bucket.
7048 #[derive(Clone, Default, PartialEq)]
7049 #[non_exhaustive]
7050 pub struct BucketContribution {
7051
7052 /// Output only. The name of the bucket.
7053 pub bucket: std::string::String,
7054
7055 /// Output only. The total storage growth in bytes for the bucket.
7056 pub total_storage_growth_bytes: i64,
7057
7058 /// Output only. The percentage increase in storage growth for the bucket.
7059 pub percentage_increase: f64,
7060
7061 /// The details of the bucket's contribution towards the
7062 /// `IntelligenceFinding`.
7063 pub details: std::option::Option<crate::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details>,
7064
7065 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7066 }
7067
7068 impl BucketContribution {
7069 /// Creates a new default instance.
7070 pub fn new() -> Self {
7071 std::default::Default::default()
7072 }
7073
7074 /// Sets the value of [bucket][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::bucket].
7075 ///
7076 /// # Example
7077 /// ```ignore,no_run
7078 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
7079 /// let x = BucketContribution::new().set_bucket("example");
7080 /// ```
7081 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7082 self.bucket = v.into();
7083 self
7084 }
7085
7086 /// Sets the value of [total_storage_growth_bytes][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::total_storage_growth_bytes].
7087 ///
7088 /// # Example
7089 /// ```ignore,no_run
7090 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
7091 /// let x = BucketContribution::new().set_total_storage_growth_bytes(42);
7092 /// ```
7093 pub fn set_total_storage_growth_bytes<T: std::convert::Into<i64>>(
7094 mut self,
7095 v: T,
7096 ) -> Self {
7097 self.total_storage_growth_bytes = v.into();
7098 self
7099 }
7100
7101 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::percentage_increase].
7102 ///
7103 /// # Example
7104 /// ```ignore,no_run
7105 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
7106 /// let x = BucketContribution::new().set_percentage_increase(42.0);
7107 /// ```
7108 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7109 self.percentage_increase = v.into();
7110 self
7111 }
7112
7113 /// Sets the value of [details][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::details].
7114 ///
7115 /// Note that all the setters affecting `details` are mutually
7116 /// exclusive.
7117 ///
7118 /// # Example
7119 /// ```ignore,no_run
7120 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
7121 /// use google_cloud_rpc::model::Status;
7122 /// let x = BucketContribution::new().set_details(Some(
7123 /// google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details::Error(Status::default().into())));
7124 /// ```
7125 pub fn set_details<T: std::convert::Into<std::option::Option<crate::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details>>>(mut self, v: T) -> Self
7126 {
7127 self.details = v.into();
7128 self
7129 }
7130
7131 /// The value of [details][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::details]
7132 /// if it holds a `Error`, `None` if the field is not set or
7133 /// holds a different branch.
7134 pub fn error(
7135 &self,
7136 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>>
7137 {
7138 #[allow(unreachable_patterns)]
7139 self.details.as_ref().and_then(|v| match v {
7140 crate::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details::Error(v) => std::option::Option::Some(v),
7141 _ => std::option::Option::None,
7142 })
7143 }
7144
7145 /// Sets the value of [details][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::details]
7146 /// to hold a `Error`.
7147 ///
7148 /// Note that all the setters affecting `details` are
7149 /// mutually exclusive.
7150 ///
7151 /// # Example
7152 /// ```ignore,no_run
7153 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
7154 /// use google_cloud_rpc::model::Status;
7155 /// let x = BucketContribution::new().set_error(Status::default()/* use setters */);
7156 /// assert!(x.error().is_some());
7157 /// ```
7158 pub fn set_error<
7159 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
7160 >(
7161 mut self,
7162 v: T,
7163 ) -> Self {
7164 self.details = std::option::Option::Some(
7165 crate::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details::Error(
7166 v.into()
7167 )
7168 );
7169 self
7170 }
7171 }
7172
7173 impl wkt::message::Message for BucketContribution {
7174 fn typename() -> &'static str {
7175 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution"
7176 }
7177 }
7178
7179 /// Defines additional types related to [BucketContribution].
7180 pub mod bucket_contribution {
7181 #[allow(unused_imports)]
7182 use super::*;
7183
7184 /// The details of the bucket's contribution towards the
7185 /// `IntelligenceFinding`.
7186 #[derive(Clone, Debug, PartialEq)]
7187 #[non_exhaustive]
7188 pub enum Details {
7189 /// Output only. The error related to accessing the details about the
7190 /// contribution of the bucket.
7191 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
7192 }
7193
7194 impl Details {
7195 /// Initializes the enum to the [Error](Self::Error) branch.
7196 pub fn from_error(
7197 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
7198 ) -> Self {
7199 Self::Error(value.into())
7200 }
7201 }
7202 }
7203 }
7204
7205 /// The specific details of the `IntelligenceFinding`.
7206 #[derive(Clone, Debug, PartialEq)]
7207 #[non_exhaustive]
7208 pub enum IntelligenceFindingDetails {
7209 /// Output only. `IntelligenceFinding` about a spike in Class A/B operations
7210 /// on Coldline or Archive Cloud Storage objects.
7211 ColdlineAndArchivalStorageOperationsSpike(
7212 std::boxed::Box<
7213 crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike,
7214 >,
7215 ),
7216 /// Output only. `IntelligenceFinding` about a spike in throttled requests
7217 /// (429 errors) within a project.
7218 ThrottledRequestsSpike(
7219 std::boxed::Box<crate::model::intelligence_finding::ThrottledRequestSpike>,
7220 ),
7221 /// Output only. `IntelligenceFinding` about a spike in cross-region egress.
7222 CrossRegionEgressSpike(
7223 std::boxed::Box<crate::model::intelligence_finding::CrossRegionEgressSpike>,
7224 ),
7225 /// Output only. `IntelligenceFinding` about growth in storage above the
7226 /// expected trend.
7227 StorageGrowthAboveTrend(
7228 std::boxed::Box<crate::model::intelligence_finding::StorageGrowthAboveTrend>,
7229 ),
7230 }
7231
7232 impl IntelligenceFindingDetails {
7233 /// Initializes the enum to the [ColdlineAndArchivalStorageOperationsSpike](Self::ColdlineAndArchivalStorageOperationsSpike) branch.
7234 pub fn from_coldline_and_archival_storage_operations_spike(
7235 value: impl std::convert::Into<
7236 std::boxed::Box<
7237 crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike,
7238 >,
7239 >,
7240 ) -> Self {
7241 Self::ColdlineAndArchivalStorageOperationsSpike(value.into())
7242 }
7243 /// Initializes the enum to the [ThrottledRequestsSpike](Self::ThrottledRequestsSpike) branch.
7244 pub fn from_throttled_requests_spike(
7245 value: impl std::convert::Into<
7246 std::boxed::Box<crate::model::intelligence_finding::ThrottledRequestSpike>,
7247 >,
7248 ) -> Self {
7249 Self::ThrottledRequestsSpike(value.into())
7250 }
7251 /// Initializes the enum to the [CrossRegionEgressSpike](Self::CrossRegionEgressSpike) branch.
7252 pub fn from_cross_region_egress_spike(
7253 value: impl std::convert::Into<
7254 std::boxed::Box<crate::model::intelligence_finding::CrossRegionEgressSpike>,
7255 >,
7256 ) -> Self {
7257 Self::CrossRegionEgressSpike(value.into())
7258 }
7259 /// Initializes the enum to the [StorageGrowthAboveTrend](Self::StorageGrowthAboveTrend) branch.
7260 pub fn from_storage_growth_above_trend(
7261 value: impl std::convert::Into<
7262 std::boxed::Box<crate::model::intelligence_finding::StorageGrowthAboveTrend>,
7263 >,
7264 ) -> Self {
7265 Self::StorageGrowthAboveTrend(value.into())
7266 }
7267 }
7268}
7269
7270/// An `IntelligenceFindingRevision` represents a specific revision of an
7271/// `IntelligenceFinding` resource.
7272#[derive(Clone, Default, PartialEq)]
7273#[non_exhaustive]
7274pub struct IntelligenceFindingRevision {
7275 /// Identifier. The resource name of `IntelligenceFindingRevision`.
7276 /// Format:
7277 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}/revisions/{revision}`
7278 pub name: std::string::String,
7279
7280 /// Output only. The snapshot of the `IntelligenceFinding` at the time the
7281 /// revision was created. This field contains the full finding details as they
7282 /// existed for the revision.
7283 pub snapshot: std::option::Option<crate::model::IntelligenceFinding>,
7284
7285 /// Output only. The timestamp when the revision was created.
7286 pub create_time: std::option::Option<wkt::Timestamp>,
7287
7288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7289}
7290
7291impl IntelligenceFindingRevision {
7292 /// Creates a new default instance.
7293 pub fn new() -> Self {
7294 std::default::Default::default()
7295 }
7296
7297 /// Sets the value of [name][crate::model::IntelligenceFindingRevision::name].
7298 ///
7299 /// # Example
7300 /// ```ignore,no_run
7301 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
7302 /// # let project_id = "project_id";
7303 /// # let location_id = "location_id";
7304 /// # let intelligence_finding_id = "intelligence_finding_id";
7305 /// # let revision_id = "revision_id";
7306 /// let x = IntelligenceFindingRevision::new().set_name(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}/revisions/{revision_id}"));
7307 /// ```
7308 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7309 self.name = v.into();
7310 self
7311 }
7312
7313 /// Sets the value of [snapshot][crate::model::IntelligenceFindingRevision::snapshot].
7314 ///
7315 /// # Example
7316 /// ```ignore,no_run
7317 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
7318 /// use google_cloud_storage::model::IntelligenceFinding;
7319 /// let x = IntelligenceFindingRevision::new().set_snapshot(IntelligenceFinding::default()/* use setters */);
7320 /// ```
7321 pub fn set_snapshot<T>(mut self, v: T) -> Self
7322 where
7323 T: std::convert::Into<crate::model::IntelligenceFinding>,
7324 {
7325 self.snapshot = std::option::Option::Some(v.into());
7326 self
7327 }
7328
7329 /// Sets or clears the value of [snapshot][crate::model::IntelligenceFindingRevision::snapshot].
7330 ///
7331 /// # Example
7332 /// ```ignore,no_run
7333 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
7334 /// use google_cloud_storage::model::IntelligenceFinding;
7335 /// let x = IntelligenceFindingRevision::new().set_or_clear_snapshot(Some(IntelligenceFinding::default()/* use setters */));
7336 /// let x = IntelligenceFindingRevision::new().set_or_clear_snapshot(None::<IntelligenceFinding>);
7337 /// ```
7338 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
7339 where
7340 T: std::convert::Into<crate::model::IntelligenceFinding>,
7341 {
7342 self.snapshot = v.map(|x| x.into());
7343 self
7344 }
7345
7346 /// Sets the value of [create_time][crate::model::IntelligenceFindingRevision::create_time].
7347 ///
7348 /// # Example
7349 /// ```ignore,no_run
7350 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
7351 /// use wkt::Timestamp;
7352 /// let x = IntelligenceFindingRevision::new().set_create_time(Timestamp::default()/* use setters */);
7353 /// ```
7354 pub fn set_create_time<T>(mut self, v: T) -> Self
7355 where
7356 T: std::convert::Into<wkt::Timestamp>,
7357 {
7358 self.create_time = std::option::Option::Some(v.into());
7359 self
7360 }
7361
7362 /// Sets or clears the value of [create_time][crate::model::IntelligenceFindingRevision::create_time].
7363 ///
7364 /// # Example
7365 /// ```ignore,no_run
7366 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
7367 /// use wkt::Timestamp;
7368 /// let x = IntelligenceFindingRevision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7369 /// let x = IntelligenceFindingRevision::new().set_or_clear_create_time(None::<Timestamp>);
7370 /// ```
7371 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7372 where
7373 T: std::convert::Into<wkt::Timestamp>,
7374 {
7375 self.create_time = v.map(|x| x.into());
7376 self
7377 }
7378}
7379
7380impl wkt::message::Message for IntelligenceFindingRevision {
7381 fn typename() -> &'static str {
7382 "type.googleapis.com/google.storage.control.v2.IntelligenceFindingRevision"
7383 }
7384}
7385
7386/// Request message to get the `IntelligenceFinding` resource associated with a
7387/// project.
7388#[derive(Clone, Default, PartialEq)]
7389#[non_exhaustive]
7390pub struct GetIntelligenceFindingRequest {
7391 /// Required. The name of the `IntelligenceFinding` resource.
7392 ///
7393 /// Format:
7394 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
7395 pub name: std::string::String,
7396
7397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7398}
7399
7400impl GetIntelligenceFindingRequest {
7401 /// Creates a new default instance.
7402 pub fn new() -> Self {
7403 std::default::Default::default()
7404 }
7405
7406 /// Sets the value of [name][crate::model::GetIntelligenceFindingRequest::name].
7407 ///
7408 /// # Example
7409 /// ```ignore,no_run
7410 /// # use google_cloud_storage::model::GetIntelligenceFindingRequest;
7411 /// # let project_id = "project_id";
7412 /// # let location_id = "location_id";
7413 /// # let intelligence_finding_id = "intelligence_finding_id";
7414 /// let x = GetIntelligenceFindingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}"));
7415 /// ```
7416 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7417 self.name = v.into();
7418 self
7419 }
7420}
7421
7422impl wkt::message::Message for GetIntelligenceFindingRequest {
7423 fn typename() -> &'static str {
7424 "type.googleapis.com/google.storage.control.v2.GetIntelligenceFindingRequest"
7425 }
7426}
7427
7428/// Request message to list `IntelligenceFinding` resources associated with
7429/// a project.
7430#[derive(Clone, Default, PartialEq)]
7431#[non_exhaustive]
7432pub struct ListIntelligenceFindingsRequest {
7433 /// Required. The parent of the `IntelligenceFinding` resource.
7434 ///
7435 /// Format: `projects/{project}/locations/{location}`
7436 pub parent: std::string::String,
7437
7438 /// Optional. The filter expression to be applied.
7439 /// Supports filtering by `type` and `associated_resources`.
7440 pub filter: std::string::String,
7441
7442 /// Optional. The maximum number of `IntelligenceFinding` resources to return.
7443 ///
7444 /// The maximum value is `100`; values above `100` will be coerced to `100`.
7445 /// The default value is `100`.
7446 pub page_size: i32,
7447
7448 /// Optional. A page token, received from a previous `ListIntelligenceFindings`
7449 /// call. Provide this to retrieve the subsequent page.
7450 ///
7451 /// When paginating, all other parameters provided to
7452 /// `ListIntelligenceFindings` must match the call that provided the page
7453 /// token.
7454 pub page_token: std::string::String,
7455
7456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7457}
7458
7459impl ListIntelligenceFindingsRequest {
7460 /// Creates a new default instance.
7461 pub fn new() -> Self {
7462 std::default::Default::default()
7463 }
7464
7465 /// Sets the value of [parent][crate::model::ListIntelligenceFindingsRequest::parent].
7466 ///
7467 /// # Example
7468 /// ```ignore,no_run
7469 /// # use google_cloud_storage::model::ListIntelligenceFindingsRequest;
7470 /// # let project_id = "project_id";
7471 /// # let location_id = "location_id";
7472 /// let x = ListIntelligenceFindingsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
7473 /// ```
7474 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7475 self.parent = v.into();
7476 self
7477 }
7478
7479 /// Sets the value of [filter][crate::model::ListIntelligenceFindingsRequest::filter].
7480 ///
7481 /// # Example
7482 /// ```ignore,no_run
7483 /// # use google_cloud_storage::model::ListIntelligenceFindingsRequest;
7484 /// let x = ListIntelligenceFindingsRequest::new().set_filter("example");
7485 /// ```
7486 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7487 self.filter = v.into();
7488 self
7489 }
7490
7491 /// Sets the value of [page_size][crate::model::ListIntelligenceFindingsRequest::page_size].
7492 ///
7493 /// # Example
7494 /// ```ignore,no_run
7495 /// # use google_cloud_storage::model::ListIntelligenceFindingsRequest;
7496 /// let x = ListIntelligenceFindingsRequest::new().set_page_size(42);
7497 /// ```
7498 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7499 self.page_size = v.into();
7500 self
7501 }
7502
7503 /// Sets the value of [page_token][crate::model::ListIntelligenceFindingsRequest::page_token].
7504 ///
7505 /// # Example
7506 /// ```ignore,no_run
7507 /// # use google_cloud_storage::model::ListIntelligenceFindingsRequest;
7508 /// let x = ListIntelligenceFindingsRequest::new().set_page_token("example");
7509 /// ```
7510 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7511 self.page_token = v.into();
7512 self
7513 }
7514}
7515
7516impl wkt::message::Message for ListIntelligenceFindingsRequest {
7517 fn typename() -> &'static str {
7518 "type.googleapis.com/google.storage.control.v2.ListIntelligenceFindingsRequest"
7519 }
7520}
7521
7522/// Response message to list the `IntelligenceFinding` resources associated with
7523/// a project.
7524#[derive(Clone, Default, PartialEq)]
7525#[non_exhaustive]
7526pub struct ListIntelligenceFindingsResponse {
7527 /// The `IntelligenceFinding` resources from the specified project.
7528 pub intelligence_findings: std::vec::Vec<crate::model::IntelligenceFinding>,
7529
7530 /// A token to retrieve the next page of results.
7531 /// Pass this value in the `page_token` field in the subsequent call.
7532 pub next_page_token: std::string::String,
7533
7534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7535}
7536
7537impl ListIntelligenceFindingsResponse {
7538 /// Creates a new default instance.
7539 pub fn new() -> Self {
7540 std::default::Default::default()
7541 }
7542
7543 /// Sets the value of [intelligence_findings][crate::model::ListIntelligenceFindingsResponse::intelligence_findings].
7544 ///
7545 /// # Example
7546 /// ```ignore,no_run
7547 /// # use google_cloud_storage::model::ListIntelligenceFindingsResponse;
7548 /// use google_cloud_storage::model::IntelligenceFinding;
7549 /// let x = ListIntelligenceFindingsResponse::new()
7550 /// .set_intelligence_findings([
7551 /// IntelligenceFinding::default()/* use setters */,
7552 /// IntelligenceFinding::default()/* use (different) setters */,
7553 /// ]);
7554 /// ```
7555 pub fn set_intelligence_findings<T, V>(mut self, v: T) -> Self
7556 where
7557 T: std::iter::IntoIterator<Item = V>,
7558 V: std::convert::Into<crate::model::IntelligenceFinding>,
7559 {
7560 use std::iter::Iterator;
7561 self.intelligence_findings = v.into_iter().map(|i| i.into()).collect();
7562 self
7563 }
7564
7565 /// Sets the value of [next_page_token][crate::model::ListIntelligenceFindingsResponse::next_page_token].
7566 ///
7567 /// # Example
7568 /// ```ignore,no_run
7569 /// # use google_cloud_storage::model::ListIntelligenceFindingsResponse;
7570 /// let x = ListIntelligenceFindingsResponse::new().set_next_page_token("example");
7571 /// ```
7572 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7573 self.next_page_token = v.into();
7574 self
7575 }
7576}
7577
7578impl wkt::message::Message for ListIntelligenceFindingsResponse {
7579 fn typename() -> &'static str {
7580 "type.googleapis.com/google.storage.control.v2.ListIntelligenceFindingsResponse"
7581 }
7582}
7583
7584#[doc(hidden)]
7585impl google_cloud_gax::paginator::internal::PageableResponse for ListIntelligenceFindingsResponse {
7586 type PageItem = crate::model::IntelligenceFinding;
7587
7588 fn items(self) -> std::vec::Vec<Self::PageItem> {
7589 self.intelligence_findings
7590 }
7591
7592 fn next_page_token(&self) -> std::string::String {
7593 use std::clone::Clone;
7594 self.next_page_token.clone()
7595 }
7596}
7597
7598/// Request message to summarize the intelligence findings for the specified
7599/// scope(org, folder or project).
7600#[derive(Clone, Default, PartialEq)]
7601#[non_exhaustive]
7602pub struct SummarizeIntelligenceFindingsRequest {
7603 /// Required. The scope to summarize the findings for.
7604 /// Format:
7605 ///
7606 /// - `organizations/{organization}/locations/{location}`
7607 /// - `folders/{folder}/locations/{location}`
7608 /// - `projects/{project}/locations/{location}`
7609 pub parent: std::string::String,
7610
7611 /// Optional. Determines the granularity of the findings
7612 /// when the `parent` is an organization or folder.
7613 ///
7614 /// - `PARENT` (or not set): A single summary is
7615 /// returned for each insight type, aggregated across the entire `parent`
7616 /// scope.
7617 /// - `PROJECT`: A separate summary is returned for each
7618 /// insight type for every project within the `parent` scope.
7619 ///
7620 /// The only supported values are `PARENT` and `PROJECT`.
7621 /// If no value is specified, the API behaviour defaults to the `PARENT`.
7622 pub resource_scope: crate::model::summarize_intelligence_findings_request::ResourceScope,
7623
7624 /// Optional. The filter expression, following AIP-160.
7625 /// Supports filtering by FindingType.
7626 pub filter: std::string::String,
7627
7628 /// Optional. The maximum number of findings to return.
7629 ///
7630 /// The maximum value is `100`; values above `100` will be coerced to `100`.
7631 /// The default value is `100`.
7632 pub page_size: i32,
7633
7634 /// Optional. A page token, received from a previous
7635 /// `SummarizeIntelligenceFindings` call. Provide this to retrieve the
7636 /// subsequent page.
7637 ///
7638 /// When paginating, all other parameters provided to
7639 /// `SummarizeIntelligenceFindings` must match the call that provided the page
7640 /// token.
7641 pub page_token: std::string::String,
7642
7643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7644}
7645
7646impl SummarizeIntelligenceFindingsRequest {
7647 /// Creates a new default instance.
7648 pub fn new() -> Self {
7649 std::default::Default::default()
7650 }
7651
7652 /// Sets the value of [parent][crate::model::SummarizeIntelligenceFindingsRequest::parent].
7653 ///
7654 /// # Example
7655 /// ```ignore,no_run
7656 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
7657 /// let x = SummarizeIntelligenceFindingsRequest::new().set_parent("example");
7658 /// ```
7659 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7660 self.parent = v.into();
7661 self
7662 }
7663
7664 /// Sets the value of [resource_scope][crate::model::SummarizeIntelligenceFindingsRequest::resource_scope].
7665 ///
7666 /// # Example
7667 /// ```ignore,no_run
7668 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
7669 /// use google_cloud_storage::model::summarize_intelligence_findings_request::ResourceScope;
7670 /// let x0 = SummarizeIntelligenceFindingsRequest::new().set_resource_scope(ResourceScope::Parent);
7671 /// let x1 = SummarizeIntelligenceFindingsRequest::new().set_resource_scope(ResourceScope::Project);
7672 /// ```
7673 pub fn set_resource_scope<
7674 T: std::convert::Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
7675 >(
7676 mut self,
7677 v: T,
7678 ) -> Self {
7679 self.resource_scope = v.into();
7680 self
7681 }
7682
7683 /// Sets the value of [filter][crate::model::SummarizeIntelligenceFindingsRequest::filter].
7684 ///
7685 /// # Example
7686 /// ```ignore,no_run
7687 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
7688 /// let x = SummarizeIntelligenceFindingsRequest::new().set_filter("example");
7689 /// ```
7690 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7691 self.filter = v.into();
7692 self
7693 }
7694
7695 /// Sets the value of [page_size][crate::model::SummarizeIntelligenceFindingsRequest::page_size].
7696 ///
7697 /// # Example
7698 /// ```ignore,no_run
7699 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
7700 /// let x = SummarizeIntelligenceFindingsRequest::new().set_page_size(42);
7701 /// ```
7702 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7703 self.page_size = v.into();
7704 self
7705 }
7706
7707 /// Sets the value of [page_token][crate::model::SummarizeIntelligenceFindingsRequest::page_token].
7708 ///
7709 /// # Example
7710 /// ```ignore,no_run
7711 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
7712 /// let x = SummarizeIntelligenceFindingsRequest::new().set_page_token("example");
7713 /// ```
7714 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7715 self.page_token = v.into();
7716 self
7717 }
7718}
7719
7720impl wkt::message::Message for SummarizeIntelligenceFindingsRequest {
7721 fn typename() -> &'static str {
7722 "type.googleapis.com/google.storage.control.v2.SummarizeIntelligenceFindingsRequest"
7723 }
7724}
7725
7726/// Defines additional types related to [SummarizeIntelligenceFindingsRequest].
7727pub mod summarize_intelligence_findings_request {
7728 #[allow(unused_imports)]
7729 use super::*;
7730
7731 /// The list of resource scopes.
7732 ///
7733 /// # Working with unknown values
7734 ///
7735 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7736 /// additional enum variants at any time. Adding new variants is not considered
7737 /// a breaking change. Applications should write their code in anticipation of:
7738 ///
7739 /// - New values appearing in future releases of the client library, **and**
7740 /// - New values received dynamically, without application changes.
7741 ///
7742 /// Please consult the [Working with enums] section in the user guide for some
7743 /// guidelines.
7744 ///
7745 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7746 #[derive(Clone, Debug, PartialEq)]
7747 #[non_exhaustive]
7748 pub enum ResourceScope {
7749 /// The default behavior. Falls back to PARENT behaviour
7750 Unspecified,
7751 /// Summaries are aggregated at the level of the `parent` resource.
7752 Parent,
7753 /// Summaries are broken down by each project within the `parent` scope.
7754 Project,
7755 /// If set, the enum was initialized with an unknown value.
7756 ///
7757 /// Applications can examine the value using [ResourceScope::value] or
7758 /// [ResourceScope::name].
7759 UnknownValue(resource_scope::UnknownValue),
7760 }
7761
7762 #[doc(hidden)]
7763 pub mod resource_scope {
7764 #[allow(unused_imports)]
7765 use super::*;
7766 #[derive(Clone, Debug, PartialEq)]
7767 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7768 }
7769
7770 impl ResourceScope {
7771 /// Gets the enum value.
7772 ///
7773 /// Returns `None` if the enum contains an unknown value deserialized from
7774 /// the string representation of enums.
7775 pub fn value(&self) -> std::option::Option<i32> {
7776 match self {
7777 Self::Unspecified => std::option::Option::Some(0),
7778 Self::Parent => std::option::Option::Some(1),
7779 Self::Project => std::option::Option::Some(2),
7780 Self::UnknownValue(u) => u.0.value(),
7781 }
7782 }
7783
7784 /// Gets the enum value as a string.
7785 ///
7786 /// Returns `None` if the enum contains an unknown value deserialized from
7787 /// the integer representation of enums.
7788 pub fn name(&self) -> std::option::Option<&str> {
7789 match self {
7790 Self::Unspecified => std::option::Option::Some("RESOURCE_SCOPE_UNSPECIFIED"),
7791 Self::Parent => std::option::Option::Some("PARENT"),
7792 Self::Project => std::option::Option::Some("PROJECT"),
7793 Self::UnknownValue(u) => u.0.name(),
7794 }
7795 }
7796 }
7797
7798 impl std::default::Default for ResourceScope {
7799 fn default() -> Self {
7800 use std::convert::From;
7801 Self::from(0)
7802 }
7803 }
7804
7805 impl std::fmt::Display for ResourceScope {
7806 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7807 wkt::internal::display_enum(f, self.name(), self.value())
7808 }
7809 }
7810
7811 impl std::convert::From<i32> for ResourceScope {
7812 fn from(value: i32) -> Self {
7813 match value {
7814 0 => Self::Unspecified,
7815 1 => Self::Parent,
7816 2 => Self::Project,
7817 _ => Self::UnknownValue(resource_scope::UnknownValue(
7818 wkt::internal::UnknownEnumValue::Integer(value),
7819 )),
7820 }
7821 }
7822 }
7823
7824 impl std::convert::From<&str> for ResourceScope {
7825 fn from(value: &str) -> Self {
7826 use std::string::ToString;
7827 match value {
7828 "RESOURCE_SCOPE_UNSPECIFIED" => Self::Unspecified,
7829 "PARENT" => Self::Parent,
7830 "PROJECT" => Self::Project,
7831 _ => Self::UnknownValue(resource_scope::UnknownValue(
7832 wkt::internal::UnknownEnumValue::String(value.to_string()),
7833 )),
7834 }
7835 }
7836 }
7837
7838 impl serde::ser::Serialize for ResourceScope {
7839 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7840 where
7841 S: serde::Serializer,
7842 {
7843 match self {
7844 Self::Unspecified => serializer.serialize_i32(0),
7845 Self::Parent => serializer.serialize_i32(1),
7846 Self::Project => serializer.serialize_i32(2),
7847 Self::UnknownValue(u) => u.0.serialize(serializer),
7848 }
7849 }
7850 }
7851
7852 impl<'de> serde::de::Deserialize<'de> for ResourceScope {
7853 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7854 where
7855 D: serde::Deserializer<'de>,
7856 {
7857 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceScope>::new(
7858 ".google.storage.control.v2.SummarizeIntelligenceFindingsRequest.ResourceScope",
7859 ))
7860 }
7861 }
7862}
7863
7864/// Response message to summarize the intelligence findings for a specified
7865/// scope(org, folder or project).
7866#[derive(Clone, Default, PartialEq)]
7867#[non_exhaustive]
7868pub struct SummarizeIntelligenceFindingsResponse {
7869 /// The list of `FindingSummary` summaries.
7870 pub finding_summaries: std::vec::Vec<crate::model::FindingSummary>,
7871
7872 /// A token to retrieve the next page of results.
7873 /// Pass this value in the `page_token` field in the subsequent call to
7874 /// `SummarizeIntelligenceFindings` to retrieve the next page of results.
7875 pub next_page_token: std::string::String,
7876
7877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7878}
7879
7880impl SummarizeIntelligenceFindingsResponse {
7881 /// Creates a new default instance.
7882 pub fn new() -> Self {
7883 std::default::Default::default()
7884 }
7885
7886 /// Sets the value of [finding_summaries][crate::model::SummarizeIntelligenceFindingsResponse::finding_summaries].
7887 ///
7888 /// # Example
7889 /// ```ignore,no_run
7890 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsResponse;
7891 /// use google_cloud_storage::model::FindingSummary;
7892 /// let x = SummarizeIntelligenceFindingsResponse::new()
7893 /// .set_finding_summaries([
7894 /// FindingSummary::default()/* use setters */,
7895 /// FindingSummary::default()/* use (different) setters */,
7896 /// ]);
7897 /// ```
7898 pub fn set_finding_summaries<T, V>(mut self, v: T) -> Self
7899 where
7900 T: std::iter::IntoIterator<Item = V>,
7901 V: std::convert::Into<crate::model::FindingSummary>,
7902 {
7903 use std::iter::Iterator;
7904 self.finding_summaries = v.into_iter().map(|i| i.into()).collect();
7905 self
7906 }
7907
7908 /// Sets the value of [next_page_token][crate::model::SummarizeIntelligenceFindingsResponse::next_page_token].
7909 ///
7910 /// # Example
7911 /// ```ignore,no_run
7912 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsResponse;
7913 /// let x = SummarizeIntelligenceFindingsResponse::new().set_next_page_token("example");
7914 /// ```
7915 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7916 self.next_page_token = v.into();
7917 self
7918 }
7919}
7920
7921impl wkt::message::Message for SummarizeIntelligenceFindingsResponse {
7922 fn typename() -> &'static str {
7923 "type.googleapis.com/google.storage.control.v2.SummarizeIntelligenceFindingsResponse"
7924 }
7925}
7926
7927#[doc(hidden)]
7928impl google_cloud_gax::paginator::internal::PageableResponse
7929 for SummarizeIntelligenceFindingsResponse
7930{
7931 type PageItem = crate::model::FindingSummary;
7932
7933 fn items(self) -> std::vec::Vec<Self::PageItem> {
7934 self.finding_summaries
7935 }
7936
7937 fn next_page_token(&self) -> std::string::String {
7938 use std::clone::Clone;
7939 self.next_page_token.clone()
7940 }
7941}
7942
7943/// Request message to get the `IntelligenceFindingRevision` resource associated
7944/// with a project.
7945#[derive(Clone, Default, PartialEq)]
7946#[non_exhaustive]
7947pub struct GetIntelligenceFindingRevisionRequest {
7948 /// Required. The name of the `IntelligenceFindingRevision` resource.
7949 ///
7950 /// ## Format:
7951 ///
7952 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}/revisions/{revision}`
7953 pub name: std::string::String,
7954
7955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7956}
7957
7958impl GetIntelligenceFindingRevisionRequest {
7959 /// Creates a new default instance.
7960 pub fn new() -> Self {
7961 std::default::Default::default()
7962 }
7963
7964 /// Sets the value of [name][crate::model::GetIntelligenceFindingRevisionRequest::name].
7965 ///
7966 /// # Example
7967 /// ```ignore,no_run
7968 /// # use google_cloud_storage::model::GetIntelligenceFindingRevisionRequest;
7969 /// # let project_id = "project_id";
7970 /// # let location_id = "location_id";
7971 /// # let intelligence_finding_id = "intelligence_finding_id";
7972 /// # let revision_id = "revision_id";
7973 /// let x = GetIntelligenceFindingRevisionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}/revisions/{revision_id}"));
7974 /// ```
7975 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7976 self.name = v.into();
7977 self
7978 }
7979}
7980
7981impl wkt::message::Message for GetIntelligenceFindingRevisionRequest {
7982 fn typename() -> &'static str {
7983 "type.googleapis.com/google.storage.control.v2.GetIntelligenceFindingRevisionRequest"
7984 }
7985}
7986
7987/// Request message to list `IntelligenceFindingRevision` resources associated
7988/// with a project.
7989#[derive(Clone, Default, PartialEq)]
7990#[non_exhaustive]
7991pub struct ListIntelligenceFindingRevisionsRequest {
7992 /// Required. The parent of the `IntelligenceFindingRevision` resource.
7993 ///
7994 /// ## Format:
7995 ///
7996 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
7997 pub parent: std::string::String,
7998
7999 /// Optional. The maximum number of `IntelligenceFindingRevision` resources to
8000 /// return.
8001 ///
8002 /// The maximum value is `100`; values above `100` will be coerced to `100`.
8003 /// The default value is `100`.
8004 pub page_size: i32,
8005
8006 /// Optional. A page token, received from a previous
8007 /// `ListIntelligenceFindingRevisions` call. Provide this to retrieve the
8008 /// subsequent page.
8009 pub page_token: std::string::String,
8010
8011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8012}
8013
8014impl ListIntelligenceFindingRevisionsRequest {
8015 /// Creates a new default instance.
8016 pub fn new() -> Self {
8017 std::default::Default::default()
8018 }
8019
8020 /// Sets the value of [parent][crate::model::ListIntelligenceFindingRevisionsRequest::parent].
8021 ///
8022 /// # Example
8023 /// ```ignore,no_run
8024 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsRequest;
8025 /// # let project_id = "project_id";
8026 /// # let location_id = "location_id";
8027 /// # let intelligence_finding_id = "intelligence_finding_id";
8028 /// let x = ListIntelligenceFindingRevisionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}"));
8029 /// ```
8030 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8031 self.parent = v.into();
8032 self
8033 }
8034
8035 /// Sets the value of [page_size][crate::model::ListIntelligenceFindingRevisionsRequest::page_size].
8036 ///
8037 /// # Example
8038 /// ```ignore,no_run
8039 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsRequest;
8040 /// let x = ListIntelligenceFindingRevisionsRequest::new().set_page_size(42);
8041 /// ```
8042 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8043 self.page_size = v.into();
8044 self
8045 }
8046
8047 /// Sets the value of [page_token][crate::model::ListIntelligenceFindingRevisionsRequest::page_token].
8048 ///
8049 /// # Example
8050 /// ```ignore,no_run
8051 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsRequest;
8052 /// let x = ListIntelligenceFindingRevisionsRequest::new().set_page_token("example");
8053 /// ```
8054 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8055 self.page_token = v.into();
8056 self
8057 }
8058}
8059
8060impl wkt::message::Message for ListIntelligenceFindingRevisionsRequest {
8061 fn typename() -> &'static str {
8062 "type.googleapis.com/google.storage.control.v2.ListIntelligenceFindingRevisionsRequest"
8063 }
8064}
8065
8066/// Response message to list `IntelligenceFindingRevision` resources associated
8067/// with a project.
8068#[derive(Clone, Default, PartialEq)]
8069#[non_exhaustive]
8070pub struct ListIntelligenceFindingRevisionsResponse {
8071 /// The `IntelligenceFindingRevision` resources from the specified project.
8072 pub intelligence_finding_revisions: std::vec::Vec<crate::model::IntelligenceFindingRevision>,
8073
8074 /// A token that can be sent as `page_token` to retrieve the next page.
8075 pub next_page_token: std::string::String,
8076
8077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8078}
8079
8080impl ListIntelligenceFindingRevisionsResponse {
8081 /// Creates a new default instance.
8082 pub fn new() -> Self {
8083 std::default::Default::default()
8084 }
8085
8086 /// Sets the value of [intelligence_finding_revisions][crate::model::ListIntelligenceFindingRevisionsResponse::intelligence_finding_revisions].
8087 ///
8088 /// # Example
8089 /// ```ignore,no_run
8090 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsResponse;
8091 /// use google_cloud_storage::model::IntelligenceFindingRevision;
8092 /// let x = ListIntelligenceFindingRevisionsResponse::new()
8093 /// .set_intelligence_finding_revisions([
8094 /// IntelligenceFindingRevision::default()/* use setters */,
8095 /// IntelligenceFindingRevision::default()/* use (different) setters */,
8096 /// ]);
8097 /// ```
8098 pub fn set_intelligence_finding_revisions<T, V>(mut self, v: T) -> Self
8099 where
8100 T: std::iter::IntoIterator<Item = V>,
8101 V: std::convert::Into<crate::model::IntelligenceFindingRevision>,
8102 {
8103 use std::iter::Iterator;
8104 self.intelligence_finding_revisions = v.into_iter().map(|i| i.into()).collect();
8105 self
8106 }
8107
8108 /// Sets the value of [next_page_token][crate::model::ListIntelligenceFindingRevisionsResponse::next_page_token].
8109 ///
8110 /// # Example
8111 /// ```ignore,no_run
8112 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsResponse;
8113 /// let x = ListIntelligenceFindingRevisionsResponse::new().set_next_page_token("example");
8114 /// ```
8115 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8116 self.next_page_token = v.into();
8117 self
8118 }
8119}
8120
8121impl wkt::message::Message for ListIntelligenceFindingRevisionsResponse {
8122 fn typename() -> &'static str {
8123 "type.googleapis.com/google.storage.control.v2.ListIntelligenceFindingRevisionsResponse"
8124 }
8125}
8126
8127#[doc(hidden)]
8128impl google_cloud_gax::paginator::internal::PageableResponse
8129 for ListIntelligenceFindingRevisionsResponse
8130{
8131 type PageItem = crate::model::IntelligenceFindingRevision;
8132
8133 fn items(self) -> std::vec::Vec<Self::PageItem> {
8134 self.intelligence_finding_revisions
8135 }
8136
8137 fn next_page_token(&self) -> std::string::String {
8138 use std::clone::Clone;
8139 self.next_page_token.clone()
8140 }
8141}
8142
8143/// A summary of findings generated for an organization, a folder, or a project.
8144#[derive(Clone, Default, PartialEq)]
8145#[non_exhaustive]
8146pub struct FindingSummary {
8147 /// Output only. The type of the finding.
8148 pub r#type: crate::model::FindingType,
8149
8150 /// Output only. The category of finding.
8151 pub category: crate::model::FindingCategory,
8152
8153 /// Output only. The fully qualified Cloud resource name for which this
8154 /// summary was generated.
8155 /// eg: `//cloudresourcemanager.googleapis.com/projects/p1`
8156 pub target_resource: std::string::String,
8157
8158 /// Output only. The creation time of the earliest finding that this summary is
8159 /// based on.
8160 pub create_time: std::option::Option<wkt::Timestamp>,
8161
8162 /// Output only. The time of the most recent update among all the findings that
8163 /// this summary is based on.
8164 pub update_time: std::option::Option<wkt::Timestamp>,
8165
8166 /// Severity of the finding.
8167 pub severity: crate::model::FindingSeverity,
8168
8169 /// Output only. List of `SummaryDetails`.
8170 pub summary_details: std::vec::Vec<crate::model::finding_summary::SummaryDetails>,
8171
8172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8173}
8174
8175impl FindingSummary {
8176 /// Creates a new default instance.
8177 pub fn new() -> Self {
8178 std::default::Default::default()
8179 }
8180
8181 /// Sets the value of [r#type][crate::model::FindingSummary::type].
8182 ///
8183 /// # Example
8184 /// ```ignore,no_run
8185 /// # use google_cloud_storage::model::FindingSummary;
8186 /// use google_cloud_storage::model::FindingType;
8187 /// let x0 = FindingSummary::new().set_type(FindingType::ColdlineAndArchivalStorageOperationsSpike);
8188 /// let x1 = FindingSummary::new().set_type(FindingType::ThrottledRequestSpike);
8189 /// let x2 = FindingSummary::new().set_type(FindingType::CrossRegionEgressSpike);
8190 /// ```
8191 pub fn set_type<T: std::convert::Into<crate::model::FindingType>>(mut self, v: T) -> Self {
8192 self.r#type = v.into();
8193 self
8194 }
8195
8196 /// Sets the value of [category][crate::model::FindingSummary::category].
8197 ///
8198 /// # Example
8199 /// ```ignore,no_run
8200 /// # use google_cloud_storage::model::FindingSummary;
8201 /// use google_cloud_storage::model::FindingCategory;
8202 /// let x0 = FindingSummary::new().set_category(FindingCategory::DataManagement);
8203 /// let x1 = FindingSummary::new().set_category(FindingCategory::Performance);
8204 /// ```
8205 pub fn set_category<T: std::convert::Into<crate::model::FindingCategory>>(
8206 mut self,
8207 v: T,
8208 ) -> Self {
8209 self.category = v.into();
8210 self
8211 }
8212
8213 /// Sets the value of [target_resource][crate::model::FindingSummary::target_resource].
8214 ///
8215 /// # Example
8216 /// ```ignore,no_run
8217 /// # use google_cloud_storage::model::FindingSummary;
8218 /// let x = FindingSummary::new().set_target_resource("example");
8219 /// ```
8220 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8221 self.target_resource = v.into();
8222 self
8223 }
8224
8225 /// Sets the value of [create_time][crate::model::FindingSummary::create_time].
8226 ///
8227 /// # Example
8228 /// ```ignore,no_run
8229 /// # use google_cloud_storage::model::FindingSummary;
8230 /// use wkt::Timestamp;
8231 /// let x = FindingSummary::new().set_create_time(Timestamp::default()/* use setters */);
8232 /// ```
8233 pub fn set_create_time<T>(mut self, v: T) -> Self
8234 where
8235 T: std::convert::Into<wkt::Timestamp>,
8236 {
8237 self.create_time = std::option::Option::Some(v.into());
8238 self
8239 }
8240
8241 /// Sets or clears the value of [create_time][crate::model::FindingSummary::create_time].
8242 ///
8243 /// # Example
8244 /// ```ignore,no_run
8245 /// # use google_cloud_storage::model::FindingSummary;
8246 /// use wkt::Timestamp;
8247 /// let x = FindingSummary::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8248 /// let x = FindingSummary::new().set_or_clear_create_time(None::<Timestamp>);
8249 /// ```
8250 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8251 where
8252 T: std::convert::Into<wkt::Timestamp>,
8253 {
8254 self.create_time = v.map(|x| x.into());
8255 self
8256 }
8257
8258 /// Sets the value of [update_time][crate::model::FindingSummary::update_time].
8259 ///
8260 /// # Example
8261 /// ```ignore,no_run
8262 /// # use google_cloud_storage::model::FindingSummary;
8263 /// use wkt::Timestamp;
8264 /// let x = FindingSummary::new().set_update_time(Timestamp::default()/* use setters */);
8265 /// ```
8266 pub fn set_update_time<T>(mut self, v: T) -> Self
8267 where
8268 T: std::convert::Into<wkt::Timestamp>,
8269 {
8270 self.update_time = std::option::Option::Some(v.into());
8271 self
8272 }
8273
8274 /// Sets or clears the value of [update_time][crate::model::FindingSummary::update_time].
8275 ///
8276 /// # Example
8277 /// ```ignore,no_run
8278 /// # use google_cloud_storage::model::FindingSummary;
8279 /// use wkt::Timestamp;
8280 /// let x = FindingSummary::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8281 /// let x = FindingSummary::new().set_or_clear_update_time(None::<Timestamp>);
8282 /// ```
8283 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8284 where
8285 T: std::convert::Into<wkt::Timestamp>,
8286 {
8287 self.update_time = v.map(|x| x.into());
8288 self
8289 }
8290
8291 /// Sets the value of [severity][crate::model::FindingSummary::severity].
8292 ///
8293 /// # Example
8294 /// ```ignore,no_run
8295 /// # use google_cloud_storage::model::FindingSummary;
8296 /// use google_cloud_storage::model::FindingSeverity;
8297 /// let x0 = FindingSummary::new().set_severity(FindingSeverity::Critical);
8298 /// ```
8299 pub fn set_severity<T: std::convert::Into<crate::model::FindingSeverity>>(
8300 mut self,
8301 v: T,
8302 ) -> Self {
8303 self.severity = v.into();
8304 self
8305 }
8306
8307 /// Sets the value of [summary_details][crate::model::FindingSummary::summary_details].
8308 ///
8309 /// # Example
8310 /// ```ignore,no_run
8311 /// # use google_cloud_storage::model::FindingSummary;
8312 /// use google_cloud_storage::model::finding_summary::SummaryDetails;
8313 /// let x = FindingSummary::new()
8314 /// .set_summary_details([
8315 /// SummaryDetails::default()/* use setters */,
8316 /// SummaryDetails::default()/* use (different) setters */,
8317 /// ]);
8318 /// ```
8319 pub fn set_summary_details<T, V>(mut self, v: T) -> Self
8320 where
8321 T: std::iter::IntoIterator<Item = V>,
8322 V: std::convert::Into<crate::model::finding_summary::SummaryDetails>,
8323 {
8324 use std::iter::Iterator;
8325 self.summary_details = v.into_iter().map(|i| i.into()).collect();
8326 self
8327 }
8328}
8329
8330impl wkt::message::Message for FindingSummary {
8331 fn typename() -> &'static str {
8332 "type.googleapis.com/google.storage.control.v2.FindingSummary"
8333 }
8334}
8335
8336/// Defines additional types related to [FindingSummary].
8337pub mod finding_summary {
8338 #[allow(unused_imports)]
8339 use super::*;
8340
8341 /// Details about the `FindingSummary` resource.
8342 #[derive(Clone, Default, PartialEq)]
8343 #[non_exhaustive]
8344 pub struct SummaryDetails {
8345 /// Output only. The type of Cloud resource this summary detail applies to.
8346 pub resource_type: crate::model::finding_summary::summary_details::ResourceType,
8347
8348 /// Output only. A short description about the FindingSummary
8349 pub description: std::string::String,
8350
8351 /// The value of the summary.
8352 pub magnitude:
8353 std::option::Option<crate::model::finding_summary::summary_details::Magnitude>,
8354
8355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8356 }
8357
8358 impl SummaryDetails {
8359 /// Creates a new default instance.
8360 pub fn new() -> Self {
8361 std::default::Default::default()
8362 }
8363
8364 /// Sets the value of [resource_type][crate::model::finding_summary::SummaryDetails::resource_type].
8365 ///
8366 /// # Example
8367 /// ```ignore,no_run
8368 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
8369 /// use google_cloud_storage::model::finding_summary::summary_details::ResourceType;
8370 /// let x0 = SummaryDetails::new().set_resource_type(ResourceType::Project);
8371 /// let x1 = SummaryDetails::new().set_resource_type(ResourceType::Bucket);
8372 /// ```
8373 pub fn set_resource_type<
8374 T: std::convert::Into<crate::model::finding_summary::summary_details::ResourceType>,
8375 >(
8376 mut self,
8377 v: T,
8378 ) -> Self {
8379 self.resource_type = v.into();
8380 self
8381 }
8382
8383 /// Sets the value of [description][crate::model::finding_summary::SummaryDetails::description].
8384 ///
8385 /// # Example
8386 /// ```ignore,no_run
8387 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
8388 /// let x = SummaryDetails::new().set_description("example");
8389 /// ```
8390 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8391 self.description = v.into();
8392 self
8393 }
8394
8395 /// Sets the value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude].
8396 ///
8397 /// Note that all the setters affecting `magnitude` are mutually
8398 /// exclusive.
8399 ///
8400 /// # Example
8401 /// ```ignore,no_run
8402 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
8403 /// use google_cloud_storage::model::finding_summary::summary_details::Magnitude;
8404 /// let x = SummaryDetails::new().set_magnitude(Some(Magnitude::Count(42)));
8405 /// ```
8406 pub fn set_magnitude<
8407 T: std::convert::Into<
8408 std::option::Option<crate::model::finding_summary::summary_details::Magnitude>,
8409 >,
8410 >(
8411 mut self,
8412 v: T,
8413 ) -> Self {
8414 self.magnitude = v.into();
8415 self
8416 }
8417
8418 /// The value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude]
8419 /// if it holds a `Count`, `None` if the field is not set or
8420 /// holds a different branch.
8421 pub fn count(&self) -> std::option::Option<&i64> {
8422 #[allow(unreachable_patterns)]
8423 self.magnitude.as_ref().and_then(|v| match v {
8424 crate::model::finding_summary::summary_details::Magnitude::Count(v) => {
8425 std::option::Option::Some(v)
8426 }
8427 _ => std::option::Option::None,
8428 })
8429 }
8430
8431 /// Sets the value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude]
8432 /// to hold a `Count`.
8433 ///
8434 /// Note that all the setters affecting `magnitude` are
8435 /// mutually exclusive.
8436 ///
8437 /// # Example
8438 /// ```ignore,no_run
8439 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
8440 /// let x = SummaryDetails::new().set_count(42);
8441 /// assert!(x.count().is_some());
8442 /// assert!(x.percentage().is_none());
8443 /// ```
8444 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8445 self.magnitude = std::option::Option::Some(
8446 crate::model::finding_summary::summary_details::Magnitude::Count(v.into()),
8447 );
8448 self
8449 }
8450
8451 /// The value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude]
8452 /// if it holds a `Percentage`, `None` if the field is not set or
8453 /// holds a different branch.
8454 pub fn percentage(&self) -> std::option::Option<&f32> {
8455 #[allow(unreachable_patterns)]
8456 self.magnitude.as_ref().and_then(|v| match v {
8457 crate::model::finding_summary::summary_details::Magnitude::Percentage(v) => {
8458 std::option::Option::Some(v)
8459 }
8460 _ => std::option::Option::None,
8461 })
8462 }
8463
8464 /// Sets the value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude]
8465 /// to hold a `Percentage`.
8466 ///
8467 /// Note that all the setters affecting `magnitude` are
8468 /// mutually exclusive.
8469 ///
8470 /// # Example
8471 /// ```ignore,no_run
8472 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
8473 /// let x = SummaryDetails::new().set_percentage(42.0);
8474 /// assert!(x.percentage().is_some());
8475 /// assert!(x.count().is_none());
8476 /// ```
8477 pub fn set_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
8478 self.magnitude = std::option::Option::Some(
8479 crate::model::finding_summary::summary_details::Magnitude::Percentage(v.into()),
8480 );
8481 self
8482 }
8483 }
8484
8485 impl wkt::message::Message for SummaryDetails {
8486 fn typename() -> &'static str {
8487 "type.googleapis.com/google.storage.control.v2.FindingSummary.SummaryDetails"
8488 }
8489 }
8490
8491 /// Defines additional types related to [SummaryDetails].
8492 pub mod summary_details {
8493 #[allow(unused_imports)]
8494 use super::*;
8495
8496 /// The list of resource types.
8497 ///
8498 /// # Working with unknown values
8499 ///
8500 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8501 /// additional enum variants at any time. Adding new variants is not considered
8502 /// a breaking change. Applications should write their code in anticipation of:
8503 ///
8504 /// - New values appearing in future releases of the client library, **and**
8505 /// - New values received dynamically, without application changes.
8506 ///
8507 /// Please consult the [Working with enums] section in the user guide for some
8508 /// guidelines.
8509 ///
8510 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8511 #[derive(Clone, Debug, PartialEq)]
8512 #[non_exhaustive]
8513 pub enum ResourceType {
8514 /// Resource type is unspecified.
8515 Unspecified,
8516 /// Resource type is project.
8517 Project,
8518 /// Resource type is bucket.
8519 Bucket,
8520 /// If set, the enum was initialized with an unknown value.
8521 ///
8522 /// Applications can examine the value using [ResourceType::value] or
8523 /// [ResourceType::name].
8524 UnknownValue(resource_type::UnknownValue),
8525 }
8526
8527 #[doc(hidden)]
8528 pub mod resource_type {
8529 #[allow(unused_imports)]
8530 use super::*;
8531 #[derive(Clone, Debug, PartialEq)]
8532 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8533 }
8534
8535 impl ResourceType {
8536 /// Gets the enum value.
8537 ///
8538 /// Returns `None` if the enum contains an unknown value deserialized from
8539 /// the string representation of enums.
8540 pub fn value(&self) -> std::option::Option<i32> {
8541 match self {
8542 Self::Unspecified => std::option::Option::Some(0),
8543 Self::Project => std::option::Option::Some(1),
8544 Self::Bucket => std::option::Option::Some(2),
8545 Self::UnknownValue(u) => u.0.value(),
8546 }
8547 }
8548
8549 /// Gets the enum value as a string.
8550 ///
8551 /// Returns `None` if the enum contains an unknown value deserialized from
8552 /// the integer representation of enums.
8553 pub fn name(&self) -> std::option::Option<&str> {
8554 match self {
8555 Self::Unspecified => std::option::Option::Some("RESOURCE_TYPE_UNSPECIFIED"),
8556 Self::Project => std::option::Option::Some("PROJECT"),
8557 Self::Bucket => std::option::Option::Some("BUCKET"),
8558 Self::UnknownValue(u) => u.0.name(),
8559 }
8560 }
8561 }
8562
8563 impl std::default::Default for ResourceType {
8564 fn default() -> Self {
8565 use std::convert::From;
8566 Self::from(0)
8567 }
8568 }
8569
8570 impl std::fmt::Display for ResourceType {
8571 fn fmt(
8572 &self,
8573 f: &mut std::fmt::Formatter<'_>,
8574 ) -> std::result::Result<(), std::fmt::Error> {
8575 wkt::internal::display_enum(f, self.name(), self.value())
8576 }
8577 }
8578
8579 impl std::convert::From<i32> for ResourceType {
8580 fn from(value: i32) -> Self {
8581 match value {
8582 0 => Self::Unspecified,
8583 1 => Self::Project,
8584 2 => Self::Bucket,
8585 _ => Self::UnknownValue(resource_type::UnknownValue(
8586 wkt::internal::UnknownEnumValue::Integer(value),
8587 )),
8588 }
8589 }
8590 }
8591
8592 impl std::convert::From<&str> for ResourceType {
8593 fn from(value: &str) -> Self {
8594 use std::string::ToString;
8595 match value {
8596 "RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
8597 "PROJECT" => Self::Project,
8598 "BUCKET" => Self::Bucket,
8599 _ => Self::UnknownValue(resource_type::UnknownValue(
8600 wkt::internal::UnknownEnumValue::String(value.to_string()),
8601 )),
8602 }
8603 }
8604 }
8605
8606 impl serde::ser::Serialize for ResourceType {
8607 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8608 where
8609 S: serde::Serializer,
8610 {
8611 match self {
8612 Self::Unspecified => serializer.serialize_i32(0),
8613 Self::Project => serializer.serialize_i32(1),
8614 Self::Bucket => serializer.serialize_i32(2),
8615 Self::UnknownValue(u) => u.0.serialize(serializer),
8616 }
8617 }
8618 }
8619
8620 impl<'de> serde::de::Deserialize<'de> for ResourceType {
8621 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8622 where
8623 D: serde::Deserializer<'de>,
8624 {
8625 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceType>::new(
8626 ".google.storage.control.v2.FindingSummary.SummaryDetails.ResourceType",
8627 ))
8628 }
8629 }
8630
8631 /// The value of the summary.
8632 #[derive(Clone, Debug, PartialEq)]
8633 #[non_exhaustive]
8634 pub enum Magnitude {
8635 /// The count of impacted resources.
8636 Count(i64),
8637 /// The percentage of impacted resources.
8638 Percentage(f32),
8639 }
8640
8641 impl Magnitude {
8642 /// Initializes the enum to the [Count](Self::Count) branch.
8643 pub fn from_count(value: impl std::convert::Into<i64>) -> Self {
8644 Self::Count(value.into())
8645 }
8646 /// Initializes the enum to the [Percentage](Self::Percentage) branch.
8647 pub fn from_percentage(value: impl std::convert::Into<f32>) -> Self {
8648 Self::Percentage(value.into())
8649 }
8650 }
8651 }
8652}
8653
8654/// List the finding types.
8655///
8656/// # Working with unknown values
8657///
8658/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8659/// additional enum variants at any time. Adding new variants is not considered
8660/// a breaking change. Applications should write their code in anticipation of:
8661///
8662/// - New values appearing in future releases of the client library, **and**
8663/// - New values received dynamically, without application changes.
8664///
8665/// Please consult the [Working with enums] section in the user guide for some
8666/// guidelines.
8667///
8668/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8669#[derive(Clone, Debug, PartialEq)]
8670#[non_exhaustive]
8671pub enum FindingType {
8672 /// Finding type is unspecified.
8673 Unspecified,
8674 /// Finding is about a spike in Class A/B operations on Coldline or Archive
8675 /// Cloud Storage objects.
8676 ColdlineAndArchivalStorageOperationsSpike,
8677 /// Finding is about a spike in throttled requests (429 errors) within a
8678 /// project.
8679 ThrottledRequestSpike,
8680 /// Finding is about a spike in cross region egress in Cloud Storage.
8681 CrossRegionEgressSpike,
8682 /// Finding is about growth in storage above the expected trend.
8683 StorageGrowthAboveTrend,
8684 /// If set, the enum was initialized with an unknown value.
8685 ///
8686 /// Applications can examine the value using [FindingType::value] or
8687 /// [FindingType::name].
8688 UnknownValue(finding_type::UnknownValue),
8689}
8690
8691#[doc(hidden)]
8692pub mod finding_type {
8693 #[allow(unused_imports)]
8694 use super::*;
8695 #[derive(Clone, Debug, PartialEq)]
8696 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8697}
8698
8699impl FindingType {
8700 /// Gets the enum value.
8701 ///
8702 /// Returns `None` if the enum contains an unknown value deserialized from
8703 /// the string representation of enums.
8704 pub fn value(&self) -> std::option::Option<i32> {
8705 match self {
8706 Self::Unspecified => std::option::Option::Some(0),
8707 Self::ColdlineAndArchivalStorageOperationsSpike => std::option::Option::Some(1),
8708 Self::ThrottledRequestSpike => std::option::Option::Some(2),
8709 Self::CrossRegionEgressSpike => std::option::Option::Some(3),
8710 Self::StorageGrowthAboveTrend => std::option::Option::Some(4),
8711 Self::UnknownValue(u) => u.0.value(),
8712 }
8713 }
8714
8715 /// Gets the enum value as a string.
8716 ///
8717 /// Returns `None` if the enum contains an unknown value deserialized from
8718 /// the integer representation of enums.
8719 pub fn name(&self) -> std::option::Option<&str> {
8720 match self {
8721 Self::Unspecified => std::option::Option::Some("FINDING_TYPE_UNSPECIFIED"),
8722 Self::ColdlineAndArchivalStorageOperationsSpike => std::option::Option::Some(
8723 "FINDING_TYPE_COLDLINE_AND_ARCHIVAL_STORAGE_OPERATIONS_SPIKE",
8724 ),
8725 Self::ThrottledRequestSpike => {
8726 std::option::Option::Some("FINDING_TYPE_THROTTLED_REQUEST_SPIKE")
8727 }
8728 Self::CrossRegionEgressSpike => {
8729 std::option::Option::Some("FINDING_TYPE_CROSS_REGION_EGRESS_SPIKE")
8730 }
8731 Self::StorageGrowthAboveTrend => {
8732 std::option::Option::Some("FINDING_TYPE_STORAGE_GROWTH_ABOVE_TREND")
8733 }
8734 Self::UnknownValue(u) => u.0.name(),
8735 }
8736 }
8737}
8738
8739impl std::default::Default for FindingType {
8740 fn default() -> Self {
8741 use std::convert::From;
8742 Self::from(0)
8743 }
8744}
8745
8746impl std::fmt::Display for FindingType {
8747 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8748 wkt::internal::display_enum(f, self.name(), self.value())
8749 }
8750}
8751
8752impl std::convert::From<i32> for FindingType {
8753 fn from(value: i32) -> Self {
8754 match value {
8755 0 => Self::Unspecified,
8756 1 => Self::ColdlineAndArchivalStorageOperationsSpike,
8757 2 => Self::ThrottledRequestSpike,
8758 3 => Self::CrossRegionEgressSpike,
8759 4 => Self::StorageGrowthAboveTrend,
8760 _ => Self::UnknownValue(finding_type::UnknownValue(
8761 wkt::internal::UnknownEnumValue::Integer(value),
8762 )),
8763 }
8764 }
8765}
8766
8767impl std::convert::From<&str> for FindingType {
8768 fn from(value: &str) -> Self {
8769 use std::string::ToString;
8770 match value {
8771 "FINDING_TYPE_UNSPECIFIED" => Self::Unspecified,
8772 "FINDING_TYPE_COLDLINE_AND_ARCHIVAL_STORAGE_OPERATIONS_SPIKE" => {
8773 Self::ColdlineAndArchivalStorageOperationsSpike
8774 }
8775 "FINDING_TYPE_THROTTLED_REQUEST_SPIKE" => Self::ThrottledRequestSpike,
8776 "FINDING_TYPE_CROSS_REGION_EGRESS_SPIKE" => Self::CrossRegionEgressSpike,
8777 "FINDING_TYPE_STORAGE_GROWTH_ABOVE_TREND" => Self::StorageGrowthAboveTrend,
8778 _ => Self::UnknownValue(finding_type::UnknownValue(
8779 wkt::internal::UnknownEnumValue::String(value.to_string()),
8780 )),
8781 }
8782 }
8783}
8784
8785impl serde::ser::Serialize for FindingType {
8786 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8787 where
8788 S: serde::Serializer,
8789 {
8790 match self {
8791 Self::Unspecified => serializer.serialize_i32(0),
8792 Self::ColdlineAndArchivalStorageOperationsSpike => serializer.serialize_i32(1),
8793 Self::ThrottledRequestSpike => serializer.serialize_i32(2),
8794 Self::CrossRegionEgressSpike => serializer.serialize_i32(3),
8795 Self::StorageGrowthAboveTrend => serializer.serialize_i32(4),
8796 Self::UnknownValue(u) => u.0.serialize(serializer),
8797 }
8798 }
8799}
8800
8801impl<'de> serde::de::Deserialize<'de> for FindingType {
8802 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8803 where
8804 D: serde::Deserializer<'de>,
8805 {
8806 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingType>::new(
8807 ".google.storage.control.v2.FindingType",
8808 ))
8809 }
8810}
8811
8812/// List of categories a finding falls under.
8813///
8814/// # Working with unknown values
8815///
8816/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8817/// additional enum variants at any time. Adding new variants is not considered
8818/// a breaking change. Applications should write their code in anticipation of:
8819///
8820/// - New values appearing in future releases of the client library, **and**
8821/// - New values received dynamically, without application changes.
8822///
8823/// Please consult the [Working with enums] section in the user guide for some
8824/// guidelines.
8825///
8826/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8827#[derive(Clone, Debug, PartialEq)]
8828#[non_exhaustive]
8829pub enum FindingCategory {
8830 /// Category is unspecified.
8831 Unspecified,
8832 /// Category is 'Data Management'.
8833 DataManagement,
8834 /// Category is 'Performance'.
8835 Performance,
8836 /// If set, the enum was initialized with an unknown value.
8837 ///
8838 /// Applications can examine the value using [FindingCategory::value] or
8839 /// [FindingCategory::name].
8840 UnknownValue(finding_category::UnknownValue),
8841}
8842
8843#[doc(hidden)]
8844pub mod finding_category {
8845 #[allow(unused_imports)]
8846 use super::*;
8847 #[derive(Clone, Debug, PartialEq)]
8848 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8849}
8850
8851impl FindingCategory {
8852 /// Gets the enum value.
8853 ///
8854 /// Returns `None` if the enum contains an unknown value deserialized from
8855 /// the string representation of enums.
8856 pub fn value(&self) -> std::option::Option<i32> {
8857 match self {
8858 Self::Unspecified => std::option::Option::Some(0),
8859 Self::DataManagement => std::option::Option::Some(1),
8860 Self::Performance => std::option::Option::Some(2),
8861 Self::UnknownValue(u) => u.0.value(),
8862 }
8863 }
8864
8865 /// Gets the enum value as a string.
8866 ///
8867 /// Returns `None` if the enum contains an unknown value deserialized from
8868 /// the integer representation of enums.
8869 pub fn name(&self) -> std::option::Option<&str> {
8870 match self {
8871 Self::Unspecified => std::option::Option::Some("FINDING_CATEGORY_UNSPECIFIED"),
8872 Self::DataManagement => std::option::Option::Some("FINDING_CATEGORY_DATA_MANAGEMENT"),
8873 Self::Performance => std::option::Option::Some("FINDING_CATEGORY_PERFORMANCE"),
8874 Self::UnknownValue(u) => u.0.name(),
8875 }
8876 }
8877}
8878
8879impl std::default::Default for FindingCategory {
8880 fn default() -> Self {
8881 use std::convert::From;
8882 Self::from(0)
8883 }
8884}
8885
8886impl std::fmt::Display for FindingCategory {
8887 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8888 wkt::internal::display_enum(f, self.name(), self.value())
8889 }
8890}
8891
8892impl std::convert::From<i32> for FindingCategory {
8893 fn from(value: i32) -> Self {
8894 match value {
8895 0 => Self::Unspecified,
8896 1 => Self::DataManagement,
8897 2 => Self::Performance,
8898 _ => Self::UnknownValue(finding_category::UnknownValue(
8899 wkt::internal::UnknownEnumValue::Integer(value),
8900 )),
8901 }
8902 }
8903}
8904
8905impl std::convert::From<&str> for FindingCategory {
8906 fn from(value: &str) -> Self {
8907 use std::string::ToString;
8908 match value {
8909 "FINDING_CATEGORY_UNSPECIFIED" => Self::Unspecified,
8910 "FINDING_CATEGORY_DATA_MANAGEMENT" => Self::DataManagement,
8911 "FINDING_CATEGORY_PERFORMANCE" => Self::Performance,
8912 _ => Self::UnknownValue(finding_category::UnknownValue(
8913 wkt::internal::UnknownEnumValue::String(value.to_string()),
8914 )),
8915 }
8916 }
8917}
8918
8919impl serde::ser::Serialize for FindingCategory {
8920 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8921 where
8922 S: serde::Serializer,
8923 {
8924 match self {
8925 Self::Unspecified => serializer.serialize_i32(0),
8926 Self::DataManagement => serializer.serialize_i32(1),
8927 Self::Performance => serializer.serialize_i32(2),
8928 Self::UnknownValue(u) => u.0.serialize(serializer),
8929 }
8930 }
8931}
8932
8933impl<'de> serde::de::Deserialize<'de> for FindingCategory {
8934 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8935 where
8936 D: serde::Deserializer<'de>,
8937 {
8938 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingCategory>::new(
8939 ".google.storage.control.v2.FindingCategory",
8940 ))
8941 }
8942}
8943
8944/// Severity of the `IntelligenceFinding` resource.
8945///
8946/// # Working with unknown values
8947///
8948/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8949/// additional enum variants at any time. Adding new variants is not considered
8950/// a breaking change. Applications should write their code in anticipation of:
8951///
8952/// - New values appearing in future releases of the client library, **and**
8953/// - New values received dynamically, without application changes.
8954///
8955/// Please consult the [Working with enums] section in the user guide for some
8956/// guidelines.
8957///
8958/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8959#[derive(Clone, Debug, PartialEq)]
8960#[non_exhaustive]
8961pub enum FindingSeverity {
8962 /// Severity is unspecified.
8963 Unspecified,
8964 /// Severity is critical.
8965 Critical,
8966 /// If set, the enum was initialized with an unknown value.
8967 ///
8968 /// Applications can examine the value using [FindingSeverity::value] or
8969 /// [FindingSeverity::name].
8970 UnknownValue(finding_severity::UnknownValue),
8971}
8972
8973#[doc(hidden)]
8974pub mod finding_severity {
8975 #[allow(unused_imports)]
8976 use super::*;
8977 #[derive(Clone, Debug, PartialEq)]
8978 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8979}
8980
8981impl FindingSeverity {
8982 /// Gets the enum value.
8983 ///
8984 /// Returns `None` if the enum contains an unknown value deserialized from
8985 /// the string representation of enums.
8986 pub fn value(&self) -> std::option::Option<i32> {
8987 match self {
8988 Self::Unspecified => std::option::Option::Some(0),
8989 Self::Critical => std::option::Option::Some(1),
8990 Self::UnknownValue(u) => u.0.value(),
8991 }
8992 }
8993
8994 /// Gets the enum value as a string.
8995 ///
8996 /// Returns `None` if the enum contains an unknown value deserialized from
8997 /// the integer representation of enums.
8998 pub fn name(&self) -> std::option::Option<&str> {
8999 match self {
9000 Self::Unspecified => std::option::Option::Some("FINDING_SEVERITY_UNSPECIFIED"),
9001 Self::Critical => std::option::Option::Some("FINDING_SEVERITY_CRITICAL"),
9002 Self::UnknownValue(u) => u.0.name(),
9003 }
9004 }
9005}
9006
9007impl std::default::Default for FindingSeverity {
9008 fn default() -> Self {
9009 use std::convert::From;
9010 Self::from(0)
9011 }
9012}
9013
9014impl std::fmt::Display for FindingSeverity {
9015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9016 wkt::internal::display_enum(f, self.name(), self.value())
9017 }
9018}
9019
9020impl std::convert::From<i32> for FindingSeverity {
9021 fn from(value: i32) -> Self {
9022 match value {
9023 0 => Self::Unspecified,
9024 1 => Self::Critical,
9025 _ => Self::UnknownValue(finding_severity::UnknownValue(
9026 wkt::internal::UnknownEnumValue::Integer(value),
9027 )),
9028 }
9029 }
9030}
9031
9032impl std::convert::From<&str> for FindingSeverity {
9033 fn from(value: &str) -> Self {
9034 use std::string::ToString;
9035 match value {
9036 "FINDING_SEVERITY_UNSPECIFIED" => Self::Unspecified,
9037 "FINDING_SEVERITY_CRITICAL" => Self::Critical,
9038 _ => Self::UnknownValue(finding_severity::UnknownValue(
9039 wkt::internal::UnknownEnumValue::String(value.to_string()),
9040 )),
9041 }
9042 }
9043}
9044
9045impl serde::ser::Serialize for FindingSeverity {
9046 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9047 where
9048 S: serde::Serializer,
9049 {
9050 match self {
9051 Self::Unspecified => serializer.serialize_i32(0),
9052 Self::Critical => serializer.serialize_i32(1),
9053 Self::UnknownValue(u) => u.0.serialize(serializer),
9054 }
9055 }
9056}
9057
9058impl<'de> serde::de::Deserialize<'de> for FindingSeverity {
9059 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9060 where
9061 D: serde::Deserializer<'de>,
9062 {
9063 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingSeverity>::new(
9064 ".google.storage.control.v2.FindingSeverity",
9065 ))
9066 }
9067}