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