google_cloud_storage/generated/gapic_control/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21
22mod debug;
23mod deserialize;
24mod serialize;
25
26/// Contains information about a pending rename operation.
27#[derive(Clone, Default, PartialEq)]
28#[non_exhaustive]
29pub struct PendingRenameInfo {
30 /// Output only. The name of the rename operation.
31 pub operation: std::string::String,
32
33 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34}
35
36impl PendingRenameInfo {
37 /// Creates a new default instance.
38 pub fn new() -> Self {
39 std::default::Default::default()
40 }
41
42 /// Sets the value of [operation][crate::model::PendingRenameInfo::operation].
43 ///
44 /// # Example
45 /// ```ignore,no_run
46 /// # use google_cloud_storage::model::PendingRenameInfo;
47 /// let x = PendingRenameInfo::new().set_operation("example");
48 /// ```
49 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
50 self.operation = v.into();
51 self
52 }
53}
54
55impl wkt::message::Message for PendingRenameInfo {
56 fn typename() -> &'static str {
57 "type.googleapis.com/google.storage.control.v2.PendingRenameInfo"
58 }
59}
60
61/// A folder resource. This resource can only exist in a hierarchical namespace
62/// enabled bucket.
63#[derive(Clone, Default, PartialEq)]
64#[non_exhaustive]
65pub struct Folder {
66 /// Identifier. The name of this folder.
67 /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
68 pub name: std::string::String,
69
70 /// Output only. The version of the metadata for this folder. Used for
71 /// preconditions and for detecting changes in metadata.
72 pub metageneration: i64,
73
74 /// Output only. The creation time of the folder.
75 pub create_time: std::option::Option<wkt::Timestamp>,
76
77 /// Output only. The modification time of the folder.
78 pub update_time: std::option::Option<wkt::Timestamp>,
79
80 /// Output only. Only present if the folder is part of an ongoing RenameFolder
81 /// operation. Contains information which can be used to query the operation
82 /// status. The presence of this field also indicates all write operations are
83 /// blocked for this folder, including folder, managed folder, and object
84 /// operations.
85 pub pending_rename_info: std::option::Option<crate::model::PendingRenameInfo>,
86
87 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
88}
89
90impl Folder {
91 /// Creates a new default instance.
92 pub fn new() -> Self {
93 std::default::Default::default()
94 }
95
96 /// Sets the value of [name][crate::model::Folder::name].
97 ///
98 /// # Example
99 /// ```ignore,no_run
100 /// # use google_cloud_storage::model::Folder;
101 /// # let project_id = "project_id";
102 /// # let bucket_id = "bucket_id";
103 /// # let folder_id = "folder_id";
104 /// let x = Folder::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
105 /// ```
106 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
107 self.name = v.into();
108 self
109 }
110
111 /// Sets the value of [metageneration][crate::model::Folder::metageneration].
112 ///
113 /// # Example
114 /// ```ignore,no_run
115 /// # use google_cloud_storage::model::Folder;
116 /// let x = Folder::new().set_metageneration(42);
117 /// ```
118 pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
119 self.metageneration = v.into();
120 self
121 }
122
123 /// Sets the value of [create_time][crate::model::Folder::create_time].
124 ///
125 /// # Example
126 /// ```ignore,no_run
127 /// # use google_cloud_storage::model::Folder;
128 /// use wkt::Timestamp;
129 /// let x = Folder::new().set_create_time(Timestamp::default()/* use setters */);
130 /// ```
131 pub fn set_create_time<T>(mut self, v: T) -> Self
132 where
133 T: std::convert::Into<wkt::Timestamp>,
134 {
135 self.create_time = std::option::Option::Some(v.into());
136 self
137 }
138
139 /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
140 ///
141 /// # Example
142 /// ```ignore,no_run
143 /// # use google_cloud_storage::model::Folder;
144 /// use wkt::Timestamp;
145 /// let x = Folder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
146 /// let x = Folder::new().set_or_clear_create_time(None::<Timestamp>);
147 /// ```
148 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
149 where
150 T: std::convert::Into<wkt::Timestamp>,
151 {
152 self.create_time = v.map(|x| x.into());
153 self
154 }
155
156 /// Sets the value of [update_time][crate::model::Folder::update_time].
157 ///
158 /// # Example
159 /// ```ignore,no_run
160 /// # use google_cloud_storage::model::Folder;
161 /// use wkt::Timestamp;
162 /// let x = Folder::new().set_update_time(Timestamp::default()/* use setters */);
163 /// ```
164 pub fn set_update_time<T>(mut self, v: T) -> Self
165 where
166 T: std::convert::Into<wkt::Timestamp>,
167 {
168 self.update_time = std::option::Option::Some(v.into());
169 self
170 }
171
172 /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
173 ///
174 /// # Example
175 /// ```ignore,no_run
176 /// # use google_cloud_storage::model::Folder;
177 /// use wkt::Timestamp;
178 /// let x = Folder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
179 /// let x = Folder::new().set_or_clear_update_time(None::<Timestamp>);
180 /// ```
181 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
182 where
183 T: std::convert::Into<wkt::Timestamp>,
184 {
185 self.update_time = v.map(|x| x.into());
186 self
187 }
188
189 /// Sets the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
190 ///
191 /// # Example
192 /// ```ignore,no_run
193 /// # use google_cloud_storage::model::Folder;
194 /// use google_cloud_storage::model::PendingRenameInfo;
195 /// let x = Folder::new().set_pending_rename_info(PendingRenameInfo::default()/* use setters */);
196 /// ```
197 pub fn set_pending_rename_info<T>(mut self, v: T) -> Self
198 where
199 T: std::convert::Into<crate::model::PendingRenameInfo>,
200 {
201 self.pending_rename_info = std::option::Option::Some(v.into());
202 self
203 }
204
205 /// Sets or clears the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
206 ///
207 /// # Example
208 /// ```ignore,no_run
209 /// # use google_cloud_storage::model::Folder;
210 /// use google_cloud_storage::model::PendingRenameInfo;
211 /// let x = Folder::new().set_or_clear_pending_rename_info(Some(PendingRenameInfo::default()/* use setters */));
212 /// let x = Folder::new().set_or_clear_pending_rename_info(None::<PendingRenameInfo>);
213 /// ```
214 pub fn set_or_clear_pending_rename_info<T>(mut self, v: std::option::Option<T>) -> Self
215 where
216 T: std::convert::Into<crate::model::PendingRenameInfo>,
217 {
218 self.pending_rename_info = v.map(|x| x.into());
219 self
220 }
221}
222
223impl wkt::message::Message for Folder {
224 fn typename() -> &'static str {
225 "type.googleapis.com/google.storage.control.v2.Folder"
226 }
227}
228
229/// Request message for GetFolder. This operation is only applicable to a
230/// hierarchical namespace enabled bucket.
231#[derive(Clone, Default, PartialEq)]
232#[non_exhaustive]
233pub struct GetFolderRequest {
234 /// Required. Name of the folder.
235 /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
236 pub name: std::string::String,
237
238 /// Makes the operation only succeed conditional on whether the folder's
239 /// current metageneration matches the given value.
240 pub if_metageneration_match: std::option::Option<i64>,
241
242 /// Makes the operation only succeed conditional on whether the folder's
243 /// current metageneration does not match the given value.
244 pub if_metageneration_not_match: std::option::Option<i64>,
245
246 /// Optional. A unique identifier for this request. UUID is the recommended
247 /// format, but other formats are still accepted.
248 pub request_id: std::string::String,
249
250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
251}
252
253impl GetFolderRequest {
254 /// Creates a new default instance.
255 pub fn new() -> Self {
256 std::default::Default::default()
257 }
258
259 /// Sets the value of [name][crate::model::GetFolderRequest::name].
260 ///
261 /// # Example
262 /// ```ignore,no_run
263 /// # use google_cloud_storage::model::GetFolderRequest;
264 /// # let project_id = "project_id";
265 /// # let bucket_id = "bucket_id";
266 /// # let folder_id = "folder_id";
267 /// let x = GetFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
268 /// ```
269 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
270 self.name = v.into();
271 self
272 }
273
274 /// Sets the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
275 ///
276 /// # Example
277 /// ```ignore,no_run
278 /// # use google_cloud_storage::model::GetFolderRequest;
279 /// let x = GetFolderRequest::new().set_if_metageneration_match(42);
280 /// ```
281 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
282 where
283 T: std::convert::Into<i64>,
284 {
285 self.if_metageneration_match = std::option::Option::Some(v.into());
286 self
287 }
288
289 /// Sets or clears the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
290 ///
291 /// # Example
292 /// ```ignore,no_run
293 /// # use google_cloud_storage::model::GetFolderRequest;
294 /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
295 /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
296 /// ```
297 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
298 where
299 T: std::convert::Into<i64>,
300 {
301 self.if_metageneration_match = v.map(|x| x.into());
302 self
303 }
304
305 /// Sets the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
306 ///
307 /// # Example
308 /// ```ignore,no_run
309 /// # use google_cloud_storage::model::GetFolderRequest;
310 /// let x = GetFolderRequest::new().set_if_metageneration_not_match(42);
311 /// ```
312 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
313 where
314 T: std::convert::Into<i64>,
315 {
316 self.if_metageneration_not_match = std::option::Option::Some(v.into());
317 self
318 }
319
320 /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
321 ///
322 /// # Example
323 /// ```ignore,no_run
324 /// # use google_cloud_storage::model::GetFolderRequest;
325 /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
326 /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
327 /// ```
328 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
329 where
330 T: std::convert::Into<i64>,
331 {
332 self.if_metageneration_not_match = v.map(|x| x.into());
333 self
334 }
335
336 /// Sets the value of [request_id][crate::model::GetFolderRequest::request_id].
337 ///
338 /// # Example
339 /// ```ignore,no_run
340 /// # use google_cloud_storage::model::GetFolderRequest;
341 /// let x = GetFolderRequest::new().set_request_id("example");
342 /// ```
343 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
344 self.request_id = v.into();
345 self
346 }
347}
348
349impl wkt::message::Message for GetFolderRequest {
350 fn typename() -> &'static str {
351 "type.googleapis.com/google.storage.control.v2.GetFolderRequest"
352 }
353}
354
355/// Request message for CreateFolder. This operation is only applicable to a
356/// hierarchical namespace enabled bucket.
357#[derive(Clone, Default, PartialEq)]
358#[non_exhaustive]
359pub struct CreateFolderRequest {
360 /// Required. Name of the bucket in which the folder will reside. The bucket
361 /// must be a hierarchical namespace enabled bucket.
362 pub parent: std::string::String,
363
364 /// Required. Properties of the new folder being created.
365 /// The bucket and name of the folder are specified in the parent and folder_id
366 /// fields, respectively. Populating those fields in `folder` will result in an
367 /// error.
368 pub folder: std::option::Option<crate::model::Folder>,
369
370 /// Required. The full name of a folder, including all its parent folders.
371 /// Folders use single '/' characters as a delimiter.
372 /// The folder_id must end with a slash.
373 /// For example, the folder_id of "books/biographies/" would create a new
374 /// "biographies/" folder under the "books/" folder.
375 pub folder_id: std::string::String,
376
377 /// Optional. If true, parent folder doesn't have to be present and all missing
378 /// ancestor folders will be created atomically.
379 pub recursive: bool,
380
381 /// Optional. A unique identifier for this request. UUID is the recommended
382 /// format, but other formats are still accepted.
383 pub request_id: std::string::String,
384
385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
386}
387
388impl CreateFolderRequest {
389 /// Creates a new default instance.
390 pub fn new() -> Self {
391 std::default::Default::default()
392 }
393
394 /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
395 ///
396 /// # Example
397 /// ```ignore,no_run
398 /// # use google_cloud_storage::model::CreateFolderRequest;
399 /// # let project_id = "project_id";
400 /// # let bucket_id = "bucket_id";
401 /// let x = CreateFolderRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
402 /// ```
403 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
404 self.parent = v.into();
405 self
406 }
407
408 /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
409 ///
410 /// # Example
411 /// ```ignore,no_run
412 /// # use google_cloud_storage::model::CreateFolderRequest;
413 /// use google_cloud_storage::model::Folder;
414 /// let x = CreateFolderRequest::new().set_folder(Folder::default()/* use setters */);
415 /// ```
416 pub fn set_folder<T>(mut self, v: T) -> Self
417 where
418 T: std::convert::Into<crate::model::Folder>,
419 {
420 self.folder = std::option::Option::Some(v.into());
421 self
422 }
423
424 /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_storage::model::CreateFolderRequest;
429 /// use google_cloud_storage::model::Folder;
430 /// let x = CreateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
431 /// let x = CreateFolderRequest::new().set_or_clear_folder(None::<Folder>);
432 /// ```
433 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
434 where
435 T: std::convert::Into<crate::model::Folder>,
436 {
437 self.folder = v.map(|x| x.into());
438 self
439 }
440
441 /// Sets the value of [folder_id][crate::model::CreateFolderRequest::folder_id].
442 ///
443 /// # Example
444 /// ```ignore,no_run
445 /// # use google_cloud_storage::model::CreateFolderRequest;
446 /// let x = CreateFolderRequest::new().set_folder_id("example");
447 /// ```
448 pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
449 self.folder_id = v.into();
450 self
451 }
452
453 /// Sets the value of [recursive][crate::model::CreateFolderRequest::recursive].
454 ///
455 /// # Example
456 /// ```ignore,no_run
457 /// # use google_cloud_storage::model::CreateFolderRequest;
458 /// let x = CreateFolderRequest::new().set_recursive(true);
459 /// ```
460 pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
461 self.recursive = v.into();
462 self
463 }
464
465 /// Sets the value of [request_id][crate::model::CreateFolderRequest::request_id].
466 ///
467 /// # Example
468 /// ```ignore,no_run
469 /// # use google_cloud_storage::model::CreateFolderRequest;
470 /// let x = CreateFolderRequest::new().set_request_id("example");
471 /// ```
472 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
473 self.request_id = v.into();
474 self
475 }
476}
477
478impl wkt::message::Message for CreateFolderRequest {
479 fn typename() -> &'static str {
480 "type.googleapis.com/google.storage.control.v2.CreateFolderRequest"
481 }
482}
483
484/// Request message for DeleteFolder. This operation is only applicable to a
485/// hierarchical namespace enabled bucket.
486#[derive(Clone, Default, PartialEq)]
487#[non_exhaustive]
488pub struct DeleteFolderRequest {
489 /// Required. Name of the folder.
490 /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
491 pub name: std::string::String,
492
493 /// Makes the operation only succeed conditional on whether the folder's
494 /// current metageneration matches the given value.
495 pub if_metageneration_match: std::option::Option<i64>,
496
497 /// Makes the operation only succeed conditional on whether the folder's
498 /// current metageneration does not match the given value.
499 pub if_metageneration_not_match: std::option::Option<i64>,
500
501 /// Optional. A unique identifier for this request. UUID is the recommended
502 /// format, but other formats are still accepted.
503 pub request_id: std::string::String,
504
505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
506}
507
508impl DeleteFolderRequest {
509 /// Creates a new default instance.
510 pub fn new() -> Self {
511 std::default::Default::default()
512 }
513
514 /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
515 ///
516 /// # Example
517 /// ```ignore,no_run
518 /// # use google_cloud_storage::model::DeleteFolderRequest;
519 /// # let project_id = "project_id";
520 /// # let bucket_id = "bucket_id";
521 /// # let folder_id = "folder_id";
522 /// let x = DeleteFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
523 /// ```
524 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
525 self.name = v.into();
526 self
527 }
528
529 /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
530 ///
531 /// # Example
532 /// ```ignore,no_run
533 /// # use google_cloud_storage::model::DeleteFolderRequest;
534 /// let x = DeleteFolderRequest::new().set_if_metageneration_match(42);
535 /// ```
536 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
537 where
538 T: std::convert::Into<i64>,
539 {
540 self.if_metageneration_match = std::option::Option::Some(v.into());
541 self
542 }
543
544 /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
545 ///
546 /// # Example
547 /// ```ignore,no_run
548 /// # use google_cloud_storage::model::DeleteFolderRequest;
549 /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
550 /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
551 /// ```
552 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
553 where
554 T: std::convert::Into<i64>,
555 {
556 self.if_metageneration_match = v.map(|x| x.into());
557 self
558 }
559
560 /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
561 ///
562 /// # Example
563 /// ```ignore,no_run
564 /// # use google_cloud_storage::model::DeleteFolderRequest;
565 /// let x = DeleteFolderRequest::new().set_if_metageneration_not_match(42);
566 /// ```
567 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
568 where
569 T: std::convert::Into<i64>,
570 {
571 self.if_metageneration_not_match = std::option::Option::Some(v.into());
572 self
573 }
574
575 /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
576 ///
577 /// # Example
578 /// ```ignore,no_run
579 /// # use google_cloud_storage::model::DeleteFolderRequest;
580 /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
581 /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
582 /// ```
583 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
584 where
585 T: std::convert::Into<i64>,
586 {
587 self.if_metageneration_not_match = v.map(|x| x.into());
588 self
589 }
590
591 /// Sets the value of [request_id][crate::model::DeleteFolderRequest::request_id].
592 ///
593 /// # Example
594 /// ```ignore,no_run
595 /// # use google_cloud_storage::model::DeleteFolderRequest;
596 /// let x = DeleteFolderRequest::new().set_request_id("example");
597 /// ```
598 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
599 self.request_id = v.into();
600 self
601 }
602}
603
604impl wkt::message::Message for DeleteFolderRequest {
605 fn typename() -> &'static str {
606 "type.googleapis.com/google.storage.control.v2.DeleteFolderRequest"
607 }
608}
609
610/// Request message for ListFolders. This operation is only applicable to a
611/// hierarchical namespace enabled bucket.
612#[derive(Clone, Default, PartialEq)]
613#[non_exhaustive]
614pub struct ListFoldersRequest {
615 /// Required. Name of the bucket in which to look for folders. The bucket must
616 /// be a hierarchical namespace enabled bucket.
617 pub parent: std::string::String,
618
619 /// Optional. Maximum number of folders to return in a single response. The
620 /// service will use this parameter or 1,000 items, whichever is smaller.
621 pub page_size: i32,
622
623 /// Optional. A previously-returned page token representing part of the larger
624 /// set of results to view.
625 pub page_token: std::string::String,
626
627 /// Optional. Filter results to folders whose names begin with this prefix.
628 /// If set, the value must either be an empty string or end with a '/'.
629 pub prefix: std::string::String,
630
631 /// Optional. If set, returns results in a directory-like mode. The results
632 /// will only include folders that either exactly match the above prefix, or
633 /// are one level below the prefix. The only supported value is '/'.
634 pub delimiter: std::string::String,
635
636 /// Optional. Filter results to folders whose names are lexicographically equal
637 /// to or after lexicographic_start. If lexicographic_end is also set, the
638 /// folders listed have names between lexicographic_start (inclusive) and
639 /// lexicographic_end (exclusive).
640 pub lexicographic_start: std::string::String,
641
642 /// Optional. Filter results to folders whose names are lexicographically
643 /// before lexicographic_end. If lexicographic_start is also set, the folders
644 /// listed have names between lexicographic_start (inclusive) and
645 /// lexicographic_end (exclusive).
646 pub lexicographic_end: std::string::String,
647
648 /// Optional. A unique identifier for this request. UUID is the recommended
649 /// format, but other formats are still accepted.
650 pub request_id: std::string::String,
651
652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
653}
654
655impl ListFoldersRequest {
656 /// Creates a new default instance.
657 pub fn new() -> Self {
658 std::default::Default::default()
659 }
660
661 /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
662 ///
663 /// # Example
664 /// ```ignore,no_run
665 /// # use google_cloud_storage::model::ListFoldersRequest;
666 /// # let project_id = "project_id";
667 /// # let bucket_id = "bucket_id";
668 /// let x = ListFoldersRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
669 /// ```
670 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
671 self.parent = v.into();
672 self
673 }
674
675 /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
676 ///
677 /// # Example
678 /// ```ignore,no_run
679 /// # use google_cloud_storage::model::ListFoldersRequest;
680 /// let x = ListFoldersRequest::new().set_page_size(42);
681 /// ```
682 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
683 self.page_size = v.into();
684 self
685 }
686
687 /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
688 ///
689 /// # Example
690 /// ```ignore,no_run
691 /// # use google_cloud_storage::model::ListFoldersRequest;
692 /// let x = ListFoldersRequest::new().set_page_token("example");
693 /// ```
694 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
695 self.page_token = v.into();
696 self
697 }
698
699 /// Sets the value of [prefix][crate::model::ListFoldersRequest::prefix].
700 ///
701 /// # Example
702 /// ```ignore,no_run
703 /// # use google_cloud_storage::model::ListFoldersRequest;
704 /// let x = ListFoldersRequest::new().set_prefix("example");
705 /// ```
706 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
707 self.prefix = v.into();
708 self
709 }
710
711 /// Sets the value of [delimiter][crate::model::ListFoldersRequest::delimiter].
712 ///
713 /// # Example
714 /// ```ignore,no_run
715 /// # use google_cloud_storage::model::ListFoldersRequest;
716 /// let x = ListFoldersRequest::new().set_delimiter("example");
717 /// ```
718 pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
719 self.delimiter = v.into();
720 self
721 }
722
723 /// Sets the value of [lexicographic_start][crate::model::ListFoldersRequest::lexicographic_start].
724 ///
725 /// # Example
726 /// ```ignore,no_run
727 /// # use google_cloud_storage::model::ListFoldersRequest;
728 /// let x = ListFoldersRequest::new().set_lexicographic_start("example");
729 /// ```
730 pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
731 mut self,
732 v: T,
733 ) -> Self {
734 self.lexicographic_start = v.into();
735 self
736 }
737
738 /// Sets the value of [lexicographic_end][crate::model::ListFoldersRequest::lexicographic_end].
739 ///
740 /// # Example
741 /// ```ignore,no_run
742 /// # use google_cloud_storage::model::ListFoldersRequest;
743 /// let x = ListFoldersRequest::new().set_lexicographic_end("example");
744 /// ```
745 pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
746 mut self,
747 v: T,
748 ) -> Self {
749 self.lexicographic_end = v.into();
750 self
751 }
752
753 /// Sets the value of [request_id][crate::model::ListFoldersRequest::request_id].
754 ///
755 /// # Example
756 /// ```ignore,no_run
757 /// # use google_cloud_storage::model::ListFoldersRequest;
758 /// let x = ListFoldersRequest::new().set_request_id("example");
759 /// ```
760 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
761 self.request_id = v.into();
762 self
763 }
764}
765
766impl wkt::message::Message for ListFoldersRequest {
767 fn typename() -> &'static str {
768 "type.googleapis.com/google.storage.control.v2.ListFoldersRequest"
769 }
770}
771
772/// Response message for ListFolders.
773#[derive(Clone, Default, PartialEq)]
774#[non_exhaustive]
775pub struct ListFoldersResponse {
776 /// The list of child folders
777 pub folders: std::vec::Vec<crate::model::Folder>,
778
779 /// The continuation token, used to page through large result sets. Provide
780 /// this value in a subsequent request to return the next page of results.
781 pub next_page_token: std::string::String,
782
783 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
784}
785
786impl ListFoldersResponse {
787 /// Creates a new default instance.
788 pub fn new() -> Self {
789 std::default::Default::default()
790 }
791
792 /// Sets the value of [folders][crate::model::ListFoldersResponse::folders].
793 ///
794 /// # Example
795 /// ```ignore,no_run
796 /// # use google_cloud_storage::model::ListFoldersResponse;
797 /// use google_cloud_storage::model::Folder;
798 /// let x = ListFoldersResponse::new()
799 /// .set_folders([
800 /// Folder::default()/* use setters */,
801 /// Folder::default()/* use (different) setters */,
802 /// ]);
803 /// ```
804 pub fn set_folders<T, V>(mut self, v: T) -> Self
805 where
806 T: std::iter::IntoIterator<Item = V>,
807 V: std::convert::Into<crate::model::Folder>,
808 {
809 use std::iter::Iterator;
810 self.folders = v.into_iter().map(|i| i.into()).collect();
811 self
812 }
813
814 /// Sets the value of [next_page_token][crate::model::ListFoldersResponse::next_page_token].
815 ///
816 /// # Example
817 /// ```ignore,no_run
818 /// # use google_cloud_storage::model::ListFoldersResponse;
819 /// let x = ListFoldersResponse::new().set_next_page_token("example");
820 /// ```
821 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
822 self.next_page_token = v.into();
823 self
824 }
825}
826
827impl wkt::message::Message for ListFoldersResponse {
828 fn typename() -> &'static str {
829 "type.googleapis.com/google.storage.control.v2.ListFoldersResponse"
830 }
831}
832
833#[doc(hidden)]
834impl google_cloud_gax::paginator::internal::PageableResponse for ListFoldersResponse {
835 type PageItem = crate::model::Folder;
836
837 fn items(self) -> std::vec::Vec<Self::PageItem> {
838 self.folders
839 }
840
841 fn next_page_token(&self) -> std::string::String {
842 use std::clone::Clone;
843 self.next_page_token.clone()
844 }
845}
846
847/// Request message for RenameFolder. This operation is only applicable to a
848/// hierarchical namespace enabled bucket.
849#[derive(Clone, Default, PartialEq)]
850#[non_exhaustive]
851pub struct RenameFolderRequest {
852 /// Required. Name of the source folder being renamed.
853 /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
854 pub name: std::string::String,
855
856 /// Required. The destination folder ID, e.g. `foo/bar/`.
857 pub destination_folder_id: std::string::String,
858
859 /// Makes the operation only succeed conditional on whether the source
860 /// folder's current metageneration matches the given value.
861 pub if_metageneration_match: std::option::Option<i64>,
862
863 /// Makes the operation only succeed conditional on whether the source
864 /// folder's current metageneration does not match the given value.
865 pub if_metageneration_not_match: std::option::Option<i64>,
866
867 /// Optional. A unique identifier for this request. UUID is the recommended
868 /// format, but other formats are still accepted. This request is only
869 /// idempotent if a `request_id` is provided.
870 pub request_id: std::string::String,
871
872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
873}
874
875impl RenameFolderRequest {
876 /// Creates a new default instance.
877 pub fn new() -> Self {
878 std::default::Default::default()
879 }
880
881 /// Sets the value of [name][crate::model::RenameFolderRequest::name].
882 ///
883 /// # Example
884 /// ```ignore,no_run
885 /// # use google_cloud_storage::model::RenameFolderRequest;
886 /// # let project_id = "project_id";
887 /// # let bucket_id = "bucket_id";
888 /// # let folder_id = "folder_id";
889 /// let x = RenameFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
890 /// ```
891 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
892 self.name = v.into();
893 self
894 }
895
896 /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
897 ///
898 /// # Example
899 /// ```ignore,no_run
900 /// # use google_cloud_storage::model::RenameFolderRequest;
901 /// let x = RenameFolderRequest::new().set_destination_folder_id("example");
902 /// ```
903 pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
904 mut self,
905 v: T,
906 ) -> Self {
907 self.destination_folder_id = v.into();
908 self
909 }
910
911 /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
912 ///
913 /// # Example
914 /// ```ignore,no_run
915 /// # use google_cloud_storage::model::RenameFolderRequest;
916 /// let x = RenameFolderRequest::new().set_if_metageneration_match(42);
917 /// ```
918 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
919 where
920 T: std::convert::Into<i64>,
921 {
922 self.if_metageneration_match = std::option::Option::Some(v.into());
923 self
924 }
925
926 /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
927 ///
928 /// # Example
929 /// ```ignore,no_run
930 /// # use google_cloud_storage::model::RenameFolderRequest;
931 /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
932 /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
933 /// ```
934 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
935 where
936 T: std::convert::Into<i64>,
937 {
938 self.if_metageneration_match = v.map(|x| x.into());
939 self
940 }
941
942 /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
943 ///
944 /// # Example
945 /// ```ignore,no_run
946 /// # use google_cloud_storage::model::RenameFolderRequest;
947 /// let x = RenameFolderRequest::new().set_if_metageneration_not_match(42);
948 /// ```
949 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
950 where
951 T: std::convert::Into<i64>,
952 {
953 self.if_metageneration_not_match = std::option::Option::Some(v.into());
954 self
955 }
956
957 /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
958 ///
959 /// # Example
960 /// ```ignore,no_run
961 /// # use google_cloud_storage::model::RenameFolderRequest;
962 /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
963 /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
964 /// ```
965 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
966 where
967 T: std::convert::Into<i64>,
968 {
969 self.if_metageneration_not_match = v.map(|x| x.into());
970 self
971 }
972
973 /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
974 ///
975 /// # Example
976 /// ```ignore,no_run
977 /// # use google_cloud_storage::model::RenameFolderRequest;
978 /// let x = RenameFolderRequest::new().set_request_id("example");
979 /// ```
980 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
981 self.request_id = v.into();
982 self
983 }
984}
985
986impl wkt::message::Message for RenameFolderRequest {
987 fn typename() -> &'static str {
988 "type.googleapis.com/google.storage.control.v2.RenameFolderRequest"
989 }
990}
991
992/// Request message for DeleteFolderRecursive.
993#[derive(Clone, Default, PartialEq)]
994#[non_exhaustive]
995pub struct DeleteFolderRecursiveRequest {
996 /// Required. Name of the folder being deleted, however all of its contents
997 /// will be deleted too. Format:
998 /// `projects/{project}/buckets/{bucket}/folders/{folder}`
999 pub name: std::string::String,
1000
1001 /// Optional. Makes the operation only succeed conditional on whether the root
1002 /// folder's current metageneration matches the given value.
1003 pub if_metageneration_match: std::option::Option<i64>,
1004
1005 /// Optional. Makes the operation only succeed conditional on whether the root
1006 /// folder's current metageneration does not match the given value.
1007 pub if_metageneration_not_match: std::option::Option<i64>,
1008
1009 /// Optional. A unique identifier for this request. UUID is the recommended
1010 /// format, but other formats are still accepted.
1011 pub request_id: std::string::String,
1012
1013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1014}
1015
1016impl DeleteFolderRecursiveRequest {
1017 /// Creates a new default instance.
1018 pub fn new() -> Self {
1019 std::default::Default::default()
1020 }
1021
1022 /// Sets the value of [name][crate::model::DeleteFolderRecursiveRequest::name].
1023 ///
1024 /// # Example
1025 /// ```ignore,no_run
1026 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1027 /// # let project_id = "project_id";
1028 /// # let bucket_id = "bucket_id";
1029 /// # let folder_id = "folder_id";
1030 /// let x = DeleteFolderRecursiveRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/folders/{folder_id}"));
1031 /// ```
1032 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1033 self.name = v.into();
1034 self
1035 }
1036
1037 /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_match].
1038 ///
1039 /// # Example
1040 /// ```ignore,no_run
1041 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1042 /// let x = DeleteFolderRecursiveRequest::new().set_if_metageneration_match(42);
1043 /// ```
1044 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1045 where
1046 T: std::convert::Into<i64>,
1047 {
1048 self.if_metageneration_match = std::option::Option::Some(v.into());
1049 self
1050 }
1051
1052 /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_match].
1053 ///
1054 /// # Example
1055 /// ```ignore,no_run
1056 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1057 /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_match(Some(42));
1058 /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1059 /// ```
1060 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1061 where
1062 T: std::convert::Into<i64>,
1063 {
1064 self.if_metageneration_match = v.map(|x| x.into());
1065 self
1066 }
1067
1068 /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_not_match].
1069 ///
1070 /// # Example
1071 /// ```ignore,no_run
1072 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1073 /// let x = DeleteFolderRecursiveRequest::new().set_if_metageneration_not_match(42);
1074 /// ```
1075 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1076 where
1077 T: std::convert::Into<i64>,
1078 {
1079 self.if_metageneration_not_match = std::option::Option::Some(v.into());
1080 self
1081 }
1082
1083 /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_not_match].
1084 ///
1085 /// # Example
1086 /// ```ignore,no_run
1087 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1088 /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1089 /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1090 /// ```
1091 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1092 where
1093 T: std::convert::Into<i64>,
1094 {
1095 self.if_metageneration_not_match = v.map(|x| x.into());
1096 self
1097 }
1098
1099 /// Sets the value of [request_id][crate::model::DeleteFolderRecursiveRequest::request_id].
1100 ///
1101 /// # Example
1102 /// ```ignore,no_run
1103 /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1104 /// let x = DeleteFolderRecursiveRequest::new().set_request_id("example");
1105 /// ```
1106 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1107 self.request_id = v.into();
1108 self
1109 }
1110}
1111
1112impl wkt::message::Message for DeleteFolderRecursiveRequest {
1113 fn typename() -> &'static str {
1114 "type.googleapis.com/google.storage.control.v2.DeleteFolderRecursiveRequest"
1115 }
1116}
1117
1118/// The message contains metadata that is common to all Storage Control
1119/// long-running operations, present in its `google.longrunning.Operation`
1120/// messages, and accessible via `metadata.common_metadata`.
1121#[derive(Clone, Default, PartialEq)]
1122#[non_exhaustive]
1123pub struct CommonLongRunningOperationMetadata {
1124 /// Output only. The time the operation was created.
1125 pub create_time: std::option::Option<wkt::Timestamp>,
1126
1127 /// Output only. The time the operation finished running.
1128 pub end_time: std::option::Option<wkt::Timestamp>,
1129
1130 /// Output only. The time the operation was last modified.
1131 pub update_time: std::option::Option<wkt::Timestamp>,
1132
1133 /// Output only. The type of operation invoked.
1134 pub r#type: std::string::String,
1135
1136 /// Output only. Identifies whether the user has requested cancellation.
1137 pub requested_cancellation: bool,
1138
1139 /// Output only. The estimated progress of the operation in percentage [0,
1140 /// 100]. The value -1 means the progress is unknown.
1141 pub progress_percent: i32,
1142
1143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1144}
1145
1146impl CommonLongRunningOperationMetadata {
1147 /// Creates a new default instance.
1148 pub fn new() -> Self {
1149 std::default::Default::default()
1150 }
1151
1152 /// Sets the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
1153 ///
1154 /// # Example
1155 /// ```ignore,no_run
1156 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1157 /// use wkt::Timestamp;
1158 /// let x = CommonLongRunningOperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1159 /// ```
1160 pub fn set_create_time<T>(mut self, v: T) -> Self
1161 where
1162 T: std::convert::Into<wkt::Timestamp>,
1163 {
1164 self.create_time = std::option::Option::Some(v.into());
1165 self
1166 }
1167
1168 /// Sets or clears the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
1169 ///
1170 /// # Example
1171 /// ```ignore,no_run
1172 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1173 /// use wkt::Timestamp;
1174 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1175 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1176 /// ```
1177 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1178 where
1179 T: std::convert::Into<wkt::Timestamp>,
1180 {
1181 self.create_time = v.map(|x| x.into());
1182 self
1183 }
1184
1185 /// Sets the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
1186 ///
1187 /// # Example
1188 /// ```ignore,no_run
1189 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1190 /// use wkt::Timestamp;
1191 /// let x = CommonLongRunningOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1192 /// ```
1193 pub fn set_end_time<T>(mut self, v: T) -> Self
1194 where
1195 T: std::convert::Into<wkt::Timestamp>,
1196 {
1197 self.end_time = std::option::Option::Some(v.into());
1198 self
1199 }
1200
1201 /// Sets or clears the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
1202 ///
1203 /// # Example
1204 /// ```ignore,no_run
1205 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1206 /// use wkt::Timestamp;
1207 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1208 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1209 /// ```
1210 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1211 where
1212 T: std::convert::Into<wkt::Timestamp>,
1213 {
1214 self.end_time = v.map(|x| x.into());
1215 self
1216 }
1217
1218 /// Sets the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
1219 ///
1220 /// # Example
1221 /// ```ignore,no_run
1222 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1223 /// use wkt::Timestamp;
1224 /// let x = CommonLongRunningOperationMetadata::new().set_update_time(Timestamp::default()/* use setters */);
1225 /// ```
1226 pub fn set_update_time<T>(mut self, v: T) -> Self
1227 where
1228 T: std::convert::Into<wkt::Timestamp>,
1229 {
1230 self.update_time = std::option::Option::Some(v.into());
1231 self
1232 }
1233
1234 /// Sets or clears the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
1235 ///
1236 /// # Example
1237 /// ```ignore,no_run
1238 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1239 /// use wkt::Timestamp;
1240 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1241 /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_update_time(None::<Timestamp>);
1242 /// ```
1243 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1244 where
1245 T: std::convert::Into<wkt::Timestamp>,
1246 {
1247 self.update_time = v.map(|x| x.into());
1248 self
1249 }
1250
1251 /// Sets the value of [r#type][crate::model::CommonLongRunningOperationMetadata::type].
1252 ///
1253 /// # Example
1254 /// ```ignore,no_run
1255 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1256 /// let x = CommonLongRunningOperationMetadata::new().set_type("example");
1257 /// ```
1258 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1259 self.r#type = v.into();
1260 self
1261 }
1262
1263 /// Sets the value of [requested_cancellation][crate::model::CommonLongRunningOperationMetadata::requested_cancellation].
1264 ///
1265 /// # Example
1266 /// ```ignore,no_run
1267 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1268 /// let x = CommonLongRunningOperationMetadata::new().set_requested_cancellation(true);
1269 /// ```
1270 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1271 self.requested_cancellation = v.into();
1272 self
1273 }
1274
1275 /// Sets the value of [progress_percent][crate::model::CommonLongRunningOperationMetadata::progress_percent].
1276 ///
1277 /// # Example
1278 /// ```ignore,no_run
1279 /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1280 /// let x = CommonLongRunningOperationMetadata::new().set_progress_percent(42);
1281 /// ```
1282 pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1283 self.progress_percent = v.into();
1284 self
1285 }
1286}
1287
1288impl wkt::message::Message for CommonLongRunningOperationMetadata {
1289 fn typename() -> &'static str {
1290 "type.googleapis.com/google.storage.control.v2.CommonLongRunningOperationMetadata"
1291 }
1292}
1293
1294/// Message returned in the metadata field of the Operation resource for
1295/// RenameFolder operations.
1296#[derive(Clone, Default, PartialEq)]
1297#[non_exhaustive]
1298pub struct RenameFolderMetadata {
1299 /// Generic metadata for the long running operation.
1300 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1301
1302 /// The path of the source folder.
1303 pub source_folder_id: std::string::String,
1304
1305 /// The path of the destination folder.
1306 pub destination_folder_id: std::string::String,
1307
1308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1309}
1310
1311impl RenameFolderMetadata {
1312 /// Creates a new default instance.
1313 pub fn new() -> Self {
1314 std::default::Default::default()
1315 }
1316
1317 /// Sets the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
1318 ///
1319 /// # Example
1320 /// ```ignore,no_run
1321 /// # use google_cloud_storage::model::RenameFolderMetadata;
1322 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1323 /// let x = RenameFolderMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
1324 /// ```
1325 pub fn set_common_metadata<T>(mut self, v: T) -> Self
1326 where
1327 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1328 {
1329 self.common_metadata = std::option::Option::Some(v.into());
1330 self
1331 }
1332
1333 /// Sets or clears the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
1334 ///
1335 /// # Example
1336 /// ```ignore,no_run
1337 /// # use google_cloud_storage::model::RenameFolderMetadata;
1338 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1339 /// let x = RenameFolderMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
1340 /// let x = RenameFolderMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
1341 /// ```
1342 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1343 where
1344 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1345 {
1346 self.common_metadata = v.map(|x| x.into());
1347 self
1348 }
1349
1350 /// Sets the value of [source_folder_id][crate::model::RenameFolderMetadata::source_folder_id].
1351 ///
1352 /// # Example
1353 /// ```ignore,no_run
1354 /// # use google_cloud_storage::model::RenameFolderMetadata;
1355 /// let x = RenameFolderMetadata::new().set_source_folder_id("example");
1356 /// ```
1357 pub fn set_source_folder_id<T: std::convert::Into<std::string::String>>(
1358 mut self,
1359 v: T,
1360 ) -> Self {
1361 self.source_folder_id = v.into();
1362 self
1363 }
1364
1365 /// Sets the value of [destination_folder_id][crate::model::RenameFolderMetadata::destination_folder_id].
1366 ///
1367 /// # Example
1368 /// ```ignore,no_run
1369 /// # use google_cloud_storage::model::RenameFolderMetadata;
1370 /// let x = RenameFolderMetadata::new().set_destination_folder_id("example");
1371 /// ```
1372 pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
1373 mut self,
1374 v: T,
1375 ) -> Self {
1376 self.destination_folder_id = v.into();
1377 self
1378 }
1379}
1380
1381impl wkt::message::Message for RenameFolderMetadata {
1382 fn typename() -> &'static str {
1383 "type.googleapis.com/google.storage.control.v2.RenameFolderMetadata"
1384 }
1385}
1386
1387/// Message returned in the metadata field of the Operation resource for
1388/// DeleteFolderRecursive operations.
1389#[derive(Clone, Default, PartialEq)]
1390#[non_exhaustive]
1391pub struct DeleteFolderRecursiveMetadata {
1392 /// Generic metadata for the long running operation.
1393 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1394
1395 /// The path of the folder recursively deleted.
1396 pub folder_id: std::string::String,
1397
1398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1399}
1400
1401impl DeleteFolderRecursiveMetadata {
1402 /// Creates a new default instance.
1403 pub fn new() -> Self {
1404 std::default::Default::default()
1405 }
1406
1407 /// Sets the value of [common_metadata][crate::model::DeleteFolderRecursiveMetadata::common_metadata].
1408 ///
1409 /// # Example
1410 /// ```ignore,no_run
1411 /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1412 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1413 /// let x = DeleteFolderRecursiveMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
1414 /// ```
1415 pub fn set_common_metadata<T>(mut self, v: T) -> Self
1416 where
1417 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1418 {
1419 self.common_metadata = std::option::Option::Some(v.into());
1420 self
1421 }
1422
1423 /// Sets or clears the value of [common_metadata][crate::model::DeleteFolderRecursiveMetadata::common_metadata].
1424 ///
1425 /// # Example
1426 /// ```ignore,no_run
1427 /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1428 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1429 /// let x = DeleteFolderRecursiveMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
1430 /// let x = DeleteFolderRecursiveMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
1431 /// ```
1432 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1433 where
1434 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1435 {
1436 self.common_metadata = v.map(|x| x.into());
1437 self
1438 }
1439
1440 /// Sets the value of [folder_id][crate::model::DeleteFolderRecursiveMetadata::folder_id].
1441 ///
1442 /// # Example
1443 /// ```ignore,no_run
1444 /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1445 /// let x = DeleteFolderRecursiveMetadata::new().set_folder_id("example");
1446 /// ```
1447 pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1448 self.folder_id = v.into();
1449 self
1450 }
1451}
1452
1453impl wkt::message::Message for DeleteFolderRecursiveMetadata {
1454 fn typename() -> &'static str {
1455 "type.googleapis.com/google.storage.control.v2.DeleteFolderRecursiveMetadata"
1456 }
1457}
1458
1459/// The storage layout configuration of a bucket.
1460#[derive(Clone, Default, PartialEq)]
1461#[non_exhaustive]
1462pub struct StorageLayout {
1463 /// Output only. The name of the StorageLayout resource.
1464 /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1465 pub name: std::string::String,
1466
1467 /// Output only. The location of the bucket.
1468 pub location: std::string::String,
1469
1470 /// Output only. The location type of the bucket (region, dual-region,
1471 /// multi-region, etc).
1472 pub location_type: std::string::String,
1473
1474 /// Output only. The data placement configuration for custom dual region. If
1475 /// there is no configuration, this is not a custom dual region bucket.
1476 pub custom_placement_config:
1477 std::option::Option<crate::model::storage_layout::CustomPlacementConfig>,
1478
1479 /// Output only. The bucket's hierarchical namespace configuration. If there is
1480 /// no configuration, the hierarchical namespace is disabled.
1481 pub hierarchical_namespace:
1482 std::option::Option<crate::model::storage_layout::HierarchicalNamespace>,
1483
1484 /// Output only. The Rapid Cache configuration for the bucket.
1485 pub rapid_cache_info: std::option::Option<crate::model::storage_layout::RapidCacheInfo>,
1486
1487 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1488}
1489
1490impl StorageLayout {
1491 /// Creates a new default instance.
1492 pub fn new() -> Self {
1493 std::default::Default::default()
1494 }
1495
1496 /// Sets the value of [name][crate::model::StorageLayout::name].
1497 ///
1498 /// # Example
1499 /// ```ignore,no_run
1500 /// # use google_cloud_storage::model::StorageLayout;
1501 /// # let project_id = "project_id";
1502 /// # let bucket_id = "bucket_id";
1503 /// let x = StorageLayout::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/storageLayout"));
1504 /// ```
1505 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1506 self.name = v.into();
1507 self
1508 }
1509
1510 /// Sets the value of [location][crate::model::StorageLayout::location].
1511 ///
1512 /// # Example
1513 /// ```ignore,no_run
1514 /// # use google_cloud_storage::model::StorageLayout;
1515 /// let x = StorageLayout::new().set_location("example");
1516 /// ```
1517 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1518 self.location = v.into();
1519 self
1520 }
1521
1522 /// Sets the value of [location_type][crate::model::StorageLayout::location_type].
1523 ///
1524 /// # Example
1525 /// ```ignore,no_run
1526 /// # use google_cloud_storage::model::StorageLayout;
1527 /// let x = StorageLayout::new().set_location_type("example");
1528 /// ```
1529 pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1530 self.location_type = v.into();
1531 self
1532 }
1533
1534 /// Sets the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
1535 ///
1536 /// # Example
1537 /// ```ignore,no_run
1538 /// # use google_cloud_storage::model::StorageLayout;
1539 /// use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1540 /// let x = StorageLayout::new().set_custom_placement_config(CustomPlacementConfig::default()/* use setters */);
1541 /// ```
1542 pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
1543 where
1544 T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
1545 {
1546 self.custom_placement_config = std::option::Option::Some(v.into());
1547 self
1548 }
1549
1550 /// Sets or clears the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
1551 ///
1552 /// # Example
1553 /// ```ignore,no_run
1554 /// # use google_cloud_storage::model::StorageLayout;
1555 /// use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1556 /// let x = StorageLayout::new().set_or_clear_custom_placement_config(Some(CustomPlacementConfig::default()/* use setters */));
1557 /// let x = StorageLayout::new().set_or_clear_custom_placement_config(None::<CustomPlacementConfig>);
1558 /// ```
1559 pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
1560 where
1561 T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
1562 {
1563 self.custom_placement_config = v.map(|x| x.into());
1564 self
1565 }
1566
1567 /// Sets the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
1568 ///
1569 /// # Example
1570 /// ```ignore,no_run
1571 /// # use google_cloud_storage::model::StorageLayout;
1572 /// use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1573 /// let x = StorageLayout::new().set_hierarchical_namespace(HierarchicalNamespace::default()/* use setters */);
1574 /// ```
1575 pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
1576 where
1577 T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
1578 {
1579 self.hierarchical_namespace = std::option::Option::Some(v.into());
1580 self
1581 }
1582
1583 /// Sets or clears the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
1584 ///
1585 /// # Example
1586 /// ```ignore,no_run
1587 /// # use google_cloud_storage::model::StorageLayout;
1588 /// use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1589 /// let x = StorageLayout::new().set_or_clear_hierarchical_namespace(Some(HierarchicalNamespace::default()/* use setters */));
1590 /// let x = StorageLayout::new().set_or_clear_hierarchical_namespace(None::<HierarchicalNamespace>);
1591 /// ```
1592 pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
1593 where
1594 T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
1595 {
1596 self.hierarchical_namespace = v.map(|x| x.into());
1597 self
1598 }
1599
1600 /// Sets the value of [rapid_cache_info][crate::model::StorageLayout::rapid_cache_info].
1601 ///
1602 /// # Example
1603 /// ```ignore,no_run
1604 /// # use google_cloud_storage::model::StorageLayout;
1605 /// use google_cloud_storage::model::storage_layout::RapidCacheInfo;
1606 /// let x = StorageLayout::new().set_rapid_cache_info(RapidCacheInfo::default()/* use setters */);
1607 /// ```
1608 pub fn set_rapid_cache_info<T>(mut self, v: T) -> Self
1609 where
1610 T: std::convert::Into<crate::model::storage_layout::RapidCacheInfo>,
1611 {
1612 self.rapid_cache_info = std::option::Option::Some(v.into());
1613 self
1614 }
1615
1616 /// Sets or clears the value of [rapid_cache_info][crate::model::StorageLayout::rapid_cache_info].
1617 ///
1618 /// # Example
1619 /// ```ignore,no_run
1620 /// # use google_cloud_storage::model::StorageLayout;
1621 /// use google_cloud_storage::model::storage_layout::RapidCacheInfo;
1622 /// let x = StorageLayout::new().set_or_clear_rapid_cache_info(Some(RapidCacheInfo::default()/* use setters */));
1623 /// let x = StorageLayout::new().set_or_clear_rapid_cache_info(None::<RapidCacheInfo>);
1624 /// ```
1625 pub fn set_or_clear_rapid_cache_info<T>(mut self, v: std::option::Option<T>) -> Self
1626 where
1627 T: std::convert::Into<crate::model::storage_layout::RapidCacheInfo>,
1628 {
1629 self.rapid_cache_info = v.map(|x| x.into());
1630 self
1631 }
1632}
1633
1634impl wkt::message::Message for StorageLayout {
1635 fn typename() -> &'static str {
1636 "type.googleapis.com/google.storage.control.v2.StorageLayout"
1637 }
1638}
1639
1640/// Defines additional types related to [StorageLayout].
1641pub mod storage_layout {
1642 #[allow(unused_imports)]
1643 use super::*;
1644
1645 /// Configuration for Custom Dual Regions. It should specify precisely two
1646 /// eligible regions within the same Multiregion. More information on regions
1647 /// may be found [here](https://cloud.google.com/storage/docs/locations).
1648 #[derive(Clone, Default, PartialEq)]
1649 #[non_exhaustive]
1650 pub struct CustomPlacementConfig {
1651 /// List of locations to use for data placement.
1652 pub data_locations: std::vec::Vec<std::string::String>,
1653
1654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1655 }
1656
1657 impl CustomPlacementConfig {
1658 /// Creates a new default instance.
1659 pub fn new() -> Self {
1660 std::default::Default::default()
1661 }
1662
1663 /// Sets the value of [data_locations][crate::model::storage_layout::CustomPlacementConfig::data_locations].
1664 ///
1665 /// # Example
1666 /// ```ignore,no_run
1667 /// # use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1668 /// let x = CustomPlacementConfig::new().set_data_locations(["a", "b", "c"]);
1669 /// ```
1670 pub fn set_data_locations<T, V>(mut self, v: T) -> Self
1671 where
1672 T: std::iter::IntoIterator<Item = V>,
1673 V: std::convert::Into<std::string::String>,
1674 {
1675 use std::iter::Iterator;
1676 self.data_locations = v.into_iter().map(|i| i.into()).collect();
1677 self
1678 }
1679 }
1680
1681 impl wkt::message::Message for CustomPlacementConfig {
1682 fn typename() -> &'static str {
1683 "type.googleapis.com/google.storage.control.v2.StorageLayout.CustomPlacementConfig"
1684 }
1685 }
1686
1687 /// Configuration for a bucket's hierarchical namespace feature.
1688 #[derive(Clone, Default, PartialEq)]
1689 #[non_exhaustive]
1690 pub struct HierarchicalNamespace {
1691 /// Enables the hierarchical namespace feature.
1692 pub enabled: bool,
1693
1694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1695 }
1696
1697 impl HierarchicalNamespace {
1698 /// Creates a new default instance.
1699 pub fn new() -> Self {
1700 std::default::Default::default()
1701 }
1702
1703 /// Sets the value of [enabled][crate::model::storage_layout::HierarchicalNamespace::enabled].
1704 ///
1705 /// # Example
1706 /// ```ignore,no_run
1707 /// # use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1708 /// let x = HierarchicalNamespace::new().set_enabled(true);
1709 /// ```
1710 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1711 self.enabled = v.into();
1712 self
1713 }
1714 }
1715
1716 impl wkt::message::Message for HierarchicalNamespace {
1717 fn typename() -> &'static str {
1718 "type.googleapis.com/google.storage.control.v2.StorageLayout.HierarchicalNamespace"
1719 }
1720 }
1721
1722 /// The Rapid Cache configuration for the bucket.
1723 #[derive(Clone, Default, PartialEq)]
1724 #[non_exhaustive]
1725 pub struct RapidCacheInfo {
1726 /// Output only. The type of cache in the bucket. Set to `rapid-cache` or
1727 /// `rapid-cache-ultra`, only if there is a cache present.
1728 pub cache_type: std::string::String,
1729
1730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1731 }
1732
1733 impl RapidCacheInfo {
1734 /// Creates a new default instance.
1735 pub fn new() -> Self {
1736 std::default::Default::default()
1737 }
1738
1739 /// Sets the value of [cache_type][crate::model::storage_layout::RapidCacheInfo::cache_type].
1740 ///
1741 /// # Example
1742 /// ```ignore,no_run
1743 /// # use google_cloud_storage::model::storage_layout::RapidCacheInfo;
1744 /// let x = RapidCacheInfo::new().set_cache_type("example");
1745 /// ```
1746 pub fn set_cache_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1747 self.cache_type = v.into();
1748 self
1749 }
1750 }
1751
1752 impl wkt::message::Message for RapidCacheInfo {
1753 fn typename() -> &'static str {
1754 "type.googleapis.com/google.storage.control.v2.StorageLayout.RapidCacheInfo"
1755 }
1756 }
1757}
1758
1759/// Request message for GetStorageLayout.
1760#[derive(Clone, Default, PartialEq)]
1761#[non_exhaustive]
1762pub struct GetStorageLayoutRequest {
1763 /// Required. The name of the StorageLayout resource.
1764 /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1765 pub name: std::string::String,
1766
1767 /// An optional prefix used for permission check. It is useful when the caller
1768 /// only has limited permissions under a specific prefix.
1769 pub prefix: std::string::String,
1770
1771 /// Optional. A unique identifier for this request. UUID is the recommended
1772 /// format, but other formats are still accepted.
1773 pub request_id: std::string::String,
1774
1775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1776}
1777
1778impl GetStorageLayoutRequest {
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::GetStorageLayoutRequest::name].
1785 ///
1786 /// # Example
1787 /// ```ignore,no_run
1788 /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1789 /// # let project_id = "project_id";
1790 /// # let bucket_id = "bucket_id";
1791 /// let x = GetStorageLayoutRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/storageLayout"));
1792 /// ```
1793 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1794 self.name = v.into();
1795 self
1796 }
1797
1798 /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
1799 ///
1800 /// # Example
1801 /// ```ignore,no_run
1802 /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1803 /// let x = GetStorageLayoutRequest::new().set_prefix("example");
1804 /// ```
1805 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1806 self.prefix = v.into();
1807 self
1808 }
1809
1810 /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
1811 ///
1812 /// # Example
1813 /// ```ignore,no_run
1814 /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1815 /// let x = GetStorageLayoutRequest::new().set_request_id("example");
1816 /// ```
1817 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1818 self.request_id = v.into();
1819 self
1820 }
1821}
1822
1823impl wkt::message::Message for GetStorageLayoutRequest {
1824 fn typename() -> &'static str {
1825 "type.googleapis.com/google.storage.control.v2.GetStorageLayoutRequest"
1826 }
1827}
1828
1829/// A managed folder.
1830#[derive(Clone, Default, PartialEq)]
1831#[non_exhaustive]
1832pub struct ManagedFolder {
1833 /// Identifier. The name of this managed folder.
1834 /// Format:
1835 /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1836 pub name: std::string::String,
1837
1838 /// Output only. The metadata version of this managed folder. It increases
1839 /// whenever the metadata is updated. Used for preconditions and for detecting
1840 /// changes in metadata. Managed folders don't have a generation number.
1841 pub metageneration: i64,
1842
1843 /// Output only. The creation time of the managed folder.
1844 pub create_time: std::option::Option<wkt::Timestamp>,
1845
1846 /// Output only. The modification time of the managed folder.
1847 pub update_time: std::option::Option<wkt::Timestamp>,
1848
1849 /// Rapid Cache configuration for a managed prefix.
1850 pub rapid_cache_config: std::option::Option<crate::model::managed_folder::RapidCacheConfig>,
1851
1852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1853}
1854
1855impl ManagedFolder {
1856 /// Creates a new default instance.
1857 pub fn new() -> Self {
1858 std::default::Default::default()
1859 }
1860
1861 /// Sets the value of [name][crate::model::ManagedFolder::name].
1862 ///
1863 /// # Example
1864 /// ```ignore,no_run
1865 /// # use google_cloud_storage::model::ManagedFolder;
1866 /// # let project_id = "project_id";
1867 /// # let bucket_id = "bucket_id";
1868 /// # let managed_folder_id = "managed_folder_id";
1869 /// let x = ManagedFolder::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/managedFolders/{managed_folder_id}"));
1870 /// ```
1871 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1872 self.name = v.into();
1873 self
1874 }
1875
1876 /// Sets the value of [metageneration][crate::model::ManagedFolder::metageneration].
1877 ///
1878 /// # Example
1879 /// ```ignore,no_run
1880 /// # use google_cloud_storage::model::ManagedFolder;
1881 /// let x = ManagedFolder::new().set_metageneration(42);
1882 /// ```
1883 pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1884 self.metageneration = v.into();
1885 self
1886 }
1887
1888 /// Sets the value of [create_time][crate::model::ManagedFolder::create_time].
1889 ///
1890 /// # Example
1891 /// ```ignore,no_run
1892 /// # use google_cloud_storage::model::ManagedFolder;
1893 /// use wkt::Timestamp;
1894 /// let x = ManagedFolder::new().set_create_time(Timestamp::default()/* use setters */);
1895 /// ```
1896 pub fn set_create_time<T>(mut self, v: T) -> Self
1897 where
1898 T: std::convert::Into<wkt::Timestamp>,
1899 {
1900 self.create_time = std::option::Option::Some(v.into());
1901 self
1902 }
1903
1904 /// Sets or clears the value of [create_time][crate::model::ManagedFolder::create_time].
1905 ///
1906 /// # Example
1907 /// ```ignore,no_run
1908 /// # use google_cloud_storage::model::ManagedFolder;
1909 /// use wkt::Timestamp;
1910 /// let x = ManagedFolder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1911 /// let x = ManagedFolder::new().set_or_clear_create_time(None::<Timestamp>);
1912 /// ```
1913 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1914 where
1915 T: std::convert::Into<wkt::Timestamp>,
1916 {
1917 self.create_time = v.map(|x| x.into());
1918 self
1919 }
1920
1921 /// Sets the value of [update_time][crate::model::ManagedFolder::update_time].
1922 ///
1923 /// # Example
1924 /// ```ignore,no_run
1925 /// # use google_cloud_storage::model::ManagedFolder;
1926 /// use wkt::Timestamp;
1927 /// let x = ManagedFolder::new().set_update_time(Timestamp::default()/* use setters */);
1928 /// ```
1929 pub fn set_update_time<T>(mut self, v: T) -> Self
1930 where
1931 T: std::convert::Into<wkt::Timestamp>,
1932 {
1933 self.update_time = std::option::Option::Some(v.into());
1934 self
1935 }
1936
1937 /// Sets or clears the value of [update_time][crate::model::ManagedFolder::update_time].
1938 ///
1939 /// # Example
1940 /// ```ignore,no_run
1941 /// # use google_cloud_storage::model::ManagedFolder;
1942 /// use wkt::Timestamp;
1943 /// let x = ManagedFolder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1944 /// let x = ManagedFolder::new().set_or_clear_update_time(None::<Timestamp>);
1945 /// ```
1946 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1947 where
1948 T: std::convert::Into<wkt::Timestamp>,
1949 {
1950 self.update_time = v.map(|x| x.into());
1951 self
1952 }
1953
1954 /// Sets the value of [rapid_cache_config][crate::model::ManagedFolder::rapid_cache_config].
1955 ///
1956 /// # Example
1957 /// ```ignore,no_run
1958 /// # use google_cloud_storage::model::ManagedFolder;
1959 /// use google_cloud_storage::model::managed_folder::RapidCacheConfig;
1960 /// let x = ManagedFolder::new().set_rapid_cache_config(RapidCacheConfig::default()/* use setters */);
1961 /// ```
1962 pub fn set_rapid_cache_config<T>(mut self, v: T) -> Self
1963 where
1964 T: std::convert::Into<crate::model::managed_folder::RapidCacheConfig>,
1965 {
1966 self.rapid_cache_config = std::option::Option::Some(v.into());
1967 self
1968 }
1969
1970 /// Sets or clears the value of [rapid_cache_config][crate::model::ManagedFolder::rapid_cache_config].
1971 ///
1972 /// # Example
1973 /// ```ignore,no_run
1974 /// # use google_cloud_storage::model::ManagedFolder;
1975 /// use google_cloud_storage::model::managed_folder::RapidCacheConfig;
1976 /// let x = ManagedFolder::new().set_or_clear_rapid_cache_config(Some(RapidCacheConfig::default()/* use setters */));
1977 /// let x = ManagedFolder::new().set_or_clear_rapid_cache_config(None::<RapidCacheConfig>);
1978 /// ```
1979 pub fn set_or_clear_rapid_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
1980 where
1981 T: std::convert::Into<crate::model::managed_folder::RapidCacheConfig>,
1982 {
1983 self.rapid_cache_config = v.map(|x| x.into());
1984 self
1985 }
1986}
1987
1988impl wkt::message::Message for ManagedFolder {
1989 fn typename() -> &'static str {
1990 "type.googleapis.com/google.storage.control.v2.ManagedFolder"
1991 }
1992}
1993
1994/// Defines additional types related to [ManagedFolder].
1995pub mod managed_folder {
1996 #[allow(unused_imports)]
1997 use super::*;
1998
1999 /// Rapid Cache configuration for a managed prefix. This configuration is used
2000 /// to determine how the rapid cache behaves for objects under the managed
2001 /// folder.
2002 #[derive(Clone, Default, PartialEq)]
2003 #[non_exhaustive]
2004 pub struct RapidCacheConfig {
2005 /// Optional. A map of rapid_cache_id to RapidCachePolicy for this prefix.
2006 /// Currently, the key rapid_cache_id is the zone. However, the
2007 /// field is generalized as rapid_cache_id to align the policy lifetime
2008 /// with the cache instance lifetime. This allows for a future transition
2009 /// from zone to a cache id if required.
2010 pub policies: std::collections::HashMap<
2011 std::string::String,
2012 crate::model::managed_folder::rapid_cache_config::RapidCachePolicy,
2013 >,
2014
2015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2016 }
2017
2018 impl RapidCacheConfig {
2019 /// Creates a new default instance.
2020 pub fn new() -> Self {
2021 std::default::Default::default()
2022 }
2023
2024 /// Sets the value of [policies][crate::model::managed_folder::RapidCacheConfig::policies].
2025 ///
2026 /// # Example
2027 /// ```ignore,no_run
2028 /// # use google_cloud_storage::model::managed_folder::RapidCacheConfig;
2029 /// use google_cloud_storage::model::managed_folder::rapid_cache_config::RapidCachePolicy;
2030 /// let x = RapidCacheConfig::new().set_policies([
2031 /// ("key0", RapidCachePolicy::default()/* use setters */),
2032 /// ("key1", RapidCachePolicy::default()/* use (different) setters */),
2033 /// ]);
2034 /// ```
2035 pub fn set_policies<T, K, V>(mut self, v: T) -> Self
2036 where
2037 T: std::iter::IntoIterator<Item = (K, V)>,
2038 K: std::convert::Into<std::string::String>,
2039 V: std::convert::Into<
2040 crate::model::managed_folder::rapid_cache_config::RapidCachePolicy,
2041 >,
2042 {
2043 use std::iter::Iterator;
2044 self.policies = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2045 self
2046 }
2047 }
2048
2049 impl wkt::message::Message for RapidCacheConfig {
2050 fn typename() -> &'static str {
2051 "type.googleapis.com/google.storage.control.v2.ManagedFolder.RapidCacheConfig"
2052 }
2053 }
2054
2055 /// Defines additional types related to [RapidCacheConfig].
2056 pub mod rapid_cache_config {
2057 #[allow(unused_imports)]
2058 use super::*;
2059
2060 /// Rapid Cache policy for a managed folder.
2061 #[derive(Clone, Default, PartialEq)]
2062 #[non_exhaustive]
2063 pub struct RapidCachePolicy {
2064 /// Required. The identifier for the rapid cache.
2065 pub rapid_cache_id: std::string::String,
2066
2067 /// Required. If enabled, objects in the Managed Folder will be ingested
2068 /// into the cache when they are written.
2069 pub ingest_on_write:
2070 crate::model::managed_folder::rapid_cache_config::rapid_cache_policy::IngestOnWrite,
2071
2072 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2073 }
2074
2075 impl RapidCachePolicy {
2076 /// Creates a new default instance.
2077 pub fn new() -> Self {
2078 std::default::Default::default()
2079 }
2080
2081 /// Sets the value of [rapid_cache_id][crate::model::managed_folder::rapid_cache_config::RapidCachePolicy::rapid_cache_id].
2082 ///
2083 /// # Example
2084 /// ```ignore,no_run
2085 /// # use google_cloud_storage::model::managed_folder::rapid_cache_config::RapidCachePolicy;
2086 /// let x = RapidCachePolicy::new().set_rapid_cache_id("example");
2087 /// ```
2088 pub fn set_rapid_cache_id<T: std::convert::Into<std::string::String>>(
2089 mut self,
2090 v: T,
2091 ) -> Self {
2092 self.rapid_cache_id = v.into();
2093 self
2094 }
2095
2096 /// Sets the value of [ingest_on_write][crate::model::managed_folder::rapid_cache_config::RapidCachePolicy::ingest_on_write].
2097 ///
2098 /// # Example
2099 /// ```ignore,no_run
2100 /// # use google_cloud_storage::model::managed_folder::rapid_cache_config::RapidCachePolicy;
2101 /// use google_cloud_storage::model::managed_folder::rapid_cache_config::rapid_cache_policy::IngestOnWrite;
2102 /// let x0 = RapidCachePolicy::new().set_ingest_on_write(IngestOnWrite::Enabled);
2103 /// ```
2104 pub fn set_ingest_on_write<T: std::convert::Into<crate::model::managed_folder::rapid_cache_config::rapid_cache_policy::IngestOnWrite>>(mut self, v: T) -> Self{
2105 self.ingest_on_write = v.into();
2106 self
2107 }
2108 }
2109
2110 impl wkt::message::Message for RapidCachePolicy {
2111 fn typename() -> &'static str {
2112 "type.googleapis.com/google.storage.control.v2.ManagedFolder.RapidCacheConfig.RapidCachePolicy"
2113 }
2114 }
2115
2116 /// Defines additional types related to [RapidCachePolicy].
2117 pub mod rapid_cache_policy {
2118 #[allow(unused_imports)]
2119 use super::*;
2120
2121 /// The behavior of the rapid cache when an object is written.
2122 ///
2123 /// # Working with unknown values
2124 ///
2125 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2126 /// additional enum variants at any time. Adding new variants is not considered
2127 /// a breaking change. Applications should write their code in anticipation of:
2128 ///
2129 /// - New values appearing in future releases of the client library, **and**
2130 /// - New values received dynamically, without application changes.
2131 ///
2132 /// Please consult the [Working with enums] section in the user guide for some
2133 /// guidelines.
2134 ///
2135 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2136 #[derive(Clone, Debug, PartialEq)]
2137 #[non_exhaustive]
2138 pub enum IngestOnWrite {
2139 /// The behavior is not specified at this resource level.
2140 /// It should be inherited from the parent resource's configuration.
2141 /// This is the default value.
2142 Unspecified,
2143 /// Ingestion on write is explicitly enabled for this resource.
2144 Enabled,
2145 /// If set, the enum was initialized with an unknown value.
2146 ///
2147 /// Applications can examine the value using [IngestOnWrite::value] or
2148 /// [IngestOnWrite::name].
2149 UnknownValue(ingest_on_write::UnknownValue),
2150 }
2151
2152 #[doc(hidden)]
2153 pub mod ingest_on_write {
2154 #[allow(unused_imports)]
2155 use super::*;
2156 #[derive(Clone, Debug, PartialEq)]
2157 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2158 }
2159
2160 impl IngestOnWrite {
2161 /// Gets the enum value.
2162 ///
2163 /// Returns `None` if the enum contains an unknown value deserialized from
2164 /// the string representation of enums.
2165 pub fn value(&self) -> std::option::Option<i32> {
2166 match self {
2167 Self::Unspecified => std::option::Option::Some(0),
2168 Self::Enabled => std::option::Option::Some(1),
2169 Self::UnknownValue(u) => u.0.value(),
2170 }
2171 }
2172
2173 /// Gets the enum value as a string.
2174 ///
2175 /// Returns `None` if the enum contains an unknown value deserialized from
2176 /// the integer representation of enums.
2177 pub fn name(&self) -> std::option::Option<&str> {
2178 match self {
2179 Self::Unspecified => {
2180 std::option::Option::Some("INGEST_ON_WRITE_UNSPECIFIED")
2181 }
2182 Self::Enabled => std::option::Option::Some("INGEST_ON_WRITE_ENABLED"),
2183 Self::UnknownValue(u) => u.0.name(),
2184 }
2185 }
2186 }
2187
2188 impl std::default::Default for IngestOnWrite {
2189 fn default() -> Self {
2190 use std::convert::From;
2191 Self::from(0)
2192 }
2193 }
2194
2195 impl std::fmt::Display for IngestOnWrite {
2196 fn fmt(
2197 &self,
2198 f: &mut std::fmt::Formatter<'_>,
2199 ) -> std::result::Result<(), std::fmt::Error> {
2200 wkt::internal::display_enum(f, self.name(), self.value())
2201 }
2202 }
2203
2204 impl std::convert::From<i32> for IngestOnWrite {
2205 fn from(value: i32) -> Self {
2206 match value {
2207 0 => Self::Unspecified,
2208 1 => Self::Enabled,
2209 _ => Self::UnknownValue(ingest_on_write::UnknownValue(
2210 wkt::internal::UnknownEnumValue::Integer(value),
2211 )),
2212 }
2213 }
2214 }
2215
2216 impl std::convert::From<&str> for IngestOnWrite {
2217 fn from(value: &str) -> Self {
2218 use std::string::ToString;
2219 match value {
2220 "INGEST_ON_WRITE_UNSPECIFIED" => Self::Unspecified,
2221 "INGEST_ON_WRITE_ENABLED" => Self::Enabled,
2222 _ => Self::UnknownValue(ingest_on_write::UnknownValue(
2223 wkt::internal::UnknownEnumValue::String(value.to_string()),
2224 )),
2225 }
2226 }
2227 }
2228
2229 impl serde::ser::Serialize for IngestOnWrite {
2230 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2231 where
2232 S: serde::Serializer,
2233 {
2234 match self {
2235 Self::Unspecified => serializer.serialize_i32(0),
2236 Self::Enabled => serializer.serialize_i32(1),
2237 Self::UnknownValue(u) => u.0.serialize(serializer),
2238 }
2239 }
2240 }
2241
2242 impl<'de> serde::de::Deserialize<'de> for IngestOnWrite {
2243 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2244 where
2245 D: serde::Deserializer<'de>,
2246 {
2247 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngestOnWrite>::new(
2248 ".google.storage.control.v2.ManagedFolder.RapidCacheConfig.RapidCachePolicy.IngestOnWrite"))
2249 }
2250 }
2251 }
2252 }
2253}
2254
2255/// Request message for GetManagedFolder.
2256#[derive(Clone, Default, PartialEq)]
2257#[non_exhaustive]
2258pub struct GetManagedFolderRequest {
2259 /// Required. Name of the managed folder.
2260 /// Format:
2261 /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
2262 pub name: std::string::String,
2263
2264 /// The operation succeeds conditional on the managed folder's current
2265 /// metageneration matching the value here specified.
2266 pub if_metageneration_match: std::option::Option<i64>,
2267
2268 /// The operation succeeds conditional on the managed folder's current
2269 /// metageneration NOT matching the value here specified.
2270 pub if_metageneration_not_match: std::option::Option<i64>,
2271
2272 /// Optional. A unique identifier for this request. UUID is the recommended
2273 /// format, but other formats are still accepted.
2274 pub request_id: std::string::String,
2275
2276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2277}
2278
2279impl GetManagedFolderRequest {
2280 /// Creates a new default instance.
2281 pub fn new() -> Self {
2282 std::default::Default::default()
2283 }
2284
2285 /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
2286 ///
2287 /// # Example
2288 /// ```ignore,no_run
2289 /// # use google_cloud_storage::model::GetManagedFolderRequest;
2290 /// # let project_id = "project_id";
2291 /// # let bucket_id = "bucket_id";
2292 /// # let managed_folder_id = "managed_folder_id";
2293 /// let x = GetManagedFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/managedFolders/{managed_folder_id}"));
2294 /// ```
2295 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2296 self.name = v.into();
2297 self
2298 }
2299
2300 /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
2301 ///
2302 /// # Example
2303 /// ```ignore,no_run
2304 /// # use google_cloud_storage::model::GetManagedFolderRequest;
2305 /// let x = GetManagedFolderRequest::new().set_if_metageneration_match(42);
2306 /// ```
2307 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2308 where
2309 T: std::convert::Into<i64>,
2310 {
2311 self.if_metageneration_match = std::option::Option::Some(v.into());
2312 self
2313 }
2314
2315 /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
2316 ///
2317 /// # Example
2318 /// ```ignore,no_run
2319 /// # use google_cloud_storage::model::GetManagedFolderRequest;
2320 /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
2321 /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
2322 /// ```
2323 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2324 where
2325 T: std::convert::Into<i64>,
2326 {
2327 self.if_metageneration_match = v.map(|x| x.into());
2328 self
2329 }
2330
2331 /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
2332 ///
2333 /// # Example
2334 /// ```ignore,no_run
2335 /// # use google_cloud_storage::model::GetManagedFolderRequest;
2336 /// let x = GetManagedFolderRequest::new().set_if_metageneration_not_match(42);
2337 /// ```
2338 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2339 where
2340 T: std::convert::Into<i64>,
2341 {
2342 self.if_metageneration_not_match = std::option::Option::Some(v.into());
2343 self
2344 }
2345
2346 /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
2347 ///
2348 /// # Example
2349 /// ```ignore,no_run
2350 /// # use google_cloud_storage::model::GetManagedFolderRequest;
2351 /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
2352 /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
2353 /// ```
2354 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2355 where
2356 T: std::convert::Into<i64>,
2357 {
2358 self.if_metageneration_not_match = v.map(|x| x.into());
2359 self
2360 }
2361
2362 /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
2363 ///
2364 /// # Example
2365 /// ```ignore,no_run
2366 /// # use google_cloud_storage::model::GetManagedFolderRequest;
2367 /// let x = GetManagedFolderRequest::new().set_request_id("example");
2368 /// ```
2369 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2370 self.request_id = v.into();
2371 self
2372 }
2373}
2374
2375impl wkt::message::Message for GetManagedFolderRequest {
2376 fn typename() -> &'static str {
2377 "type.googleapis.com/google.storage.control.v2.GetManagedFolderRequest"
2378 }
2379}
2380
2381/// Request message for CreateManagedFolder.
2382#[derive(Clone, Default, PartialEq)]
2383#[non_exhaustive]
2384pub struct CreateManagedFolderRequest {
2385 /// Required. Name of the bucket this managed folder belongs to.
2386 pub parent: std::string::String,
2387
2388 /// Required. Properties of the managed folder being created.
2389 /// The bucket and managed folder names are specified in the `parent` and
2390 /// `managed_folder_id` fields. Populating these fields in `managed_folder`
2391 /// will result in an error.
2392 pub managed_folder: std::option::Option<crate::model::ManagedFolder>,
2393
2394 /// Required. The name of the managed folder. It uses a single `/` as delimiter
2395 /// and leading and trailing `/` are allowed.
2396 pub managed_folder_id: std::string::String,
2397
2398 /// Optional. A unique identifier for this request. UUID is the recommended
2399 /// format, but other formats are still accepted.
2400 pub request_id: std::string::String,
2401
2402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2403}
2404
2405impl CreateManagedFolderRequest {
2406 /// Creates a new default instance.
2407 pub fn new() -> Self {
2408 std::default::Default::default()
2409 }
2410
2411 /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
2412 ///
2413 /// # Example
2414 /// ```ignore,no_run
2415 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2416 /// # let project_id = "project_id";
2417 /// # let bucket_id = "bucket_id";
2418 /// let x = CreateManagedFolderRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
2419 /// ```
2420 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2421 self.parent = v.into();
2422 self
2423 }
2424
2425 /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
2426 ///
2427 /// # Example
2428 /// ```ignore,no_run
2429 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2430 /// use google_cloud_storage::model::ManagedFolder;
2431 /// let x = CreateManagedFolderRequest::new().set_managed_folder(ManagedFolder::default()/* use setters */);
2432 /// ```
2433 pub fn set_managed_folder<T>(mut self, v: T) -> Self
2434 where
2435 T: std::convert::Into<crate::model::ManagedFolder>,
2436 {
2437 self.managed_folder = std::option::Option::Some(v.into());
2438 self
2439 }
2440
2441 /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
2442 ///
2443 /// # Example
2444 /// ```ignore,no_run
2445 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2446 /// use google_cloud_storage::model::ManagedFolder;
2447 /// let x = CreateManagedFolderRequest::new().set_or_clear_managed_folder(Some(ManagedFolder::default()/* use setters */));
2448 /// let x = CreateManagedFolderRequest::new().set_or_clear_managed_folder(None::<ManagedFolder>);
2449 /// ```
2450 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
2451 where
2452 T: std::convert::Into<crate::model::ManagedFolder>,
2453 {
2454 self.managed_folder = v.map(|x| x.into());
2455 self
2456 }
2457
2458 /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
2459 ///
2460 /// # Example
2461 /// ```ignore,no_run
2462 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2463 /// let x = CreateManagedFolderRequest::new().set_managed_folder_id("example");
2464 /// ```
2465 pub fn set_managed_folder_id<T: std::convert::Into<std::string::String>>(
2466 mut self,
2467 v: T,
2468 ) -> Self {
2469 self.managed_folder_id = v.into();
2470 self
2471 }
2472
2473 /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
2474 ///
2475 /// # Example
2476 /// ```ignore,no_run
2477 /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2478 /// let x = CreateManagedFolderRequest::new().set_request_id("example");
2479 /// ```
2480 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2481 self.request_id = v.into();
2482 self
2483 }
2484}
2485
2486impl wkt::message::Message for CreateManagedFolderRequest {
2487 fn typename() -> &'static str {
2488 "type.googleapis.com/google.storage.control.v2.CreateManagedFolderRequest"
2489 }
2490}
2491
2492/// DeleteManagedFolder RPC request message.
2493#[derive(Clone, Default, PartialEq)]
2494#[non_exhaustive]
2495pub struct DeleteManagedFolderRequest {
2496 /// Required. Name of the managed folder.
2497 /// Format:
2498 /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
2499 pub name: std::string::String,
2500
2501 /// The operation succeeds conditional on the managed folder's current
2502 /// metageneration matching the value here specified.
2503 pub if_metageneration_match: std::option::Option<i64>,
2504
2505 /// The operation succeeds conditional on the managed folder's current
2506 /// metageneration NOT matching the value here specified.
2507 pub if_metageneration_not_match: std::option::Option<i64>,
2508
2509 /// Allows deletion of a managed folder even if it is not empty.
2510 /// A managed folder is empty if it manages no child managed folders or
2511 /// objects. Caller must have permission for
2512 /// storage.managedFolders.setIamPolicy.
2513 pub allow_non_empty: bool,
2514
2515 /// Optional. A unique identifier for this request. UUID is the recommended
2516 /// format, but other formats are still accepted.
2517 pub request_id: std::string::String,
2518
2519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2520}
2521
2522impl DeleteManagedFolderRequest {
2523 /// Creates a new default instance.
2524 pub fn new() -> Self {
2525 std::default::Default::default()
2526 }
2527
2528 /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
2529 ///
2530 /// # Example
2531 /// ```ignore,no_run
2532 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2533 /// # let project_id = "project_id";
2534 /// # let bucket_id = "bucket_id";
2535 /// # let managed_folder_id = "managed_folder_id";
2536 /// let x = DeleteManagedFolderRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/managedFolders/{managed_folder_id}"));
2537 /// ```
2538 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2539 self.name = v.into();
2540 self
2541 }
2542
2543 /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
2544 ///
2545 /// # Example
2546 /// ```ignore,no_run
2547 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2548 /// let x = DeleteManagedFolderRequest::new().set_if_metageneration_match(42);
2549 /// ```
2550 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2551 where
2552 T: std::convert::Into<i64>,
2553 {
2554 self.if_metageneration_match = std::option::Option::Some(v.into());
2555 self
2556 }
2557
2558 /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
2559 ///
2560 /// # Example
2561 /// ```ignore,no_run
2562 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2563 /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
2564 /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
2565 /// ```
2566 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2567 where
2568 T: std::convert::Into<i64>,
2569 {
2570 self.if_metageneration_match = v.map(|x| x.into());
2571 self
2572 }
2573
2574 /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
2575 ///
2576 /// # Example
2577 /// ```ignore,no_run
2578 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2579 /// let x = DeleteManagedFolderRequest::new().set_if_metageneration_not_match(42);
2580 /// ```
2581 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2582 where
2583 T: std::convert::Into<i64>,
2584 {
2585 self.if_metageneration_not_match = std::option::Option::Some(v.into());
2586 self
2587 }
2588
2589 /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
2590 ///
2591 /// # Example
2592 /// ```ignore,no_run
2593 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2594 /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
2595 /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
2596 /// ```
2597 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2598 where
2599 T: std::convert::Into<i64>,
2600 {
2601 self.if_metageneration_not_match = v.map(|x| x.into());
2602 self
2603 }
2604
2605 /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
2606 ///
2607 /// # Example
2608 /// ```ignore,no_run
2609 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2610 /// let x = DeleteManagedFolderRequest::new().set_allow_non_empty(true);
2611 /// ```
2612 pub fn set_allow_non_empty<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2613 self.allow_non_empty = v.into();
2614 self
2615 }
2616
2617 /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
2618 ///
2619 /// # Example
2620 /// ```ignore,no_run
2621 /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2622 /// let x = DeleteManagedFolderRequest::new().set_request_id("example");
2623 /// ```
2624 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2625 self.request_id = v.into();
2626 self
2627 }
2628}
2629
2630impl wkt::message::Message for DeleteManagedFolderRequest {
2631 fn typename() -> &'static str {
2632 "type.googleapis.com/google.storage.control.v2.DeleteManagedFolderRequest"
2633 }
2634}
2635
2636/// Request message for ListManagedFolders.
2637#[derive(Clone, Default, PartialEq)]
2638#[non_exhaustive]
2639pub struct ListManagedFoldersRequest {
2640 /// Required. Name of the bucket this managed folder belongs to.
2641 pub parent: std::string::String,
2642
2643 /// Optional. Maximum number of managed folders to return in a single response.
2644 /// The service will use this parameter or 1,000 items, whichever is smaller.
2645 pub page_size: i32,
2646
2647 /// Optional. A previously-returned page token representing part of the larger
2648 /// set of results to view.
2649 pub page_token: std::string::String,
2650
2651 /// Optional. Filter results to match managed folders with name starting with
2652 /// this prefix.
2653 pub prefix: std::string::String,
2654
2655 /// Optional. A unique identifier for this request. UUID is the recommended
2656 /// format, but other formats are still accepted.
2657 pub request_id: std::string::String,
2658
2659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2660}
2661
2662impl ListManagedFoldersRequest {
2663 /// Creates a new default instance.
2664 pub fn new() -> Self {
2665 std::default::Default::default()
2666 }
2667
2668 /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
2669 ///
2670 /// # Example
2671 /// ```ignore,no_run
2672 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2673 /// # let project_id = "project_id";
2674 /// # let bucket_id = "bucket_id";
2675 /// let x = ListManagedFoldersRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
2676 /// ```
2677 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2678 self.parent = v.into();
2679 self
2680 }
2681
2682 /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
2683 ///
2684 /// # Example
2685 /// ```ignore,no_run
2686 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2687 /// let x = ListManagedFoldersRequest::new().set_page_size(42);
2688 /// ```
2689 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2690 self.page_size = v.into();
2691 self
2692 }
2693
2694 /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
2695 ///
2696 /// # Example
2697 /// ```ignore,no_run
2698 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2699 /// let x = ListManagedFoldersRequest::new().set_page_token("example");
2700 /// ```
2701 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2702 self.page_token = v.into();
2703 self
2704 }
2705
2706 /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
2707 ///
2708 /// # Example
2709 /// ```ignore,no_run
2710 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2711 /// let x = ListManagedFoldersRequest::new().set_prefix("example");
2712 /// ```
2713 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2714 self.prefix = v.into();
2715 self
2716 }
2717
2718 /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
2719 ///
2720 /// # Example
2721 /// ```ignore,no_run
2722 /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2723 /// let x = ListManagedFoldersRequest::new().set_request_id("example");
2724 /// ```
2725 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2726 self.request_id = v.into();
2727 self
2728 }
2729}
2730
2731impl wkt::message::Message for ListManagedFoldersRequest {
2732 fn typename() -> &'static str {
2733 "type.googleapis.com/google.storage.control.v2.ListManagedFoldersRequest"
2734 }
2735}
2736
2737/// Response message for ListManagedFolders.
2738#[derive(Clone, Default, PartialEq)]
2739#[non_exhaustive]
2740pub struct ListManagedFoldersResponse {
2741 /// The list of matching managed folders
2742 pub managed_folders: std::vec::Vec<crate::model::ManagedFolder>,
2743
2744 /// The continuation token, used to page through large result sets. Provide
2745 /// this value in a subsequent request to return the next page of results.
2746 pub next_page_token: std::string::String,
2747
2748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2749}
2750
2751impl ListManagedFoldersResponse {
2752 /// Creates a new default instance.
2753 pub fn new() -> Self {
2754 std::default::Default::default()
2755 }
2756
2757 /// Sets the value of [managed_folders][crate::model::ListManagedFoldersResponse::managed_folders].
2758 ///
2759 /// # Example
2760 /// ```ignore,no_run
2761 /// # use google_cloud_storage::model::ListManagedFoldersResponse;
2762 /// use google_cloud_storage::model::ManagedFolder;
2763 /// let x = ListManagedFoldersResponse::new()
2764 /// .set_managed_folders([
2765 /// ManagedFolder::default()/* use setters */,
2766 /// ManagedFolder::default()/* use (different) setters */,
2767 /// ]);
2768 /// ```
2769 pub fn set_managed_folders<T, V>(mut self, v: T) -> Self
2770 where
2771 T: std::iter::IntoIterator<Item = V>,
2772 V: std::convert::Into<crate::model::ManagedFolder>,
2773 {
2774 use std::iter::Iterator;
2775 self.managed_folders = v.into_iter().map(|i| i.into()).collect();
2776 self
2777 }
2778
2779 /// Sets the value of [next_page_token][crate::model::ListManagedFoldersResponse::next_page_token].
2780 ///
2781 /// # Example
2782 /// ```ignore,no_run
2783 /// # use google_cloud_storage::model::ListManagedFoldersResponse;
2784 /// let x = ListManagedFoldersResponse::new().set_next_page_token("example");
2785 /// ```
2786 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2787 self.next_page_token = v.into();
2788 self
2789 }
2790}
2791
2792impl wkt::message::Message for ListManagedFoldersResponse {
2793 fn typename() -> &'static str {
2794 "type.googleapis.com/google.storage.control.v2.ListManagedFoldersResponse"
2795 }
2796}
2797
2798#[doc(hidden)]
2799impl google_cloud_gax::paginator::internal::PageableResponse for ListManagedFoldersResponse {
2800 type PageItem = crate::model::ManagedFolder;
2801
2802 fn items(self) -> std::vec::Vec<Self::PageItem> {
2803 self.managed_folders
2804 }
2805
2806 fn next_page_token(&self) -> std::string::String {
2807 use std::clone::Clone;
2808 self.next_page_token.clone()
2809 }
2810}
2811
2812/// Request message for UpdateManagedFolder.
2813#[derive(Clone, Default, PartialEq)]
2814#[non_exhaustive]
2815pub struct UpdateManagedFolderRequest {
2816 /// Required. Properties of the managed folder being updated. Currently, this
2817 /// RPC only supports updating the `rapid_cache_config` field in
2818 /// `managed_folder`.
2819 pub managed_folder: std::option::Option<crate::model::ManagedFolder>,
2820
2821 /// Optional. Update mask for managed_folder.
2822 /// Currently, this RPC only supports updating the `rapid_cache_config`
2823 /// field in `managed_folder`. This field also supports update mask for the
2824 /// subfields in the map of `rapid_cache_config`. The user can specify the
2825 /// update mask for `rapid_cache_config.policies` and
2826 /// `rapid_cache_config.policies.<key>`, but patching is not supported for
2827 /// a field within `RapidCachePolicy.policies.<key>`, like
2828 /// rapid_cache_config.policies.[key].ingest_on_write.
2829 pub update_mask: std::option::Option<wkt::FieldMask>,
2830
2831 /// Optional. The operation succeeds conditional on the managed folder's
2832 /// current metageneration matching the value here specified.
2833 pub if_metageneration_match: std::option::Option<i64>,
2834
2835 /// Optional. The operation succeeds conditional on the managed folder's
2836 /// current metageneration NOT matching the value here specified.
2837 pub if_metageneration_not_match: std::option::Option<i64>,
2838
2839 /// Optional. A unique identifier for this request. UUID is the recommended
2840 /// format, but other formats are still accepted.
2841 pub request_id: std::string::String,
2842
2843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2844}
2845
2846impl UpdateManagedFolderRequest {
2847 /// Creates a new default instance.
2848 pub fn new() -> Self {
2849 std::default::Default::default()
2850 }
2851
2852 /// Sets the value of [managed_folder][crate::model::UpdateManagedFolderRequest::managed_folder].
2853 ///
2854 /// # Example
2855 /// ```ignore,no_run
2856 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2857 /// use google_cloud_storage::model::ManagedFolder;
2858 /// let x = UpdateManagedFolderRequest::new().set_managed_folder(ManagedFolder::default()/* use setters */);
2859 /// ```
2860 pub fn set_managed_folder<T>(mut self, v: T) -> Self
2861 where
2862 T: std::convert::Into<crate::model::ManagedFolder>,
2863 {
2864 self.managed_folder = std::option::Option::Some(v.into());
2865 self
2866 }
2867
2868 /// Sets or clears the value of [managed_folder][crate::model::UpdateManagedFolderRequest::managed_folder].
2869 ///
2870 /// # Example
2871 /// ```ignore,no_run
2872 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2873 /// use google_cloud_storage::model::ManagedFolder;
2874 /// let x = UpdateManagedFolderRequest::new().set_or_clear_managed_folder(Some(ManagedFolder::default()/* use setters */));
2875 /// let x = UpdateManagedFolderRequest::new().set_or_clear_managed_folder(None::<ManagedFolder>);
2876 /// ```
2877 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
2878 where
2879 T: std::convert::Into<crate::model::ManagedFolder>,
2880 {
2881 self.managed_folder = v.map(|x| x.into());
2882 self
2883 }
2884
2885 /// Sets the value of [update_mask][crate::model::UpdateManagedFolderRequest::update_mask].
2886 ///
2887 /// # Example
2888 /// ```ignore,no_run
2889 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2890 /// use wkt::FieldMask;
2891 /// let x = UpdateManagedFolderRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2892 /// ```
2893 pub fn set_update_mask<T>(mut self, v: T) -> Self
2894 where
2895 T: std::convert::Into<wkt::FieldMask>,
2896 {
2897 self.update_mask = std::option::Option::Some(v.into());
2898 self
2899 }
2900
2901 /// Sets or clears the value of [update_mask][crate::model::UpdateManagedFolderRequest::update_mask].
2902 ///
2903 /// # Example
2904 /// ```ignore,no_run
2905 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2906 /// use wkt::FieldMask;
2907 /// let x = UpdateManagedFolderRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2908 /// let x = UpdateManagedFolderRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2909 /// ```
2910 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2911 where
2912 T: std::convert::Into<wkt::FieldMask>,
2913 {
2914 self.update_mask = v.map(|x| x.into());
2915 self
2916 }
2917
2918 /// Sets the value of [if_metageneration_match][crate::model::UpdateManagedFolderRequest::if_metageneration_match].
2919 ///
2920 /// # Example
2921 /// ```ignore,no_run
2922 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2923 /// let x = UpdateManagedFolderRequest::new().set_if_metageneration_match(42);
2924 /// ```
2925 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2926 where
2927 T: std::convert::Into<i64>,
2928 {
2929 self.if_metageneration_match = std::option::Option::Some(v.into());
2930 self
2931 }
2932
2933 /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateManagedFolderRequest::if_metageneration_match].
2934 ///
2935 /// # Example
2936 /// ```ignore,no_run
2937 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2938 /// let x = UpdateManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
2939 /// let x = UpdateManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
2940 /// ```
2941 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2942 where
2943 T: std::convert::Into<i64>,
2944 {
2945 self.if_metageneration_match = v.map(|x| x.into());
2946 self
2947 }
2948
2949 /// Sets the value of [if_metageneration_not_match][crate::model::UpdateManagedFolderRequest::if_metageneration_not_match].
2950 ///
2951 /// # Example
2952 /// ```ignore,no_run
2953 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2954 /// let x = UpdateManagedFolderRequest::new().set_if_metageneration_not_match(42);
2955 /// ```
2956 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2957 where
2958 T: std::convert::Into<i64>,
2959 {
2960 self.if_metageneration_not_match = std::option::Option::Some(v.into());
2961 self
2962 }
2963
2964 /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateManagedFolderRequest::if_metageneration_not_match].
2965 ///
2966 /// # Example
2967 /// ```ignore,no_run
2968 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2969 /// let x = UpdateManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
2970 /// let x = UpdateManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
2971 /// ```
2972 pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2973 where
2974 T: std::convert::Into<i64>,
2975 {
2976 self.if_metageneration_not_match = v.map(|x| x.into());
2977 self
2978 }
2979
2980 /// Sets the value of [request_id][crate::model::UpdateManagedFolderRequest::request_id].
2981 ///
2982 /// # Example
2983 /// ```ignore,no_run
2984 /// # use google_cloud_storage::model::UpdateManagedFolderRequest;
2985 /// let x = UpdateManagedFolderRequest::new().set_request_id("example");
2986 /// ```
2987 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2988 self.request_id = v.into();
2989 self
2990 }
2991}
2992
2993impl wkt::message::Message for UpdateManagedFolderRequest {
2994 fn typename() -> &'static str {
2995 "type.googleapis.com/google.storage.control.v2.UpdateManagedFolderRequest"
2996 }
2997}
2998
2999/// Message returned in the metadata field of the Operation resource for
3000/// CreateAnywhereCache operations.
3001#[derive(Clone, Default, PartialEq)]
3002#[non_exhaustive]
3003pub struct CreateAnywhereCacheMetadata {
3004 /// Generic metadata for the long running operation.
3005 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
3006
3007 /// Anywhere Cache ID.
3008 pub anywhere_cache_id: std::option::Option<std::string::String>,
3009
3010 /// The zone in which the cache instance is running. For example,
3011 /// us-central1-a.
3012 pub zone: std::option::Option<std::string::String>,
3013
3014 /// Anywhere Cache entry's TTL. A cache-level config that is applied to all new
3015 /// cache entries on admission. Default ttl value (24hrs) is applied if not
3016 /// specified in the create request.
3017 pub ttl: std::option::Option<wkt::Duration>,
3018
3019 /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
3020 /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
3021 /// applied if not specified in the create request.
3022 pub admission_policy: std::option::Option<std::string::String>,
3023
3024 /// Optional. Specifies whether objects are ingested into the cache upon write.
3025 /// Defaults to false.
3026 pub ingest_on_write: std::option::Option<bool>,
3027
3028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3029}
3030
3031impl CreateAnywhereCacheMetadata {
3032 /// Creates a new default instance.
3033 pub fn new() -> Self {
3034 std::default::Default::default()
3035 }
3036
3037 /// Sets the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
3038 ///
3039 /// # Example
3040 /// ```ignore,no_run
3041 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3042 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
3043 /// let x = CreateAnywhereCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
3044 /// ```
3045 pub fn set_common_metadata<T>(mut self, v: T) -> Self
3046 where
3047 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
3048 {
3049 self.common_metadata = std::option::Option::Some(v.into());
3050 self
3051 }
3052
3053 /// Sets or clears the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
3054 ///
3055 /// # Example
3056 /// ```ignore,no_run
3057 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3058 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
3059 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
3060 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
3061 /// ```
3062 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3063 where
3064 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
3065 {
3066 self.common_metadata = v.map(|x| x.into());
3067 self
3068 }
3069
3070 /// Sets the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
3071 ///
3072 /// # Example
3073 /// ```ignore,no_run
3074 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3075 /// let x = CreateAnywhereCacheMetadata::new().set_anywhere_cache_id("example");
3076 /// ```
3077 pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
3078 where
3079 T: std::convert::Into<std::string::String>,
3080 {
3081 self.anywhere_cache_id = std::option::Option::Some(v.into());
3082 self
3083 }
3084
3085 /// Sets or clears the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
3086 ///
3087 /// # Example
3088 /// ```ignore,no_run
3089 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3090 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(Some("example"));
3091 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(None::<String>);
3092 /// ```
3093 pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
3094 where
3095 T: std::convert::Into<std::string::String>,
3096 {
3097 self.anywhere_cache_id = v.map(|x| x.into());
3098 self
3099 }
3100
3101 /// Sets the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
3102 ///
3103 /// # Example
3104 /// ```ignore,no_run
3105 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3106 /// let x = CreateAnywhereCacheMetadata::new().set_zone("example");
3107 /// ```
3108 pub fn set_zone<T>(mut self, v: T) -> Self
3109 where
3110 T: std::convert::Into<std::string::String>,
3111 {
3112 self.zone = std::option::Option::Some(v.into());
3113 self
3114 }
3115
3116 /// Sets or clears the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
3117 ///
3118 /// # Example
3119 /// ```ignore,no_run
3120 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3121 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_zone(Some("example"));
3122 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_zone(None::<String>);
3123 /// ```
3124 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
3125 where
3126 T: std::convert::Into<std::string::String>,
3127 {
3128 self.zone = v.map(|x| x.into());
3129 self
3130 }
3131
3132 /// Sets the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
3133 ///
3134 /// # Example
3135 /// ```ignore,no_run
3136 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3137 /// use wkt::Duration;
3138 /// let x = CreateAnywhereCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
3139 /// ```
3140 pub fn set_ttl<T>(mut self, v: T) -> Self
3141 where
3142 T: std::convert::Into<wkt::Duration>,
3143 {
3144 self.ttl = std::option::Option::Some(v.into());
3145 self
3146 }
3147
3148 /// Sets or clears the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
3149 ///
3150 /// # Example
3151 /// ```ignore,no_run
3152 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3153 /// use wkt::Duration;
3154 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
3155 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
3156 /// ```
3157 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
3158 where
3159 T: std::convert::Into<wkt::Duration>,
3160 {
3161 self.ttl = v.map(|x| x.into());
3162 self
3163 }
3164
3165 /// Sets the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
3166 ///
3167 /// # Example
3168 /// ```ignore,no_run
3169 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3170 /// let x = CreateAnywhereCacheMetadata::new().set_admission_policy("example");
3171 /// ```
3172 pub fn set_admission_policy<T>(mut self, v: T) -> Self
3173 where
3174 T: std::convert::Into<std::string::String>,
3175 {
3176 self.admission_policy = std::option::Option::Some(v.into());
3177 self
3178 }
3179
3180 /// Sets or clears the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
3181 ///
3182 /// # Example
3183 /// ```ignore,no_run
3184 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3185 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
3186 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
3187 /// ```
3188 pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
3189 where
3190 T: std::convert::Into<std::string::String>,
3191 {
3192 self.admission_policy = v.map(|x| x.into());
3193 self
3194 }
3195
3196 /// Sets the value of [ingest_on_write][crate::model::CreateAnywhereCacheMetadata::ingest_on_write].
3197 ///
3198 /// # Example
3199 /// ```ignore,no_run
3200 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3201 /// let x = CreateAnywhereCacheMetadata::new().set_ingest_on_write(true);
3202 /// ```
3203 pub fn set_ingest_on_write<T>(mut self, v: T) -> Self
3204 where
3205 T: std::convert::Into<bool>,
3206 {
3207 self.ingest_on_write = std::option::Option::Some(v.into());
3208 self
3209 }
3210
3211 /// Sets or clears the value of [ingest_on_write][crate::model::CreateAnywhereCacheMetadata::ingest_on_write].
3212 ///
3213 /// # Example
3214 /// ```ignore,no_run
3215 /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
3216 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ingest_on_write(Some(false));
3217 /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ingest_on_write(None::<bool>);
3218 /// ```
3219 pub fn set_or_clear_ingest_on_write<T>(mut self, v: std::option::Option<T>) -> Self
3220 where
3221 T: std::convert::Into<bool>,
3222 {
3223 self.ingest_on_write = v.map(|x| x.into());
3224 self
3225 }
3226}
3227
3228impl wkt::message::Message for CreateAnywhereCacheMetadata {
3229 fn typename() -> &'static str {
3230 "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheMetadata"
3231 }
3232}
3233
3234/// Message returned in the metadata field of the Operation resource for
3235/// CreateRapidCache operations.
3236#[derive(Clone, Default, PartialEq)]
3237#[non_exhaustive]
3238pub struct CreateRapidCacheMetadata {
3239 /// Generic metadata for the long running operation.
3240 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
3241
3242 /// Rapid Cache ID.
3243 pub rapid_cache_id: std::option::Option<std::string::String>,
3244
3245 /// The zone in which the cache instance is running. For example,
3246 /// us-central1-a.
3247 pub zone: std::option::Option<std::string::String>,
3248
3249 /// Rapid Cache entry's TTL. A cache-level config that is applied to all new
3250 /// cache entries on admission. Default ttl value (24hrs) is applied if not
3251 /// specified in the create request.
3252 pub ttl: std::option::Option<wkt::Duration>,
3253
3254 /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
3255 /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
3256 /// applied if not specified in the create request.
3257 pub admission_policy: std::option::Option<std::string::String>,
3258
3259 /// Optional. Specifies whether objects are ingested into the cache upon write.
3260 /// Defaults to false.
3261 pub ingest_on_write: std::option::Option<bool>,
3262
3263 /// Optional. The type of cache. Either rapid cache or rapid cache ultra.
3264 pub cache_type: std::option::Option<std::string::String>,
3265
3266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3267}
3268
3269impl CreateRapidCacheMetadata {
3270 /// Creates a new default instance.
3271 pub fn new() -> Self {
3272 std::default::Default::default()
3273 }
3274
3275 /// Sets the value of [common_metadata][crate::model::CreateRapidCacheMetadata::common_metadata].
3276 ///
3277 /// # Example
3278 /// ```ignore,no_run
3279 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3280 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
3281 /// let x = CreateRapidCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
3282 /// ```
3283 pub fn set_common_metadata<T>(mut self, v: T) -> Self
3284 where
3285 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
3286 {
3287 self.common_metadata = std::option::Option::Some(v.into());
3288 self
3289 }
3290
3291 /// Sets or clears the value of [common_metadata][crate::model::CreateRapidCacheMetadata::common_metadata].
3292 ///
3293 /// # Example
3294 /// ```ignore,no_run
3295 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3296 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
3297 /// let x = CreateRapidCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
3298 /// let x = CreateRapidCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
3299 /// ```
3300 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3301 where
3302 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
3303 {
3304 self.common_metadata = v.map(|x| x.into());
3305 self
3306 }
3307
3308 /// Sets the value of [rapid_cache_id][crate::model::CreateRapidCacheMetadata::rapid_cache_id].
3309 ///
3310 /// # Example
3311 /// ```ignore,no_run
3312 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3313 /// let x = CreateRapidCacheMetadata::new().set_rapid_cache_id("example");
3314 /// ```
3315 pub fn set_rapid_cache_id<T>(mut self, v: T) -> Self
3316 where
3317 T: std::convert::Into<std::string::String>,
3318 {
3319 self.rapid_cache_id = std::option::Option::Some(v.into());
3320 self
3321 }
3322
3323 /// Sets or clears the value of [rapid_cache_id][crate::model::CreateRapidCacheMetadata::rapid_cache_id].
3324 ///
3325 /// # Example
3326 /// ```ignore,no_run
3327 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3328 /// let x = CreateRapidCacheMetadata::new().set_or_clear_rapid_cache_id(Some("example"));
3329 /// let x = CreateRapidCacheMetadata::new().set_or_clear_rapid_cache_id(None::<String>);
3330 /// ```
3331 pub fn set_or_clear_rapid_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
3332 where
3333 T: std::convert::Into<std::string::String>,
3334 {
3335 self.rapid_cache_id = v.map(|x| x.into());
3336 self
3337 }
3338
3339 /// Sets the value of [zone][crate::model::CreateRapidCacheMetadata::zone].
3340 ///
3341 /// # Example
3342 /// ```ignore,no_run
3343 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3344 /// let x = CreateRapidCacheMetadata::new().set_zone("example");
3345 /// ```
3346 pub fn set_zone<T>(mut self, v: T) -> Self
3347 where
3348 T: std::convert::Into<std::string::String>,
3349 {
3350 self.zone = std::option::Option::Some(v.into());
3351 self
3352 }
3353
3354 /// Sets or clears the value of [zone][crate::model::CreateRapidCacheMetadata::zone].
3355 ///
3356 /// # Example
3357 /// ```ignore,no_run
3358 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3359 /// let x = CreateRapidCacheMetadata::new().set_or_clear_zone(Some("example"));
3360 /// let x = CreateRapidCacheMetadata::new().set_or_clear_zone(None::<String>);
3361 /// ```
3362 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
3363 where
3364 T: std::convert::Into<std::string::String>,
3365 {
3366 self.zone = v.map(|x| x.into());
3367 self
3368 }
3369
3370 /// Sets the value of [ttl][crate::model::CreateRapidCacheMetadata::ttl].
3371 ///
3372 /// # Example
3373 /// ```ignore,no_run
3374 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3375 /// use wkt::Duration;
3376 /// let x = CreateRapidCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
3377 /// ```
3378 pub fn set_ttl<T>(mut self, v: T) -> Self
3379 where
3380 T: std::convert::Into<wkt::Duration>,
3381 {
3382 self.ttl = std::option::Option::Some(v.into());
3383 self
3384 }
3385
3386 /// Sets or clears the value of [ttl][crate::model::CreateRapidCacheMetadata::ttl].
3387 ///
3388 /// # Example
3389 /// ```ignore,no_run
3390 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3391 /// use wkt::Duration;
3392 /// let x = CreateRapidCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
3393 /// let x = CreateRapidCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
3394 /// ```
3395 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
3396 where
3397 T: std::convert::Into<wkt::Duration>,
3398 {
3399 self.ttl = v.map(|x| x.into());
3400 self
3401 }
3402
3403 /// Sets the value of [admission_policy][crate::model::CreateRapidCacheMetadata::admission_policy].
3404 ///
3405 /// # Example
3406 /// ```ignore,no_run
3407 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3408 /// let x = CreateRapidCacheMetadata::new().set_admission_policy("example");
3409 /// ```
3410 pub fn set_admission_policy<T>(mut self, v: T) -> Self
3411 where
3412 T: std::convert::Into<std::string::String>,
3413 {
3414 self.admission_policy = std::option::Option::Some(v.into());
3415 self
3416 }
3417
3418 /// Sets or clears the value of [admission_policy][crate::model::CreateRapidCacheMetadata::admission_policy].
3419 ///
3420 /// # Example
3421 /// ```ignore,no_run
3422 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3423 /// let x = CreateRapidCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
3424 /// let x = CreateRapidCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
3425 /// ```
3426 pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
3427 where
3428 T: std::convert::Into<std::string::String>,
3429 {
3430 self.admission_policy = v.map(|x| x.into());
3431 self
3432 }
3433
3434 /// Sets the value of [ingest_on_write][crate::model::CreateRapidCacheMetadata::ingest_on_write].
3435 ///
3436 /// # Example
3437 /// ```ignore,no_run
3438 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3439 /// let x = CreateRapidCacheMetadata::new().set_ingest_on_write(true);
3440 /// ```
3441 pub fn set_ingest_on_write<T>(mut self, v: T) -> Self
3442 where
3443 T: std::convert::Into<bool>,
3444 {
3445 self.ingest_on_write = std::option::Option::Some(v.into());
3446 self
3447 }
3448
3449 /// Sets or clears the value of [ingest_on_write][crate::model::CreateRapidCacheMetadata::ingest_on_write].
3450 ///
3451 /// # Example
3452 /// ```ignore,no_run
3453 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3454 /// let x = CreateRapidCacheMetadata::new().set_or_clear_ingest_on_write(Some(false));
3455 /// let x = CreateRapidCacheMetadata::new().set_or_clear_ingest_on_write(None::<bool>);
3456 /// ```
3457 pub fn set_or_clear_ingest_on_write<T>(mut self, v: std::option::Option<T>) -> Self
3458 where
3459 T: std::convert::Into<bool>,
3460 {
3461 self.ingest_on_write = v.map(|x| x.into());
3462 self
3463 }
3464
3465 /// Sets the value of [cache_type][crate::model::CreateRapidCacheMetadata::cache_type].
3466 ///
3467 /// # Example
3468 /// ```ignore,no_run
3469 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3470 /// let x = CreateRapidCacheMetadata::new().set_cache_type("example");
3471 /// ```
3472 pub fn set_cache_type<T>(mut self, v: T) -> Self
3473 where
3474 T: std::convert::Into<std::string::String>,
3475 {
3476 self.cache_type = std::option::Option::Some(v.into());
3477 self
3478 }
3479
3480 /// Sets or clears the value of [cache_type][crate::model::CreateRapidCacheMetadata::cache_type].
3481 ///
3482 /// # Example
3483 /// ```ignore,no_run
3484 /// # use google_cloud_storage::model::CreateRapidCacheMetadata;
3485 /// let x = CreateRapidCacheMetadata::new().set_or_clear_cache_type(Some("example"));
3486 /// let x = CreateRapidCacheMetadata::new().set_or_clear_cache_type(None::<String>);
3487 /// ```
3488 pub fn set_or_clear_cache_type<T>(mut self, v: std::option::Option<T>) -> Self
3489 where
3490 T: std::convert::Into<std::string::String>,
3491 {
3492 self.cache_type = v.map(|x| x.into());
3493 self
3494 }
3495}
3496
3497impl wkt::message::Message for CreateRapidCacheMetadata {
3498 fn typename() -> &'static str {
3499 "type.googleapis.com/google.storage.control.v2.CreateRapidCacheMetadata"
3500 }
3501}
3502
3503/// Message returned in the metadata field of the Operation resource for
3504/// UpdateAnywhereCache operation.
3505#[derive(Clone, Default, PartialEq)]
3506#[non_exhaustive]
3507pub struct UpdateAnywhereCacheMetadata {
3508 /// Generic metadata for the long running operation.
3509 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
3510
3511 /// Anywhere Cache ID.
3512 pub anywhere_cache_id: std::option::Option<std::string::String>,
3513
3514 /// The zone in which the cache instance is running. For example,
3515 /// us-central1-a.
3516 pub zone: std::option::Option<std::string::String>,
3517
3518 /// Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that
3519 /// is applied to all new cache entries on admission. If `ttl` is pending
3520 /// update, this field equals to the new value specified in the Update request.
3521 pub ttl: std::option::Option<wkt::Duration>,
3522
3523 /// Optional. Anywhere Cache entry Admission Policy in kebab-case (e.g.,
3524 /// "admit-on-first-miss"). If `admission_policy` is pending
3525 /// update, this field equals to the new value specified in the Update request.
3526 pub admission_policy: std::option::Option<std::string::String>,
3527
3528 /// Specifies whether objects are ingested into the cache upon write. If not
3529 /// set, it defaults to false.
3530 pub ingest_on_write: std::option::Option<bool>,
3531
3532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3533}
3534
3535impl UpdateAnywhereCacheMetadata {
3536 /// Creates a new default instance.
3537 pub fn new() -> Self {
3538 std::default::Default::default()
3539 }
3540
3541 /// Sets the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
3542 ///
3543 /// # Example
3544 /// ```ignore,no_run
3545 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3546 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
3547 /// let x = UpdateAnywhereCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
3548 /// ```
3549 pub fn set_common_metadata<T>(mut self, v: T) -> Self
3550 where
3551 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
3552 {
3553 self.common_metadata = std::option::Option::Some(v.into());
3554 self
3555 }
3556
3557 /// Sets or clears the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
3558 ///
3559 /// # Example
3560 /// ```ignore,no_run
3561 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3562 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
3563 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
3564 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
3565 /// ```
3566 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3567 where
3568 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
3569 {
3570 self.common_metadata = v.map(|x| x.into());
3571 self
3572 }
3573
3574 /// Sets the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
3575 ///
3576 /// # Example
3577 /// ```ignore,no_run
3578 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3579 /// let x = UpdateAnywhereCacheMetadata::new().set_anywhere_cache_id("example");
3580 /// ```
3581 pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
3582 where
3583 T: std::convert::Into<std::string::String>,
3584 {
3585 self.anywhere_cache_id = std::option::Option::Some(v.into());
3586 self
3587 }
3588
3589 /// Sets or clears the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
3590 ///
3591 /// # Example
3592 /// ```ignore,no_run
3593 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3594 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(Some("example"));
3595 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(None::<String>);
3596 /// ```
3597 pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
3598 where
3599 T: std::convert::Into<std::string::String>,
3600 {
3601 self.anywhere_cache_id = v.map(|x| x.into());
3602 self
3603 }
3604
3605 /// Sets the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
3606 ///
3607 /// # Example
3608 /// ```ignore,no_run
3609 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3610 /// let x = UpdateAnywhereCacheMetadata::new().set_zone("example");
3611 /// ```
3612 pub fn set_zone<T>(mut self, v: T) -> Self
3613 where
3614 T: std::convert::Into<std::string::String>,
3615 {
3616 self.zone = std::option::Option::Some(v.into());
3617 self
3618 }
3619
3620 /// Sets or clears the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
3621 ///
3622 /// # Example
3623 /// ```ignore,no_run
3624 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3625 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_zone(Some("example"));
3626 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_zone(None::<String>);
3627 /// ```
3628 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
3629 where
3630 T: std::convert::Into<std::string::String>,
3631 {
3632 self.zone = v.map(|x| x.into());
3633 self
3634 }
3635
3636 /// Sets the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
3637 ///
3638 /// # Example
3639 /// ```ignore,no_run
3640 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3641 /// use wkt::Duration;
3642 /// let x = UpdateAnywhereCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
3643 /// ```
3644 pub fn set_ttl<T>(mut self, v: T) -> Self
3645 where
3646 T: std::convert::Into<wkt::Duration>,
3647 {
3648 self.ttl = std::option::Option::Some(v.into());
3649 self
3650 }
3651
3652 /// Sets or clears the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
3653 ///
3654 /// # Example
3655 /// ```ignore,no_run
3656 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3657 /// use wkt::Duration;
3658 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
3659 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
3660 /// ```
3661 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
3662 where
3663 T: std::convert::Into<wkt::Duration>,
3664 {
3665 self.ttl = v.map(|x| x.into());
3666 self
3667 }
3668
3669 /// Sets the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
3670 ///
3671 /// # Example
3672 /// ```ignore,no_run
3673 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3674 /// let x = UpdateAnywhereCacheMetadata::new().set_admission_policy("example");
3675 /// ```
3676 pub fn set_admission_policy<T>(mut self, v: T) -> Self
3677 where
3678 T: std::convert::Into<std::string::String>,
3679 {
3680 self.admission_policy = std::option::Option::Some(v.into());
3681 self
3682 }
3683
3684 /// Sets or clears the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
3685 ///
3686 /// # Example
3687 /// ```ignore,no_run
3688 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3689 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
3690 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
3691 /// ```
3692 pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
3693 where
3694 T: std::convert::Into<std::string::String>,
3695 {
3696 self.admission_policy = v.map(|x| x.into());
3697 self
3698 }
3699
3700 /// Sets the value of [ingest_on_write][crate::model::UpdateAnywhereCacheMetadata::ingest_on_write].
3701 ///
3702 /// # Example
3703 /// ```ignore,no_run
3704 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3705 /// let x = UpdateAnywhereCacheMetadata::new().set_ingest_on_write(true);
3706 /// ```
3707 pub fn set_ingest_on_write<T>(mut self, v: T) -> Self
3708 where
3709 T: std::convert::Into<bool>,
3710 {
3711 self.ingest_on_write = std::option::Option::Some(v.into());
3712 self
3713 }
3714
3715 /// Sets or clears the value of [ingest_on_write][crate::model::UpdateAnywhereCacheMetadata::ingest_on_write].
3716 ///
3717 /// # Example
3718 /// ```ignore,no_run
3719 /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
3720 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ingest_on_write(Some(false));
3721 /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ingest_on_write(None::<bool>);
3722 /// ```
3723 pub fn set_or_clear_ingest_on_write<T>(mut self, v: std::option::Option<T>) -> Self
3724 where
3725 T: std::convert::Into<bool>,
3726 {
3727 self.ingest_on_write = v.map(|x| x.into());
3728 self
3729 }
3730}
3731
3732impl wkt::message::Message for UpdateAnywhereCacheMetadata {
3733 fn typename() -> &'static str {
3734 "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheMetadata"
3735 }
3736}
3737
3738/// Message returned in the metadata field of the Operation resource for
3739/// UpdateRapidCache operation.
3740#[derive(Clone, Default, PartialEq)]
3741#[non_exhaustive]
3742pub struct UpdateRapidCacheMetadata {
3743 /// Generic metadata for the long running operation.
3744 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
3745
3746 /// Rapid Cache ID.
3747 pub rapid_cache_id: std::option::Option<std::string::String>,
3748
3749 /// The zone in which the cache instance is running. For example,
3750 /// us-central1-a.
3751 pub zone: std::option::Option<std::string::String>,
3752
3753 /// Rapid Cache entry's TTL between 1h and 7days. A cache-level config that
3754 /// is applied to all new cache entries on admission. If `ttl` is pending
3755 /// update, this field equals to the new value specified in the Update request.
3756 pub ttl: std::option::Option<wkt::Duration>,
3757
3758 /// Optional. Rapid Cache entry Admission Policy in kebab-case (e.g.,
3759 /// "admit-on-first-miss"). If `admission_policy` is pending
3760 /// update, this field equals to the new value specified in the Update request.
3761 pub admission_policy: std::option::Option<std::string::String>,
3762
3763 /// Specifies whether objects are ingested into the cache upon write. If not
3764 /// set, it defaults to false.
3765 pub ingest_on_write: std::option::Option<bool>,
3766
3767 /// Optional. The type of cache. Either rapid cache or rapid cache ultra.
3768 pub cache_type: std::option::Option<std::string::String>,
3769
3770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3771}
3772
3773impl UpdateRapidCacheMetadata {
3774 /// Creates a new default instance.
3775 pub fn new() -> Self {
3776 std::default::Default::default()
3777 }
3778
3779 /// Sets the value of [common_metadata][crate::model::UpdateRapidCacheMetadata::common_metadata].
3780 ///
3781 /// # Example
3782 /// ```ignore,no_run
3783 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3784 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
3785 /// let x = UpdateRapidCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
3786 /// ```
3787 pub fn set_common_metadata<T>(mut self, v: T) -> Self
3788 where
3789 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
3790 {
3791 self.common_metadata = std::option::Option::Some(v.into());
3792 self
3793 }
3794
3795 /// Sets or clears the value of [common_metadata][crate::model::UpdateRapidCacheMetadata::common_metadata].
3796 ///
3797 /// # Example
3798 /// ```ignore,no_run
3799 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3800 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
3801 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
3802 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
3803 /// ```
3804 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3805 where
3806 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
3807 {
3808 self.common_metadata = v.map(|x| x.into());
3809 self
3810 }
3811
3812 /// Sets the value of [rapid_cache_id][crate::model::UpdateRapidCacheMetadata::rapid_cache_id].
3813 ///
3814 /// # Example
3815 /// ```ignore,no_run
3816 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3817 /// let x = UpdateRapidCacheMetadata::new().set_rapid_cache_id("example");
3818 /// ```
3819 pub fn set_rapid_cache_id<T>(mut self, v: T) -> Self
3820 where
3821 T: std::convert::Into<std::string::String>,
3822 {
3823 self.rapid_cache_id = std::option::Option::Some(v.into());
3824 self
3825 }
3826
3827 /// Sets or clears the value of [rapid_cache_id][crate::model::UpdateRapidCacheMetadata::rapid_cache_id].
3828 ///
3829 /// # Example
3830 /// ```ignore,no_run
3831 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3832 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_rapid_cache_id(Some("example"));
3833 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_rapid_cache_id(None::<String>);
3834 /// ```
3835 pub fn set_or_clear_rapid_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
3836 where
3837 T: std::convert::Into<std::string::String>,
3838 {
3839 self.rapid_cache_id = v.map(|x| x.into());
3840 self
3841 }
3842
3843 /// Sets the value of [zone][crate::model::UpdateRapidCacheMetadata::zone].
3844 ///
3845 /// # Example
3846 /// ```ignore,no_run
3847 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3848 /// let x = UpdateRapidCacheMetadata::new().set_zone("example");
3849 /// ```
3850 pub fn set_zone<T>(mut self, v: T) -> Self
3851 where
3852 T: std::convert::Into<std::string::String>,
3853 {
3854 self.zone = std::option::Option::Some(v.into());
3855 self
3856 }
3857
3858 /// Sets or clears the value of [zone][crate::model::UpdateRapidCacheMetadata::zone].
3859 ///
3860 /// # Example
3861 /// ```ignore,no_run
3862 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3863 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_zone(Some("example"));
3864 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_zone(None::<String>);
3865 /// ```
3866 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
3867 where
3868 T: std::convert::Into<std::string::String>,
3869 {
3870 self.zone = v.map(|x| x.into());
3871 self
3872 }
3873
3874 /// Sets the value of [ttl][crate::model::UpdateRapidCacheMetadata::ttl].
3875 ///
3876 /// # Example
3877 /// ```ignore,no_run
3878 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3879 /// use wkt::Duration;
3880 /// let x = UpdateRapidCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
3881 /// ```
3882 pub fn set_ttl<T>(mut self, v: T) -> Self
3883 where
3884 T: std::convert::Into<wkt::Duration>,
3885 {
3886 self.ttl = std::option::Option::Some(v.into());
3887 self
3888 }
3889
3890 /// Sets or clears the value of [ttl][crate::model::UpdateRapidCacheMetadata::ttl].
3891 ///
3892 /// # Example
3893 /// ```ignore,no_run
3894 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3895 /// use wkt::Duration;
3896 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
3897 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
3898 /// ```
3899 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
3900 where
3901 T: std::convert::Into<wkt::Duration>,
3902 {
3903 self.ttl = v.map(|x| x.into());
3904 self
3905 }
3906
3907 /// Sets the value of [admission_policy][crate::model::UpdateRapidCacheMetadata::admission_policy].
3908 ///
3909 /// # Example
3910 /// ```ignore,no_run
3911 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3912 /// let x = UpdateRapidCacheMetadata::new().set_admission_policy("example");
3913 /// ```
3914 pub fn set_admission_policy<T>(mut self, v: T) -> Self
3915 where
3916 T: std::convert::Into<std::string::String>,
3917 {
3918 self.admission_policy = std::option::Option::Some(v.into());
3919 self
3920 }
3921
3922 /// Sets or clears the value of [admission_policy][crate::model::UpdateRapidCacheMetadata::admission_policy].
3923 ///
3924 /// # Example
3925 /// ```ignore,no_run
3926 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3927 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
3928 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
3929 /// ```
3930 pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
3931 where
3932 T: std::convert::Into<std::string::String>,
3933 {
3934 self.admission_policy = v.map(|x| x.into());
3935 self
3936 }
3937
3938 /// Sets the value of [ingest_on_write][crate::model::UpdateRapidCacheMetadata::ingest_on_write].
3939 ///
3940 /// # Example
3941 /// ```ignore,no_run
3942 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3943 /// let x = UpdateRapidCacheMetadata::new().set_ingest_on_write(true);
3944 /// ```
3945 pub fn set_ingest_on_write<T>(mut self, v: T) -> Self
3946 where
3947 T: std::convert::Into<bool>,
3948 {
3949 self.ingest_on_write = std::option::Option::Some(v.into());
3950 self
3951 }
3952
3953 /// Sets or clears the value of [ingest_on_write][crate::model::UpdateRapidCacheMetadata::ingest_on_write].
3954 ///
3955 /// # Example
3956 /// ```ignore,no_run
3957 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3958 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_ingest_on_write(Some(false));
3959 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_ingest_on_write(None::<bool>);
3960 /// ```
3961 pub fn set_or_clear_ingest_on_write<T>(mut self, v: std::option::Option<T>) -> Self
3962 where
3963 T: std::convert::Into<bool>,
3964 {
3965 self.ingest_on_write = v.map(|x| x.into());
3966 self
3967 }
3968
3969 /// Sets the value of [cache_type][crate::model::UpdateRapidCacheMetadata::cache_type].
3970 ///
3971 /// # Example
3972 /// ```ignore,no_run
3973 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3974 /// let x = UpdateRapidCacheMetadata::new().set_cache_type("example");
3975 /// ```
3976 pub fn set_cache_type<T>(mut self, v: T) -> Self
3977 where
3978 T: std::convert::Into<std::string::String>,
3979 {
3980 self.cache_type = std::option::Option::Some(v.into());
3981 self
3982 }
3983
3984 /// Sets or clears the value of [cache_type][crate::model::UpdateRapidCacheMetadata::cache_type].
3985 ///
3986 /// # Example
3987 /// ```ignore,no_run
3988 /// # use google_cloud_storage::model::UpdateRapidCacheMetadata;
3989 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_cache_type(Some("example"));
3990 /// let x = UpdateRapidCacheMetadata::new().set_or_clear_cache_type(None::<String>);
3991 /// ```
3992 pub fn set_or_clear_cache_type<T>(mut self, v: std::option::Option<T>) -> Self
3993 where
3994 T: std::convert::Into<std::string::String>,
3995 {
3996 self.cache_type = v.map(|x| x.into());
3997 self
3998 }
3999}
4000
4001impl wkt::message::Message for UpdateRapidCacheMetadata {
4002 fn typename() -> &'static str {
4003 "type.googleapis.com/google.storage.control.v2.UpdateRapidCacheMetadata"
4004 }
4005}
4006
4007/// Message returned in the metadata field of the Operation resource for
4008/// DeleteRapidCache operation.
4009#[derive(Clone, Default, PartialEq)]
4010#[non_exhaustive]
4011pub struct DisableRapidCacheMetadata {
4012 /// Generic metadata for the long running operation.
4013 pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
4014
4015 /// Rapid Cache ID.
4016 pub rapid_cache_id: std::option::Option<std::string::String>,
4017
4018 /// The zone in which the cache instance is running. For example,
4019 /// us-central1-a.
4020 pub zone: std::option::Option<std::string::String>,
4021
4022 /// Optional. The type of cache. Either rapid cache or rapid cache ultra.
4023 pub cache_type: std::option::Option<std::string::String>,
4024
4025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4026}
4027
4028impl DisableRapidCacheMetadata {
4029 /// Creates a new default instance.
4030 pub fn new() -> Self {
4031 std::default::Default::default()
4032 }
4033
4034 /// Sets the value of [common_metadata][crate::model::DisableRapidCacheMetadata::common_metadata].
4035 ///
4036 /// # Example
4037 /// ```ignore,no_run
4038 /// # use google_cloud_storage::model::DisableRapidCacheMetadata;
4039 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
4040 /// let x = DisableRapidCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
4041 /// ```
4042 pub fn set_common_metadata<T>(mut self, v: T) -> Self
4043 where
4044 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
4045 {
4046 self.common_metadata = std::option::Option::Some(v.into());
4047 self
4048 }
4049
4050 /// Sets or clears the value of [common_metadata][crate::model::DisableRapidCacheMetadata::common_metadata].
4051 ///
4052 /// # Example
4053 /// ```ignore,no_run
4054 /// # use google_cloud_storage::model::DisableRapidCacheMetadata;
4055 /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
4056 /// let x = DisableRapidCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
4057 /// let x = DisableRapidCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
4058 /// ```
4059 pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4060 where
4061 T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
4062 {
4063 self.common_metadata = v.map(|x| x.into());
4064 self
4065 }
4066
4067 /// Sets the value of [rapid_cache_id][crate::model::DisableRapidCacheMetadata::rapid_cache_id].
4068 ///
4069 /// # Example
4070 /// ```ignore,no_run
4071 /// # use google_cloud_storage::model::DisableRapidCacheMetadata;
4072 /// let x = DisableRapidCacheMetadata::new().set_rapid_cache_id("example");
4073 /// ```
4074 pub fn set_rapid_cache_id<T>(mut self, v: T) -> Self
4075 where
4076 T: std::convert::Into<std::string::String>,
4077 {
4078 self.rapid_cache_id = std::option::Option::Some(v.into());
4079 self
4080 }
4081
4082 /// Sets or clears the value of [rapid_cache_id][crate::model::DisableRapidCacheMetadata::rapid_cache_id].
4083 ///
4084 /// # Example
4085 /// ```ignore,no_run
4086 /// # use google_cloud_storage::model::DisableRapidCacheMetadata;
4087 /// let x = DisableRapidCacheMetadata::new().set_or_clear_rapid_cache_id(Some("example"));
4088 /// let x = DisableRapidCacheMetadata::new().set_or_clear_rapid_cache_id(None::<String>);
4089 /// ```
4090 pub fn set_or_clear_rapid_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
4091 where
4092 T: std::convert::Into<std::string::String>,
4093 {
4094 self.rapid_cache_id = v.map(|x| x.into());
4095 self
4096 }
4097
4098 /// Sets the value of [zone][crate::model::DisableRapidCacheMetadata::zone].
4099 ///
4100 /// # Example
4101 /// ```ignore,no_run
4102 /// # use google_cloud_storage::model::DisableRapidCacheMetadata;
4103 /// let x = DisableRapidCacheMetadata::new().set_zone("example");
4104 /// ```
4105 pub fn set_zone<T>(mut self, v: T) -> Self
4106 where
4107 T: std::convert::Into<std::string::String>,
4108 {
4109 self.zone = std::option::Option::Some(v.into());
4110 self
4111 }
4112
4113 /// Sets or clears the value of [zone][crate::model::DisableRapidCacheMetadata::zone].
4114 ///
4115 /// # Example
4116 /// ```ignore,no_run
4117 /// # use google_cloud_storage::model::DisableRapidCacheMetadata;
4118 /// let x = DisableRapidCacheMetadata::new().set_or_clear_zone(Some("example"));
4119 /// let x = DisableRapidCacheMetadata::new().set_or_clear_zone(None::<String>);
4120 /// ```
4121 pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
4122 where
4123 T: std::convert::Into<std::string::String>,
4124 {
4125 self.zone = v.map(|x| x.into());
4126 self
4127 }
4128
4129 /// Sets the value of [cache_type][crate::model::DisableRapidCacheMetadata::cache_type].
4130 ///
4131 /// # Example
4132 /// ```ignore,no_run
4133 /// # use google_cloud_storage::model::DisableRapidCacheMetadata;
4134 /// let x = DisableRapidCacheMetadata::new().set_cache_type("example");
4135 /// ```
4136 pub fn set_cache_type<T>(mut self, v: T) -> Self
4137 where
4138 T: std::convert::Into<std::string::String>,
4139 {
4140 self.cache_type = std::option::Option::Some(v.into());
4141 self
4142 }
4143
4144 /// Sets or clears the value of [cache_type][crate::model::DisableRapidCacheMetadata::cache_type].
4145 ///
4146 /// # Example
4147 /// ```ignore,no_run
4148 /// # use google_cloud_storage::model::DisableRapidCacheMetadata;
4149 /// let x = DisableRapidCacheMetadata::new().set_or_clear_cache_type(Some("example"));
4150 /// let x = DisableRapidCacheMetadata::new().set_or_clear_cache_type(None::<String>);
4151 /// ```
4152 pub fn set_or_clear_cache_type<T>(mut self, v: std::option::Option<T>) -> Self
4153 where
4154 T: std::convert::Into<std::string::String>,
4155 {
4156 self.cache_type = v.map(|x| x.into());
4157 self
4158 }
4159}
4160
4161impl wkt::message::Message for DisableRapidCacheMetadata {
4162 fn typename() -> &'static str {
4163 "type.googleapis.com/google.storage.control.v2.DisableRapidCacheMetadata"
4164 }
4165}
4166
4167/// An Anywhere Cache Instance.
4168#[derive(Clone, Default, PartialEq)]
4169#[non_exhaustive]
4170pub struct AnywhereCache {
4171 /// Immutable. The resource name of this AnywhereCache.
4172 /// Format:
4173 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
4174 pub name: std::string::String,
4175
4176 /// Immutable. The zone in which the cache instance is running. For example,
4177 /// us-central1-a.
4178 pub zone: std::string::String,
4179
4180 /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
4181 /// that defines how long a cache entry can live. Default ttl value (24hrs)
4182 /// is applied if not specified in the create request. TTL must be in whole
4183 /// seconds.
4184 pub ttl: std::option::Option<wkt::Duration>,
4185
4186 /// Cache admission policy. Valid policies includes:
4187 /// `admit-on-first-miss` and `admit-on-second-miss`. Defaults to
4188 /// `admit-on-first-miss`. Default value is applied if not specified in the
4189 /// create request.
4190 pub admission_policy: std::string::String,
4191
4192 /// Output only. Cache state including `running`, `creating`, `disabled` and
4193 /// `paused`.
4194 pub state: std::string::String,
4195
4196 /// Output only. Time when Anywhere cache instance is allocated.
4197 pub create_time: std::option::Option<wkt::Timestamp>,
4198
4199 /// Output only. Time when Anywhere cache instance is last updated, including
4200 /// creation.
4201 pub update_time: std::option::Option<wkt::Timestamp>,
4202
4203 /// Output only. True if there is an active update operation against this cache
4204 /// instance. Subsequential update requests will be rejected if this field is
4205 /// true. Output only.
4206 pub pending_update: bool,
4207
4208 /// Optional. Specifies whether objects are ingested into the cache upon write.
4209 /// Defaults to false.
4210 pub ingest_on_write: std::option::Option<bool>,
4211
4212 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4213}
4214
4215impl AnywhereCache {
4216 /// Creates a new default instance.
4217 pub fn new() -> Self {
4218 std::default::Default::default()
4219 }
4220
4221 /// Sets the value of [name][crate::model::AnywhereCache::name].
4222 ///
4223 /// # Example
4224 /// ```ignore,no_run
4225 /// # use google_cloud_storage::model::AnywhereCache;
4226 /// # let project_id = "project_id";
4227 /// # let bucket_id = "bucket_id";
4228 /// # let anywhere_cache_id = "anywhere_cache_id";
4229 /// let x = AnywhereCache::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
4230 /// ```
4231 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4232 self.name = v.into();
4233 self
4234 }
4235
4236 /// Sets the value of [zone][crate::model::AnywhereCache::zone].
4237 ///
4238 /// # Example
4239 /// ```ignore,no_run
4240 /// # use google_cloud_storage::model::AnywhereCache;
4241 /// let x = AnywhereCache::new().set_zone("example");
4242 /// ```
4243 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4244 self.zone = v.into();
4245 self
4246 }
4247
4248 /// Sets the value of [ttl][crate::model::AnywhereCache::ttl].
4249 ///
4250 /// # Example
4251 /// ```ignore,no_run
4252 /// # use google_cloud_storage::model::AnywhereCache;
4253 /// use wkt::Duration;
4254 /// let x = AnywhereCache::new().set_ttl(Duration::default()/* use setters */);
4255 /// ```
4256 pub fn set_ttl<T>(mut self, v: T) -> Self
4257 where
4258 T: std::convert::Into<wkt::Duration>,
4259 {
4260 self.ttl = std::option::Option::Some(v.into());
4261 self
4262 }
4263
4264 /// Sets or clears the value of [ttl][crate::model::AnywhereCache::ttl].
4265 ///
4266 /// # Example
4267 /// ```ignore,no_run
4268 /// # use google_cloud_storage::model::AnywhereCache;
4269 /// use wkt::Duration;
4270 /// let x = AnywhereCache::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
4271 /// let x = AnywhereCache::new().set_or_clear_ttl(None::<Duration>);
4272 /// ```
4273 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
4274 where
4275 T: std::convert::Into<wkt::Duration>,
4276 {
4277 self.ttl = v.map(|x| x.into());
4278 self
4279 }
4280
4281 /// Sets the value of [admission_policy][crate::model::AnywhereCache::admission_policy].
4282 ///
4283 /// # Example
4284 /// ```ignore,no_run
4285 /// # use google_cloud_storage::model::AnywhereCache;
4286 /// let x = AnywhereCache::new().set_admission_policy("example");
4287 /// ```
4288 pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
4289 mut self,
4290 v: T,
4291 ) -> Self {
4292 self.admission_policy = v.into();
4293 self
4294 }
4295
4296 /// Sets the value of [state][crate::model::AnywhereCache::state].
4297 ///
4298 /// # Example
4299 /// ```ignore,no_run
4300 /// # use google_cloud_storage::model::AnywhereCache;
4301 /// let x = AnywhereCache::new().set_state("example");
4302 /// ```
4303 pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4304 self.state = v.into();
4305 self
4306 }
4307
4308 /// Sets the value of [create_time][crate::model::AnywhereCache::create_time].
4309 ///
4310 /// # Example
4311 /// ```ignore,no_run
4312 /// # use google_cloud_storage::model::AnywhereCache;
4313 /// use wkt::Timestamp;
4314 /// let x = AnywhereCache::new().set_create_time(Timestamp::default()/* use setters */);
4315 /// ```
4316 pub fn set_create_time<T>(mut self, v: T) -> Self
4317 where
4318 T: std::convert::Into<wkt::Timestamp>,
4319 {
4320 self.create_time = std::option::Option::Some(v.into());
4321 self
4322 }
4323
4324 /// Sets or clears the value of [create_time][crate::model::AnywhereCache::create_time].
4325 ///
4326 /// # Example
4327 /// ```ignore,no_run
4328 /// # use google_cloud_storage::model::AnywhereCache;
4329 /// use wkt::Timestamp;
4330 /// let x = AnywhereCache::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4331 /// let x = AnywhereCache::new().set_or_clear_create_time(None::<Timestamp>);
4332 /// ```
4333 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4334 where
4335 T: std::convert::Into<wkt::Timestamp>,
4336 {
4337 self.create_time = v.map(|x| x.into());
4338 self
4339 }
4340
4341 /// Sets the value of [update_time][crate::model::AnywhereCache::update_time].
4342 ///
4343 /// # Example
4344 /// ```ignore,no_run
4345 /// # use google_cloud_storage::model::AnywhereCache;
4346 /// use wkt::Timestamp;
4347 /// let x = AnywhereCache::new().set_update_time(Timestamp::default()/* use setters */);
4348 /// ```
4349 pub fn set_update_time<T>(mut self, v: T) -> Self
4350 where
4351 T: std::convert::Into<wkt::Timestamp>,
4352 {
4353 self.update_time = std::option::Option::Some(v.into());
4354 self
4355 }
4356
4357 /// Sets or clears the value of [update_time][crate::model::AnywhereCache::update_time].
4358 ///
4359 /// # Example
4360 /// ```ignore,no_run
4361 /// # use google_cloud_storage::model::AnywhereCache;
4362 /// use wkt::Timestamp;
4363 /// let x = AnywhereCache::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4364 /// let x = AnywhereCache::new().set_or_clear_update_time(None::<Timestamp>);
4365 /// ```
4366 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4367 where
4368 T: std::convert::Into<wkt::Timestamp>,
4369 {
4370 self.update_time = v.map(|x| x.into());
4371 self
4372 }
4373
4374 /// Sets the value of [pending_update][crate::model::AnywhereCache::pending_update].
4375 ///
4376 /// # Example
4377 /// ```ignore,no_run
4378 /// # use google_cloud_storage::model::AnywhereCache;
4379 /// let x = AnywhereCache::new().set_pending_update(true);
4380 /// ```
4381 pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4382 self.pending_update = v.into();
4383 self
4384 }
4385
4386 /// Sets the value of [ingest_on_write][crate::model::AnywhereCache::ingest_on_write].
4387 ///
4388 /// # Example
4389 /// ```ignore,no_run
4390 /// # use google_cloud_storage::model::AnywhereCache;
4391 /// let x = AnywhereCache::new().set_ingest_on_write(true);
4392 /// ```
4393 pub fn set_ingest_on_write<T>(mut self, v: T) -> Self
4394 where
4395 T: std::convert::Into<bool>,
4396 {
4397 self.ingest_on_write = std::option::Option::Some(v.into());
4398 self
4399 }
4400
4401 /// Sets or clears the value of [ingest_on_write][crate::model::AnywhereCache::ingest_on_write].
4402 ///
4403 /// # Example
4404 /// ```ignore,no_run
4405 /// # use google_cloud_storage::model::AnywhereCache;
4406 /// let x = AnywhereCache::new().set_or_clear_ingest_on_write(Some(false));
4407 /// let x = AnywhereCache::new().set_or_clear_ingest_on_write(None::<bool>);
4408 /// ```
4409 pub fn set_or_clear_ingest_on_write<T>(mut self, v: std::option::Option<T>) -> Self
4410 where
4411 T: std::convert::Into<bool>,
4412 {
4413 self.ingest_on_write = v.map(|x| x.into());
4414 self
4415 }
4416}
4417
4418impl wkt::message::Message for AnywhereCache {
4419 fn typename() -> &'static str {
4420 "type.googleapis.com/google.storage.control.v2.AnywhereCache"
4421 }
4422}
4423
4424/// Request message for CreateAnywhereCache.
4425#[derive(Clone, Default, PartialEq)]
4426#[non_exhaustive]
4427pub struct CreateAnywhereCacheRequest {
4428 /// Required. The bucket to which this cache belongs.
4429 /// Format: `projects/{project}/buckets/{bucket}`
4430 pub parent: std::string::String,
4431
4432 /// Required. Properties of the Anywhere Cache instance being created.
4433 /// The parent bucket name is specified in the `parent` field. Server uses the
4434 /// default value of `ttl` or `admission_policy` if not specified in
4435 /// request.
4436 pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
4437
4438 /// Optional. A unique identifier for this request. UUID is the recommended
4439 /// format, but other formats are still accepted. This request is only
4440 /// idempotent if a `request_id` is provided.
4441 pub request_id: std::string::String,
4442
4443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4444}
4445
4446impl CreateAnywhereCacheRequest {
4447 /// Creates a new default instance.
4448 pub fn new() -> Self {
4449 std::default::Default::default()
4450 }
4451
4452 /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
4453 ///
4454 /// # Example
4455 /// ```ignore,no_run
4456 /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
4457 /// # let project_id = "project_id";
4458 /// # let bucket_id = "bucket_id";
4459 /// let x = CreateAnywhereCacheRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
4460 /// ```
4461 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4462 self.parent = v.into();
4463 self
4464 }
4465
4466 /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
4467 ///
4468 /// # Example
4469 /// ```ignore,no_run
4470 /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
4471 /// use google_cloud_storage::model::AnywhereCache;
4472 /// let x = CreateAnywhereCacheRequest::new().set_anywhere_cache(AnywhereCache::default()/* use setters */);
4473 /// ```
4474 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
4475 where
4476 T: std::convert::Into<crate::model::AnywhereCache>,
4477 {
4478 self.anywhere_cache = std::option::Option::Some(v.into());
4479 self
4480 }
4481
4482 /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
4483 ///
4484 /// # Example
4485 /// ```ignore,no_run
4486 /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
4487 /// use google_cloud_storage::model::AnywhereCache;
4488 /// let x = CreateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(Some(AnywhereCache::default()/* use setters */));
4489 /// let x = CreateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(None::<AnywhereCache>);
4490 /// ```
4491 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
4492 where
4493 T: std::convert::Into<crate::model::AnywhereCache>,
4494 {
4495 self.anywhere_cache = v.map(|x| x.into());
4496 self
4497 }
4498
4499 /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
4500 ///
4501 /// # Example
4502 /// ```ignore,no_run
4503 /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
4504 /// let x = CreateAnywhereCacheRequest::new().set_request_id("example");
4505 /// ```
4506 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4507 self.request_id = v.into();
4508 self
4509 }
4510}
4511
4512impl wkt::message::Message for CreateAnywhereCacheRequest {
4513 fn typename() -> &'static str {
4514 "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheRequest"
4515 }
4516}
4517
4518/// Request message for UpdateAnywhereCache.
4519#[derive(Clone, Default, PartialEq)]
4520#[non_exhaustive]
4521pub struct UpdateAnywhereCacheRequest {
4522 /// Required. The Anywhere Cache instance to be updated.
4523 pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
4524
4525 /// Required. List of fields to be updated. Mutable fields of AnywhereCache
4526 /// include `ttl` and `admission_policy`.
4527 ///
4528 /// To specify ALL fields, specify a single field with the value `*`. Note: We
4529 /// recommend against doing this. If a new field is introduced at a later time,
4530 /// an older client updating with the `*` may accidentally reset the new
4531 /// field's value.
4532 ///
4533 /// Not specifying any fields is an error.
4534 pub update_mask: std::option::Option<wkt::FieldMask>,
4535
4536 /// Optional. A unique identifier for this request. UUID is the recommended
4537 /// format, but other formats are still accepted. This request is only
4538 /// idempotent if a `request_id` is provided.
4539 pub request_id: std::string::String,
4540
4541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4542}
4543
4544impl UpdateAnywhereCacheRequest {
4545 /// Creates a new default instance.
4546 pub fn new() -> Self {
4547 std::default::Default::default()
4548 }
4549
4550 /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
4551 ///
4552 /// # Example
4553 /// ```ignore,no_run
4554 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
4555 /// use google_cloud_storage::model::AnywhereCache;
4556 /// let x = UpdateAnywhereCacheRequest::new().set_anywhere_cache(AnywhereCache::default()/* use setters */);
4557 /// ```
4558 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
4559 where
4560 T: std::convert::Into<crate::model::AnywhereCache>,
4561 {
4562 self.anywhere_cache = std::option::Option::Some(v.into());
4563 self
4564 }
4565
4566 /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
4567 ///
4568 /// # Example
4569 /// ```ignore,no_run
4570 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
4571 /// use google_cloud_storage::model::AnywhereCache;
4572 /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(Some(AnywhereCache::default()/* use setters */));
4573 /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(None::<AnywhereCache>);
4574 /// ```
4575 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
4576 where
4577 T: std::convert::Into<crate::model::AnywhereCache>,
4578 {
4579 self.anywhere_cache = v.map(|x| x.into());
4580 self
4581 }
4582
4583 /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
4584 ///
4585 /// # Example
4586 /// ```ignore,no_run
4587 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
4588 /// use wkt::FieldMask;
4589 /// let x = UpdateAnywhereCacheRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4590 /// ```
4591 pub fn set_update_mask<T>(mut self, v: T) -> Self
4592 where
4593 T: std::convert::Into<wkt::FieldMask>,
4594 {
4595 self.update_mask = std::option::Option::Some(v.into());
4596 self
4597 }
4598
4599 /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
4600 ///
4601 /// # Example
4602 /// ```ignore,no_run
4603 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
4604 /// use wkt::FieldMask;
4605 /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4606 /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4607 /// ```
4608 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4609 where
4610 T: std::convert::Into<wkt::FieldMask>,
4611 {
4612 self.update_mask = v.map(|x| x.into());
4613 self
4614 }
4615
4616 /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
4617 ///
4618 /// # Example
4619 /// ```ignore,no_run
4620 /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
4621 /// let x = UpdateAnywhereCacheRequest::new().set_request_id("example");
4622 /// ```
4623 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4624 self.request_id = v.into();
4625 self
4626 }
4627}
4628
4629impl wkt::message::Message for UpdateAnywhereCacheRequest {
4630 fn typename() -> &'static str {
4631 "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheRequest"
4632 }
4633}
4634
4635/// Request message for DisableAnywhereCache.
4636#[derive(Clone, Default, PartialEq)]
4637#[non_exhaustive]
4638pub struct DisableAnywhereCacheRequest {
4639 /// Required. The name field in the request should be:
4640 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
4641 pub name: std::string::String,
4642
4643 /// Optional. A unique identifier for this request. UUID is the recommended
4644 /// format, but other formats are still accepted. This request is only
4645 /// idempotent if a `request_id` is provided.
4646 pub request_id: std::string::String,
4647
4648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4649}
4650
4651impl DisableAnywhereCacheRequest {
4652 /// Creates a new default instance.
4653 pub fn new() -> Self {
4654 std::default::Default::default()
4655 }
4656
4657 /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
4658 ///
4659 /// # Example
4660 /// ```ignore,no_run
4661 /// # use google_cloud_storage::model::DisableAnywhereCacheRequest;
4662 /// # let project_id = "project_id";
4663 /// # let bucket_id = "bucket_id";
4664 /// # let anywhere_cache_id = "anywhere_cache_id";
4665 /// let x = DisableAnywhereCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
4666 /// ```
4667 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4668 self.name = v.into();
4669 self
4670 }
4671
4672 /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
4673 ///
4674 /// # Example
4675 /// ```ignore,no_run
4676 /// # use google_cloud_storage::model::DisableAnywhereCacheRequest;
4677 /// let x = DisableAnywhereCacheRequest::new().set_request_id("example");
4678 /// ```
4679 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4680 self.request_id = v.into();
4681 self
4682 }
4683}
4684
4685impl wkt::message::Message for DisableAnywhereCacheRequest {
4686 fn typename() -> &'static str {
4687 "type.googleapis.com/google.storage.control.v2.DisableAnywhereCacheRequest"
4688 }
4689}
4690
4691/// Request message for PauseAnywhereCache.
4692#[derive(Clone, Default, PartialEq)]
4693#[non_exhaustive]
4694pub struct PauseAnywhereCacheRequest {
4695 /// Required. The name field in the request should be:
4696 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
4697 pub name: std::string::String,
4698
4699 /// Optional. A unique identifier for this request. UUID is the recommended
4700 /// format, but other formats are still accepted. This request is only
4701 /// idempotent if a `request_id` is provided.
4702 pub request_id: std::string::String,
4703
4704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4705}
4706
4707impl PauseAnywhereCacheRequest {
4708 /// Creates a new default instance.
4709 pub fn new() -> Self {
4710 std::default::Default::default()
4711 }
4712
4713 /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
4714 ///
4715 /// # Example
4716 /// ```ignore,no_run
4717 /// # use google_cloud_storage::model::PauseAnywhereCacheRequest;
4718 /// # let project_id = "project_id";
4719 /// # let bucket_id = "bucket_id";
4720 /// # let anywhere_cache_id = "anywhere_cache_id";
4721 /// let x = PauseAnywhereCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
4722 /// ```
4723 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4724 self.name = v.into();
4725 self
4726 }
4727
4728 /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
4729 ///
4730 /// # Example
4731 /// ```ignore,no_run
4732 /// # use google_cloud_storage::model::PauseAnywhereCacheRequest;
4733 /// let x = PauseAnywhereCacheRequest::new().set_request_id("example");
4734 /// ```
4735 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4736 self.request_id = v.into();
4737 self
4738 }
4739}
4740
4741impl wkt::message::Message for PauseAnywhereCacheRequest {
4742 fn typename() -> &'static str {
4743 "type.googleapis.com/google.storage.control.v2.PauseAnywhereCacheRequest"
4744 }
4745}
4746
4747/// Request message for ResumeAnywhereCache.
4748#[derive(Clone, Default, PartialEq)]
4749#[non_exhaustive]
4750pub struct ResumeAnywhereCacheRequest {
4751 /// Required. The name field in the request should be:
4752 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
4753 pub name: std::string::String,
4754
4755 /// Optional. A unique identifier for this request. UUID is the recommended
4756 /// format, but other formats are still accepted. This request is only
4757 /// idempotent if a `request_id` is provided.
4758 pub request_id: std::string::String,
4759
4760 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4761}
4762
4763impl ResumeAnywhereCacheRequest {
4764 /// Creates a new default instance.
4765 pub fn new() -> Self {
4766 std::default::Default::default()
4767 }
4768
4769 /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
4770 ///
4771 /// # Example
4772 /// ```ignore,no_run
4773 /// # use google_cloud_storage::model::ResumeAnywhereCacheRequest;
4774 /// # let project_id = "project_id";
4775 /// # let bucket_id = "bucket_id";
4776 /// # let anywhere_cache_id = "anywhere_cache_id";
4777 /// let x = ResumeAnywhereCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
4778 /// ```
4779 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4780 self.name = v.into();
4781 self
4782 }
4783
4784 /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
4785 ///
4786 /// # Example
4787 /// ```ignore,no_run
4788 /// # use google_cloud_storage::model::ResumeAnywhereCacheRequest;
4789 /// let x = ResumeAnywhereCacheRequest::new().set_request_id("example");
4790 /// ```
4791 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4792 self.request_id = v.into();
4793 self
4794 }
4795}
4796
4797impl wkt::message::Message for ResumeAnywhereCacheRequest {
4798 fn typename() -> &'static str {
4799 "type.googleapis.com/google.storage.control.v2.ResumeAnywhereCacheRequest"
4800 }
4801}
4802
4803/// Request message for GetAnywhereCache.
4804#[derive(Clone, Default, PartialEq)]
4805#[non_exhaustive]
4806pub struct GetAnywhereCacheRequest {
4807 /// Required. The name field in the request should be:
4808 /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
4809 pub name: std::string::String,
4810
4811 /// Optional. A unique identifier for this request. UUID is the recommended
4812 /// format, but other formats are still accepted.
4813 pub request_id: std::string::String,
4814
4815 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4816}
4817
4818impl GetAnywhereCacheRequest {
4819 /// Creates a new default instance.
4820 pub fn new() -> Self {
4821 std::default::Default::default()
4822 }
4823
4824 /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
4825 ///
4826 /// # Example
4827 /// ```ignore,no_run
4828 /// # use google_cloud_storage::model::GetAnywhereCacheRequest;
4829 /// # let project_id = "project_id";
4830 /// # let bucket_id = "bucket_id";
4831 /// # let anywhere_cache_id = "anywhere_cache_id";
4832 /// let x = GetAnywhereCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/anywhereCaches/{anywhere_cache_id}"));
4833 /// ```
4834 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4835 self.name = v.into();
4836 self
4837 }
4838
4839 /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
4840 ///
4841 /// # Example
4842 /// ```ignore,no_run
4843 /// # use google_cloud_storage::model::GetAnywhereCacheRequest;
4844 /// let x = GetAnywhereCacheRequest::new().set_request_id("example");
4845 /// ```
4846 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4847 self.request_id = v.into();
4848 self
4849 }
4850}
4851
4852impl wkt::message::Message for GetAnywhereCacheRequest {
4853 fn typename() -> &'static str {
4854 "type.googleapis.com/google.storage.control.v2.GetAnywhereCacheRequest"
4855 }
4856}
4857
4858/// Request message for ListAnywhereCaches.
4859#[derive(Clone, Default, PartialEq)]
4860#[non_exhaustive]
4861pub struct ListAnywhereCachesRequest {
4862 /// Required. The bucket to which this cache belongs.
4863 pub parent: std::string::String,
4864
4865 /// Maximum number of caches to return in a single response.
4866 /// The service will use this parameter or 1,000 items, whichever is smaller.
4867 pub page_size: i32,
4868
4869 /// A previously-returned page token representing part of the larger set of
4870 /// results to view.
4871 pub page_token: std::string::String,
4872
4873 /// Optional. A unique identifier for this request. UUID is the recommended
4874 /// format, but other formats are still accepted.
4875 pub request_id: std::string::String,
4876
4877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4878}
4879
4880impl ListAnywhereCachesRequest {
4881 /// Creates a new default instance.
4882 pub fn new() -> Self {
4883 std::default::Default::default()
4884 }
4885
4886 /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
4887 ///
4888 /// # Example
4889 /// ```ignore,no_run
4890 /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
4891 /// # let project_id = "project_id";
4892 /// # let bucket_id = "bucket_id";
4893 /// let x = ListAnywhereCachesRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
4894 /// ```
4895 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4896 self.parent = v.into();
4897 self
4898 }
4899
4900 /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
4901 ///
4902 /// # Example
4903 /// ```ignore,no_run
4904 /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
4905 /// let x = ListAnywhereCachesRequest::new().set_page_size(42);
4906 /// ```
4907 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4908 self.page_size = v.into();
4909 self
4910 }
4911
4912 /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
4913 ///
4914 /// # Example
4915 /// ```ignore,no_run
4916 /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
4917 /// let x = ListAnywhereCachesRequest::new().set_page_token("example");
4918 /// ```
4919 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4920 self.page_token = v.into();
4921 self
4922 }
4923
4924 /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
4925 ///
4926 /// # Example
4927 /// ```ignore,no_run
4928 /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
4929 /// let x = ListAnywhereCachesRequest::new().set_request_id("example");
4930 /// ```
4931 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4932 self.request_id = v.into();
4933 self
4934 }
4935}
4936
4937impl wkt::message::Message for ListAnywhereCachesRequest {
4938 fn typename() -> &'static str {
4939 "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesRequest"
4940 }
4941}
4942
4943/// Response message for ListAnywhereCaches.
4944#[derive(Clone, Default, PartialEq)]
4945#[non_exhaustive]
4946pub struct ListAnywhereCachesResponse {
4947 /// The list of items.
4948 pub anywhere_caches: std::vec::Vec<crate::model::AnywhereCache>,
4949
4950 /// A token, which can be sent as `page_token` to retrieve the next page.
4951 /// If this field is omitted, there are no subsequent pages.
4952 pub next_page_token: std::string::String,
4953
4954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4955}
4956
4957impl ListAnywhereCachesResponse {
4958 /// Creates a new default instance.
4959 pub fn new() -> Self {
4960 std::default::Default::default()
4961 }
4962
4963 /// Sets the value of [anywhere_caches][crate::model::ListAnywhereCachesResponse::anywhere_caches].
4964 ///
4965 /// # Example
4966 /// ```ignore,no_run
4967 /// # use google_cloud_storage::model::ListAnywhereCachesResponse;
4968 /// use google_cloud_storage::model::AnywhereCache;
4969 /// let x = ListAnywhereCachesResponse::new()
4970 /// .set_anywhere_caches([
4971 /// AnywhereCache::default()/* use setters */,
4972 /// AnywhereCache::default()/* use (different) setters */,
4973 /// ]);
4974 /// ```
4975 pub fn set_anywhere_caches<T, V>(mut self, v: T) -> Self
4976 where
4977 T: std::iter::IntoIterator<Item = V>,
4978 V: std::convert::Into<crate::model::AnywhereCache>,
4979 {
4980 use std::iter::Iterator;
4981 self.anywhere_caches = v.into_iter().map(|i| i.into()).collect();
4982 self
4983 }
4984
4985 /// Sets the value of [next_page_token][crate::model::ListAnywhereCachesResponse::next_page_token].
4986 ///
4987 /// # Example
4988 /// ```ignore,no_run
4989 /// # use google_cloud_storage::model::ListAnywhereCachesResponse;
4990 /// let x = ListAnywhereCachesResponse::new().set_next_page_token("example");
4991 /// ```
4992 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4993 self.next_page_token = v.into();
4994 self
4995 }
4996}
4997
4998impl wkt::message::Message for ListAnywhereCachesResponse {
4999 fn typename() -> &'static str {
5000 "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesResponse"
5001 }
5002}
5003
5004#[doc(hidden)]
5005impl google_cloud_gax::paginator::internal::PageableResponse for ListAnywhereCachesResponse {
5006 type PageItem = crate::model::AnywhereCache;
5007
5008 fn items(self) -> std::vec::Vec<Self::PageItem> {
5009 self.anywhere_caches
5010 }
5011
5012 fn next_page_token(&self) -> std::string::String {
5013 use std::clone::Clone;
5014 self.next_page_token.clone()
5015 }
5016}
5017
5018/// A Rapid Cache Instance.
5019#[derive(Clone, Default, PartialEq)]
5020#[non_exhaustive]
5021pub struct RapidCache {
5022 /// Immutable. The resource name of this RapidCache.
5023 /// Format:
5024 /// projects/{project}/buckets/{bucket}/rapidCaches/{rapid_cache}
5025 pub name: std::string::String,
5026
5027 /// Immutable. The zone in which the cache instance is running. For example,
5028 /// us-central1-a.
5029 pub zone: std::string::String,
5030
5031 /// Immutable. The type of Rapid Cache this represents. Valid values include:
5032 /// 'rapid-cache' and 'rapid-cache-ultra'.
5033 pub cache_type: std::string::String,
5034
5035 /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
5036 /// that defines how long a cache entry can live. Default ttl value (24hrs)
5037 /// is applied if not specified in the create request. TTL must be in whole
5038 /// seconds.
5039 pub ttl: std::option::Option<wkt::Duration>,
5040
5041 /// Cache admission policy. Valid policies includes:
5042 /// no_read_admission, admit-on-first-miss and admit-on-second-miss. Defaults
5043 /// to admit-on-first-miss for both AC and RCU. Default value is applied if not
5044 /// specified in the create request.
5045 pub admission_policy: std::string::String,
5046
5047 /// Output only. Cache state including running, creating, and disabled.
5048 pub state: std::string::String,
5049
5050 /// Output only. Time when Rapid cache instance is allocated.
5051 pub create_time: std::option::Option<wkt::Timestamp>,
5052
5053 /// Output only. Time when Rapid cache instance is last updated, including
5054 /// creation.
5055 pub update_time: std::option::Option<wkt::Timestamp>,
5056
5057 /// Output only. True if there is an active update operation against this cache
5058 /// instance. Subsequential update requests will be rejected if this field is
5059 /// true. Output only.
5060 pub pending_update: bool,
5061
5062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5063}
5064
5065impl RapidCache {
5066 /// Creates a new default instance.
5067 pub fn new() -> Self {
5068 std::default::Default::default()
5069 }
5070
5071 /// Sets the value of [name][crate::model::RapidCache::name].
5072 ///
5073 /// # Example
5074 /// ```ignore,no_run
5075 /// # use google_cloud_storage::model::RapidCache;
5076 /// # let project_id = "project_id";
5077 /// # let bucket_id = "bucket_id";
5078 /// # let rapid_cache_id = "rapid_cache_id";
5079 /// let x = RapidCache::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/rapidCaches/{rapid_cache_id}"));
5080 /// ```
5081 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5082 self.name = v.into();
5083 self
5084 }
5085
5086 /// Sets the value of [zone][crate::model::RapidCache::zone].
5087 ///
5088 /// # Example
5089 /// ```ignore,no_run
5090 /// # use google_cloud_storage::model::RapidCache;
5091 /// let x = RapidCache::new().set_zone("example");
5092 /// ```
5093 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5094 self.zone = v.into();
5095 self
5096 }
5097
5098 /// Sets the value of [cache_type][crate::model::RapidCache::cache_type].
5099 ///
5100 /// # Example
5101 /// ```ignore,no_run
5102 /// # use google_cloud_storage::model::RapidCache;
5103 /// let x = RapidCache::new().set_cache_type("example");
5104 /// ```
5105 pub fn set_cache_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5106 self.cache_type = v.into();
5107 self
5108 }
5109
5110 /// Sets the value of [ttl][crate::model::RapidCache::ttl].
5111 ///
5112 /// # Example
5113 /// ```ignore,no_run
5114 /// # use google_cloud_storage::model::RapidCache;
5115 /// use wkt::Duration;
5116 /// let x = RapidCache::new().set_ttl(Duration::default()/* use setters */);
5117 /// ```
5118 pub fn set_ttl<T>(mut self, v: T) -> Self
5119 where
5120 T: std::convert::Into<wkt::Duration>,
5121 {
5122 self.ttl = std::option::Option::Some(v.into());
5123 self
5124 }
5125
5126 /// Sets or clears the value of [ttl][crate::model::RapidCache::ttl].
5127 ///
5128 /// # Example
5129 /// ```ignore,no_run
5130 /// # use google_cloud_storage::model::RapidCache;
5131 /// use wkt::Duration;
5132 /// let x = RapidCache::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
5133 /// let x = RapidCache::new().set_or_clear_ttl(None::<Duration>);
5134 /// ```
5135 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5136 where
5137 T: std::convert::Into<wkt::Duration>,
5138 {
5139 self.ttl = v.map(|x| x.into());
5140 self
5141 }
5142
5143 /// Sets the value of [admission_policy][crate::model::RapidCache::admission_policy].
5144 ///
5145 /// # Example
5146 /// ```ignore,no_run
5147 /// # use google_cloud_storage::model::RapidCache;
5148 /// let x = RapidCache::new().set_admission_policy("example");
5149 /// ```
5150 pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
5151 mut self,
5152 v: T,
5153 ) -> Self {
5154 self.admission_policy = v.into();
5155 self
5156 }
5157
5158 /// Sets the value of [state][crate::model::RapidCache::state].
5159 ///
5160 /// # Example
5161 /// ```ignore,no_run
5162 /// # use google_cloud_storage::model::RapidCache;
5163 /// let x = RapidCache::new().set_state("example");
5164 /// ```
5165 pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5166 self.state = v.into();
5167 self
5168 }
5169
5170 /// Sets the value of [create_time][crate::model::RapidCache::create_time].
5171 ///
5172 /// # Example
5173 /// ```ignore,no_run
5174 /// # use google_cloud_storage::model::RapidCache;
5175 /// use wkt::Timestamp;
5176 /// let x = RapidCache::new().set_create_time(Timestamp::default()/* use setters */);
5177 /// ```
5178 pub fn set_create_time<T>(mut self, v: T) -> Self
5179 where
5180 T: std::convert::Into<wkt::Timestamp>,
5181 {
5182 self.create_time = std::option::Option::Some(v.into());
5183 self
5184 }
5185
5186 /// Sets or clears the value of [create_time][crate::model::RapidCache::create_time].
5187 ///
5188 /// # Example
5189 /// ```ignore,no_run
5190 /// # use google_cloud_storage::model::RapidCache;
5191 /// use wkt::Timestamp;
5192 /// let x = RapidCache::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5193 /// let x = RapidCache::new().set_or_clear_create_time(None::<Timestamp>);
5194 /// ```
5195 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5196 where
5197 T: std::convert::Into<wkt::Timestamp>,
5198 {
5199 self.create_time = v.map(|x| x.into());
5200 self
5201 }
5202
5203 /// Sets the value of [update_time][crate::model::RapidCache::update_time].
5204 ///
5205 /// # Example
5206 /// ```ignore,no_run
5207 /// # use google_cloud_storage::model::RapidCache;
5208 /// use wkt::Timestamp;
5209 /// let x = RapidCache::new().set_update_time(Timestamp::default()/* use setters */);
5210 /// ```
5211 pub fn set_update_time<T>(mut self, v: T) -> Self
5212 where
5213 T: std::convert::Into<wkt::Timestamp>,
5214 {
5215 self.update_time = std::option::Option::Some(v.into());
5216 self
5217 }
5218
5219 /// Sets or clears the value of [update_time][crate::model::RapidCache::update_time].
5220 ///
5221 /// # Example
5222 /// ```ignore,no_run
5223 /// # use google_cloud_storage::model::RapidCache;
5224 /// use wkt::Timestamp;
5225 /// let x = RapidCache::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5226 /// let x = RapidCache::new().set_or_clear_update_time(None::<Timestamp>);
5227 /// ```
5228 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5229 where
5230 T: std::convert::Into<wkt::Timestamp>,
5231 {
5232 self.update_time = v.map(|x| x.into());
5233 self
5234 }
5235
5236 /// Sets the value of [pending_update][crate::model::RapidCache::pending_update].
5237 ///
5238 /// # Example
5239 /// ```ignore,no_run
5240 /// # use google_cloud_storage::model::RapidCache;
5241 /// let x = RapidCache::new().set_pending_update(true);
5242 /// ```
5243 pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5244 self.pending_update = v.into();
5245 self
5246 }
5247}
5248
5249impl wkt::message::Message for RapidCache {
5250 fn typename() -> &'static str {
5251 "type.googleapis.com/google.storage.control.v2.RapidCache"
5252 }
5253}
5254
5255/// Request message for CreateRapidCache.
5256#[derive(Clone, Default, PartialEq)]
5257#[non_exhaustive]
5258pub struct CreateRapidCacheRequest {
5259 /// Required. The bucket to which this cache belongs.
5260 /// Format: `projects/{project}/buckets/{bucket}`
5261 pub parent: std::string::String,
5262
5263 /// Required. The RapidCache to create. Default values for ingest_on_write, ttl
5264 /// and admission_policy will be applied if not specified in the request.
5265 pub rapid_cache: std::option::Option<crate::model::RapidCache>,
5266
5267 /// Optional. A unique identifier for this request. UUID is the recommended
5268 /// format, but other formats are still accepted. This request is only
5269 /// idempotent if a `request_id` is provided.
5270 pub request_id: std::string::String,
5271
5272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5273}
5274
5275impl CreateRapidCacheRequest {
5276 /// Creates a new default instance.
5277 pub fn new() -> Self {
5278 std::default::Default::default()
5279 }
5280
5281 /// Sets the value of [parent][crate::model::CreateRapidCacheRequest::parent].
5282 ///
5283 /// # Example
5284 /// ```ignore,no_run
5285 /// # use google_cloud_storage::model::CreateRapidCacheRequest;
5286 /// # let project_id = "project_id";
5287 /// # let bucket_id = "bucket_id";
5288 /// let x = CreateRapidCacheRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
5289 /// ```
5290 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5291 self.parent = v.into();
5292 self
5293 }
5294
5295 /// Sets the value of [rapid_cache][crate::model::CreateRapidCacheRequest::rapid_cache].
5296 ///
5297 /// # Example
5298 /// ```ignore,no_run
5299 /// # use google_cloud_storage::model::CreateRapidCacheRequest;
5300 /// use google_cloud_storage::model::RapidCache;
5301 /// let x = CreateRapidCacheRequest::new().set_rapid_cache(RapidCache::default()/* use setters */);
5302 /// ```
5303 pub fn set_rapid_cache<T>(mut self, v: T) -> Self
5304 where
5305 T: std::convert::Into<crate::model::RapidCache>,
5306 {
5307 self.rapid_cache = std::option::Option::Some(v.into());
5308 self
5309 }
5310
5311 /// Sets or clears the value of [rapid_cache][crate::model::CreateRapidCacheRequest::rapid_cache].
5312 ///
5313 /// # Example
5314 /// ```ignore,no_run
5315 /// # use google_cloud_storage::model::CreateRapidCacheRequest;
5316 /// use google_cloud_storage::model::RapidCache;
5317 /// let x = CreateRapidCacheRequest::new().set_or_clear_rapid_cache(Some(RapidCache::default()/* use setters */));
5318 /// let x = CreateRapidCacheRequest::new().set_or_clear_rapid_cache(None::<RapidCache>);
5319 /// ```
5320 pub fn set_or_clear_rapid_cache<T>(mut self, v: std::option::Option<T>) -> Self
5321 where
5322 T: std::convert::Into<crate::model::RapidCache>,
5323 {
5324 self.rapid_cache = v.map(|x| x.into());
5325 self
5326 }
5327
5328 /// Sets the value of [request_id][crate::model::CreateRapidCacheRequest::request_id].
5329 ///
5330 /// # Example
5331 /// ```ignore,no_run
5332 /// # use google_cloud_storage::model::CreateRapidCacheRequest;
5333 /// let x = CreateRapidCacheRequest::new().set_request_id("example");
5334 /// ```
5335 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5336 self.request_id = v.into();
5337 self
5338 }
5339}
5340
5341impl wkt::message::Message for CreateRapidCacheRequest {
5342 fn typename() -> &'static str {
5343 "type.googleapis.com/google.storage.control.v2.CreateRapidCacheRequest"
5344 }
5345}
5346
5347/// Request message for UpdateRapidCache.
5348#[derive(Clone, Default, PartialEq)]
5349#[non_exhaustive]
5350pub struct UpdateRapidCacheRequest {
5351 /// Required. The RapidCache to update.
5352 pub rapid_cache: std::option::Option<crate::model::RapidCache>,
5353
5354 /// Required. List of fields to be updated. Mutable fields of RapidCache
5355 /// include `ttl`, `admission_policy` and `ingest_on_write`.
5356 ///
5357 /// To specify ALL fields, specify a single field with the value `*`. Note: We
5358 /// recommend against doing this. If a new field is introduced at a later time,
5359 /// an older client updating with the `*` may accidentally reset the new
5360 /// field's value.
5361 ///
5362 /// Not specifying any fields is an error.
5363 pub update_mask: std::option::Option<wkt::FieldMask>,
5364
5365 /// Optional. A unique identifier for this request. UUID is the recommended
5366 /// format, but other formats are still accepted. This request is only
5367 /// idempotent if a `request_id` is provided.
5368 pub request_id: std::string::String,
5369
5370 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5371}
5372
5373impl UpdateRapidCacheRequest {
5374 /// Creates a new default instance.
5375 pub fn new() -> Self {
5376 std::default::Default::default()
5377 }
5378
5379 /// Sets the value of [rapid_cache][crate::model::UpdateRapidCacheRequest::rapid_cache].
5380 ///
5381 /// # Example
5382 /// ```ignore,no_run
5383 /// # use google_cloud_storage::model::UpdateRapidCacheRequest;
5384 /// use google_cloud_storage::model::RapidCache;
5385 /// let x = UpdateRapidCacheRequest::new().set_rapid_cache(RapidCache::default()/* use setters */);
5386 /// ```
5387 pub fn set_rapid_cache<T>(mut self, v: T) -> Self
5388 where
5389 T: std::convert::Into<crate::model::RapidCache>,
5390 {
5391 self.rapid_cache = std::option::Option::Some(v.into());
5392 self
5393 }
5394
5395 /// Sets or clears the value of [rapid_cache][crate::model::UpdateRapidCacheRequest::rapid_cache].
5396 ///
5397 /// # Example
5398 /// ```ignore,no_run
5399 /// # use google_cloud_storage::model::UpdateRapidCacheRequest;
5400 /// use google_cloud_storage::model::RapidCache;
5401 /// let x = UpdateRapidCacheRequest::new().set_or_clear_rapid_cache(Some(RapidCache::default()/* use setters */));
5402 /// let x = UpdateRapidCacheRequest::new().set_or_clear_rapid_cache(None::<RapidCache>);
5403 /// ```
5404 pub fn set_or_clear_rapid_cache<T>(mut self, v: std::option::Option<T>) -> Self
5405 where
5406 T: std::convert::Into<crate::model::RapidCache>,
5407 {
5408 self.rapid_cache = v.map(|x| x.into());
5409 self
5410 }
5411
5412 /// Sets the value of [update_mask][crate::model::UpdateRapidCacheRequest::update_mask].
5413 ///
5414 /// # Example
5415 /// ```ignore,no_run
5416 /// # use google_cloud_storage::model::UpdateRapidCacheRequest;
5417 /// use wkt::FieldMask;
5418 /// let x = UpdateRapidCacheRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5419 /// ```
5420 pub fn set_update_mask<T>(mut self, v: T) -> Self
5421 where
5422 T: std::convert::Into<wkt::FieldMask>,
5423 {
5424 self.update_mask = std::option::Option::Some(v.into());
5425 self
5426 }
5427
5428 /// Sets or clears the value of [update_mask][crate::model::UpdateRapidCacheRequest::update_mask].
5429 ///
5430 /// # Example
5431 /// ```ignore,no_run
5432 /// # use google_cloud_storage::model::UpdateRapidCacheRequest;
5433 /// use wkt::FieldMask;
5434 /// let x = UpdateRapidCacheRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5435 /// let x = UpdateRapidCacheRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5436 /// ```
5437 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5438 where
5439 T: std::convert::Into<wkt::FieldMask>,
5440 {
5441 self.update_mask = v.map(|x| x.into());
5442 self
5443 }
5444
5445 /// Sets the value of [request_id][crate::model::UpdateRapidCacheRequest::request_id].
5446 ///
5447 /// # Example
5448 /// ```ignore,no_run
5449 /// # use google_cloud_storage::model::UpdateRapidCacheRequest;
5450 /// let x = UpdateRapidCacheRequest::new().set_request_id("example");
5451 /// ```
5452 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5453 self.request_id = v.into();
5454 self
5455 }
5456}
5457
5458impl wkt::message::Message for UpdateRapidCacheRequest {
5459 fn typename() -> &'static str {
5460 "type.googleapis.com/google.storage.control.v2.UpdateRapidCacheRequest"
5461 }
5462}
5463
5464/// Request message for DisableRapidCache.
5465#[derive(Clone, Default, PartialEq)]
5466#[non_exhaustive]
5467pub struct DisableRapidCacheRequest {
5468 /// Required. The name field in the request should be:
5469 /// `projects/{project}/buckets/{bucket}/rapidCaches/{rapid_cache}`
5470 pub name: std::string::String,
5471
5472 /// Optional. A unique identifier for this request. UUID is the recommended
5473 /// format, but other formats are still accepted. This request is only
5474 /// idempotent if a `request_id` is provided.
5475 pub request_id: std::string::String,
5476
5477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5478}
5479
5480impl DisableRapidCacheRequest {
5481 /// Creates a new default instance.
5482 pub fn new() -> Self {
5483 std::default::Default::default()
5484 }
5485
5486 /// Sets the value of [name][crate::model::DisableRapidCacheRequest::name].
5487 ///
5488 /// # Example
5489 /// ```ignore,no_run
5490 /// # use google_cloud_storage::model::DisableRapidCacheRequest;
5491 /// # let project_id = "project_id";
5492 /// # let bucket_id = "bucket_id";
5493 /// # let rapid_cache_id = "rapid_cache_id";
5494 /// let x = DisableRapidCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/rapidCaches/{rapid_cache_id}"));
5495 /// ```
5496 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5497 self.name = v.into();
5498 self
5499 }
5500
5501 /// Sets the value of [request_id][crate::model::DisableRapidCacheRequest::request_id].
5502 ///
5503 /// # Example
5504 /// ```ignore,no_run
5505 /// # use google_cloud_storage::model::DisableRapidCacheRequest;
5506 /// let x = DisableRapidCacheRequest::new().set_request_id("example");
5507 /// ```
5508 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5509 self.request_id = v.into();
5510 self
5511 }
5512}
5513
5514impl wkt::message::Message for DisableRapidCacheRequest {
5515 fn typename() -> &'static str {
5516 "type.googleapis.com/google.storage.control.v2.DisableRapidCacheRequest"
5517 }
5518}
5519
5520/// Request message for GetRapidCache.
5521#[derive(Clone, Default, PartialEq)]
5522#[non_exhaustive]
5523pub struct GetRapidCacheRequest {
5524 /// Required. The name field in the request should be:
5525 /// `projects/{project}/buckets/{bucket}/rapidCaches/{rapid_cache}`
5526 pub name: std::string::String,
5527
5528 /// Optional. A unique identifier for this request. UUID is the recommended
5529 /// format, but other formats are still accepted.
5530 pub request_id: std::string::String,
5531
5532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5533}
5534
5535impl GetRapidCacheRequest {
5536 /// Creates a new default instance.
5537 pub fn new() -> Self {
5538 std::default::Default::default()
5539 }
5540
5541 /// Sets the value of [name][crate::model::GetRapidCacheRequest::name].
5542 ///
5543 /// # Example
5544 /// ```ignore,no_run
5545 /// # use google_cloud_storage::model::GetRapidCacheRequest;
5546 /// # let project_id = "project_id";
5547 /// # let bucket_id = "bucket_id";
5548 /// # let rapid_cache_id = "rapid_cache_id";
5549 /// let x = GetRapidCacheRequest::new().set_name(format!("projects/{project_id}/buckets/{bucket_id}/rapidCaches/{rapid_cache_id}"));
5550 /// ```
5551 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5552 self.name = v.into();
5553 self
5554 }
5555
5556 /// Sets the value of [request_id][crate::model::GetRapidCacheRequest::request_id].
5557 ///
5558 /// # Example
5559 /// ```ignore,no_run
5560 /// # use google_cloud_storage::model::GetRapidCacheRequest;
5561 /// let x = GetRapidCacheRequest::new().set_request_id("example");
5562 /// ```
5563 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5564 self.request_id = v.into();
5565 self
5566 }
5567}
5568
5569impl wkt::message::Message for GetRapidCacheRequest {
5570 fn typename() -> &'static str {
5571 "type.googleapis.com/google.storage.control.v2.GetRapidCacheRequest"
5572 }
5573}
5574
5575/// Request message for ListRapidCaches.
5576#[derive(Clone, Default, PartialEq)]
5577#[non_exhaustive]
5578pub struct ListRapidCachesRequest {
5579 /// Required. The bucket to which this cache belongs.
5580 pub parent: std::string::String,
5581
5582 /// Maximum number of caches to return in a single response.
5583 /// The service will use this parameter or 1,000 items, whichever is smaller.
5584 pub page_size: i32,
5585
5586 /// A previously-returned page token representing part of the larger set of
5587 /// results to view.
5588 pub page_token: std::string::String,
5589
5590 /// Optional. A unique identifier for this request. UUID is the recommended
5591 /// format, but other formats are still accepted.
5592 pub request_id: std::string::String,
5593
5594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5595}
5596
5597impl ListRapidCachesRequest {
5598 /// Creates a new default instance.
5599 pub fn new() -> Self {
5600 std::default::Default::default()
5601 }
5602
5603 /// Sets the value of [parent][crate::model::ListRapidCachesRequest::parent].
5604 ///
5605 /// # Example
5606 /// ```ignore,no_run
5607 /// # use google_cloud_storage::model::ListRapidCachesRequest;
5608 /// # let project_id = "project_id";
5609 /// # let bucket_id = "bucket_id";
5610 /// let x = ListRapidCachesRequest::new().set_parent(format!("projects/{project_id}/buckets/{bucket_id}"));
5611 /// ```
5612 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5613 self.parent = v.into();
5614 self
5615 }
5616
5617 /// Sets the value of [page_size][crate::model::ListRapidCachesRequest::page_size].
5618 ///
5619 /// # Example
5620 /// ```ignore,no_run
5621 /// # use google_cloud_storage::model::ListRapidCachesRequest;
5622 /// let x = ListRapidCachesRequest::new().set_page_size(42);
5623 /// ```
5624 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5625 self.page_size = v.into();
5626 self
5627 }
5628
5629 /// Sets the value of [page_token][crate::model::ListRapidCachesRequest::page_token].
5630 ///
5631 /// # Example
5632 /// ```ignore,no_run
5633 /// # use google_cloud_storage::model::ListRapidCachesRequest;
5634 /// let x = ListRapidCachesRequest::new().set_page_token("example");
5635 /// ```
5636 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5637 self.page_token = v.into();
5638 self
5639 }
5640
5641 /// Sets the value of [request_id][crate::model::ListRapidCachesRequest::request_id].
5642 ///
5643 /// # Example
5644 /// ```ignore,no_run
5645 /// # use google_cloud_storage::model::ListRapidCachesRequest;
5646 /// let x = ListRapidCachesRequest::new().set_request_id("example");
5647 /// ```
5648 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5649 self.request_id = v.into();
5650 self
5651 }
5652}
5653
5654impl wkt::message::Message for ListRapidCachesRequest {
5655 fn typename() -> &'static str {
5656 "type.googleapis.com/google.storage.control.v2.ListRapidCachesRequest"
5657 }
5658}
5659
5660/// Response message for ListRapidCaches.
5661#[derive(Clone, Default, PartialEq)]
5662#[non_exhaustive]
5663pub struct ListRapidCachesResponse {
5664 /// The list of rapid caches.
5665 pub rapid_caches: std::vec::Vec<crate::model::RapidCache>,
5666
5667 /// A token, which can be sent as `page_token` to retrieve the next page.
5668 /// If this field is omitted, there are no subsequent pages.
5669 pub next_page_token: std::string::String,
5670
5671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5672}
5673
5674impl ListRapidCachesResponse {
5675 /// Creates a new default instance.
5676 pub fn new() -> Self {
5677 std::default::Default::default()
5678 }
5679
5680 /// Sets the value of [rapid_caches][crate::model::ListRapidCachesResponse::rapid_caches].
5681 ///
5682 /// # Example
5683 /// ```ignore,no_run
5684 /// # use google_cloud_storage::model::ListRapidCachesResponse;
5685 /// use google_cloud_storage::model::RapidCache;
5686 /// let x = ListRapidCachesResponse::new()
5687 /// .set_rapid_caches([
5688 /// RapidCache::default()/* use setters */,
5689 /// RapidCache::default()/* use (different) setters */,
5690 /// ]);
5691 /// ```
5692 pub fn set_rapid_caches<T, V>(mut self, v: T) -> Self
5693 where
5694 T: std::iter::IntoIterator<Item = V>,
5695 V: std::convert::Into<crate::model::RapidCache>,
5696 {
5697 use std::iter::Iterator;
5698 self.rapid_caches = v.into_iter().map(|i| i.into()).collect();
5699 self
5700 }
5701
5702 /// Sets the value of [next_page_token][crate::model::ListRapidCachesResponse::next_page_token].
5703 ///
5704 /// # Example
5705 /// ```ignore,no_run
5706 /// # use google_cloud_storage::model::ListRapidCachesResponse;
5707 /// let x = ListRapidCachesResponse::new().set_next_page_token("example");
5708 /// ```
5709 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5710 self.next_page_token = v.into();
5711 self
5712 }
5713}
5714
5715impl wkt::message::Message for ListRapidCachesResponse {
5716 fn typename() -> &'static str {
5717 "type.googleapis.com/google.storage.control.v2.ListRapidCachesResponse"
5718 }
5719}
5720
5721#[doc(hidden)]
5722impl google_cloud_gax::paginator::internal::PageableResponse for ListRapidCachesResponse {
5723 type PageItem = crate::model::RapidCache;
5724
5725 fn items(self) -> std::vec::Vec<Self::PageItem> {
5726 self.rapid_caches
5727 }
5728
5729 fn next_page_token(&self) -> std::string::String {
5730 use std::clone::Clone;
5731 self.next_page_token.clone()
5732 }
5733}
5734
5735/// The `IntelligenceConfig` resource associated with your organization, folder,
5736/// or project.
5737#[derive(Clone, Default, PartialEq)]
5738#[non_exhaustive]
5739pub struct IntelligenceConfig {
5740 /// Identifier. The name of the `IntelligenceConfig` resource associated with
5741 /// your organization, folder, or project.
5742 ///
5743 /// The name format varies based on the GCP resource hierarchy as follows:
5744 ///
5745 /// * For project:
5746 /// `projects/{project_number}/locations/global/intelligenceConfig`
5747 /// * For organization:
5748 /// `organizations/{org_id}/locations/global/intelligenceConfig`
5749 /// * For folder: `folders/{folder_id}/locations/global/intelligenceConfig`
5750 pub name: std::string::String,
5751
5752 /// Optional. The edition configuration of the `IntelligenceConfig` resource.
5753 pub edition_config: crate::model::intelligence_config::EditionConfig,
5754
5755 /// Output only. The time at which the `IntelligenceConfig` resource is last
5756 /// updated.
5757 pub update_time: std::option::Option<wkt::Timestamp>,
5758
5759 /// Optional. Filter over location and bucket.
5760 pub filter: std::option::Option<crate::model::intelligence_config::Filter>,
5761
5762 /// Output only. The `IntelligenceConfig` resource that is applicable for the
5763 /// resource.
5764 pub effective_intelligence_config:
5765 std::option::Option<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
5766
5767 /// The trial configuration of the `IntelligenceConfig` resource.
5768 pub trial_config: std::option::Option<crate::model::intelligence_config::TrialConfig>,
5769
5770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5771}
5772
5773impl IntelligenceConfig {
5774 /// Creates a new default instance.
5775 pub fn new() -> Self {
5776 std::default::Default::default()
5777 }
5778
5779 /// Sets the value of [name][crate::model::IntelligenceConfig::name].
5780 ///
5781 /// # Example
5782 /// ```ignore,no_run
5783 /// # use google_cloud_storage::model::IntelligenceConfig;
5784 /// # let folder_id = "folder_id";
5785 /// # let location_id = "location_id";
5786 /// let x = IntelligenceConfig::new().set_name(format!("folders/{folder_id}/locations/{location_id}/intelligenceConfig"));
5787 /// ```
5788 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5789 self.name = v.into();
5790 self
5791 }
5792
5793 /// Sets the value of [edition_config][crate::model::IntelligenceConfig::edition_config].
5794 ///
5795 /// # Example
5796 /// ```ignore,no_run
5797 /// # use google_cloud_storage::model::IntelligenceConfig;
5798 /// use google_cloud_storage::model::intelligence_config::EditionConfig;
5799 /// let x0 = IntelligenceConfig::new().set_edition_config(EditionConfig::Inherit);
5800 /// let x1 = IntelligenceConfig::new().set_edition_config(EditionConfig::Disabled);
5801 /// let x2 = IntelligenceConfig::new().set_edition_config(EditionConfig::Standard);
5802 /// ```
5803 pub fn set_edition_config<
5804 T: std::convert::Into<crate::model::intelligence_config::EditionConfig>,
5805 >(
5806 mut self,
5807 v: T,
5808 ) -> Self {
5809 self.edition_config = v.into();
5810 self
5811 }
5812
5813 /// Sets the value of [update_time][crate::model::IntelligenceConfig::update_time].
5814 ///
5815 /// # Example
5816 /// ```ignore,no_run
5817 /// # use google_cloud_storage::model::IntelligenceConfig;
5818 /// use wkt::Timestamp;
5819 /// let x = IntelligenceConfig::new().set_update_time(Timestamp::default()/* use setters */);
5820 /// ```
5821 pub fn set_update_time<T>(mut self, v: T) -> Self
5822 where
5823 T: std::convert::Into<wkt::Timestamp>,
5824 {
5825 self.update_time = std::option::Option::Some(v.into());
5826 self
5827 }
5828
5829 /// Sets or clears the value of [update_time][crate::model::IntelligenceConfig::update_time].
5830 ///
5831 /// # Example
5832 /// ```ignore,no_run
5833 /// # use google_cloud_storage::model::IntelligenceConfig;
5834 /// use wkt::Timestamp;
5835 /// let x = IntelligenceConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5836 /// let x = IntelligenceConfig::new().set_or_clear_update_time(None::<Timestamp>);
5837 /// ```
5838 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5839 where
5840 T: std::convert::Into<wkt::Timestamp>,
5841 {
5842 self.update_time = v.map(|x| x.into());
5843 self
5844 }
5845
5846 /// Sets the value of [filter][crate::model::IntelligenceConfig::filter].
5847 ///
5848 /// # Example
5849 /// ```ignore,no_run
5850 /// # use google_cloud_storage::model::IntelligenceConfig;
5851 /// use google_cloud_storage::model::intelligence_config::Filter;
5852 /// let x = IntelligenceConfig::new().set_filter(Filter::default()/* use setters */);
5853 /// ```
5854 pub fn set_filter<T>(mut self, v: T) -> Self
5855 where
5856 T: std::convert::Into<crate::model::intelligence_config::Filter>,
5857 {
5858 self.filter = std::option::Option::Some(v.into());
5859 self
5860 }
5861
5862 /// Sets or clears the value of [filter][crate::model::IntelligenceConfig::filter].
5863 ///
5864 /// # Example
5865 /// ```ignore,no_run
5866 /// # use google_cloud_storage::model::IntelligenceConfig;
5867 /// use google_cloud_storage::model::intelligence_config::Filter;
5868 /// let x = IntelligenceConfig::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
5869 /// let x = IntelligenceConfig::new().set_or_clear_filter(None::<Filter>);
5870 /// ```
5871 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
5872 where
5873 T: std::convert::Into<crate::model::intelligence_config::Filter>,
5874 {
5875 self.filter = v.map(|x| x.into());
5876 self
5877 }
5878
5879 /// Sets the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
5880 ///
5881 /// # Example
5882 /// ```ignore,no_run
5883 /// # use google_cloud_storage::model::IntelligenceConfig;
5884 /// use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
5885 /// let x = IntelligenceConfig::new().set_effective_intelligence_config(EffectiveIntelligenceConfig::default()/* use setters */);
5886 /// ```
5887 pub fn set_effective_intelligence_config<T>(mut self, v: T) -> Self
5888 where
5889 T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
5890 {
5891 self.effective_intelligence_config = std::option::Option::Some(v.into());
5892 self
5893 }
5894
5895 /// Sets or clears the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
5896 ///
5897 /// # Example
5898 /// ```ignore,no_run
5899 /// # use google_cloud_storage::model::IntelligenceConfig;
5900 /// use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
5901 /// let x = IntelligenceConfig::new().set_or_clear_effective_intelligence_config(Some(EffectiveIntelligenceConfig::default()/* use setters */));
5902 /// let x = IntelligenceConfig::new().set_or_clear_effective_intelligence_config(None::<EffectiveIntelligenceConfig>);
5903 /// ```
5904 pub fn set_or_clear_effective_intelligence_config<T>(
5905 mut self,
5906 v: std::option::Option<T>,
5907 ) -> Self
5908 where
5909 T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
5910 {
5911 self.effective_intelligence_config = v.map(|x| x.into());
5912 self
5913 }
5914
5915 /// Sets the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
5916 ///
5917 /// # Example
5918 /// ```ignore,no_run
5919 /// # use google_cloud_storage::model::IntelligenceConfig;
5920 /// use google_cloud_storage::model::intelligence_config::TrialConfig;
5921 /// let x = IntelligenceConfig::new().set_trial_config(TrialConfig::default()/* use setters */);
5922 /// ```
5923 pub fn set_trial_config<T>(mut self, v: T) -> Self
5924 where
5925 T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
5926 {
5927 self.trial_config = std::option::Option::Some(v.into());
5928 self
5929 }
5930
5931 /// Sets or clears the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
5932 ///
5933 /// # Example
5934 /// ```ignore,no_run
5935 /// # use google_cloud_storage::model::IntelligenceConfig;
5936 /// use google_cloud_storage::model::intelligence_config::TrialConfig;
5937 /// let x = IntelligenceConfig::new().set_or_clear_trial_config(Some(TrialConfig::default()/* use setters */));
5938 /// let x = IntelligenceConfig::new().set_or_clear_trial_config(None::<TrialConfig>);
5939 /// ```
5940 pub fn set_or_clear_trial_config<T>(mut self, v: std::option::Option<T>) -> Self
5941 where
5942 T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
5943 {
5944 self.trial_config = v.map(|x| x.into());
5945 self
5946 }
5947}
5948
5949impl wkt::message::Message for IntelligenceConfig {
5950 fn typename() -> &'static str {
5951 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig"
5952 }
5953}
5954
5955/// Defines additional types related to [IntelligenceConfig].
5956pub mod intelligence_config {
5957 #[allow(unused_imports)]
5958 use super::*;
5959
5960 /// Filter over location and bucket using include or exclude semantics.
5961 /// Resources that match the include or exclude filter are exclusively included
5962 /// or excluded from the Storage Intelligence plan.
5963 #[derive(Clone, Default, PartialEq)]
5964 #[non_exhaustive]
5965 pub struct Filter {
5966 /// Bucket locations to include or exclude.
5967 pub cloud_storage_locations: std::option::Option<
5968 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
5969 >,
5970
5971 /// Buckets to include or exclude.
5972 pub cloud_storage_buckets: std::option::Option<
5973 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
5974 >,
5975
5976 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5977 }
5978
5979 impl Filter {
5980 /// Creates a new default instance.
5981 pub fn new() -> Self {
5982 std::default::Default::default()
5983 }
5984
5985 /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations].
5986 ///
5987 /// Note that all the setters affecting `cloud_storage_locations` are mutually
5988 /// exclusive.
5989 ///
5990 /// # Example
5991 /// ```ignore,no_run
5992 /// # use google_cloud_storage::model::intelligence_config::Filter;
5993 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
5994 /// let x = Filter::new().set_cloud_storage_locations(Some(
5995 /// google_cloud_storage::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(CloudStorageLocations::default().into())));
5996 /// ```
5997 pub fn set_cloud_storage_locations<
5998 T: std::convert::Into<
5999 std::option::Option<
6000 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
6001 >,
6002 >,
6003 >(
6004 mut self,
6005 v: T,
6006 ) -> Self {
6007 self.cloud_storage_locations = v.into();
6008 self
6009 }
6010
6011 /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
6012 /// if it holds a `IncludedCloudStorageLocations`, `None` if the field is not set or
6013 /// holds a different branch.
6014 pub fn included_cloud_storage_locations(
6015 &self,
6016 ) -> std::option::Option<
6017 &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
6018 > {
6019 #[allow(unreachable_patterns)]
6020 self.cloud_storage_locations.as_ref().and_then(|v| match v {
6021 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(v) => std::option::Option::Some(v),
6022 _ => std::option::Option::None,
6023 })
6024 }
6025
6026 /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
6027 /// to hold a `IncludedCloudStorageLocations`.
6028 ///
6029 /// Note that all the setters affecting `cloud_storage_locations` are
6030 /// mutually exclusive.
6031 ///
6032 /// # Example
6033 /// ```ignore,no_run
6034 /// # use google_cloud_storage::model::intelligence_config::Filter;
6035 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
6036 /// let x = Filter::new().set_included_cloud_storage_locations(CloudStorageLocations::default()/* use setters */);
6037 /// assert!(x.included_cloud_storage_locations().is_some());
6038 /// assert!(x.excluded_cloud_storage_locations().is_none());
6039 /// ```
6040 pub fn set_included_cloud_storage_locations<
6041 T: std::convert::Into<
6042 std::boxed::Box<
6043 crate::model::intelligence_config::filter::CloudStorageLocations,
6044 >,
6045 >,
6046 >(
6047 mut self,
6048 v: T,
6049 ) -> Self {
6050 self.cloud_storage_locations = std::option::Option::Some(
6051 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
6052 v.into()
6053 )
6054 );
6055 self
6056 }
6057
6058 /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
6059 /// if it holds a `ExcludedCloudStorageLocations`, `None` if the field is not set or
6060 /// holds a different branch.
6061 pub fn excluded_cloud_storage_locations(
6062 &self,
6063 ) -> std::option::Option<
6064 &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
6065 > {
6066 #[allow(unreachable_patterns)]
6067 self.cloud_storage_locations.as_ref().and_then(|v| match v {
6068 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(v) => std::option::Option::Some(v),
6069 _ => std::option::Option::None,
6070 })
6071 }
6072
6073 /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
6074 /// to hold a `ExcludedCloudStorageLocations`.
6075 ///
6076 /// Note that all the setters affecting `cloud_storage_locations` are
6077 /// mutually exclusive.
6078 ///
6079 /// # Example
6080 /// ```ignore,no_run
6081 /// # use google_cloud_storage::model::intelligence_config::Filter;
6082 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
6083 /// let x = Filter::new().set_excluded_cloud_storage_locations(CloudStorageLocations::default()/* use setters */);
6084 /// assert!(x.excluded_cloud_storage_locations().is_some());
6085 /// assert!(x.included_cloud_storage_locations().is_none());
6086 /// ```
6087 pub fn set_excluded_cloud_storage_locations<
6088 T: std::convert::Into<
6089 std::boxed::Box<
6090 crate::model::intelligence_config::filter::CloudStorageLocations,
6091 >,
6092 >,
6093 >(
6094 mut self,
6095 v: T,
6096 ) -> Self {
6097 self.cloud_storage_locations = std::option::Option::Some(
6098 crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
6099 v.into()
6100 )
6101 );
6102 self
6103 }
6104
6105 /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets].
6106 ///
6107 /// Note that all the setters affecting `cloud_storage_buckets` are mutually
6108 /// exclusive.
6109 ///
6110 /// # Example
6111 /// ```ignore,no_run
6112 /// # use google_cloud_storage::model::intelligence_config::Filter;
6113 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
6114 /// let x = Filter::new().set_cloud_storage_buckets(Some(
6115 /// google_cloud_storage::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(CloudStorageBuckets::default().into())));
6116 /// ```
6117 pub fn set_cloud_storage_buckets<
6118 T: std::convert::Into<
6119 std::option::Option<
6120 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
6121 >,
6122 >,
6123 >(
6124 mut self,
6125 v: T,
6126 ) -> Self {
6127 self.cloud_storage_buckets = v.into();
6128 self
6129 }
6130
6131 /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
6132 /// if it holds a `IncludedCloudStorageBuckets`, `None` if the field is not set or
6133 /// holds a different branch.
6134 pub fn included_cloud_storage_buckets(
6135 &self,
6136 ) -> std::option::Option<
6137 &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
6138 > {
6139 #[allow(unreachable_patterns)]
6140 self.cloud_storage_buckets.as_ref().and_then(|v| match v {
6141 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(v) => std::option::Option::Some(v),
6142 _ => std::option::Option::None,
6143 })
6144 }
6145
6146 /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
6147 /// to hold a `IncludedCloudStorageBuckets`.
6148 ///
6149 /// Note that all the setters affecting `cloud_storage_buckets` are
6150 /// mutually exclusive.
6151 ///
6152 /// # Example
6153 /// ```ignore,no_run
6154 /// # use google_cloud_storage::model::intelligence_config::Filter;
6155 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
6156 /// let x = Filter::new().set_included_cloud_storage_buckets(CloudStorageBuckets::default()/* use setters */);
6157 /// assert!(x.included_cloud_storage_buckets().is_some());
6158 /// assert!(x.excluded_cloud_storage_buckets().is_none());
6159 /// ```
6160 pub fn set_included_cloud_storage_buckets<
6161 T: std::convert::Into<
6162 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
6163 >,
6164 >(
6165 mut self,
6166 v: T,
6167 ) -> Self {
6168 self.cloud_storage_buckets = std::option::Option::Some(
6169 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
6170 v.into()
6171 )
6172 );
6173 self
6174 }
6175
6176 /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
6177 /// if it holds a `ExcludedCloudStorageBuckets`, `None` if the field is not set or
6178 /// holds a different branch.
6179 pub fn excluded_cloud_storage_buckets(
6180 &self,
6181 ) -> std::option::Option<
6182 &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
6183 > {
6184 #[allow(unreachable_patterns)]
6185 self.cloud_storage_buckets.as_ref().and_then(|v| match v {
6186 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(v) => std::option::Option::Some(v),
6187 _ => std::option::Option::None,
6188 })
6189 }
6190
6191 /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
6192 /// to hold a `ExcludedCloudStorageBuckets`.
6193 ///
6194 /// Note that all the setters affecting `cloud_storage_buckets` are
6195 /// mutually exclusive.
6196 ///
6197 /// # Example
6198 /// ```ignore,no_run
6199 /// # use google_cloud_storage::model::intelligence_config::Filter;
6200 /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
6201 /// let x = Filter::new().set_excluded_cloud_storage_buckets(CloudStorageBuckets::default()/* use setters */);
6202 /// assert!(x.excluded_cloud_storage_buckets().is_some());
6203 /// assert!(x.included_cloud_storage_buckets().is_none());
6204 /// ```
6205 pub fn set_excluded_cloud_storage_buckets<
6206 T: std::convert::Into<
6207 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
6208 >,
6209 >(
6210 mut self,
6211 v: T,
6212 ) -> Self {
6213 self.cloud_storage_buckets = std::option::Option::Some(
6214 crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
6215 v.into()
6216 )
6217 );
6218 self
6219 }
6220 }
6221
6222 impl wkt::message::Message for Filter {
6223 fn typename() -> &'static str {
6224 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter"
6225 }
6226 }
6227
6228 /// Defines additional types related to [Filter].
6229 pub mod filter {
6230 #[allow(unused_imports)]
6231 use super::*;
6232
6233 /// Collection of bucket locations.
6234 #[derive(Clone, Default, PartialEq)]
6235 #[non_exhaustive]
6236 pub struct CloudStorageLocations {
6237 /// Optional. Bucket locations. Location can be any of the Cloud Storage
6238 /// regions specified in lower case format. For example, `us-east1`,
6239 /// `us-west1`.
6240 pub locations: std::vec::Vec<std::string::String>,
6241
6242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6243 }
6244
6245 impl CloudStorageLocations {
6246 /// Creates a new default instance.
6247 pub fn new() -> Self {
6248 std::default::Default::default()
6249 }
6250
6251 /// Sets the value of [locations][crate::model::intelligence_config::filter::CloudStorageLocations::locations].
6252 ///
6253 /// # Example
6254 /// ```ignore,no_run
6255 /// # use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
6256 /// let x = CloudStorageLocations::new().set_locations(["a", "b", "c"]);
6257 /// ```
6258 pub fn set_locations<T, V>(mut self, v: T) -> Self
6259 where
6260 T: std::iter::IntoIterator<Item = V>,
6261 V: std::convert::Into<std::string::String>,
6262 {
6263 use std::iter::Iterator;
6264 self.locations = v.into_iter().map(|i| i.into()).collect();
6265 self
6266 }
6267 }
6268
6269 impl wkt::message::Message for CloudStorageLocations {
6270 fn typename() -> &'static str {
6271 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"
6272 }
6273 }
6274
6275 /// Collection of buckets.
6276 #[derive(Clone, Default, PartialEq)]
6277 #[non_exhaustive]
6278 pub struct CloudStorageBuckets {
6279 /// Optional. A regex pattern for matching bucket names. Regex should
6280 /// follow the syntax specified in
6281 /// [google/re2](https://github.com/google/re2). For example,
6282 /// `^sample_.*` matches all buckets of the form
6283 /// `gs://sample_bucket-1`, `gs://sample_bucket-2`,
6284 /// `gs://sample_bucket-n` but not `gs://test_sample_bucket`.
6285 /// If you want to match a single bucket, say `gs://sample_bucket`,
6286 /// use `sample_bucket`.
6287 pub bucket_id_regexes: std::vec::Vec<std::string::String>,
6288
6289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6290 }
6291
6292 impl CloudStorageBuckets {
6293 /// Creates a new default instance.
6294 pub fn new() -> Self {
6295 std::default::Default::default()
6296 }
6297
6298 /// Sets the value of [bucket_id_regexes][crate::model::intelligence_config::filter::CloudStorageBuckets::bucket_id_regexes].
6299 ///
6300 /// # Example
6301 /// ```ignore,no_run
6302 /// # use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
6303 /// let x = CloudStorageBuckets::new().set_bucket_id_regexes(["a", "b", "c"]);
6304 /// ```
6305 pub fn set_bucket_id_regexes<T, V>(mut self, v: T) -> Self
6306 where
6307 T: std::iter::IntoIterator<Item = V>,
6308 V: std::convert::Into<std::string::String>,
6309 {
6310 use std::iter::Iterator;
6311 self.bucket_id_regexes = v.into_iter().map(|i| i.into()).collect();
6312 self
6313 }
6314 }
6315
6316 impl wkt::message::Message for CloudStorageBuckets {
6317 fn typename() -> &'static str {
6318 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"
6319 }
6320 }
6321
6322 /// Bucket locations to include or exclude.
6323 #[derive(Clone, Debug, PartialEq)]
6324 #[non_exhaustive]
6325 pub enum CloudStorageLocationsOneOf {
6326 /// Bucket locations to include.
6327 IncludedCloudStorageLocations(
6328 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
6329 ),
6330 /// Bucket locations to exclude.
6331 ExcludedCloudStorageLocations(
6332 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
6333 ),
6334 }
6335
6336 impl CloudStorageLocationsOneOf {
6337 /// Initializes the enum to the [IncludedCloudStorageLocations](Self::IncludedCloudStorageLocations) branch.
6338 pub fn from_included_cloud_storage_locations(
6339 value: impl std::convert::Into<
6340 std::boxed::Box<
6341 crate::model::intelligence_config::filter::CloudStorageLocations,
6342 >,
6343 >,
6344 ) -> Self {
6345 Self::IncludedCloudStorageLocations(value.into())
6346 }
6347 /// Initializes the enum to the [ExcludedCloudStorageLocations](Self::ExcludedCloudStorageLocations) branch.
6348 pub fn from_excluded_cloud_storage_locations(
6349 value: impl std::convert::Into<
6350 std::boxed::Box<
6351 crate::model::intelligence_config::filter::CloudStorageLocations,
6352 >,
6353 >,
6354 ) -> Self {
6355 Self::ExcludedCloudStorageLocations(value.into())
6356 }
6357 }
6358
6359 /// Buckets to include or exclude.
6360 #[derive(Clone, Debug, PartialEq)]
6361 #[non_exhaustive]
6362 pub enum CloudStorageBucketsOneOf {
6363 /// Buckets to include.
6364 IncludedCloudStorageBuckets(
6365 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
6366 ),
6367 /// Buckets to exclude.
6368 ExcludedCloudStorageBuckets(
6369 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
6370 ),
6371 }
6372
6373 impl CloudStorageBucketsOneOf {
6374 /// Initializes the enum to the [IncludedCloudStorageBuckets](Self::IncludedCloudStorageBuckets) branch.
6375 pub fn from_included_cloud_storage_buckets(
6376 value: impl std::convert::Into<
6377 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
6378 >,
6379 ) -> Self {
6380 Self::IncludedCloudStorageBuckets(value.into())
6381 }
6382 /// Initializes the enum to the [ExcludedCloudStorageBuckets](Self::ExcludedCloudStorageBuckets) branch.
6383 pub fn from_excluded_cloud_storage_buckets(
6384 value: impl std::convert::Into<
6385 std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
6386 >,
6387 ) -> Self {
6388 Self::ExcludedCloudStorageBuckets(value.into())
6389 }
6390 }
6391 }
6392
6393 /// The effective `IntelligenceConfig` for the resource.
6394 #[derive(Clone, Default, PartialEq)]
6395 #[non_exhaustive]
6396 pub struct EffectiveIntelligenceConfig {
6397 /// Output only. The `IntelligenceConfig` edition that is applicable for the
6398 /// resource.
6399 pub effective_edition:
6400 crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition,
6401
6402 /// Output only. The `IntelligenceConfig` resource that is applied for the
6403 /// target resource. Format:
6404 /// `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig`
6405 pub intelligence_config: std::string::String,
6406
6407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6408 }
6409
6410 impl EffectiveIntelligenceConfig {
6411 /// Creates a new default instance.
6412 pub fn new() -> Self {
6413 std::default::Default::default()
6414 }
6415
6416 /// Sets the value of [effective_edition][crate::model::intelligence_config::EffectiveIntelligenceConfig::effective_edition].
6417 ///
6418 /// # Example
6419 /// ```ignore,no_run
6420 /// # use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
6421 /// use google_cloud_storage::model::intelligence_config::effective_intelligence_config::EffectiveEdition;
6422 /// let x0 = EffectiveIntelligenceConfig::new().set_effective_edition(EffectiveEdition::None);
6423 /// let x1 = EffectiveIntelligenceConfig::new().set_effective_edition(EffectiveEdition::Standard);
6424 /// ```
6425 pub fn set_effective_edition<T: std::convert::Into<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>(mut self, v: T) -> Self{
6426 self.effective_edition = v.into();
6427 self
6428 }
6429
6430 /// Sets the value of [intelligence_config][crate::model::intelligence_config::EffectiveIntelligenceConfig::intelligence_config].
6431 ///
6432 /// # Example
6433 /// ```ignore,no_run
6434 /// # use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
6435 /// let x = EffectiveIntelligenceConfig::new().set_intelligence_config("example");
6436 /// ```
6437 pub fn set_intelligence_config<T: std::convert::Into<std::string::String>>(
6438 mut self,
6439 v: T,
6440 ) -> Self {
6441 self.intelligence_config = v.into();
6442 self
6443 }
6444 }
6445
6446 impl wkt::message::Message for EffectiveIntelligenceConfig {
6447 fn typename() -> &'static str {
6448 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"
6449 }
6450 }
6451
6452 /// Defines additional types related to [EffectiveIntelligenceConfig].
6453 pub mod effective_intelligence_config {
6454 #[allow(unused_imports)]
6455 use super::*;
6456
6457 /// The effective edition of the `IntelligenceConfig` resource.
6458 ///
6459 /// # Working with unknown values
6460 ///
6461 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6462 /// additional enum variants at any time. Adding new variants is not considered
6463 /// a breaking change. Applications should write their code in anticipation of:
6464 ///
6465 /// - New values appearing in future releases of the client library, **and**
6466 /// - New values received dynamically, without application changes.
6467 ///
6468 /// Please consult the [Working with enums] section in the user guide for some
6469 /// guidelines.
6470 ///
6471 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6472 #[derive(Clone, Debug, PartialEq)]
6473 #[non_exhaustive]
6474 pub enum EffectiveEdition {
6475 /// This is an unknown edition of the resource.
6476 Unspecified,
6477 /// No edition.
6478 None,
6479 /// The `IntelligenceConfig` resource is of STANDARD edition.
6480 Standard,
6481 /// If set, the enum was initialized with an unknown value.
6482 ///
6483 /// Applications can examine the value using [EffectiveEdition::value] or
6484 /// [EffectiveEdition::name].
6485 UnknownValue(effective_edition::UnknownValue),
6486 }
6487
6488 #[doc(hidden)]
6489 pub mod effective_edition {
6490 #[allow(unused_imports)]
6491 use super::*;
6492 #[derive(Clone, Debug, PartialEq)]
6493 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6494 }
6495
6496 impl EffectiveEdition {
6497 /// Gets the enum value.
6498 ///
6499 /// Returns `None` if the enum contains an unknown value deserialized from
6500 /// the string representation of enums.
6501 pub fn value(&self) -> std::option::Option<i32> {
6502 match self {
6503 Self::Unspecified => std::option::Option::Some(0),
6504 Self::None => std::option::Option::Some(1),
6505 Self::Standard => std::option::Option::Some(2),
6506 Self::UnknownValue(u) => u.0.value(),
6507 }
6508 }
6509
6510 /// Gets the enum value as a string.
6511 ///
6512 /// Returns `None` if the enum contains an unknown value deserialized from
6513 /// the integer representation of enums.
6514 pub fn name(&self) -> std::option::Option<&str> {
6515 match self {
6516 Self::Unspecified => std::option::Option::Some("EFFECTIVE_EDITION_UNSPECIFIED"),
6517 Self::None => std::option::Option::Some("NONE"),
6518 Self::Standard => std::option::Option::Some("STANDARD"),
6519 Self::UnknownValue(u) => u.0.name(),
6520 }
6521 }
6522 }
6523
6524 impl std::default::Default for EffectiveEdition {
6525 fn default() -> Self {
6526 use std::convert::From;
6527 Self::from(0)
6528 }
6529 }
6530
6531 impl std::fmt::Display for EffectiveEdition {
6532 fn fmt(
6533 &self,
6534 f: &mut std::fmt::Formatter<'_>,
6535 ) -> std::result::Result<(), std::fmt::Error> {
6536 wkt::internal::display_enum(f, self.name(), self.value())
6537 }
6538 }
6539
6540 impl std::convert::From<i32> for EffectiveEdition {
6541 fn from(value: i32) -> Self {
6542 match value {
6543 0 => Self::Unspecified,
6544 1 => Self::None,
6545 2 => Self::Standard,
6546 _ => Self::UnknownValue(effective_edition::UnknownValue(
6547 wkt::internal::UnknownEnumValue::Integer(value),
6548 )),
6549 }
6550 }
6551 }
6552
6553 impl std::convert::From<&str> for EffectiveEdition {
6554 fn from(value: &str) -> Self {
6555 use std::string::ToString;
6556 match value {
6557 "EFFECTIVE_EDITION_UNSPECIFIED" => Self::Unspecified,
6558 "NONE" => Self::None,
6559 "STANDARD" => Self::Standard,
6560 _ => Self::UnknownValue(effective_edition::UnknownValue(
6561 wkt::internal::UnknownEnumValue::String(value.to_string()),
6562 )),
6563 }
6564 }
6565 }
6566
6567 impl serde::ser::Serialize for EffectiveEdition {
6568 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6569 where
6570 S: serde::Serializer,
6571 {
6572 match self {
6573 Self::Unspecified => serializer.serialize_i32(0),
6574 Self::None => serializer.serialize_i32(1),
6575 Self::Standard => serializer.serialize_i32(2),
6576 Self::UnknownValue(u) => u.0.serialize(serializer),
6577 }
6578 }
6579 }
6580
6581 impl<'de> serde::de::Deserialize<'de> for EffectiveEdition {
6582 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6583 where
6584 D: serde::Deserializer<'de>,
6585 {
6586 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveEdition>::new(
6587 ".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition"))
6588 }
6589 }
6590 }
6591
6592 /// The trial configuration of the `IntelligenceConfig` resource.
6593 #[derive(Clone, Default, PartialEq)]
6594 #[non_exhaustive]
6595 pub struct TrialConfig {
6596 /// Output only. The time at which the trial expires.
6597 pub expire_time: std::option::Option<wkt::Timestamp>,
6598
6599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6600 }
6601
6602 impl TrialConfig {
6603 /// Creates a new default instance.
6604 pub fn new() -> Self {
6605 std::default::Default::default()
6606 }
6607
6608 /// Sets the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
6609 ///
6610 /// # Example
6611 /// ```ignore,no_run
6612 /// # use google_cloud_storage::model::intelligence_config::TrialConfig;
6613 /// use wkt::Timestamp;
6614 /// let x = TrialConfig::new().set_expire_time(Timestamp::default()/* use setters */);
6615 /// ```
6616 pub fn set_expire_time<T>(mut self, v: T) -> Self
6617 where
6618 T: std::convert::Into<wkt::Timestamp>,
6619 {
6620 self.expire_time = std::option::Option::Some(v.into());
6621 self
6622 }
6623
6624 /// Sets or clears the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
6625 ///
6626 /// # Example
6627 /// ```ignore,no_run
6628 /// # use google_cloud_storage::model::intelligence_config::TrialConfig;
6629 /// use wkt::Timestamp;
6630 /// let x = TrialConfig::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
6631 /// let x = TrialConfig::new().set_or_clear_expire_time(None::<Timestamp>);
6632 /// ```
6633 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
6634 where
6635 T: std::convert::Into<wkt::Timestamp>,
6636 {
6637 self.expire_time = v.map(|x| x.into());
6638 self
6639 }
6640 }
6641
6642 impl wkt::message::Message for TrialConfig {
6643 fn typename() -> &'static str {
6644 "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.TrialConfig"
6645 }
6646 }
6647
6648 /// The edition configuration of the `IntelligenceConfig` resource. This
6649 /// signifies the edition used for configuring the `IntelligenceConfig`
6650 /// resource and can only take the following values:
6651 /// `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and
6652 /// `EVALUATE`.
6653 ///
6654 /// # Working with unknown values
6655 ///
6656 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6657 /// additional enum variants at any time. Adding new variants is not considered
6658 /// a breaking change. Applications should write their code in anticipation of:
6659 ///
6660 /// - New values appearing in future releases of the client library, **and**
6661 /// - New values received dynamically, without application changes.
6662 ///
6663 /// Please consult the [Working with enums] section in the user guide for some
6664 /// guidelines.
6665 ///
6666 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6667 #[derive(Clone, Debug, PartialEq)]
6668 #[non_exhaustive]
6669 pub enum EditionConfig {
6670 /// This is an unknown edition of the resource.
6671 Unspecified,
6672 /// The inherited edition from the parent and filters. This is the default
6673 /// edition when there is no `IntelligenceConfig` setup for a GCP resource.
6674 Inherit,
6675 /// The edition configuration is disabled for the `IntelligenceConfig`
6676 /// resource and its children. Filters are not applicable.
6677 Disabled,
6678 /// The `IntelligenceConfig` resource is of STANDARD edition.
6679 Standard,
6680 /// The `IntelligenceConfig` resource is available in `TRIAL` edition. During
6681 /// the trial period, Cloud Storage does not charge for Storage Intelligence
6682 /// usage. You can specify the buckets to include in the trial period by
6683 /// using filters. At the end of the trial period, the `IntelligenceConfig`
6684 /// resource is upgraded to `STANDARD` edition.
6685 Trial,
6686 /// The `IntelligenceConfig` resource is of ESSENTIALS edition.
6687 Essentials,
6688 /// If set, the enum was initialized with an unknown value.
6689 ///
6690 /// Applications can examine the value using [EditionConfig::value] or
6691 /// [EditionConfig::name].
6692 UnknownValue(edition_config::UnknownValue),
6693 }
6694
6695 #[doc(hidden)]
6696 pub mod edition_config {
6697 #[allow(unused_imports)]
6698 use super::*;
6699 #[derive(Clone, Debug, PartialEq)]
6700 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6701 }
6702
6703 impl EditionConfig {
6704 /// Gets the enum value.
6705 ///
6706 /// Returns `None` if the enum contains an unknown value deserialized from
6707 /// the string representation of enums.
6708 pub fn value(&self) -> std::option::Option<i32> {
6709 match self {
6710 Self::Unspecified => std::option::Option::Some(0),
6711 Self::Inherit => std::option::Option::Some(1),
6712 Self::Disabled => std::option::Option::Some(2),
6713 Self::Standard => std::option::Option::Some(3),
6714 Self::Trial => std::option::Option::Some(5),
6715 Self::Essentials => std::option::Option::Some(6),
6716 Self::UnknownValue(u) => u.0.value(),
6717 }
6718 }
6719
6720 /// Gets the enum value as a string.
6721 ///
6722 /// Returns `None` if the enum contains an unknown value deserialized from
6723 /// the integer representation of enums.
6724 pub fn name(&self) -> std::option::Option<&str> {
6725 match self {
6726 Self::Unspecified => std::option::Option::Some("EDITION_CONFIG_UNSPECIFIED"),
6727 Self::Inherit => std::option::Option::Some("INHERIT"),
6728 Self::Disabled => std::option::Option::Some("DISABLED"),
6729 Self::Standard => std::option::Option::Some("STANDARD"),
6730 Self::Trial => std::option::Option::Some("TRIAL"),
6731 Self::Essentials => std::option::Option::Some("ESSENTIALS"),
6732 Self::UnknownValue(u) => u.0.name(),
6733 }
6734 }
6735 }
6736
6737 impl std::default::Default for EditionConfig {
6738 fn default() -> Self {
6739 use std::convert::From;
6740 Self::from(0)
6741 }
6742 }
6743
6744 impl std::fmt::Display for EditionConfig {
6745 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6746 wkt::internal::display_enum(f, self.name(), self.value())
6747 }
6748 }
6749
6750 impl std::convert::From<i32> for EditionConfig {
6751 fn from(value: i32) -> Self {
6752 match value {
6753 0 => Self::Unspecified,
6754 1 => Self::Inherit,
6755 2 => Self::Disabled,
6756 3 => Self::Standard,
6757 5 => Self::Trial,
6758 6 => Self::Essentials,
6759 _ => Self::UnknownValue(edition_config::UnknownValue(
6760 wkt::internal::UnknownEnumValue::Integer(value),
6761 )),
6762 }
6763 }
6764 }
6765
6766 impl std::convert::From<&str> for EditionConfig {
6767 fn from(value: &str) -> Self {
6768 use std::string::ToString;
6769 match value {
6770 "EDITION_CONFIG_UNSPECIFIED" => Self::Unspecified,
6771 "INHERIT" => Self::Inherit,
6772 "DISABLED" => Self::Disabled,
6773 "STANDARD" => Self::Standard,
6774 "TRIAL" => Self::Trial,
6775 "ESSENTIALS" => Self::Essentials,
6776 _ => Self::UnknownValue(edition_config::UnknownValue(
6777 wkt::internal::UnknownEnumValue::String(value.to_string()),
6778 )),
6779 }
6780 }
6781 }
6782
6783 impl serde::ser::Serialize for EditionConfig {
6784 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6785 where
6786 S: serde::Serializer,
6787 {
6788 match self {
6789 Self::Unspecified => serializer.serialize_i32(0),
6790 Self::Inherit => serializer.serialize_i32(1),
6791 Self::Disabled => serializer.serialize_i32(2),
6792 Self::Standard => serializer.serialize_i32(3),
6793 Self::Trial => serializer.serialize_i32(5),
6794 Self::Essentials => serializer.serialize_i32(6),
6795 Self::UnknownValue(u) => u.0.serialize(serializer),
6796 }
6797 }
6798 }
6799
6800 impl<'de> serde::de::Deserialize<'de> for EditionConfig {
6801 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6802 where
6803 D: serde::Deserializer<'de>,
6804 {
6805 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EditionConfig>::new(
6806 ".google.storage.control.v2.IntelligenceConfig.EditionConfig",
6807 ))
6808 }
6809 }
6810}
6811
6812/// Request message to update the `IntelligenceConfig` resource associated with
6813/// your organization.
6814#[derive(Clone, Default, PartialEq)]
6815#[non_exhaustive]
6816pub struct UpdateOrganizationIntelligenceConfigRequest {
6817 /// Required. The `IntelligenceConfig` resource to be updated.
6818 pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
6819
6820 /// Required. The `update_mask` that specifies the fields within the
6821 /// `IntelligenceConfig` resource that should be modified by this update. Only
6822 /// the listed fields are updated.
6823 pub update_mask: std::option::Option<wkt::FieldMask>,
6824
6825 /// Optional. The ID that uniquely identifies the request, preventing duplicate
6826 /// processing.
6827 pub request_id: std::string::String,
6828
6829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6830}
6831
6832impl UpdateOrganizationIntelligenceConfigRequest {
6833 /// Creates a new default instance.
6834 pub fn new() -> Self {
6835 std::default::Default::default()
6836 }
6837
6838 /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
6839 ///
6840 /// # Example
6841 /// ```ignore,no_run
6842 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
6843 /// use google_cloud_storage::model::IntelligenceConfig;
6844 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
6845 /// ```
6846 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
6847 where
6848 T: std::convert::Into<crate::model::IntelligenceConfig>,
6849 {
6850 self.intelligence_config = std::option::Option::Some(v.into());
6851 self
6852 }
6853
6854 /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
6855 ///
6856 /// # Example
6857 /// ```ignore,no_run
6858 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
6859 /// use google_cloud_storage::model::IntelligenceConfig;
6860 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
6861 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
6862 /// ```
6863 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
6864 where
6865 T: std::convert::Into<crate::model::IntelligenceConfig>,
6866 {
6867 self.intelligence_config = v.map(|x| x.into());
6868 self
6869 }
6870
6871 /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
6872 ///
6873 /// # Example
6874 /// ```ignore,no_run
6875 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
6876 /// use wkt::FieldMask;
6877 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6878 /// ```
6879 pub fn set_update_mask<T>(mut self, v: T) -> Self
6880 where
6881 T: std::convert::Into<wkt::FieldMask>,
6882 {
6883 self.update_mask = std::option::Option::Some(v.into());
6884 self
6885 }
6886
6887 /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
6888 ///
6889 /// # Example
6890 /// ```ignore,no_run
6891 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
6892 /// use wkt::FieldMask;
6893 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6894 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6895 /// ```
6896 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6897 where
6898 T: std::convert::Into<wkt::FieldMask>,
6899 {
6900 self.update_mask = v.map(|x| x.into());
6901 self
6902 }
6903
6904 /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
6905 ///
6906 /// # Example
6907 /// ```ignore,no_run
6908 /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
6909 /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_request_id("example");
6910 /// ```
6911 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6912 self.request_id = v.into();
6913 self
6914 }
6915}
6916
6917impl wkt::message::Message for UpdateOrganizationIntelligenceConfigRequest {
6918 fn typename() -> &'static str {
6919 "type.googleapis.com/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"
6920 }
6921}
6922
6923/// Request message to update the `IntelligenceConfig` resource associated with
6924/// your folder.
6925#[derive(Clone, Default, PartialEq)]
6926#[non_exhaustive]
6927pub struct UpdateFolderIntelligenceConfigRequest {
6928 /// Required. The `IntelligenceConfig` resource to be updated.
6929 pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
6930
6931 /// Required. The `update_mask` that specifies the fields within the
6932 /// `IntelligenceConfig` resource that should be modified by this update. Only
6933 /// the listed fields are updated.
6934 pub update_mask: std::option::Option<wkt::FieldMask>,
6935
6936 /// Optional. The ID that uniquely identifies the request, preventing duplicate
6937 /// processing.
6938 pub request_id: std::string::String,
6939
6940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6941}
6942
6943impl UpdateFolderIntelligenceConfigRequest {
6944 /// Creates a new default instance.
6945 pub fn new() -> Self {
6946 std::default::Default::default()
6947 }
6948
6949 /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
6950 ///
6951 /// # Example
6952 /// ```ignore,no_run
6953 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
6954 /// use google_cloud_storage::model::IntelligenceConfig;
6955 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
6956 /// ```
6957 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
6958 where
6959 T: std::convert::Into<crate::model::IntelligenceConfig>,
6960 {
6961 self.intelligence_config = std::option::Option::Some(v.into());
6962 self
6963 }
6964
6965 /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
6966 ///
6967 /// # Example
6968 /// ```ignore,no_run
6969 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
6970 /// use google_cloud_storage::model::IntelligenceConfig;
6971 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
6972 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
6973 /// ```
6974 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
6975 where
6976 T: std::convert::Into<crate::model::IntelligenceConfig>,
6977 {
6978 self.intelligence_config = v.map(|x| x.into());
6979 self
6980 }
6981
6982 /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
6983 ///
6984 /// # Example
6985 /// ```ignore,no_run
6986 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
6987 /// use wkt::FieldMask;
6988 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6989 /// ```
6990 pub fn set_update_mask<T>(mut self, v: T) -> Self
6991 where
6992 T: std::convert::Into<wkt::FieldMask>,
6993 {
6994 self.update_mask = std::option::Option::Some(v.into());
6995 self
6996 }
6997
6998 /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
6999 ///
7000 /// # Example
7001 /// ```ignore,no_run
7002 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
7003 /// use wkt::FieldMask;
7004 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7005 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7006 /// ```
7007 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7008 where
7009 T: std::convert::Into<wkt::FieldMask>,
7010 {
7011 self.update_mask = v.map(|x| x.into());
7012 self
7013 }
7014
7015 /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
7016 ///
7017 /// # Example
7018 /// ```ignore,no_run
7019 /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
7020 /// let x = UpdateFolderIntelligenceConfigRequest::new().set_request_id("example");
7021 /// ```
7022 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7023 self.request_id = v.into();
7024 self
7025 }
7026}
7027
7028impl wkt::message::Message for UpdateFolderIntelligenceConfigRequest {
7029 fn typename() -> &'static str {
7030 "type.googleapis.com/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"
7031 }
7032}
7033
7034/// Request message to update the `IntelligenceConfig` resource associated with
7035/// your project.
7036#[derive(Clone, Default, PartialEq)]
7037#[non_exhaustive]
7038pub struct UpdateProjectIntelligenceConfigRequest {
7039 /// Required. The `IntelligenceConfig` resource to be updated.
7040 pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
7041
7042 /// Required. The `update_mask` that specifies the fields within the
7043 /// `IntelligenceConfig` resource that should be modified by this update. Only
7044 /// the listed fields are updated.
7045 pub update_mask: std::option::Option<wkt::FieldMask>,
7046
7047 /// Optional. The ID that uniquely identifies the request, preventing duplicate
7048 /// processing.
7049 pub request_id: std::string::String,
7050
7051 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7052}
7053
7054impl UpdateProjectIntelligenceConfigRequest {
7055 /// Creates a new default instance.
7056 pub fn new() -> Self {
7057 std::default::Default::default()
7058 }
7059
7060 /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
7061 ///
7062 /// # Example
7063 /// ```ignore,no_run
7064 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
7065 /// use google_cloud_storage::model::IntelligenceConfig;
7066 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
7067 /// ```
7068 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
7069 where
7070 T: std::convert::Into<crate::model::IntelligenceConfig>,
7071 {
7072 self.intelligence_config = std::option::Option::Some(v.into());
7073 self
7074 }
7075
7076 /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
7077 ///
7078 /// # Example
7079 /// ```ignore,no_run
7080 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
7081 /// use google_cloud_storage::model::IntelligenceConfig;
7082 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
7083 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
7084 /// ```
7085 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
7086 where
7087 T: std::convert::Into<crate::model::IntelligenceConfig>,
7088 {
7089 self.intelligence_config = v.map(|x| x.into());
7090 self
7091 }
7092
7093 /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
7094 ///
7095 /// # Example
7096 /// ```ignore,no_run
7097 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
7098 /// use wkt::FieldMask;
7099 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7100 /// ```
7101 pub fn set_update_mask<T>(mut self, v: T) -> Self
7102 where
7103 T: std::convert::Into<wkt::FieldMask>,
7104 {
7105 self.update_mask = std::option::Option::Some(v.into());
7106 self
7107 }
7108
7109 /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
7110 ///
7111 /// # Example
7112 /// ```ignore,no_run
7113 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
7114 /// use wkt::FieldMask;
7115 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7116 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7117 /// ```
7118 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7119 where
7120 T: std::convert::Into<wkt::FieldMask>,
7121 {
7122 self.update_mask = v.map(|x| x.into());
7123 self
7124 }
7125
7126 /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
7127 ///
7128 /// # Example
7129 /// ```ignore,no_run
7130 /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
7131 /// let x = UpdateProjectIntelligenceConfigRequest::new().set_request_id("example");
7132 /// ```
7133 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7134 self.request_id = v.into();
7135 self
7136 }
7137}
7138
7139impl wkt::message::Message for UpdateProjectIntelligenceConfigRequest {
7140 fn typename() -> &'static str {
7141 "type.googleapis.com/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"
7142 }
7143}
7144
7145/// Request message to get the `IntelligenceConfig` resource associated with your
7146/// organization.
7147#[derive(Clone, Default, PartialEq)]
7148#[non_exhaustive]
7149pub struct GetOrganizationIntelligenceConfigRequest {
7150 /// Required. The name of the `IntelligenceConfig` resource associated with
7151 /// your organization.
7152 ///
7153 /// Format: `organizations/{org_id}/locations/global/intelligenceConfig`
7154 pub name: std::string::String,
7155
7156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7157}
7158
7159impl GetOrganizationIntelligenceConfigRequest {
7160 /// Creates a new default instance.
7161 pub fn new() -> Self {
7162 std::default::Default::default()
7163 }
7164
7165 /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
7166 ///
7167 /// # Example
7168 /// ```ignore,no_run
7169 /// # use google_cloud_storage::model::GetOrganizationIntelligenceConfigRequest;
7170 /// # let folder_id = "folder_id";
7171 /// # let location_id = "location_id";
7172 /// let x = GetOrganizationIntelligenceConfigRequest::new().set_name(format!("folders/{folder_id}/locations/{location_id}/intelligenceConfig"));
7173 /// ```
7174 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7175 self.name = v.into();
7176 self
7177 }
7178}
7179
7180impl wkt::message::Message for GetOrganizationIntelligenceConfigRequest {
7181 fn typename() -> &'static str {
7182 "type.googleapis.com/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"
7183 }
7184}
7185
7186/// Request message to get the `IntelligenceConfig` resource associated with your
7187/// folder.
7188#[derive(Clone, Default, PartialEq)]
7189#[non_exhaustive]
7190pub struct GetFolderIntelligenceConfigRequest {
7191 /// Required. The name of the `IntelligenceConfig` resource associated with
7192 /// your folder.
7193 ///
7194 /// Format: `folders/{id}/locations/global/intelligenceConfig`
7195 pub name: std::string::String,
7196
7197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7198}
7199
7200impl GetFolderIntelligenceConfigRequest {
7201 /// Creates a new default instance.
7202 pub fn new() -> Self {
7203 std::default::Default::default()
7204 }
7205
7206 /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
7207 ///
7208 /// # Example
7209 /// ```ignore,no_run
7210 /// # use google_cloud_storage::model::GetFolderIntelligenceConfigRequest;
7211 /// # let folder_id = "folder_id";
7212 /// # let location_id = "location_id";
7213 /// let x = GetFolderIntelligenceConfigRequest::new().set_name(format!("folders/{folder_id}/locations/{location_id}/intelligenceConfig"));
7214 /// ```
7215 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7216 self.name = v.into();
7217 self
7218 }
7219}
7220
7221impl wkt::message::Message for GetFolderIntelligenceConfigRequest {
7222 fn typename() -> &'static str {
7223 "type.googleapis.com/google.storage.control.v2.GetFolderIntelligenceConfigRequest"
7224 }
7225}
7226
7227/// Request message to get the `IntelligenceConfig` resource associated with your
7228/// project.
7229#[derive(Clone, Default, PartialEq)]
7230#[non_exhaustive]
7231pub struct GetProjectIntelligenceConfigRequest {
7232 /// Required. The name of the `IntelligenceConfig` resource associated with
7233 /// your project.
7234 ///
7235 /// Format: `projects/{id}/locations/global/intelligenceConfig`
7236 pub name: std::string::String,
7237
7238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7239}
7240
7241impl GetProjectIntelligenceConfigRequest {
7242 /// Creates a new default instance.
7243 pub fn new() -> Self {
7244 std::default::Default::default()
7245 }
7246
7247 /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
7248 ///
7249 /// # Example
7250 /// ```ignore,no_run
7251 /// # use google_cloud_storage::model::GetProjectIntelligenceConfigRequest;
7252 /// # let folder_id = "folder_id";
7253 /// # let location_id = "location_id";
7254 /// let x = GetProjectIntelligenceConfigRequest::new().set_name(format!("folders/{folder_id}/locations/{location_id}/intelligenceConfig"));
7255 /// ```
7256 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7257 self.name = v.into();
7258 self
7259 }
7260}
7261
7262impl wkt::message::Message for GetProjectIntelligenceConfigRequest {
7263 fn typename() -> &'static str {
7264 "type.googleapis.com/google.storage.control.v2.GetProjectIntelligenceConfigRequest"
7265 }
7266}
7267
7268/// The `IntelligenceFinding` resource that represents a security, performance,
7269/// or cost-related finding about a project or bucket.
7270#[derive(Clone, Default, PartialEq)]
7271#[non_exhaustive]
7272pub struct IntelligenceFinding {
7273 /// Identifier. The resource name of `IntelligenceFinding`.
7274 /// Format:
7275 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
7276 pub name: std::string::String,
7277
7278 /// Output only. A short description about the finding.
7279 pub description: std::string::String,
7280
7281 /// Output only. Type of this finding.
7282 pub r#type: crate::model::FindingType,
7283
7284 /// Output only. Category of this finding.
7285 pub category: crate::model::FindingCategory,
7286
7287 /// Output only. Severity of the finding.
7288 pub severity: crate::model::FindingSeverity,
7289
7290 /// Output only. The time at which the finding was created.
7291 pub create_time: std::option::Option<wkt::Timestamp>,
7292
7293 /// Output only. The time at which the finding was last updated.
7294 pub update_time: std::option::Option<wkt::Timestamp>,
7295
7296 /// Output only. The fully qualified resource name of the resource that this
7297 /// `IntelligenceFinding` applies to. eg:
7298 ///
7299 /// - `storage.googleapis.com/projects/_/buckets/b1`
7300 /// - `cloudresourecemanager.googleapis.com/projects/p1`
7301 pub target_resource: std::string::String,
7302
7303 /// Output only. Contains GCP resource names that are
7304 /// relevant to this `IntelligenceFinding`. The `target_resource` is also added
7305 /// as part of `associated_resources`. eg:
7306 ///
7307 /// - `storage.googleapis.com/projects/_/buckets/b1`
7308 /// - `cloudresourecemanager.googleapis.com/projects/p1`
7309 pub associated_resources: std::vec::Vec<std::string::String>,
7310
7311 /// Output only. The time interval during which the underlying data was used to
7312 /// generate this `IntelligenceFinding`.
7313 pub observation_period: std::option::Option<google_cloud_type::model::Interval>,
7314
7315 /// The specific details of the `IntelligenceFinding`.
7316 pub intelligence_finding_details:
7317 std::option::Option<crate::model::intelligence_finding::IntelligenceFindingDetails>,
7318
7319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7320}
7321
7322impl IntelligenceFinding {
7323 /// Creates a new default instance.
7324 pub fn new() -> Self {
7325 std::default::Default::default()
7326 }
7327
7328 /// Sets the value of [name][crate::model::IntelligenceFinding::name].
7329 ///
7330 /// # Example
7331 /// ```ignore,no_run
7332 /// # use google_cloud_storage::model::IntelligenceFinding;
7333 /// # let project_id = "project_id";
7334 /// # let location_id = "location_id";
7335 /// # let intelligence_finding_id = "intelligence_finding_id";
7336 /// let x = IntelligenceFinding::new().set_name(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}"));
7337 /// ```
7338 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7339 self.name = v.into();
7340 self
7341 }
7342
7343 /// Sets the value of [description][crate::model::IntelligenceFinding::description].
7344 ///
7345 /// # Example
7346 /// ```ignore,no_run
7347 /// # use google_cloud_storage::model::IntelligenceFinding;
7348 /// let x = IntelligenceFinding::new().set_description("example");
7349 /// ```
7350 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7351 self.description = v.into();
7352 self
7353 }
7354
7355 /// Sets the value of [r#type][crate::model::IntelligenceFinding::type].
7356 ///
7357 /// # Example
7358 /// ```ignore,no_run
7359 /// # use google_cloud_storage::model::IntelligenceFinding;
7360 /// use google_cloud_storage::model::FindingType;
7361 /// let x0 = IntelligenceFinding::new().set_type(FindingType::ColdlineAndArchivalStorageOperationsSpike);
7362 /// let x1 = IntelligenceFinding::new().set_type(FindingType::ThrottledRequestSpike);
7363 /// let x2 = IntelligenceFinding::new().set_type(FindingType::CrossRegionEgressSpike);
7364 /// ```
7365 pub fn set_type<T: std::convert::Into<crate::model::FindingType>>(mut self, v: T) -> Self {
7366 self.r#type = v.into();
7367 self
7368 }
7369
7370 /// Sets the value of [category][crate::model::IntelligenceFinding::category].
7371 ///
7372 /// # Example
7373 /// ```ignore,no_run
7374 /// # use google_cloud_storage::model::IntelligenceFinding;
7375 /// use google_cloud_storage::model::FindingCategory;
7376 /// let x0 = IntelligenceFinding::new().set_category(FindingCategory::DataManagement);
7377 /// let x1 = IntelligenceFinding::new().set_category(FindingCategory::Performance);
7378 /// ```
7379 pub fn set_category<T: std::convert::Into<crate::model::FindingCategory>>(
7380 mut self,
7381 v: T,
7382 ) -> Self {
7383 self.category = v.into();
7384 self
7385 }
7386
7387 /// Sets the value of [severity][crate::model::IntelligenceFinding::severity].
7388 ///
7389 /// # Example
7390 /// ```ignore,no_run
7391 /// # use google_cloud_storage::model::IntelligenceFinding;
7392 /// use google_cloud_storage::model::FindingSeverity;
7393 /// let x0 = IntelligenceFinding::new().set_severity(FindingSeverity::Critical);
7394 /// ```
7395 pub fn set_severity<T: std::convert::Into<crate::model::FindingSeverity>>(
7396 mut self,
7397 v: T,
7398 ) -> Self {
7399 self.severity = v.into();
7400 self
7401 }
7402
7403 /// Sets the value of [create_time][crate::model::IntelligenceFinding::create_time].
7404 ///
7405 /// # Example
7406 /// ```ignore,no_run
7407 /// # use google_cloud_storage::model::IntelligenceFinding;
7408 /// use wkt::Timestamp;
7409 /// let x = IntelligenceFinding::new().set_create_time(Timestamp::default()/* use setters */);
7410 /// ```
7411 pub fn set_create_time<T>(mut self, v: T) -> Self
7412 where
7413 T: std::convert::Into<wkt::Timestamp>,
7414 {
7415 self.create_time = std::option::Option::Some(v.into());
7416 self
7417 }
7418
7419 /// Sets or clears the value of [create_time][crate::model::IntelligenceFinding::create_time].
7420 ///
7421 /// # Example
7422 /// ```ignore,no_run
7423 /// # use google_cloud_storage::model::IntelligenceFinding;
7424 /// use wkt::Timestamp;
7425 /// let x = IntelligenceFinding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7426 /// let x = IntelligenceFinding::new().set_or_clear_create_time(None::<Timestamp>);
7427 /// ```
7428 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7429 where
7430 T: std::convert::Into<wkt::Timestamp>,
7431 {
7432 self.create_time = v.map(|x| x.into());
7433 self
7434 }
7435
7436 /// Sets the value of [update_time][crate::model::IntelligenceFinding::update_time].
7437 ///
7438 /// # Example
7439 /// ```ignore,no_run
7440 /// # use google_cloud_storage::model::IntelligenceFinding;
7441 /// use wkt::Timestamp;
7442 /// let x = IntelligenceFinding::new().set_update_time(Timestamp::default()/* use setters */);
7443 /// ```
7444 pub fn set_update_time<T>(mut self, v: T) -> Self
7445 where
7446 T: std::convert::Into<wkt::Timestamp>,
7447 {
7448 self.update_time = std::option::Option::Some(v.into());
7449 self
7450 }
7451
7452 /// Sets or clears the value of [update_time][crate::model::IntelligenceFinding::update_time].
7453 ///
7454 /// # Example
7455 /// ```ignore,no_run
7456 /// # use google_cloud_storage::model::IntelligenceFinding;
7457 /// use wkt::Timestamp;
7458 /// let x = IntelligenceFinding::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7459 /// let x = IntelligenceFinding::new().set_or_clear_update_time(None::<Timestamp>);
7460 /// ```
7461 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7462 where
7463 T: std::convert::Into<wkt::Timestamp>,
7464 {
7465 self.update_time = v.map(|x| x.into());
7466 self
7467 }
7468
7469 /// Sets the value of [target_resource][crate::model::IntelligenceFinding::target_resource].
7470 ///
7471 /// # Example
7472 /// ```ignore,no_run
7473 /// # use google_cloud_storage::model::IntelligenceFinding;
7474 /// let x = IntelligenceFinding::new().set_target_resource("example");
7475 /// ```
7476 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7477 self.target_resource = v.into();
7478 self
7479 }
7480
7481 /// Sets the value of [associated_resources][crate::model::IntelligenceFinding::associated_resources].
7482 ///
7483 /// # Example
7484 /// ```ignore,no_run
7485 /// # use google_cloud_storage::model::IntelligenceFinding;
7486 /// let x = IntelligenceFinding::new().set_associated_resources(["a", "b", "c"]);
7487 /// ```
7488 pub fn set_associated_resources<T, V>(mut self, v: T) -> Self
7489 where
7490 T: std::iter::IntoIterator<Item = V>,
7491 V: std::convert::Into<std::string::String>,
7492 {
7493 use std::iter::Iterator;
7494 self.associated_resources = v.into_iter().map(|i| i.into()).collect();
7495 self
7496 }
7497
7498 /// Sets the value of [observation_period][crate::model::IntelligenceFinding::observation_period].
7499 ///
7500 /// # Example
7501 /// ```ignore,no_run
7502 /// # use google_cloud_storage::model::IntelligenceFinding;
7503 /// use google_cloud_type::model::Interval;
7504 /// let x = IntelligenceFinding::new().set_observation_period(Interval::default()/* use setters */);
7505 /// ```
7506 pub fn set_observation_period<T>(mut self, v: T) -> Self
7507 where
7508 T: std::convert::Into<google_cloud_type::model::Interval>,
7509 {
7510 self.observation_period = std::option::Option::Some(v.into());
7511 self
7512 }
7513
7514 /// Sets or clears the value of [observation_period][crate::model::IntelligenceFinding::observation_period].
7515 ///
7516 /// # Example
7517 /// ```ignore,no_run
7518 /// # use google_cloud_storage::model::IntelligenceFinding;
7519 /// use google_cloud_type::model::Interval;
7520 /// let x = IntelligenceFinding::new().set_or_clear_observation_period(Some(Interval::default()/* use setters */));
7521 /// let x = IntelligenceFinding::new().set_or_clear_observation_period(None::<Interval>);
7522 /// ```
7523 pub fn set_or_clear_observation_period<T>(mut self, v: std::option::Option<T>) -> Self
7524 where
7525 T: std::convert::Into<google_cloud_type::model::Interval>,
7526 {
7527 self.observation_period = v.map(|x| x.into());
7528 self
7529 }
7530
7531 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details].
7532 ///
7533 /// Note that all the setters affecting `intelligence_finding_details` are mutually
7534 /// exclusive.
7535 ///
7536 /// # Example
7537 /// ```ignore,no_run
7538 /// # use google_cloud_storage::model::IntelligenceFinding;
7539 /// use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
7540 /// let x = IntelligenceFinding::new().set_intelligence_finding_details(Some(
7541 /// google_cloud_storage::model::intelligence_finding::IntelligenceFindingDetails::ColdlineAndArchivalStorageOperationsSpike(ColdlineAndArchivalStorageOperationsSpike::default().into())));
7542 /// ```
7543 pub fn set_intelligence_finding_details<
7544 T: std::convert::Into<
7545 std::option::Option<crate::model::intelligence_finding::IntelligenceFindingDetails>,
7546 >,
7547 >(
7548 mut self,
7549 v: T,
7550 ) -> Self {
7551 self.intelligence_finding_details = v.into();
7552 self
7553 }
7554
7555 /// The value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
7556 /// if it holds a `ColdlineAndArchivalStorageOperationsSpike`, `None` if the field is not set or
7557 /// holds a different branch.
7558 pub fn coldline_and_archival_storage_operations_spike(
7559 &self,
7560 ) -> std::option::Option<
7561 &std::boxed::Box<
7562 crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike,
7563 >,
7564 > {
7565 #[allow(unreachable_patterns)]
7566 self.intelligence_finding_details.as_ref().and_then(|v| match v {
7567 crate::model::intelligence_finding::IntelligenceFindingDetails::ColdlineAndArchivalStorageOperationsSpike(v) => std::option::Option::Some(v),
7568 _ => std::option::Option::None,
7569 })
7570 }
7571
7572 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
7573 /// to hold a `ColdlineAndArchivalStorageOperationsSpike`.
7574 ///
7575 /// Note that all the setters affecting `intelligence_finding_details` are
7576 /// mutually exclusive.
7577 ///
7578 /// # Example
7579 /// ```ignore,no_run
7580 /// # use google_cloud_storage::model::IntelligenceFinding;
7581 /// use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
7582 /// let x = IntelligenceFinding::new().set_coldline_and_archival_storage_operations_spike(ColdlineAndArchivalStorageOperationsSpike::default()/* use setters */);
7583 /// assert!(x.coldline_and_archival_storage_operations_spike().is_some());
7584 /// assert!(x.throttled_requests_spike().is_none());
7585 /// assert!(x.cross_region_egress_spike().is_none());
7586 /// assert!(x.storage_growth_above_trend().is_none());
7587 /// ```
7588 pub fn set_coldline_and_archival_storage_operations_spike<
7589 T: std::convert::Into<
7590 std::boxed::Box<
7591 crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike,
7592 >,
7593 >,
7594 >(
7595 mut self,
7596 v: T,
7597 ) -> Self {
7598 self.intelligence_finding_details = std::option::Option::Some(
7599 crate::model::intelligence_finding::IntelligenceFindingDetails::ColdlineAndArchivalStorageOperationsSpike(
7600 v.into()
7601 )
7602 );
7603 self
7604 }
7605
7606 /// The value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
7607 /// if it holds a `ThrottledRequestsSpike`, `None` if the field is not set or
7608 /// holds a different branch.
7609 pub fn throttled_requests_spike(
7610 &self,
7611 ) -> std::option::Option<
7612 &std::boxed::Box<crate::model::intelligence_finding::ThrottledRequestSpike>,
7613 > {
7614 #[allow(unreachable_patterns)]
7615 self.intelligence_finding_details.as_ref().and_then(|v| match v {
7616 crate::model::intelligence_finding::IntelligenceFindingDetails::ThrottledRequestsSpike(v) => std::option::Option::Some(v),
7617 _ => std::option::Option::None,
7618 })
7619 }
7620
7621 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
7622 /// to hold a `ThrottledRequestsSpike`.
7623 ///
7624 /// Note that all the setters affecting `intelligence_finding_details` are
7625 /// mutually exclusive.
7626 ///
7627 /// # Example
7628 /// ```ignore,no_run
7629 /// # use google_cloud_storage::model::IntelligenceFinding;
7630 /// use google_cloud_storage::model::intelligence_finding::ThrottledRequestSpike;
7631 /// let x = IntelligenceFinding::new().set_throttled_requests_spike(ThrottledRequestSpike::default()/* use setters */);
7632 /// assert!(x.throttled_requests_spike().is_some());
7633 /// assert!(x.coldline_and_archival_storage_operations_spike().is_none());
7634 /// assert!(x.cross_region_egress_spike().is_none());
7635 /// assert!(x.storage_growth_above_trend().is_none());
7636 /// ```
7637 pub fn set_throttled_requests_spike<
7638 T: std::convert::Into<
7639 std::boxed::Box<crate::model::intelligence_finding::ThrottledRequestSpike>,
7640 >,
7641 >(
7642 mut self,
7643 v: T,
7644 ) -> Self {
7645 self.intelligence_finding_details = std::option::Option::Some(
7646 crate::model::intelligence_finding::IntelligenceFindingDetails::ThrottledRequestsSpike(
7647 v.into(),
7648 ),
7649 );
7650 self
7651 }
7652
7653 /// The value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
7654 /// if it holds a `CrossRegionEgressSpike`, `None` if the field is not set or
7655 /// holds a different branch.
7656 pub fn cross_region_egress_spike(
7657 &self,
7658 ) -> std::option::Option<
7659 &std::boxed::Box<crate::model::intelligence_finding::CrossRegionEgressSpike>,
7660 > {
7661 #[allow(unreachable_patterns)]
7662 self.intelligence_finding_details.as_ref().and_then(|v| match v {
7663 crate::model::intelligence_finding::IntelligenceFindingDetails::CrossRegionEgressSpike(v) => std::option::Option::Some(v),
7664 _ => std::option::Option::None,
7665 })
7666 }
7667
7668 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
7669 /// to hold a `CrossRegionEgressSpike`.
7670 ///
7671 /// Note that all the setters affecting `intelligence_finding_details` are
7672 /// mutually exclusive.
7673 ///
7674 /// # Example
7675 /// ```ignore,no_run
7676 /// # use google_cloud_storage::model::IntelligenceFinding;
7677 /// use google_cloud_storage::model::intelligence_finding::CrossRegionEgressSpike;
7678 /// let x = IntelligenceFinding::new().set_cross_region_egress_spike(CrossRegionEgressSpike::default()/* use setters */);
7679 /// assert!(x.cross_region_egress_spike().is_some());
7680 /// assert!(x.coldline_and_archival_storage_operations_spike().is_none());
7681 /// assert!(x.throttled_requests_spike().is_none());
7682 /// assert!(x.storage_growth_above_trend().is_none());
7683 /// ```
7684 pub fn set_cross_region_egress_spike<
7685 T: std::convert::Into<
7686 std::boxed::Box<crate::model::intelligence_finding::CrossRegionEgressSpike>,
7687 >,
7688 >(
7689 mut self,
7690 v: T,
7691 ) -> Self {
7692 self.intelligence_finding_details = std::option::Option::Some(
7693 crate::model::intelligence_finding::IntelligenceFindingDetails::CrossRegionEgressSpike(
7694 v.into(),
7695 ),
7696 );
7697 self
7698 }
7699
7700 /// The value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
7701 /// if it holds a `StorageGrowthAboveTrend`, `None` if the field is not set or
7702 /// holds a different branch.
7703 pub fn storage_growth_above_trend(
7704 &self,
7705 ) -> std::option::Option<
7706 &std::boxed::Box<crate::model::intelligence_finding::StorageGrowthAboveTrend>,
7707 > {
7708 #[allow(unreachable_patterns)]
7709 self.intelligence_finding_details.as_ref().and_then(|v| match v {
7710 crate::model::intelligence_finding::IntelligenceFindingDetails::StorageGrowthAboveTrend(v) => std::option::Option::Some(v),
7711 _ => std::option::Option::None,
7712 })
7713 }
7714
7715 /// Sets the value of [intelligence_finding_details][crate::model::IntelligenceFinding::intelligence_finding_details]
7716 /// to hold a `StorageGrowthAboveTrend`.
7717 ///
7718 /// Note that all the setters affecting `intelligence_finding_details` are
7719 /// mutually exclusive.
7720 ///
7721 /// # Example
7722 /// ```ignore,no_run
7723 /// # use google_cloud_storage::model::IntelligenceFinding;
7724 /// use google_cloud_storage::model::intelligence_finding::StorageGrowthAboveTrend;
7725 /// let x = IntelligenceFinding::new().set_storage_growth_above_trend(StorageGrowthAboveTrend::default()/* use setters */);
7726 /// assert!(x.storage_growth_above_trend().is_some());
7727 /// assert!(x.coldline_and_archival_storage_operations_spike().is_none());
7728 /// assert!(x.throttled_requests_spike().is_none());
7729 /// assert!(x.cross_region_egress_spike().is_none());
7730 /// ```
7731 pub fn set_storage_growth_above_trend<
7732 T: std::convert::Into<
7733 std::boxed::Box<crate::model::intelligence_finding::StorageGrowthAboveTrend>,
7734 >,
7735 >(
7736 mut self,
7737 v: T,
7738 ) -> Self {
7739 self.intelligence_finding_details = std::option::Option::Some(
7740 crate::model::intelligence_finding::IntelligenceFindingDetails::StorageGrowthAboveTrend(
7741 v.into(),
7742 ),
7743 );
7744 self
7745 }
7746}
7747
7748impl wkt::message::Message for IntelligenceFinding {
7749 fn typename() -> &'static str {
7750 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding"
7751 }
7752}
7753
7754/// Defines additional types related to [IntelligenceFinding].
7755pub mod intelligence_finding {
7756 #[allow(unused_imports)]
7757 use super::*;
7758
7759 /// Represents a finding about a spike in Class A/B operations on Coldline
7760 /// or Archive Cloud Storage objects.
7761 /// This corresponds to the `COLD_AND_ARCHIVAL_STORAGE_OPERATIONS_SPIKE`
7762 /// finding type.
7763 #[derive(Clone, Default, PartialEq)]
7764 #[non_exhaustive]
7765 pub struct ColdlineAndArchivalStorageOperationsSpike {
7766
7767 /// Output only. The percentage increase in operations across the project.
7768 pub percentage_increase: f64,
7769
7770 /// Output only. The total count of operations across the project.
7771 pub total_operations_count: i64,
7772
7773 /// Output only. A list of the top buckets driving the increase in
7774 /// operations.
7775 pub top_buckets: std::vec::Vec<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution>,
7776
7777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7778 }
7779
7780 impl ColdlineAndArchivalStorageOperationsSpike {
7781 /// Creates a new default instance.
7782 pub fn new() -> Self {
7783 std::default::Default::default()
7784 }
7785
7786 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike::percentage_increase].
7787 ///
7788 /// # Example
7789 /// ```ignore,no_run
7790 /// # use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
7791 /// let x = ColdlineAndArchivalStorageOperationsSpike::new().set_percentage_increase(42.0);
7792 /// ```
7793 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7794 self.percentage_increase = v.into();
7795 self
7796 }
7797
7798 /// Sets the value of [total_operations_count][crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike::total_operations_count].
7799 ///
7800 /// # Example
7801 /// ```ignore,no_run
7802 /// # use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
7803 /// let x = ColdlineAndArchivalStorageOperationsSpike::new().set_total_operations_count(42);
7804 /// ```
7805 pub fn set_total_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7806 self.total_operations_count = v.into();
7807 self
7808 }
7809
7810 /// Sets the value of [top_buckets][crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike::top_buckets].
7811 ///
7812 /// # Example
7813 /// ```ignore,no_run
7814 /// # use google_cloud_storage::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
7815 /// use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
7816 /// let x = ColdlineAndArchivalStorageOperationsSpike::new()
7817 /// .set_top_buckets([
7818 /// BucketContribution::default()/* use setters */,
7819 /// BucketContribution::default()/* use (different) setters */,
7820 /// ]);
7821 /// ```
7822 pub fn set_top_buckets<T, V>(mut self, v: T) -> Self
7823 where
7824 T: std::iter::IntoIterator<Item = V>,
7825 V: std::convert::Into<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution>
7826 {
7827 use std::iter::Iterator;
7828 self.top_buckets = v.into_iter().map(|i| i.into()).collect();
7829 self
7830 }
7831 }
7832
7833 impl wkt::message::Message for ColdlineAndArchivalStorageOperationsSpike {
7834 fn typename() -> &'static str {
7835 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike"
7836 }
7837 }
7838
7839 /// Defines additional types related to [ColdlineAndArchivalStorageOperationsSpike].
7840 pub mod coldline_and_archival_storage_operations_spike {
7841 #[allow(unused_imports)]
7842 use super::*;
7843
7844 /// Represents the operation spike details for a bucket.
7845 #[derive(Clone, Default, PartialEq)]
7846 #[non_exhaustive]
7847 pub struct BucketContribution {
7848
7849 /// Output only. The name of the bucket.
7850 pub bucket: std::string::String,
7851
7852 /// Output only. The percentage increase in operations for the bucket.
7853 pub percentage_increase: f64,
7854
7855 /// Output only. The total count of operations for the bucket.
7856 pub total_operations_count: i64,
7857
7858 /// The details of the bucket's contribution towards the
7859 /// `IntelligenceFinding`.
7860 pub details: std::option::Option<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details>,
7861
7862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7863 }
7864
7865 impl BucketContribution {
7866 /// Creates a new default instance.
7867 pub fn new() -> Self {
7868 std::default::Default::default()
7869 }
7870
7871 /// Sets the value of [bucket][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::bucket].
7872 ///
7873 /// # Example
7874 /// ```ignore,no_run
7875 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
7876 /// let x = BucketContribution::new().set_bucket("example");
7877 /// ```
7878 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7879 self.bucket = v.into();
7880 self
7881 }
7882
7883 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::percentage_increase].
7884 ///
7885 /// # Example
7886 /// ```ignore,no_run
7887 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
7888 /// let x = BucketContribution::new().set_percentage_increase(42.0);
7889 /// ```
7890 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7891 self.percentage_increase = v.into();
7892 self
7893 }
7894
7895 /// Sets the value of [total_operations_count][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::total_operations_count].
7896 ///
7897 /// # Example
7898 /// ```ignore,no_run
7899 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
7900 /// let x = BucketContribution::new().set_total_operations_count(42);
7901 /// ```
7902 pub fn set_total_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7903 self.total_operations_count = v.into();
7904 self
7905 }
7906
7907 /// Sets the value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details].
7908 ///
7909 /// Note that all the setters affecting `details` are mutually
7910 /// exclusive.
7911 ///
7912 /// # Example
7913 /// ```ignore,no_run
7914 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
7915 /// use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution;
7916 /// let x = BucketContribution::new().set_details(Some(
7917 /// google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Contribution(Contribution::default().into())));
7918 /// ```
7919 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
7920 {
7921 self.details = v.into();
7922 self
7923 }
7924
7925 /// The value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details]
7926 /// if it holds a `Contribution`, `None` if the field is not set or
7927 /// holds a different branch.
7928 pub fn contribution(&self) -> std::option::Option<&std::boxed::Box<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution>>{
7929 #[allow(unreachable_patterns)]
7930 self.details.as_ref().and_then(|v| match v {
7931 crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Contribution(v) => std::option::Option::Some(v),
7932 _ => std::option::Option::None,
7933 })
7934 }
7935
7936 /// Sets the value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details]
7937 /// to hold a `Contribution`.
7938 ///
7939 /// Note that all the setters affecting `details` are
7940 /// mutually exclusive.
7941 ///
7942 /// # Example
7943 /// ```ignore,no_run
7944 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
7945 /// use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution;
7946 /// let x = BucketContribution::new().set_contribution(Contribution::default()/* use setters */);
7947 /// assert!(x.contribution().is_some());
7948 /// assert!(x.error().is_none());
7949 /// ```
7950 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{
7951 self.details = std::option::Option::Some(
7952 crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Contribution(
7953 v.into()
7954 )
7955 );
7956 self
7957 }
7958
7959 /// The value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details]
7960 /// if it holds a `Error`, `None` if the field is not set or
7961 /// holds a different branch.
7962 pub fn error(
7963 &self,
7964 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>>
7965 {
7966 #[allow(unreachable_patterns)]
7967 self.details.as_ref().and_then(|v| match v {
7968 crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Error(v) => std::option::Option::Some(v),
7969 _ => std::option::Option::None,
7970 })
7971 }
7972
7973 /// Sets the value of [details][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::details]
7974 /// to hold a `Error`.
7975 ///
7976 /// Note that all the setters affecting `details` are
7977 /// mutually exclusive.
7978 ///
7979 /// # Example
7980 /// ```ignore,no_run
7981 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
7982 /// use google_cloud_rpc::model::Status;
7983 /// let x = BucketContribution::new().set_error(Status::default()/* use setters */);
7984 /// assert!(x.error().is_some());
7985 /// assert!(x.contribution().is_none());
7986 /// ```
7987 pub fn set_error<
7988 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
7989 >(
7990 mut self,
7991 v: T,
7992 ) -> Self {
7993 self.details = std::option::Option::Some(
7994 crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details::Error(
7995 v.into()
7996 )
7997 );
7998 self
7999 }
8000 }
8001
8002 impl wkt::message::Message for BucketContribution {
8003 fn typename() -> &'static str {
8004 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution"
8005 }
8006 }
8007
8008 /// Defines additional types related to [BucketContribution].
8009 pub mod bucket_contribution {
8010 #[allow(unused_imports)]
8011 use super::*;
8012
8013 /// Represents the contribution of the bucket towards the
8014 /// `IntelligenceFinding`.
8015 #[derive(Clone, Default, PartialEq)]
8016 #[non_exhaustive]
8017 pub struct Contribution {
8018
8019 /// Output only. A list of the top object prefixes driving the increase
8020 /// in operations.
8021 pub top_prefixes: std::vec::Vec<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution>,
8022
8023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8024 }
8025
8026 impl Contribution {
8027 /// Creates a new default instance.
8028 pub fn new() -> Self {
8029 std::default::Default::default()
8030 }
8031
8032 /// Sets the value of [top_prefixes][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution::top_prefixes].
8033 ///
8034 /// # Example
8035 /// ```ignore,no_run
8036 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution;
8037 /// use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
8038 /// let x = Contribution::new()
8039 /// .set_top_prefixes([
8040 /// PrefixContribution::default()/* use setters */,
8041 /// PrefixContribution::default()/* use (different) setters */,
8042 /// ]);
8043 /// ```
8044 pub fn set_top_prefixes<T, V>(mut self, v: T) -> Self
8045 where
8046 T: std::iter::IntoIterator<Item = V>,
8047 V: std::convert::Into<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution>
8048 {
8049 use std::iter::Iterator;
8050 self.top_prefixes = v.into_iter().map(|i| i.into()).collect();
8051 self
8052 }
8053 }
8054
8055 impl wkt::message::Message for Contribution {
8056 fn typename() -> &'static str {
8057 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution"
8058 }
8059 }
8060
8061 /// Defines additional types related to [Contribution].
8062 pub mod contribution {
8063 #[allow(unused_imports)]
8064 use super::*;
8065
8066 /// Represents the operation spike details for an object prefix.
8067 #[derive(Clone, Default, PartialEq)]
8068 #[non_exhaustive]
8069 pub struct PrefixContribution {
8070 /// Output only. The object prefix.
8071 /// Format: `a/b/c`, 'a/b/d', etc.
8072 pub prefix: std::string::String,
8073
8074 /// Output only. The percentage increase in operations for the object
8075 /// prefix.
8076 pub percentage_increase: f64,
8077
8078 /// Output only. The total count of operations for the object prefix.
8079 pub total_operations_count: i64,
8080
8081 pub(crate) _unknown_fields:
8082 serde_json::Map<std::string::String, serde_json::Value>,
8083 }
8084
8085 impl PrefixContribution {
8086 /// Creates a new default instance.
8087 pub fn new() -> Self {
8088 std::default::Default::default()
8089 }
8090
8091 /// Sets the value of [prefix][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution::prefix].
8092 ///
8093 /// # Example
8094 /// ```ignore,no_run
8095 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
8096 /// let x = PrefixContribution::new().set_prefix("example");
8097 /// ```
8098 pub fn set_prefix<T: std::convert::Into<std::string::String>>(
8099 mut self,
8100 v: T,
8101 ) -> Self {
8102 self.prefix = v.into();
8103 self
8104 }
8105
8106 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution::percentage_increase].
8107 ///
8108 /// # Example
8109 /// ```ignore,no_run
8110 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
8111 /// let x = PrefixContribution::new().set_percentage_increase(42.0);
8112 /// ```
8113 pub fn set_percentage_increase<T: std::convert::Into<f64>>(
8114 mut self,
8115 v: T,
8116 ) -> Self {
8117 self.percentage_increase = v.into();
8118 self
8119 }
8120
8121 /// Sets the value of [total_operations_count][crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution::total_operations_count].
8122 ///
8123 /// # Example
8124 /// ```ignore,no_run
8125 /// # use google_cloud_storage::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
8126 /// let x = PrefixContribution::new().set_total_operations_count(42);
8127 /// ```
8128 pub fn set_total_operations_count<T: std::convert::Into<i64>>(
8129 mut self,
8130 v: T,
8131 ) -> Self {
8132 self.total_operations_count = v.into();
8133 self
8134 }
8135 }
8136
8137 impl wkt::message::Message for PrefixContribution {
8138 fn typename() -> &'static str {
8139 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ColdlineAndArchivalStorageOperationsSpike.BucketContribution.Contribution.PrefixContribution"
8140 }
8141 }
8142 }
8143
8144 /// The details of the bucket's contribution towards the
8145 /// `IntelligenceFinding`.
8146 #[derive(Clone, Debug, PartialEq)]
8147 #[non_exhaustive]
8148 pub enum Details {
8149 /// Output only. The details about the contribution of the bucket.
8150 Contribution(std::boxed::Box<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution>),
8151 /// Output only. The error related to accessing the details about the
8152 /// contribution of the bucket.
8153 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
8154 }
8155
8156 impl Details {
8157 /// Initializes the enum to the [Contribution](Self::Contribution) branch.
8158 pub fn from_contribution(
8159 value: impl std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution>>,
8160 ) -> Self {
8161 Self::Contribution(value.into())
8162 }
8163 /// Initializes the enum to the [Error](Self::Error) branch.
8164 pub fn from_error(
8165 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
8166 ) -> Self {
8167 Self::Error(value.into())
8168 }
8169 }
8170 }
8171 }
8172
8173 /// Represents a finding about a spike in cross-region egress from Cloud
8174 /// Storage.
8175 /// This corresponds to the `CROSS_REGION_EGRESS_SPIKE` finding type.
8176 #[derive(Clone, Default, PartialEq)]
8177 #[non_exhaustive]
8178 pub struct CrossRegionEgressSpike {
8179 /// Output only. The total cross-region egress volume in bytes across the
8180 /// project.
8181 pub total_egress_bytes: i64,
8182
8183 /// Output only. The percentage increase in cross-region egress across the
8184 /// project.
8185 pub percentage_increase: f64,
8186
8187 /// Output only. A list of top buckets driving the increase in cross-region
8188 /// egress.
8189 pub top_buckets: std::vec::Vec<
8190 crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution,
8191 >,
8192
8193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8194 }
8195
8196 impl CrossRegionEgressSpike {
8197 /// Creates a new default instance.
8198 pub fn new() -> Self {
8199 std::default::Default::default()
8200 }
8201
8202 /// Sets the value of [total_egress_bytes][crate::model::intelligence_finding::CrossRegionEgressSpike::total_egress_bytes].
8203 ///
8204 /// # Example
8205 /// ```ignore,no_run
8206 /// # use google_cloud_storage::model::intelligence_finding::CrossRegionEgressSpike;
8207 /// let x = CrossRegionEgressSpike::new().set_total_egress_bytes(42);
8208 /// ```
8209 pub fn set_total_egress_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8210 self.total_egress_bytes = v.into();
8211 self
8212 }
8213
8214 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::CrossRegionEgressSpike::percentage_increase].
8215 ///
8216 /// # Example
8217 /// ```ignore,no_run
8218 /// # use google_cloud_storage::model::intelligence_finding::CrossRegionEgressSpike;
8219 /// let x = CrossRegionEgressSpike::new().set_percentage_increase(42.0);
8220 /// ```
8221 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
8222 self.percentage_increase = v.into();
8223 self
8224 }
8225
8226 /// Sets the value of [top_buckets][crate::model::intelligence_finding::CrossRegionEgressSpike::top_buckets].
8227 ///
8228 /// # Example
8229 /// ```ignore,no_run
8230 /// # use google_cloud_storage::model::intelligence_finding::CrossRegionEgressSpike;
8231 /// use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
8232 /// let x = CrossRegionEgressSpike::new()
8233 /// .set_top_buckets([
8234 /// BucketContribution::default()/* use setters */,
8235 /// BucketContribution::default()/* use (different) setters */,
8236 /// ]);
8237 /// ```
8238 pub fn set_top_buckets<T, V>(mut self, v: T) -> Self
8239 where
8240 T: std::iter::IntoIterator<Item = V>,
8241 V: std::convert::Into<crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution>
8242 {
8243 use std::iter::Iterator;
8244 self.top_buckets = v.into_iter().map(|i| i.into()).collect();
8245 self
8246 }
8247 }
8248
8249 impl wkt::message::Message for CrossRegionEgressSpike {
8250 fn typename() -> &'static str {
8251 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike"
8252 }
8253 }
8254
8255 /// Defines additional types related to [CrossRegionEgressSpike].
8256 pub mod cross_region_egress_spike {
8257 #[allow(unused_imports)]
8258 use super::*;
8259
8260 /// Represents the cross-region egress spike details for a bucket.
8261 #[derive(Clone, Default, PartialEq)]
8262 #[non_exhaustive]
8263 pub struct BucketContribution {
8264
8265 /// Output only. The name of the bucket.
8266 pub bucket: std::string::String,
8267
8268 /// Output only. The total cross-region egress volume in bytes for the
8269 /// bucket.
8270 pub total_egress_bytes: i64,
8271
8272 /// Output only. The percentage increase in cross-region egress for the
8273 /// bucket.
8274 pub percentage_increase: f64,
8275
8276 /// The details of the bucket's contribution towards the
8277 /// `IntelligenceFinding`.
8278 pub details: std::option::Option<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details>,
8279
8280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8281 }
8282
8283 impl BucketContribution {
8284 /// Creates a new default instance.
8285 pub fn new() -> Self {
8286 std::default::Default::default()
8287 }
8288
8289 /// Sets the value of [bucket][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::bucket].
8290 ///
8291 /// # Example
8292 /// ```ignore,no_run
8293 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
8294 /// let x = BucketContribution::new().set_bucket("example");
8295 /// ```
8296 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8297 self.bucket = v.into();
8298 self
8299 }
8300
8301 /// Sets the value of [total_egress_bytes][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::total_egress_bytes].
8302 ///
8303 /// # Example
8304 /// ```ignore,no_run
8305 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
8306 /// let x = BucketContribution::new().set_total_egress_bytes(42);
8307 /// ```
8308 pub fn set_total_egress_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8309 self.total_egress_bytes = v.into();
8310 self
8311 }
8312
8313 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::percentage_increase].
8314 ///
8315 /// # Example
8316 /// ```ignore,no_run
8317 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
8318 /// let x = BucketContribution::new().set_percentage_increase(42.0);
8319 /// ```
8320 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
8321 self.percentage_increase = v.into();
8322 self
8323 }
8324
8325 /// Sets the value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details].
8326 ///
8327 /// Note that all the setters affecting `details` are mutually
8328 /// exclusive.
8329 ///
8330 /// # Example
8331 /// ```ignore,no_run
8332 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
8333 /// use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution;
8334 /// let x = BucketContribution::new().set_details(Some(
8335 /// google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Contribution(Contribution::default().into())));
8336 /// ```
8337 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
8338 {
8339 self.details = v.into();
8340 self
8341 }
8342
8343 /// The value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details]
8344 /// if it holds a `Contribution`, `None` if the field is not set or
8345 /// holds a different branch.
8346 pub fn contribution(&self) -> std::option::Option<&std::boxed::Box<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution>>{
8347 #[allow(unreachable_patterns)]
8348 self.details.as_ref().and_then(|v| match v {
8349 crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Contribution(v) => std::option::Option::Some(v),
8350 _ => std::option::Option::None,
8351 })
8352 }
8353
8354 /// Sets the value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details]
8355 /// to hold a `Contribution`.
8356 ///
8357 /// Note that all the setters affecting `details` are
8358 /// mutually exclusive.
8359 ///
8360 /// # Example
8361 /// ```ignore,no_run
8362 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
8363 /// use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution;
8364 /// let x = BucketContribution::new().set_contribution(Contribution::default()/* use setters */);
8365 /// assert!(x.contribution().is_some());
8366 /// assert!(x.error().is_none());
8367 /// ```
8368 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{
8369 self.details = std::option::Option::Some(
8370 crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Contribution(
8371 v.into()
8372 )
8373 );
8374 self
8375 }
8376
8377 /// The value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details]
8378 /// if it holds a `Error`, `None` if the field is not set or
8379 /// holds a different branch.
8380 pub fn error(
8381 &self,
8382 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>>
8383 {
8384 #[allow(unreachable_patterns)]
8385 self.details.as_ref().and_then(|v| match v {
8386 crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Error(v) => std::option::Option::Some(v),
8387 _ => std::option::Option::None,
8388 })
8389 }
8390
8391 /// Sets the value of [details][crate::model::intelligence_finding::cross_region_egress_spike::BucketContribution::details]
8392 /// to hold a `Error`.
8393 ///
8394 /// Note that all the setters affecting `details` are
8395 /// mutually exclusive.
8396 ///
8397 /// # Example
8398 /// ```ignore,no_run
8399 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::BucketContribution;
8400 /// use google_cloud_rpc::model::Status;
8401 /// let x = BucketContribution::new().set_error(Status::default()/* use setters */);
8402 /// assert!(x.error().is_some());
8403 /// assert!(x.contribution().is_none());
8404 /// ```
8405 pub fn set_error<
8406 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
8407 >(
8408 mut self,
8409 v: T,
8410 ) -> Self {
8411 self.details = std::option::Option::Some(
8412 crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details::Error(
8413 v.into()
8414 )
8415 );
8416 self
8417 }
8418 }
8419
8420 impl wkt::message::Message for BucketContribution {
8421 fn typename() -> &'static str {
8422 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution"
8423 }
8424 }
8425
8426 /// Defines additional types related to [BucketContribution].
8427 pub mod bucket_contribution {
8428 #[allow(unused_imports)]
8429 use super::*;
8430
8431 /// Represents the contribution of the bucket towards the
8432 /// `IntelligenceFinding`.
8433 #[derive(Clone, Default, PartialEq)]
8434 #[non_exhaustive]
8435 pub struct Contribution {
8436
8437 /// Output only. A list of the top object prefixes driving the increase
8438 /// in cross-region egress.
8439 pub top_prefixes: std::vec::Vec<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution>,
8440
8441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8442 }
8443
8444 impl Contribution {
8445 /// Creates a new default instance.
8446 pub fn new() -> Self {
8447 std::default::Default::default()
8448 }
8449
8450 /// Sets the value of [top_prefixes][crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution::top_prefixes].
8451 ///
8452 /// # Example
8453 /// ```ignore,no_run
8454 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution;
8455 /// use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
8456 /// let x = Contribution::new()
8457 /// .set_top_prefixes([
8458 /// PrefixContribution::default()/* use setters */,
8459 /// PrefixContribution::default()/* use (different) setters */,
8460 /// ]);
8461 /// ```
8462 pub fn set_top_prefixes<T, V>(mut self, v: T) -> Self
8463 where
8464 T: std::iter::IntoIterator<Item = V>,
8465 V: std::convert::Into<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution>
8466 {
8467 use std::iter::Iterator;
8468 self.top_prefixes = v.into_iter().map(|i| i.into()).collect();
8469 self
8470 }
8471 }
8472
8473 impl wkt::message::Message for Contribution {
8474 fn typename() -> &'static str {
8475 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution"
8476 }
8477 }
8478
8479 /// Defines additional types related to [Contribution].
8480 pub mod contribution {
8481 #[allow(unused_imports)]
8482 use super::*;
8483
8484 /// Represents the cross-region egress spike details for an object
8485 /// prefix.
8486 #[derive(Clone, Default, PartialEq)]
8487 #[non_exhaustive]
8488 pub struct PrefixContribution {
8489 /// Output only. The object prefix.
8490 /// Format: `a/b/c`, 'a/b/d', etc.
8491 pub prefix: std::string::String,
8492
8493 /// Output only. The total cross-region egress volume in bytes from the
8494 /// object prefix.
8495 pub total_egress_bytes: i64,
8496
8497 /// Output only. The percentage increase in cross-region egress for the
8498 /// object prefix.
8499 pub percentage_increase: f64,
8500
8501 pub(crate) _unknown_fields:
8502 serde_json::Map<std::string::String, serde_json::Value>,
8503 }
8504
8505 impl PrefixContribution {
8506 /// Creates a new default instance.
8507 pub fn new() -> Self {
8508 std::default::Default::default()
8509 }
8510
8511 /// Sets the value of [prefix][crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution::prefix].
8512 ///
8513 /// # Example
8514 /// ```ignore,no_run
8515 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
8516 /// let x = PrefixContribution::new().set_prefix("example");
8517 /// ```
8518 pub fn set_prefix<T: std::convert::Into<std::string::String>>(
8519 mut self,
8520 v: T,
8521 ) -> Self {
8522 self.prefix = v.into();
8523 self
8524 }
8525
8526 /// Sets the value of [total_egress_bytes][crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution::total_egress_bytes].
8527 ///
8528 /// # Example
8529 /// ```ignore,no_run
8530 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
8531 /// let x = PrefixContribution::new().set_total_egress_bytes(42);
8532 /// ```
8533 pub fn set_total_egress_bytes<T: std::convert::Into<i64>>(
8534 mut self,
8535 v: T,
8536 ) -> Self {
8537 self.total_egress_bytes = v.into();
8538 self
8539 }
8540
8541 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution::percentage_increase].
8542 ///
8543 /// # Example
8544 /// ```ignore,no_run
8545 /// # use google_cloud_storage::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
8546 /// let x = PrefixContribution::new().set_percentage_increase(42.0);
8547 /// ```
8548 pub fn set_percentage_increase<T: std::convert::Into<f64>>(
8549 mut self,
8550 v: T,
8551 ) -> Self {
8552 self.percentage_increase = v.into();
8553 self
8554 }
8555 }
8556
8557 impl wkt::message::Message for PrefixContribution {
8558 fn typename() -> &'static str {
8559 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.CrossRegionEgressSpike.BucketContribution.Contribution.PrefixContribution"
8560 }
8561 }
8562 }
8563
8564 /// The details of the bucket's contribution towards the
8565 /// `IntelligenceFinding`.
8566 #[derive(Clone, Debug, PartialEq)]
8567 #[non_exhaustive]
8568 pub enum Details {
8569 /// Output only. The details about the contribution of the bucket.
8570 Contribution(std::boxed::Box<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution>),
8571 /// Output only. The error related to accessing the details about the
8572 /// contribution of the bucket.
8573 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
8574 }
8575
8576 impl Details {
8577 /// Initializes the enum to the [Contribution](Self::Contribution) branch.
8578 pub fn from_contribution(
8579 value: impl std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution>>,
8580 ) -> Self {
8581 Self::Contribution(value.into())
8582 }
8583 /// Initializes the enum to the [Error](Self::Error) branch.
8584 pub fn from_error(
8585 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
8586 ) -> Self {
8587 Self::Error(value.into())
8588 }
8589 }
8590 }
8591 }
8592
8593 /// Represents a finding about a spike in throttled requests (429 errors)
8594 /// within a project.
8595 /// This corresponds to the `THROTTLED_REQUEST_SPIKE` finding type.
8596 #[derive(Clone, Default, PartialEq)]
8597 #[non_exhaustive]
8598 pub struct ThrottledRequestSpike {
8599 /// Output only. The count of throttled requests across the project.
8600 pub throttled_requests: i64,
8601
8602 /// Output only. The percentage increase in throttled requests across the
8603 /// project.
8604 pub percentage_increase: f64,
8605
8606 /// Output only. A list of top buckets driving the increase in throttled
8607 /// requests.
8608 pub top_buckets: std::vec::Vec<
8609 crate::model::intelligence_finding::throttled_request_spike::BucketContribution,
8610 >,
8611
8612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8613 }
8614
8615 impl ThrottledRequestSpike {
8616 /// Creates a new default instance.
8617 pub fn new() -> Self {
8618 std::default::Default::default()
8619 }
8620
8621 /// Sets the value of [throttled_requests][crate::model::intelligence_finding::ThrottledRequestSpike::throttled_requests].
8622 ///
8623 /// # Example
8624 /// ```ignore,no_run
8625 /// # use google_cloud_storage::model::intelligence_finding::ThrottledRequestSpike;
8626 /// let x = ThrottledRequestSpike::new().set_throttled_requests(42);
8627 /// ```
8628 pub fn set_throttled_requests<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8629 self.throttled_requests = v.into();
8630 self
8631 }
8632
8633 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::ThrottledRequestSpike::percentage_increase].
8634 ///
8635 /// # Example
8636 /// ```ignore,no_run
8637 /// # use google_cloud_storage::model::intelligence_finding::ThrottledRequestSpike;
8638 /// let x = ThrottledRequestSpike::new().set_percentage_increase(42.0);
8639 /// ```
8640 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
8641 self.percentage_increase = v.into();
8642 self
8643 }
8644
8645 /// Sets the value of [top_buckets][crate::model::intelligence_finding::ThrottledRequestSpike::top_buckets].
8646 ///
8647 /// # Example
8648 /// ```ignore,no_run
8649 /// # use google_cloud_storage::model::intelligence_finding::ThrottledRequestSpike;
8650 /// use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
8651 /// let x = ThrottledRequestSpike::new()
8652 /// .set_top_buckets([
8653 /// BucketContribution::default()/* use setters */,
8654 /// BucketContribution::default()/* use (different) setters */,
8655 /// ]);
8656 /// ```
8657 pub fn set_top_buckets<T, V>(mut self, v: T) -> Self
8658 where
8659 T: std::iter::IntoIterator<Item = V>,
8660 V: std::convert::Into<
8661 crate::model::intelligence_finding::throttled_request_spike::BucketContribution,
8662 >,
8663 {
8664 use std::iter::Iterator;
8665 self.top_buckets = v.into_iter().map(|i| i.into()).collect();
8666 self
8667 }
8668 }
8669
8670 impl wkt::message::Message for ThrottledRequestSpike {
8671 fn typename() -> &'static str {
8672 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike"
8673 }
8674 }
8675
8676 /// Defines additional types related to [ThrottledRequestSpike].
8677 pub mod throttled_request_spike {
8678 #[allow(unused_imports)]
8679 use super::*;
8680
8681 /// Represents the throttled requests details for a bucket.
8682 #[derive(Clone, Default, PartialEq)]
8683 #[non_exhaustive]
8684 pub struct BucketContribution {
8685
8686 /// Output only. The name of the bucket.
8687 pub bucket: std::string::String,
8688
8689 /// Output only. The count of throttled requests for the bucket.
8690 pub throttled_requests: i64,
8691
8692 /// Output only. The percentage increase in throttled requests for the
8693 /// bucket.
8694 pub percentage_increase: f64,
8695
8696 /// The details of the bucket's contribution towards the
8697 /// `IntelligenceFinding`.
8698 pub details: std::option::Option<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details>,
8699
8700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8701 }
8702
8703 impl BucketContribution {
8704 /// Creates a new default instance.
8705 pub fn new() -> Self {
8706 std::default::Default::default()
8707 }
8708
8709 /// Sets the value of [bucket][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::bucket].
8710 ///
8711 /// # Example
8712 /// ```ignore,no_run
8713 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
8714 /// let x = BucketContribution::new().set_bucket("example");
8715 /// ```
8716 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8717 self.bucket = v.into();
8718 self
8719 }
8720
8721 /// Sets the value of [throttled_requests][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::throttled_requests].
8722 ///
8723 /// # Example
8724 /// ```ignore,no_run
8725 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
8726 /// let x = BucketContribution::new().set_throttled_requests(42);
8727 /// ```
8728 pub fn set_throttled_requests<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8729 self.throttled_requests = v.into();
8730 self
8731 }
8732
8733 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::percentage_increase].
8734 ///
8735 /// # Example
8736 /// ```ignore,no_run
8737 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
8738 /// let x = BucketContribution::new().set_percentage_increase(42.0);
8739 /// ```
8740 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
8741 self.percentage_increase = v.into();
8742 self
8743 }
8744
8745 /// Sets the value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details].
8746 ///
8747 /// Note that all the setters affecting `details` are mutually
8748 /// exclusive.
8749 ///
8750 /// # Example
8751 /// ```ignore,no_run
8752 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
8753 /// use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution;
8754 /// let x = BucketContribution::new().set_details(Some(
8755 /// google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Contribution(Contribution::default().into())));
8756 /// ```
8757 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
8758 {
8759 self.details = v.into();
8760 self
8761 }
8762
8763 /// The value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details]
8764 /// if it holds a `Contribution`, `None` if the field is not set or
8765 /// holds a different branch.
8766 pub fn contribution(&self) -> std::option::Option<&std::boxed::Box<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution>>{
8767 #[allow(unreachable_patterns)]
8768 self.details.as_ref().and_then(|v| match v {
8769 crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Contribution(v) => std::option::Option::Some(v),
8770 _ => std::option::Option::None,
8771 })
8772 }
8773
8774 /// Sets the value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details]
8775 /// to hold a `Contribution`.
8776 ///
8777 /// Note that all the setters affecting `details` are
8778 /// mutually exclusive.
8779 ///
8780 /// # Example
8781 /// ```ignore,no_run
8782 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
8783 /// use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution;
8784 /// let x = BucketContribution::new().set_contribution(Contribution::default()/* use setters */);
8785 /// assert!(x.contribution().is_some());
8786 /// assert!(x.error().is_none());
8787 /// ```
8788 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{
8789 self.details = std::option::Option::Some(
8790 crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Contribution(
8791 v.into()
8792 )
8793 );
8794 self
8795 }
8796
8797 /// The value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details]
8798 /// if it holds a `Error`, `None` if the field is not set or
8799 /// holds a different branch.
8800 pub fn error(
8801 &self,
8802 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>>
8803 {
8804 #[allow(unreachable_patterns)]
8805 self.details.as_ref().and_then(|v| match v {
8806 crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Error(v) => std::option::Option::Some(v),
8807 _ => std::option::Option::None,
8808 })
8809 }
8810
8811 /// Sets the value of [details][crate::model::intelligence_finding::throttled_request_spike::BucketContribution::details]
8812 /// to hold a `Error`.
8813 ///
8814 /// Note that all the setters affecting `details` are
8815 /// mutually exclusive.
8816 ///
8817 /// # Example
8818 /// ```ignore,no_run
8819 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::BucketContribution;
8820 /// use google_cloud_rpc::model::Status;
8821 /// let x = BucketContribution::new().set_error(Status::default()/* use setters */);
8822 /// assert!(x.error().is_some());
8823 /// assert!(x.contribution().is_none());
8824 /// ```
8825 pub fn set_error<
8826 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
8827 >(
8828 mut self,
8829 v: T,
8830 ) -> Self {
8831 self.details = std::option::Option::Some(
8832 crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details::Error(
8833 v.into()
8834 )
8835 );
8836 self
8837 }
8838 }
8839
8840 impl wkt::message::Message for BucketContribution {
8841 fn typename() -> &'static str {
8842 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution"
8843 }
8844 }
8845
8846 /// Defines additional types related to [BucketContribution].
8847 pub mod bucket_contribution {
8848 #[allow(unused_imports)]
8849 use super::*;
8850
8851 /// Represents the contribution of the bucket towards the
8852 /// `IntelligenceFinding`.
8853 #[derive(Clone, Default, PartialEq)]
8854 #[non_exhaustive]
8855 pub struct Contribution {
8856
8857 /// Output only. A list of top object prefixes driving the increase in
8858 /// throttled requests.
8859 pub top_prefixes: std::vec::Vec<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution>,
8860
8861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8862 }
8863
8864 impl Contribution {
8865 /// Creates a new default instance.
8866 pub fn new() -> Self {
8867 std::default::Default::default()
8868 }
8869
8870 /// Sets the value of [top_prefixes][crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution::top_prefixes].
8871 ///
8872 /// # Example
8873 /// ```ignore,no_run
8874 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution;
8875 /// use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
8876 /// let x = Contribution::new()
8877 /// .set_top_prefixes([
8878 /// PrefixContribution::default()/* use setters */,
8879 /// PrefixContribution::default()/* use (different) setters */,
8880 /// ]);
8881 /// ```
8882 pub fn set_top_prefixes<T, V>(mut self, v: T) -> Self
8883 where
8884 T: std::iter::IntoIterator<Item = V>,
8885 V: std::convert::Into<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution>
8886 {
8887 use std::iter::Iterator;
8888 self.top_prefixes = v.into_iter().map(|i| i.into()).collect();
8889 self
8890 }
8891 }
8892
8893 impl wkt::message::Message for Contribution {
8894 fn typename() -> &'static str {
8895 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution"
8896 }
8897 }
8898
8899 /// Defines additional types related to [Contribution].
8900 pub mod contribution {
8901 #[allow(unused_imports)]
8902 use super::*;
8903
8904 /// Represents throttled requests details for an object prefix.
8905 #[derive(Clone, Default, PartialEq)]
8906 #[non_exhaustive]
8907 pub struct PrefixContribution {
8908 /// Output only. The object prefix.
8909 /// Format: `a/b/c`, 'a/b/d', etc.
8910 pub prefix: std::string::String,
8911
8912 /// Output only. The count of throttled requests for the object prefix.
8913 pub throttled_requests: i64,
8914
8915 /// Output only. The percentage increase in throttled requests for the
8916 /// object prefix.
8917 pub percentage_increase: f64,
8918
8919 pub(crate) _unknown_fields:
8920 serde_json::Map<std::string::String, serde_json::Value>,
8921 }
8922
8923 impl PrefixContribution {
8924 /// Creates a new default instance.
8925 pub fn new() -> Self {
8926 std::default::Default::default()
8927 }
8928
8929 /// Sets the value of [prefix][crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution::prefix].
8930 ///
8931 /// # Example
8932 /// ```ignore,no_run
8933 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
8934 /// let x = PrefixContribution::new().set_prefix("example");
8935 /// ```
8936 pub fn set_prefix<T: std::convert::Into<std::string::String>>(
8937 mut self,
8938 v: T,
8939 ) -> Self {
8940 self.prefix = v.into();
8941 self
8942 }
8943
8944 /// Sets the value of [throttled_requests][crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution::throttled_requests].
8945 ///
8946 /// # Example
8947 /// ```ignore,no_run
8948 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
8949 /// let x = PrefixContribution::new().set_throttled_requests(42);
8950 /// ```
8951 pub fn set_throttled_requests<T: std::convert::Into<i64>>(
8952 mut self,
8953 v: T,
8954 ) -> Self {
8955 self.throttled_requests = v.into();
8956 self
8957 }
8958
8959 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution::percentage_increase].
8960 ///
8961 /// # Example
8962 /// ```ignore,no_run
8963 /// # use google_cloud_storage::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
8964 /// let x = PrefixContribution::new().set_percentage_increase(42.0);
8965 /// ```
8966 pub fn set_percentage_increase<T: std::convert::Into<f64>>(
8967 mut self,
8968 v: T,
8969 ) -> Self {
8970 self.percentage_increase = v.into();
8971 self
8972 }
8973 }
8974
8975 impl wkt::message::Message for PrefixContribution {
8976 fn typename() -> &'static str {
8977 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.ThrottledRequestSpike.BucketContribution.Contribution.PrefixContribution"
8978 }
8979 }
8980 }
8981
8982 /// The details of the bucket's contribution towards the
8983 /// `IntelligenceFinding`.
8984 #[derive(Clone, Debug, PartialEq)]
8985 #[non_exhaustive]
8986 pub enum Details {
8987 /// Output only. The details about the contribution of the bucket.
8988 Contribution(std::boxed::Box<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution>),
8989 /// Output only. The error related to accessing the details about the
8990 /// contribution of the bucket.
8991 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
8992 }
8993
8994 impl Details {
8995 /// Initializes the enum to the [Contribution](Self::Contribution) branch.
8996 pub fn from_contribution(
8997 value: impl std::convert::Into<std::boxed::Box<crate::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution>>,
8998 ) -> Self {
8999 Self::Contribution(value.into())
9000 }
9001 /// Initializes the enum to the [Error](Self::Error) branch.
9002 pub fn from_error(
9003 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
9004 ) -> Self {
9005 Self::Error(value.into())
9006 }
9007 }
9008 }
9009 }
9010
9011 /// Represents a finding about a storage growth above the expected trend.
9012 /// This corresponds to the `STORAGE_GROWTH_ABOVE_TREND` finding type.
9013 #[derive(Clone, Default, PartialEq)]
9014 #[non_exhaustive]
9015 pub struct StorageGrowthAboveTrend {
9016 /// Output only. The total storage growth in bytes.
9017 pub total_storage_growth_bytes: i64,
9018
9019 /// Output only. The percentage increase in storage growth.
9020 pub percentage_increase: f64,
9021
9022 /// Output only. A list of top buckets driving the increase in storage
9023 /// growth.
9024 pub top_buckets: std::vec::Vec<
9025 crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution,
9026 >,
9027
9028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9029 }
9030
9031 impl StorageGrowthAboveTrend {
9032 /// Creates a new default instance.
9033 pub fn new() -> Self {
9034 std::default::Default::default()
9035 }
9036
9037 /// Sets the value of [total_storage_growth_bytes][crate::model::intelligence_finding::StorageGrowthAboveTrend::total_storage_growth_bytes].
9038 ///
9039 /// # Example
9040 /// ```ignore,no_run
9041 /// # use google_cloud_storage::model::intelligence_finding::StorageGrowthAboveTrend;
9042 /// let x = StorageGrowthAboveTrend::new().set_total_storage_growth_bytes(42);
9043 /// ```
9044 pub fn set_total_storage_growth_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9045 self.total_storage_growth_bytes = v.into();
9046 self
9047 }
9048
9049 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::StorageGrowthAboveTrend::percentage_increase].
9050 ///
9051 /// # Example
9052 /// ```ignore,no_run
9053 /// # use google_cloud_storage::model::intelligence_finding::StorageGrowthAboveTrend;
9054 /// let x = StorageGrowthAboveTrend::new().set_percentage_increase(42.0);
9055 /// ```
9056 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
9057 self.percentage_increase = v.into();
9058 self
9059 }
9060
9061 /// Sets the value of [top_buckets][crate::model::intelligence_finding::StorageGrowthAboveTrend::top_buckets].
9062 ///
9063 /// # Example
9064 /// ```ignore,no_run
9065 /// # use google_cloud_storage::model::intelligence_finding::StorageGrowthAboveTrend;
9066 /// use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
9067 /// let x = StorageGrowthAboveTrend::new()
9068 /// .set_top_buckets([
9069 /// BucketContribution::default()/* use setters */,
9070 /// BucketContribution::default()/* use (different) setters */,
9071 /// ]);
9072 /// ```
9073 pub fn set_top_buckets<T, V>(mut self, v: T) -> Self
9074 where
9075 T: std::iter::IntoIterator<Item = V>,
9076 V: std::convert::Into<crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution>
9077 {
9078 use std::iter::Iterator;
9079 self.top_buckets = v.into_iter().map(|i| i.into()).collect();
9080 self
9081 }
9082 }
9083
9084 impl wkt::message::Message for StorageGrowthAboveTrend {
9085 fn typename() -> &'static str {
9086 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend"
9087 }
9088 }
9089
9090 /// Defines additional types related to [StorageGrowthAboveTrend].
9091 pub mod storage_growth_above_trend {
9092 #[allow(unused_imports)]
9093 use super::*;
9094
9095 /// Represents the storage growth details for a bucket.
9096 #[derive(Clone, Default, PartialEq)]
9097 #[non_exhaustive]
9098 pub struct BucketContribution {
9099
9100 /// Output only. The name of the bucket.
9101 pub bucket: std::string::String,
9102
9103 /// Output only. The total storage growth in bytes for the bucket.
9104 pub total_storage_growth_bytes: i64,
9105
9106 /// Output only. The percentage increase in storage growth for the bucket.
9107 pub percentage_increase: f64,
9108
9109 /// The details of the bucket's contribution towards the
9110 /// `IntelligenceFinding`.
9111 pub details: std::option::Option<crate::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details>,
9112
9113 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9114 }
9115
9116 impl BucketContribution {
9117 /// Creates a new default instance.
9118 pub fn new() -> Self {
9119 std::default::Default::default()
9120 }
9121
9122 /// Sets the value of [bucket][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::bucket].
9123 ///
9124 /// # Example
9125 /// ```ignore,no_run
9126 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
9127 /// let x = BucketContribution::new().set_bucket("example");
9128 /// ```
9129 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9130 self.bucket = v.into();
9131 self
9132 }
9133
9134 /// Sets the value of [total_storage_growth_bytes][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::total_storage_growth_bytes].
9135 ///
9136 /// # Example
9137 /// ```ignore,no_run
9138 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
9139 /// let x = BucketContribution::new().set_total_storage_growth_bytes(42);
9140 /// ```
9141 pub fn set_total_storage_growth_bytes<T: std::convert::Into<i64>>(
9142 mut self,
9143 v: T,
9144 ) -> Self {
9145 self.total_storage_growth_bytes = v.into();
9146 self
9147 }
9148
9149 /// Sets the value of [percentage_increase][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::percentage_increase].
9150 ///
9151 /// # Example
9152 /// ```ignore,no_run
9153 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
9154 /// let x = BucketContribution::new().set_percentage_increase(42.0);
9155 /// ```
9156 pub fn set_percentage_increase<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
9157 self.percentage_increase = v.into();
9158 self
9159 }
9160
9161 /// Sets the value of [details][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::details].
9162 ///
9163 /// Note that all the setters affecting `details` are mutually
9164 /// exclusive.
9165 ///
9166 /// # Example
9167 /// ```ignore,no_run
9168 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
9169 /// use google_cloud_rpc::model::Status;
9170 /// let x = BucketContribution::new().set_details(Some(
9171 /// google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details::Error(Status::default().into())));
9172 /// ```
9173 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
9174 {
9175 self.details = v.into();
9176 self
9177 }
9178
9179 /// The value of [details][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::details]
9180 /// if it holds a `Error`, `None` if the field is not set or
9181 /// holds a different branch.
9182 pub fn error(
9183 &self,
9184 ) -> std::option::Option<&std::boxed::Box<google_cloud_rpc::model::Status>>
9185 {
9186 #[allow(unreachable_patterns)]
9187 self.details.as_ref().and_then(|v| match v {
9188 crate::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details::Error(v) => std::option::Option::Some(v),
9189 _ => std::option::Option::None,
9190 })
9191 }
9192
9193 /// Sets the value of [details][crate::model::intelligence_finding::storage_growth_above_trend::BucketContribution::details]
9194 /// to hold a `Error`.
9195 ///
9196 /// Note that all the setters affecting `details` are
9197 /// mutually exclusive.
9198 ///
9199 /// # Example
9200 /// ```ignore,no_run
9201 /// # use google_cloud_storage::model::intelligence_finding::storage_growth_above_trend::BucketContribution;
9202 /// use google_cloud_rpc::model::Status;
9203 /// let x = BucketContribution::new().set_error(Status::default()/* use setters */);
9204 /// assert!(x.error().is_some());
9205 /// ```
9206 pub fn set_error<
9207 T: std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
9208 >(
9209 mut self,
9210 v: T,
9211 ) -> Self {
9212 self.details = std::option::Option::Some(
9213 crate::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details::Error(
9214 v.into()
9215 )
9216 );
9217 self
9218 }
9219 }
9220
9221 impl wkt::message::Message for BucketContribution {
9222 fn typename() -> &'static str {
9223 "type.googleapis.com/google.storage.control.v2.IntelligenceFinding.StorageGrowthAboveTrend.BucketContribution"
9224 }
9225 }
9226
9227 /// Defines additional types related to [BucketContribution].
9228 pub mod bucket_contribution {
9229 #[allow(unused_imports)]
9230 use super::*;
9231
9232 /// The details of the bucket's contribution towards the
9233 /// `IntelligenceFinding`.
9234 #[derive(Clone, Debug, PartialEq)]
9235 #[non_exhaustive]
9236 pub enum Details {
9237 /// Output only. The error related to accessing the details about the
9238 /// contribution of the bucket.
9239 Error(std::boxed::Box<google_cloud_rpc::model::Status>),
9240 }
9241
9242 impl Details {
9243 /// Initializes the enum to the [Error](Self::Error) branch.
9244 pub fn from_error(
9245 value: impl std::convert::Into<std::boxed::Box<google_cloud_rpc::model::Status>>,
9246 ) -> Self {
9247 Self::Error(value.into())
9248 }
9249 }
9250 }
9251 }
9252
9253 /// The specific details of the `IntelligenceFinding`.
9254 #[derive(Clone, Debug, PartialEq)]
9255 #[non_exhaustive]
9256 pub enum IntelligenceFindingDetails {
9257 /// Output only. `IntelligenceFinding` about a spike in Class A/B operations
9258 /// on Coldline or Archive Cloud Storage objects.
9259 ColdlineAndArchivalStorageOperationsSpike(
9260 std::boxed::Box<
9261 crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike,
9262 >,
9263 ),
9264 /// Output only. `IntelligenceFinding` about a spike in throttled requests
9265 /// (429 errors) within a project.
9266 ThrottledRequestsSpike(
9267 std::boxed::Box<crate::model::intelligence_finding::ThrottledRequestSpike>,
9268 ),
9269 /// Output only. `IntelligenceFinding` about a spike in cross-region egress.
9270 CrossRegionEgressSpike(
9271 std::boxed::Box<crate::model::intelligence_finding::CrossRegionEgressSpike>,
9272 ),
9273 /// Output only. `IntelligenceFinding` about growth in storage above the
9274 /// expected trend.
9275 StorageGrowthAboveTrend(
9276 std::boxed::Box<crate::model::intelligence_finding::StorageGrowthAboveTrend>,
9277 ),
9278 }
9279
9280 impl IntelligenceFindingDetails {
9281 /// Initializes the enum to the [ColdlineAndArchivalStorageOperationsSpike](Self::ColdlineAndArchivalStorageOperationsSpike) branch.
9282 pub fn from_coldline_and_archival_storage_operations_spike(
9283 value: impl std::convert::Into<
9284 std::boxed::Box<
9285 crate::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike,
9286 >,
9287 >,
9288 ) -> Self {
9289 Self::ColdlineAndArchivalStorageOperationsSpike(value.into())
9290 }
9291 /// Initializes the enum to the [ThrottledRequestsSpike](Self::ThrottledRequestsSpike) branch.
9292 pub fn from_throttled_requests_spike(
9293 value: impl std::convert::Into<
9294 std::boxed::Box<crate::model::intelligence_finding::ThrottledRequestSpike>,
9295 >,
9296 ) -> Self {
9297 Self::ThrottledRequestsSpike(value.into())
9298 }
9299 /// Initializes the enum to the [CrossRegionEgressSpike](Self::CrossRegionEgressSpike) branch.
9300 pub fn from_cross_region_egress_spike(
9301 value: impl std::convert::Into<
9302 std::boxed::Box<crate::model::intelligence_finding::CrossRegionEgressSpike>,
9303 >,
9304 ) -> Self {
9305 Self::CrossRegionEgressSpike(value.into())
9306 }
9307 /// Initializes the enum to the [StorageGrowthAboveTrend](Self::StorageGrowthAboveTrend) branch.
9308 pub fn from_storage_growth_above_trend(
9309 value: impl std::convert::Into<
9310 std::boxed::Box<crate::model::intelligence_finding::StorageGrowthAboveTrend>,
9311 >,
9312 ) -> Self {
9313 Self::StorageGrowthAboveTrend(value.into())
9314 }
9315 }
9316}
9317
9318/// An `IntelligenceFindingRevision` represents a specific revision of an
9319/// `IntelligenceFinding` resource.
9320#[derive(Clone, Default, PartialEq)]
9321#[non_exhaustive]
9322pub struct IntelligenceFindingRevision {
9323 /// Output only. The resource name of `IntelligenceFindingRevision`.
9324 /// Format:
9325 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}/revisions/{revision}`
9326 pub name: std::string::String,
9327
9328 /// Output only. The snapshot of the `IntelligenceFinding` at the time the
9329 /// revision was created. This field contains the full finding details as they
9330 /// existed for the revision.
9331 pub snapshot: std::option::Option<crate::model::IntelligenceFinding>,
9332
9333 /// Output only. The timestamp when the revision was created.
9334 pub create_time: std::option::Option<wkt::Timestamp>,
9335
9336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9337}
9338
9339impl IntelligenceFindingRevision {
9340 /// Creates a new default instance.
9341 pub fn new() -> Self {
9342 std::default::Default::default()
9343 }
9344
9345 /// Sets the value of [name][crate::model::IntelligenceFindingRevision::name].
9346 ///
9347 /// # Example
9348 /// ```ignore,no_run
9349 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
9350 /// # let project_id = "project_id";
9351 /// # let location_id = "location_id";
9352 /// # let intelligence_finding_id = "intelligence_finding_id";
9353 /// # let revision_id = "revision_id";
9354 /// let x = IntelligenceFindingRevision::new().set_name(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}/revisions/{revision_id}"));
9355 /// ```
9356 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9357 self.name = v.into();
9358 self
9359 }
9360
9361 /// Sets the value of [snapshot][crate::model::IntelligenceFindingRevision::snapshot].
9362 ///
9363 /// # Example
9364 /// ```ignore,no_run
9365 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
9366 /// use google_cloud_storage::model::IntelligenceFinding;
9367 /// let x = IntelligenceFindingRevision::new().set_snapshot(IntelligenceFinding::default()/* use setters */);
9368 /// ```
9369 pub fn set_snapshot<T>(mut self, v: T) -> Self
9370 where
9371 T: std::convert::Into<crate::model::IntelligenceFinding>,
9372 {
9373 self.snapshot = std::option::Option::Some(v.into());
9374 self
9375 }
9376
9377 /// Sets or clears the value of [snapshot][crate::model::IntelligenceFindingRevision::snapshot].
9378 ///
9379 /// # Example
9380 /// ```ignore,no_run
9381 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
9382 /// use google_cloud_storage::model::IntelligenceFinding;
9383 /// let x = IntelligenceFindingRevision::new().set_or_clear_snapshot(Some(IntelligenceFinding::default()/* use setters */));
9384 /// let x = IntelligenceFindingRevision::new().set_or_clear_snapshot(None::<IntelligenceFinding>);
9385 /// ```
9386 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9387 where
9388 T: std::convert::Into<crate::model::IntelligenceFinding>,
9389 {
9390 self.snapshot = v.map(|x| x.into());
9391 self
9392 }
9393
9394 /// Sets the value of [create_time][crate::model::IntelligenceFindingRevision::create_time].
9395 ///
9396 /// # Example
9397 /// ```ignore,no_run
9398 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
9399 /// use wkt::Timestamp;
9400 /// let x = IntelligenceFindingRevision::new().set_create_time(Timestamp::default()/* use setters */);
9401 /// ```
9402 pub fn set_create_time<T>(mut self, v: T) -> Self
9403 where
9404 T: std::convert::Into<wkt::Timestamp>,
9405 {
9406 self.create_time = std::option::Option::Some(v.into());
9407 self
9408 }
9409
9410 /// Sets or clears the value of [create_time][crate::model::IntelligenceFindingRevision::create_time].
9411 ///
9412 /// # Example
9413 /// ```ignore,no_run
9414 /// # use google_cloud_storage::model::IntelligenceFindingRevision;
9415 /// use wkt::Timestamp;
9416 /// let x = IntelligenceFindingRevision::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9417 /// let x = IntelligenceFindingRevision::new().set_or_clear_create_time(None::<Timestamp>);
9418 /// ```
9419 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9420 where
9421 T: std::convert::Into<wkt::Timestamp>,
9422 {
9423 self.create_time = v.map(|x| x.into());
9424 self
9425 }
9426}
9427
9428impl wkt::message::Message for IntelligenceFindingRevision {
9429 fn typename() -> &'static str {
9430 "type.googleapis.com/google.storage.control.v2.IntelligenceFindingRevision"
9431 }
9432}
9433
9434/// Request message to get the `IntelligenceFinding` resource associated with a
9435/// project.
9436#[derive(Clone, Default, PartialEq)]
9437#[non_exhaustive]
9438pub struct GetIntelligenceFindingRequest {
9439 /// Required. The name of the `IntelligenceFinding` resource.
9440 ///
9441 /// Format:
9442 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
9443 pub name: std::string::String,
9444
9445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9446}
9447
9448impl GetIntelligenceFindingRequest {
9449 /// Creates a new default instance.
9450 pub fn new() -> Self {
9451 std::default::Default::default()
9452 }
9453
9454 /// Sets the value of [name][crate::model::GetIntelligenceFindingRequest::name].
9455 ///
9456 /// # Example
9457 /// ```ignore,no_run
9458 /// # use google_cloud_storage::model::GetIntelligenceFindingRequest;
9459 /// # let project_id = "project_id";
9460 /// # let location_id = "location_id";
9461 /// # let intelligence_finding_id = "intelligence_finding_id";
9462 /// let x = GetIntelligenceFindingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}"));
9463 /// ```
9464 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9465 self.name = v.into();
9466 self
9467 }
9468}
9469
9470impl wkt::message::Message for GetIntelligenceFindingRequest {
9471 fn typename() -> &'static str {
9472 "type.googleapis.com/google.storage.control.v2.GetIntelligenceFindingRequest"
9473 }
9474}
9475
9476/// Request message to list `IntelligenceFinding` resources associated with
9477/// a project.
9478#[derive(Clone, Default, PartialEq)]
9479#[non_exhaustive]
9480pub struct ListIntelligenceFindingsRequest {
9481 /// Required. The parent of the `IntelligenceFinding` resource.
9482 ///
9483 /// Format: `projects/{project}/locations/{location}`
9484 pub parent: std::string::String,
9485
9486 /// Optional. The filter expression to be applied.
9487 /// Supports filtering by `type` and `associated_resources`.
9488 pub filter: std::string::String,
9489
9490 /// Optional. The maximum number of `IntelligenceFinding` resources to return.
9491 ///
9492 /// The maximum value is `100`; values above `100` will be coerced to `100`.
9493 /// The default value is `100`.
9494 pub page_size: i32,
9495
9496 /// Optional. A page token, received from a previous `ListIntelligenceFindings`
9497 /// call. Provide this to retrieve the subsequent page.
9498 ///
9499 /// When paginating, all other parameters provided to
9500 /// `ListIntelligenceFindings` must match the call that provided the page
9501 /// token.
9502 pub page_token: std::string::String,
9503
9504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9505}
9506
9507impl ListIntelligenceFindingsRequest {
9508 /// Creates a new default instance.
9509 pub fn new() -> Self {
9510 std::default::Default::default()
9511 }
9512
9513 /// Sets the value of [parent][crate::model::ListIntelligenceFindingsRequest::parent].
9514 ///
9515 /// # Example
9516 /// ```ignore,no_run
9517 /// # use google_cloud_storage::model::ListIntelligenceFindingsRequest;
9518 /// # let project_id = "project_id";
9519 /// # let location_id = "location_id";
9520 /// let x = ListIntelligenceFindingsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
9521 /// ```
9522 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9523 self.parent = v.into();
9524 self
9525 }
9526
9527 /// Sets the value of [filter][crate::model::ListIntelligenceFindingsRequest::filter].
9528 ///
9529 /// # Example
9530 /// ```ignore,no_run
9531 /// # use google_cloud_storage::model::ListIntelligenceFindingsRequest;
9532 /// let x = ListIntelligenceFindingsRequest::new().set_filter("example");
9533 /// ```
9534 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9535 self.filter = v.into();
9536 self
9537 }
9538
9539 /// Sets the value of [page_size][crate::model::ListIntelligenceFindingsRequest::page_size].
9540 ///
9541 /// # Example
9542 /// ```ignore,no_run
9543 /// # use google_cloud_storage::model::ListIntelligenceFindingsRequest;
9544 /// let x = ListIntelligenceFindingsRequest::new().set_page_size(42);
9545 /// ```
9546 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9547 self.page_size = v.into();
9548 self
9549 }
9550
9551 /// Sets the value of [page_token][crate::model::ListIntelligenceFindingsRequest::page_token].
9552 ///
9553 /// # Example
9554 /// ```ignore,no_run
9555 /// # use google_cloud_storage::model::ListIntelligenceFindingsRequest;
9556 /// let x = ListIntelligenceFindingsRequest::new().set_page_token("example");
9557 /// ```
9558 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9559 self.page_token = v.into();
9560 self
9561 }
9562}
9563
9564impl wkt::message::Message for ListIntelligenceFindingsRequest {
9565 fn typename() -> &'static str {
9566 "type.googleapis.com/google.storage.control.v2.ListIntelligenceFindingsRequest"
9567 }
9568}
9569
9570/// Response message to list the `IntelligenceFinding` resources associated with
9571/// a project.
9572#[derive(Clone, Default, PartialEq)]
9573#[non_exhaustive]
9574pub struct ListIntelligenceFindingsResponse {
9575 /// The `IntelligenceFinding` resources from the specified project.
9576 pub intelligence_findings: std::vec::Vec<crate::model::IntelligenceFinding>,
9577
9578 /// A token to retrieve the next page of results.
9579 /// Pass this value in the `page_token` field in the subsequent call.
9580 pub next_page_token: std::string::String,
9581
9582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9583}
9584
9585impl ListIntelligenceFindingsResponse {
9586 /// Creates a new default instance.
9587 pub fn new() -> Self {
9588 std::default::Default::default()
9589 }
9590
9591 /// Sets the value of [intelligence_findings][crate::model::ListIntelligenceFindingsResponse::intelligence_findings].
9592 ///
9593 /// # Example
9594 /// ```ignore,no_run
9595 /// # use google_cloud_storage::model::ListIntelligenceFindingsResponse;
9596 /// use google_cloud_storage::model::IntelligenceFinding;
9597 /// let x = ListIntelligenceFindingsResponse::new()
9598 /// .set_intelligence_findings([
9599 /// IntelligenceFinding::default()/* use setters */,
9600 /// IntelligenceFinding::default()/* use (different) setters */,
9601 /// ]);
9602 /// ```
9603 pub fn set_intelligence_findings<T, V>(mut self, v: T) -> Self
9604 where
9605 T: std::iter::IntoIterator<Item = V>,
9606 V: std::convert::Into<crate::model::IntelligenceFinding>,
9607 {
9608 use std::iter::Iterator;
9609 self.intelligence_findings = v.into_iter().map(|i| i.into()).collect();
9610 self
9611 }
9612
9613 /// Sets the value of [next_page_token][crate::model::ListIntelligenceFindingsResponse::next_page_token].
9614 ///
9615 /// # Example
9616 /// ```ignore,no_run
9617 /// # use google_cloud_storage::model::ListIntelligenceFindingsResponse;
9618 /// let x = ListIntelligenceFindingsResponse::new().set_next_page_token("example");
9619 /// ```
9620 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9621 self.next_page_token = v.into();
9622 self
9623 }
9624}
9625
9626impl wkt::message::Message for ListIntelligenceFindingsResponse {
9627 fn typename() -> &'static str {
9628 "type.googleapis.com/google.storage.control.v2.ListIntelligenceFindingsResponse"
9629 }
9630}
9631
9632#[doc(hidden)]
9633impl google_cloud_gax::paginator::internal::PageableResponse for ListIntelligenceFindingsResponse {
9634 type PageItem = crate::model::IntelligenceFinding;
9635
9636 fn items(self) -> std::vec::Vec<Self::PageItem> {
9637 self.intelligence_findings
9638 }
9639
9640 fn next_page_token(&self) -> std::string::String {
9641 use std::clone::Clone;
9642 self.next_page_token.clone()
9643 }
9644}
9645
9646/// Request message to summarize the intelligence findings for the specified
9647/// scope (organization, folder or project).
9648#[derive(Clone, Default, PartialEq)]
9649#[non_exhaustive]
9650pub struct SummarizeIntelligenceFindingsRequest {
9651 /// Required. The scope to summarize the findings for.
9652 /// Format:
9653 ///
9654 /// - `organizations/{organization}/locations/{location}`
9655 /// - `folders/{folder}/locations/{location}`
9656 /// - `projects/{project}/locations/{location}`
9657 pub parent: std::string::String,
9658
9659 /// Optional. Determines the granularity of the findings
9660 /// when the `parent` is an organization or folder.
9661 ///
9662 /// - `PARENT` (or not set): A single summary is
9663 /// returned for each insight type, aggregated across the entire `parent`
9664 /// scope.
9665 /// - `PROJECT`: A separate summary is returned for each
9666 /// insight type for every project within the `parent` scope.
9667 ///
9668 /// The only supported values are `PARENT` and `PROJECT`.
9669 /// If no value is specified, the API behaviour defaults to the `PARENT`.
9670 pub resource_scope: crate::model::summarize_intelligence_findings_request::ResourceScope,
9671
9672 /// Optional. The filter expression, following AIP-160.
9673 /// Supports filtering by FindingType.
9674 pub filter: std::string::String,
9675
9676 /// Optional. The maximum number of findings to return.
9677 ///
9678 /// The maximum value is `100`; values above `100` will be coerced to `100`.
9679 /// The default value is `100`.
9680 pub page_size: i32,
9681
9682 /// Optional. A page token, received from a previous
9683 /// `SummarizeIntelligenceFindings` call. Provide this to retrieve the
9684 /// subsequent page.
9685 ///
9686 /// When paginating, all other parameters provided to
9687 /// `SummarizeIntelligenceFindings` must match the call that provided the page
9688 /// token.
9689 pub page_token: std::string::String,
9690
9691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9692}
9693
9694impl SummarizeIntelligenceFindingsRequest {
9695 /// Creates a new default instance.
9696 pub fn new() -> Self {
9697 std::default::Default::default()
9698 }
9699
9700 /// Sets the value of [parent][crate::model::SummarizeIntelligenceFindingsRequest::parent].
9701 ///
9702 /// # Example
9703 /// ```ignore,no_run
9704 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
9705 /// let x = SummarizeIntelligenceFindingsRequest::new().set_parent("example");
9706 /// ```
9707 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9708 self.parent = v.into();
9709 self
9710 }
9711
9712 /// Sets the value of [resource_scope][crate::model::SummarizeIntelligenceFindingsRequest::resource_scope].
9713 ///
9714 /// # Example
9715 /// ```ignore,no_run
9716 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
9717 /// use google_cloud_storage::model::summarize_intelligence_findings_request::ResourceScope;
9718 /// let x0 = SummarizeIntelligenceFindingsRequest::new().set_resource_scope(ResourceScope::Parent);
9719 /// let x1 = SummarizeIntelligenceFindingsRequest::new().set_resource_scope(ResourceScope::Project);
9720 /// ```
9721 pub fn set_resource_scope<
9722 T: std::convert::Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
9723 >(
9724 mut self,
9725 v: T,
9726 ) -> Self {
9727 self.resource_scope = v.into();
9728 self
9729 }
9730
9731 /// Sets the value of [filter][crate::model::SummarizeIntelligenceFindingsRequest::filter].
9732 ///
9733 /// # Example
9734 /// ```ignore,no_run
9735 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
9736 /// let x = SummarizeIntelligenceFindingsRequest::new().set_filter("example");
9737 /// ```
9738 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9739 self.filter = v.into();
9740 self
9741 }
9742
9743 /// Sets the value of [page_size][crate::model::SummarizeIntelligenceFindingsRequest::page_size].
9744 ///
9745 /// # Example
9746 /// ```ignore,no_run
9747 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
9748 /// let x = SummarizeIntelligenceFindingsRequest::new().set_page_size(42);
9749 /// ```
9750 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9751 self.page_size = v.into();
9752 self
9753 }
9754
9755 /// Sets the value of [page_token][crate::model::SummarizeIntelligenceFindingsRequest::page_token].
9756 ///
9757 /// # Example
9758 /// ```ignore,no_run
9759 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsRequest;
9760 /// let x = SummarizeIntelligenceFindingsRequest::new().set_page_token("example");
9761 /// ```
9762 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9763 self.page_token = v.into();
9764 self
9765 }
9766}
9767
9768impl wkt::message::Message for SummarizeIntelligenceFindingsRequest {
9769 fn typename() -> &'static str {
9770 "type.googleapis.com/google.storage.control.v2.SummarizeIntelligenceFindingsRequest"
9771 }
9772}
9773
9774/// Defines additional types related to [SummarizeIntelligenceFindingsRequest].
9775pub mod summarize_intelligence_findings_request {
9776 #[allow(unused_imports)]
9777 use super::*;
9778
9779 /// The list of resource scopes.
9780 ///
9781 /// # Working with unknown values
9782 ///
9783 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9784 /// additional enum variants at any time. Adding new variants is not considered
9785 /// a breaking change. Applications should write their code in anticipation of:
9786 ///
9787 /// - New values appearing in future releases of the client library, **and**
9788 /// - New values received dynamically, without application changes.
9789 ///
9790 /// Please consult the [Working with enums] section in the user guide for some
9791 /// guidelines.
9792 ///
9793 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9794 #[derive(Clone, Debug, PartialEq)]
9795 #[non_exhaustive]
9796 pub enum ResourceScope {
9797 /// The default behavior. Falls back to PARENT behaviour
9798 Unspecified,
9799 /// Summaries are aggregated at the level of the `parent` resource.
9800 Parent,
9801 /// Summaries are broken down by each project within the `parent` scope.
9802 Project,
9803 /// If set, the enum was initialized with an unknown value.
9804 ///
9805 /// Applications can examine the value using [ResourceScope::value] or
9806 /// [ResourceScope::name].
9807 UnknownValue(resource_scope::UnknownValue),
9808 }
9809
9810 #[doc(hidden)]
9811 pub mod resource_scope {
9812 #[allow(unused_imports)]
9813 use super::*;
9814 #[derive(Clone, Debug, PartialEq)]
9815 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9816 }
9817
9818 impl ResourceScope {
9819 /// Gets the enum value.
9820 ///
9821 /// Returns `None` if the enum contains an unknown value deserialized from
9822 /// the string representation of enums.
9823 pub fn value(&self) -> std::option::Option<i32> {
9824 match self {
9825 Self::Unspecified => std::option::Option::Some(0),
9826 Self::Parent => std::option::Option::Some(1),
9827 Self::Project => std::option::Option::Some(2),
9828 Self::UnknownValue(u) => u.0.value(),
9829 }
9830 }
9831
9832 /// Gets the enum value as a string.
9833 ///
9834 /// Returns `None` if the enum contains an unknown value deserialized from
9835 /// the integer representation of enums.
9836 pub fn name(&self) -> std::option::Option<&str> {
9837 match self {
9838 Self::Unspecified => std::option::Option::Some("RESOURCE_SCOPE_UNSPECIFIED"),
9839 Self::Parent => std::option::Option::Some("PARENT"),
9840 Self::Project => std::option::Option::Some("PROJECT"),
9841 Self::UnknownValue(u) => u.0.name(),
9842 }
9843 }
9844 }
9845
9846 impl std::default::Default for ResourceScope {
9847 fn default() -> Self {
9848 use std::convert::From;
9849 Self::from(0)
9850 }
9851 }
9852
9853 impl std::fmt::Display for ResourceScope {
9854 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9855 wkt::internal::display_enum(f, self.name(), self.value())
9856 }
9857 }
9858
9859 impl std::convert::From<i32> for ResourceScope {
9860 fn from(value: i32) -> Self {
9861 match value {
9862 0 => Self::Unspecified,
9863 1 => Self::Parent,
9864 2 => Self::Project,
9865 _ => Self::UnknownValue(resource_scope::UnknownValue(
9866 wkt::internal::UnknownEnumValue::Integer(value),
9867 )),
9868 }
9869 }
9870 }
9871
9872 impl std::convert::From<&str> for ResourceScope {
9873 fn from(value: &str) -> Self {
9874 use std::string::ToString;
9875 match value {
9876 "RESOURCE_SCOPE_UNSPECIFIED" => Self::Unspecified,
9877 "PARENT" => Self::Parent,
9878 "PROJECT" => Self::Project,
9879 _ => Self::UnknownValue(resource_scope::UnknownValue(
9880 wkt::internal::UnknownEnumValue::String(value.to_string()),
9881 )),
9882 }
9883 }
9884 }
9885
9886 impl serde::ser::Serialize for ResourceScope {
9887 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9888 where
9889 S: serde::Serializer,
9890 {
9891 match self {
9892 Self::Unspecified => serializer.serialize_i32(0),
9893 Self::Parent => serializer.serialize_i32(1),
9894 Self::Project => serializer.serialize_i32(2),
9895 Self::UnknownValue(u) => u.0.serialize(serializer),
9896 }
9897 }
9898 }
9899
9900 impl<'de> serde::de::Deserialize<'de> for ResourceScope {
9901 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9902 where
9903 D: serde::Deserializer<'de>,
9904 {
9905 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceScope>::new(
9906 ".google.storage.control.v2.SummarizeIntelligenceFindingsRequest.ResourceScope",
9907 ))
9908 }
9909 }
9910}
9911
9912/// Response message to summarize the intelligence findings for a specified
9913/// scope (organization, folder or project).
9914#[derive(Clone, Default, PartialEq)]
9915#[non_exhaustive]
9916pub struct SummarizeIntelligenceFindingsResponse {
9917 /// The list of `FindingSummary` summaries.
9918 pub finding_summaries: std::vec::Vec<crate::model::FindingSummary>,
9919
9920 /// A token to retrieve the next page of results.
9921 /// Pass this value in the `page_token` field in the subsequent call to
9922 /// `SummarizeIntelligenceFindings` to retrieve the next page of results.
9923 pub next_page_token: std::string::String,
9924
9925 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9926}
9927
9928impl SummarizeIntelligenceFindingsResponse {
9929 /// Creates a new default instance.
9930 pub fn new() -> Self {
9931 std::default::Default::default()
9932 }
9933
9934 /// Sets the value of [finding_summaries][crate::model::SummarizeIntelligenceFindingsResponse::finding_summaries].
9935 ///
9936 /// # Example
9937 /// ```ignore,no_run
9938 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsResponse;
9939 /// use google_cloud_storage::model::FindingSummary;
9940 /// let x = SummarizeIntelligenceFindingsResponse::new()
9941 /// .set_finding_summaries([
9942 /// FindingSummary::default()/* use setters */,
9943 /// FindingSummary::default()/* use (different) setters */,
9944 /// ]);
9945 /// ```
9946 pub fn set_finding_summaries<T, V>(mut self, v: T) -> Self
9947 where
9948 T: std::iter::IntoIterator<Item = V>,
9949 V: std::convert::Into<crate::model::FindingSummary>,
9950 {
9951 use std::iter::Iterator;
9952 self.finding_summaries = v.into_iter().map(|i| i.into()).collect();
9953 self
9954 }
9955
9956 /// Sets the value of [next_page_token][crate::model::SummarizeIntelligenceFindingsResponse::next_page_token].
9957 ///
9958 /// # Example
9959 /// ```ignore,no_run
9960 /// # use google_cloud_storage::model::SummarizeIntelligenceFindingsResponse;
9961 /// let x = SummarizeIntelligenceFindingsResponse::new().set_next_page_token("example");
9962 /// ```
9963 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9964 self.next_page_token = v.into();
9965 self
9966 }
9967}
9968
9969impl wkt::message::Message for SummarizeIntelligenceFindingsResponse {
9970 fn typename() -> &'static str {
9971 "type.googleapis.com/google.storage.control.v2.SummarizeIntelligenceFindingsResponse"
9972 }
9973}
9974
9975#[doc(hidden)]
9976impl google_cloud_gax::paginator::internal::PageableResponse
9977 for SummarizeIntelligenceFindingsResponse
9978{
9979 type PageItem = crate::model::FindingSummary;
9980
9981 fn items(self) -> std::vec::Vec<Self::PageItem> {
9982 self.finding_summaries
9983 }
9984
9985 fn next_page_token(&self) -> std::string::String {
9986 use std::clone::Clone;
9987 self.next_page_token.clone()
9988 }
9989}
9990
9991/// Request message to get the `IntelligenceFindingRevision` resource associated
9992/// with a project.
9993#[derive(Clone, Default, PartialEq)]
9994#[non_exhaustive]
9995pub struct GetIntelligenceFindingRevisionRequest {
9996 /// Required. The name of the `IntelligenceFindingRevision` resource.
9997 ///
9998 /// ## Format:
9999 ///
10000 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}/revisions/{revision}`
10001 pub name: std::string::String,
10002
10003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10004}
10005
10006impl GetIntelligenceFindingRevisionRequest {
10007 /// Creates a new default instance.
10008 pub fn new() -> Self {
10009 std::default::Default::default()
10010 }
10011
10012 /// Sets the value of [name][crate::model::GetIntelligenceFindingRevisionRequest::name].
10013 ///
10014 /// # Example
10015 /// ```ignore,no_run
10016 /// # use google_cloud_storage::model::GetIntelligenceFindingRevisionRequest;
10017 /// # let project_id = "project_id";
10018 /// # let location_id = "location_id";
10019 /// # let intelligence_finding_id = "intelligence_finding_id";
10020 /// # let revision_id = "revision_id";
10021 /// let x = GetIntelligenceFindingRevisionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}/revisions/{revision_id}"));
10022 /// ```
10023 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10024 self.name = v.into();
10025 self
10026 }
10027}
10028
10029impl wkt::message::Message for GetIntelligenceFindingRevisionRequest {
10030 fn typename() -> &'static str {
10031 "type.googleapis.com/google.storage.control.v2.GetIntelligenceFindingRevisionRequest"
10032 }
10033}
10034
10035/// Request message to list `IntelligenceFindingRevision` resources associated
10036/// with a project.
10037#[derive(Clone, Default, PartialEq)]
10038#[non_exhaustive]
10039pub struct ListIntelligenceFindingRevisionsRequest {
10040 /// Required. The parent of the `IntelligenceFindingRevision` resource.
10041 ///
10042 /// ## Format:
10043 ///
10044 /// `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
10045 pub parent: std::string::String,
10046
10047 /// Optional. The maximum number of `IntelligenceFindingRevision` resources to
10048 /// return.
10049 ///
10050 /// The maximum value is `100`; values above `100` will be coerced to `100`.
10051 /// The default value is `100`.
10052 pub page_size: i32,
10053
10054 /// Optional. A page token, received from a previous
10055 /// `ListIntelligenceFindingRevisions` call. Provide this to retrieve the
10056 /// subsequent page.
10057 pub page_token: std::string::String,
10058
10059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10060}
10061
10062impl ListIntelligenceFindingRevisionsRequest {
10063 /// Creates a new default instance.
10064 pub fn new() -> Self {
10065 std::default::Default::default()
10066 }
10067
10068 /// Sets the value of [parent][crate::model::ListIntelligenceFindingRevisionsRequest::parent].
10069 ///
10070 /// # Example
10071 /// ```ignore,no_run
10072 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsRequest;
10073 /// # let project_id = "project_id";
10074 /// # let location_id = "location_id";
10075 /// # let intelligence_finding_id = "intelligence_finding_id";
10076 /// let x = ListIntelligenceFindingRevisionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/intelligenceFindings/{intelligence_finding_id}"));
10077 /// ```
10078 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10079 self.parent = v.into();
10080 self
10081 }
10082
10083 /// Sets the value of [page_size][crate::model::ListIntelligenceFindingRevisionsRequest::page_size].
10084 ///
10085 /// # Example
10086 /// ```ignore,no_run
10087 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsRequest;
10088 /// let x = ListIntelligenceFindingRevisionsRequest::new().set_page_size(42);
10089 /// ```
10090 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10091 self.page_size = v.into();
10092 self
10093 }
10094
10095 /// Sets the value of [page_token][crate::model::ListIntelligenceFindingRevisionsRequest::page_token].
10096 ///
10097 /// # Example
10098 /// ```ignore,no_run
10099 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsRequest;
10100 /// let x = ListIntelligenceFindingRevisionsRequest::new().set_page_token("example");
10101 /// ```
10102 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10103 self.page_token = v.into();
10104 self
10105 }
10106}
10107
10108impl wkt::message::Message for ListIntelligenceFindingRevisionsRequest {
10109 fn typename() -> &'static str {
10110 "type.googleapis.com/google.storage.control.v2.ListIntelligenceFindingRevisionsRequest"
10111 }
10112}
10113
10114/// Response message to list `IntelligenceFindingRevision` resources associated
10115/// with a project.
10116#[derive(Clone, Default, PartialEq)]
10117#[non_exhaustive]
10118pub struct ListIntelligenceFindingRevisionsResponse {
10119 /// The `IntelligenceFindingRevision` resources from the specified project.
10120 pub intelligence_finding_revisions: std::vec::Vec<crate::model::IntelligenceFindingRevision>,
10121
10122 /// A token that can be sent as `page_token` to retrieve the next page.
10123 pub next_page_token: std::string::String,
10124
10125 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10126}
10127
10128impl ListIntelligenceFindingRevisionsResponse {
10129 /// Creates a new default instance.
10130 pub fn new() -> Self {
10131 std::default::Default::default()
10132 }
10133
10134 /// Sets the value of [intelligence_finding_revisions][crate::model::ListIntelligenceFindingRevisionsResponse::intelligence_finding_revisions].
10135 ///
10136 /// # Example
10137 /// ```ignore,no_run
10138 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsResponse;
10139 /// use google_cloud_storage::model::IntelligenceFindingRevision;
10140 /// let x = ListIntelligenceFindingRevisionsResponse::new()
10141 /// .set_intelligence_finding_revisions([
10142 /// IntelligenceFindingRevision::default()/* use setters */,
10143 /// IntelligenceFindingRevision::default()/* use (different) setters */,
10144 /// ]);
10145 /// ```
10146 pub fn set_intelligence_finding_revisions<T, V>(mut self, v: T) -> Self
10147 where
10148 T: std::iter::IntoIterator<Item = V>,
10149 V: std::convert::Into<crate::model::IntelligenceFindingRevision>,
10150 {
10151 use std::iter::Iterator;
10152 self.intelligence_finding_revisions = v.into_iter().map(|i| i.into()).collect();
10153 self
10154 }
10155
10156 /// Sets the value of [next_page_token][crate::model::ListIntelligenceFindingRevisionsResponse::next_page_token].
10157 ///
10158 /// # Example
10159 /// ```ignore,no_run
10160 /// # use google_cloud_storage::model::ListIntelligenceFindingRevisionsResponse;
10161 /// let x = ListIntelligenceFindingRevisionsResponse::new().set_next_page_token("example");
10162 /// ```
10163 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10164 self.next_page_token = v.into();
10165 self
10166 }
10167}
10168
10169impl wkt::message::Message for ListIntelligenceFindingRevisionsResponse {
10170 fn typename() -> &'static str {
10171 "type.googleapis.com/google.storage.control.v2.ListIntelligenceFindingRevisionsResponse"
10172 }
10173}
10174
10175#[doc(hidden)]
10176impl google_cloud_gax::paginator::internal::PageableResponse
10177 for ListIntelligenceFindingRevisionsResponse
10178{
10179 type PageItem = crate::model::IntelligenceFindingRevision;
10180
10181 fn items(self) -> std::vec::Vec<Self::PageItem> {
10182 self.intelligence_finding_revisions
10183 }
10184
10185 fn next_page_token(&self) -> std::string::String {
10186 use std::clone::Clone;
10187 self.next_page_token.clone()
10188 }
10189}
10190
10191/// A summary of findings generated for an organization, a folder, or a project.
10192#[derive(Clone, Default, PartialEq)]
10193#[non_exhaustive]
10194pub struct FindingSummary {
10195 /// Output only. The type of the finding.
10196 pub r#type: crate::model::FindingType,
10197
10198 /// Output only. The category of finding.
10199 pub category: crate::model::FindingCategory,
10200
10201 /// Output only. The fully qualified Cloud resource name for which this
10202 /// summary was generated.
10203 /// eg: `//cloudresourcemanager.googleapis.com/projects/p1`
10204 pub target_resource: std::string::String,
10205
10206 /// Output only. The creation time of the earliest finding that this summary is
10207 /// based on.
10208 pub create_time: std::option::Option<wkt::Timestamp>,
10209
10210 /// Output only. The time of the most recent update among all the findings that
10211 /// this summary is based on.
10212 pub update_time: std::option::Option<wkt::Timestamp>,
10213
10214 /// Severity of the finding.
10215 pub severity: crate::model::FindingSeverity,
10216
10217 /// Output only. List of `SummaryDetails`.
10218 pub summary_details: std::vec::Vec<crate::model::finding_summary::SummaryDetails>,
10219
10220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10221}
10222
10223impl FindingSummary {
10224 /// Creates a new default instance.
10225 pub fn new() -> Self {
10226 std::default::Default::default()
10227 }
10228
10229 /// Sets the value of [r#type][crate::model::FindingSummary::type].
10230 ///
10231 /// # Example
10232 /// ```ignore,no_run
10233 /// # use google_cloud_storage::model::FindingSummary;
10234 /// use google_cloud_storage::model::FindingType;
10235 /// let x0 = FindingSummary::new().set_type(FindingType::ColdlineAndArchivalStorageOperationsSpike);
10236 /// let x1 = FindingSummary::new().set_type(FindingType::ThrottledRequestSpike);
10237 /// let x2 = FindingSummary::new().set_type(FindingType::CrossRegionEgressSpike);
10238 /// ```
10239 pub fn set_type<T: std::convert::Into<crate::model::FindingType>>(mut self, v: T) -> Self {
10240 self.r#type = v.into();
10241 self
10242 }
10243
10244 /// Sets the value of [category][crate::model::FindingSummary::category].
10245 ///
10246 /// # Example
10247 /// ```ignore,no_run
10248 /// # use google_cloud_storage::model::FindingSummary;
10249 /// use google_cloud_storage::model::FindingCategory;
10250 /// let x0 = FindingSummary::new().set_category(FindingCategory::DataManagement);
10251 /// let x1 = FindingSummary::new().set_category(FindingCategory::Performance);
10252 /// ```
10253 pub fn set_category<T: std::convert::Into<crate::model::FindingCategory>>(
10254 mut self,
10255 v: T,
10256 ) -> Self {
10257 self.category = v.into();
10258 self
10259 }
10260
10261 /// Sets the value of [target_resource][crate::model::FindingSummary::target_resource].
10262 ///
10263 /// # Example
10264 /// ```ignore,no_run
10265 /// # use google_cloud_storage::model::FindingSummary;
10266 /// let x = FindingSummary::new().set_target_resource("example");
10267 /// ```
10268 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10269 self.target_resource = v.into();
10270 self
10271 }
10272
10273 /// Sets the value of [create_time][crate::model::FindingSummary::create_time].
10274 ///
10275 /// # Example
10276 /// ```ignore,no_run
10277 /// # use google_cloud_storage::model::FindingSummary;
10278 /// use wkt::Timestamp;
10279 /// let x = FindingSummary::new().set_create_time(Timestamp::default()/* use setters */);
10280 /// ```
10281 pub fn set_create_time<T>(mut self, v: T) -> Self
10282 where
10283 T: std::convert::Into<wkt::Timestamp>,
10284 {
10285 self.create_time = std::option::Option::Some(v.into());
10286 self
10287 }
10288
10289 /// Sets or clears the value of [create_time][crate::model::FindingSummary::create_time].
10290 ///
10291 /// # Example
10292 /// ```ignore,no_run
10293 /// # use google_cloud_storage::model::FindingSummary;
10294 /// use wkt::Timestamp;
10295 /// let x = FindingSummary::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10296 /// let x = FindingSummary::new().set_or_clear_create_time(None::<Timestamp>);
10297 /// ```
10298 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10299 where
10300 T: std::convert::Into<wkt::Timestamp>,
10301 {
10302 self.create_time = v.map(|x| x.into());
10303 self
10304 }
10305
10306 /// Sets the value of [update_time][crate::model::FindingSummary::update_time].
10307 ///
10308 /// # Example
10309 /// ```ignore,no_run
10310 /// # use google_cloud_storage::model::FindingSummary;
10311 /// use wkt::Timestamp;
10312 /// let x = FindingSummary::new().set_update_time(Timestamp::default()/* use setters */);
10313 /// ```
10314 pub fn set_update_time<T>(mut self, v: T) -> Self
10315 where
10316 T: std::convert::Into<wkt::Timestamp>,
10317 {
10318 self.update_time = std::option::Option::Some(v.into());
10319 self
10320 }
10321
10322 /// Sets or clears the value of [update_time][crate::model::FindingSummary::update_time].
10323 ///
10324 /// # Example
10325 /// ```ignore,no_run
10326 /// # use google_cloud_storage::model::FindingSummary;
10327 /// use wkt::Timestamp;
10328 /// let x = FindingSummary::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10329 /// let x = FindingSummary::new().set_or_clear_update_time(None::<Timestamp>);
10330 /// ```
10331 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10332 where
10333 T: std::convert::Into<wkt::Timestamp>,
10334 {
10335 self.update_time = v.map(|x| x.into());
10336 self
10337 }
10338
10339 /// Sets the value of [severity][crate::model::FindingSummary::severity].
10340 ///
10341 /// # Example
10342 /// ```ignore,no_run
10343 /// # use google_cloud_storage::model::FindingSummary;
10344 /// use google_cloud_storage::model::FindingSeverity;
10345 /// let x0 = FindingSummary::new().set_severity(FindingSeverity::Critical);
10346 /// ```
10347 pub fn set_severity<T: std::convert::Into<crate::model::FindingSeverity>>(
10348 mut self,
10349 v: T,
10350 ) -> Self {
10351 self.severity = v.into();
10352 self
10353 }
10354
10355 /// Sets the value of [summary_details][crate::model::FindingSummary::summary_details].
10356 ///
10357 /// # Example
10358 /// ```ignore,no_run
10359 /// # use google_cloud_storage::model::FindingSummary;
10360 /// use google_cloud_storage::model::finding_summary::SummaryDetails;
10361 /// let x = FindingSummary::new()
10362 /// .set_summary_details([
10363 /// SummaryDetails::default()/* use setters */,
10364 /// SummaryDetails::default()/* use (different) setters */,
10365 /// ]);
10366 /// ```
10367 pub fn set_summary_details<T, V>(mut self, v: T) -> Self
10368 where
10369 T: std::iter::IntoIterator<Item = V>,
10370 V: std::convert::Into<crate::model::finding_summary::SummaryDetails>,
10371 {
10372 use std::iter::Iterator;
10373 self.summary_details = v.into_iter().map(|i| i.into()).collect();
10374 self
10375 }
10376}
10377
10378impl wkt::message::Message for FindingSummary {
10379 fn typename() -> &'static str {
10380 "type.googleapis.com/google.storage.control.v2.FindingSummary"
10381 }
10382}
10383
10384/// Defines additional types related to [FindingSummary].
10385pub mod finding_summary {
10386 #[allow(unused_imports)]
10387 use super::*;
10388
10389 /// Details about the `FindingSummary` resource.
10390 #[derive(Clone, Default, PartialEq)]
10391 #[non_exhaustive]
10392 pub struct SummaryDetails {
10393 /// Output only. The type of Cloud resource this summary detail applies to.
10394 pub resource_type: crate::model::finding_summary::summary_details::ResourceType,
10395
10396 /// Output only. A short description about the FindingSummary
10397 pub description: std::string::String,
10398
10399 /// The value of the summary.
10400 pub magnitude:
10401 std::option::Option<crate::model::finding_summary::summary_details::Magnitude>,
10402
10403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10404 }
10405
10406 impl SummaryDetails {
10407 /// Creates a new default instance.
10408 pub fn new() -> Self {
10409 std::default::Default::default()
10410 }
10411
10412 /// Sets the value of [resource_type][crate::model::finding_summary::SummaryDetails::resource_type].
10413 ///
10414 /// # Example
10415 /// ```ignore,no_run
10416 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
10417 /// use google_cloud_storage::model::finding_summary::summary_details::ResourceType;
10418 /// let x0 = SummaryDetails::new().set_resource_type(ResourceType::Project);
10419 /// let x1 = SummaryDetails::new().set_resource_type(ResourceType::Bucket);
10420 /// ```
10421 pub fn set_resource_type<
10422 T: std::convert::Into<crate::model::finding_summary::summary_details::ResourceType>,
10423 >(
10424 mut self,
10425 v: T,
10426 ) -> Self {
10427 self.resource_type = v.into();
10428 self
10429 }
10430
10431 /// Sets the value of [description][crate::model::finding_summary::SummaryDetails::description].
10432 ///
10433 /// # Example
10434 /// ```ignore,no_run
10435 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
10436 /// let x = SummaryDetails::new().set_description("example");
10437 /// ```
10438 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10439 self.description = v.into();
10440 self
10441 }
10442
10443 /// Sets the value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude].
10444 ///
10445 /// Note that all the setters affecting `magnitude` are mutually
10446 /// exclusive.
10447 ///
10448 /// # Example
10449 /// ```ignore,no_run
10450 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
10451 /// use google_cloud_storage::model::finding_summary::summary_details::Magnitude;
10452 /// let x = SummaryDetails::new().set_magnitude(Some(Magnitude::Count(42)));
10453 /// ```
10454 pub fn set_magnitude<
10455 T: std::convert::Into<
10456 std::option::Option<crate::model::finding_summary::summary_details::Magnitude>,
10457 >,
10458 >(
10459 mut self,
10460 v: T,
10461 ) -> Self {
10462 self.magnitude = v.into();
10463 self
10464 }
10465
10466 /// The value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude]
10467 /// if it holds a `Count`, `None` if the field is not set or
10468 /// holds a different branch.
10469 pub fn count(&self) -> std::option::Option<&i64> {
10470 #[allow(unreachable_patterns)]
10471 self.magnitude.as_ref().and_then(|v| match v {
10472 crate::model::finding_summary::summary_details::Magnitude::Count(v) => {
10473 std::option::Option::Some(v)
10474 }
10475 _ => std::option::Option::None,
10476 })
10477 }
10478
10479 /// Sets the value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude]
10480 /// to hold a `Count`.
10481 ///
10482 /// Note that all the setters affecting `magnitude` are
10483 /// mutually exclusive.
10484 ///
10485 /// # Example
10486 /// ```ignore,no_run
10487 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
10488 /// let x = SummaryDetails::new().set_count(42);
10489 /// assert!(x.count().is_some());
10490 /// assert!(x.percentage().is_none());
10491 /// ```
10492 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10493 self.magnitude = std::option::Option::Some(
10494 crate::model::finding_summary::summary_details::Magnitude::Count(v.into()),
10495 );
10496 self
10497 }
10498
10499 /// The value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude]
10500 /// if it holds a `Percentage`, `None` if the field is not set or
10501 /// holds a different branch.
10502 pub fn percentage(&self) -> std::option::Option<&f32> {
10503 #[allow(unreachable_patterns)]
10504 self.magnitude.as_ref().and_then(|v| match v {
10505 crate::model::finding_summary::summary_details::Magnitude::Percentage(v) => {
10506 std::option::Option::Some(v)
10507 }
10508 _ => std::option::Option::None,
10509 })
10510 }
10511
10512 /// Sets the value of [magnitude][crate::model::finding_summary::SummaryDetails::magnitude]
10513 /// to hold a `Percentage`.
10514 ///
10515 /// Note that all the setters affecting `magnitude` are
10516 /// mutually exclusive.
10517 ///
10518 /// # Example
10519 /// ```ignore,no_run
10520 /// # use google_cloud_storage::model::finding_summary::SummaryDetails;
10521 /// let x = SummaryDetails::new().set_percentage(42.0);
10522 /// assert!(x.percentage().is_some());
10523 /// assert!(x.count().is_none());
10524 /// ```
10525 pub fn set_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
10526 self.magnitude = std::option::Option::Some(
10527 crate::model::finding_summary::summary_details::Magnitude::Percentage(v.into()),
10528 );
10529 self
10530 }
10531 }
10532
10533 impl wkt::message::Message for SummaryDetails {
10534 fn typename() -> &'static str {
10535 "type.googleapis.com/google.storage.control.v2.FindingSummary.SummaryDetails"
10536 }
10537 }
10538
10539 /// Defines additional types related to [SummaryDetails].
10540 pub mod summary_details {
10541 #[allow(unused_imports)]
10542 use super::*;
10543
10544 /// The list of resource types.
10545 ///
10546 /// # Working with unknown values
10547 ///
10548 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10549 /// additional enum variants at any time. Adding new variants is not considered
10550 /// a breaking change. Applications should write their code in anticipation of:
10551 ///
10552 /// - New values appearing in future releases of the client library, **and**
10553 /// - New values received dynamically, without application changes.
10554 ///
10555 /// Please consult the [Working with enums] section in the user guide for some
10556 /// guidelines.
10557 ///
10558 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10559 #[derive(Clone, Debug, PartialEq)]
10560 #[non_exhaustive]
10561 pub enum ResourceType {
10562 /// Resource type is unspecified.
10563 Unspecified,
10564 /// Resource type is project.
10565 Project,
10566 /// Resource type is bucket.
10567 Bucket,
10568 /// If set, the enum was initialized with an unknown value.
10569 ///
10570 /// Applications can examine the value using [ResourceType::value] or
10571 /// [ResourceType::name].
10572 UnknownValue(resource_type::UnknownValue),
10573 }
10574
10575 #[doc(hidden)]
10576 pub mod resource_type {
10577 #[allow(unused_imports)]
10578 use super::*;
10579 #[derive(Clone, Debug, PartialEq)]
10580 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10581 }
10582
10583 impl ResourceType {
10584 /// Gets the enum value.
10585 ///
10586 /// Returns `None` if the enum contains an unknown value deserialized from
10587 /// the string representation of enums.
10588 pub fn value(&self) -> std::option::Option<i32> {
10589 match self {
10590 Self::Unspecified => std::option::Option::Some(0),
10591 Self::Project => std::option::Option::Some(1),
10592 Self::Bucket => std::option::Option::Some(2),
10593 Self::UnknownValue(u) => u.0.value(),
10594 }
10595 }
10596
10597 /// Gets the enum value as a string.
10598 ///
10599 /// Returns `None` if the enum contains an unknown value deserialized from
10600 /// the integer representation of enums.
10601 pub fn name(&self) -> std::option::Option<&str> {
10602 match self {
10603 Self::Unspecified => std::option::Option::Some("RESOURCE_TYPE_UNSPECIFIED"),
10604 Self::Project => std::option::Option::Some("PROJECT"),
10605 Self::Bucket => std::option::Option::Some("BUCKET"),
10606 Self::UnknownValue(u) => u.0.name(),
10607 }
10608 }
10609 }
10610
10611 impl std::default::Default for ResourceType {
10612 fn default() -> Self {
10613 use std::convert::From;
10614 Self::from(0)
10615 }
10616 }
10617
10618 impl std::fmt::Display for ResourceType {
10619 fn fmt(
10620 &self,
10621 f: &mut std::fmt::Formatter<'_>,
10622 ) -> std::result::Result<(), std::fmt::Error> {
10623 wkt::internal::display_enum(f, self.name(), self.value())
10624 }
10625 }
10626
10627 impl std::convert::From<i32> for ResourceType {
10628 fn from(value: i32) -> Self {
10629 match value {
10630 0 => Self::Unspecified,
10631 1 => Self::Project,
10632 2 => Self::Bucket,
10633 _ => Self::UnknownValue(resource_type::UnknownValue(
10634 wkt::internal::UnknownEnumValue::Integer(value),
10635 )),
10636 }
10637 }
10638 }
10639
10640 impl std::convert::From<&str> for ResourceType {
10641 fn from(value: &str) -> Self {
10642 use std::string::ToString;
10643 match value {
10644 "RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
10645 "PROJECT" => Self::Project,
10646 "BUCKET" => Self::Bucket,
10647 _ => Self::UnknownValue(resource_type::UnknownValue(
10648 wkt::internal::UnknownEnumValue::String(value.to_string()),
10649 )),
10650 }
10651 }
10652 }
10653
10654 impl serde::ser::Serialize for ResourceType {
10655 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10656 where
10657 S: serde::Serializer,
10658 {
10659 match self {
10660 Self::Unspecified => serializer.serialize_i32(0),
10661 Self::Project => serializer.serialize_i32(1),
10662 Self::Bucket => serializer.serialize_i32(2),
10663 Self::UnknownValue(u) => u.0.serialize(serializer),
10664 }
10665 }
10666 }
10667
10668 impl<'de> serde::de::Deserialize<'de> for ResourceType {
10669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10670 where
10671 D: serde::Deserializer<'de>,
10672 {
10673 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceType>::new(
10674 ".google.storage.control.v2.FindingSummary.SummaryDetails.ResourceType",
10675 ))
10676 }
10677 }
10678
10679 /// The value of the summary.
10680 #[derive(Clone, Debug, PartialEq)]
10681 #[non_exhaustive]
10682 pub enum Magnitude {
10683 /// The count of impacted resources.
10684 Count(i64),
10685 /// The percentage of impacted resources.
10686 Percentage(f32),
10687 }
10688
10689 impl Magnitude {
10690 /// Initializes the enum to the [Count](Self::Count) branch.
10691 pub fn from_count(value: impl std::convert::Into<i64>) -> Self {
10692 Self::Count(value.into())
10693 }
10694 /// Initializes the enum to the [Percentage](Self::Percentage) branch.
10695 pub fn from_percentage(value: impl std::convert::Into<f32>) -> Self {
10696 Self::Percentage(value.into())
10697 }
10698 }
10699 }
10700}
10701
10702/// A full representation of an object context.
10703#[derive(Clone, Default, PartialEq)]
10704#[non_exhaustive]
10705pub struct ObjectFullContext {
10706 /// The type of the object context.
10707 pub r#type: crate::model::object_full_context::Type,
10708
10709 /// The key of the object context, which is unique among contexts of an object.
10710 pub key: std::string::String,
10711
10712 /// The value of the object context.
10713 pub value: std::string::String,
10714
10715 /// The time at which the object context was created.
10716 pub create_time: std::option::Option<wkt::Timestamp>,
10717
10718 /// The time at which the object context was updated.
10719 pub update_time: std::option::Option<wkt::Timestamp>,
10720
10721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10722}
10723
10724impl ObjectFullContext {
10725 /// Creates a new default instance.
10726 pub fn new() -> Self {
10727 std::default::Default::default()
10728 }
10729
10730 /// Sets the value of [r#type][crate::model::ObjectFullContext::type].
10731 ///
10732 /// # Example
10733 /// ```ignore,no_run
10734 /// # use google_cloud_storage::model::ObjectFullContext;
10735 /// use google_cloud_storage::model::object_full_context::Type;
10736 /// let x0 = ObjectFullContext::new().set_type(Type::Custom);
10737 /// let x1 = ObjectFullContext::new().set_type(Type::Google);
10738 /// ```
10739 pub fn set_type<T: std::convert::Into<crate::model::object_full_context::Type>>(
10740 mut self,
10741 v: T,
10742 ) -> Self {
10743 self.r#type = v.into();
10744 self
10745 }
10746
10747 /// Sets the value of [key][crate::model::ObjectFullContext::key].
10748 ///
10749 /// # Example
10750 /// ```ignore,no_run
10751 /// # use google_cloud_storage::model::ObjectFullContext;
10752 /// let x = ObjectFullContext::new().set_key("example");
10753 /// ```
10754 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10755 self.key = v.into();
10756 self
10757 }
10758
10759 /// Sets the value of [value][crate::model::ObjectFullContext::value].
10760 ///
10761 /// # Example
10762 /// ```ignore,no_run
10763 /// # use google_cloud_storage::model::ObjectFullContext;
10764 /// let x = ObjectFullContext::new().set_value("example");
10765 /// ```
10766 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10767 self.value = v.into();
10768 self
10769 }
10770
10771 /// Sets the value of [create_time][crate::model::ObjectFullContext::create_time].
10772 ///
10773 /// # Example
10774 /// ```ignore,no_run
10775 /// # use google_cloud_storage::model::ObjectFullContext;
10776 /// use wkt::Timestamp;
10777 /// let x = ObjectFullContext::new().set_create_time(Timestamp::default()/* use setters */);
10778 /// ```
10779 pub fn set_create_time<T>(mut self, v: T) -> Self
10780 where
10781 T: std::convert::Into<wkt::Timestamp>,
10782 {
10783 self.create_time = std::option::Option::Some(v.into());
10784 self
10785 }
10786
10787 /// Sets or clears the value of [create_time][crate::model::ObjectFullContext::create_time].
10788 ///
10789 /// # Example
10790 /// ```ignore,no_run
10791 /// # use google_cloud_storage::model::ObjectFullContext;
10792 /// use wkt::Timestamp;
10793 /// let x = ObjectFullContext::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10794 /// let x = ObjectFullContext::new().set_or_clear_create_time(None::<Timestamp>);
10795 /// ```
10796 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10797 where
10798 T: std::convert::Into<wkt::Timestamp>,
10799 {
10800 self.create_time = v.map(|x| x.into());
10801 self
10802 }
10803
10804 /// Sets the value of [update_time][crate::model::ObjectFullContext::update_time].
10805 ///
10806 /// # Example
10807 /// ```ignore,no_run
10808 /// # use google_cloud_storage::model::ObjectFullContext;
10809 /// use wkt::Timestamp;
10810 /// let x = ObjectFullContext::new().set_update_time(Timestamp::default()/* use setters */);
10811 /// ```
10812 pub fn set_update_time<T>(mut self, v: T) -> Self
10813 where
10814 T: std::convert::Into<wkt::Timestamp>,
10815 {
10816 self.update_time = std::option::Option::Some(v.into());
10817 self
10818 }
10819
10820 /// Sets or clears the value of [update_time][crate::model::ObjectFullContext::update_time].
10821 ///
10822 /// # Example
10823 /// ```ignore,no_run
10824 /// # use google_cloud_storage::model::ObjectFullContext;
10825 /// use wkt::Timestamp;
10826 /// let x = ObjectFullContext::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10827 /// let x = ObjectFullContext::new().set_or_clear_update_time(None::<Timestamp>);
10828 /// ```
10829 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10830 where
10831 T: std::convert::Into<wkt::Timestamp>,
10832 {
10833 self.update_time = v.map(|x| x.into());
10834 self
10835 }
10836}
10837
10838impl wkt::message::Message for ObjectFullContext {
10839 fn typename() -> &'static str {
10840 "type.googleapis.com/google.storage.control.v2.ObjectFullContext"
10841 }
10842}
10843
10844/// Defines additional types related to [ObjectFullContext].
10845pub mod object_full_context {
10846 #[allow(unused_imports)]
10847 use super::*;
10848
10849 /// Types of object contexts.
10850 ///
10851 /// # Working with unknown values
10852 ///
10853 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10854 /// additional enum variants at any time. Adding new variants is not considered
10855 /// a breaking change. Applications should write their code in anticipation of:
10856 ///
10857 /// - New values appearing in future releases of the client library, **and**
10858 /// - New values received dynamically, without application changes.
10859 ///
10860 /// Please consult the [Working with enums] section in the user guide for some
10861 /// guidelines.
10862 ///
10863 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10864 #[derive(Clone, Debug, PartialEq)]
10865 #[non_exhaustive]
10866 pub enum Type {
10867 /// The type is not specified.
10868 Unspecified,
10869 /// Custom context.
10870 Custom,
10871 /// Google context.
10872 Google,
10873 /// If set, the enum was initialized with an unknown value.
10874 ///
10875 /// Applications can examine the value using [Type::value] or
10876 /// [Type::name].
10877 UnknownValue(r#type::UnknownValue),
10878 }
10879
10880 #[doc(hidden)]
10881 pub mod r#type {
10882 #[allow(unused_imports)]
10883 use super::*;
10884 #[derive(Clone, Debug, PartialEq)]
10885 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10886 }
10887
10888 impl Type {
10889 /// Gets the enum value.
10890 ///
10891 /// Returns `None` if the enum contains an unknown value deserialized from
10892 /// the string representation of enums.
10893 pub fn value(&self) -> std::option::Option<i32> {
10894 match self {
10895 Self::Unspecified => std::option::Option::Some(0),
10896 Self::Custom => std::option::Option::Some(1),
10897 Self::Google => std::option::Option::Some(2),
10898 Self::UnknownValue(u) => u.0.value(),
10899 }
10900 }
10901
10902 /// Gets the enum value as a string.
10903 ///
10904 /// Returns `None` if the enum contains an unknown value deserialized from
10905 /// the integer representation of enums.
10906 pub fn name(&self) -> std::option::Option<&str> {
10907 match self {
10908 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
10909 Self::Custom => std::option::Option::Some("CUSTOM"),
10910 Self::Google => std::option::Option::Some("GOOGLE"),
10911 Self::UnknownValue(u) => u.0.name(),
10912 }
10913 }
10914 }
10915
10916 impl std::default::Default for Type {
10917 fn default() -> Self {
10918 use std::convert::From;
10919 Self::from(0)
10920 }
10921 }
10922
10923 impl std::fmt::Display for Type {
10924 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10925 wkt::internal::display_enum(f, self.name(), self.value())
10926 }
10927 }
10928
10929 impl std::convert::From<i32> for Type {
10930 fn from(value: i32) -> Self {
10931 match value {
10932 0 => Self::Unspecified,
10933 1 => Self::Custom,
10934 2 => Self::Google,
10935 _ => Self::UnknownValue(r#type::UnknownValue(
10936 wkt::internal::UnknownEnumValue::Integer(value),
10937 )),
10938 }
10939 }
10940 }
10941
10942 impl std::convert::From<&str> for Type {
10943 fn from(value: &str) -> Self {
10944 use std::string::ToString;
10945 match value {
10946 "TYPE_UNSPECIFIED" => Self::Unspecified,
10947 "CUSTOM" => Self::Custom,
10948 "GOOGLE" => Self::Google,
10949 _ => Self::UnknownValue(r#type::UnknownValue(
10950 wkt::internal::UnknownEnumValue::String(value.to_string()),
10951 )),
10952 }
10953 }
10954 }
10955
10956 impl serde::ser::Serialize for Type {
10957 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10958 where
10959 S: serde::Serializer,
10960 {
10961 match self {
10962 Self::Unspecified => serializer.serialize_i32(0),
10963 Self::Custom => serializer.serialize_i32(1),
10964 Self::Google => serializer.serialize_i32(2),
10965 Self::UnknownValue(u) => u.0.serialize(serializer),
10966 }
10967 }
10968 }
10969
10970 impl<'de> serde::de::Deserialize<'de> for Type {
10971 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10972 where
10973 D: serde::Deserializer<'de>,
10974 {
10975 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10976 ".google.storage.control.v2.ObjectFullContext.Type",
10977 ))
10978 }
10979 }
10980}
10981
10982/// Request message for ViewObjectFullContext.
10983#[derive(Clone, Default, PartialEq)]
10984#[non_exhaustive]
10985pub struct ViewObjectFullContextRequest {
10986 /// Optional. If present, selects a specific revision of this object (as
10987 /// opposed to the latest version, the default).
10988 pub generation: i64,
10989
10990 /// Required. The key of the object context to retrieve.
10991 pub context_key: std::string::String,
10992
10993 /// Required. The name of the object.
10994 /// Format: `projects/{project}/buckets/{bucket}/objects/{object}`
10995 pub name: std::string::String,
10996
10997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10998}
10999
11000impl ViewObjectFullContextRequest {
11001 /// Creates a new default instance.
11002 pub fn new() -> Self {
11003 std::default::Default::default()
11004 }
11005
11006 /// Sets the value of [generation][crate::model::ViewObjectFullContextRequest::generation].
11007 ///
11008 /// # Example
11009 /// ```ignore,no_run
11010 /// # use google_cloud_storage::model::ViewObjectFullContextRequest;
11011 /// let x = ViewObjectFullContextRequest::new().set_generation(42);
11012 /// ```
11013 pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11014 self.generation = v.into();
11015 self
11016 }
11017
11018 /// Sets the value of [context_key][crate::model::ViewObjectFullContextRequest::context_key].
11019 ///
11020 /// # Example
11021 /// ```ignore,no_run
11022 /// # use google_cloud_storage::model::ViewObjectFullContextRequest;
11023 /// let x = ViewObjectFullContextRequest::new().set_context_key("example");
11024 /// ```
11025 pub fn set_context_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11026 self.context_key = v.into();
11027 self
11028 }
11029
11030 /// Sets the value of [name][crate::model::ViewObjectFullContextRequest::name].
11031 ///
11032 /// # Example
11033 /// ```ignore,no_run
11034 /// # use google_cloud_storage::model::ViewObjectFullContextRequest;
11035 /// let x = ViewObjectFullContextRequest::new().set_name("example");
11036 /// ```
11037 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11038 self.name = v.into();
11039 self
11040 }
11041}
11042
11043impl wkt::message::Message for ViewObjectFullContextRequest {
11044 fn typename() -> &'static str {
11045 "type.googleapis.com/google.storage.control.v2.ViewObjectFullContextRequest"
11046 }
11047}
11048
11049/// List the finding types.
11050///
11051/// # Working with unknown values
11052///
11053/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11054/// additional enum variants at any time. Adding new variants is not considered
11055/// a breaking change. Applications should write their code in anticipation of:
11056///
11057/// - New values appearing in future releases of the client library, **and**
11058/// - New values received dynamically, without application changes.
11059///
11060/// Please consult the [Working with enums] section in the user guide for some
11061/// guidelines.
11062///
11063/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11064#[derive(Clone, Debug, PartialEq)]
11065#[non_exhaustive]
11066pub enum FindingType {
11067 /// Finding type is unspecified.
11068 Unspecified,
11069 /// Finding is about a spike in Class A/B operations on Coldline or Archive
11070 /// Cloud Storage objects.
11071 ColdlineAndArchivalStorageOperationsSpike,
11072 /// Finding is about a spike in throttled requests (429 errors) within a
11073 /// project.
11074 ThrottledRequestSpike,
11075 /// Finding is about a spike in cross region egress in Cloud Storage.
11076 CrossRegionEgressSpike,
11077 /// Finding is about growth in storage above the expected trend.
11078 StorageGrowthAboveTrend,
11079 /// If set, the enum was initialized with an unknown value.
11080 ///
11081 /// Applications can examine the value using [FindingType::value] or
11082 /// [FindingType::name].
11083 UnknownValue(finding_type::UnknownValue),
11084}
11085
11086#[doc(hidden)]
11087pub mod finding_type {
11088 #[allow(unused_imports)]
11089 use super::*;
11090 #[derive(Clone, Debug, PartialEq)]
11091 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11092}
11093
11094impl FindingType {
11095 /// Gets the enum value.
11096 ///
11097 /// Returns `None` if the enum contains an unknown value deserialized from
11098 /// the string representation of enums.
11099 pub fn value(&self) -> std::option::Option<i32> {
11100 match self {
11101 Self::Unspecified => std::option::Option::Some(0),
11102 Self::ColdlineAndArchivalStorageOperationsSpike => std::option::Option::Some(1),
11103 Self::ThrottledRequestSpike => std::option::Option::Some(2),
11104 Self::CrossRegionEgressSpike => std::option::Option::Some(3),
11105 Self::StorageGrowthAboveTrend => std::option::Option::Some(4),
11106 Self::UnknownValue(u) => u.0.value(),
11107 }
11108 }
11109
11110 /// Gets the enum value as a string.
11111 ///
11112 /// Returns `None` if the enum contains an unknown value deserialized from
11113 /// the integer representation of enums.
11114 pub fn name(&self) -> std::option::Option<&str> {
11115 match self {
11116 Self::Unspecified => std::option::Option::Some("FINDING_TYPE_UNSPECIFIED"),
11117 Self::ColdlineAndArchivalStorageOperationsSpike => std::option::Option::Some(
11118 "FINDING_TYPE_COLDLINE_AND_ARCHIVAL_STORAGE_OPERATIONS_SPIKE",
11119 ),
11120 Self::ThrottledRequestSpike => {
11121 std::option::Option::Some("FINDING_TYPE_THROTTLED_REQUEST_SPIKE")
11122 }
11123 Self::CrossRegionEgressSpike => {
11124 std::option::Option::Some("FINDING_TYPE_CROSS_REGION_EGRESS_SPIKE")
11125 }
11126 Self::StorageGrowthAboveTrend => {
11127 std::option::Option::Some("FINDING_TYPE_STORAGE_GROWTH_ABOVE_TREND")
11128 }
11129 Self::UnknownValue(u) => u.0.name(),
11130 }
11131 }
11132}
11133
11134impl std::default::Default for FindingType {
11135 fn default() -> Self {
11136 use std::convert::From;
11137 Self::from(0)
11138 }
11139}
11140
11141impl std::fmt::Display for FindingType {
11142 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11143 wkt::internal::display_enum(f, self.name(), self.value())
11144 }
11145}
11146
11147impl std::convert::From<i32> for FindingType {
11148 fn from(value: i32) -> Self {
11149 match value {
11150 0 => Self::Unspecified,
11151 1 => Self::ColdlineAndArchivalStorageOperationsSpike,
11152 2 => Self::ThrottledRequestSpike,
11153 3 => Self::CrossRegionEgressSpike,
11154 4 => Self::StorageGrowthAboveTrend,
11155 _ => Self::UnknownValue(finding_type::UnknownValue(
11156 wkt::internal::UnknownEnumValue::Integer(value),
11157 )),
11158 }
11159 }
11160}
11161
11162impl std::convert::From<&str> for FindingType {
11163 fn from(value: &str) -> Self {
11164 use std::string::ToString;
11165 match value {
11166 "FINDING_TYPE_UNSPECIFIED" => Self::Unspecified,
11167 "FINDING_TYPE_COLDLINE_AND_ARCHIVAL_STORAGE_OPERATIONS_SPIKE" => {
11168 Self::ColdlineAndArchivalStorageOperationsSpike
11169 }
11170 "FINDING_TYPE_THROTTLED_REQUEST_SPIKE" => Self::ThrottledRequestSpike,
11171 "FINDING_TYPE_CROSS_REGION_EGRESS_SPIKE" => Self::CrossRegionEgressSpike,
11172 "FINDING_TYPE_STORAGE_GROWTH_ABOVE_TREND" => Self::StorageGrowthAboveTrend,
11173 _ => Self::UnknownValue(finding_type::UnknownValue(
11174 wkt::internal::UnknownEnumValue::String(value.to_string()),
11175 )),
11176 }
11177 }
11178}
11179
11180impl serde::ser::Serialize for FindingType {
11181 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11182 where
11183 S: serde::Serializer,
11184 {
11185 match self {
11186 Self::Unspecified => serializer.serialize_i32(0),
11187 Self::ColdlineAndArchivalStorageOperationsSpike => serializer.serialize_i32(1),
11188 Self::ThrottledRequestSpike => serializer.serialize_i32(2),
11189 Self::CrossRegionEgressSpike => serializer.serialize_i32(3),
11190 Self::StorageGrowthAboveTrend => serializer.serialize_i32(4),
11191 Self::UnknownValue(u) => u.0.serialize(serializer),
11192 }
11193 }
11194}
11195
11196impl<'de> serde::de::Deserialize<'de> for FindingType {
11197 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11198 where
11199 D: serde::Deserializer<'de>,
11200 {
11201 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingType>::new(
11202 ".google.storage.control.v2.FindingType",
11203 ))
11204 }
11205}
11206
11207/// List of categories a finding falls under.
11208///
11209/// # Working with unknown values
11210///
11211/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11212/// additional enum variants at any time. Adding new variants is not considered
11213/// a breaking change. Applications should write their code in anticipation of:
11214///
11215/// - New values appearing in future releases of the client library, **and**
11216/// - New values received dynamically, without application changes.
11217///
11218/// Please consult the [Working with enums] section in the user guide for some
11219/// guidelines.
11220///
11221/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11222#[derive(Clone, Debug, PartialEq)]
11223#[non_exhaustive]
11224pub enum FindingCategory {
11225 /// Category is unspecified.
11226 Unspecified,
11227 /// Category is 'Data Management'.
11228 DataManagement,
11229 /// Category is 'Performance'.
11230 Performance,
11231 /// If set, the enum was initialized with an unknown value.
11232 ///
11233 /// Applications can examine the value using [FindingCategory::value] or
11234 /// [FindingCategory::name].
11235 UnknownValue(finding_category::UnknownValue),
11236}
11237
11238#[doc(hidden)]
11239pub mod finding_category {
11240 #[allow(unused_imports)]
11241 use super::*;
11242 #[derive(Clone, Debug, PartialEq)]
11243 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11244}
11245
11246impl FindingCategory {
11247 /// Gets the enum value.
11248 ///
11249 /// Returns `None` if the enum contains an unknown value deserialized from
11250 /// the string representation of enums.
11251 pub fn value(&self) -> std::option::Option<i32> {
11252 match self {
11253 Self::Unspecified => std::option::Option::Some(0),
11254 Self::DataManagement => std::option::Option::Some(1),
11255 Self::Performance => std::option::Option::Some(2),
11256 Self::UnknownValue(u) => u.0.value(),
11257 }
11258 }
11259
11260 /// Gets the enum value as a string.
11261 ///
11262 /// Returns `None` if the enum contains an unknown value deserialized from
11263 /// the integer representation of enums.
11264 pub fn name(&self) -> std::option::Option<&str> {
11265 match self {
11266 Self::Unspecified => std::option::Option::Some("FINDING_CATEGORY_UNSPECIFIED"),
11267 Self::DataManagement => std::option::Option::Some("FINDING_CATEGORY_DATA_MANAGEMENT"),
11268 Self::Performance => std::option::Option::Some("FINDING_CATEGORY_PERFORMANCE"),
11269 Self::UnknownValue(u) => u.0.name(),
11270 }
11271 }
11272}
11273
11274impl std::default::Default for FindingCategory {
11275 fn default() -> Self {
11276 use std::convert::From;
11277 Self::from(0)
11278 }
11279}
11280
11281impl std::fmt::Display for FindingCategory {
11282 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11283 wkt::internal::display_enum(f, self.name(), self.value())
11284 }
11285}
11286
11287impl std::convert::From<i32> for FindingCategory {
11288 fn from(value: i32) -> Self {
11289 match value {
11290 0 => Self::Unspecified,
11291 1 => Self::DataManagement,
11292 2 => Self::Performance,
11293 _ => Self::UnknownValue(finding_category::UnknownValue(
11294 wkt::internal::UnknownEnumValue::Integer(value),
11295 )),
11296 }
11297 }
11298}
11299
11300impl std::convert::From<&str> for FindingCategory {
11301 fn from(value: &str) -> Self {
11302 use std::string::ToString;
11303 match value {
11304 "FINDING_CATEGORY_UNSPECIFIED" => Self::Unspecified,
11305 "FINDING_CATEGORY_DATA_MANAGEMENT" => Self::DataManagement,
11306 "FINDING_CATEGORY_PERFORMANCE" => Self::Performance,
11307 _ => Self::UnknownValue(finding_category::UnknownValue(
11308 wkt::internal::UnknownEnumValue::String(value.to_string()),
11309 )),
11310 }
11311 }
11312}
11313
11314impl serde::ser::Serialize for FindingCategory {
11315 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11316 where
11317 S: serde::Serializer,
11318 {
11319 match self {
11320 Self::Unspecified => serializer.serialize_i32(0),
11321 Self::DataManagement => serializer.serialize_i32(1),
11322 Self::Performance => serializer.serialize_i32(2),
11323 Self::UnknownValue(u) => u.0.serialize(serializer),
11324 }
11325 }
11326}
11327
11328impl<'de> serde::de::Deserialize<'de> for FindingCategory {
11329 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11330 where
11331 D: serde::Deserializer<'de>,
11332 {
11333 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingCategory>::new(
11334 ".google.storage.control.v2.FindingCategory",
11335 ))
11336 }
11337}
11338
11339/// Severity of the `IntelligenceFinding` resource.
11340///
11341/// # Working with unknown values
11342///
11343/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11344/// additional enum variants at any time. Adding new variants is not considered
11345/// a breaking change. Applications should write their code in anticipation of:
11346///
11347/// - New values appearing in future releases of the client library, **and**
11348/// - New values received dynamically, without application changes.
11349///
11350/// Please consult the [Working with enums] section in the user guide for some
11351/// guidelines.
11352///
11353/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11354#[derive(Clone, Debug, PartialEq)]
11355#[non_exhaustive]
11356pub enum FindingSeverity {
11357 /// Severity is unspecified.
11358 Unspecified,
11359 /// Severity is critical.
11360 Critical,
11361 /// If set, the enum was initialized with an unknown value.
11362 ///
11363 /// Applications can examine the value using [FindingSeverity::value] or
11364 /// [FindingSeverity::name].
11365 UnknownValue(finding_severity::UnknownValue),
11366}
11367
11368#[doc(hidden)]
11369pub mod finding_severity {
11370 #[allow(unused_imports)]
11371 use super::*;
11372 #[derive(Clone, Debug, PartialEq)]
11373 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11374}
11375
11376impl FindingSeverity {
11377 /// Gets the enum value.
11378 ///
11379 /// Returns `None` if the enum contains an unknown value deserialized from
11380 /// the string representation of enums.
11381 pub fn value(&self) -> std::option::Option<i32> {
11382 match self {
11383 Self::Unspecified => std::option::Option::Some(0),
11384 Self::Critical => std::option::Option::Some(1),
11385 Self::UnknownValue(u) => u.0.value(),
11386 }
11387 }
11388
11389 /// Gets the enum value as a string.
11390 ///
11391 /// Returns `None` if the enum contains an unknown value deserialized from
11392 /// the integer representation of enums.
11393 pub fn name(&self) -> std::option::Option<&str> {
11394 match self {
11395 Self::Unspecified => std::option::Option::Some("FINDING_SEVERITY_UNSPECIFIED"),
11396 Self::Critical => std::option::Option::Some("FINDING_SEVERITY_CRITICAL"),
11397 Self::UnknownValue(u) => u.0.name(),
11398 }
11399 }
11400}
11401
11402impl std::default::Default for FindingSeverity {
11403 fn default() -> Self {
11404 use std::convert::From;
11405 Self::from(0)
11406 }
11407}
11408
11409impl std::fmt::Display for FindingSeverity {
11410 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11411 wkt::internal::display_enum(f, self.name(), self.value())
11412 }
11413}
11414
11415impl std::convert::From<i32> for FindingSeverity {
11416 fn from(value: i32) -> Self {
11417 match value {
11418 0 => Self::Unspecified,
11419 1 => Self::Critical,
11420 _ => Self::UnknownValue(finding_severity::UnknownValue(
11421 wkt::internal::UnknownEnumValue::Integer(value),
11422 )),
11423 }
11424 }
11425}
11426
11427impl std::convert::From<&str> for FindingSeverity {
11428 fn from(value: &str) -> Self {
11429 use std::string::ToString;
11430 match value {
11431 "FINDING_SEVERITY_UNSPECIFIED" => Self::Unspecified,
11432 "FINDING_SEVERITY_CRITICAL" => Self::Critical,
11433 _ => Self::UnknownValue(finding_severity::UnknownValue(
11434 wkt::internal::UnknownEnumValue::String(value.to_string()),
11435 )),
11436 }
11437 }
11438}
11439
11440impl serde::ser::Serialize for FindingSeverity {
11441 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11442 where
11443 S: serde::Serializer,
11444 {
11445 match self {
11446 Self::Unspecified => serializer.serialize_i32(0),
11447 Self::Critical => serializer.serialize_i32(1),
11448 Self::UnknownValue(u) => u.0.serialize(serializer),
11449 }
11450 }
11451}
11452
11453impl<'de> serde::de::Deserialize<'de> for FindingSeverity {
11454 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11455 where
11456 D: serde::Deserializer<'de>,
11457 {
11458 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingSeverity>::new(
11459 ".google.storage.control.v2.FindingSeverity",
11460 ))
11461 }
11462}