Skip to main content

google_cloud_storage/generated/gapic/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19
20mod debug;
21mod deserialize;
22mod serialize;
23
24/// Request message for [DeleteBucket][google.storage.v2.Storage.DeleteBucket].
25///
26/// [google.storage.v2.Storage.DeleteBucket]: crate::client::StorageControl::delete_bucket
27#[derive(Clone, Default, PartialEq)]
28#[non_exhaustive]
29pub struct DeleteBucketRequest {
30    /// Required. Name of a bucket to delete.
31    pub name: std::string::String,
32
33    /// If set, only deletes the bucket if its metageneration matches this value.
34    pub if_metageneration_match: std::option::Option<i64>,
35
36    /// If set, only deletes the bucket if its metageneration does not match this
37    /// value.
38    pub if_metageneration_not_match: std::option::Option<i64>,
39
40    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
41}
42
43impl DeleteBucketRequest {
44    pub fn new() -> Self {
45        std::default::Default::default()
46    }
47
48    /// Sets the value of [name][crate::model::DeleteBucketRequest::name].
49    ///
50    /// # Example
51    /// ```ignore,no_run
52    /// # use google_cloud_storage::model::DeleteBucketRequest;
53    /// let x = DeleteBucketRequest::new().set_name("example");
54    /// ```
55    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
56        self.name = v.into();
57        self
58    }
59
60    /// Sets the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
61    ///
62    /// # Example
63    /// ```ignore,no_run
64    /// # use google_cloud_storage::model::DeleteBucketRequest;
65    /// let x = DeleteBucketRequest::new().set_if_metageneration_match(42);
66    /// ```
67    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
68    where
69        T: std::convert::Into<i64>,
70    {
71        self.if_metageneration_match = std::option::Option::Some(v.into());
72        self
73    }
74
75    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
76    ///
77    /// # Example
78    /// ```ignore,no_run
79    /// # use google_cloud_storage::model::DeleteBucketRequest;
80    /// let x = DeleteBucketRequest::new().set_or_clear_if_metageneration_match(Some(42));
81    /// let x = DeleteBucketRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
82    /// ```
83    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
84    where
85        T: std::convert::Into<i64>,
86    {
87        self.if_metageneration_match = v.map(|x| x.into());
88        self
89    }
90
91    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
92    ///
93    /// # Example
94    /// ```ignore,no_run
95    /// # use google_cloud_storage::model::DeleteBucketRequest;
96    /// let x = DeleteBucketRequest::new().set_if_metageneration_not_match(42);
97    /// ```
98    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
99    where
100        T: std::convert::Into<i64>,
101    {
102        self.if_metageneration_not_match = std::option::Option::Some(v.into());
103        self
104    }
105
106    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
107    ///
108    /// # Example
109    /// ```ignore,no_run
110    /// # use google_cloud_storage::model::DeleteBucketRequest;
111    /// let x = DeleteBucketRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
112    /// let x = DeleteBucketRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
113    /// ```
114    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
115    where
116        T: std::convert::Into<i64>,
117    {
118        self.if_metageneration_not_match = v.map(|x| x.into());
119        self
120    }
121}
122
123impl wkt::message::Message for DeleteBucketRequest {
124    fn typename() -> &'static str {
125        "type.googleapis.com/google.storage.v2.DeleteBucketRequest"
126    }
127}
128
129/// Request message for [GetBucket][google.storage.v2.Storage.GetBucket].
130///
131/// [google.storage.v2.Storage.GetBucket]: crate::client::StorageControl::get_bucket
132#[derive(Clone, Default, PartialEq)]
133#[non_exhaustive]
134pub struct GetBucketRequest {
135    /// Required. Name of a bucket.
136    pub name: std::string::String,
137
138    /// If set, only gets the bucket metadata if its metageneration matches this
139    /// value.
140    pub if_metageneration_match: std::option::Option<i64>,
141
142    /// If set, and if the bucket's current metageneration matches the specified
143    /// value, the request returns an error.
144    pub if_metageneration_not_match: std::option::Option<i64>,
145
146    /// Mask specifying which fields to read.
147    /// A `*` field might be used to indicate all fields.
148    /// If no mask is specified, it defaults to all fields.
149    pub read_mask: std::option::Option<wkt::FieldMask>,
150
151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
152}
153
154impl GetBucketRequest {
155    pub fn new() -> Self {
156        std::default::Default::default()
157    }
158
159    /// Sets the value of [name][crate::model::GetBucketRequest::name].
160    ///
161    /// # Example
162    /// ```ignore,no_run
163    /// # use google_cloud_storage::model::GetBucketRequest;
164    /// let x = GetBucketRequest::new().set_name("example");
165    /// ```
166    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
167        self.name = v.into();
168        self
169    }
170
171    /// Sets the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
172    ///
173    /// # Example
174    /// ```ignore,no_run
175    /// # use google_cloud_storage::model::GetBucketRequest;
176    /// let x = GetBucketRequest::new().set_if_metageneration_match(42);
177    /// ```
178    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
179    where
180        T: std::convert::Into<i64>,
181    {
182        self.if_metageneration_match = std::option::Option::Some(v.into());
183        self
184    }
185
186    /// Sets or clears the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
187    ///
188    /// # Example
189    /// ```ignore,no_run
190    /// # use google_cloud_storage::model::GetBucketRequest;
191    /// let x = GetBucketRequest::new().set_or_clear_if_metageneration_match(Some(42));
192    /// let x = GetBucketRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
193    /// ```
194    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
195    where
196        T: std::convert::Into<i64>,
197    {
198        self.if_metageneration_match = v.map(|x| x.into());
199        self
200    }
201
202    /// Sets the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
203    ///
204    /// # Example
205    /// ```ignore,no_run
206    /// # use google_cloud_storage::model::GetBucketRequest;
207    /// let x = GetBucketRequest::new().set_if_metageneration_not_match(42);
208    /// ```
209    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
210    where
211        T: std::convert::Into<i64>,
212    {
213        self.if_metageneration_not_match = std::option::Option::Some(v.into());
214        self
215    }
216
217    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
218    ///
219    /// # Example
220    /// ```ignore,no_run
221    /// # use google_cloud_storage::model::GetBucketRequest;
222    /// let x = GetBucketRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
223    /// let x = GetBucketRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
224    /// ```
225    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
226    where
227        T: std::convert::Into<i64>,
228    {
229        self.if_metageneration_not_match = v.map(|x| x.into());
230        self
231    }
232
233    /// Sets the value of [read_mask][crate::model::GetBucketRequest::read_mask].
234    ///
235    /// # Example
236    /// ```ignore,no_run
237    /// # use google_cloud_storage::model::GetBucketRequest;
238    /// use wkt::FieldMask;
239    /// let x = GetBucketRequest::new().set_read_mask(FieldMask::default()/* use setters */);
240    /// ```
241    pub fn set_read_mask<T>(mut self, v: T) -> Self
242    where
243        T: std::convert::Into<wkt::FieldMask>,
244    {
245        self.read_mask = std::option::Option::Some(v.into());
246        self
247    }
248
249    /// Sets or clears the value of [read_mask][crate::model::GetBucketRequest::read_mask].
250    ///
251    /// # Example
252    /// ```ignore,no_run
253    /// # use google_cloud_storage::model::GetBucketRequest;
254    /// use wkt::FieldMask;
255    /// let x = GetBucketRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
256    /// let x = GetBucketRequest::new().set_or_clear_read_mask(None::<FieldMask>);
257    /// ```
258    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
259    where
260        T: std::convert::Into<wkt::FieldMask>,
261    {
262        self.read_mask = v.map(|x| x.into());
263        self
264    }
265}
266
267impl wkt::message::Message for GetBucketRequest {
268    fn typename() -> &'static str {
269        "type.googleapis.com/google.storage.v2.GetBucketRequest"
270    }
271}
272
273/// Request message for [CreateBucket][google.storage.v2.Storage.CreateBucket].
274///
275/// [google.storage.v2.Storage.CreateBucket]: crate::client::StorageControl::create_bucket
276#[derive(Clone, Default, PartialEq)]
277#[non_exhaustive]
278pub struct CreateBucketRequest {
279    /// Required. The project to which this bucket belongs. This field must either
280    /// be empty or `projects/_`. The project ID that owns this bucket should be
281    /// specified in the `bucket.project` field.
282    pub parent: std::string::String,
283
284    /// Optional. Properties of the new bucket being inserted.
285    /// The name of the bucket is specified in the `bucket_id` field. Populating
286    /// `bucket.name` field results in an error.
287    /// The project of the bucket must be specified in the `bucket.project` field.
288    /// This field must be in `projects/{projectIdentifier}` format,
289    /// {projectIdentifier} can be the project ID or project number. The `parent`
290    /// field must be either empty or `projects/_`.
291    pub bucket: std::option::Option<crate::model::Bucket>,
292
293    /// Required. The ID to use for this bucket, which becomes the final component
294    /// of the bucket's resource name. For example, the value `foo` might result in
295    /// a bucket with the name `projects/123456/buckets/foo`.
296    pub bucket_id: std::string::String,
297
298    /// Optional. Apply a predefined set of access controls to this bucket.
299    /// Valid values are `authenticatedRead`, `private`, `projectPrivate`,
300    /// `publicRead`, or `publicReadWrite`.
301    pub predefined_acl: std::string::String,
302
303    /// Optional. Apply a predefined set of default object access controls to this
304    /// bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
305    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
306    pub predefined_default_object_acl: std::string::String,
307
308    /// Optional. If true, enable object retention on the bucket.
309    pub enable_object_retention: bool,
310
311    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
312}
313
314impl CreateBucketRequest {
315    pub fn new() -> Self {
316        std::default::Default::default()
317    }
318
319    /// Sets the value of [parent][crate::model::CreateBucketRequest::parent].
320    ///
321    /// # Example
322    /// ```ignore,no_run
323    /// # use google_cloud_storage::model::CreateBucketRequest;
324    /// let x = CreateBucketRequest::new().set_parent("example");
325    /// ```
326    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
327        self.parent = v.into();
328        self
329    }
330
331    /// Sets the value of [bucket][crate::model::CreateBucketRequest::bucket].
332    ///
333    /// # Example
334    /// ```ignore,no_run
335    /// # use google_cloud_storage::model::CreateBucketRequest;
336    /// use google_cloud_storage::model::Bucket;
337    /// let x = CreateBucketRequest::new().set_bucket(Bucket::default()/* use setters */);
338    /// ```
339    pub fn set_bucket<T>(mut self, v: T) -> Self
340    where
341        T: std::convert::Into<crate::model::Bucket>,
342    {
343        self.bucket = std::option::Option::Some(v.into());
344        self
345    }
346
347    /// Sets or clears the value of [bucket][crate::model::CreateBucketRequest::bucket].
348    ///
349    /// # Example
350    /// ```ignore,no_run
351    /// # use google_cloud_storage::model::CreateBucketRequest;
352    /// use google_cloud_storage::model::Bucket;
353    /// let x = CreateBucketRequest::new().set_or_clear_bucket(Some(Bucket::default()/* use setters */));
354    /// let x = CreateBucketRequest::new().set_or_clear_bucket(None::<Bucket>);
355    /// ```
356    pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
357    where
358        T: std::convert::Into<crate::model::Bucket>,
359    {
360        self.bucket = v.map(|x| x.into());
361        self
362    }
363
364    /// Sets the value of [bucket_id][crate::model::CreateBucketRequest::bucket_id].
365    ///
366    /// # Example
367    /// ```ignore,no_run
368    /// # use google_cloud_storage::model::CreateBucketRequest;
369    /// let x = CreateBucketRequest::new().set_bucket_id("example");
370    /// ```
371    pub fn set_bucket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
372        self.bucket_id = v.into();
373        self
374    }
375
376    /// Sets the value of [predefined_acl][crate::model::CreateBucketRequest::predefined_acl].
377    ///
378    /// # Example
379    /// ```ignore,no_run
380    /// # use google_cloud_storage::model::CreateBucketRequest;
381    /// let x = CreateBucketRequest::new().set_predefined_acl("example");
382    /// ```
383    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
384        self.predefined_acl = v.into();
385        self
386    }
387
388    /// Sets the value of [predefined_default_object_acl][crate::model::CreateBucketRequest::predefined_default_object_acl].
389    ///
390    /// # Example
391    /// ```ignore,no_run
392    /// # use google_cloud_storage::model::CreateBucketRequest;
393    /// let x = CreateBucketRequest::new().set_predefined_default_object_acl("example");
394    /// ```
395    pub fn set_predefined_default_object_acl<T: std::convert::Into<std::string::String>>(
396        mut self,
397        v: T,
398    ) -> Self {
399        self.predefined_default_object_acl = v.into();
400        self
401    }
402
403    /// Sets the value of [enable_object_retention][crate::model::CreateBucketRequest::enable_object_retention].
404    ///
405    /// # Example
406    /// ```ignore,no_run
407    /// # use google_cloud_storage::model::CreateBucketRequest;
408    /// let x = CreateBucketRequest::new().set_enable_object_retention(true);
409    /// ```
410    pub fn set_enable_object_retention<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
411        self.enable_object_retention = v.into();
412        self
413    }
414}
415
416impl wkt::message::Message for CreateBucketRequest {
417    fn typename() -> &'static str {
418        "type.googleapis.com/google.storage.v2.CreateBucketRequest"
419    }
420}
421
422/// Request message for [ListBuckets][google.storage.v2.Storage.ListBuckets].
423///
424/// [google.storage.v2.Storage.ListBuckets]: crate::client::StorageControl::list_buckets
425#[derive(Clone, Default, PartialEq)]
426#[non_exhaustive]
427pub struct ListBucketsRequest {
428    /// Required. The project whose buckets we are listing.
429    pub parent: std::string::String,
430
431    /// Optional. Maximum number of buckets to return in a single response. The
432    /// service uses this parameter or `1,000` items, whichever is smaller. If
433    /// `acl` is present in the `read_mask`, the service uses this parameter of
434    /// `200` items, whichever is smaller.
435    pub page_size: i32,
436
437    /// Optional. A previously-returned page token representing part of the larger
438    /// set of results to view.
439    pub page_token: std::string::String,
440
441    /// Optional. Filter results to buckets whose names begin with this prefix.
442    pub prefix: std::string::String,
443
444    /// Mask specifying which fields to read from each result.
445    /// If no mask is specified, it defaults to all fields except `items.
446    /// owner`, `items.acl`, and `items.default_object_acl`.
447    /// `*` might be used to mean "all fields".
448    pub read_mask: std::option::Option<wkt::FieldMask>,
449
450    /// Optional. Allows listing of buckets, even if there are buckets that are
451    /// unreachable.
452    pub return_partial_success: bool,
453
454    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
455}
456
457impl ListBucketsRequest {
458    pub fn new() -> Self {
459        std::default::Default::default()
460    }
461
462    /// Sets the value of [parent][crate::model::ListBucketsRequest::parent].
463    ///
464    /// # Example
465    /// ```ignore,no_run
466    /// # use google_cloud_storage::model::ListBucketsRequest;
467    /// let x = ListBucketsRequest::new().set_parent("example");
468    /// ```
469    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
470        self.parent = v.into();
471        self
472    }
473
474    /// Sets the value of [page_size][crate::model::ListBucketsRequest::page_size].
475    ///
476    /// # Example
477    /// ```ignore,no_run
478    /// # use google_cloud_storage::model::ListBucketsRequest;
479    /// let x = ListBucketsRequest::new().set_page_size(42);
480    /// ```
481    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
482        self.page_size = v.into();
483        self
484    }
485
486    /// Sets the value of [page_token][crate::model::ListBucketsRequest::page_token].
487    ///
488    /// # Example
489    /// ```ignore,no_run
490    /// # use google_cloud_storage::model::ListBucketsRequest;
491    /// let x = ListBucketsRequest::new().set_page_token("example");
492    /// ```
493    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
494        self.page_token = v.into();
495        self
496    }
497
498    /// Sets the value of [prefix][crate::model::ListBucketsRequest::prefix].
499    ///
500    /// # Example
501    /// ```ignore,no_run
502    /// # use google_cloud_storage::model::ListBucketsRequest;
503    /// let x = ListBucketsRequest::new().set_prefix("example");
504    /// ```
505    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
506        self.prefix = v.into();
507        self
508    }
509
510    /// Sets the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
511    ///
512    /// # Example
513    /// ```ignore,no_run
514    /// # use google_cloud_storage::model::ListBucketsRequest;
515    /// use wkt::FieldMask;
516    /// let x = ListBucketsRequest::new().set_read_mask(FieldMask::default()/* use setters */);
517    /// ```
518    pub fn set_read_mask<T>(mut self, v: T) -> Self
519    where
520        T: std::convert::Into<wkt::FieldMask>,
521    {
522        self.read_mask = std::option::Option::Some(v.into());
523        self
524    }
525
526    /// Sets or clears the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
527    ///
528    /// # Example
529    /// ```ignore,no_run
530    /// # use google_cloud_storage::model::ListBucketsRequest;
531    /// use wkt::FieldMask;
532    /// let x = ListBucketsRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
533    /// let x = ListBucketsRequest::new().set_or_clear_read_mask(None::<FieldMask>);
534    /// ```
535    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
536    where
537        T: std::convert::Into<wkt::FieldMask>,
538    {
539        self.read_mask = v.map(|x| x.into());
540        self
541    }
542
543    /// Sets the value of [return_partial_success][crate::model::ListBucketsRequest::return_partial_success].
544    ///
545    /// # Example
546    /// ```ignore,no_run
547    /// # use google_cloud_storage::model::ListBucketsRequest;
548    /// let x = ListBucketsRequest::new().set_return_partial_success(true);
549    /// ```
550    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
551        self.return_partial_success = v.into();
552        self
553    }
554}
555
556impl wkt::message::Message for ListBucketsRequest {
557    fn typename() -> &'static str {
558        "type.googleapis.com/google.storage.v2.ListBucketsRequest"
559    }
560}
561
562/// Response message for [ListBuckets][google.storage.v2.Storage.ListBuckets].
563///
564/// [google.storage.v2.Storage.ListBuckets]: crate::client::StorageControl::list_buckets
565#[derive(Clone, Default, PartialEq)]
566#[non_exhaustive]
567pub struct ListBucketsResponse {
568    /// The list of items.
569    pub buckets: std::vec::Vec<crate::model::Bucket>,
570
571    /// The continuation token, used to page through large result sets. Provide
572    /// this value in a subsequent request to return the next page of results.
573    pub next_page_token: std::string::String,
574
575    /// Unreachable resources.
576    /// This field can only be present if the caller specified
577    /// return_partial_success to be true in the request to receive indications
578    /// of temporarily missing resources.
579    /// unreachable might be:
580    /// unreachable = [
581    /// "projects/_/buckets/bucket1",
582    /// "projects/_/buckets/bucket2",
583    /// "projects/_/buckets/bucket3",
584    /// ]
585    pub unreachable: std::vec::Vec<std::string::String>,
586
587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
588}
589
590impl ListBucketsResponse {
591    pub fn new() -> Self {
592        std::default::Default::default()
593    }
594
595    /// Sets the value of [buckets][crate::model::ListBucketsResponse::buckets].
596    ///
597    /// # Example
598    /// ```ignore,no_run
599    /// # use google_cloud_storage::model::ListBucketsResponse;
600    /// use google_cloud_storage::model::Bucket;
601    /// let x = ListBucketsResponse::new()
602    ///     .set_buckets([
603    ///         Bucket::default()/* use setters */,
604    ///         Bucket::default()/* use (different) setters */,
605    ///     ]);
606    /// ```
607    pub fn set_buckets<T, V>(mut self, v: T) -> Self
608    where
609        T: std::iter::IntoIterator<Item = V>,
610        V: std::convert::Into<crate::model::Bucket>,
611    {
612        use std::iter::Iterator;
613        self.buckets = v.into_iter().map(|i| i.into()).collect();
614        self
615    }
616
617    /// Sets the value of [next_page_token][crate::model::ListBucketsResponse::next_page_token].
618    ///
619    /// # Example
620    /// ```ignore,no_run
621    /// # use google_cloud_storage::model::ListBucketsResponse;
622    /// let x = ListBucketsResponse::new().set_next_page_token("example");
623    /// ```
624    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
625        self.next_page_token = v.into();
626        self
627    }
628
629    /// Sets the value of [unreachable][crate::model::ListBucketsResponse::unreachable].
630    ///
631    /// # Example
632    /// ```ignore,no_run
633    /// # use google_cloud_storage::model::ListBucketsResponse;
634    /// let x = ListBucketsResponse::new().set_unreachable(["a", "b", "c"]);
635    /// ```
636    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
637    where
638        T: std::iter::IntoIterator<Item = V>,
639        V: std::convert::Into<std::string::String>,
640    {
641        use std::iter::Iterator;
642        self.unreachable = v.into_iter().map(|i| i.into()).collect();
643        self
644    }
645}
646
647impl wkt::message::Message for ListBucketsResponse {
648    fn typename() -> &'static str {
649        "type.googleapis.com/google.storage.v2.ListBucketsResponse"
650    }
651}
652
653#[doc(hidden)]
654impl google_cloud_gax::paginator::internal::PageableResponse for ListBucketsResponse {
655    type PageItem = crate::model::Bucket;
656
657    fn items(self) -> std::vec::Vec<Self::PageItem> {
658        self.buckets
659    }
660
661    fn next_page_token(&self) -> std::string::String {
662        use std::clone::Clone;
663        self.next_page_token.clone()
664    }
665}
666
667/// Request message for
668/// [LockBucketRetentionPolicy][google.storage.v2.Storage.LockBucketRetentionPolicy].
669///
670/// [google.storage.v2.Storage.LockBucketRetentionPolicy]: crate::client::StorageControl::lock_bucket_retention_policy
671#[derive(Clone, Default, PartialEq)]
672#[non_exhaustive]
673pub struct LockBucketRetentionPolicyRequest {
674    /// Required. Name of a bucket.
675    pub bucket: std::string::String,
676
677    /// Required. Makes the operation conditional on whether bucket's current
678    /// metageneration matches the given value. Must be positive.
679    pub if_metageneration_match: i64,
680
681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
682}
683
684impl LockBucketRetentionPolicyRequest {
685    pub fn new() -> Self {
686        std::default::Default::default()
687    }
688
689    /// Sets the value of [bucket][crate::model::LockBucketRetentionPolicyRequest::bucket].
690    ///
691    /// # Example
692    /// ```ignore,no_run
693    /// # use google_cloud_storage::model::LockBucketRetentionPolicyRequest;
694    /// let x = LockBucketRetentionPolicyRequest::new().set_bucket("example");
695    /// ```
696    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
697        self.bucket = v.into();
698        self
699    }
700
701    /// Sets the value of [if_metageneration_match][crate::model::LockBucketRetentionPolicyRequest::if_metageneration_match].
702    ///
703    /// # Example
704    /// ```ignore,no_run
705    /// # use google_cloud_storage::model::LockBucketRetentionPolicyRequest;
706    /// let x = LockBucketRetentionPolicyRequest::new().set_if_metageneration_match(42);
707    /// ```
708    pub fn set_if_metageneration_match<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
709        self.if_metageneration_match = v.into();
710        self
711    }
712}
713
714impl wkt::message::Message for LockBucketRetentionPolicyRequest {
715    fn typename() -> &'static str {
716        "type.googleapis.com/google.storage.v2.LockBucketRetentionPolicyRequest"
717    }
718}
719
720/// Request for [UpdateBucket][google.storage.v2.Storage.UpdateBucket] method.
721///
722/// [google.storage.v2.Storage.UpdateBucket]: crate::client::StorageControl::update_bucket
723#[derive(Clone, Default, PartialEq)]
724#[non_exhaustive]
725pub struct UpdateBucketRequest {
726    /// Required. The bucket to update.
727    /// The bucket's `name` field is used to identify the bucket.
728    pub bucket: std::option::Option<crate::model::Bucket>,
729
730    /// If set, the request modifies the bucket if its metageneration matches this
731    /// value.
732    pub if_metageneration_match: std::option::Option<i64>,
733
734    /// If set, the request modifies the bucket if its metageneration doesn't
735    /// match this value.
736    pub if_metageneration_not_match: std::option::Option<i64>,
737
738    /// Optional. Apply a predefined set of access controls to this bucket.
739    /// Valid values are `authenticatedRead`, `private`, `projectPrivate`,
740    /// `publicRead`, or `publicReadWrite`.
741    pub predefined_acl: std::string::String,
742
743    /// Optional. Apply a predefined set of default object access controls to this
744    /// bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
745    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
746    pub predefined_default_object_acl: std::string::String,
747
748    /// Required. List of fields to be updated.
749    ///
750    /// To specify ALL fields, equivalent to the JSON API's "update" function,
751    /// specify a single field with the value `*`. Note: not recommended. If a new
752    /// field is introduced at a later time, an older client updating with the `*`
753    /// might accidentally reset the new field's value.
754    ///
755    /// Not specifying any fields is an error.
756    pub update_mask: std::option::Option<wkt::FieldMask>,
757
758    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
759}
760
761impl UpdateBucketRequest {
762    pub fn new() -> Self {
763        std::default::Default::default()
764    }
765
766    /// Sets the value of [bucket][crate::model::UpdateBucketRequest::bucket].
767    ///
768    /// # Example
769    /// ```ignore,no_run
770    /// # use google_cloud_storage::model::UpdateBucketRequest;
771    /// use google_cloud_storage::model::Bucket;
772    /// let x = UpdateBucketRequest::new().set_bucket(Bucket::default()/* use setters */);
773    /// ```
774    pub fn set_bucket<T>(mut self, v: T) -> Self
775    where
776        T: std::convert::Into<crate::model::Bucket>,
777    {
778        self.bucket = std::option::Option::Some(v.into());
779        self
780    }
781
782    /// Sets or clears the value of [bucket][crate::model::UpdateBucketRequest::bucket].
783    ///
784    /// # Example
785    /// ```ignore,no_run
786    /// # use google_cloud_storage::model::UpdateBucketRequest;
787    /// use google_cloud_storage::model::Bucket;
788    /// let x = UpdateBucketRequest::new().set_or_clear_bucket(Some(Bucket::default()/* use setters */));
789    /// let x = UpdateBucketRequest::new().set_or_clear_bucket(None::<Bucket>);
790    /// ```
791    pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
792    where
793        T: std::convert::Into<crate::model::Bucket>,
794    {
795        self.bucket = v.map(|x| x.into());
796        self
797    }
798
799    /// Sets the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
800    ///
801    /// # Example
802    /// ```ignore,no_run
803    /// # use google_cloud_storage::model::UpdateBucketRequest;
804    /// let x = UpdateBucketRequest::new().set_if_metageneration_match(42);
805    /// ```
806    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
807    where
808        T: std::convert::Into<i64>,
809    {
810        self.if_metageneration_match = std::option::Option::Some(v.into());
811        self
812    }
813
814    /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
815    ///
816    /// # Example
817    /// ```ignore,no_run
818    /// # use google_cloud_storage::model::UpdateBucketRequest;
819    /// let x = UpdateBucketRequest::new().set_or_clear_if_metageneration_match(Some(42));
820    /// let x = UpdateBucketRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
821    /// ```
822    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
823    where
824        T: std::convert::Into<i64>,
825    {
826        self.if_metageneration_match = v.map(|x| x.into());
827        self
828    }
829
830    /// Sets the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
831    ///
832    /// # Example
833    /// ```ignore,no_run
834    /// # use google_cloud_storage::model::UpdateBucketRequest;
835    /// let x = UpdateBucketRequest::new().set_if_metageneration_not_match(42);
836    /// ```
837    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
838    where
839        T: std::convert::Into<i64>,
840    {
841        self.if_metageneration_not_match = std::option::Option::Some(v.into());
842        self
843    }
844
845    /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
846    ///
847    /// # Example
848    /// ```ignore,no_run
849    /// # use google_cloud_storage::model::UpdateBucketRequest;
850    /// let x = UpdateBucketRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
851    /// let x = UpdateBucketRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
852    /// ```
853    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
854    where
855        T: std::convert::Into<i64>,
856    {
857        self.if_metageneration_not_match = v.map(|x| x.into());
858        self
859    }
860
861    /// Sets the value of [predefined_acl][crate::model::UpdateBucketRequest::predefined_acl].
862    ///
863    /// # Example
864    /// ```ignore,no_run
865    /// # use google_cloud_storage::model::UpdateBucketRequest;
866    /// let x = UpdateBucketRequest::new().set_predefined_acl("example");
867    /// ```
868    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
869        self.predefined_acl = v.into();
870        self
871    }
872
873    /// Sets the value of [predefined_default_object_acl][crate::model::UpdateBucketRequest::predefined_default_object_acl].
874    ///
875    /// # Example
876    /// ```ignore,no_run
877    /// # use google_cloud_storage::model::UpdateBucketRequest;
878    /// let x = UpdateBucketRequest::new().set_predefined_default_object_acl("example");
879    /// ```
880    pub fn set_predefined_default_object_acl<T: std::convert::Into<std::string::String>>(
881        mut self,
882        v: T,
883    ) -> Self {
884        self.predefined_default_object_acl = v.into();
885        self
886    }
887
888    /// Sets the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
889    ///
890    /// # Example
891    /// ```ignore,no_run
892    /// # use google_cloud_storage::model::UpdateBucketRequest;
893    /// use wkt::FieldMask;
894    /// let x = UpdateBucketRequest::new().set_update_mask(FieldMask::default()/* use setters */);
895    /// ```
896    pub fn set_update_mask<T>(mut self, v: T) -> Self
897    where
898        T: std::convert::Into<wkt::FieldMask>,
899    {
900        self.update_mask = std::option::Option::Some(v.into());
901        self
902    }
903
904    /// Sets or clears the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
905    ///
906    /// # Example
907    /// ```ignore,no_run
908    /// # use google_cloud_storage::model::UpdateBucketRequest;
909    /// use wkt::FieldMask;
910    /// let x = UpdateBucketRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
911    /// let x = UpdateBucketRequest::new().set_or_clear_update_mask(None::<FieldMask>);
912    /// ```
913    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
914    where
915        T: std::convert::Into<wkt::FieldMask>,
916    {
917        self.update_mask = v.map(|x| x.into());
918        self
919    }
920}
921
922impl wkt::message::Message for UpdateBucketRequest {
923    fn typename() -> &'static str {
924        "type.googleapis.com/google.storage.v2.UpdateBucketRequest"
925    }
926}
927
928/// Request message for [ComposeObject][google.storage.v2.Storage.ComposeObject].
929///
930/// [google.storage.v2.Storage.ComposeObject]: crate::client::StorageControl::compose_object
931#[derive(Clone, Default, PartialEq)]
932#[non_exhaustive]
933pub struct ComposeObjectRequest {
934    /// Required. Properties of the resulting object.
935    pub destination: std::option::Option<crate::model::Object>,
936
937    /// Optional. The list of source objects that is concatenated into a single
938    /// object.
939    pub source_objects: std::vec::Vec<crate::model::compose_object_request::SourceObject>,
940
941    /// Optional. Apply a predefined set of access controls to the destination
942    /// object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
943    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
944    pub destination_predefined_acl: std::string::String,
945
946    /// Makes the operation conditional on whether the object's current generation
947    /// matches the given value. Setting to 0 makes the operation succeed only if
948    /// there are no live versions of the object.
949    pub if_generation_match: std::option::Option<i64>,
950
951    /// Makes the operation conditional on whether the object's current
952    /// metageneration matches the given value.
953    pub if_metageneration_match: std::option::Option<i64>,
954
955    /// Optional. Resource name of the Cloud KMS key, of the form
956    /// `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
957    /// that is used to encrypt the object. Overrides the object
958    /// metadata's `kms_key_name` value, if any.
959    pub kms_key: std::string::String,
960
961    /// Optional. A set of parameters common to Storage API requests concerning an
962    /// object.
963    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
964
965    /// Optional. The checksums of the complete object. This is validated against
966    /// the combined checksums of the component objects.
967    pub object_checksums: std::option::Option<crate::model::ObjectChecksums>,
968
969    /// Whether the source objects should be deleted in the compose request.
970    pub delete_source_objects: std::option::Option<bool>,
971
972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
973}
974
975impl ComposeObjectRequest {
976    pub fn new() -> Self {
977        std::default::Default::default()
978    }
979
980    /// Sets the value of [destination][crate::model::ComposeObjectRequest::destination].
981    ///
982    /// # Example
983    /// ```ignore,no_run
984    /// # use google_cloud_storage::model::ComposeObjectRequest;
985    /// use google_cloud_storage::model::Object;
986    /// let x = ComposeObjectRequest::new().set_destination(Object::default()/* use setters */);
987    /// ```
988    pub fn set_destination<T>(mut self, v: T) -> Self
989    where
990        T: std::convert::Into<crate::model::Object>,
991    {
992        self.destination = std::option::Option::Some(v.into());
993        self
994    }
995
996    /// Sets or clears the value of [destination][crate::model::ComposeObjectRequest::destination].
997    ///
998    /// # Example
999    /// ```ignore,no_run
1000    /// # use google_cloud_storage::model::ComposeObjectRequest;
1001    /// use google_cloud_storage::model::Object;
1002    /// let x = ComposeObjectRequest::new().set_or_clear_destination(Some(Object::default()/* use setters */));
1003    /// let x = ComposeObjectRequest::new().set_or_clear_destination(None::<Object>);
1004    /// ```
1005    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
1006    where
1007        T: std::convert::Into<crate::model::Object>,
1008    {
1009        self.destination = v.map(|x| x.into());
1010        self
1011    }
1012
1013    /// Sets the value of [source_objects][crate::model::ComposeObjectRequest::source_objects].
1014    ///
1015    /// # Example
1016    /// ```ignore,no_run
1017    /// # use google_cloud_storage::model::ComposeObjectRequest;
1018    /// use google_cloud_storage::model::compose_object_request::SourceObject;
1019    /// let x = ComposeObjectRequest::new()
1020    ///     .set_source_objects([
1021    ///         SourceObject::default()/* use setters */,
1022    ///         SourceObject::default()/* use (different) setters */,
1023    ///     ]);
1024    /// ```
1025    pub fn set_source_objects<T, V>(mut self, v: T) -> Self
1026    where
1027        T: std::iter::IntoIterator<Item = V>,
1028        V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
1029    {
1030        use std::iter::Iterator;
1031        self.source_objects = v.into_iter().map(|i| i.into()).collect();
1032        self
1033    }
1034
1035    /// Sets the value of [destination_predefined_acl][crate::model::ComposeObjectRequest::destination_predefined_acl].
1036    ///
1037    /// # Example
1038    /// ```ignore,no_run
1039    /// # use google_cloud_storage::model::ComposeObjectRequest;
1040    /// let x = ComposeObjectRequest::new().set_destination_predefined_acl("example");
1041    /// ```
1042    pub fn set_destination_predefined_acl<T: std::convert::Into<std::string::String>>(
1043        mut self,
1044        v: T,
1045    ) -> Self {
1046        self.destination_predefined_acl = v.into();
1047        self
1048    }
1049
1050    /// Sets the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
1051    ///
1052    /// # Example
1053    /// ```ignore,no_run
1054    /// # use google_cloud_storage::model::ComposeObjectRequest;
1055    /// let x = ComposeObjectRequest::new().set_if_generation_match(42);
1056    /// ```
1057    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1058    where
1059        T: std::convert::Into<i64>,
1060    {
1061        self.if_generation_match = std::option::Option::Some(v.into());
1062        self
1063    }
1064
1065    /// Sets or clears the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
1066    ///
1067    /// # Example
1068    /// ```ignore,no_run
1069    /// # use google_cloud_storage::model::ComposeObjectRequest;
1070    /// let x = ComposeObjectRequest::new().set_or_clear_if_generation_match(Some(42));
1071    /// let x = ComposeObjectRequest::new().set_or_clear_if_generation_match(None::<i32>);
1072    /// ```
1073    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1074    where
1075        T: std::convert::Into<i64>,
1076    {
1077        self.if_generation_match = v.map(|x| x.into());
1078        self
1079    }
1080
1081    /// Sets the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
1082    ///
1083    /// # Example
1084    /// ```ignore,no_run
1085    /// # use google_cloud_storage::model::ComposeObjectRequest;
1086    /// let x = ComposeObjectRequest::new().set_if_metageneration_match(42);
1087    /// ```
1088    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1089    where
1090        T: std::convert::Into<i64>,
1091    {
1092        self.if_metageneration_match = std::option::Option::Some(v.into());
1093        self
1094    }
1095
1096    /// Sets or clears the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
1097    ///
1098    /// # Example
1099    /// ```ignore,no_run
1100    /// # use google_cloud_storage::model::ComposeObjectRequest;
1101    /// let x = ComposeObjectRequest::new().set_or_clear_if_metageneration_match(Some(42));
1102    /// let x = ComposeObjectRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1103    /// ```
1104    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1105    where
1106        T: std::convert::Into<i64>,
1107    {
1108        self.if_metageneration_match = v.map(|x| x.into());
1109        self
1110    }
1111
1112    /// Sets the value of [kms_key][crate::model::ComposeObjectRequest::kms_key].
1113    ///
1114    /// # Example
1115    /// ```ignore,no_run
1116    /// # use google_cloud_storage::model::ComposeObjectRequest;
1117    /// let x = ComposeObjectRequest::new().set_kms_key("example");
1118    /// ```
1119    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1120        self.kms_key = v.into();
1121        self
1122    }
1123
1124    /// Sets the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
1125    ///
1126    /// # Example
1127    /// ```ignore,no_run
1128    /// # use google_cloud_storage::model::ComposeObjectRequest;
1129    /// use google_cloud_storage::model::CommonObjectRequestParams;
1130    /// let x = ComposeObjectRequest::new().set_common_object_request_params(CommonObjectRequestParams::default()/* use setters */);
1131    /// ```
1132    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1133    where
1134        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1135    {
1136        self.common_object_request_params = std::option::Option::Some(v.into());
1137        self
1138    }
1139
1140    /// Sets or clears the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
1141    ///
1142    /// # Example
1143    /// ```ignore,no_run
1144    /// # use google_cloud_storage::model::ComposeObjectRequest;
1145    /// use google_cloud_storage::model::CommonObjectRequestParams;
1146    /// let x = ComposeObjectRequest::new().set_or_clear_common_object_request_params(Some(CommonObjectRequestParams::default()/* use setters */));
1147    /// let x = ComposeObjectRequest::new().set_or_clear_common_object_request_params(None::<CommonObjectRequestParams>);
1148    /// ```
1149    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
1150    where
1151        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1152    {
1153        self.common_object_request_params = v.map(|x| x.into());
1154        self
1155    }
1156
1157    /// Sets the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
1158    ///
1159    /// # Example
1160    /// ```ignore,no_run
1161    /// # use google_cloud_storage::model::ComposeObjectRequest;
1162    /// use google_cloud_storage::model::ObjectChecksums;
1163    /// let x = ComposeObjectRequest::new().set_object_checksums(ObjectChecksums::default()/* use setters */);
1164    /// ```
1165    pub fn set_object_checksums<T>(mut self, v: T) -> Self
1166    where
1167        T: std::convert::Into<crate::model::ObjectChecksums>,
1168    {
1169        self.object_checksums = std::option::Option::Some(v.into());
1170        self
1171    }
1172
1173    /// Sets or clears the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
1174    ///
1175    /// # Example
1176    /// ```ignore,no_run
1177    /// # use google_cloud_storage::model::ComposeObjectRequest;
1178    /// use google_cloud_storage::model::ObjectChecksums;
1179    /// let x = ComposeObjectRequest::new().set_or_clear_object_checksums(Some(ObjectChecksums::default()/* use setters */));
1180    /// let x = ComposeObjectRequest::new().set_or_clear_object_checksums(None::<ObjectChecksums>);
1181    /// ```
1182    pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
1183    where
1184        T: std::convert::Into<crate::model::ObjectChecksums>,
1185    {
1186        self.object_checksums = v.map(|x| x.into());
1187        self
1188    }
1189
1190    /// Sets the value of [delete_source_objects][crate::model::ComposeObjectRequest::delete_source_objects].
1191    ///
1192    /// # Example
1193    /// ```ignore,no_run
1194    /// # use google_cloud_storage::model::ComposeObjectRequest;
1195    /// let x = ComposeObjectRequest::new().set_delete_source_objects(true);
1196    /// ```
1197    pub fn set_delete_source_objects<T>(mut self, v: T) -> Self
1198    where
1199        T: std::convert::Into<bool>,
1200    {
1201        self.delete_source_objects = std::option::Option::Some(v.into());
1202        self
1203    }
1204
1205    /// Sets or clears the value of [delete_source_objects][crate::model::ComposeObjectRequest::delete_source_objects].
1206    ///
1207    /// # Example
1208    /// ```ignore,no_run
1209    /// # use google_cloud_storage::model::ComposeObjectRequest;
1210    /// let x = ComposeObjectRequest::new().set_or_clear_delete_source_objects(Some(false));
1211    /// let x = ComposeObjectRequest::new().set_or_clear_delete_source_objects(None::<bool>);
1212    /// ```
1213    pub fn set_or_clear_delete_source_objects<T>(mut self, v: std::option::Option<T>) -> Self
1214    where
1215        T: std::convert::Into<bool>,
1216    {
1217        self.delete_source_objects = v.map(|x| x.into());
1218        self
1219    }
1220}
1221
1222impl wkt::message::Message for ComposeObjectRequest {
1223    fn typename() -> &'static str {
1224        "type.googleapis.com/google.storage.v2.ComposeObjectRequest"
1225    }
1226}
1227
1228/// Defines additional types related to [ComposeObjectRequest].
1229pub mod compose_object_request {
1230    #[allow(unused_imports)]
1231    use super::*;
1232
1233    /// Description of a source object for a composition request.
1234    #[derive(Clone, Default, PartialEq)]
1235    #[non_exhaustive]
1236    pub struct SourceObject {
1237        /// Required. The source object's name. All source objects must reside in the
1238        /// same bucket.
1239        pub name: std::string::String,
1240
1241        /// Optional. The generation of this object to use as the source.
1242        pub generation: i64,
1243
1244        /// Optional. Conditions that must be met for this operation to execute.
1245        pub object_preconditions: std::option::Option<
1246            crate::model::compose_object_request::source_object::ObjectPreconditions,
1247        >,
1248
1249        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1250    }
1251
1252    impl SourceObject {
1253        pub fn new() -> Self {
1254            std::default::Default::default()
1255        }
1256
1257        /// Sets the value of [name][crate::model::compose_object_request::SourceObject::name].
1258        ///
1259        /// # Example
1260        /// ```ignore,no_run
1261        /// # use google_cloud_storage::model::compose_object_request::SourceObject;
1262        /// let x = SourceObject::new().set_name("example");
1263        /// ```
1264        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1265            self.name = v.into();
1266            self
1267        }
1268
1269        /// Sets the value of [generation][crate::model::compose_object_request::SourceObject::generation].
1270        ///
1271        /// # Example
1272        /// ```ignore,no_run
1273        /// # use google_cloud_storage::model::compose_object_request::SourceObject;
1274        /// let x = SourceObject::new().set_generation(42);
1275        /// ```
1276        pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1277            self.generation = v.into();
1278            self
1279        }
1280
1281        /// Sets the value of [object_preconditions][crate::model::compose_object_request::SourceObject::object_preconditions].
1282        ///
1283        /// # Example
1284        /// ```ignore,no_run
1285        /// # use google_cloud_storage::model::compose_object_request::SourceObject;
1286        /// use google_cloud_storage::model::compose_object_request::source_object::ObjectPreconditions;
1287        /// let x = SourceObject::new().set_object_preconditions(ObjectPreconditions::default()/* use setters */);
1288        /// ```
1289        pub fn set_object_preconditions<T>(mut self, v: T) -> Self
1290        where
1291            T: std::convert::Into<
1292                    crate::model::compose_object_request::source_object::ObjectPreconditions,
1293                >,
1294        {
1295            self.object_preconditions = std::option::Option::Some(v.into());
1296            self
1297        }
1298
1299        /// Sets or clears the value of [object_preconditions][crate::model::compose_object_request::SourceObject::object_preconditions].
1300        ///
1301        /// # Example
1302        /// ```ignore,no_run
1303        /// # use google_cloud_storage::model::compose_object_request::SourceObject;
1304        /// use google_cloud_storage::model::compose_object_request::source_object::ObjectPreconditions;
1305        /// let x = SourceObject::new().set_or_clear_object_preconditions(Some(ObjectPreconditions::default()/* use setters */));
1306        /// let x = SourceObject::new().set_or_clear_object_preconditions(None::<ObjectPreconditions>);
1307        /// ```
1308        pub fn set_or_clear_object_preconditions<T>(mut self, v: std::option::Option<T>) -> Self
1309        where
1310            T: std::convert::Into<
1311                    crate::model::compose_object_request::source_object::ObjectPreconditions,
1312                >,
1313        {
1314            self.object_preconditions = v.map(|x| x.into());
1315            self
1316        }
1317    }
1318
1319    impl wkt::message::Message for SourceObject {
1320        fn typename() -> &'static str {
1321            "type.googleapis.com/google.storage.v2.ComposeObjectRequest.SourceObject"
1322        }
1323    }
1324
1325    /// Defines additional types related to [SourceObject].
1326    pub mod source_object {
1327        #[allow(unused_imports)]
1328        use super::*;
1329
1330        /// Preconditions for a source object of a composition request.
1331        #[derive(Clone, Default, PartialEq)]
1332        #[non_exhaustive]
1333        pub struct ObjectPreconditions {
1334            /// Only perform the composition if the generation of the source object
1335            /// that would be used matches this value.  If this value and a generation
1336            /// are both specified, they must be the same value or the call fails.
1337            pub if_generation_match: std::option::Option<i64>,
1338
1339            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1340        }
1341
1342        impl ObjectPreconditions {
1343            pub fn new() -> Self {
1344                std::default::Default::default()
1345            }
1346
1347            /// Sets the value of [if_generation_match][crate::model::compose_object_request::source_object::ObjectPreconditions::if_generation_match].
1348            ///
1349            /// # Example
1350            /// ```ignore,no_run
1351            /// # use google_cloud_storage::model::compose_object_request::source_object::ObjectPreconditions;
1352            /// let x = ObjectPreconditions::new().set_if_generation_match(42);
1353            /// ```
1354            pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1355            where
1356                T: std::convert::Into<i64>,
1357            {
1358                self.if_generation_match = std::option::Option::Some(v.into());
1359                self
1360            }
1361
1362            /// Sets or clears the value of [if_generation_match][crate::model::compose_object_request::source_object::ObjectPreconditions::if_generation_match].
1363            ///
1364            /// # Example
1365            /// ```ignore,no_run
1366            /// # use google_cloud_storage::model::compose_object_request::source_object::ObjectPreconditions;
1367            /// let x = ObjectPreconditions::new().set_or_clear_if_generation_match(Some(42));
1368            /// let x = ObjectPreconditions::new().set_or_clear_if_generation_match(None::<i32>);
1369            /// ```
1370            pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1371            where
1372                T: std::convert::Into<i64>,
1373            {
1374                self.if_generation_match = v.map(|x| x.into());
1375                self
1376            }
1377        }
1378
1379        impl wkt::message::Message for ObjectPreconditions {
1380            fn typename() -> &'static str {
1381                "type.googleapis.com/google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions"
1382            }
1383        }
1384    }
1385}
1386
1387/// Request message for deleting an object.
1388#[derive(Clone, Default, PartialEq)]
1389#[non_exhaustive]
1390pub struct DeleteObjectRequest {
1391    /// Required. Name of the bucket in which the object resides.
1392    pub bucket: std::string::String,
1393
1394    /// Required. The name of the finalized object to delete.
1395    /// Note: If you want to delete an unfinalized resumable upload please use
1396    /// `CancelResumableWrite`.
1397    pub object: std::string::String,
1398
1399    /// Optional. If present, permanently deletes a specific revision of this
1400    /// object (as opposed to the latest version, the default).
1401    pub generation: i64,
1402
1403    /// Makes the operation conditional on whether the object's current generation
1404    /// matches the given value. Setting to 0 makes the operation succeed only if
1405    /// there are no live versions of the object.
1406    pub if_generation_match: std::option::Option<i64>,
1407
1408    /// Makes the operation conditional on whether the object's live generation
1409    /// does not match the given value. If no live object exists, the precondition
1410    /// fails. Setting to 0 makes the operation succeed only if there is a live
1411    /// version of the object.
1412    pub if_generation_not_match: std::option::Option<i64>,
1413
1414    /// Makes the operation conditional on whether the object's current
1415    /// metageneration matches the given value.
1416    pub if_metageneration_match: std::option::Option<i64>,
1417
1418    /// Makes the operation conditional on whether the object's current
1419    /// metageneration does not match the given value.
1420    pub if_metageneration_not_match: std::option::Option<i64>,
1421
1422    /// Optional. A set of parameters common to Storage API requests concerning an
1423    /// object.
1424    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
1425
1426    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1427}
1428
1429impl DeleteObjectRequest {
1430    pub fn new() -> Self {
1431        std::default::Default::default()
1432    }
1433
1434    /// Sets the value of [bucket][crate::model::DeleteObjectRequest::bucket].
1435    ///
1436    /// # Example
1437    /// ```ignore,no_run
1438    /// # use google_cloud_storage::model::DeleteObjectRequest;
1439    /// let x = DeleteObjectRequest::new().set_bucket("example");
1440    /// ```
1441    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1442        self.bucket = v.into();
1443        self
1444    }
1445
1446    /// Sets the value of [object][crate::model::DeleteObjectRequest::object].
1447    ///
1448    /// # Example
1449    /// ```ignore,no_run
1450    /// # use google_cloud_storage::model::DeleteObjectRequest;
1451    /// let x = DeleteObjectRequest::new().set_object("example");
1452    /// ```
1453    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1454        self.object = v.into();
1455        self
1456    }
1457
1458    /// Sets the value of [generation][crate::model::DeleteObjectRequest::generation].
1459    ///
1460    /// # Example
1461    /// ```ignore,no_run
1462    /// # use google_cloud_storage::model::DeleteObjectRequest;
1463    /// let x = DeleteObjectRequest::new().set_generation(42);
1464    /// ```
1465    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1466        self.generation = v.into();
1467        self
1468    }
1469
1470    /// Sets the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
1471    ///
1472    /// # Example
1473    /// ```ignore,no_run
1474    /// # use google_cloud_storage::model::DeleteObjectRequest;
1475    /// let x = DeleteObjectRequest::new().set_if_generation_match(42);
1476    /// ```
1477    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1478    where
1479        T: std::convert::Into<i64>,
1480    {
1481        self.if_generation_match = std::option::Option::Some(v.into());
1482        self
1483    }
1484
1485    /// Sets or clears the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
1486    ///
1487    /// # Example
1488    /// ```ignore,no_run
1489    /// # use google_cloud_storage::model::DeleteObjectRequest;
1490    /// let x = DeleteObjectRequest::new().set_or_clear_if_generation_match(Some(42));
1491    /// let x = DeleteObjectRequest::new().set_or_clear_if_generation_match(None::<i32>);
1492    /// ```
1493    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1494    where
1495        T: std::convert::Into<i64>,
1496    {
1497        self.if_generation_match = v.map(|x| x.into());
1498        self
1499    }
1500
1501    /// Sets the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
1502    ///
1503    /// # Example
1504    /// ```ignore,no_run
1505    /// # use google_cloud_storage::model::DeleteObjectRequest;
1506    /// let x = DeleteObjectRequest::new().set_if_generation_not_match(42);
1507    /// ```
1508    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1509    where
1510        T: std::convert::Into<i64>,
1511    {
1512        self.if_generation_not_match = std::option::Option::Some(v.into());
1513        self
1514    }
1515
1516    /// Sets or clears the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
1517    ///
1518    /// # Example
1519    /// ```ignore,no_run
1520    /// # use google_cloud_storage::model::DeleteObjectRequest;
1521    /// let x = DeleteObjectRequest::new().set_or_clear_if_generation_not_match(Some(42));
1522    /// let x = DeleteObjectRequest::new().set_or_clear_if_generation_not_match(None::<i32>);
1523    /// ```
1524    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1525    where
1526        T: std::convert::Into<i64>,
1527    {
1528        self.if_generation_not_match = v.map(|x| x.into());
1529        self
1530    }
1531
1532    /// Sets the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
1533    ///
1534    /// # Example
1535    /// ```ignore,no_run
1536    /// # use google_cloud_storage::model::DeleteObjectRequest;
1537    /// let x = DeleteObjectRequest::new().set_if_metageneration_match(42);
1538    /// ```
1539    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1540    where
1541        T: std::convert::Into<i64>,
1542    {
1543        self.if_metageneration_match = std::option::Option::Some(v.into());
1544        self
1545    }
1546
1547    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
1548    ///
1549    /// # Example
1550    /// ```ignore,no_run
1551    /// # use google_cloud_storage::model::DeleteObjectRequest;
1552    /// let x = DeleteObjectRequest::new().set_or_clear_if_metageneration_match(Some(42));
1553    /// let x = DeleteObjectRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1554    /// ```
1555    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1556    where
1557        T: std::convert::Into<i64>,
1558    {
1559        self.if_metageneration_match = v.map(|x| x.into());
1560        self
1561    }
1562
1563    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
1564    ///
1565    /// # Example
1566    /// ```ignore,no_run
1567    /// # use google_cloud_storage::model::DeleteObjectRequest;
1568    /// let x = DeleteObjectRequest::new().set_if_metageneration_not_match(42);
1569    /// ```
1570    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1571    where
1572        T: std::convert::Into<i64>,
1573    {
1574        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1575        self
1576    }
1577
1578    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
1579    ///
1580    /// # Example
1581    /// ```ignore,no_run
1582    /// # use google_cloud_storage::model::DeleteObjectRequest;
1583    /// let x = DeleteObjectRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1584    /// let x = DeleteObjectRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1585    /// ```
1586    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1587    where
1588        T: std::convert::Into<i64>,
1589    {
1590        self.if_metageneration_not_match = v.map(|x| x.into());
1591        self
1592    }
1593
1594    /// Sets the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
1595    ///
1596    /// # Example
1597    /// ```ignore,no_run
1598    /// # use google_cloud_storage::model::DeleteObjectRequest;
1599    /// use google_cloud_storage::model::CommonObjectRequestParams;
1600    /// let x = DeleteObjectRequest::new().set_common_object_request_params(CommonObjectRequestParams::default()/* use setters */);
1601    /// ```
1602    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1603    where
1604        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1605    {
1606        self.common_object_request_params = std::option::Option::Some(v.into());
1607        self
1608    }
1609
1610    /// Sets or clears the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
1611    ///
1612    /// # Example
1613    /// ```ignore,no_run
1614    /// # use google_cloud_storage::model::DeleteObjectRequest;
1615    /// use google_cloud_storage::model::CommonObjectRequestParams;
1616    /// let x = DeleteObjectRequest::new().set_or_clear_common_object_request_params(Some(CommonObjectRequestParams::default()/* use setters */));
1617    /// let x = DeleteObjectRequest::new().set_or_clear_common_object_request_params(None::<CommonObjectRequestParams>);
1618    /// ```
1619    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
1620    where
1621        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1622    {
1623        self.common_object_request_params = v.map(|x| x.into());
1624        self
1625    }
1626}
1627
1628impl wkt::message::Message for DeleteObjectRequest {
1629    fn typename() -> &'static str {
1630        "type.googleapis.com/google.storage.v2.DeleteObjectRequest"
1631    }
1632}
1633
1634/// Request message for
1635/// [RestoreObject][google.storage.v2.Storage.RestoreObject].
1636/// `bucket`, `object`, and `generation` **must** be set.
1637///
1638/// [google.storage.v2.Storage.RestoreObject]: crate::client::StorageControl::restore_object
1639#[derive(Clone, Default, PartialEq)]
1640#[non_exhaustive]
1641pub struct RestoreObjectRequest {
1642    /// Required. Name of the bucket in which the object resides.
1643    pub bucket: std::string::String,
1644
1645    /// Required. The name of the object to restore.
1646    pub object: std::string::String,
1647
1648    /// Required. The specific revision of the object to restore.
1649    pub generation: i64,
1650
1651    /// Optional. Restore token used to differentiate soft-deleted objects with the
1652    /// same name and generation. Only applicable for hierarchical namespace
1653    /// buckets. This parameter is optional, and is only required in the rare case
1654    /// when there are multiple soft-deleted objects with the same name and
1655    /// generation.
1656    pub restore_token: std::string::String,
1657
1658    /// Makes the operation conditional on whether the object's current generation
1659    /// matches the given value. Setting to 0 makes the operation succeed only if
1660    /// there are no live versions of the object.
1661    pub if_generation_match: std::option::Option<i64>,
1662
1663    /// Makes the operation conditional on whether the object's live generation
1664    /// does not match the given value. If no live object exists, the precondition
1665    /// fails. Setting to 0 makes the operation succeed only if there is a live
1666    /// version of the object.
1667    pub if_generation_not_match: std::option::Option<i64>,
1668
1669    /// Makes the operation conditional on whether the object's current
1670    /// metageneration matches the given value.
1671    pub if_metageneration_match: std::option::Option<i64>,
1672
1673    /// Makes the operation conditional on whether the object's current
1674    /// metageneration does not match the given value.
1675    pub if_metageneration_not_match: std::option::Option<i64>,
1676
1677    /// If false or unset, the bucket's default object ACL is used.
1678    /// If true, copy the source object's access controls.
1679    /// Return an error if bucket has UBLA enabled.
1680    pub copy_source_acl: std::option::Option<bool>,
1681
1682    /// Optional. A set of parameters common to Storage API requests concerning an
1683    /// object.
1684    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
1685
1686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1687}
1688
1689impl RestoreObjectRequest {
1690    pub fn new() -> Self {
1691        std::default::Default::default()
1692    }
1693
1694    /// Sets the value of [bucket][crate::model::RestoreObjectRequest::bucket].
1695    ///
1696    /// # Example
1697    /// ```ignore,no_run
1698    /// # use google_cloud_storage::model::RestoreObjectRequest;
1699    /// let x = RestoreObjectRequest::new().set_bucket("example");
1700    /// ```
1701    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1702        self.bucket = v.into();
1703        self
1704    }
1705
1706    /// Sets the value of [object][crate::model::RestoreObjectRequest::object].
1707    ///
1708    /// # Example
1709    /// ```ignore,no_run
1710    /// # use google_cloud_storage::model::RestoreObjectRequest;
1711    /// let x = RestoreObjectRequest::new().set_object("example");
1712    /// ```
1713    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1714        self.object = v.into();
1715        self
1716    }
1717
1718    /// Sets the value of [generation][crate::model::RestoreObjectRequest::generation].
1719    ///
1720    /// # Example
1721    /// ```ignore,no_run
1722    /// # use google_cloud_storage::model::RestoreObjectRequest;
1723    /// let x = RestoreObjectRequest::new().set_generation(42);
1724    /// ```
1725    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1726        self.generation = v.into();
1727        self
1728    }
1729
1730    /// Sets the value of [restore_token][crate::model::RestoreObjectRequest::restore_token].
1731    ///
1732    /// # Example
1733    /// ```ignore,no_run
1734    /// # use google_cloud_storage::model::RestoreObjectRequest;
1735    /// let x = RestoreObjectRequest::new().set_restore_token("example");
1736    /// ```
1737    pub fn set_restore_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1738        self.restore_token = v.into();
1739        self
1740    }
1741
1742    /// Sets the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
1743    ///
1744    /// # Example
1745    /// ```ignore,no_run
1746    /// # use google_cloud_storage::model::RestoreObjectRequest;
1747    /// let x = RestoreObjectRequest::new().set_if_generation_match(42);
1748    /// ```
1749    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1750    where
1751        T: std::convert::Into<i64>,
1752    {
1753        self.if_generation_match = std::option::Option::Some(v.into());
1754        self
1755    }
1756
1757    /// Sets or clears the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
1758    ///
1759    /// # Example
1760    /// ```ignore,no_run
1761    /// # use google_cloud_storage::model::RestoreObjectRequest;
1762    /// let x = RestoreObjectRequest::new().set_or_clear_if_generation_match(Some(42));
1763    /// let x = RestoreObjectRequest::new().set_or_clear_if_generation_match(None::<i32>);
1764    /// ```
1765    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1766    where
1767        T: std::convert::Into<i64>,
1768    {
1769        self.if_generation_match = v.map(|x| x.into());
1770        self
1771    }
1772
1773    /// Sets the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
1774    ///
1775    /// # Example
1776    /// ```ignore,no_run
1777    /// # use google_cloud_storage::model::RestoreObjectRequest;
1778    /// let x = RestoreObjectRequest::new().set_if_generation_not_match(42);
1779    /// ```
1780    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1781    where
1782        T: std::convert::Into<i64>,
1783    {
1784        self.if_generation_not_match = std::option::Option::Some(v.into());
1785        self
1786    }
1787
1788    /// Sets or clears the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
1789    ///
1790    /// # Example
1791    /// ```ignore,no_run
1792    /// # use google_cloud_storage::model::RestoreObjectRequest;
1793    /// let x = RestoreObjectRequest::new().set_or_clear_if_generation_not_match(Some(42));
1794    /// let x = RestoreObjectRequest::new().set_or_clear_if_generation_not_match(None::<i32>);
1795    /// ```
1796    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1797    where
1798        T: std::convert::Into<i64>,
1799    {
1800        self.if_generation_not_match = v.map(|x| x.into());
1801        self
1802    }
1803
1804    /// Sets the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
1805    ///
1806    /// # Example
1807    /// ```ignore,no_run
1808    /// # use google_cloud_storage::model::RestoreObjectRequest;
1809    /// let x = RestoreObjectRequest::new().set_if_metageneration_match(42);
1810    /// ```
1811    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1812    where
1813        T: std::convert::Into<i64>,
1814    {
1815        self.if_metageneration_match = std::option::Option::Some(v.into());
1816        self
1817    }
1818
1819    /// Sets or clears the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
1820    ///
1821    /// # Example
1822    /// ```ignore,no_run
1823    /// # use google_cloud_storage::model::RestoreObjectRequest;
1824    /// let x = RestoreObjectRequest::new().set_or_clear_if_metageneration_match(Some(42));
1825    /// let x = RestoreObjectRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1826    /// ```
1827    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1828    where
1829        T: std::convert::Into<i64>,
1830    {
1831        self.if_metageneration_match = v.map(|x| x.into());
1832        self
1833    }
1834
1835    /// Sets the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
1836    ///
1837    /// # Example
1838    /// ```ignore,no_run
1839    /// # use google_cloud_storage::model::RestoreObjectRequest;
1840    /// let x = RestoreObjectRequest::new().set_if_metageneration_not_match(42);
1841    /// ```
1842    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1843    where
1844        T: std::convert::Into<i64>,
1845    {
1846        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1847        self
1848    }
1849
1850    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
1851    ///
1852    /// # Example
1853    /// ```ignore,no_run
1854    /// # use google_cloud_storage::model::RestoreObjectRequest;
1855    /// let x = RestoreObjectRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1856    /// let x = RestoreObjectRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1857    /// ```
1858    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1859    where
1860        T: std::convert::Into<i64>,
1861    {
1862        self.if_metageneration_not_match = v.map(|x| x.into());
1863        self
1864    }
1865
1866    /// Sets the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
1867    ///
1868    /// # Example
1869    /// ```ignore,no_run
1870    /// # use google_cloud_storage::model::RestoreObjectRequest;
1871    /// let x = RestoreObjectRequest::new().set_copy_source_acl(true);
1872    /// ```
1873    pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1874    where
1875        T: std::convert::Into<bool>,
1876    {
1877        self.copy_source_acl = std::option::Option::Some(v.into());
1878        self
1879    }
1880
1881    /// Sets or clears the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
1882    ///
1883    /// # Example
1884    /// ```ignore,no_run
1885    /// # use google_cloud_storage::model::RestoreObjectRequest;
1886    /// let x = RestoreObjectRequest::new().set_or_clear_copy_source_acl(Some(false));
1887    /// let x = RestoreObjectRequest::new().set_or_clear_copy_source_acl(None::<bool>);
1888    /// ```
1889    pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1890    where
1891        T: std::convert::Into<bool>,
1892    {
1893        self.copy_source_acl = v.map(|x| x.into());
1894        self
1895    }
1896
1897    /// Sets the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
1898    ///
1899    /// # Example
1900    /// ```ignore,no_run
1901    /// # use google_cloud_storage::model::RestoreObjectRequest;
1902    /// use google_cloud_storage::model::CommonObjectRequestParams;
1903    /// let x = RestoreObjectRequest::new().set_common_object_request_params(CommonObjectRequestParams::default()/* use setters */);
1904    /// ```
1905    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1906    where
1907        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1908    {
1909        self.common_object_request_params = std::option::Option::Some(v.into());
1910        self
1911    }
1912
1913    /// Sets or clears the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
1914    ///
1915    /// # Example
1916    /// ```ignore,no_run
1917    /// # use google_cloud_storage::model::RestoreObjectRequest;
1918    /// use google_cloud_storage::model::CommonObjectRequestParams;
1919    /// let x = RestoreObjectRequest::new().set_or_clear_common_object_request_params(Some(CommonObjectRequestParams::default()/* use setters */));
1920    /// let x = RestoreObjectRequest::new().set_or_clear_common_object_request_params(None::<CommonObjectRequestParams>);
1921    /// ```
1922    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
1923    where
1924        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1925    {
1926        self.common_object_request_params = v.map(|x| x.into());
1927        self
1928    }
1929}
1930
1931impl wkt::message::Message for RestoreObjectRequest {
1932    fn typename() -> &'static str {
1933        "type.googleapis.com/google.storage.v2.RestoreObjectRequest"
1934    }
1935}
1936
1937/// Request message for [ReadObject][google.storage.v2.Storage.ReadObject].
1938#[derive(Clone, Default, PartialEq)]
1939#[non_exhaustive]
1940pub struct ReadObjectRequest {
1941    /// Required. The name of the bucket containing the object to read.
1942    pub bucket: std::string::String,
1943
1944    /// Required. The name of the object to read.
1945    pub object: std::string::String,
1946
1947    /// Optional. If present, selects a specific revision of this object (as
1948    /// opposed to the latest version, the default).
1949    pub generation: i64,
1950
1951    /// Optional. The offset for the first byte to return in the read, relative to
1952    /// the start of the object.
1953    ///
1954    /// A negative `read_offset` value is interpreted as the number of bytes
1955    /// back from the end of the object to be returned. For example, if an object's
1956    /// length is `15` bytes, a `ReadObjectRequest` with `read_offset` = `-5` and
1957    /// `read_limit` = `3` would return bytes `10` through `12` of the object.
1958    /// Requesting a negative offset with magnitude larger than the size of the
1959    /// object returns the entire object.
1960    pub read_offset: i64,
1961
1962    /// Optional. The maximum number of `data` bytes the server is allowed to
1963    /// return in the sum of all `Object` messages. A `read_limit` of zero
1964    /// indicates that there is no limit, and a negative `read_limit` causes an
1965    /// error.
1966    ///
1967    /// If the stream returns fewer bytes than allowed by the `read_limit` and no
1968    /// error occurred, the stream includes all data from the `read_offset` to the
1969    /// end of the resource.
1970    pub read_limit: i64,
1971
1972    /// Makes the operation conditional on whether the object's current generation
1973    /// matches the given value. Setting to 0 makes the operation succeed only if
1974    /// there are no live versions of the object.
1975    pub if_generation_match: std::option::Option<i64>,
1976
1977    /// Makes the operation conditional on whether the object's live generation
1978    /// does not match the given value. If no live object exists, the precondition
1979    /// fails. Setting to 0 makes the operation succeed only if there is a live
1980    /// version of the object.
1981    pub if_generation_not_match: std::option::Option<i64>,
1982
1983    /// Makes the operation conditional on whether the object's current
1984    /// metageneration matches the given value.
1985    pub if_metageneration_match: std::option::Option<i64>,
1986
1987    /// Makes the operation conditional on whether the object's current
1988    /// metageneration does not match the given value.
1989    pub if_metageneration_not_match: std::option::Option<i64>,
1990
1991    /// Optional. A set of parameters common to Storage API requests concerning an
1992    /// object.
1993    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
1994
1995    /// Mask specifying which fields to read.
1996    /// The `checksummed_data` field and its children are always present.
1997    /// If no mask is specified, it defaults to all fields except `metadata.
1998    /// owner` and `metadata.acl`.
1999    /// `*` might be used to mean "all fields".
2000    pub read_mask: std::option::Option<wkt::FieldMask>,
2001
2002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2003}
2004
2005impl ReadObjectRequest {
2006    pub fn new() -> Self {
2007        std::default::Default::default()
2008    }
2009
2010    /// Sets the value of [bucket][crate::model::ReadObjectRequest::bucket].
2011    ///
2012    /// # Example
2013    /// ```ignore,no_run
2014    /// # use google_cloud_storage::model::ReadObjectRequest;
2015    /// let x = ReadObjectRequest::new().set_bucket("example");
2016    /// ```
2017    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2018        self.bucket = v.into();
2019        self
2020    }
2021
2022    /// Sets the value of [object][crate::model::ReadObjectRequest::object].
2023    ///
2024    /// # Example
2025    /// ```ignore,no_run
2026    /// # use google_cloud_storage::model::ReadObjectRequest;
2027    /// let x = ReadObjectRequest::new().set_object("example");
2028    /// ```
2029    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2030        self.object = v.into();
2031        self
2032    }
2033
2034    /// Sets the value of [generation][crate::model::ReadObjectRequest::generation].
2035    ///
2036    /// # Example
2037    /// ```ignore,no_run
2038    /// # use google_cloud_storage::model::ReadObjectRequest;
2039    /// let x = ReadObjectRequest::new().set_generation(42);
2040    /// ```
2041    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2042        self.generation = v.into();
2043        self
2044    }
2045
2046    /// Sets the value of [read_offset][crate::model::ReadObjectRequest::read_offset].
2047    ///
2048    /// # Example
2049    /// ```ignore,no_run
2050    /// # use google_cloud_storage::model::ReadObjectRequest;
2051    /// let x = ReadObjectRequest::new().set_read_offset(42);
2052    /// ```
2053    pub fn set_read_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2054        self.read_offset = v.into();
2055        self
2056    }
2057
2058    /// Sets the value of [read_limit][crate::model::ReadObjectRequest::read_limit].
2059    ///
2060    /// # Example
2061    /// ```ignore,no_run
2062    /// # use google_cloud_storage::model::ReadObjectRequest;
2063    /// let x = ReadObjectRequest::new().set_read_limit(42);
2064    /// ```
2065    pub fn set_read_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2066        self.read_limit = v.into();
2067        self
2068    }
2069
2070    /// Sets the value of [if_generation_match][crate::model::ReadObjectRequest::if_generation_match].
2071    ///
2072    /// # Example
2073    /// ```ignore,no_run
2074    /// # use google_cloud_storage::model::ReadObjectRequest;
2075    /// let x = ReadObjectRequest::new().set_if_generation_match(42);
2076    /// ```
2077    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2078    where
2079        T: std::convert::Into<i64>,
2080    {
2081        self.if_generation_match = std::option::Option::Some(v.into());
2082        self
2083    }
2084
2085    /// Sets or clears the value of [if_generation_match][crate::model::ReadObjectRequest::if_generation_match].
2086    ///
2087    /// # Example
2088    /// ```ignore,no_run
2089    /// # use google_cloud_storage::model::ReadObjectRequest;
2090    /// let x = ReadObjectRequest::new().set_or_clear_if_generation_match(Some(42));
2091    /// let x = ReadObjectRequest::new().set_or_clear_if_generation_match(None::<i32>);
2092    /// ```
2093    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2094    where
2095        T: std::convert::Into<i64>,
2096    {
2097        self.if_generation_match = v.map(|x| x.into());
2098        self
2099    }
2100
2101    /// Sets the value of [if_generation_not_match][crate::model::ReadObjectRequest::if_generation_not_match].
2102    ///
2103    /// # Example
2104    /// ```ignore,no_run
2105    /// # use google_cloud_storage::model::ReadObjectRequest;
2106    /// let x = ReadObjectRequest::new().set_if_generation_not_match(42);
2107    /// ```
2108    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2109    where
2110        T: std::convert::Into<i64>,
2111    {
2112        self.if_generation_not_match = std::option::Option::Some(v.into());
2113        self
2114    }
2115
2116    /// Sets or clears the value of [if_generation_not_match][crate::model::ReadObjectRequest::if_generation_not_match].
2117    ///
2118    /// # Example
2119    /// ```ignore,no_run
2120    /// # use google_cloud_storage::model::ReadObjectRequest;
2121    /// let x = ReadObjectRequest::new().set_or_clear_if_generation_not_match(Some(42));
2122    /// let x = ReadObjectRequest::new().set_or_clear_if_generation_not_match(None::<i32>);
2123    /// ```
2124    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2125    where
2126        T: std::convert::Into<i64>,
2127    {
2128        self.if_generation_not_match = v.map(|x| x.into());
2129        self
2130    }
2131
2132    /// Sets the value of [if_metageneration_match][crate::model::ReadObjectRequest::if_metageneration_match].
2133    ///
2134    /// # Example
2135    /// ```ignore,no_run
2136    /// # use google_cloud_storage::model::ReadObjectRequest;
2137    /// let x = ReadObjectRequest::new().set_if_metageneration_match(42);
2138    /// ```
2139    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2140    where
2141        T: std::convert::Into<i64>,
2142    {
2143        self.if_metageneration_match = std::option::Option::Some(v.into());
2144        self
2145    }
2146
2147    /// Sets or clears the value of [if_metageneration_match][crate::model::ReadObjectRequest::if_metageneration_match].
2148    ///
2149    /// # Example
2150    /// ```ignore,no_run
2151    /// # use google_cloud_storage::model::ReadObjectRequest;
2152    /// let x = ReadObjectRequest::new().set_or_clear_if_metageneration_match(Some(42));
2153    /// let x = ReadObjectRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
2154    /// ```
2155    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2156    where
2157        T: std::convert::Into<i64>,
2158    {
2159        self.if_metageneration_match = v.map(|x| x.into());
2160        self
2161    }
2162
2163    /// Sets the value of [if_metageneration_not_match][crate::model::ReadObjectRequest::if_metageneration_not_match].
2164    ///
2165    /// # Example
2166    /// ```ignore,no_run
2167    /// # use google_cloud_storage::model::ReadObjectRequest;
2168    /// let x = ReadObjectRequest::new().set_if_metageneration_not_match(42);
2169    /// ```
2170    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2171    where
2172        T: std::convert::Into<i64>,
2173    {
2174        self.if_metageneration_not_match = std::option::Option::Some(v.into());
2175        self
2176    }
2177
2178    /// Sets or clears the value of [if_metageneration_not_match][crate::model::ReadObjectRequest::if_metageneration_not_match].
2179    ///
2180    /// # Example
2181    /// ```ignore,no_run
2182    /// # use google_cloud_storage::model::ReadObjectRequest;
2183    /// let x = ReadObjectRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
2184    /// let x = ReadObjectRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
2185    /// ```
2186    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2187    where
2188        T: std::convert::Into<i64>,
2189    {
2190        self.if_metageneration_not_match = v.map(|x| x.into());
2191        self
2192    }
2193
2194    /// Sets the value of [common_object_request_params][crate::model::ReadObjectRequest::common_object_request_params].
2195    ///
2196    /// # Example
2197    /// ```ignore,no_run
2198    /// # use google_cloud_storage::model::ReadObjectRequest;
2199    /// use google_cloud_storage::model::CommonObjectRequestParams;
2200    /// let x = ReadObjectRequest::new().set_common_object_request_params(CommonObjectRequestParams::default()/* use setters */);
2201    /// ```
2202    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2203    where
2204        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2205    {
2206        self.common_object_request_params = std::option::Option::Some(v.into());
2207        self
2208    }
2209
2210    /// Sets or clears the value of [common_object_request_params][crate::model::ReadObjectRequest::common_object_request_params].
2211    ///
2212    /// # Example
2213    /// ```ignore,no_run
2214    /// # use google_cloud_storage::model::ReadObjectRequest;
2215    /// use google_cloud_storage::model::CommonObjectRequestParams;
2216    /// let x = ReadObjectRequest::new().set_or_clear_common_object_request_params(Some(CommonObjectRequestParams::default()/* use setters */));
2217    /// let x = ReadObjectRequest::new().set_or_clear_common_object_request_params(None::<CommonObjectRequestParams>);
2218    /// ```
2219    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
2220    where
2221        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2222    {
2223        self.common_object_request_params = v.map(|x| x.into());
2224        self
2225    }
2226
2227    /// Sets the value of [read_mask][crate::model::ReadObjectRequest::read_mask].
2228    ///
2229    /// # Example
2230    /// ```ignore,no_run
2231    /// # use google_cloud_storage::model::ReadObjectRequest;
2232    /// use wkt::FieldMask;
2233    /// let x = ReadObjectRequest::new().set_read_mask(FieldMask::default()/* use setters */);
2234    /// ```
2235    pub fn set_read_mask<T>(mut self, v: T) -> Self
2236    where
2237        T: std::convert::Into<wkt::FieldMask>,
2238    {
2239        self.read_mask = std::option::Option::Some(v.into());
2240        self
2241    }
2242
2243    /// Sets or clears the value of [read_mask][crate::model::ReadObjectRequest::read_mask].
2244    ///
2245    /// # Example
2246    /// ```ignore,no_run
2247    /// # use google_cloud_storage::model::ReadObjectRequest;
2248    /// use wkt::FieldMask;
2249    /// let x = ReadObjectRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
2250    /// let x = ReadObjectRequest::new().set_or_clear_read_mask(None::<FieldMask>);
2251    /// ```
2252    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2253    where
2254        T: std::convert::Into<wkt::FieldMask>,
2255    {
2256        self.read_mask = v.map(|x| x.into());
2257        self
2258    }
2259}
2260
2261impl wkt::message::Message for ReadObjectRequest {
2262    fn typename() -> &'static str {
2263        "type.googleapis.com/google.storage.v2.ReadObjectRequest"
2264    }
2265}
2266
2267/// Request message for [GetObject][google.storage.v2.Storage.GetObject].
2268///
2269/// [google.storage.v2.Storage.GetObject]: crate::client::StorageControl::get_object
2270#[derive(Clone, Default, PartialEq)]
2271#[non_exhaustive]
2272pub struct GetObjectRequest {
2273    /// Required. Name of the bucket in which the object resides.
2274    pub bucket: std::string::String,
2275
2276    /// Required. Name of the object.
2277    pub object: std::string::String,
2278
2279    /// Optional. If present, selects a specific revision of this object (as
2280    /// opposed to the latest version, the default).
2281    pub generation: i64,
2282
2283    /// If true, return the soft-deleted version of this object.
2284    pub soft_deleted: std::option::Option<bool>,
2285
2286    /// Makes the operation conditional on whether the object's current generation
2287    /// matches the given value. Setting to 0 makes the operation succeed only if
2288    /// there are no live versions of the object.
2289    pub if_generation_match: std::option::Option<i64>,
2290
2291    /// Makes the operation conditional on whether the object's live generation
2292    /// does not match the given value. If no live object exists, the precondition
2293    /// fails. Setting to 0 makes the operation succeed only if there is a live
2294    /// version of the object.
2295    pub if_generation_not_match: std::option::Option<i64>,
2296
2297    /// Makes the operation conditional on whether the object's current
2298    /// metageneration matches the given value.
2299    pub if_metageneration_match: std::option::Option<i64>,
2300
2301    /// Makes the operation conditional on whether the object's current
2302    /// metageneration does not match the given value.
2303    pub if_metageneration_not_match: std::option::Option<i64>,
2304
2305    /// Optional. A set of parameters common to Storage API requests concerning an
2306    /// object.
2307    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
2308
2309    /// Mask specifying which fields to read.
2310    /// If no mask is specified, it defaults to all fields except `metadata.
2311    /// acl` and `metadata.owner`.
2312    /// `*` might be used to mean "all fields".
2313    pub read_mask: std::option::Option<wkt::FieldMask>,
2314
2315    /// Optional. Restore token used to differentiate soft-deleted objects with the
2316    /// same name and generation. Only applicable for hierarchical namespace
2317    /// buckets and if `soft_deleted` is set to `true`. This parameter is optional,
2318    /// and is only required in the rare case when there are multiple soft-deleted
2319    /// objects with the same `name` and `generation`.
2320    pub restore_token: std::string::String,
2321
2322    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2323}
2324
2325impl GetObjectRequest {
2326    pub fn new() -> Self {
2327        std::default::Default::default()
2328    }
2329
2330    /// Sets the value of [bucket][crate::model::GetObjectRequest::bucket].
2331    ///
2332    /// # Example
2333    /// ```ignore,no_run
2334    /// # use google_cloud_storage::model::GetObjectRequest;
2335    /// let x = GetObjectRequest::new().set_bucket("example");
2336    /// ```
2337    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2338        self.bucket = v.into();
2339        self
2340    }
2341
2342    /// Sets the value of [object][crate::model::GetObjectRequest::object].
2343    ///
2344    /// # Example
2345    /// ```ignore,no_run
2346    /// # use google_cloud_storage::model::GetObjectRequest;
2347    /// let x = GetObjectRequest::new().set_object("example");
2348    /// ```
2349    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2350        self.object = v.into();
2351        self
2352    }
2353
2354    /// Sets the value of [generation][crate::model::GetObjectRequest::generation].
2355    ///
2356    /// # Example
2357    /// ```ignore,no_run
2358    /// # use google_cloud_storage::model::GetObjectRequest;
2359    /// let x = GetObjectRequest::new().set_generation(42);
2360    /// ```
2361    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2362        self.generation = v.into();
2363        self
2364    }
2365
2366    /// Sets the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
2367    ///
2368    /// # Example
2369    /// ```ignore,no_run
2370    /// # use google_cloud_storage::model::GetObjectRequest;
2371    /// let x = GetObjectRequest::new().set_soft_deleted(true);
2372    /// ```
2373    pub fn set_soft_deleted<T>(mut self, v: T) -> Self
2374    where
2375        T: std::convert::Into<bool>,
2376    {
2377        self.soft_deleted = std::option::Option::Some(v.into());
2378        self
2379    }
2380
2381    /// Sets or clears the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
2382    ///
2383    /// # Example
2384    /// ```ignore,no_run
2385    /// # use google_cloud_storage::model::GetObjectRequest;
2386    /// let x = GetObjectRequest::new().set_or_clear_soft_deleted(Some(false));
2387    /// let x = GetObjectRequest::new().set_or_clear_soft_deleted(None::<bool>);
2388    /// ```
2389    pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
2390    where
2391        T: std::convert::Into<bool>,
2392    {
2393        self.soft_deleted = v.map(|x| x.into());
2394        self
2395    }
2396
2397    /// Sets the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
2398    ///
2399    /// # Example
2400    /// ```ignore,no_run
2401    /// # use google_cloud_storage::model::GetObjectRequest;
2402    /// let x = GetObjectRequest::new().set_if_generation_match(42);
2403    /// ```
2404    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2405    where
2406        T: std::convert::Into<i64>,
2407    {
2408        self.if_generation_match = std::option::Option::Some(v.into());
2409        self
2410    }
2411
2412    /// Sets or clears the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
2413    ///
2414    /// # Example
2415    /// ```ignore,no_run
2416    /// # use google_cloud_storage::model::GetObjectRequest;
2417    /// let x = GetObjectRequest::new().set_or_clear_if_generation_match(Some(42));
2418    /// let x = GetObjectRequest::new().set_or_clear_if_generation_match(None::<i32>);
2419    /// ```
2420    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2421    where
2422        T: std::convert::Into<i64>,
2423    {
2424        self.if_generation_match = v.map(|x| x.into());
2425        self
2426    }
2427
2428    /// Sets the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
2429    ///
2430    /// # Example
2431    /// ```ignore,no_run
2432    /// # use google_cloud_storage::model::GetObjectRequest;
2433    /// let x = GetObjectRequest::new().set_if_generation_not_match(42);
2434    /// ```
2435    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2436    where
2437        T: std::convert::Into<i64>,
2438    {
2439        self.if_generation_not_match = std::option::Option::Some(v.into());
2440        self
2441    }
2442
2443    /// Sets or clears the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
2444    ///
2445    /// # Example
2446    /// ```ignore,no_run
2447    /// # use google_cloud_storage::model::GetObjectRequest;
2448    /// let x = GetObjectRequest::new().set_or_clear_if_generation_not_match(Some(42));
2449    /// let x = GetObjectRequest::new().set_or_clear_if_generation_not_match(None::<i32>);
2450    /// ```
2451    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2452    where
2453        T: std::convert::Into<i64>,
2454    {
2455        self.if_generation_not_match = v.map(|x| x.into());
2456        self
2457    }
2458
2459    /// Sets the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
2460    ///
2461    /// # Example
2462    /// ```ignore,no_run
2463    /// # use google_cloud_storage::model::GetObjectRequest;
2464    /// let x = GetObjectRequest::new().set_if_metageneration_match(42);
2465    /// ```
2466    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2467    where
2468        T: std::convert::Into<i64>,
2469    {
2470        self.if_metageneration_match = std::option::Option::Some(v.into());
2471        self
2472    }
2473
2474    /// Sets or clears the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
2475    ///
2476    /// # Example
2477    /// ```ignore,no_run
2478    /// # use google_cloud_storage::model::GetObjectRequest;
2479    /// let x = GetObjectRequest::new().set_or_clear_if_metageneration_match(Some(42));
2480    /// let x = GetObjectRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
2481    /// ```
2482    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2483    where
2484        T: std::convert::Into<i64>,
2485    {
2486        self.if_metageneration_match = v.map(|x| x.into());
2487        self
2488    }
2489
2490    /// Sets the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
2491    ///
2492    /// # Example
2493    /// ```ignore,no_run
2494    /// # use google_cloud_storage::model::GetObjectRequest;
2495    /// let x = GetObjectRequest::new().set_if_metageneration_not_match(42);
2496    /// ```
2497    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2498    where
2499        T: std::convert::Into<i64>,
2500    {
2501        self.if_metageneration_not_match = std::option::Option::Some(v.into());
2502        self
2503    }
2504
2505    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
2506    ///
2507    /// # Example
2508    /// ```ignore,no_run
2509    /// # use google_cloud_storage::model::GetObjectRequest;
2510    /// let x = GetObjectRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
2511    /// let x = GetObjectRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
2512    /// ```
2513    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2514    where
2515        T: std::convert::Into<i64>,
2516    {
2517        self.if_metageneration_not_match = v.map(|x| x.into());
2518        self
2519    }
2520
2521    /// Sets the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
2522    ///
2523    /// # Example
2524    /// ```ignore,no_run
2525    /// # use google_cloud_storage::model::GetObjectRequest;
2526    /// use google_cloud_storage::model::CommonObjectRequestParams;
2527    /// let x = GetObjectRequest::new().set_common_object_request_params(CommonObjectRequestParams::default()/* use setters */);
2528    /// ```
2529    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2530    where
2531        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2532    {
2533        self.common_object_request_params = std::option::Option::Some(v.into());
2534        self
2535    }
2536
2537    /// Sets or clears the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
2538    ///
2539    /// # Example
2540    /// ```ignore,no_run
2541    /// # use google_cloud_storage::model::GetObjectRequest;
2542    /// use google_cloud_storage::model::CommonObjectRequestParams;
2543    /// let x = GetObjectRequest::new().set_or_clear_common_object_request_params(Some(CommonObjectRequestParams::default()/* use setters */));
2544    /// let x = GetObjectRequest::new().set_or_clear_common_object_request_params(None::<CommonObjectRequestParams>);
2545    /// ```
2546    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
2547    where
2548        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2549    {
2550        self.common_object_request_params = v.map(|x| x.into());
2551        self
2552    }
2553
2554    /// Sets the value of [read_mask][crate::model::GetObjectRequest::read_mask].
2555    ///
2556    /// # Example
2557    /// ```ignore,no_run
2558    /// # use google_cloud_storage::model::GetObjectRequest;
2559    /// use wkt::FieldMask;
2560    /// let x = GetObjectRequest::new().set_read_mask(FieldMask::default()/* use setters */);
2561    /// ```
2562    pub fn set_read_mask<T>(mut self, v: T) -> Self
2563    where
2564        T: std::convert::Into<wkt::FieldMask>,
2565    {
2566        self.read_mask = std::option::Option::Some(v.into());
2567        self
2568    }
2569
2570    /// Sets or clears the value of [read_mask][crate::model::GetObjectRequest::read_mask].
2571    ///
2572    /// # Example
2573    /// ```ignore,no_run
2574    /// # use google_cloud_storage::model::GetObjectRequest;
2575    /// use wkt::FieldMask;
2576    /// let x = GetObjectRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
2577    /// let x = GetObjectRequest::new().set_or_clear_read_mask(None::<FieldMask>);
2578    /// ```
2579    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2580    where
2581        T: std::convert::Into<wkt::FieldMask>,
2582    {
2583        self.read_mask = v.map(|x| x.into());
2584        self
2585    }
2586
2587    /// Sets the value of [restore_token][crate::model::GetObjectRequest::restore_token].
2588    ///
2589    /// # Example
2590    /// ```ignore,no_run
2591    /// # use google_cloud_storage::model::GetObjectRequest;
2592    /// let x = GetObjectRequest::new().set_restore_token("example");
2593    /// ```
2594    pub fn set_restore_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2595        self.restore_token = v.into();
2596        self
2597    }
2598}
2599
2600impl wkt::message::Message for GetObjectRequest {
2601    fn typename() -> &'static str {
2602        "type.googleapis.com/google.storage.v2.GetObjectRequest"
2603    }
2604}
2605
2606/// Describes an attempt to insert an object, possibly over multiple requests.
2607#[derive(Clone, Default, PartialEq)]
2608#[non_exhaustive]
2609pub struct WriteObjectSpec {
2610    /// Required. Destination object, including its name and its metadata.
2611    pub resource: std::option::Option<crate::model::Object>,
2612
2613    /// Optional. Apply a predefined set of access controls to this object.
2614    /// Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
2615    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
2616    pub predefined_acl: std::string::String,
2617
2618    /// Makes the operation conditional on whether the object's current
2619    /// generation matches the given value. Setting to `0` makes the operation
2620    /// succeed only if there are no live versions of the object.
2621    pub if_generation_match: std::option::Option<i64>,
2622
2623    /// Makes the operation conditional on whether the object's live
2624    /// generation does not match the given value. If no live object exists, the
2625    /// precondition fails. Setting to `0` makes the operation succeed only if
2626    /// there is a live version of the object.
2627    pub if_generation_not_match: std::option::Option<i64>,
2628
2629    /// Makes the operation conditional on whether the object's current
2630    /// metageneration matches the given value.
2631    pub if_metageneration_match: std::option::Option<i64>,
2632
2633    /// Makes the operation conditional on whether the object's current
2634    /// metageneration does not match the given value.
2635    pub if_metageneration_not_match: std::option::Option<i64>,
2636
2637    /// The expected final object size being uploaded.
2638    /// If this value is set, closing the stream after writing fewer or more than
2639    /// `object_size` bytes results in an `OUT_OF_RANGE` error.
2640    ///
2641    /// This situation is considered a client error, and if such an error occurs
2642    /// you must start the upload over from scratch, this time sending the correct
2643    /// number of bytes.
2644    pub object_size: std::option::Option<i64>,
2645
2646    /// If `true`, the object is created in appendable mode.
2647    /// This field might only be set when using `BidiWriteObject`.
2648    pub appendable: std::option::Option<bool>,
2649
2650    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2651}
2652
2653impl WriteObjectSpec {
2654    pub fn new() -> Self {
2655        std::default::Default::default()
2656    }
2657
2658    /// Sets the value of [resource][crate::model::WriteObjectSpec::resource].
2659    ///
2660    /// # Example
2661    /// ```ignore,no_run
2662    /// # use google_cloud_storage::model::WriteObjectSpec;
2663    /// use google_cloud_storage::model::Object;
2664    /// let x = WriteObjectSpec::new().set_resource(Object::default()/* use setters */);
2665    /// ```
2666    pub fn set_resource<T>(mut self, v: T) -> Self
2667    where
2668        T: std::convert::Into<crate::model::Object>,
2669    {
2670        self.resource = std::option::Option::Some(v.into());
2671        self
2672    }
2673
2674    /// Sets or clears the value of [resource][crate::model::WriteObjectSpec::resource].
2675    ///
2676    /// # Example
2677    /// ```ignore,no_run
2678    /// # use google_cloud_storage::model::WriteObjectSpec;
2679    /// use google_cloud_storage::model::Object;
2680    /// let x = WriteObjectSpec::new().set_or_clear_resource(Some(Object::default()/* use setters */));
2681    /// let x = WriteObjectSpec::new().set_or_clear_resource(None::<Object>);
2682    /// ```
2683    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2684    where
2685        T: std::convert::Into<crate::model::Object>,
2686    {
2687        self.resource = v.map(|x| x.into());
2688        self
2689    }
2690
2691    /// Sets the value of [predefined_acl][crate::model::WriteObjectSpec::predefined_acl].
2692    ///
2693    /// # Example
2694    /// ```ignore,no_run
2695    /// # use google_cloud_storage::model::WriteObjectSpec;
2696    /// let x = WriteObjectSpec::new().set_predefined_acl("example");
2697    /// ```
2698    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2699        self.predefined_acl = v.into();
2700        self
2701    }
2702
2703    /// Sets the value of [if_generation_match][crate::model::WriteObjectSpec::if_generation_match].
2704    ///
2705    /// # Example
2706    /// ```ignore,no_run
2707    /// # use google_cloud_storage::model::WriteObjectSpec;
2708    /// let x = WriteObjectSpec::new().set_if_generation_match(42);
2709    /// ```
2710    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2711    where
2712        T: std::convert::Into<i64>,
2713    {
2714        self.if_generation_match = std::option::Option::Some(v.into());
2715        self
2716    }
2717
2718    /// Sets or clears the value of [if_generation_match][crate::model::WriteObjectSpec::if_generation_match].
2719    ///
2720    /// # Example
2721    /// ```ignore,no_run
2722    /// # use google_cloud_storage::model::WriteObjectSpec;
2723    /// let x = WriteObjectSpec::new().set_or_clear_if_generation_match(Some(42));
2724    /// let x = WriteObjectSpec::new().set_or_clear_if_generation_match(None::<i32>);
2725    /// ```
2726    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2727    where
2728        T: std::convert::Into<i64>,
2729    {
2730        self.if_generation_match = v.map(|x| x.into());
2731        self
2732    }
2733
2734    /// Sets the value of [if_generation_not_match][crate::model::WriteObjectSpec::if_generation_not_match].
2735    ///
2736    /// # Example
2737    /// ```ignore,no_run
2738    /// # use google_cloud_storage::model::WriteObjectSpec;
2739    /// let x = WriteObjectSpec::new().set_if_generation_not_match(42);
2740    /// ```
2741    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2742    where
2743        T: std::convert::Into<i64>,
2744    {
2745        self.if_generation_not_match = std::option::Option::Some(v.into());
2746        self
2747    }
2748
2749    /// Sets or clears the value of [if_generation_not_match][crate::model::WriteObjectSpec::if_generation_not_match].
2750    ///
2751    /// # Example
2752    /// ```ignore,no_run
2753    /// # use google_cloud_storage::model::WriteObjectSpec;
2754    /// let x = WriteObjectSpec::new().set_or_clear_if_generation_not_match(Some(42));
2755    /// let x = WriteObjectSpec::new().set_or_clear_if_generation_not_match(None::<i32>);
2756    /// ```
2757    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2758    where
2759        T: std::convert::Into<i64>,
2760    {
2761        self.if_generation_not_match = v.map(|x| x.into());
2762        self
2763    }
2764
2765    /// Sets the value of [if_metageneration_match][crate::model::WriteObjectSpec::if_metageneration_match].
2766    ///
2767    /// # Example
2768    /// ```ignore,no_run
2769    /// # use google_cloud_storage::model::WriteObjectSpec;
2770    /// let x = WriteObjectSpec::new().set_if_metageneration_match(42);
2771    /// ```
2772    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2773    where
2774        T: std::convert::Into<i64>,
2775    {
2776        self.if_metageneration_match = std::option::Option::Some(v.into());
2777        self
2778    }
2779
2780    /// Sets or clears the value of [if_metageneration_match][crate::model::WriteObjectSpec::if_metageneration_match].
2781    ///
2782    /// # Example
2783    /// ```ignore,no_run
2784    /// # use google_cloud_storage::model::WriteObjectSpec;
2785    /// let x = WriteObjectSpec::new().set_or_clear_if_metageneration_match(Some(42));
2786    /// let x = WriteObjectSpec::new().set_or_clear_if_metageneration_match(None::<i32>);
2787    /// ```
2788    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2789    where
2790        T: std::convert::Into<i64>,
2791    {
2792        self.if_metageneration_match = v.map(|x| x.into());
2793        self
2794    }
2795
2796    /// Sets the value of [if_metageneration_not_match][crate::model::WriteObjectSpec::if_metageneration_not_match].
2797    ///
2798    /// # Example
2799    /// ```ignore,no_run
2800    /// # use google_cloud_storage::model::WriteObjectSpec;
2801    /// let x = WriteObjectSpec::new().set_if_metageneration_not_match(42);
2802    /// ```
2803    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2804    where
2805        T: std::convert::Into<i64>,
2806    {
2807        self.if_metageneration_not_match = std::option::Option::Some(v.into());
2808        self
2809    }
2810
2811    /// Sets or clears the value of [if_metageneration_not_match][crate::model::WriteObjectSpec::if_metageneration_not_match].
2812    ///
2813    /// # Example
2814    /// ```ignore,no_run
2815    /// # use google_cloud_storage::model::WriteObjectSpec;
2816    /// let x = WriteObjectSpec::new().set_or_clear_if_metageneration_not_match(Some(42));
2817    /// let x = WriteObjectSpec::new().set_or_clear_if_metageneration_not_match(None::<i32>);
2818    /// ```
2819    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2820    where
2821        T: std::convert::Into<i64>,
2822    {
2823        self.if_metageneration_not_match = v.map(|x| x.into());
2824        self
2825    }
2826
2827    /// Sets the value of [object_size][crate::model::WriteObjectSpec::object_size].
2828    ///
2829    /// # Example
2830    /// ```ignore,no_run
2831    /// # use google_cloud_storage::model::WriteObjectSpec;
2832    /// let x = WriteObjectSpec::new().set_object_size(42);
2833    /// ```
2834    pub fn set_object_size<T>(mut self, v: T) -> Self
2835    where
2836        T: std::convert::Into<i64>,
2837    {
2838        self.object_size = std::option::Option::Some(v.into());
2839        self
2840    }
2841
2842    /// Sets or clears the value of [object_size][crate::model::WriteObjectSpec::object_size].
2843    ///
2844    /// # Example
2845    /// ```ignore,no_run
2846    /// # use google_cloud_storage::model::WriteObjectSpec;
2847    /// let x = WriteObjectSpec::new().set_or_clear_object_size(Some(42));
2848    /// let x = WriteObjectSpec::new().set_or_clear_object_size(None::<i32>);
2849    /// ```
2850    pub fn set_or_clear_object_size<T>(mut self, v: std::option::Option<T>) -> Self
2851    where
2852        T: std::convert::Into<i64>,
2853    {
2854        self.object_size = v.map(|x| x.into());
2855        self
2856    }
2857
2858    /// Sets the value of [appendable][crate::model::WriteObjectSpec::appendable].
2859    ///
2860    /// # Example
2861    /// ```ignore,no_run
2862    /// # use google_cloud_storage::model::WriteObjectSpec;
2863    /// let x = WriteObjectSpec::new().set_appendable(true);
2864    /// ```
2865    pub fn set_appendable<T>(mut self, v: T) -> Self
2866    where
2867        T: std::convert::Into<bool>,
2868    {
2869        self.appendable = std::option::Option::Some(v.into());
2870        self
2871    }
2872
2873    /// Sets or clears the value of [appendable][crate::model::WriteObjectSpec::appendable].
2874    ///
2875    /// # Example
2876    /// ```ignore,no_run
2877    /// # use google_cloud_storage::model::WriteObjectSpec;
2878    /// let x = WriteObjectSpec::new().set_or_clear_appendable(Some(false));
2879    /// let x = WriteObjectSpec::new().set_or_clear_appendable(None::<bool>);
2880    /// ```
2881    pub fn set_or_clear_appendable<T>(mut self, v: std::option::Option<T>) -> Self
2882    where
2883        T: std::convert::Into<bool>,
2884    {
2885        self.appendable = v.map(|x| x.into());
2886        self
2887    }
2888}
2889
2890impl wkt::message::Message for WriteObjectSpec {
2891    fn typename() -> &'static str {
2892        "type.googleapis.com/google.storage.v2.WriteObjectSpec"
2893    }
2894}
2895
2896/// Request message for [ListObjects][google.storage.v2.Storage.ListObjects].
2897///
2898/// [google.storage.v2.Storage.ListObjects]: crate::client::StorageControl::list_objects
2899#[derive(Clone, Default, PartialEq)]
2900#[non_exhaustive]
2901pub struct ListObjectsRequest {
2902    /// Required. Name of the bucket in which to look for objects.
2903    pub parent: std::string::String,
2904
2905    /// Optional. Maximum number of `items` plus `prefixes` to return
2906    /// in a single page of responses. As duplicate `prefixes` are
2907    /// omitted, fewer total results might be returned than requested. The service
2908    /// uses this parameter or 1,000 items, whichever is smaller.
2909    pub page_size: i32,
2910
2911    /// Optional. A previously-returned page token representing part of the larger
2912    /// set of results to view.
2913    pub page_token: std::string::String,
2914
2915    /// Optional. If set, returns results in a directory-like mode. `items`
2916    /// contains only objects whose names, aside from the `prefix`, do not contain
2917    /// `delimiter`. Objects whose names, aside from the `prefix`, contain
2918    /// `delimiter` has their name, truncated after the `delimiter`, returned in
2919    /// `prefixes`. Duplicate `prefixes` are omitted.
2920    pub delimiter: std::string::String,
2921
2922    /// Optional. If true, objects that end in exactly one instance of `delimiter`
2923    /// has their metadata included in `items` in addition to
2924    /// `prefixes`.
2925    pub include_trailing_delimiter: bool,
2926
2927    /// Optional. Filter results to objects whose names begin with this prefix.
2928    pub prefix: std::string::String,
2929
2930    /// Optional. If `true`, lists all versions of an object as distinct results.
2931    pub versions: bool,
2932
2933    /// Mask specifying which fields to read from each result.
2934    /// If no mask is specified, defaults to all fields except `items.acl` and
2935    /// `items.owner`.
2936    /// `*` might be used to mean all fields.
2937    pub read_mask: std::option::Option<wkt::FieldMask>,
2938
2939    /// Optional. Filter results to objects whose names are lexicographically equal
2940    /// to or after `lexicographic_start`. If `lexicographic_end` is also set, the
2941    /// objects listed have names between `lexicographic_start` (inclusive) and
2942    /// `lexicographic_end` (exclusive).
2943    pub lexicographic_start: std::string::String,
2944
2945    /// Optional. Filter results to objects whose names are lexicographically
2946    /// before `lexicographic_end`. If `lexicographic_start` is also set, the
2947    /// objects listed have names between `lexicographic_start` (inclusive) and
2948    /// `lexicographic_end` (exclusive).
2949    pub lexicographic_end: std::string::String,
2950
2951    /// Optional. If true, only list all soft-deleted versions of the object.
2952    /// Soft delete policy is required to set this option.
2953    pub soft_deleted: bool,
2954
2955    /// Optional. If true, includes folders and managed folders (besides objects)
2956    /// in the returned `prefixes`. Requires `delimiter` to be set to '/'.
2957    pub include_folders_as_prefixes: bool,
2958
2959    /// Optional. Filter results to objects and prefixes that match this glob
2960    /// pattern. See [List objects using
2961    /// glob](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob)
2962    /// for the full syntax.
2963    pub match_glob: std::string::String,
2964
2965    /// Optional. An expression used to filter the returned objects by the
2966    /// `context` field. For the full syntax, see [Filter objects by contexts
2967    /// syntax](https://cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts-syntax).
2968    /// If a `delimiter` is set, the returned `prefixes` are exempt from this
2969    /// filter.
2970    pub filter: std::string::String,
2971
2972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2973}
2974
2975impl ListObjectsRequest {
2976    pub fn new() -> Self {
2977        std::default::Default::default()
2978    }
2979
2980    /// Sets the value of [parent][crate::model::ListObjectsRequest::parent].
2981    ///
2982    /// # Example
2983    /// ```ignore,no_run
2984    /// # use google_cloud_storage::model::ListObjectsRequest;
2985    /// let x = ListObjectsRequest::new().set_parent("example");
2986    /// ```
2987    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2988        self.parent = v.into();
2989        self
2990    }
2991
2992    /// Sets the value of [page_size][crate::model::ListObjectsRequest::page_size].
2993    ///
2994    /// # Example
2995    /// ```ignore,no_run
2996    /// # use google_cloud_storage::model::ListObjectsRequest;
2997    /// let x = ListObjectsRequest::new().set_page_size(42);
2998    /// ```
2999    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3000        self.page_size = v.into();
3001        self
3002    }
3003
3004    /// Sets the value of [page_token][crate::model::ListObjectsRequest::page_token].
3005    ///
3006    /// # Example
3007    /// ```ignore,no_run
3008    /// # use google_cloud_storage::model::ListObjectsRequest;
3009    /// let x = ListObjectsRequest::new().set_page_token("example");
3010    /// ```
3011    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3012        self.page_token = v.into();
3013        self
3014    }
3015
3016    /// Sets the value of [delimiter][crate::model::ListObjectsRequest::delimiter].
3017    ///
3018    /// # Example
3019    /// ```ignore,no_run
3020    /// # use google_cloud_storage::model::ListObjectsRequest;
3021    /// let x = ListObjectsRequest::new().set_delimiter("example");
3022    /// ```
3023    pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3024        self.delimiter = v.into();
3025        self
3026    }
3027
3028    /// Sets the value of [include_trailing_delimiter][crate::model::ListObjectsRequest::include_trailing_delimiter].
3029    ///
3030    /// # Example
3031    /// ```ignore,no_run
3032    /// # use google_cloud_storage::model::ListObjectsRequest;
3033    /// let x = ListObjectsRequest::new().set_include_trailing_delimiter(true);
3034    /// ```
3035    pub fn set_include_trailing_delimiter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3036        self.include_trailing_delimiter = v.into();
3037        self
3038    }
3039
3040    /// Sets the value of [prefix][crate::model::ListObjectsRequest::prefix].
3041    ///
3042    /// # Example
3043    /// ```ignore,no_run
3044    /// # use google_cloud_storage::model::ListObjectsRequest;
3045    /// let x = ListObjectsRequest::new().set_prefix("example");
3046    /// ```
3047    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3048        self.prefix = v.into();
3049        self
3050    }
3051
3052    /// Sets the value of [versions][crate::model::ListObjectsRequest::versions].
3053    ///
3054    /// # Example
3055    /// ```ignore,no_run
3056    /// # use google_cloud_storage::model::ListObjectsRequest;
3057    /// let x = ListObjectsRequest::new().set_versions(true);
3058    /// ```
3059    pub fn set_versions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3060        self.versions = v.into();
3061        self
3062    }
3063
3064    /// Sets the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
3065    ///
3066    /// # Example
3067    /// ```ignore,no_run
3068    /// # use google_cloud_storage::model::ListObjectsRequest;
3069    /// use wkt::FieldMask;
3070    /// let x = ListObjectsRequest::new().set_read_mask(FieldMask::default()/* use setters */);
3071    /// ```
3072    pub fn set_read_mask<T>(mut self, v: T) -> Self
3073    where
3074        T: std::convert::Into<wkt::FieldMask>,
3075    {
3076        self.read_mask = std::option::Option::Some(v.into());
3077        self
3078    }
3079
3080    /// Sets or clears the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
3081    ///
3082    /// # Example
3083    /// ```ignore,no_run
3084    /// # use google_cloud_storage::model::ListObjectsRequest;
3085    /// use wkt::FieldMask;
3086    /// let x = ListObjectsRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
3087    /// let x = ListObjectsRequest::new().set_or_clear_read_mask(None::<FieldMask>);
3088    /// ```
3089    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
3090    where
3091        T: std::convert::Into<wkt::FieldMask>,
3092    {
3093        self.read_mask = v.map(|x| x.into());
3094        self
3095    }
3096
3097    /// Sets the value of [lexicographic_start][crate::model::ListObjectsRequest::lexicographic_start].
3098    ///
3099    /// # Example
3100    /// ```ignore,no_run
3101    /// # use google_cloud_storage::model::ListObjectsRequest;
3102    /// let x = ListObjectsRequest::new().set_lexicographic_start("example");
3103    /// ```
3104    pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
3105        mut self,
3106        v: T,
3107    ) -> Self {
3108        self.lexicographic_start = v.into();
3109        self
3110    }
3111
3112    /// Sets the value of [lexicographic_end][crate::model::ListObjectsRequest::lexicographic_end].
3113    ///
3114    /// # Example
3115    /// ```ignore,no_run
3116    /// # use google_cloud_storage::model::ListObjectsRequest;
3117    /// let x = ListObjectsRequest::new().set_lexicographic_end("example");
3118    /// ```
3119    pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
3120        mut self,
3121        v: T,
3122    ) -> Self {
3123        self.lexicographic_end = v.into();
3124        self
3125    }
3126
3127    /// Sets the value of [soft_deleted][crate::model::ListObjectsRequest::soft_deleted].
3128    ///
3129    /// # Example
3130    /// ```ignore,no_run
3131    /// # use google_cloud_storage::model::ListObjectsRequest;
3132    /// let x = ListObjectsRequest::new().set_soft_deleted(true);
3133    /// ```
3134    pub fn set_soft_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3135        self.soft_deleted = v.into();
3136        self
3137    }
3138
3139    /// Sets the value of [include_folders_as_prefixes][crate::model::ListObjectsRequest::include_folders_as_prefixes].
3140    ///
3141    /// # Example
3142    /// ```ignore,no_run
3143    /// # use google_cloud_storage::model::ListObjectsRequest;
3144    /// let x = ListObjectsRequest::new().set_include_folders_as_prefixes(true);
3145    /// ```
3146    pub fn set_include_folders_as_prefixes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3147        self.include_folders_as_prefixes = v.into();
3148        self
3149    }
3150
3151    /// Sets the value of [match_glob][crate::model::ListObjectsRequest::match_glob].
3152    ///
3153    /// # Example
3154    /// ```ignore,no_run
3155    /// # use google_cloud_storage::model::ListObjectsRequest;
3156    /// let x = ListObjectsRequest::new().set_match_glob("example");
3157    /// ```
3158    pub fn set_match_glob<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3159        self.match_glob = v.into();
3160        self
3161    }
3162
3163    /// Sets the value of [filter][crate::model::ListObjectsRequest::filter].
3164    ///
3165    /// # Example
3166    /// ```ignore,no_run
3167    /// # use google_cloud_storage::model::ListObjectsRequest;
3168    /// let x = ListObjectsRequest::new().set_filter("example");
3169    /// ```
3170    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3171        self.filter = v.into();
3172        self
3173    }
3174}
3175
3176impl wkt::message::Message for ListObjectsRequest {
3177    fn typename() -> &'static str {
3178        "type.googleapis.com/google.storage.v2.ListObjectsRequest"
3179    }
3180}
3181
3182/// Request message for [RewriteObject][google.storage.v2.Storage.RewriteObject].
3183/// If the source object is encrypted using a Customer-Supplied Encryption Key
3184/// the key information must be provided in the
3185/// `copy_source_encryption_algorithm`, `copy_source_encryption_key_bytes`, and
3186/// `copy_source_encryption_key_sha256_bytes` fields. If the destination object
3187/// should be encrypted the keying information should be provided in the
3188/// `encryption_algorithm`, `encryption_key_bytes`, and
3189/// `encryption_key_sha256_bytes` fields of the
3190/// `common_object_request_params.customer_encryption` field.
3191///
3192/// [google.storage.v2.Storage.RewriteObject]: crate::client::StorageControl::rewrite_object
3193#[derive(Clone, Default, PartialEq)]
3194#[non_exhaustive]
3195pub struct RewriteObjectRequest {
3196    /// Required. Immutable. The name of the destination object.
3197    /// See the
3198    /// [Naming Guidelines](https://cloud.google.com/storage/docs/objects#naming).
3199    /// Example: `test.txt`
3200    /// The `name` field by itself does not uniquely identify a Cloud Storage
3201    /// object. A Cloud Storage object is uniquely identified by the tuple of
3202    /// (bucket, object, generation).
3203    pub destination_name: std::string::String,
3204
3205    /// Required. Immutable. The name of the bucket containing the destination
3206    /// object.
3207    pub destination_bucket: std::string::String,
3208
3209    /// Optional. The name of the Cloud KMS key that is used to encrypt the
3210    /// destination object. The Cloud KMS key must be located in same location as
3211    /// the object. If the parameter is not specified, the request uses the
3212    /// destination bucket's default encryption key, if any, or else the
3213    /// Google-managed encryption key.
3214    pub destination_kms_key: std::string::String,
3215
3216    /// Optional. Properties of the destination, post-rewrite object.
3217    /// The `name`, `bucket` and `kms_key` fields must not be populated (these
3218    /// values are specified in the `destination_name`, `destination_bucket`, and
3219    /// `destination_kms_key` fields).
3220    /// If `destination` is present it is used to construct the destination
3221    /// object's metadata; otherwise the destination object's metadata is
3222    /// copied from the source object.
3223    pub destination: std::option::Option<crate::model::Object>,
3224
3225    /// Required. Name of the bucket in which to find the source object.
3226    pub source_bucket: std::string::String,
3227
3228    /// Required. Name of the source object.
3229    pub source_object: std::string::String,
3230
3231    /// Optional. If present, selects a specific revision of the source object (as
3232    /// opposed to the latest version, the default).
3233    pub source_generation: i64,
3234
3235    /// Optional. Include this field (from the previous rewrite response) on each
3236    /// rewrite request after the first one, until the rewrite response 'done' flag
3237    /// is true. Calls that provide a rewriteToken can omit all other request
3238    /// fields, but if included those fields must match the values provided in the
3239    /// first rewrite request.
3240    pub rewrite_token: std::string::String,
3241
3242    /// Optional. Apply a predefined set of access controls to the destination
3243    /// object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
3244    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
3245    pub destination_predefined_acl: std::string::String,
3246
3247    /// Makes the operation conditional on whether the object's current generation
3248    /// matches the given value. Setting to 0 makes the operation succeed only if
3249    /// there are no live versions of the object.
3250    pub if_generation_match: std::option::Option<i64>,
3251
3252    /// Makes the operation conditional on whether the object's live generation
3253    /// does not match the given value. If no live object exists, the precondition
3254    /// fails. Setting to 0 makes the operation succeed only if there is a live
3255    /// version of the object.
3256    pub if_generation_not_match: std::option::Option<i64>,
3257
3258    /// Makes the operation conditional on whether the destination object's current
3259    /// metageneration matches the given value.
3260    pub if_metageneration_match: std::option::Option<i64>,
3261
3262    /// Makes the operation conditional on whether the destination object's current
3263    /// metageneration does not match the given value.
3264    pub if_metageneration_not_match: std::option::Option<i64>,
3265
3266    /// Makes the operation conditional on whether the source object's live
3267    /// generation matches the given value.
3268    pub if_source_generation_match: std::option::Option<i64>,
3269
3270    /// Makes the operation conditional on whether the source object's live
3271    /// generation does not match the given value.
3272    pub if_source_generation_not_match: std::option::Option<i64>,
3273
3274    /// Makes the operation conditional on whether the source object's current
3275    /// metageneration matches the given value.
3276    pub if_source_metageneration_match: std::option::Option<i64>,
3277
3278    /// Makes the operation conditional on whether the source object's current
3279    /// metageneration does not match the given value.
3280    pub if_source_metageneration_not_match: std::option::Option<i64>,
3281
3282    /// Optional. The maximum number of bytes that are rewritten per rewrite
3283    /// request. Most callers shouldn't need to specify this parameter - it is
3284    /// primarily in place to support testing. If specified the value must be an
3285    /// integral multiple of 1 MiB (1048576). Also, this only applies to requests
3286    /// where the source and destination span locations and/or storage classes.
3287    /// Finally, this value must not change across rewrite calls else you'll get an
3288    /// error that the `rewriteToken` is invalid.
3289    pub max_bytes_rewritten_per_call: i64,
3290
3291    /// Optional. The algorithm used to encrypt the source object, if any. Used if
3292    /// the source object was encrypted with a Customer-Supplied Encryption Key.
3293    pub copy_source_encryption_algorithm: std::string::String,
3294
3295    /// Optional. The raw bytes (not base64-encoded) AES-256 encryption key used to
3296    /// encrypt the source object, if it was encrypted with a Customer-Supplied
3297    /// Encryption Key.
3298    pub copy_source_encryption_key_bytes: ::bytes::Bytes,
3299
3300    /// Optional. The raw bytes (not base64-encoded) SHA256 hash of the encryption
3301    /// key used to encrypt the source object, if it was encrypted with a
3302    /// Customer-Supplied Encryption Key.
3303    pub copy_source_encryption_key_sha256_bytes: ::bytes::Bytes,
3304
3305    /// Optional. A set of parameters common to Storage API requests concerning an
3306    /// object.
3307    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
3308
3309    /// Optional. The checksums of the complete object. This is used to validate
3310    /// the destination object after rewriting.
3311    pub object_checksums: std::option::Option<crate::model::ObjectChecksums>,
3312
3313    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3314}
3315
3316impl RewriteObjectRequest {
3317    pub fn new() -> Self {
3318        std::default::Default::default()
3319    }
3320
3321    /// Sets the value of [destination_name][crate::model::RewriteObjectRequest::destination_name].
3322    ///
3323    /// # Example
3324    /// ```ignore,no_run
3325    /// # use google_cloud_storage::model::RewriteObjectRequest;
3326    /// let x = RewriteObjectRequest::new().set_destination_name("example");
3327    /// ```
3328    pub fn set_destination_name<T: std::convert::Into<std::string::String>>(
3329        mut self,
3330        v: T,
3331    ) -> Self {
3332        self.destination_name = v.into();
3333        self
3334    }
3335
3336    /// Sets the value of [destination_bucket][crate::model::RewriteObjectRequest::destination_bucket].
3337    ///
3338    /// # Example
3339    /// ```ignore,no_run
3340    /// # use google_cloud_storage::model::RewriteObjectRequest;
3341    /// let x = RewriteObjectRequest::new().set_destination_bucket("example");
3342    /// ```
3343    pub fn set_destination_bucket<T: std::convert::Into<std::string::String>>(
3344        mut self,
3345        v: T,
3346    ) -> Self {
3347        self.destination_bucket = v.into();
3348        self
3349    }
3350
3351    /// Sets the value of [destination_kms_key][crate::model::RewriteObjectRequest::destination_kms_key].
3352    ///
3353    /// # Example
3354    /// ```ignore,no_run
3355    /// # use google_cloud_storage::model::RewriteObjectRequest;
3356    /// let x = RewriteObjectRequest::new().set_destination_kms_key("example");
3357    /// ```
3358    pub fn set_destination_kms_key<T: std::convert::Into<std::string::String>>(
3359        mut self,
3360        v: T,
3361    ) -> Self {
3362        self.destination_kms_key = v.into();
3363        self
3364    }
3365
3366    /// Sets the value of [destination][crate::model::RewriteObjectRequest::destination].
3367    ///
3368    /// # Example
3369    /// ```ignore,no_run
3370    /// # use google_cloud_storage::model::RewriteObjectRequest;
3371    /// use google_cloud_storage::model::Object;
3372    /// let x = RewriteObjectRequest::new().set_destination(Object::default()/* use setters */);
3373    /// ```
3374    pub fn set_destination<T>(mut self, v: T) -> Self
3375    where
3376        T: std::convert::Into<crate::model::Object>,
3377    {
3378        self.destination = std::option::Option::Some(v.into());
3379        self
3380    }
3381
3382    /// Sets or clears the value of [destination][crate::model::RewriteObjectRequest::destination].
3383    ///
3384    /// # Example
3385    /// ```ignore,no_run
3386    /// # use google_cloud_storage::model::RewriteObjectRequest;
3387    /// use google_cloud_storage::model::Object;
3388    /// let x = RewriteObjectRequest::new().set_or_clear_destination(Some(Object::default()/* use setters */));
3389    /// let x = RewriteObjectRequest::new().set_or_clear_destination(None::<Object>);
3390    /// ```
3391    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
3392    where
3393        T: std::convert::Into<crate::model::Object>,
3394    {
3395        self.destination = v.map(|x| x.into());
3396        self
3397    }
3398
3399    /// Sets the value of [source_bucket][crate::model::RewriteObjectRequest::source_bucket].
3400    ///
3401    /// # Example
3402    /// ```ignore,no_run
3403    /// # use google_cloud_storage::model::RewriteObjectRequest;
3404    /// let x = RewriteObjectRequest::new().set_source_bucket("example");
3405    /// ```
3406    pub fn set_source_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3407        self.source_bucket = v.into();
3408        self
3409    }
3410
3411    /// Sets the value of [source_object][crate::model::RewriteObjectRequest::source_object].
3412    ///
3413    /// # Example
3414    /// ```ignore,no_run
3415    /// # use google_cloud_storage::model::RewriteObjectRequest;
3416    /// let x = RewriteObjectRequest::new().set_source_object("example");
3417    /// ```
3418    pub fn set_source_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3419        self.source_object = v.into();
3420        self
3421    }
3422
3423    /// Sets the value of [source_generation][crate::model::RewriteObjectRequest::source_generation].
3424    ///
3425    /// # Example
3426    /// ```ignore,no_run
3427    /// # use google_cloud_storage::model::RewriteObjectRequest;
3428    /// let x = RewriteObjectRequest::new().set_source_generation(42);
3429    /// ```
3430    pub fn set_source_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3431        self.source_generation = v.into();
3432        self
3433    }
3434
3435    /// Sets the value of [rewrite_token][crate::model::RewriteObjectRequest::rewrite_token].
3436    ///
3437    /// # Example
3438    /// ```ignore,no_run
3439    /// # use google_cloud_storage::model::RewriteObjectRequest;
3440    /// let x = RewriteObjectRequest::new().set_rewrite_token("example");
3441    /// ```
3442    pub fn set_rewrite_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3443        self.rewrite_token = v.into();
3444        self
3445    }
3446
3447    /// Sets the value of [destination_predefined_acl][crate::model::RewriteObjectRequest::destination_predefined_acl].
3448    ///
3449    /// # Example
3450    /// ```ignore,no_run
3451    /// # use google_cloud_storage::model::RewriteObjectRequest;
3452    /// let x = RewriteObjectRequest::new().set_destination_predefined_acl("example");
3453    /// ```
3454    pub fn set_destination_predefined_acl<T: std::convert::Into<std::string::String>>(
3455        mut self,
3456        v: T,
3457    ) -> Self {
3458        self.destination_predefined_acl = v.into();
3459        self
3460    }
3461
3462    /// Sets the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
3463    ///
3464    /// # Example
3465    /// ```ignore,no_run
3466    /// # use google_cloud_storage::model::RewriteObjectRequest;
3467    /// let x = RewriteObjectRequest::new().set_if_generation_match(42);
3468    /// ```
3469    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
3470    where
3471        T: std::convert::Into<i64>,
3472    {
3473        self.if_generation_match = std::option::Option::Some(v.into());
3474        self
3475    }
3476
3477    /// Sets or clears the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
3478    ///
3479    /// # Example
3480    /// ```ignore,no_run
3481    /// # use google_cloud_storage::model::RewriteObjectRequest;
3482    /// let x = RewriteObjectRequest::new().set_or_clear_if_generation_match(Some(42));
3483    /// let x = RewriteObjectRequest::new().set_or_clear_if_generation_match(None::<i32>);
3484    /// ```
3485    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
3486    where
3487        T: std::convert::Into<i64>,
3488    {
3489        self.if_generation_match = v.map(|x| x.into());
3490        self
3491    }
3492
3493    /// Sets the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
3494    ///
3495    /// # Example
3496    /// ```ignore,no_run
3497    /// # use google_cloud_storage::model::RewriteObjectRequest;
3498    /// let x = RewriteObjectRequest::new().set_if_generation_not_match(42);
3499    /// ```
3500    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
3501    where
3502        T: std::convert::Into<i64>,
3503    {
3504        self.if_generation_not_match = std::option::Option::Some(v.into());
3505        self
3506    }
3507
3508    /// Sets or clears the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
3509    ///
3510    /// # Example
3511    /// ```ignore,no_run
3512    /// # use google_cloud_storage::model::RewriteObjectRequest;
3513    /// let x = RewriteObjectRequest::new().set_or_clear_if_generation_not_match(Some(42));
3514    /// let x = RewriteObjectRequest::new().set_or_clear_if_generation_not_match(None::<i32>);
3515    /// ```
3516    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
3517    where
3518        T: std::convert::Into<i64>,
3519    {
3520        self.if_generation_not_match = v.map(|x| x.into());
3521        self
3522    }
3523
3524    /// Sets the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
3525    ///
3526    /// # Example
3527    /// ```ignore,no_run
3528    /// # use google_cloud_storage::model::RewriteObjectRequest;
3529    /// let x = RewriteObjectRequest::new().set_if_metageneration_match(42);
3530    /// ```
3531    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
3532    where
3533        T: std::convert::Into<i64>,
3534    {
3535        self.if_metageneration_match = std::option::Option::Some(v.into());
3536        self
3537    }
3538
3539    /// Sets or clears the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
3540    ///
3541    /// # Example
3542    /// ```ignore,no_run
3543    /// # use google_cloud_storage::model::RewriteObjectRequest;
3544    /// let x = RewriteObjectRequest::new().set_or_clear_if_metageneration_match(Some(42));
3545    /// let x = RewriteObjectRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
3546    /// ```
3547    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
3548    where
3549        T: std::convert::Into<i64>,
3550    {
3551        self.if_metageneration_match = v.map(|x| x.into());
3552        self
3553    }
3554
3555    /// Sets the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
3556    ///
3557    /// # Example
3558    /// ```ignore,no_run
3559    /// # use google_cloud_storage::model::RewriteObjectRequest;
3560    /// let x = RewriteObjectRequest::new().set_if_metageneration_not_match(42);
3561    /// ```
3562    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
3563    where
3564        T: std::convert::Into<i64>,
3565    {
3566        self.if_metageneration_not_match = std::option::Option::Some(v.into());
3567        self
3568    }
3569
3570    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
3571    ///
3572    /// # Example
3573    /// ```ignore,no_run
3574    /// # use google_cloud_storage::model::RewriteObjectRequest;
3575    /// let x = RewriteObjectRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
3576    /// let x = RewriteObjectRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
3577    /// ```
3578    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
3579    where
3580        T: std::convert::Into<i64>,
3581    {
3582        self.if_metageneration_not_match = v.map(|x| x.into());
3583        self
3584    }
3585
3586    /// Sets the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
3587    ///
3588    /// # Example
3589    /// ```ignore,no_run
3590    /// # use google_cloud_storage::model::RewriteObjectRequest;
3591    /// let x = RewriteObjectRequest::new().set_if_source_generation_match(42);
3592    /// ```
3593    pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
3594    where
3595        T: std::convert::Into<i64>,
3596    {
3597        self.if_source_generation_match = std::option::Option::Some(v.into());
3598        self
3599    }
3600
3601    /// Sets or clears the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
3602    ///
3603    /// # Example
3604    /// ```ignore,no_run
3605    /// # use google_cloud_storage::model::RewriteObjectRequest;
3606    /// let x = RewriteObjectRequest::new().set_or_clear_if_source_generation_match(Some(42));
3607    /// let x = RewriteObjectRequest::new().set_or_clear_if_source_generation_match(None::<i32>);
3608    /// ```
3609    pub fn set_or_clear_if_source_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
3610    where
3611        T: std::convert::Into<i64>,
3612    {
3613        self.if_source_generation_match = v.map(|x| x.into());
3614        self
3615    }
3616
3617    /// Sets the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
3618    ///
3619    /// # Example
3620    /// ```ignore,no_run
3621    /// # use google_cloud_storage::model::RewriteObjectRequest;
3622    /// let x = RewriteObjectRequest::new().set_if_source_generation_not_match(42);
3623    /// ```
3624    pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
3625    where
3626        T: std::convert::Into<i64>,
3627    {
3628        self.if_source_generation_not_match = std::option::Option::Some(v.into());
3629        self
3630    }
3631
3632    /// Sets or clears the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
3633    ///
3634    /// # Example
3635    /// ```ignore,no_run
3636    /// # use google_cloud_storage::model::RewriteObjectRequest;
3637    /// let x = RewriteObjectRequest::new().set_or_clear_if_source_generation_not_match(Some(42));
3638    /// let x = RewriteObjectRequest::new().set_or_clear_if_source_generation_not_match(None::<i32>);
3639    /// ```
3640    pub fn set_or_clear_if_source_generation_not_match<T>(
3641        mut self,
3642        v: std::option::Option<T>,
3643    ) -> Self
3644    where
3645        T: std::convert::Into<i64>,
3646    {
3647        self.if_source_generation_not_match = v.map(|x| x.into());
3648        self
3649    }
3650
3651    /// Sets the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
3652    ///
3653    /// # Example
3654    /// ```ignore,no_run
3655    /// # use google_cloud_storage::model::RewriteObjectRequest;
3656    /// let x = RewriteObjectRequest::new().set_if_source_metageneration_match(42);
3657    /// ```
3658    pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
3659    where
3660        T: std::convert::Into<i64>,
3661    {
3662        self.if_source_metageneration_match = std::option::Option::Some(v.into());
3663        self
3664    }
3665
3666    /// Sets or clears the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
3667    ///
3668    /// # Example
3669    /// ```ignore,no_run
3670    /// # use google_cloud_storage::model::RewriteObjectRequest;
3671    /// let x = RewriteObjectRequest::new().set_or_clear_if_source_metageneration_match(Some(42));
3672    /// let x = RewriteObjectRequest::new().set_or_clear_if_source_metageneration_match(None::<i32>);
3673    /// ```
3674    pub fn set_or_clear_if_source_metageneration_match<T>(
3675        mut self,
3676        v: std::option::Option<T>,
3677    ) -> Self
3678    where
3679        T: std::convert::Into<i64>,
3680    {
3681        self.if_source_metageneration_match = v.map(|x| x.into());
3682        self
3683    }
3684
3685    /// Sets the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
3686    ///
3687    /// # Example
3688    /// ```ignore,no_run
3689    /// # use google_cloud_storage::model::RewriteObjectRequest;
3690    /// let x = RewriteObjectRequest::new().set_if_source_metageneration_not_match(42);
3691    /// ```
3692    pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
3693    where
3694        T: std::convert::Into<i64>,
3695    {
3696        self.if_source_metageneration_not_match = std::option::Option::Some(v.into());
3697        self
3698    }
3699
3700    /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
3701    ///
3702    /// # Example
3703    /// ```ignore,no_run
3704    /// # use google_cloud_storage::model::RewriteObjectRequest;
3705    /// let x = RewriteObjectRequest::new().set_or_clear_if_source_metageneration_not_match(Some(42));
3706    /// let x = RewriteObjectRequest::new().set_or_clear_if_source_metageneration_not_match(None::<i32>);
3707    /// ```
3708    pub fn set_or_clear_if_source_metageneration_not_match<T>(
3709        mut self,
3710        v: std::option::Option<T>,
3711    ) -> Self
3712    where
3713        T: std::convert::Into<i64>,
3714    {
3715        self.if_source_metageneration_not_match = v.map(|x| x.into());
3716        self
3717    }
3718
3719    /// Sets the value of [max_bytes_rewritten_per_call][crate::model::RewriteObjectRequest::max_bytes_rewritten_per_call].
3720    ///
3721    /// # Example
3722    /// ```ignore,no_run
3723    /// # use google_cloud_storage::model::RewriteObjectRequest;
3724    /// let x = RewriteObjectRequest::new().set_max_bytes_rewritten_per_call(42);
3725    /// ```
3726    pub fn set_max_bytes_rewritten_per_call<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3727        self.max_bytes_rewritten_per_call = v.into();
3728        self
3729    }
3730
3731    /// Sets the value of [copy_source_encryption_algorithm][crate::model::RewriteObjectRequest::copy_source_encryption_algorithm].
3732    ///
3733    /// # Example
3734    /// ```ignore,no_run
3735    /// # use google_cloud_storage::model::RewriteObjectRequest;
3736    /// let x = RewriteObjectRequest::new().set_copy_source_encryption_algorithm("example");
3737    /// ```
3738    pub fn set_copy_source_encryption_algorithm<T: std::convert::Into<std::string::String>>(
3739        mut self,
3740        v: T,
3741    ) -> Self {
3742        self.copy_source_encryption_algorithm = v.into();
3743        self
3744    }
3745
3746    /// Sets the value of [copy_source_encryption_key_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_bytes].
3747    ///
3748    /// # Example
3749    /// ```ignore,no_run
3750    /// # use google_cloud_storage::model::RewriteObjectRequest;
3751    /// let x = RewriteObjectRequest::new().set_copy_source_encryption_key_bytes(bytes::Bytes::from_static(b"example"));
3752    /// ```
3753    pub fn set_copy_source_encryption_key_bytes<T: std::convert::Into<::bytes::Bytes>>(
3754        mut self,
3755        v: T,
3756    ) -> Self {
3757        self.copy_source_encryption_key_bytes = v.into();
3758        self
3759    }
3760
3761    /// Sets the value of [copy_source_encryption_key_sha256_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_sha256_bytes].
3762    ///
3763    /// # Example
3764    /// ```ignore,no_run
3765    /// # use google_cloud_storage::model::RewriteObjectRequest;
3766    /// let x = RewriteObjectRequest::new().set_copy_source_encryption_key_sha256_bytes(bytes::Bytes::from_static(b"example"));
3767    /// ```
3768    pub fn set_copy_source_encryption_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(
3769        mut self,
3770        v: T,
3771    ) -> Self {
3772        self.copy_source_encryption_key_sha256_bytes = v.into();
3773        self
3774    }
3775
3776    /// Sets the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
3777    ///
3778    /// # Example
3779    /// ```ignore,no_run
3780    /// # use google_cloud_storage::model::RewriteObjectRequest;
3781    /// use google_cloud_storage::model::CommonObjectRequestParams;
3782    /// let x = RewriteObjectRequest::new().set_common_object_request_params(CommonObjectRequestParams::default()/* use setters */);
3783    /// ```
3784    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
3785    where
3786        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
3787    {
3788        self.common_object_request_params = std::option::Option::Some(v.into());
3789        self
3790    }
3791
3792    /// Sets or clears the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
3793    ///
3794    /// # Example
3795    /// ```ignore,no_run
3796    /// # use google_cloud_storage::model::RewriteObjectRequest;
3797    /// use google_cloud_storage::model::CommonObjectRequestParams;
3798    /// let x = RewriteObjectRequest::new().set_or_clear_common_object_request_params(Some(CommonObjectRequestParams::default()/* use setters */));
3799    /// let x = RewriteObjectRequest::new().set_or_clear_common_object_request_params(None::<CommonObjectRequestParams>);
3800    /// ```
3801    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
3802    where
3803        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
3804    {
3805        self.common_object_request_params = v.map(|x| x.into());
3806        self
3807    }
3808
3809    /// Sets the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
3810    ///
3811    /// # Example
3812    /// ```ignore,no_run
3813    /// # use google_cloud_storage::model::RewriteObjectRequest;
3814    /// use google_cloud_storage::model::ObjectChecksums;
3815    /// let x = RewriteObjectRequest::new().set_object_checksums(ObjectChecksums::default()/* use setters */);
3816    /// ```
3817    pub fn set_object_checksums<T>(mut self, v: T) -> Self
3818    where
3819        T: std::convert::Into<crate::model::ObjectChecksums>,
3820    {
3821        self.object_checksums = std::option::Option::Some(v.into());
3822        self
3823    }
3824
3825    /// Sets or clears the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
3826    ///
3827    /// # Example
3828    /// ```ignore,no_run
3829    /// # use google_cloud_storage::model::RewriteObjectRequest;
3830    /// use google_cloud_storage::model::ObjectChecksums;
3831    /// let x = RewriteObjectRequest::new().set_or_clear_object_checksums(Some(ObjectChecksums::default()/* use setters */));
3832    /// let x = RewriteObjectRequest::new().set_or_clear_object_checksums(None::<ObjectChecksums>);
3833    /// ```
3834    pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
3835    where
3836        T: std::convert::Into<crate::model::ObjectChecksums>,
3837    {
3838        self.object_checksums = v.map(|x| x.into());
3839        self
3840    }
3841}
3842
3843impl wkt::message::Message for RewriteObjectRequest {
3844    fn typename() -> &'static str {
3845        "type.googleapis.com/google.storage.v2.RewriteObjectRequest"
3846    }
3847}
3848
3849/// A rewrite response.
3850#[derive(Clone, Default, PartialEq)]
3851#[non_exhaustive]
3852pub struct RewriteResponse {
3853    /// The total bytes written so far, which can be used to provide a waiting user
3854    /// with a progress indicator. This property is always present in the response.
3855    pub total_bytes_rewritten: i64,
3856
3857    /// The total size of the object being copied in bytes. This property is always
3858    /// present in the response.
3859    pub object_size: i64,
3860
3861    /// `true` if the copy is finished; otherwise, `false` if
3862    /// the copy is in progress. This property is always present in the response.
3863    pub done: bool,
3864
3865    /// A token to use in subsequent requests to continue copying data. This token
3866    /// is present in the response only when there is more data to copy.
3867    pub rewrite_token: std::string::String,
3868
3869    /// A resource containing the metadata for the copied-to object. This property
3870    /// is present in the response only when copying completes.
3871    pub resource: std::option::Option<crate::model::Object>,
3872
3873    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3874}
3875
3876impl RewriteResponse {
3877    pub fn new() -> Self {
3878        std::default::Default::default()
3879    }
3880
3881    /// Sets the value of [total_bytes_rewritten][crate::model::RewriteResponse::total_bytes_rewritten].
3882    ///
3883    /// # Example
3884    /// ```ignore,no_run
3885    /// # use google_cloud_storage::model::RewriteResponse;
3886    /// let x = RewriteResponse::new().set_total_bytes_rewritten(42);
3887    /// ```
3888    pub fn set_total_bytes_rewritten<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3889        self.total_bytes_rewritten = v.into();
3890        self
3891    }
3892
3893    /// Sets the value of [object_size][crate::model::RewriteResponse::object_size].
3894    ///
3895    /// # Example
3896    /// ```ignore,no_run
3897    /// # use google_cloud_storage::model::RewriteResponse;
3898    /// let x = RewriteResponse::new().set_object_size(42);
3899    /// ```
3900    pub fn set_object_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3901        self.object_size = v.into();
3902        self
3903    }
3904
3905    /// Sets the value of [done][crate::model::RewriteResponse::done].
3906    ///
3907    /// # Example
3908    /// ```ignore,no_run
3909    /// # use google_cloud_storage::model::RewriteResponse;
3910    /// let x = RewriteResponse::new().set_done(true);
3911    /// ```
3912    pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3913        self.done = v.into();
3914        self
3915    }
3916
3917    /// Sets the value of [rewrite_token][crate::model::RewriteResponse::rewrite_token].
3918    ///
3919    /// # Example
3920    /// ```ignore,no_run
3921    /// # use google_cloud_storage::model::RewriteResponse;
3922    /// let x = RewriteResponse::new().set_rewrite_token("example");
3923    /// ```
3924    pub fn set_rewrite_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3925        self.rewrite_token = v.into();
3926        self
3927    }
3928
3929    /// Sets the value of [resource][crate::model::RewriteResponse::resource].
3930    ///
3931    /// # Example
3932    /// ```ignore,no_run
3933    /// # use google_cloud_storage::model::RewriteResponse;
3934    /// use google_cloud_storage::model::Object;
3935    /// let x = RewriteResponse::new().set_resource(Object::default()/* use setters */);
3936    /// ```
3937    pub fn set_resource<T>(mut self, v: T) -> Self
3938    where
3939        T: std::convert::Into<crate::model::Object>,
3940    {
3941        self.resource = std::option::Option::Some(v.into());
3942        self
3943    }
3944
3945    /// Sets or clears the value of [resource][crate::model::RewriteResponse::resource].
3946    ///
3947    /// # Example
3948    /// ```ignore,no_run
3949    /// # use google_cloud_storage::model::RewriteResponse;
3950    /// use google_cloud_storage::model::Object;
3951    /// let x = RewriteResponse::new().set_or_clear_resource(Some(Object::default()/* use setters */));
3952    /// let x = RewriteResponse::new().set_or_clear_resource(None::<Object>);
3953    /// ```
3954    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
3955    where
3956        T: std::convert::Into<crate::model::Object>,
3957    {
3958        self.resource = v.map(|x| x.into());
3959        self
3960    }
3961}
3962
3963impl wkt::message::Message for RewriteResponse {
3964    fn typename() -> &'static str {
3965        "type.googleapis.com/google.storage.v2.RewriteResponse"
3966    }
3967}
3968
3969/// Request message for [MoveObject][google.storage.v2.Storage.MoveObject].
3970///
3971/// [google.storage.v2.Storage.MoveObject]: crate::client::StorageControl::move_object
3972#[derive(Clone, Default, PartialEq)]
3973#[non_exhaustive]
3974pub struct MoveObjectRequest {
3975    /// Required. Name of the bucket in which the object resides.
3976    pub bucket: std::string::String,
3977
3978    /// Required. Name of the source object.
3979    pub source_object: std::string::String,
3980
3981    /// Required. Name of the destination object.
3982    pub destination_object: std::string::String,
3983
3984    /// Optional. Makes the operation conditional on whether the source object's
3985    /// current generation matches the given value. `if_source_generation_match`
3986    /// and `if_source_generation_not_match` conditions are mutually exclusive:
3987    /// it's an error for both of them to be set in the request.
3988    pub if_source_generation_match: std::option::Option<i64>,
3989
3990    /// Optional. Makes the operation conditional on whether the source object's
3991    /// current generation does not match the given value.
3992    /// `if_source_generation_match` and `if_source_generation_not_match`
3993    /// conditions are mutually exclusive: it's an error for both of them to be set
3994    /// in the request.
3995    pub if_source_generation_not_match: std::option::Option<i64>,
3996
3997    /// Optional. Makes the operation conditional on whether the source object's
3998    /// current metageneration matches the given value.
3999    /// `if_source_metageneration_match` and `if_source_metageneration_not_match`
4000    /// conditions are mutually exclusive: it's an error for both of them to be set
4001    /// in the request.
4002    pub if_source_metageneration_match: std::option::Option<i64>,
4003
4004    /// Optional. Makes the operation conditional on whether the source object's
4005    /// current metageneration does not match the given value.
4006    /// `if_source_metageneration_match` and `if_source_metageneration_not_match`
4007    /// conditions are mutually exclusive: it's an error for both of them to be set
4008    /// in the request.
4009    pub if_source_metageneration_not_match: std::option::Option<i64>,
4010
4011    /// Optional. Makes the operation conditional on whether the destination
4012    /// object's current generation matches the given value. Setting to 0 makes the
4013    /// operation succeed only if there are no live versions of the object.
4014    /// `if_generation_match` and `if_generation_not_match` conditions are mutually
4015    /// exclusive: it's an error for both of them to be set in the request.
4016    pub if_generation_match: std::option::Option<i64>,
4017
4018    /// Optional. Makes the operation conditional on whether the destination
4019    /// object's current generation does not match the given value. If no live
4020    /// object exists, the precondition fails. Setting to 0 makes the operation
4021    /// succeed only if there is a live version of the object.
4022    /// `if_generation_match` and `if_generation_not_match` conditions are mutually
4023    /// exclusive: it's an error for both of them to be set in the request.
4024    pub if_generation_not_match: std::option::Option<i64>,
4025
4026    /// Optional. Makes the operation conditional on whether the destination
4027    /// object's current metageneration matches the given value.
4028    /// `if_metageneration_match` and `if_metageneration_not_match` conditions are
4029    /// mutually exclusive: it's an error for both of them to be set in the
4030    /// request.
4031    pub if_metageneration_match: std::option::Option<i64>,
4032
4033    /// Optional. Makes the operation conditional on whether the destination
4034    /// object's current metageneration does not match the given value.
4035    /// `if_metageneration_match` and `if_metageneration_not_match` conditions are
4036    /// mutually exclusive: it's an error for both of them to be set in the
4037    /// request.
4038    pub if_metageneration_not_match: std::option::Option<i64>,
4039
4040    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4041}
4042
4043impl MoveObjectRequest {
4044    pub fn new() -> Self {
4045        std::default::Default::default()
4046    }
4047
4048    /// Sets the value of [bucket][crate::model::MoveObjectRequest::bucket].
4049    ///
4050    /// # Example
4051    /// ```ignore,no_run
4052    /// # use google_cloud_storage::model::MoveObjectRequest;
4053    /// let x = MoveObjectRequest::new().set_bucket("example");
4054    /// ```
4055    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4056        self.bucket = v.into();
4057        self
4058    }
4059
4060    /// Sets the value of [source_object][crate::model::MoveObjectRequest::source_object].
4061    ///
4062    /// # Example
4063    /// ```ignore,no_run
4064    /// # use google_cloud_storage::model::MoveObjectRequest;
4065    /// let x = MoveObjectRequest::new().set_source_object("example");
4066    /// ```
4067    pub fn set_source_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4068        self.source_object = v.into();
4069        self
4070    }
4071
4072    /// Sets the value of [destination_object][crate::model::MoveObjectRequest::destination_object].
4073    ///
4074    /// # Example
4075    /// ```ignore,no_run
4076    /// # use google_cloud_storage::model::MoveObjectRequest;
4077    /// let x = MoveObjectRequest::new().set_destination_object("example");
4078    /// ```
4079    pub fn set_destination_object<T: std::convert::Into<std::string::String>>(
4080        mut self,
4081        v: T,
4082    ) -> Self {
4083        self.destination_object = v.into();
4084        self
4085    }
4086
4087    /// Sets the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
4088    ///
4089    /// # Example
4090    /// ```ignore,no_run
4091    /// # use google_cloud_storage::model::MoveObjectRequest;
4092    /// let x = MoveObjectRequest::new().set_if_source_generation_match(42);
4093    /// ```
4094    pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
4095    where
4096        T: std::convert::Into<i64>,
4097    {
4098        self.if_source_generation_match = std::option::Option::Some(v.into());
4099        self
4100    }
4101
4102    /// Sets or clears the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
4103    ///
4104    /// # Example
4105    /// ```ignore,no_run
4106    /// # use google_cloud_storage::model::MoveObjectRequest;
4107    /// let x = MoveObjectRequest::new().set_or_clear_if_source_generation_match(Some(42));
4108    /// let x = MoveObjectRequest::new().set_or_clear_if_source_generation_match(None::<i32>);
4109    /// ```
4110    pub fn set_or_clear_if_source_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
4111    where
4112        T: std::convert::Into<i64>,
4113    {
4114        self.if_source_generation_match = v.map(|x| x.into());
4115        self
4116    }
4117
4118    /// Sets the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
4119    ///
4120    /// # Example
4121    /// ```ignore,no_run
4122    /// # use google_cloud_storage::model::MoveObjectRequest;
4123    /// let x = MoveObjectRequest::new().set_if_source_generation_not_match(42);
4124    /// ```
4125    pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
4126    where
4127        T: std::convert::Into<i64>,
4128    {
4129        self.if_source_generation_not_match = std::option::Option::Some(v.into());
4130        self
4131    }
4132
4133    /// Sets or clears the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
4134    ///
4135    /// # Example
4136    /// ```ignore,no_run
4137    /// # use google_cloud_storage::model::MoveObjectRequest;
4138    /// let x = MoveObjectRequest::new().set_or_clear_if_source_generation_not_match(Some(42));
4139    /// let x = MoveObjectRequest::new().set_or_clear_if_source_generation_not_match(None::<i32>);
4140    /// ```
4141    pub fn set_or_clear_if_source_generation_not_match<T>(
4142        mut self,
4143        v: std::option::Option<T>,
4144    ) -> Self
4145    where
4146        T: std::convert::Into<i64>,
4147    {
4148        self.if_source_generation_not_match = v.map(|x| x.into());
4149        self
4150    }
4151
4152    /// Sets the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
4153    ///
4154    /// # Example
4155    /// ```ignore,no_run
4156    /// # use google_cloud_storage::model::MoveObjectRequest;
4157    /// let x = MoveObjectRequest::new().set_if_source_metageneration_match(42);
4158    /// ```
4159    pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
4160    where
4161        T: std::convert::Into<i64>,
4162    {
4163        self.if_source_metageneration_match = std::option::Option::Some(v.into());
4164        self
4165    }
4166
4167    /// Sets or clears the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
4168    ///
4169    /// # Example
4170    /// ```ignore,no_run
4171    /// # use google_cloud_storage::model::MoveObjectRequest;
4172    /// let x = MoveObjectRequest::new().set_or_clear_if_source_metageneration_match(Some(42));
4173    /// let x = MoveObjectRequest::new().set_or_clear_if_source_metageneration_match(None::<i32>);
4174    /// ```
4175    pub fn set_or_clear_if_source_metageneration_match<T>(
4176        mut self,
4177        v: std::option::Option<T>,
4178    ) -> Self
4179    where
4180        T: std::convert::Into<i64>,
4181    {
4182        self.if_source_metageneration_match = v.map(|x| x.into());
4183        self
4184    }
4185
4186    /// Sets the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
4187    ///
4188    /// # Example
4189    /// ```ignore,no_run
4190    /// # use google_cloud_storage::model::MoveObjectRequest;
4191    /// let x = MoveObjectRequest::new().set_if_source_metageneration_not_match(42);
4192    /// ```
4193    pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
4194    where
4195        T: std::convert::Into<i64>,
4196    {
4197        self.if_source_metageneration_not_match = std::option::Option::Some(v.into());
4198        self
4199    }
4200
4201    /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
4202    ///
4203    /// # Example
4204    /// ```ignore,no_run
4205    /// # use google_cloud_storage::model::MoveObjectRequest;
4206    /// let x = MoveObjectRequest::new().set_or_clear_if_source_metageneration_not_match(Some(42));
4207    /// let x = MoveObjectRequest::new().set_or_clear_if_source_metageneration_not_match(None::<i32>);
4208    /// ```
4209    pub fn set_or_clear_if_source_metageneration_not_match<T>(
4210        mut self,
4211        v: std::option::Option<T>,
4212    ) -> Self
4213    where
4214        T: std::convert::Into<i64>,
4215    {
4216        self.if_source_metageneration_not_match = v.map(|x| x.into());
4217        self
4218    }
4219
4220    /// Sets the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
4221    ///
4222    /// # Example
4223    /// ```ignore,no_run
4224    /// # use google_cloud_storage::model::MoveObjectRequest;
4225    /// let x = MoveObjectRequest::new().set_if_generation_match(42);
4226    /// ```
4227    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
4228    where
4229        T: std::convert::Into<i64>,
4230    {
4231        self.if_generation_match = std::option::Option::Some(v.into());
4232        self
4233    }
4234
4235    /// Sets or clears the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
4236    ///
4237    /// # Example
4238    /// ```ignore,no_run
4239    /// # use google_cloud_storage::model::MoveObjectRequest;
4240    /// let x = MoveObjectRequest::new().set_or_clear_if_generation_match(Some(42));
4241    /// let x = MoveObjectRequest::new().set_or_clear_if_generation_match(None::<i32>);
4242    /// ```
4243    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
4244    where
4245        T: std::convert::Into<i64>,
4246    {
4247        self.if_generation_match = v.map(|x| x.into());
4248        self
4249    }
4250
4251    /// Sets the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
4252    ///
4253    /// # Example
4254    /// ```ignore,no_run
4255    /// # use google_cloud_storage::model::MoveObjectRequest;
4256    /// let x = MoveObjectRequest::new().set_if_generation_not_match(42);
4257    /// ```
4258    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
4259    where
4260        T: std::convert::Into<i64>,
4261    {
4262        self.if_generation_not_match = std::option::Option::Some(v.into());
4263        self
4264    }
4265
4266    /// Sets or clears the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
4267    ///
4268    /// # Example
4269    /// ```ignore,no_run
4270    /// # use google_cloud_storage::model::MoveObjectRequest;
4271    /// let x = MoveObjectRequest::new().set_or_clear_if_generation_not_match(Some(42));
4272    /// let x = MoveObjectRequest::new().set_or_clear_if_generation_not_match(None::<i32>);
4273    /// ```
4274    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
4275    where
4276        T: std::convert::Into<i64>,
4277    {
4278        self.if_generation_not_match = v.map(|x| x.into());
4279        self
4280    }
4281
4282    /// Sets the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
4283    ///
4284    /// # Example
4285    /// ```ignore,no_run
4286    /// # use google_cloud_storage::model::MoveObjectRequest;
4287    /// let x = MoveObjectRequest::new().set_if_metageneration_match(42);
4288    /// ```
4289    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
4290    where
4291        T: std::convert::Into<i64>,
4292    {
4293        self.if_metageneration_match = std::option::Option::Some(v.into());
4294        self
4295    }
4296
4297    /// Sets or clears the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
4298    ///
4299    /// # Example
4300    /// ```ignore,no_run
4301    /// # use google_cloud_storage::model::MoveObjectRequest;
4302    /// let x = MoveObjectRequest::new().set_or_clear_if_metageneration_match(Some(42));
4303    /// let x = MoveObjectRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
4304    /// ```
4305    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
4306    where
4307        T: std::convert::Into<i64>,
4308    {
4309        self.if_metageneration_match = v.map(|x| x.into());
4310        self
4311    }
4312
4313    /// Sets the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
4314    ///
4315    /// # Example
4316    /// ```ignore,no_run
4317    /// # use google_cloud_storage::model::MoveObjectRequest;
4318    /// let x = MoveObjectRequest::new().set_if_metageneration_not_match(42);
4319    /// ```
4320    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
4321    where
4322        T: std::convert::Into<i64>,
4323    {
4324        self.if_metageneration_not_match = std::option::Option::Some(v.into());
4325        self
4326    }
4327
4328    /// Sets or clears the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
4329    ///
4330    /// # Example
4331    /// ```ignore,no_run
4332    /// # use google_cloud_storage::model::MoveObjectRequest;
4333    /// let x = MoveObjectRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
4334    /// let x = MoveObjectRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
4335    /// ```
4336    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
4337    where
4338        T: std::convert::Into<i64>,
4339    {
4340        self.if_metageneration_not_match = v.map(|x| x.into());
4341        self
4342    }
4343}
4344
4345impl wkt::message::Message for MoveObjectRequest {
4346    fn typename() -> &'static str {
4347        "type.googleapis.com/google.storage.v2.MoveObjectRequest"
4348    }
4349}
4350
4351/// Request message for [UpdateObject][google.storage.v2.Storage.UpdateObject].
4352///
4353/// [google.storage.v2.Storage.UpdateObject]: crate::client::StorageControl::update_object
4354#[derive(Clone, Default, PartialEq)]
4355#[non_exhaustive]
4356pub struct UpdateObjectRequest {
4357    /// Required. The object to update.
4358    /// The object's bucket and name fields are used to identify the object to
4359    /// update. If present, the object's generation field selects a specific
4360    /// revision of this object whose metadata should be updated. Otherwise,
4361    /// assumes the live version of the object.
4362    pub object: std::option::Option<crate::model::Object>,
4363
4364    /// Makes the operation conditional on whether the object's current generation
4365    /// matches the given value. Setting to 0 makes the operation succeed only if
4366    /// there are no live versions of the object.
4367    pub if_generation_match: std::option::Option<i64>,
4368
4369    /// Makes the operation conditional on whether the object's live generation
4370    /// does not match the given value. If no live object exists, the precondition
4371    /// fails. Setting to 0 makes the operation succeed only if there is a live
4372    /// version of the object.
4373    pub if_generation_not_match: std::option::Option<i64>,
4374
4375    /// Makes the operation conditional on whether the object's current
4376    /// metageneration matches the given value.
4377    pub if_metageneration_match: std::option::Option<i64>,
4378
4379    /// Makes the operation conditional on whether the object's current
4380    /// metageneration does not match the given value.
4381    pub if_metageneration_not_match: std::option::Option<i64>,
4382
4383    /// Optional. Apply a predefined set of access controls to this object.
4384    /// Valid values are "authenticatedRead", "bucketOwnerFullControl",
4385    /// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
4386    pub predefined_acl: std::string::String,
4387
4388    /// Required. List of fields to be updated.
4389    ///
4390    /// To specify ALL fields, equivalent to the JSON API's "update" function,
4391    /// specify a single field with the value `*`. Note: not recommended. If a new
4392    /// field is introduced at a later time, an older client updating with the `*`
4393    /// might accidentally reset the new field's value.
4394    ///
4395    /// Not specifying any fields is an error.
4396    pub update_mask: std::option::Option<wkt::FieldMask>,
4397
4398    /// Optional. A set of parameters common to Storage API requests concerning an
4399    /// object.
4400    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
4401
4402    /// Optional. Overrides the unlocked retention config on the object.
4403    pub override_unlocked_retention: bool,
4404
4405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4406}
4407
4408impl UpdateObjectRequest {
4409    pub fn new() -> Self {
4410        std::default::Default::default()
4411    }
4412
4413    /// Sets the value of [object][crate::model::UpdateObjectRequest::object].
4414    ///
4415    /// # Example
4416    /// ```ignore,no_run
4417    /// # use google_cloud_storage::model::UpdateObjectRequest;
4418    /// use google_cloud_storage::model::Object;
4419    /// let x = UpdateObjectRequest::new().set_object(Object::default()/* use setters */);
4420    /// ```
4421    pub fn set_object<T>(mut self, v: T) -> Self
4422    where
4423        T: std::convert::Into<crate::model::Object>,
4424    {
4425        self.object = std::option::Option::Some(v.into());
4426        self
4427    }
4428
4429    /// Sets or clears the value of [object][crate::model::UpdateObjectRequest::object].
4430    ///
4431    /// # Example
4432    /// ```ignore,no_run
4433    /// # use google_cloud_storage::model::UpdateObjectRequest;
4434    /// use google_cloud_storage::model::Object;
4435    /// let x = UpdateObjectRequest::new().set_or_clear_object(Some(Object::default()/* use setters */));
4436    /// let x = UpdateObjectRequest::new().set_or_clear_object(None::<Object>);
4437    /// ```
4438    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
4439    where
4440        T: std::convert::Into<crate::model::Object>,
4441    {
4442        self.object = v.map(|x| x.into());
4443        self
4444    }
4445
4446    /// Sets the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
4447    ///
4448    /// # Example
4449    /// ```ignore,no_run
4450    /// # use google_cloud_storage::model::UpdateObjectRequest;
4451    /// let x = UpdateObjectRequest::new().set_if_generation_match(42);
4452    /// ```
4453    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
4454    where
4455        T: std::convert::Into<i64>,
4456    {
4457        self.if_generation_match = std::option::Option::Some(v.into());
4458        self
4459    }
4460
4461    /// Sets or clears the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
4462    ///
4463    /// # Example
4464    /// ```ignore,no_run
4465    /// # use google_cloud_storage::model::UpdateObjectRequest;
4466    /// let x = UpdateObjectRequest::new().set_or_clear_if_generation_match(Some(42));
4467    /// let x = UpdateObjectRequest::new().set_or_clear_if_generation_match(None::<i32>);
4468    /// ```
4469    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
4470    where
4471        T: std::convert::Into<i64>,
4472    {
4473        self.if_generation_match = v.map(|x| x.into());
4474        self
4475    }
4476
4477    /// Sets the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
4478    ///
4479    /// # Example
4480    /// ```ignore,no_run
4481    /// # use google_cloud_storage::model::UpdateObjectRequest;
4482    /// let x = UpdateObjectRequest::new().set_if_generation_not_match(42);
4483    /// ```
4484    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
4485    where
4486        T: std::convert::Into<i64>,
4487    {
4488        self.if_generation_not_match = std::option::Option::Some(v.into());
4489        self
4490    }
4491
4492    /// Sets or clears the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
4493    ///
4494    /// # Example
4495    /// ```ignore,no_run
4496    /// # use google_cloud_storage::model::UpdateObjectRequest;
4497    /// let x = UpdateObjectRequest::new().set_or_clear_if_generation_not_match(Some(42));
4498    /// let x = UpdateObjectRequest::new().set_or_clear_if_generation_not_match(None::<i32>);
4499    /// ```
4500    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
4501    where
4502        T: std::convert::Into<i64>,
4503    {
4504        self.if_generation_not_match = v.map(|x| x.into());
4505        self
4506    }
4507
4508    /// Sets the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
4509    ///
4510    /// # Example
4511    /// ```ignore,no_run
4512    /// # use google_cloud_storage::model::UpdateObjectRequest;
4513    /// let x = UpdateObjectRequest::new().set_if_metageneration_match(42);
4514    /// ```
4515    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
4516    where
4517        T: std::convert::Into<i64>,
4518    {
4519        self.if_metageneration_match = std::option::Option::Some(v.into());
4520        self
4521    }
4522
4523    /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
4524    ///
4525    /// # Example
4526    /// ```ignore,no_run
4527    /// # use google_cloud_storage::model::UpdateObjectRequest;
4528    /// let x = UpdateObjectRequest::new().set_or_clear_if_metageneration_match(Some(42));
4529    /// let x = UpdateObjectRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
4530    /// ```
4531    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
4532    where
4533        T: std::convert::Into<i64>,
4534    {
4535        self.if_metageneration_match = v.map(|x| x.into());
4536        self
4537    }
4538
4539    /// Sets the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
4540    ///
4541    /// # Example
4542    /// ```ignore,no_run
4543    /// # use google_cloud_storage::model::UpdateObjectRequest;
4544    /// let x = UpdateObjectRequest::new().set_if_metageneration_not_match(42);
4545    /// ```
4546    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
4547    where
4548        T: std::convert::Into<i64>,
4549    {
4550        self.if_metageneration_not_match = std::option::Option::Some(v.into());
4551        self
4552    }
4553
4554    /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
4555    ///
4556    /// # Example
4557    /// ```ignore,no_run
4558    /// # use google_cloud_storage::model::UpdateObjectRequest;
4559    /// let x = UpdateObjectRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
4560    /// let x = UpdateObjectRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
4561    /// ```
4562    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
4563    where
4564        T: std::convert::Into<i64>,
4565    {
4566        self.if_metageneration_not_match = v.map(|x| x.into());
4567        self
4568    }
4569
4570    /// Sets the value of [predefined_acl][crate::model::UpdateObjectRequest::predefined_acl].
4571    ///
4572    /// # Example
4573    /// ```ignore,no_run
4574    /// # use google_cloud_storage::model::UpdateObjectRequest;
4575    /// let x = UpdateObjectRequest::new().set_predefined_acl("example");
4576    /// ```
4577    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4578        self.predefined_acl = v.into();
4579        self
4580    }
4581
4582    /// Sets the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
4583    ///
4584    /// # Example
4585    /// ```ignore,no_run
4586    /// # use google_cloud_storage::model::UpdateObjectRequest;
4587    /// use wkt::FieldMask;
4588    /// let x = UpdateObjectRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4589    /// ```
4590    pub fn set_update_mask<T>(mut self, v: T) -> Self
4591    where
4592        T: std::convert::Into<wkt::FieldMask>,
4593    {
4594        self.update_mask = std::option::Option::Some(v.into());
4595        self
4596    }
4597
4598    /// Sets or clears the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
4599    ///
4600    /// # Example
4601    /// ```ignore,no_run
4602    /// # use google_cloud_storage::model::UpdateObjectRequest;
4603    /// use wkt::FieldMask;
4604    /// let x = UpdateObjectRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4605    /// let x = UpdateObjectRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4606    /// ```
4607    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4608    where
4609        T: std::convert::Into<wkt::FieldMask>,
4610    {
4611        self.update_mask = v.map(|x| x.into());
4612        self
4613    }
4614
4615    /// Sets the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
4616    ///
4617    /// # Example
4618    /// ```ignore,no_run
4619    /// # use google_cloud_storage::model::UpdateObjectRequest;
4620    /// use google_cloud_storage::model::CommonObjectRequestParams;
4621    /// let x = UpdateObjectRequest::new().set_common_object_request_params(CommonObjectRequestParams::default()/* use setters */);
4622    /// ```
4623    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
4624    where
4625        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
4626    {
4627        self.common_object_request_params = std::option::Option::Some(v.into());
4628        self
4629    }
4630
4631    /// Sets or clears the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
4632    ///
4633    /// # Example
4634    /// ```ignore,no_run
4635    /// # use google_cloud_storage::model::UpdateObjectRequest;
4636    /// use google_cloud_storage::model::CommonObjectRequestParams;
4637    /// let x = UpdateObjectRequest::new().set_or_clear_common_object_request_params(Some(CommonObjectRequestParams::default()/* use setters */));
4638    /// let x = UpdateObjectRequest::new().set_or_clear_common_object_request_params(None::<CommonObjectRequestParams>);
4639    /// ```
4640    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
4641    where
4642        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
4643    {
4644        self.common_object_request_params = v.map(|x| x.into());
4645        self
4646    }
4647
4648    /// Sets the value of [override_unlocked_retention][crate::model::UpdateObjectRequest::override_unlocked_retention].
4649    ///
4650    /// # Example
4651    /// ```ignore,no_run
4652    /// # use google_cloud_storage::model::UpdateObjectRequest;
4653    /// let x = UpdateObjectRequest::new().set_override_unlocked_retention(true);
4654    /// ```
4655    pub fn set_override_unlocked_retention<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4656        self.override_unlocked_retention = v.into();
4657        self
4658    }
4659}
4660
4661impl wkt::message::Message for UpdateObjectRequest {
4662    fn typename() -> &'static str {
4663        "type.googleapis.com/google.storage.v2.UpdateObjectRequest"
4664    }
4665}
4666
4667/// Parameters that can be passed to any object request.
4668#[derive(Clone, Default, PartialEq)]
4669#[non_exhaustive]
4670pub struct CommonObjectRequestParams {
4671    /// Optional. Encryption algorithm used with the Customer-Supplied Encryption
4672    /// Keys feature.
4673    pub encryption_algorithm: std::string::String,
4674
4675    /// Optional. Encryption key used with the Customer-Supplied Encryption Keys
4676    /// feature. In raw bytes format (not base64-encoded).
4677    pub encryption_key_bytes: ::bytes::Bytes,
4678
4679    /// Optional. SHA256 hash of encryption key used with the Customer-supplied
4680    /// encryption keys feature.
4681    pub encryption_key_sha256_bytes: ::bytes::Bytes,
4682
4683    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4684}
4685
4686impl CommonObjectRequestParams {
4687    pub fn new() -> Self {
4688        std::default::Default::default()
4689    }
4690
4691    /// Sets the value of [encryption_algorithm][crate::model::CommonObjectRequestParams::encryption_algorithm].
4692    ///
4693    /// # Example
4694    /// ```ignore,no_run
4695    /// # use google_cloud_storage::model::CommonObjectRequestParams;
4696    /// let x = CommonObjectRequestParams::new().set_encryption_algorithm("example");
4697    /// ```
4698    pub fn set_encryption_algorithm<T: std::convert::Into<std::string::String>>(
4699        mut self,
4700        v: T,
4701    ) -> Self {
4702        self.encryption_algorithm = v.into();
4703        self
4704    }
4705
4706    /// Sets the value of [encryption_key_bytes][crate::model::CommonObjectRequestParams::encryption_key_bytes].
4707    ///
4708    /// # Example
4709    /// ```ignore,no_run
4710    /// # use google_cloud_storage::model::CommonObjectRequestParams;
4711    /// let x = CommonObjectRequestParams::new().set_encryption_key_bytes(bytes::Bytes::from_static(b"example"));
4712    /// ```
4713    pub fn set_encryption_key_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4714        self.encryption_key_bytes = v.into();
4715        self
4716    }
4717
4718    /// Sets the value of [encryption_key_sha256_bytes][crate::model::CommonObjectRequestParams::encryption_key_sha256_bytes].
4719    ///
4720    /// # Example
4721    /// ```ignore,no_run
4722    /// # use google_cloud_storage::model::CommonObjectRequestParams;
4723    /// let x = CommonObjectRequestParams::new().set_encryption_key_sha256_bytes(bytes::Bytes::from_static(b"example"));
4724    /// ```
4725    pub fn set_encryption_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(
4726        mut self,
4727        v: T,
4728    ) -> Self {
4729        self.encryption_key_sha256_bytes = v.into();
4730        self
4731    }
4732}
4733
4734impl wkt::message::Message for CommonObjectRequestParams {
4735    fn typename() -> &'static str {
4736        "type.googleapis.com/google.storage.v2.CommonObjectRequestParams"
4737    }
4738}
4739
4740/// A bucket.
4741#[derive(Clone, Default, PartialEq)]
4742#[non_exhaustive]
4743pub struct Bucket {
4744    /// Identifier. The name of the bucket.
4745    /// Format: `projects/{project}/buckets/{bucket}`
4746    pub name: std::string::String,
4747
4748    /// Output only. The user-chosen part of the bucket name. The `{bucket}`
4749    /// portion of the `name` field. For globally unique buckets, this is equal to
4750    /// the `bucket name` of other Cloud Storage APIs. Example: `pub`.
4751    pub bucket_id: std::string::String,
4752
4753    /// The etag of the bucket.
4754    /// If included in the metadata of an `UpdateBucketRequest`, the operation is
4755    /// only performed if the `etag` matches that of the bucket.
4756    pub etag: std::string::String,
4757
4758    /// Immutable. The project which owns this bucket, in the format of
4759    /// `projects/{projectIdentifier}`.
4760    /// `{projectIdentifier}` can be the project ID or project number.
4761    /// Output values are always in the project number format.
4762    pub project: std::string::String,
4763
4764    /// Output only. The metadata generation of this bucket.
4765    pub metageneration: i64,
4766
4767    /// Immutable. The location of the bucket. Object data for objects in the
4768    /// bucket resides in physical storage within this region.  Defaults to `US`.
4769    /// Attempting to update this field after the bucket is created results in an
4770    /// error.
4771    pub location: std::string::String,
4772
4773    /// Output only. The location type of the bucket (region, dual-region,
4774    /// multi-region, etc).
4775    pub location_type: std::string::String,
4776
4777    /// Optional. The bucket's default storage class, used whenever no storageClass
4778    /// is specified for a newly-created object. This defines how objects in the
4779    /// bucket are stored and determines the SLA and the cost of storage.
4780    /// If this value is not specified when the bucket is created, it defaults
4781    /// to `STANDARD`. For more information, see [Storage
4782    /// classes](https://developers.google.com/storage/docs/storage-classes).
4783    pub storage_class: std::string::String,
4784
4785    /// Optional. The recovery point objective for cross-region replication of the
4786    /// bucket. Applicable only for dual- and multi-region buckets. `DEFAULT` uses
4787    /// default replication. `ASYNC_TURBO` enables turbo replication, valid for
4788    /// dual-region buckets only. If rpo is not specified when the bucket is
4789    /// created, it defaults to `DEFAULT`. For more information, see [Turbo
4790    /// replication](https://cloud.google.com/storage/docs/availability-durability#turbo-replication).
4791    pub rpo: std::string::String,
4792
4793    /// Optional. Access controls on the bucket.
4794    /// If `iam_config.uniform_bucket_level_access` is enabled on this bucket,
4795    /// requests to set, read, or modify acl is an error.
4796    pub acl: std::vec::Vec<crate::model::BucketAccessControl>,
4797
4798    /// Optional. Default access controls to apply to new objects when no ACL is
4799    /// provided. If `iam_config.uniform_bucket_level_access` is enabled on this
4800    /// bucket, requests to set, read, or modify acl is an error.
4801    pub default_object_acl: std::vec::Vec<crate::model::ObjectAccessControl>,
4802
4803    /// Optional. The bucket's lifecycle configuration. See [Lifecycle
4804    /// Management](https://developers.google.com/storage/docs/lifecycle) for more
4805    /// information.
4806    pub lifecycle: std::option::Option<crate::model::bucket::Lifecycle>,
4807
4808    /// Output only. The creation time of the bucket.
4809    pub create_time: std::option::Option<wkt::Timestamp>,
4810
4811    /// Optional. The bucket's [CORS](https://www.w3.org/TR/cors/)
4812    /// configuration.
4813    pub cors: std::vec::Vec<crate::model::bucket::Cors>,
4814
4815    /// Output only. The modification time of the bucket.
4816    pub update_time: std::option::Option<wkt::Timestamp>,
4817
4818    /// Optional. The default value for event-based hold on newly created objects
4819    /// in this bucket.  Event-based hold is a way to retain objects indefinitely
4820    /// until an event occurs, signified by the hold's release. After being
4821    /// released, such objects are subject to bucket-level retention (if any).  One
4822    /// sample use case of this flag is for banks to hold loan documents for at
4823    /// least 3 years after loan is paid in full. Here, bucket-level retention is 3
4824    /// years and the event is loan being paid in full. In this example, these
4825    /// objects are held intact for any number of years until the event has
4826    /// occurred (event-based hold on the object is released) and then 3 more years
4827    /// after that. That means retention duration of the objects begins from the
4828    /// moment event-based hold transitioned from true to false.  Objects under
4829    /// event-based hold cannot be deleted, overwritten or archived until the hold
4830    /// is removed.
4831    pub default_event_based_hold: bool,
4832
4833    /// Optional. User-provided labels, in key/value pairs.
4834    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4835
4836    /// Optional. The bucket's website config, controlling how the service behaves
4837    /// when accessing bucket contents as a web site. See the [Static website
4838    /// examples](https://cloud.google.com/storage/docs/static-website) for more
4839    /// information.
4840    pub website: std::option::Option<crate::model::bucket::Website>,
4841
4842    /// Optional. The bucket's versioning configuration.
4843    pub versioning: std::option::Option<crate::model::bucket::Versioning>,
4844
4845    /// Optional. The bucket's logging config, which defines the destination bucket
4846    /// and name prefix (if any) for the current bucket's logs.
4847    pub logging: std::option::Option<crate::model::bucket::Logging>,
4848
4849    /// Output only. The owner of the bucket. This is always the project team's
4850    /// owner group.
4851    pub owner: std::option::Option<crate::model::Owner>,
4852
4853    /// Optional. Encryption config for a bucket.
4854    pub encryption: std::option::Option<crate::model::bucket::Encryption>,
4855
4856    /// Optional. The bucket's billing configuration.
4857    pub billing: std::option::Option<crate::model::bucket::Billing>,
4858
4859    /// Optional. The bucket's retention policy. The retention policy enforces a
4860    /// minimum retention time for all objects contained in the bucket, based on
4861    /// their creation time. Any attempt to overwrite or delete objects younger
4862    /// than the retention period results in a `PERMISSION_DENIED` error.  An
4863    /// unlocked retention policy can be modified or removed from the bucket via a
4864    /// storage.buckets.update operation. A locked retention policy cannot be
4865    /// removed or shortened in duration for the lifetime of the bucket.
4866    /// Attempting to remove or decrease period of a locked retention policy
4867    /// results in a `PERMISSION_DENIED` error.
4868    pub retention_policy: std::option::Option<crate::model::bucket::RetentionPolicy>,
4869
4870    /// Optional. The bucket's IAM configuration.
4871    pub iam_config: std::option::Option<crate::model::bucket::IamConfig>,
4872
4873    /// Optional. Reserved for future use.
4874    pub satisfies_pzs: bool,
4875
4876    /// Optional. Configuration that, if present, specifies the data placement for
4877    /// a [configurable
4878    /// dual-region](https://cloud.google.com/storage/docs/locations#location-dr).
4879    pub custom_placement_config: std::option::Option<crate::model::bucket::CustomPlacementConfig>,
4880
4881    /// Optional. The bucket's Autoclass configuration. If there is no
4882    /// configuration, the Autoclass feature is disabled and has no effect on the
4883    /// bucket.
4884    pub autoclass: std::option::Option<crate::model::bucket::Autoclass>,
4885
4886    /// Optional. The bucket's hierarchical namespace configuration. If there is no
4887    /// configuration, the hierarchical namespace feature is disabled and has
4888    /// no effect on the bucket.
4889    pub hierarchical_namespace: std::option::Option<crate::model::bucket::HierarchicalNamespace>,
4890
4891    /// Optional. The bucket's soft delete policy. The soft delete policy prevents
4892    /// soft-deleted objects from being permanently deleted.
4893    pub soft_delete_policy: std::option::Option<crate::model::bucket::SoftDeletePolicy>,
4894
4895    /// Optional. The bucket's object retention configuration. Must be enabled
4896    /// before objects in the bucket might have retention configured.
4897    pub object_retention: std::option::Option<crate::model::bucket::ObjectRetention>,
4898
4899    /// Optional. The bucket's IP filter configuration.
4900    pub ip_filter: std::option::Option<crate::model::bucket::IpFilter>,
4901
4902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4903}
4904
4905impl Bucket {
4906    pub fn new() -> Self {
4907        std::default::Default::default()
4908    }
4909
4910    /// Sets the value of [name][crate::model::Bucket::name].
4911    ///
4912    /// # Example
4913    /// ```ignore,no_run
4914    /// # use google_cloud_storage::model::Bucket;
4915    /// let x = Bucket::new().set_name("example");
4916    /// ```
4917    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4918        self.name = v.into();
4919        self
4920    }
4921
4922    /// Sets the value of [bucket_id][crate::model::Bucket::bucket_id].
4923    ///
4924    /// # Example
4925    /// ```ignore,no_run
4926    /// # use google_cloud_storage::model::Bucket;
4927    /// let x = Bucket::new().set_bucket_id("example");
4928    /// ```
4929    pub fn set_bucket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4930        self.bucket_id = v.into();
4931        self
4932    }
4933
4934    /// Sets the value of [etag][crate::model::Bucket::etag].
4935    ///
4936    /// # Example
4937    /// ```ignore,no_run
4938    /// # use google_cloud_storage::model::Bucket;
4939    /// let x = Bucket::new().set_etag("example");
4940    /// ```
4941    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4942        self.etag = v.into();
4943        self
4944    }
4945
4946    /// Sets the value of [project][crate::model::Bucket::project].
4947    ///
4948    /// # Example
4949    /// ```ignore,no_run
4950    /// # use google_cloud_storage::model::Bucket;
4951    /// let x = Bucket::new().set_project("example");
4952    /// ```
4953    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4954        self.project = v.into();
4955        self
4956    }
4957
4958    /// Sets the value of [metageneration][crate::model::Bucket::metageneration].
4959    ///
4960    /// # Example
4961    /// ```ignore,no_run
4962    /// # use google_cloud_storage::model::Bucket;
4963    /// let x = Bucket::new().set_metageneration(42);
4964    /// ```
4965    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4966        self.metageneration = v.into();
4967        self
4968    }
4969
4970    /// Sets the value of [location][crate::model::Bucket::location].
4971    ///
4972    /// # Example
4973    /// ```ignore,no_run
4974    /// # use google_cloud_storage::model::Bucket;
4975    /// let x = Bucket::new().set_location("example");
4976    /// ```
4977    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4978        self.location = v.into();
4979        self
4980    }
4981
4982    /// Sets the value of [location_type][crate::model::Bucket::location_type].
4983    ///
4984    /// # Example
4985    /// ```ignore,no_run
4986    /// # use google_cloud_storage::model::Bucket;
4987    /// let x = Bucket::new().set_location_type("example");
4988    /// ```
4989    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4990        self.location_type = v.into();
4991        self
4992    }
4993
4994    /// Sets the value of [storage_class][crate::model::Bucket::storage_class].
4995    ///
4996    /// # Example
4997    /// ```ignore,no_run
4998    /// # use google_cloud_storage::model::Bucket;
4999    /// let x = Bucket::new().set_storage_class("example");
5000    /// ```
5001    pub fn set_storage_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5002        self.storage_class = v.into();
5003        self
5004    }
5005
5006    /// Sets the value of [rpo][crate::model::Bucket::rpo].
5007    ///
5008    /// # Example
5009    /// ```ignore,no_run
5010    /// # use google_cloud_storage::model::Bucket;
5011    /// let x = Bucket::new().set_rpo("example");
5012    /// ```
5013    pub fn set_rpo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5014        self.rpo = v.into();
5015        self
5016    }
5017
5018    /// Sets the value of [acl][crate::model::Bucket::acl].
5019    ///
5020    /// # Example
5021    /// ```ignore,no_run
5022    /// # use google_cloud_storage::model::Bucket;
5023    /// use google_cloud_storage::model::BucketAccessControl;
5024    /// let x = Bucket::new()
5025    ///     .set_acl([
5026    ///         BucketAccessControl::default()/* use setters */,
5027    ///         BucketAccessControl::default()/* use (different) setters */,
5028    ///     ]);
5029    /// ```
5030    pub fn set_acl<T, V>(mut self, v: T) -> Self
5031    where
5032        T: std::iter::IntoIterator<Item = V>,
5033        V: std::convert::Into<crate::model::BucketAccessControl>,
5034    {
5035        use std::iter::Iterator;
5036        self.acl = v.into_iter().map(|i| i.into()).collect();
5037        self
5038    }
5039
5040    /// Sets the value of [default_object_acl][crate::model::Bucket::default_object_acl].
5041    ///
5042    /// # Example
5043    /// ```ignore,no_run
5044    /// # use google_cloud_storage::model::Bucket;
5045    /// use google_cloud_storage::model::ObjectAccessControl;
5046    /// let x = Bucket::new()
5047    ///     .set_default_object_acl([
5048    ///         ObjectAccessControl::default()/* use setters */,
5049    ///         ObjectAccessControl::default()/* use (different) setters */,
5050    ///     ]);
5051    /// ```
5052    pub fn set_default_object_acl<T, V>(mut self, v: T) -> Self
5053    where
5054        T: std::iter::IntoIterator<Item = V>,
5055        V: std::convert::Into<crate::model::ObjectAccessControl>,
5056    {
5057        use std::iter::Iterator;
5058        self.default_object_acl = v.into_iter().map(|i| i.into()).collect();
5059        self
5060    }
5061
5062    /// Sets the value of [lifecycle][crate::model::Bucket::lifecycle].
5063    ///
5064    /// # Example
5065    /// ```ignore,no_run
5066    /// # use google_cloud_storage::model::Bucket;
5067    /// use google_cloud_storage::model::bucket::Lifecycle;
5068    /// let x = Bucket::new().set_lifecycle(Lifecycle::default()/* use setters */);
5069    /// ```
5070    pub fn set_lifecycle<T>(mut self, v: T) -> Self
5071    where
5072        T: std::convert::Into<crate::model::bucket::Lifecycle>,
5073    {
5074        self.lifecycle = std::option::Option::Some(v.into());
5075        self
5076    }
5077
5078    /// Sets or clears the value of [lifecycle][crate::model::Bucket::lifecycle].
5079    ///
5080    /// # Example
5081    /// ```ignore,no_run
5082    /// # use google_cloud_storage::model::Bucket;
5083    /// use google_cloud_storage::model::bucket::Lifecycle;
5084    /// let x = Bucket::new().set_or_clear_lifecycle(Some(Lifecycle::default()/* use setters */));
5085    /// let x = Bucket::new().set_or_clear_lifecycle(None::<Lifecycle>);
5086    /// ```
5087    pub fn set_or_clear_lifecycle<T>(mut self, v: std::option::Option<T>) -> Self
5088    where
5089        T: std::convert::Into<crate::model::bucket::Lifecycle>,
5090    {
5091        self.lifecycle = v.map(|x| x.into());
5092        self
5093    }
5094
5095    /// Sets the value of [create_time][crate::model::Bucket::create_time].
5096    ///
5097    /// # Example
5098    /// ```ignore,no_run
5099    /// # use google_cloud_storage::model::Bucket;
5100    /// use wkt::Timestamp;
5101    /// let x = Bucket::new().set_create_time(Timestamp::default()/* use setters */);
5102    /// ```
5103    pub fn set_create_time<T>(mut self, v: T) -> Self
5104    where
5105        T: std::convert::Into<wkt::Timestamp>,
5106    {
5107        self.create_time = std::option::Option::Some(v.into());
5108        self
5109    }
5110
5111    /// Sets or clears the value of [create_time][crate::model::Bucket::create_time].
5112    ///
5113    /// # Example
5114    /// ```ignore,no_run
5115    /// # use google_cloud_storage::model::Bucket;
5116    /// use wkt::Timestamp;
5117    /// let x = Bucket::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5118    /// let x = Bucket::new().set_or_clear_create_time(None::<Timestamp>);
5119    /// ```
5120    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5121    where
5122        T: std::convert::Into<wkt::Timestamp>,
5123    {
5124        self.create_time = v.map(|x| x.into());
5125        self
5126    }
5127
5128    /// Sets the value of [cors][crate::model::Bucket::cors].
5129    ///
5130    /// # Example
5131    /// ```ignore,no_run
5132    /// # use google_cloud_storage::model::Bucket;
5133    /// use google_cloud_storage::model::bucket::Cors;
5134    /// let x = Bucket::new()
5135    ///     .set_cors([
5136    ///         Cors::default()/* use setters */,
5137    ///         Cors::default()/* use (different) setters */,
5138    ///     ]);
5139    /// ```
5140    pub fn set_cors<T, V>(mut self, v: T) -> Self
5141    where
5142        T: std::iter::IntoIterator<Item = V>,
5143        V: std::convert::Into<crate::model::bucket::Cors>,
5144    {
5145        use std::iter::Iterator;
5146        self.cors = v.into_iter().map(|i| i.into()).collect();
5147        self
5148    }
5149
5150    /// Sets the value of [update_time][crate::model::Bucket::update_time].
5151    ///
5152    /// # Example
5153    /// ```ignore,no_run
5154    /// # use google_cloud_storage::model::Bucket;
5155    /// use wkt::Timestamp;
5156    /// let x = Bucket::new().set_update_time(Timestamp::default()/* use setters */);
5157    /// ```
5158    pub fn set_update_time<T>(mut self, v: T) -> Self
5159    where
5160        T: std::convert::Into<wkt::Timestamp>,
5161    {
5162        self.update_time = std::option::Option::Some(v.into());
5163        self
5164    }
5165
5166    /// Sets or clears the value of [update_time][crate::model::Bucket::update_time].
5167    ///
5168    /// # Example
5169    /// ```ignore,no_run
5170    /// # use google_cloud_storage::model::Bucket;
5171    /// use wkt::Timestamp;
5172    /// let x = Bucket::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5173    /// let x = Bucket::new().set_or_clear_update_time(None::<Timestamp>);
5174    /// ```
5175    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5176    where
5177        T: std::convert::Into<wkt::Timestamp>,
5178    {
5179        self.update_time = v.map(|x| x.into());
5180        self
5181    }
5182
5183    /// Sets the value of [default_event_based_hold][crate::model::Bucket::default_event_based_hold].
5184    ///
5185    /// # Example
5186    /// ```ignore,no_run
5187    /// # use google_cloud_storage::model::Bucket;
5188    /// let x = Bucket::new().set_default_event_based_hold(true);
5189    /// ```
5190    pub fn set_default_event_based_hold<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5191        self.default_event_based_hold = v.into();
5192        self
5193    }
5194
5195    /// Sets the value of [labels][crate::model::Bucket::labels].
5196    ///
5197    /// # Example
5198    /// ```ignore,no_run
5199    /// # use google_cloud_storage::model::Bucket;
5200    /// let x = Bucket::new().set_labels([
5201    ///     ("key0", "abc"),
5202    ///     ("key1", "xyz"),
5203    /// ]);
5204    /// ```
5205    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5206    where
5207        T: std::iter::IntoIterator<Item = (K, V)>,
5208        K: std::convert::Into<std::string::String>,
5209        V: std::convert::Into<std::string::String>,
5210    {
5211        use std::iter::Iterator;
5212        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5213        self
5214    }
5215
5216    /// Sets the value of [website][crate::model::Bucket::website].
5217    ///
5218    /// # Example
5219    /// ```ignore,no_run
5220    /// # use google_cloud_storage::model::Bucket;
5221    /// use google_cloud_storage::model::bucket::Website;
5222    /// let x = Bucket::new().set_website(Website::default()/* use setters */);
5223    /// ```
5224    pub fn set_website<T>(mut self, v: T) -> Self
5225    where
5226        T: std::convert::Into<crate::model::bucket::Website>,
5227    {
5228        self.website = std::option::Option::Some(v.into());
5229        self
5230    }
5231
5232    /// Sets or clears the value of [website][crate::model::Bucket::website].
5233    ///
5234    /// # Example
5235    /// ```ignore,no_run
5236    /// # use google_cloud_storage::model::Bucket;
5237    /// use google_cloud_storage::model::bucket::Website;
5238    /// let x = Bucket::new().set_or_clear_website(Some(Website::default()/* use setters */));
5239    /// let x = Bucket::new().set_or_clear_website(None::<Website>);
5240    /// ```
5241    pub fn set_or_clear_website<T>(mut self, v: std::option::Option<T>) -> Self
5242    where
5243        T: std::convert::Into<crate::model::bucket::Website>,
5244    {
5245        self.website = v.map(|x| x.into());
5246        self
5247    }
5248
5249    /// Sets the value of [versioning][crate::model::Bucket::versioning].
5250    ///
5251    /// # Example
5252    /// ```ignore,no_run
5253    /// # use google_cloud_storage::model::Bucket;
5254    /// use google_cloud_storage::model::bucket::Versioning;
5255    /// let x = Bucket::new().set_versioning(Versioning::default()/* use setters */);
5256    /// ```
5257    pub fn set_versioning<T>(mut self, v: T) -> Self
5258    where
5259        T: std::convert::Into<crate::model::bucket::Versioning>,
5260    {
5261        self.versioning = std::option::Option::Some(v.into());
5262        self
5263    }
5264
5265    /// Sets or clears the value of [versioning][crate::model::Bucket::versioning].
5266    ///
5267    /// # Example
5268    /// ```ignore,no_run
5269    /// # use google_cloud_storage::model::Bucket;
5270    /// use google_cloud_storage::model::bucket::Versioning;
5271    /// let x = Bucket::new().set_or_clear_versioning(Some(Versioning::default()/* use setters */));
5272    /// let x = Bucket::new().set_or_clear_versioning(None::<Versioning>);
5273    /// ```
5274    pub fn set_or_clear_versioning<T>(mut self, v: std::option::Option<T>) -> Self
5275    where
5276        T: std::convert::Into<crate::model::bucket::Versioning>,
5277    {
5278        self.versioning = v.map(|x| x.into());
5279        self
5280    }
5281
5282    /// Sets the value of [logging][crate::model::Bucket::logging].
5283    ///
5284    /// # Example
5285    /// ```ignore,no_run
5286    /// # use google_cloud_storage::model::Bucket;
5287    /// use google_cloud_storage::model::bucket::Logging;
5288    /// let x = Bucket::new().set_logging(Logging::default()/* use setters */);
5289    /// ```
5290    pub fn set_logging<T>(mut self, v: T) -> Self
5291    where
5292        T: std::convert::Into<crate::model::bucket::Logging>,
5293    {
5294        self.logging = std::option::Option::Some(v.into());
5295        self
5296    }
5297
5298    /// Sets or clears the value of [logging][crate::model::Bucket::logging].
5299    ///
5300    /// # Example
5301    /// ```ignore,no_run
5302    /// # use google_cloud_storage::model::Bucket;
5303    /// use google_cloud_storage::model::bucket::Logging;
5304    /// let x = Bucket::new().set_or_clear_logging(Some(Logging::default()/* use setters */));
5305    /// let x = Bucket::new().set_or_clear_logging(None::<Logging>);
5306    /// ```
5307    pub fn set_or_clear_logging<T>(mut self, v: std::option::Option<T>) -> Self
5308    where
5309        T: std::convert::Into<crate::model::bucket::Logging>,
5310    {
5311        self.logging = v.map(|x| x.into());
5312        self
5313    }
5314
5315    /// Sets the value of [owner][crate::model::Bucket::owner].
5316    ///
5317    /// # Example
5318    /// ```ignore,no_run
5319    /// # use google_cloud_storage::model::Bucket;
5320    /// use google_cloud_storage::model::Owner;
5321    /// let x = Bucket::new().set_owner(Owner::default()/* use setters */);
5322    /// ```
5323    pub fn set_owner<T>(mut self, v: T) -> Self
5324    where
5325        T: std::convert::Into<crate::model::Owner>,
5326    {
5327        self.owner = std::option::Option::Some(v.into());
5328        self
5329    }
5330
5331    /// Sets or clears the value of [owner][crate::model::Bucket::owner].
5332    ///
5333    /// # Example
5334    /// ```ignore,no_run
5335    /// # use google_cloud_storage::model::Bucket;
5336    /// use google_cloud_storage::model::Owner;
5337    /// let x = Bucket::new().set_or_clear_owner(Some(Owner::default()/* use setters */));
5338    /// let x = Bucket::new().set_or_clear_owner(None::<Owner>);
5339    /// ```
5340    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
5341    where
5342        T: std::convert::Into<crate::model::Owner>,
5343    {
5344        self.owner = v.map(|x| x.into());
5345        self
5346    }
5347
5348    /// Sets the value of [encryption][crate::model::Bucket::encryption].
5349    ///
5350    /// # Example
5351    /// ```ignore,no_run
5352    /// # use google_cloud_storage::model::Bucket;
5353    /// use google_cloud_storage::model::bucket::Encryption;
5354    /// let x = Bucket::new().set_encryption(Encryption::default()/* use setters */);
5355    /// ```
5356    pub fn set_encryption<T>(mut self, v: T) -> Self
5357    where
5358        T: std::convert::Into<crate::model::bucket::Encryption>,
5359    {
5360        self.encryption = std::option::Option::Some(v.into());
5361        self
5362    }
5363
5364    /// Sets or clears the value of [encryption][crate::model::Bucket::encryption].
5365    ///
5366    /// # Example
5367    /// ```ignore,no_run
5368    /// # use google_cloud_storage::model::Bucket;
5369    /// use google_cloud_storage::model::bucket::Encryption;
5370    /// let x = Bucket::new().set_or_clear_encryption(Some(Encryption::default()/* use setters */));
5371    /// let x = Bucket::new().set_or_clear_encryption(None::<Encryption>);
5372    /// ```
5373    pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
5374    where
5375        T: std::convert::Into<crate::model::bucket::Encryption>,
5376    {
5377        self.encryption = v.map(|x| x.into());
5378        self
5379    }
5380
5381    /// Sets the value of [billing][crate::model::Bucket::billing].
5382    ///
5383    /// # Example
5384    /// ```ignore,no_run
5385    /// # use google_cloud_storage::model::Bucket;
5386    /// use google_cloud_storage::model::bucket::Billing;
5387    /// let x = Bucket::new().set_billing(Billing::default()/* use setters */);
5388    /// ```
5389    pub fn set_billing<T>(mut self, v: T) -> Self
5390    where
5391        T: std::convert::Into<crate::model::bucket::Billing>,
5392    {
5393        self.billing = std::option::Option::Some(v.into());
5394        self
5395    }
5396
5397    /// Sets or clears the value of [billing][crate::model::Bucket::billing].
5398    ///
5399    /// # Example
5400    /// ```ignore,no_run
5401    /// # use google_cloud_storage::model::Bucket;
5402    /// use google_cloud_storage::model::bucket::Billing;
5403    /// let x = Bucket::new().set_or_clear_billing(Some(Billing::default()/* use setters */));
5404    /// let x = Bucket::new().set_or_clear_billing(None::<Billing>);
5405    /// ```
5406    pub fn set_or_clear_billing<T>(mut self, v: std::option::Option<T>) -> Self
5407    where
5408        T: std::convert::Into<crate::model::bucket::Billing>,
5409    {
5410        self.billing = v.map(|x| x.into());
5411        self
5412    }
5413
5414    /// Sets the value of [retention_policy][crate::model::Bucket::retention_policy].
5415    ///
5416    /// # Example
5417    /// ```ignore,no_run
5418    /// # use google_cloud_storage::model::Bucket;
5419    /// use google_cloud_storage::model::bucket::RetentionPolicy;
5420    /// let x = Bucket::new().set_retention_policy(RetentionPolicy::default()/* use setters */);
5421    /// ```
5422    pub fn set_retention_policy<T>(mut self, v: T) -> Self
5423    where
5424        T: std::convert::Into<crate::model::bucket::RetentionPolicy>,
5425    {
5426        self.retention_policy = std::option::Option::Some(v.into());
5427        self
5428    }
5429
5430    /// Sets or clears the value of [retention_policy][crate::model::Bucket::retention_policy].
5431    ///
5432    /// # Example
5433    /// ```ignore,no_run
5434    /// # use google_cloud_storage::model::Bucket;
5435    /// use google_cloud_storage::model::bucket::RetentionPolicy;
5436    /// let x = Bucket::new().set_or_clear_retention_policy(Some(RetentionPolicy::default()/* use setters */));
5437    /// let x = Bucket::new().set_or_clear_retention_policy(None::<RetentionPolicy>);
5438    /// ```
5439    pub fn set_or_clear_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
5440    where
5441        T: std::convert::Into<crate::model::bucket::RetentionPolicy>,
5442    {
5443        self.retention_policy = v.map(|x| x.into());
5444        self
5445    }
5446
5447    /// Sets the value of [iam_config][crate::model::Bucket::iam_config].
5448    ///
5449    /// # Example
5450    /// ```ignore,no_run
5451    /// # use google_cloud_storage::model::Bucket;
5452    /// use google_cloud_storage::model::bucket::IamConfig;
5453    /// let x = Bucket::new().set_iam_config(IamConfig::default()/* use setters */);
5454    /// ```
5455    pub fn set_iam_config<T>(mut self, v: T) -> Self
5456    where
5457        T: std::convert::Into<crate::model::bucket::IamConfig>,
5458    {
5459        self.iam_config = std::option::Option::Some(v.into());
5460        self
5461    }
5462
5463    /// Sets or clears the value of [iam_config][crate::model::Bucket::iam_config].
5464    ///
5465    /// # Example
5466    /// ```ignore,no_run
5467    /// # use google_cloud_storage::model::Bucket;
5468    /// use google_cloud_storage::model::bucket::IamConfig;
5469    /// let x = Bucket::new().set_or_clear_iam_config(Some(IamConfig::default()/* use setters */));
5470    /// let x = Bucket::new().set_or_clear_iam_config(None::<IamConfig>);
5471    /// ```
5472    pub fn set_or_clear_iam_config<T>(mut self, v: std::option::Option<T>) -> Self
5473    where
5474        T: std::convert::Into<crate::model::bucket::IamConfig>,
5475    {
5476        self.iam_config = v.map(|x| x.into());
5477        self
5478    }
5479
5480    /// Sets the value of [satisfies_pzs][crate::model::Bucket::satisfies_pzs].
5481    ///
5482    /// # Example
5483    /// ```ignore,no_run
5484    /// # use google_cloud_storage::model::Bucket;
5485    /// let x = Bucket::new().set_satisfies_pzs(true);
5486    /// ```
5487    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5488        self.satisfies_pzs = v.into();
5489        self
5490    }
5491
5492    /// Sets the value of [custom_placement_config][crate::model::Bucket::custom_placement_config].
5493    ///
5494    /// # Example
5495    /// ```ignore,no_run
5496    /// # use google_cloud_storage::model::Bucket;
5497    /// use google_cloud_storage::model::bucket::CustomPlacementConfig;
5498    /// let x = Bucket::new().set_custom_placement_config(CustomPlacementConfig::default()/* use setters */);
5499    /// ```
5500    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
5501    where
5502        T: std::convert::Into<crate::model::bucket::CustomPlacementConfig>,
5503    {
5504        self.custom_placement_config = std::option::Option::Some(v.into());
5505        self
5506    }
5507
5508    /// Sets or clears the value of [custom_placement_config][crate::model::Bucket::custom_placement_config].
5509    ///
5510    /// # Example
5511    /// ```ignore,no_run
5512    /// # use google_cloud_storage::model::Bucket;
5513    /// use google_cloud_storage::model::bucket::CustomPlacementConfig;
5514    /// let x = Bucket::new().set_or_clear_custom_placement_config(Some(CustomPlacementConfig::default()/* use setters */));
5515    /// let x = Bucket::new().set_or_clear_custom_placement_config(None::<CustomPlacementConfig>);
5516    /// ```
5517    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
5518    where
5519        T: std::convert::Into<crate::model::bucket::CustomPlacementConfig>,
5520    {
5521        self.custom_placement_config = v.map(|x| x.into());
5522        self
5523    }
5524
5525    /// Sets the value of [autoclass][crate::model::Bucket::autoclass].
5526    ///
5527    /// # Example
5528    /// ```ignore,no_run
5529    /// # use google_cloud_storage::model::Bucket;
5530    /// use google_cloud_storage::model::bucket::Autoclass;
5531    /// let x = Bucket::new().set_autoclass(Autoclass::default()/* use setters */);
5532    /// ```
5533    pub fn set_autoclass<T>(mut self, v: T) -> Self
5534    where
5535        T: std::convert::Into<crate::model::bucket::Autoclass>,
5536    {
5537        self.autoclass = std::option::Option::Some(v.into());
5538        self
5539    }
5540
5541    /// Sets or clears the value of [autoclass][crate::model::Bucket::autoclass].
5542    ///
5543    /// # Example
5544    /// ```ignore,no_run
5545    /// # use google_cloud_storage::model::Bucket;
5546    /// use google_cloud_storage::model::bucket::Autoclass;
5547    /// let x = Bucket::new().set_or_clear_autoclass(Some(Autoclass::default()/* use setters */));
5548    /// let x = Bucket::new().set_or_clear_autoclass(None::<Autoclass>);
5549    /// ```
5550    pub fn set_or_clear_autoclass<T>(mut self, v: std::option::Option<T>) -> Self
5551    where
5552        T: std::convert::Into<crate::model::bucket::Autoclass>,
5553    {
5554        self.autoclass = v.map(|x| x.into());
5555        self
5556    }
5557
5558    /// Sets the value of [hierarchical_namespace][crate::model::Bucket::hierarchical_namespace].
5559    ///
5560    /// # Example
5561    /// ```ignore,no_run
5562    /// # use google_cloud_storage::model::Bucket;
5563    /// use google_cloud_storage::model::bucket::HierarchicalNamespace;
5564    /// let x = Bucket::new().set_hierarchical_namespace(HierarchicalNamespace::default()/* use setters */);
5565    /// ```
5566    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
5567    where
5568        T: std::convert::Into<crate::model::bucket::HierarchicalNamespace>,
5569    {
5570        self.hierarchical_namespace = std::option::Option::Some(v.into());
5571        self
5572    }
5573
5574    /// Sets or clears the value of [hierarchical_namespace][crate::model::Bucket::hierarchical_namespace].
5575    ///
5576    /// # Example
5577    /// ```ignore,no_run
5578    /// # use google_cloud_storage::model::Bucket;
5579    /// use google_cloud_storage::model::bucket::HierarchicalNamespace;
5580    /// let x = Bucket::new().set_or_clear_hierarchical_namespace(Some(HierarchicalNamespace::default()/* use setters */));
5581    /// let x = Bucket::new().set_or_clear_hierarchical_namespace(None::<HierarchicalNamespace>);
5582    /// ```
5583    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
5584    where
5585        T: std::convert::Into<crate::model::bucket::HierarchicalNamespace>,
5586    {
5587        self.hierarchical_namespace = v.map(|x| x.into());
5588        self
5589    }
5590
5591    /// Sets the value of [soft_delete_policy][crate::model::Bucket::soft_delete_policy].
5592    ///
5593    /// # Example
5594    /// ```ignore,no_run
5595    /// # use google_cloud_storage::model::Bucket;
5596    /// use google_cloud_storage::model::bucket::SoftDeletePolicy;
5597    /// let x = Bucket::new().set_soft_delete_policy(SoftDeletePolicy::default()/* use setters */);
5598    /// ```
5599    pub fn set_soft_delete_policy<T>(mut self, v: T) -> Self
5600    where
5601        T: std::convert::Into<crate::model::bucket::SoftDeletePolicy>,
5602    {
5603        self.soft_delete_policy = std::option::Option::Some(v.into());
5604        self
5605    }
5606
5607    /// Sets or clears the value of [soft_delete_policy][crate::model::Bucket::soft_delete_policy].
5608    ///
5609    /// # Example
5610    /// ```ignore,no_run
5611    /// # use google_cloud_storage::model::Bucket;
5612    /// use google_cloud_storage::model::bucket::SoftDeletePolicy;
5613    /// let x = Bucket::new().set_or_clear_soft_delete_policy(Some(SoftDeletePolicy::default()/* use setters */));
5614    /// let x = Bucket::new().set_or_clear_soft_delete_policy(None::<SoftDeletePolicy>);
5615    /// ```
5616    pub fn set_or_clear_soft_delete_policy<T>(mut self, v: std::option::Option<T>) -> Self
5617    where
5618        T: std::convert::Into<crate::model::bucket::SoftDeletePolicy>,
5619    {
5620        self.soft_delete_policy = v.map(|x| x.into());
5621        self
5622    }
5623
5624    /// Sets the value of [object_retention][crate::model::Bucket::object_retention].
5625    ///
5626    /// # Example
5627    /// ```ignore,no_run
5628    /// # use google_cloud_storage::model::Bucket;
5629    /// use google_cloud_storage::model::bucket::ObjectRetention;
5630    /// let x = Bucket::new().set_object_retention(ObjectRetention::default()/* use setters */);
5631    /// ```
5632    pub fn set_object_retention<T>(mut self, v: T) -> Self
5633    where
5634        T: std::convert::Into<crate::model::bucket::ObjectRetention>,
5635    {
5636        self.object_retention = std::option::Option::Some(v.into());
5637        self
5638    }
5639
5640    /// Sets or clears the value of [object_retention][crate::model::Bucket::object_retention].
5641    ///
5642    /// # Example
5643    /// ```ignore,no_run
5644    /// # use google_cloud_storage::model::Bucket;
5645    /// use google_cloud_storage::model::bucket::ObjectRetention;
5646    /// let x = Bucket::new().set_or_clear_object_retention(Some(ObjectRetention::default()/* use setters */));
5647    /// let x = Bucket::new().set_or_clear_object_retention(None::<ObjectRetention>);
5648    /// ```
5649    pub fn set_or_clear_object_retention<T>(mut self, v: std::option::Option<T>) -> Self
5650    where
5651        T: std::convert::Into<crate::model::bucket::ObjectRetention>,
5652    {
5653        self.object_retention = v.map(|x| x.into());
5654        self
5655    }
5656
5657    /// Sets the value of [ip_filter][crate::model::Bucket::ip_filter].
5658    ///
5659    /// # Example
5660    /// ```ignore,no_run
5661    /// # use google_cloud_storage::model::Bucket;
5662    /// use google_cloud_storage::model::bucket::IpFilter;
5663    /// let x = Bucket::new().set_ip_filter(IpFilter::default()/* use setters */);
5664    /// ```
5665    pub fn set_ip_filter<T>(mut self, v: T) -> Self
5666    where
5667        T: std::convert::Into<crate::model::bucket::IpFilter>,
5668    {
5669        self.ip_filter = std::option::Option::Some(v.into());
5670        self
5671    }
5672
5673    /// Sets or clears the value of [ip_filter][crate::model::Bucket::ip_filter].
5674    ///
5675    /// # Example
5676    /// ```ignore,no_run
5677    /// # use google_cloud_storage::model::Bucket;
5678    /// use google_cloud_storage::model::bucket::IpFilter;
5679    /// let x = Bucket::new().set_or_clear_ip_filter(Some(IpFilter::default()/* use setters */));
5680    /// let x = Bucket::new().set_or_clear_ip_filter(None::<IpFilter>);
5681    /// ```
5682    pub fn set_or_clear_ip_filter<T>(mut self, v: std::option::Option<T>) -> Self
5683    where
5684        T: std::convert::Into<crate::model::bucket::IpFilter>,
5685    {
5686        self.ip_filter = v.map(|x| x.into());
5687        self
5688    }
5689}
5690
5691impl wkt::message::Message for Bucket {
5692    fn typename() -> &'static str {
5693        "type.googleapis.com/google.storage.v2.Bucket"
5694    }
5695}
5696
5697/// Defines additional types related to [Bucket].
5698pub mod bucket {
5699    #[allow(unused_imports)]
5700    use super::*;
5701
5702    /// Billing properties of a bucket.
5703    #[derive(Clone, Default, PartialEq)]
5704    #[non_exhaustive]
5705    pub struct Billing {
5706        /// Optional. When set to true, Requester Pays is enabled for this bucket.
5707        pub requester_pays: bool,
5708
5709        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5710    }
5711
5712    impl Billing {
5713        pub fn new() -> Self {
5714            std::default::Default::default()
5715        }
5716
5717        /// Sets the value of [requester_pays][crate::model::bucket::Billing::requester_pays].
5718        ///
5719        /// # Example
5720        /// ```ignore,no_run
5721        /// # use google_cloud_storage::model::bucket::Billing;
5722        /// let x = Billing::new().set_requester_pays(true);
5723        /// ```
5724        pub fn set_requester_pays<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5725            self.requester_pays = v.into();
5726            self
5727        }
5728    }
5729
5730    impl wkt::message::Message for Billing {
5731        fn typename() -> &'static str {
5732            "type.googleapis.com/google.storage.v2.Bucket.Billing"
5733        }
5734    }
5735
5736    /// Cross-Origin Response sharing (CORS) properties for a bucket.
5737    /// For more on Cloud Storage and CORS, see
5738    /// <https://cloud.google.com/storage/docs/cross-origin>.
5739    /// For more on CORS in general, see <https://tools.ietf.org/html/rfc6454>.
5740    #[derive(Clone, Default, PartialEq)]
5741    #[non_exhaustive]
5742    pub struct Cors {
5743        /// Optional. The list of origins eligible to receive CORS response headers.
5744        /// For more information about origins, see [RFC
5745        /// 6454](https://tools.ietf.org/html/rfc6454). Note: `*` is permitted in the
5746        /// list of origins, and means `any origin`.
5747        pub origin: std::vec::Vec<std::string::String>,
5748
5749        /// Optional. The list of HTTP methods on which to include CORS response
5750        /// headers,
5751        /// (`GET`, `OPTIONS`, `POST`, etc) Note: `*` is permitted in the list of
5752        /// methods, and means "any method".
5753        pub method: std::vec::Vec<std::string::String>,
5754
5755        /// Optional. The list of HTTP headers other than the [simple response
5756        /// headers](https://www.w3.org/TR/cors/#simple-response-headers) to give
5757        /// permission for the user-agent to share across domains.
5758        pub response_header: std::vec::Vec<std::string::String>,
5759
5760        /// Optional. The value, in seconds, to return in the [Access-Control-Max-Age
5761        /// header](https://www.w3.org/TR/cors/#access-control-max-age-response-header)
5762        /// used in preflight responses.
5763        pub max_age_seconds: i32,
5764
5765        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5766    }
5767
5768    impl Cors {
5769        pub fn new() -> Self {
5770            std::default::Default::default()
5771        }
5772
5773        /// Sets the value of [origin][crate::model::bucket::Cors::origin].
5774        ///
5775        /// # Example
5776        /// ```ignore,no_run
5777        /// # use google_cloud_storage::model::bucket::Cors;
5778        /// let x = Cors::new().set_origin(["a", "b", "c"]);
5779        /// ```
5780        pub fn set_origin<T, V>(mut self, v: T) -> Self
5781        where
5782            T: std::iter::IntoIterator<Item = V>,
5783            V: std::convert::Into<std::string::String>,
5784        {
5785            use std::iter::Iterator;
5786            self.origin = v.into_iter().map(|i| i.into()).collect();
5787            self
5788        }
5789
5790        /// Sets the value of [method][crate::model::bucket::Cors::method].
5791        ///
5792        /// # Example
5793        /// ```ignore,no_run
5794        /// # use google_cloud_storage::model::bucket::Cors;
5795        /// let x = Cors::new().set_method(["a", "b", "c"]);
5796        /// ```
5797        pub fn set_method<T, V>(mut self, v: T) -> Self
5798        where
5799            T: std::iter::IntoIterator<Item = V>,
5800            V: std::convert::Into<std::string::String>,
5801        {
5802            use std::iter::Iterator;
5803            self.method = v.into_iter().map(|i| i.into()).collect();
5804            self
5805        }
5806
5807        /// Sets the value of [response_header][crate::model::bucket::Cors::response_header].
5808        ///
5809        /// # Example
5810        /// ```ignore,no_run
5811        /// # use google_cloud_storage::model::bucket::Cors;
5812        /// let x = Cors::new().set_response_header(["a", "b", "c"]);
5813        /// ```
5814        pub fn set_response_header<T, V>(mut self, v: T) -> Self
5815        where
5816            T: std::iter::IntoIterator<Item = V>,
5817            V: std::convert::Into<std::string::String>,
5818        {
5819            use std::iter::Iterator;
5820            self.response_header = v.into_iter().map(|i| i.into()).collect();
5821            self
5822        }
5823
5824        /// Sets the value of [max_age_seconds][crate::model::bucket::Cors::max_age_seconds].
5825        ///
5826        /// # Example
5827        /// ```ignore,no_run
5828        /// # use google_cloud_storage::model::bucket::Cors;
5829        /// let x = Cors::new().set_max_age_seconds(42);
5830        /// ```
5831        pub fn set_max_age_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5832            self.max_age_seconds = v.into();
5833            self
5834        }
5835    }
5836
5837    impl wkt::message::Message for Cors {
5838        fn typename() -> &'static str {
5839            "type.googleapis.com/google.storage.v2.Bucket.Cors"
5840        }
5841    }
5842
5843    /// Encryption properties of a bucket.
5844    #[derive(Clone, Default, PartialEq)]
5845    #[non_exhaustive]
5846    pub struct Encryption {
5847        /// Optional. The name of the Cloud KMS key that is used to encrypt objects
5848        /// inserted into this bucket, if no encryption method is specified.
5849        pub default_kms_key: std::string::String,
5850
5851        /// Optional. If omitted, then new objects with GMEK encryption-type is
5852        /// allowed. If set, then new objects created in this bucket must comply with
5853        /// enforcement config. Changing this has no effect on existing objects; it
5854        /// applies to new objects only.
5855        pub google_managed_encryption_enforcement_config: std::option::Option<
5856            crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
5857        >,
5858
5859        /// Optional. If omitted, then new objects with CMEK encryption-type is
5860        /// allowed. If set, then new objects created in this bucket must comply with
5861        /// enforcement config. Changing this has no effect on existing objects; it
5862        /// applies to new objects only.
5863        pub customer_managed_encryption_enforcement_config: std::option::Option<
5864            crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
5865        >,
5866
5867        /// Optional. If omitted, then new objects with CSEK encryption-type is
5868        /// allowed. If set, then new objects created in this bucket must comply with
5869        /// enforcement config. Changing this has no effect on existing objects; it
5870        /// applies to new objects only.
5871        pub customer_supplied_encryption_enforcement_config: std::option::Option<
5872            crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
5873        >,
5874
5875        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5876    }
5877
5878    impl Encryption {
5879        pub fn new() -> Self {
5880            std::default::Default::default()
5881        }
5882
5883        /// Sets the value of [default_kms_key][crate::model::bucket::Encryption::default_kms_key].
5884        ///
5885        /// # Example
5886        /// ```ignore,no_run
5887        /// # use google_cloud_storage::model::bucket::Encryption;
5888        /// let x = Encryption::new().set_default_kms_key("example");
5889        /// ```
5890        pub fn set_default_kms_key<T: std::convert::Into<std::string::String>>(
5891            mut self,
5892            v: T,
5893        ) -> Self {
5894            self.default_kms_key = v.into();
5895            self
5896        }
5897
5898        /// Sets the value of [google_managed_encryption_enforcement_config][crate::model::bucket::Encryption::google_managed_encryption_enforcement_config].
5899        ///
5900        /// # Example
5901        /// ```ignore,no_run
5902        /// # use google_cloud_storage::model::bucket::Encryption;
5903        /// use google_cloud_storage::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig;
5904        /// let x = Encryption::new().set_google_managed_encryption_enforcement_config(GoogleManagedEncryptionEnforcementConfig::default()/* use setters */);
5905        /// ```
5906        pub fn set_google_managed_encryption_enforcement_config<T>(mut self, v: T) -> Self
5907        where
5908            T: std::convert::Into<
5909                    crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
5910                >,
5911        {
5912            self.google_managed_encryption_enforcement_config = std::option::Option::Some(v.into());
5913            self
5914        }
5915
5916        /// Sets or clears the value of [google_managed_encryption_enforcement_config][crate::model::bucket::Encryption::google_managed_encryption_enforcement_config].
5917        ///
5918        /// # Example
5919        /// ```ignore,no_run
5920        /// # use google_cloud_storage::model::bucket::Encryption;
5921        /// use google_cloud_storage::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig;
5922        /// let x = Encryption::new().set_or_clear_google_managed_encryption_enforcement_config(Some(GoogleManagedEncryptionEnforcementConfig::default()/* use setters */));
5923        /// let x = Encryption::new().set_or_clear_google_managed_encryption_enforcement_config(None::<GoogleManagedEncryptionEnforcementConfig>);
5924        /// ```
5925        pub fn set_or_clear_google_managed_encryption_enforcement_config<T>(
5926            mut self,
5927            v: std::option::Option<T>,
5928        ) -> Self
5929        where
5930            T: std::convert::Into<
5931                    crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
5932                >,
5933        {
5934            self.google_managed_encryption_enforcement_config = v.map(|x| x.into());
5935            self
5936        }
5937
5938        /// Sets the value of [customer_managed_encryption_enforcement_config][crate::model::bucket::Encryption::customer_managed_encryption_enforcement_config].
5939        ///
5940        /// # Example
5941        /// ```ignore,no_run
5942        /// # use google_cloud_storage::model::bucket::Encryption;
5943        /// use google_cloud_storage::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig;
5944        /// let x = Encryption::new().set_customer_managed_encryption_enforcement_config(CustomerManagedEncryptionEnforcementConfig::default()/* use setters */);
5945        /// ```
5946        pub fn set_customer_managed_encryption_enforcement_config<T>(mut self, v: T) -> Self
5947        where
5948            T: std::convert::Into<
5949                    crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
5950                >,
5951        {
5952            self.customer_managed_encryption_enforcement_config =
5953                std::option::Option::Some(v.into());
5954            self
5955        }
5956
5957        /// Sets or clears the value of [customer_managed_encryption_enforcement_config][crate::model::bucket::Encryption::customer_managed_encryption_enforcement_config].
5958        ///
5959        /// # Example
5960        /// ```ignore,no_run
5961        /// # use google_cloud_storage::model::bucket::Encryption;
5962        /// use google_cloud_storage::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig;
5963        /// let x = Encryption::new().set_or_clear_customer_managed_encryption_enforcement_config(Some(CustomerManagedEncryptionEnforcementConfig::default()/* use setters */));
5964        /// let x = Encryption::new().set_or_clear_customer_managed_encryption_enforcement_config(None::<CustomerManagedEncryptionEnforcementConfig>);
5965        /// ```
5966        pub fn set_or_clear_customer_managed_encryption_enforcement_config<T>(
5967            mut self,
5968            v: std::option::Option<T>,
5969        ) -> Self
5970        where
5971            T: std::convert::Into<
5972                    crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
5973                >,
5974        {
5975            self.customer_managed_encryption_enforcement_config = v.map(|x| x.into());
5976            self
5977        }
5978
5979        /// Sets the value of [customer_supplied_encryption_enforcement_config][crate::model::bucket::Encryption::customer_supplied_encryption_enforcement_config].
5980        ///
5981        /// # Example
5982        /// ```ignore,no_run
5983        /// # use google_cloud_storage::model::bucket::Encryption;
5984        /// use google_cloud_storage::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig;
5985        /// let x = Encryption::new().set_customer_supplied_encryption_enforcement_config(CustomerSuppliedEncryptionEnforcementConfig::default()/* use setters */);
5986        /// ```
5987        pub fn set_customer_supplied_encryption_enforcement_config<T>(mut self, v: T) -> Self
5988        where
5989            T: std::convert::Into<
5990                    crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
5991                >,
5992        {
5993            self.customer_supplied_encryption_enforcement_config =
5994                std::option::Option::Some(v.into());
5995            self
5996        }
5997
5998        /// Sets or clears the value of [customer_supplied_encryption_enforcement_config][crate::model::bucket::Encryption::customer_supplied_encryption_enforcement_config].
5999        ///
6000        /// # Example
6001        /// ```ignore,no_run
6002        /// # use google_cloud_storage::model::bucket::Encryption;
6003        /// use google_cloud_storage::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig;
6004        /// let x = Encryption::new().set_or_clear_customer_supplied_encryption_enforcement_config(Some(CustomerSuppliedEncryptionEnforcementConfig::default()/* use setters */));
6005        /// let x = Encryption::new().set_or_clear_customer_supplied_encryption_enforcement_config(None::<CustomerSuppliedEncryptionEnforcementConfig>);
6006        /// ```
6007        pub fn set_or_clear_customer_supplied_encryption_enforcement_config<T>(
6008            mut self,
6009            v: std::option::Option<T>,
6010        ) -> Self
6011        where
6012            T: std::convert::Into<
6013                    crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
6014                >,
6015        {
6016            self.customer_supplied_encryption_enforcement_config = v.map(|x| x.into());
6017            self
6018        }
6019    }
6020
6021    impl wkt::message::Message for Encryption {
6022        fn typename() -> &'static str {
6023            "type.googleapis.com/google.storage.v2.Bucket.Encryption"
6024        }
6025    }
6026
6027    /// Defines additional types related to [Encryption].
6028    pub mod encryption {
6029        #[allow(unused_imports)]
6030        use super::*;
6031
6032        /// Google Managed Encryption (GMEK) enforcement config of a bucket.
6033        #[derive(Clone, Default, PartialEq)]
6034        #[non_exhaustive]
6035        pub struct GoogleManagedEncryptionEnforcementConfig {
6036            /// Restriction mode for google-managed encryption for new objects within
6037            /// the bucket. Valid values are: `NotRestricted` and `FullyRestricted`.
6038            /// If `NotRestricted` or unset, creation of new objects with
6039            /// google-managed encryption is allowed.
6040            /// If `FullyRestricted`, new objects can't be created using google-managed
6041            /// encryption.
6042            pub restriction_mode: std::option::Option<std::string::String>,
6043
6044            /// Time from which the config was effective. This is service-provided.
6045            pub effective_time: std::option::Option<wkt::Timestamp>,
6046
6047            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6048        }
6049
6050        impl GoogleManagedEncryptionEnforcementConfig {
6051            pub fn new() -> Self {
6052                std::default::Default::default()
6053            }
6054
6055            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::restriction_mode].
6056            ///
6057            /// # Example
6058            /// ```ignore,no_run
6059            /// # use google_cloud_storage::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig;
6060            /// let x = GoogleManagedEncryptionEnforcementConfig::new().set_restriction_mode("example");
6061            /// ```
6062            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
6063            where
6064                T: std::convert::Into<std::string::String>,
6065            {
6066                self.restriction_mode = std::option::Option::Some(v.into());
6067                self
6068            }
6069
6070            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::restriction_mode].
6071            ///
6072            /// # Example
6073            /// ```ignore,no_run
6074            /// # use google_cloud_storage::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig;
6075            /// let x = GoogleManagedEncryptionEnforcementConfig::new().set_or_clear_restriction_mode(Some("example"));
6076            /// let x = GoogleManagedEncryptionEnforcementConfig::new().set_or_clear_restriction_mode(None::<String>);
6077            /// ```
6078            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
6079            where
6080                T: std::convert::Into<std::string::String>,
6081            {
6082                self.restriction_mode = v.map(|x| x.into());
6083                self
6084            }
6085
6086            /// Sets the value of [effective_time][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::effective_time].
6087            ///
6088            /// # Example
6089            /// ```ignore,no_run
6090            /// # use google_cloud_storage::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig;
6091            /// use wkt::Timestamp;
6092            /// let x = GoogleManagedEncryptionEnforcementConfig::new().set_effective_time(Timestamp::default()/* use setters */);
6093            /// ```
6094            pub fn set_effective_time<T>(mut self, v: T) -> Self
6095            where
6096                T: std::convert::Into<wkt::Timestamp>,
6097            {
6098                self.effective_time = std::option::Option::Some(v.into());
6099                self
6100            }
6101
6102            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::effective_time].
6103            ///
6104            /// # Example
6105            /// ```ignore,no_run
6106            /// # use google_cloud_storage::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig;
6107            /// use wkt::Timestamp;
6108            /// let x = GoogleManagedEncryptionEnforcementConfig::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
6109            /// let x = GoogleManagedEncryptionEnforcementConfig::new().set_or_clear_effective_time(None::<Timestamp>);
6110            /// ```
6111            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
6112            where
6113                T: std::convert::Into<wkt::Timestamp>,
6114            {
6115                self.effective_time = v.map(|x| x.into());
6116                self
6117            }
6118        }
6119
6120        impl wkt::message::Message for GoogleManagedEncryptionEnforcementConfig {
6121            fn typename() -> &'static str {
6122                "type.googleapis.com/google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig"
6123            }
6124        }
6125
6126        /// Customer Managed Encryption (CMEK) enforcement config of a bucket.
6127        #[derive(Clone, Default, PartialEq)]
6128        #[non_exhaustive]
6129        pub struct CustomerManagedEncryptionEnforcementConfig {
6130            /// Restriction mode for customer-managed encryption for new objects within
6131            /// the bucket. Valid values are: `NotRestricted` and `FullyRestricted`.
6132            /// If `NotRestricted` or unset, creation of new objects with
6133            /// customer-managed encryption is allowed.
6134            /// If `FullyRestricted`, new objects can't be created using
6135            /// customer-managed encryption.
6136            pub restriction_mode: std::option::Option<std::string::String>,
6137
6138            /// Time from which the config was effective. This is service-provided.
6139            pub effective_time: std::option::Option<wkt::Timestamp>,
6140
6141            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6142        }
6143
6144        impl CustomerManagedEncryptionEnforcementConfig {
6145            pub fn new() -> Self {
6146                std::default::Default::default()
6147            }
6148
6149            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::restriction_mode].
6150            ///
6151            /// # Example
6152            /// ```ignore,no_run
6153            /// # use google_cloud_storage::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig;
6154            /// let x = CustomerManagedEncryptionEnforcementConfig::new().set_restriction_mode("example");
6155            /// ```
6156            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
6157            where
6158                T: std::convert::Into<std::string::String>,
6159            {
6160                self.restriction_mode = std::option::Option::Some(v.into());
6161                self
6162            }
6163
6164            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::restriction_mode].
6165            ///
6166            /// # Example
6167            /// ```ignore,no_run
6168            /// # use google_cloud_storage::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig;
6169            /// let x = CustomerManagedEncryptionEnforcementConfig::new().set_or_clear_restriction_mode(Some("example"));
6170            /// let x = CustomerManagedEncryptionEnforcementConfig::new().set_or_clear_restriction_mode(None::<String>);
6171            /// ```
6172            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
6173            where
6174                T: std::convert::Into<std::string::String>,
6175            {
6176                self.restriction_mode = v.map(|x| x.into());
6177                self
6178            }
6179
6180            /// Sets the value of [effective_time][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::effective_time].
6181            ///
6182            /// # Example
6183            /// ```ignore,no_run
6184            /// # use google_cloud_storage::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig;
6185            /// use wkt::Timestamp;
6186            /// let x = CustomerManagedEncryptionEnforcementConfig::new().set_effective_time(Timestamp::default()/* use setters */);
6187            /// ```
6188            pub fn set_effective_time<T>(mut self, v: T) -> Self
6189            where
6190                T: std::convert::Into<wkt::Timestamp>,
6191            {
6192                self.effective_time = std::option::Option::Some(v.into());
6193                self
6194            }
6195
6196            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::effective_time].
6197            ///
6198            /// # Example
6199            /// ```ignore,no_run
6200            /// # use google_cloud_storage::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig;
6201            /// use wkt::Timestamp;
6202            /// let x = CustomerManagedEncryptionEnforcementConfig::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
6203            /// let x = CustomerManagedEncryptionEnforcementConfig::new().set_or_clear_effective_time(None::<Timestamp>);
6204            /// ```
6205            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
6206            where
6207                T: std::convert::Into<wkt::Timestamp>,
6208            {
6209                self.effective_time = v.map(|x| x.into());
6210                self
6211            }
6212        }
6213
6214        impl wkt::message::Message for CustomerManagedEncryptionEnforcementConfig {
6215            fn typename() -> &'static str {
6216                "type.googleapis.com/google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig"
6217            }
6218        }
6219
6220        /// Customer Supplied Encryption (CSEK) enforcement config of a bucket.
6221        #[derive(Clone, Default, PartialEq)]
6222        #[non_exhaustive]
6223        pub struct CustomerSuppliedEncryptionEnforcementConfig {
6224            /// Restriction mode for customer-supplied encryption for new objects
6225            /// within the bucket. Valid values are: `NotRestricted` and
6226            /// `FullyRestricted`.
6227            /// If `NotRestricted` or unset, creation of new objects with
6228            /// customer-supplied encryption is allowed.
6229            /// If `FullyRestricted`, new objects can't be created using
6230            /// customer-supplied encryption.
6231            pub restriction_mode: std::option::Option<std::string::String>,
6232
6233            /// Time from which the config was effective. This is service-provided.
6234            pub effective_time: std::option::Option<wkt::Timestamp>,
6235
6236            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6237        }
6238
6239        impl CustomerSuppliedEncryptionEnforcementConfig {
6240            pub fn new() -> Self {
6241                std::default::Default::default()
6242            }
6243
6244            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::restriction_mode].
6245            ///
6246            /// # Example
6247            /// ```ignore,no_run
6248            /// # use google_cloud_storage::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig;
6249            /// let x = CustomerSuppliedEncryptionEnforcementConfig::new().set_restriction_mode("example");
6250            /// ```
6251            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
6252            where
6253                T: std::convert::Into<std::string::String>,
6254            {
6255                self.restriction_mode = std::option::Option::Some(v.into());
6256                self
6257            }
6258
6259            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::restriction_mode].
6260            ///
6261            /// # Example
6262            /// ```ignore,no_run
6263            /// # use google_cloud_storage::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig;
6264            /// let x = CustomerSuppliedEncryptionEnforcementConfig::new().set_or_clear_restriction_mode(Some("example"));
6265            /// let x = CustomerSuppliedEncryptionEnforcementConfig::new().set_or_clear_restriction_mode(None::<String>);
6266            /// ```
6267            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
6268            where
6269                T: std::convert::Into<std::string::String>,
6270            {
6271                self.restriction_mode = v.map(|x| x.into());
6272                self
6273            }
6274
6275            /// Sets the value of [effective_time][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::effective_time].
6276            ///
6277            /// # Example
6278            /// ```ignore,no_run
6279            /// # use google_cloud_storage::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig;
6280            /// use wkt::Timestamp;
6281            /// let x = CustomerSuppliedEncryptionEnforcementConfig::new().set_effective_time(Timestamp::default()/* use setters */);
6282            /// ```
6283            pub fn set_effective_time<T>(mut self, v: T) -> Self
6284            where
6285                T: std::convert::Into<wkt::Timestamp>,
6286            {
6287                self.effective_time = std::option::Option::Some(v.into());
6288                self
6289            }
6290
6291            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::effective_time].
6292            ///
6293            /// # Example
6294            /// ```ignore,no_run
6295            /// # use google_cloud_storage::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig;
6296            /// use wkt::Timestamp;
6297            /// let x = CustomerSuppliedEncryptionEnforcementConfig::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
6298            /// let x = CustomerSuppliedEncryptionEnforcementConfig::new().set_or_clear_effective_time(None::<Timestamp>);
6299            /// ```
6300            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
6301            where
6302                T: std::convert::Into<wkt::Timestamp>,
6303            {
6304                self.effective_time = v.map(|x| x.into());
6305                self
6306            }
6307        }
6308
6309        impl wkt::message::Message for CustomerSuppliedEncryptionEnforcementConfig {
6310            fn typename() -> &'static str {
6311                "type.googleapis.com/google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig"
6312            }
6313        }
6314    }
6315
6316    /// Bucket restriction options.
6317    #[derive(Clone, Default, PartialEq)]
6318    #[non_exhaustive]
6319    pub struct IamConfig {
6320        /// Optional. Bucket restriction options currently enforced on the bucket.
6321        pub uniform_bucket_level_access:
6322            std::option::Option<crate::model::bucket::iam_config::UniformBucketLevelAccess>,
6323
6324        /// Optional. Whether IAM enforces public access prevention. Valid values are
6325        /// `enforced` or `inherited`.
6326        pub public_access_prevention: std::string::String,
6327
6328        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6329    }
6330
6331    impl IamConfig {
6332        pub fn new() -> Self {
6333            std::default::Default::default()
6334        }
6335
6336        /// Sets the value of [uniform_bucket_level_access][crate::model::bucket::IamConfig::uniform_bucket_level_access].
6337        ///
6338        /// # Example
6339        /// ```ignore,no_run
6340        /// # use google_cloud_storage::model::bucket::IamConfig;
6341        /// use google_cloud_storage::model::bucket::iam_config::UniformBucketLevelAccess;
6342        /// let x = IamConfig::new().set_uniform_bucket_level_access(UniformBucketLevelAccess::default()/* use setters */);
6343        /// ```
6344        pub fn set_uniform_bucket_level_access<T>(mut self, v: T) -> Self
6345        where
6346            T: std::convert::Into<crate::model::bucket::iam_config::UniformBucketLevelAccess>,
6347        {
6348            self.uniform_bucket_level_access = std::option::Option::Some(v.into());
6349            self
6350        }
6351
6352        /// Sets or clears the value of [uniform_bucket_level_access][crate::model::bucket::IamConfig::uniform_bucket_level_access].
6353        ///
6354        /// # Example
6355        /// ```ignore,no_run
6356        /// # use google_cloud_storage::model::bucket::IamConfig;
6357        /// use google_cloud_storage::model::bucket::iam_config::UniformBucketLevelAccess;
6358        /// let x = IamConfig::new().set_or_clear_uniform_bucket_level_access(Some(UniformBucketLevelAccess::default()/* use setters */));
6359        /// let x = IamConfig::new().set_or_clear_uniform_bucket_level_access(None::<UniformBucketLevelAccess>);
6360        /// ```
6361        pub fn set_or_clear_uniform_bucket_level_access<T>(
6362            mut self,
6363            v: std::option::Option<T>,
6364        ) -> Self
6365        where
6366            T: std::convert::Into<crate::model::bucket::iam_config::UniformBucketLevelAccess>,
6367        {
6368            self.uniform_bucket_level_access = v.map(|x| x.into());
6369            self
6370        }
6371
6372        /// Sets the value of [public_access_prevention][crate::model::bucket::IamConfig::public_access_prevention].
6373        ///
6374        /// # Example
6375        /// ```ignore,no_run
6376        /// # use google_cloud_storage::model::bucket::IamConfig;
6377        /// let x = IamConfig::new().set_public_access_prevention("example");
6378        /// ```
6379        pub fn set_public_access_prevention<T: std::convert::Into<std::string::String>>(
6380            mut self,
6381            v: T,
6382        ) -> Self {
6383            self.public_access_prevention = v.into();
6384            self
6385        }
6386    }
6387
6388    impl wkt::message::Message for IamConfig {
6389        fn typename() -> &'static str {
6390            "type.googleapis.com/google.storage.v2.Bucket.IamConfig"
6391        }
6392    }
6393
6394    /// Defines additional types related to [IamConfig].
6395    pub mod iam_config {
6396        #[allow(unused_imports)]
6397        use super::*;
6398
6399        /// Settings for Uniform Bucket level access.
6400        /// See <https://cloud.google.com/storage/docs/uniform-bucket-level-access>.
6401        #[derive(Clone, Default, PartialEq)]
6402        #[non_exhaustive]
6403        pub struct UniformBucketLevelAccess {
6404            /// Optional. If set, access checks only use bucket-level IAM policies or
6405            /// above.
6406            pub enabled: bool,
6407
6408            /// Optional. The deadline time for changing
6409            /// `iam_config.uniform_bucket_level_access.enabled` from `true` to
6410            /// `false`. Mutable until the specified deadline is reached, but not
6411            /// afterward.
6412            pub lock_time: std::option::Option<wkt::Timestamp>,
6413
6414            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6415        }
6416
6417        impl UniformBucketLevelAccess {
6418            pub fn new() -> Self {
6419                std::default::Default::default()
6420            }
6421
6422            /// Sets the value of [enabled][crate::model::bucket::iam_config::UniformBucketLevelAccess::enabled].
6423            ///
6424            /// # Example
6425            /// ```ignore,no_run
6426            /// # use google_cloud_storage::model::bucket::iam_config::UniformBucketLevelAccess;
6427            /// let x = UniformBucketLevelAccess::new().set_enabled(true);
6428            /// ```
6429            pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6430                self.enabled = v.into();
6431                self
6432            }
6433
6434            /// Sets the value of [lock_time][crate::model::bucket::iam_config::UniformBucketLevelAccess::lock_time].
6435            ///
6436            /// # Example
6437            /// ```ignore,no_run
6438            /// # use google_cloud_storage::model::bucket::iam_config::UniformBucketLevelAccess;
6439            /// use wkt::Timestamp;
6440            /// let x = UniformBucketLevelAccess::new().set_lock_time(Timestamp::default()/* use setters */);
6441            /// ```
6442            pub fn set_lock_time<T>(mut self, v: T) -> Self
6443            where
6444                T: std::convert::Into<wkt::Timestamp>,
6445            {
6446                self.lock_time = std::option::Option::Some(v.into());
6447                self
6448            }
6449
6450            /// Sets or clears the value of [lock_time][crate::model::bucket::iam_config::UniformBucketLevelAccess::lock_time].
6451            ///
6452            /// # Example
6453            /// ```ignore,no_run
6454            /// # use google_cloud_storage::model::bucket::iam_config::UniformBucketLevelAccess;
6455            /// use wkt::Timestamp;
6456            /// let x = UniformBucketLevelAccess::new().set_or_clear_lock_time(Some(Timestamp::default()/* use setters */));
6457            /// let x = UniformBucketLevelAccess::new().set_or_clear_lock_time(None::<Timestamp>);
6458            /// ```
6459            pub fn set_or_clear_lock_time<T>(mut self, v: std::option::Option<T>) -> Self
6460            where
6461                T: std::convert::Into<wkt::Timestamp>,
6462            {
6463                self.lock_time = v.map(|x| x.into());
6464                self
6465            }
6466        }
6467
6468        impl wkt::message::Message for UniformBucketLevelAccess {
6469            fn typename() -> &'static str {
6470                "type.googleapis.com/google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess"
6471            }
6472        }
6473    }
6474
6475    /// Lifecycle properties of a bucket.
6476    /// For more information, see [Object Lifecycle
6477    /// Management](https://cloud.google.com/storage/docs/lifecycle).
6478    #[derive(Clone, Default, PartialEq)]
6479    #[non_exhaustive]
6480    pub struct Lifecycle {
6481        /// Optional. A lifecycle management rule, which is made of an action to take
6482        /// and the condition under which the action is taken.
6483        pub rule: std::vec::Vec<crate::model::bucket::lifecycle::Rule>,
6484
6485        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6486    }
6487
6488    impl Lifecycle {
6489        pub fn new() -> Self {
6490            std::default::Default::default()
6491        }
6492
6493        /// Sets the value of [rule][crate::model::bucket::Lifecycle::rule].
6494        ///
6495        /// # Example
6496        /// ```ignore,no_run
6497        /// # use google_cloud_storage::model::bucket::Lifecycle;
6498        /// use google_cloud_storage::model::bucket::lifecycle::Rule;
6499        /// let x = Lifecycle::new()
6500        ///     .set_rule([
6501        ///         Rule::default()/* use setters */,
6502        ///         Rule::default()/* use (different) setters */,
6503        ///     ]);
6504        /// ```
6505        pub fn set_rule<T, V>(mut self, v: T) -> Self
6506        where
6507            T: std::iter::IntoIterator<Item = V>,
6508            V: std::convert::Into<crate::model::bucket::lifecycle::Rule>,
6509        {
6510            use std::iter::Iterator;
6511            self.rule = v.into_iter().map(|i| i.into()).collect();
6512            self
6513        }
6514    }
6515
6516    impl wkt::message::Message for Lifecycle {
6517        fn typename() -> &'static str {
6518            "type.googleapis.com/google.storage.v2.Bucket.Lifecycle"
6519        }
6520    }
6521
6522    /// Defines additional types related to [Lifecycle].
6523    pub mod lifecycle {
6524        #[allow(unused_imports)]
6525        use super::*;
6526
6527        /// A lifecycle Rule, combining an action to take on an object and a
6528        /// condition which triggers that action.
6529        #[derive(Clone, Default, PartialEq)]
6530        #[non_exhaustive]
6531        pub struct Rule {
6532            /// Optional. The action to take.
6533            pub action: std::option::Option<crate::model::bucket::lifecycle::rule::Action>,
6534
6535            /// Optional. The condition under which the action is taken.
6536            pub condition: std::option::Option<crate::model::bucket::lifecycle::rule::Condition>,
6537
6538            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6539        }
6540
6541        impl Rule {
6542            pub fn new() -> Self {
6543                std::default::Default::default()
6544            }
6545
6546            /// Sets the value of [action][crate::model::bucket::lifecycle::Rule::action].
6547            ///
6548            /// # Example
6549            /// ```ignore,no_run
6550            /// # use google_cloud_storage::model::bucket::lifecycle::Rule;
6551            /// use google_cloud_storage::model::bucket::lifecycle::rule::Action;
6552            /// let x = Rule::new().set_action(Action::default()/* use setters */);
6553            /// ```
6554            pub fn set_action<T>(mut self, v: T) -> Self
6555            where
6556                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Action>,
6557            {
6558                self.action = std::option::Option::Some(v.into());
6559                self
6560            }
6561
6562            /// Sets or clears the value of [action][crate::model::bucket::lifecycle::Rule::action].
6563            ///
6564            /// # Example
6565            /// ```ignore,no_run
6566            /// # use google_cloud_storage::model::bucket::lifecycle::Rule;
6567            /// use google_cloud_storage::model::bucket::lifecycle::rule::Action;
6568            /// let x = Rule::new().set_or_clear_action(Some(Action::default()/* use setters */));
6569            /// let x = Rule::new().set_or_clear_action(None::<Action>);
6570            /// ```
6571            pub fn set_or_clear_action<T>(mut self, v: std::option::Option<T>) -> Self
6572            where
6573                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Action>,
6574            {
6575                self.action = v.map(|x| x.into());
6576                self
6577            }
6578
6579            /// Sets the value of [condition][crate::model::bucket::lifecycle::Rule::condition].
6580            ///
6581            /// # Example
6582            /// ```ignore,no_run
6583            /// # use google_cloud_storage::model::bucket::lifecycle::Rule;
6584            /// use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6585            /// let x = Rule::new().set_condition(Condition::default()/* use setters */);
6586            /// ```
6587            pub fn set_condition<T>(mut self, v: T) -> Self
6588            where
6589                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Condition>,
6590            {
6591                self.condition = std::option::Option::Some(v.into());
6592                self
6593            }
6594
6595            /// Sets or clears the value of [condition][crate::model::bucket::lifecycle::Rule::condition].
6596            ///
6597            /// # Example
6598            /// ```ignore,no_run
6599            /// # use google_cloud_storage::model::bucket::lifecycle::Rule;
6600            /// use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6601            /// let x = Rule::new().set_or_clear_condition(Some(Condition::default()/* use setters */));
6602            /// let x = Rule::new().set_or_clear_condition(None::<Condition>);
6603            /// ```
6604            pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
6605            where
6606                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Condition>,
6607            {
6608                self.condition = v.map(|x| x.into());
6609                self
6610            }
6611        }
6612
6613        impl wkt::message::Message for Rule {
6614            fn typename() -> &'static str {
6615                "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule"
6616            }
6617        }
6618
6619        /// Defines additional types related to [Rule].
6620        pub mod rule {
6621            #[allow(unused_imports)]
6622            use super::*;
6623
6624            /// An action to take on an object.
6625            #[derive(Clone, Default, PartialEq)]
6626            #[non_exhaustive]
6627            pub struct Action {
6628                /// Optional. Type of the action. Currently, only `Delete`,
6629                /// `SetStorageClass`, and `AbortIncompleteMultipartUpload` are
6630                /// supported.
6631                pub r#type: std::string::String,
6632
6633                /// Optional. Target storage class. Required iff the type of the action
6634                /// is SetStorageClass.
6635                pub storage_class: std::string::String,
6636
6637                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6638            }
6639
6640            impl Action {
6641                pub fn new() -> Self {
6642                    std::default::Default::default()
6643                }
6644
6645                /// Sets the value of [r#type][crate::model::bucket::lifecycle::rule::Action::type].
6646                ///
6647                /// # Example
6648                /// ```ignore,no_run
6649                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Action;
6650                /// let x = Action::new().set_type("example");
6651                /// ```
6652                pub fn set_type<T: std::convert::Into<std::string::String>>(
6653                    mut self,
6654                    v: T,
6655                ) -> Self {
6656                    self.r#type = v.into();
6657                    self
6658                }
6659
6660                /// Sets the value of [storage_class][crate::model::bucket::lifecycle::rule::Action::storage_class].
6661                ///
6662                /// # Example
6663                /// ```ignore,no_run
6664                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Action;
6665                /// let x = Action::new().set_storage_class("example");
6666                /// ```
6667                pub fn set_storage_class<T: std::convert::Into<std::string::String>>(
6668                    mut self,
6669                    v: T,
6670                ) -> Self {
6671                    self.storage_class = v.into();
6672                    self
6673                }
6674            }
6675
6676            impl wkt::message::Message for Action {
6677                fn typename() -> &'static str {
6678                    "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule.Action"
6679                }
6680            }
6681
6682            /// A condition of an object which triggers some action.
6683            #[derive(Clone, Default, PartialEq)]
6684            #[non_exhaustive]
6685            pub struct Condition {
6686                /// Age of an object (in days). This condition is satisfied when an
6687                /// object reaches the specified age.
6688                /// A value of 0 indicates that all objects immediately match this
6689                /// condition.
6690                pub age_days: std::option::Option<i32>,
6691
6692                /// Optional. This condition is satisfied when an object is created
6693                /// before midnight of the specified date in UTC.
6694                pub created_before: std::option::Option<google_cloud_type::model::Date>,
6695
6696                /// Relevant only for versioned objects. If the value is
6697                /// `true`, this condition matches live objects; if the value
6698                /// is `false`, it matches archived objects.
6699                pub is_live: std::option::Option<bool>,
6700
6701                /// Relevant only for versioned objects. If the value is N, this
6702                /// condition is satisfied when there are at least N versions (including
6703                /// the live version) newer than this version of the object.
6704                pub num_newer_versions: std::option::Option<i32>,
6705
6706                /// Optional. Objects having any of the storage classes specified by this
6707                /// condition are matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
6708                /// `NEARLINE`, `COLDLINE`, `STANDARD`, and
6709                /// `DURABLE_REDUCED_AVAILABILITY`.
6710                pub matches_storage_class: std::vec::Vec<std::string::String>,
6711
6712                /// Number of days that have elapsed since the custom timestamp set on an
6713                /// object.
6714                /// The value of the field must be a nonnegative integer.
6715                pub days_since_custom_time: std::option::Option<i32>,
6716
6717                /// Optional. An object matches this condition if the custom timestamp
6718                /// set on the object is before the specified date in UTC.
6719                pub custom_time_before: std::option::Option<google_cloud_type::model::Date>,
6720
6721                /// This condition is relevant only for versioned objects. An object
6722                /// version satisfies this condition only if these many days have been
6723                /// passed since it became noncurrent. The value of the field must be a
6724                /// nonnegative integer. If it's zero, the object version becomes
6725                /// eligible for Lifecycle action as soon as it becomes noncurrent.
6726                pub days_since_noncurrent_time: std::option::Option<i32>,
6727
6728                /// Optional. This condition is relevant only for versioned objects. An
6729                /// object version satisfies this condition only if it became noncurrent
6730                /// before the specified date in UTC.
6731                pub noncurrent_time_before: std::option::Option<google_cloud_type::model::Date>,
6732
6733                /// Optional. List of object name prefixes. If any prefix exactly matches
6734                /// the beginning of the object name, the condition evaluates to true.
6735                pub matches_prefix: std::vec::Vec<std::string::String>,
6736
6737                /// Optional. List of object name suffixes. If any suffix exactly matches
6738                /// the end of the object name, the condition evaluates to true.
6739                pub matches_suffix: std::vec::Vec<std::string::String>,
6740
6741                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6742            }
6743
6744            impl Condition {
6745                pub fn new() -> Self {
6746                    std::default::Default::default()
6747                }
6748
6749                /// Sets the value of [age_days][crate::model::bucket::lifecycle::rule::Condition::age_days].
6750                ///
6751                /// # Example
6752                /// ```ignore,no_run
6753                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6754                /// let x = Condition::new().set_age_days(42);
6755                /// ```
6756                pub fn set_age_days<T>(mut self, v: T) -> Self
6757                where
6758                    T: std::convert::Into<i32>,
6759                {
6760                    self.age_days = std::option::Option::Some(v.into());
6761                    self
6762                }
6763
6764                /// Sets or clears the value of [age_days][crate::model::bucket::lifecycle::rule::Condition::age_days].
6765                ///
6766                /// # Example
6767                /// ```ignore,no_run
6768                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6769                /// let x = Condition::new().set_or_clear_age_days(Some(42));
6770                /// let x = Condition::new().set_or_clear_age_days(None::<i32>);
6771                /// ```
6772                pub fn set_or_clear_age_days<T>(mut self, v: std::option::Option<T>) -> Self
6773                where
6774                    T: std::convert::Into<i32>,
6775                {
6776                    self.age_days = v.map(|x| x.into());
6777                    self
6778                }
6779
6780                /// Sets the value of [created_before][crate::model::bucket::lifecycle::rule::Condition::created_before].
6781                ///
6782                /// # Example
6783                /// ```ignore,no_run
6784                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6785                /// use google_cloud_type::model::Date;
6786                /// let x = Condition::new().set_created_before(Date::default()/* use setters */);
6787                /// ```
6788                pub fn set_created_before<T>(mut self, v: T) -> Self
6789                where
6790                    T: std::convert::Into<google_cloud_type::model::Date>,
6791                {
6792                    self.created_before = std::option::Option::Some(v.into());
6793                    self
6794                }
6795
6796                /// Sets or clears the value of [created_before][crate::model::bucket::lifecycle::rule::Condition::created_before].
6797                ///
6798                /// # Example
6799                /// ```ignore,no_run
6800                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6801                /// use google_cloud_type::model::Date;
6802                /// let x = Condition::new().set_or_clear_created_before(Some(Date::default()/* use setters */));
6803                /// let x = Condition::new().set_or_clear_created_before(None::<Date>);
6804                /// ```
6805                pub fn set_or_clear_created_before<T>(mut self, v: std::option::Option<T>) -> Self
6806                where
6807                    T: std::convert::Into<google_cloud_type::model::Date>,
6808                {
6809                    self.created_before = v.map(|x| x.into());
6810                    self
6811                }
6812
6813                /// Sets the value of [is_live][crate::model::bucket::lifecycle::rule::Condition::is_live].
6814                ///
6815                /// # Example
6816                /// ```ignore,no_run
6817                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6818                /// let x = Condition::new().set_is_live(true);
6819                /// ```
6820                pub fn set_is_live<T>(mut self, v: T) -> Self
6821                where
6822                    T: std::convert::Into<bool>,
6823                {
6824                    self.is_live = std::option::Option::Some(v.into());
6825                    self
6826                }
6827
6828                /// Sets or clears the value of [is_live][crate::model::bucket::lifecycle::rule::Condition::is_live].
6829                ///
6830                /// # Example
6831                /// ```ignore,no_run
6832                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6833                /// let x = Condition::new().set_or_clear_is_live(Some(false));
6834                /// let x = Condition::new().set_or_clear_is_live(None::<bool>);
6835                /// ```
6836                pub fn set_or_clear_is_live<T>(mut self, v: std::option::Option<T>) -> Self
6837                where
6838                    T: std::convert::Into<bool>,
6839                {
6840                    self.is_live = v.map(|x| x.into());
6841                    self
6842                }
6843
6844                /// Sets the value of [num_newer_versions][crate::model::bucket::lifecycle::rule::Condition::num_newer_versions].
6845                ///
6846                /// # Example
6847                /// ```ignore,no_run
6848                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6849                /// let x = Condition::new().set_num_newer_versions(42);
6850                /// ```
6851                pub fn set_num_newer_versions<T>(mut self, v: T) -> Self
6852                where
6853                    T: std::convert::Into<i32>,
6854                {
6855                    self.num_newer_versions = std::option::Option::Some(v.into());
6856                    self
6857                }
6858
6859                /// Sets or clears the value of [num_newer_versions][crate::model::bucket::lifecycle::rule::Condition::num_newer_versions].
6860                ///
6861                /// # Example
6862                /// ```ignore,no_run
6863                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6864                /// let x = Condition::new().set_or_clear_num_newer_versions(Some(42));
6865                /// let x = Condition::new().set_or_clear_num_newer_versions(None::<i32>);
6866                /// ```
6867                pub fn set_or_clear_num_newer_versions<T>(
6868                    mut self,
6869                    v: std::option::Option<T>,
6870                ) -> Self
6871                where
6872                    T: std::convert::Into<i32>,
6873                {
6874                    self.num_newer_versions = v.map(|x| x.into());
6875                    self
6876                }
6877
6878                /// Sets the value of [matches_storage_class][crate::model::bucket::lifecycle::rule::Condition::matches_storage_class].
6879                ///
6880                /// # Example
6881                /// ```ignore,no_run
6882                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6883                /// let x = Condition::new().set_matches_storage_class(["a", "b", "c"]);
6884                /// ```
6885                pub fn set_matches_storage_class<T, V>(mut self, v: T) -> Self
6886                where
6887                    T: std::iter::IntoIterator<Item = V>,
6888                    V: std::convert::Into<std::string::String>,
6889                {
6890                    use std::iter::Iterator;
6891                    self.matches_storage_class = v.into_iter().map(|i| i.into()).collect();
6892                    self
6893                }
6894
6895                /// Sets the value of [days_since_custom_time][crate::model::bucket::lifecycle::rule::Condition::days_since_custom_time].
6896                ///
6897                /// # Example
6898                /// ```ignore,no_run
6899                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6900                /// let x = Condition::new().set_days_since_custom_time(42);
6901                /// ```
6902                pub fn set_days_since_custom_time<T>(mut self, v: T) -> Self
6903                where
6904                    T: std::convert::Into<i32>,
6905                {
6906                    self.days_since_custom_time = std::option::Option::Some(v.into());
6907                    self
6908                }
6909
6910                /// Sets or clears the value of [days_since_custom_time][crate::model::bucket::lifecycle::rule::Condition::days_since_custom_time].
6911                ///
6912                /// # Example
6913                /// ```ignore,no_run
6914                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6915                /// let x = Condition::new().set_or_clear_days_since_custom_time(Some(42));
6916                /// let x = Condition::new().set_or_clear_days_since_custom_time(None::<i32>);
6917                /// ```
6918                pub fn set_or_clear_days_since_custom_time<T>(
6919                    mut self,
6920                    v: std::option::Option<T>,
6921                ) -> Self
6922                where
6923                    T: std::convert::Into<i32>,
6924                {
6925                    self.days_since_custom_time = v.map(|x| x.into());
6926                    self
6927                }
6928
6929                /// Sets the value of [custom_time_before][crate::model::bucket::lifecycle::rule::Condition::custom_time_before].
6930                ///
6931                /// # Example
6932                /// ```ignore,no_run
6933                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6934                /// use google_cloud_type::model::Date;
6935                /// let x = Condition::new().set_custom_time_before(Date::default()/* use setters */);
6936                /// ```
6937                pub fn set_custom_time_before<T>(mut self, v: T) -> Self
6938                where
6939                    T: std::convert::Into<google_cloud_type::model::Date>,
6940                {
6941                    self.custom_time_before = std::option::Option::Some(v.into());
6942                    self
6943                }
6944
6945                /// Sets or clears the value of [custom_time_before][crate::model::bucket::lifecycle::rule::Condition::custom_time_before].
6946                ///
6947                /// # Example
6948                /// ```ignore,no_run
6949                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6950                /// use google_cloud_type::model::Date;
6951                /// let x = Condition::new().set_or_clear_custom_time_before(Some(Date::default()/* use setters */));
6952                /// let x = Condition::new().set_or_clear_custom_time_before(None::<Date>);
6953                /// ```
6954                pub fn set_or_clear_custom_time_before<T>(
6955                    mut self,
6956                    v: std::option::Option<T>,
6957                ) -> Self
6958                where
6959                    T: std::convert::Into<google_cloud_type::model::Date>,
6960                {
6961                    self.custom_time_before = v.map(|x| x.into());
6962                    self
6963                }
6964
6965                /// Sets the value of [days_since_noncurrent_time][crate::model::bucket::lifecycle::rule::Condition::days_since_noncurrent_time].
6966                ///
6967                /// # Example
6968                /// ```ignore,no_run
6969                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6970                /// let x = Condition::new().set_days_since_noncurrent_time(42);
6971                /// ```
6972                pub fn set_days_since_noncurrent_time<T>(mut self, v: T) -> Self
6973                where
6974                    T: std::convert::Into<i32>,
6975                {
6976                    self.days_since_noncurrent_time = std::option::Option::Some(v.into());
6977                    self
6978                }
6979
6980                /// Sets or clears the value of [days_since_noncurrent_time][crate::model::bucket::lifecycle::rule::Condition::days_since_noncurrent_time].
6981                ///
6982                /// # Example
6983                /// ```ignore,no_run
6984                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
6985                /// let x = Condition::new().set_or_clear_days_since_noncurrent_time(Some(42));
6986                /// let x = Condition::new().set_or_clear_days_since_noncurrent_time(None::<i32>);
6987                /// ```
6988                pub fn set_or_clear_days_since_noncurrent_time<T>(
6989                    mut self,
6990                    v: std::option::Option<T>,
6991                ) -> Self
6992                where
6993                    T: std::convert::Into<i32>,
6994                {
6995                    self.days_since_noncurrent_time = v.map(|x| x.into());
6996                    self
6997                }
6998
6999                /// Sets the value of [noncurrent_time_before][crate::model::bucket::lifecycle::rule::Condition::noncurrent_time_before].
7000                ///
7001                /// # Example
7002                /// ```ignore,no_run
7003                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
7004                /// use google_cloud_type::model::Date;
7005                /// let x = Condition::new().set_noncurrent_time_before(Date::default()/* use setters */);
7006                /// ```
7007                pub fn set_noncurrent_time_before<T>(mut self, v: T) -> Self
7008                where
7009                    T: std::convert::Into<google_cloud_type::model::Date>,
7010                {
7011                    self.noncurrent_time_before = std::option::Option::Some(v.into());
7012                    self
7013                }
7014
7015                /// Sets or clears the value of [noncurrent_time_before][crate::model::bucket::lifecycle::rule::Condition::noncurrent_time_before].
7016                ///
7017                /// # Example
7018                /// ```ignore,no_run
7019                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
7020                /// use google_cloud_type::model::Date;
7021                /// let x = Condition::new().set_or_clear_noncurrent_time_before(Some(Date::default()/* use setters */));
7022                /// let x = Condition::new().set_or_clear_noncurrent_time_before(None::<Date>);
7023                /// ```
7024                pub fn set_or_clear_noncurrent_time_before<T>(
7025                    mut self,
7026                    v: std::option::Option<T>,
7027                ) -> Self
7028                where
7029                    T: std::convert::Into<google_cloud_type::model::Date>,
7030                {
7031                    self.noncurrent_time_before = v.map(|x| x.into());
7032                    self
7033                }
7034
7035                /// Sets the value of [matches_prefix][crate::model::bucket::lifecycle::rule::Condition::matches_prefix].
7036                ///
7037                /// # Example
7038                /// ```ignore,no_run
7039                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
7040                /// let x = Condition::new().set_matches_prefix(["a", "b", "c"]);
7041                /// ```
7042                pub fn set_matches_prefix<T, V>(mut self, v: T) -> Self
7043                where
7044                    T: std::iter::IntoIterator<Item = V>,
7045                    V: std::convert::Into<std::string::String>,
7046                {
7047                    use std::iter::Iterator;
7048                    self.matches_prefix = v.into_iter().map(|i| i.into()).collect();
7049                    self
7050                }
7051
7052                /// Sets the value of [matches_suffix][crate::model::bucket::lifecycle::rule::Condition::matches_suffix].
7053                ///
7054                /// # Example
7055                /// ```ignore,no_run
7056                /// # use google_cloud_storage::model::bucket::lifecycle::rule::Condition;
7057                /// let x = Condition::new().set_matches_suffix(["a", "b", "c"]);
7058                /// ```
7059                pub fn set_matches_suffix<T, V>(mut self, v: T) -> Self
7060                where
7061                    T: std::iter::IntoIterator<Item = V>,
7062                    V: std::convert::Into<std::string::String>,
7063                {
7064                    use std::iter::Iterator;
7065                    self.matches_suffix = v.into_iter().map(|i| i.into()).collect();
7066                    self
7067                }
7068            }
7069
7070            impl wkt::message::Message for Condition {
7071                fn typename() -> &'static str {
7072                    "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule.Condition"
7073                }
7074            }
7075        }
7076    }
7077
7078    /// Logging-related properties of a bucket.
7079    #[derive(Clone, Default, PartialEq)]
7080    #[non_exhaustive]
7081    pub struct Logging {
7082        /// Optional. The destination bucket where the current bucket's logs should
7083        /// be placed, using path format (like `projects/123456/buckets/foo`).
7084        pub log_bucket: std::string::String,
7085
7086        /// Optional. A prefix for log object names.
7087        pub log_object_prefix: std::string::String,
7088
7089        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7090    }
7091
7092    impl Logging {
7093        pub fn new() -> Self {
7094            std::default::Default::default()
7095        }
7096
7097        /// Sets the value of [log_bucket][crate::model::bucket::Logging::log_bucket].
7098        ///
7099        /// # Example
7100        /// ```ignore,no_run
7101        /// # use google_cloud_storage::model::bucket::Logging;
7102        /// let x = Logging::new().set_log_bucket("example");
7103        /// ```
7104        pub fn set_log_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7105            self.log_bucket = v.into();
7106            self
7107        }
7108
7109        /// Sets the value of [log_object_prefix][crate::model::bucket::Logging::log_object_prefix].
7110        ///
7111        /// # Example
7112        /// ```ignore,no_run
7113        /// # use google_cloud_storage::model::bucket::Logging;
7114        /// let x = Logging::new().set_log_object_prefix("example");
7115        /// ```
7116        pub fn set_log_object_prefix<T: std::convert::Into<std::string::String>>(
7117            mut self,
7118            v: T,
7119        ) -> Self {
7120            self.log_object_prefix = v.into();
7121            self
7122        }
7123    }
7124
7125    impl wkt::message::Message for Logging {
7126        fn typename() -> &'static str {
7127            "type.googleapis.com/google.storage.v2.Bucket.Logging"
7128        }
7129    }
7130
7131    /// Object Retention related properties of a bucket.
7132    #[derive(Clone, Default, PartialEq)]
7133    #[non_exhaustive]
7134    pub struct ObjectRetention {
7135        /// Optional. Output only. If true, object retention is enabled for the
7136        /// bucket.
7137        pub enabled: bool,
7138
7139        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7140    }
7141
7142    impl ObjectRetention {
7143        pub fn new() -> Self {
7144            std::default::Default::default()
7145        }
7146
7147        /// Sets the value of [enabled][crate::model::bucket::ObjectRetention::enabled].
7148        ///
7149        /// # Example
7150        /// ```ignore,no_run
7151        /// # use google_cloud_storage::model::bucket::ObjectRetention;
7152        /// let x = ObjectRetention::new().set_enabled(true);
7153        /// ```
7154        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7155            self.enabled = v.into();
7156            self
7157        }
7158    }
7159
7160    impl wkt::message::Message for ObjectRetention {
7161        fn typename() -> &'static str {
7162            "type.googleapis.com/google.storage.v2.Bucket.ObjectRetention"
7163        }
7164    }
7165
7166    /// Retention policy properties of a bucket.
7167    #[derive(Clone, Default, PartialEq)]
7168    #[non_exhaustive]
7169    pub struct RetentionPolicy {
7170        /// Optional. Server-determined value that indicates the time from which
7171        /// policy was enforced and effective.
7172        pub effective_time: std::option::Option<wkt::Timestamp>,
7173
7174        /// Optional. Once locked, an object retention policy cannot be modified.
7175        pub is_locked: bool,
7176
7177        /// Optional. The duration that objects need to be retained. Retention
7178        /// duration must be greater than zero and less than 100 years. Note that
7179        /// enforcement of retention periods less than a day is not guaranteed. Such
7180        /// periods should only be used for testing purposes. Any `nanos` value
7181        /// specified is rounded down to the nearest second.
7182        pub retention_duration: std::option::Option<wkt::Duration>,
7183
7184        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7185    }
7186
7187    impl RetentionPolicy {
7188        pub fn new() -> Self {
7189            std::default::Default::default()
7190        }
7191
7192        /// Sets the value of [effective_time][crate::model::bucket::RetentionPolicy::effective_time].
7193        ///
7194        /// # Example
7195        /// ```ignore,no_run
7196        /// # use google_cloud_storage::model::bucket::RetentionPolicy;
7197        /// use wkt::Timestamp;
7198        /// let x = RetentionPolicy::new().set_effective_time(Timestamp::default()/* use setters */);
7199        /// ```
7200        pub fn set_effective_time<T>(mut self, v: T) -> Self
7201        where
7202            T: std::convert::Into<wkt::Timestamp>,
7203        {
7204            self.effective_time = std::option::Option::Some(v.into());
7205            self
7206        }
7207
7208        /// Sets or clears the value of [effective_time][crate::model::bucket::RetentionPolicy::effective_time].
7209        ///
7210        /// # Example
7211        /// ```ignore,no_run
7212        /// # use google_cloud_storage::model::bucket::RetentionPolicy;
7213        /// use wkt::Timestamp;
7214        /// let x = RetentionPolicy::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
7215        /// let x = RetentionPolicy::new().set_or_clear_effective_time(None::<Timestamp>);
7216        /// ```
7217        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
7218        where
7219            T: std::convert::Into<wkt::Timestamp>,
7220        {
7221            self.effective_time = v.map(|x| x.into());
7222            self
7223        }
7224
7225        /// Sets the value of [is_locked][crate::model::bucket::RetentionPolicy::is_locked].
7226        ///
7227        /// # Example
7228        /// ```ignore,no_run
7229        /// # use google_cloud_storage::model::bucket::RetentionPolicy;
7230        /// let x = RetentionPolicy::new().set_is_locked(true);
7231        /// ```
7232        pub fn set_is_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7233            self.is_locked = v.into();
7234            self
7235        }
7236
7237        /// Sets the value of [retention_duration][crate::model::bucket::RetentionPolicy::retention_duration].
7238        ///
7239        /// # Example
7240        /// ```ignore,no_run
7241        /// # use google_cloud_storage::model::bucket::RetentionPolicy;
7242        /// use wkt::Duration;
7243        /// let x = RetentionPolicy::new().set_retention_duration(Duration::default()/* use setters */);
7244        /// ```
7245        pub fn set_retention_duration<T>(mut self, v: T) -> Self
7246        where
7247            T: std::convert::Into<wkt::Duration>,
7248        {
7249            self.retention_duration = std::option::Option::Some(v.into());
7250            self
7251        }
7252
7253        /// Sets or clears the value of [retention_duration][crate::model::bucket::RetentionPolicy::retention_duration].
7254        ///
7255        /// # Example
7256        /// ```ignore,no_run
7257        /// # use google_cloud_storage::model::bucket::RetentionPolicy;
7258        /// use wkt::Duration;
7259        /// let x = RetentionPolicy::new().set_or_clear_retention_duration(Some(Duration::default()/* use setters */));
7260        /// let x = RetentionPolicy::new().set_or_clear_retention_duration(None::<Duration>);
7261        /// ```
7262        pub fn set_or_clear_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
7263        where
7264            T: std::convert::Into<wkt::Duration>,
7265        {
7266            self.retention_duration = v.map(|x| x.into());
7267            self
7268        }
7269    }
7270
7271    impl wkt::message::Message for RetentionPolicy {
7272        fn typename() -> &'static str {
7273            "type.googleapis.com/google.storage.v2.Bucket.RetentionPolicy"
7274        }
7275    }
7276
7277    /// Soft delete policy properties of a bucket.
7278    #[derive(Clone, Default, PartialEq)]
7279    #[non_exhaustive]
7280    pub struct SoftDeletePolicy {
7281        /// The period of time that soft-deleted objects in the bucket must be
7282        /// retained and cannot be permanently deleted. The duration must be greater
7283        /// than or equal to 7 days and less than 1 year.
7284        pub retention_duration: std::option::Option<wkt::Duration>,
7285
7286        /// Time from which the policy was effective. This is service-provided.
7287        pub effective_time: std::option::Option<wkt::Timestamp>,
7288
7289        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7290    }
7291
7292    impl SoftDeletePolicy {
7293        pub fn new() -> Self {
7294            std::default::Default::default()
7295        }
7296
7297        /// Sets the value of [retention_duration][crate::model::bucket::SoftDeletePolicy::retention_duration].
7298        ///
7299        /// # Example
7300        /// ```ignore,no_run
7301        /// # use google_cloud_storage::model::bucket::SoftDeletePolicy;
7302        /// use wkt::Duration;
7303        /// let x = SoftDeletePolicy::new().set_retention_duration(Duration::default()/* use setters */);
7304        /// ```
7305        pub fn set_retention_duration<T>(mut self, v: T) -> Self
7306        where
7307            T: std::convert::Into<wkt::Duration>,
7308        {
7309            self.retention_duration = std::option::Option::Some(v.into());
7310            self
7311        }
7312
7313        /// Sets or clears the value of [retention_duration][crate::model::bucket::SoftDeletePolicy::retention_duration].
7314        ///
7315        /// # Example
7316        /// ```ignore,no_run
7317        /// # use google_cloud_storage::model::bucket::SoftDeletePolicy;
7318        /// use wkt::Duration;
7319        /// let x = SoftDeletePolicy::new().set_or_clear_retention_duration(Some(Duration::default()/* use setters */));
7320        /// let x = SoftDeletePolicy::new().set_or_clear_retention_duration(None::<Duration>);
7321        /// ```
7322        pub fn set_or_clear_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
7323        where
7324            T: std::convert::Into<wkt::Duration>,
7325        {
7326            self.retention_duration = v.map(|x| x.into());
7327            self
7328        }
7329
7330        /// Sets the value of [effective_time][crate::model::bucket::SoftDeletePolicy::effective_time].
7331        ///
7332        /// # Example
7333        /// ```ignore,no_run
7334        /// # use google_cloud_storage::model::bucket::SoftDeletePolicy;
7335        /// use wkt::Timestamp;
7336        /// let x = SoftDeletePolicy::new().set_effective_time(Timestamp::default()/* use setters */);
7337        /// ```
7338        pub fn set_effective_time<T>(mut self, v: T) -> Self
7339        where
7340            T: std::convert::Into<wkt::Timestamp>,
7341        {
7342            self.effective_time = std::option::Option::Some(v.into());
7343            self
7344        }
7345
7346        /// Sets or clears the value of [effective_time][crate::model::bucket::SoftDeletePolicy::effective_time].
7347        ///
7348        /// # Example
7349        /// ```ignore,no_run
7350        /// # use google_cloud_storage::model::bucket::SoftDeletePolicy;
7351        /// use wkt::Timestamp;
7352        /// let x = SoftDeletePolicy::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
7353        /// let x = SoftDeletePolicy::new().set_or_clear_effective_time(None::<Timestamp>);
7354        /// ```
7355        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
7356        where
7357            T: std::convert::Into<wkt::Timestamp>,
7358        {
7359            self.effective_time = v.map(|x| x.into());
7360            self
7361        }
7362    }
7363
7364    impl wkt::message::Message for SoftDeletePolicy {
7365        fn typename() -> &'static str {
7366            "type.googleapis.com/google.storage.v2.Bucket.SoftDeletePolicy"
7367        }
7368    }
7369
7370    /// Properties of a bucket related to versioning.
7371    /// For more information about Cloud Storage versioning, see [Object
7372    /// versioning](https://cloud.google.com/storage/docs/object-versioning).
7373    #[derive(Clone, Default, PartialEq)]
7374    #[non_exhaustive]
7375    pub struct Versioning {
7376        /// Optional. While set to true, versioning is fully enabled for this bucket.
7377        pub enabled: bool,
7378
7379        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7380    }
7381
7382    impl Versioning {
7383        pub fn new() -> Self {
7384            std::default::Default::default()
7385        }
7386
7387        /// Sets the value of [enabled][crate::model::bucket::Versioning::enabled].
7388        ///
7389        /// # Example
7390        /// ```ignore,no_run
7391        /// # use google_cloud_storage::model::bucket::Versioning;
7392        /// let x = Versioning::new().set_enabled(true);
7393        /// ```
7394        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7395            self.enabled = v.into();
7396            self
7397        }
7398    }
7399
7400    impl wkt::message::Message for Versioning {
7401        fn typename() -> &'static str {
7402            "type.googleapis.com/google.storage.v2.Bucket.Versioning"
7403        }
7404    }
7405
7406    /// Properties of a bucket related to accessing the contents as a static
7407    /// website. For details, see [hosting a static website using Cloud
7408    /// Storage](https://cloud.google.com/storage/docs/hosting-static-website).
7409    #[derive(Clone, Default, PartialEq)]
7410    #[non_exhaustive]
7411    pub struct Website {
7412        /// Optional. If the requested object path is missing, the service ensures
7413        /// the path has a trailing '/', append this suffix, and attempt to retrieve
7414        /// the resulting object. This allows the creation of `index.html` objects to
7415        /// represent directory pages.
7416        pub main_page_suffix: std::string::String,
7417
7418        /// Optional. If the requested object path is missing, and any
7419        /// `mainPageSuffix` object is missing, if applicable, the service
7420        /// returns the named object from this bucket as the content for a
7421        /// [404 Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)
7422        /// result.
7423        pub not_found_page: std::string::String,
7424
7425        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7426    }
7427
7428    impl Website {
7429        pub fn new() -> Self {
7430            std::default::Default::default()
7431        }
7432
7433        /// Sets the value of [main_page_suffix][crate::model::bucket::Website::main_page_suffix].
7434        ///
7435        /// # Example
7436        /// ```ignore,no_run
7437        /// # use google_cloud_storage::model::bucket::Website;
7438        /// let x = Website::new().set_main_page_suffix("example");
7439        /// ```
7440        pub fn set_main_page_suffix<T: std::convert::Into<std::string::String>>(
7441            mut self,
7442            v: T,
7443        ) -> Self {
7444            self.main_page_suffix = v.into();
7445            self
7446        }
7447
7448        /// Sets the value of [not_found_page][crate::model::bucket::Website::not_found_page].
7449        ///
7450        /// # Example
7451        /// ```ignore,no_run
7452        /// # use google_cloud_storage::model::bucket::Website;
7453        /// let x = Website::new().set_not_found_page("example");
7454        /// ```
7455        pub fn set_not_found_page<T: std::convert::Into<std::string::String>>(
7456            mut self,
7457            v: T,
7458        ) -> Self {
7459            self.not_found_page = v.into();
7460            self
7461        }
7462    }
7463
7464    impl wkt::message::Message for Website {
7465        fn typename() -> &'static str {
7466            "type.googleapis.com/google.storage.v2.Bucket.Website"
7467        }
7468    }
7469
7470    /// Configuration for [configurable dual-
7471    /// regions](https://cloud.google.com/storage/docs/locations#configurable). It
7472    /// should specify precisely two eligible regions within the same multi-region.
7473    /// For details, see
7474    /// [locations](https://cloud.google.com/storage/docs/locations).
7475    #[derive(Clone, Default, PartialEq)]
7476    #[non_exhaustive]
7477    pub struct CustomPlacementConfig {
7478        /// Optional. List of locations to use for data placement.
7479        pub data_locations: std::vec::Vec<std::string::String>,
7480
7481        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7482    }
7483
7484    impl CustomPlacementConfig {
7485        pub fn new() -> Self {
7486            std::default::Default::default()
7487        }
7488
7489        /// Sets the value of [data_locations][crate::model::bucket::CustomPlacementConfig::data_locations].
7490        ///
7491        /// # Example
7492        /// ```ignore,no_run
7493        /// # use google_cloud_storage::model::bucket::CustomPlacementConfig;
7494        /// let x = CustomPlacementConfig::new().set_data_locations(["a", "b", "c"]);
7495        /// ```
7496        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
7497        where
7498            T: std::iter::IntoIterator<Item = V>,
7499            V: std::convert::Into<std::string::String>,
7500        {
7501            use std::iter::Iterator;
7502            self.data_locations = v.into_iter().map(|i| i.into()).collect();
7503            self
7504        }
7505    }
7506
7507    impl wkt::message::Message for CustomPlacementConfig {
7508        fn typename() -> &'static str {
7509            "type.googleapis.com/google.storage.v2.Bucket.CustomPlacementConfig"
7510        }
7511    }
7512
7513    /// Configuration for a bucket's Autoclass feature.
7514    #[derive(Clone, Default, PartialEq)]
7515    #[non_exhaustive]
7516    pub struct Autoclass {
7517        /// Optional. Enables Autoclass.
7518        pub enabled: bool,
7519
7520        /// Output only. Latest instant at which the `enabled` field was set to true
7521        /// after being disabled/unconfigured or set to false after being enabled. If
7522        /// Autoclass is enabled when the bucket is created, the value of the
7523        /// `toggle_time` field is set to the bucket `create_time`.
7524        pub toggle_time: std::option::Option<wkt::Timestamp>,
7525
7526        /// An object in an Autoclass bucket eventually cools down to the
7527        /// terminal storage class if there is no access to the object.
7528        /// The only valid values are NEARLINE and ARCHIVE.
7529        pub terminal_storage_class: std::option::Option<std::string::String>,
7530
7531        /// Output only. Latest instant at which the autoclass terminal storage class
7532        /// was updated.
7533        pub terminal_storage_class_update_time: std::option::Option<wkt::Timestamp>,
7534
7535        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7536    }
7537
7538    impl Autoclass {
7539        pub fn new() -> Self {
7540            std::default::Default::default()
7541        }
7542
7543        /// Sets the value of [enabled][crate::model::bucket::Autoclass::enabled].
7544        ///
7545        /// # Example
7546        /// ```ignore,no_run
7547        /// # use google_cloud_storage::model::bucket::Autoclass;
7548        /// let x = Autoclass::new().set_enabled(true);
7549        /// ```
7550        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7551            self.enabled = v.into();
7552            self
7553        }
7554
7555        /// Sets the value of [toggle_time][crate::model::bucket::Autoclass::toggle_time].
7556        ///
7557        /// # Example
7558        /// ```ignore,no_run
7559        /// # use google_cloud_storage::model::bucket::Autoclass;
7560        /// use wkt::Timestamp;
7561        /// let x = Autoclass::new().set_toggle_time(Timestamp::default()/* use setters */);
7562        /// ```
7563        pub fn set_toggle_time<T>(mut self, v: T) -> Self
7564        where
7565            T: std::convert::Into<wkt::Timestamp>,
7566        {
7567            self.toggle_time = std::option::Option::Some(v.into());
7568            self
7569        }
7570
7571        /// Sets or clears the value of [toggle_time][crate::model::bucket::Autoclass::toggle_time].
7572        ///
7573        /// # Example
7574        /// ```ignore,no_run
7575        /// # use google_cloud_storage::model::bucket::Autoclass;
7576        /// use wkt::Timestamp;
7577        /// let x = Autoclass::new().set_or_clear_toggle_time(Some(Timestamp::default()/* use setters */));
7578        /// let x = Autoclass::new().set_or_clear_toggle_time(None::<Timestamp>);
7579        /// ```
7580        pub fn set_or_clear_toggle_time<T>(mut self, v: std::option::Option<T>) -> Self
7581        where
7582            T: std::convert::Into<wkt::Timestamp>,
7583        {
7584            self.toggle_time = v.map(|x| x.into());
7585            self
7586        }
7587
7588        /// Sets the value of [terminal_storage_class][crate::model::bucket::Autoclass::terminal_storage_class].
7589        ///
7590        /// # Example
7591        /// ```ignore,no_run
7592        /// # use google_cloud_storage::model::bucket::Autoclass;
7593        /// let x = Autoclass::new().set_terminal_storage_class("example");
7594        /// ```
7595        pub fn set_terminal_storage_class<T>(mut self, v: T) -> Self
7596        where
7597            T: std::convert::Into<std::string::String>,
7598        {
7599            self.terminal_storage_class = std::option::Option::Some(v.into());
7600            self
7601        }
7602
7603        /// Sets or clears the value of [terminal_storage_class][crate::model::bucket::Autoclass::terminal_storage_class].
7604        ///
7605        /// # Example
7606        /// ```ignore,no_run
7607        /// # use google_cloud_storage::model::bucket::Autoclass;
7608        /// let x = Autoclass::new().set_or_clear_terminal_storage_class(Some("example"));
7609        /// let x = Autoclass::new().set_or_clear_terminal_storage_class(None::<String>);
7610        /// ```
7611        pub fn set_or_clear_terminal_storage_class<T>(mut self, v: std::option::Option<T>) -> Self
7612        where
7613            T: std::convert::Into<std::string::String>,
7614        {
7615            self.terminal_storage_class = v.map(|x| x.into());
7616            self
7617        }
7618
7619        /// Sets the value of [terminal_storage_class_update_time][crate::model::bucket::Autoclass::terminal_storage_class_update_time].
7620        ///
7621        /// # Example
7622        /// ```ignore,no_run
7623        /// # use google_cloud_storage::model::bucket::Autoclass;
7624        /// use wkt::Timestamp;
7625        /// let x = Autoclass::new().set_terminal_storage_class_update_time(Timestamp::default()/* use setters */);
7626        /// ```
7627        pub fn set_terminal_storage_class_update_time<T>(mut self, v: T) -> Self
7628        where
7629            T: std::convert::Into<wkt::Timestamp>,
7630        {
7631            self.terminal_storage_class_update_time = std::option::Option::Some(v.into());
7632            self
7633        }
7634
7635        /// Sets or clears the value of [terminal_storage_class_update_time][crate::model::bucket::Autoclass::terminal_storage_class_update_time].
7636        ///
7637        /// # Example
7638        /// ```ignore,no_run
7639        /// # use google_cloud_storage::model::bucket::Autoclass;
7640        /// use wkt::Timestamp;
7641        /// let x = Autoclass::new().set_or_clear_terminal_storage_class_update_time(Some(Timestamp::default()/* use setters */));
7642        /// let x = Autoclass::new().set_or_clear_terminal_storage_class_update_time(None::<Timestamp>);
7643        /// ```
7644        pub fn set_or_clear_terminal_storage_class_update_time<T>(
7645            mut self,
7646            v: std::option::Option<T>,
7647        ) -> Self
7648        where
7649            T: std::convert::Into<wkt::Timestamp>,
7650        {
7651            self.terminal_storage_class_update_time = v.map(|x| x.into());
7652            self
7653        }
7654    }
7655
7656    impl wkt::message::Message for Autoclass {
7657        fn typename() -> &'static str {
7658            "type.googleapis.com/google.storage.v2.Bucket.Autoclass"
7659        }
7660    }
7661
7662    /// The [bucket IP
7663    /// filtering](https://cloud.google.com/storage/docs/ip-filtering-overview)
7664    /// configuration. Specifies the network sources that can access the bucket, as
7665    /// well as its underlying objects.
7666    #[derive(Clone, Default, PartialEq)]
7667    #[non_exhaustive]
7668    pub struct IpFilter {
7669        /// The state of the IP filter configuration. Valid values are `Enabled` and
7670        /// `Disabled`. When set to `Enabled`, IP filtering rules are applied to a
7671        /// bucket and all incoming requests to the bucket are evaluated against
7672        /// these rules. When set to `Disabled`, IP filtering rules are not applied
7673        /// to a bucket.
7674        pub mode: std::option::Option<std::string::String>,
7675
7676        /// Public IPs allowed to operate or access the bucket.
7677        pub public_network_source:
7678            std::option::Option<crate::model::bucket::ip_filter::PublicNetworkSource>,
7679
7680        /// Optional. The list of network sources that are allowed to access
7681        /// operations on the bucket or the underlying objects.
7682        pub vpc_network_sources: std::vec::Vec<crate::model::bucket::ip_filter::VpcNetworkSource>,
7683
7684        /// Optional. Whether or not to allow VPCs from orgs different than the
7685        /// bucket's parent org to access the bucket. When set to true, validations
7686        /// on the existence of the VPCs won't be performed. If set to false, each
7687        /// VPC network source is checked to belong to the same org as the bucket as
7688        /// well as validated for existence.
7689        pub allow_cross_org_vpcs: bool,
7690
7691        /// Whether or not to allow all P4SA access to the bucket. When set to true,
7692        /// IP filter config validation doesn't apply.
7693        pub allow_all_service_agent_access: std::option::Option<bool>,
7694
7695        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7696    }
7697
7698    impl IpFilter {
7699        pub fn new() -> Self {
7700            std::default::Default::default()
7701        }
7702
7703        /// Sets the value of [mode][crate::model::bucket::IpFilter::mode].
7704        ///
7705        /// # Example
7706        /// ```ignore,no_run
7707        /// # use google_cloud_storage::model::bucket::IpFilter;
7708        /// let x = IpFilter::new().set_mode("example");
7709        /// ```
7710        pub fn set_mode<T>(mut self, v: T) -> Self
7711        where
7712            T: std::convert::Into<std::string::String>,
7713        {
7714            self.mode = std::option::Option::Some(v.into());
7715            self
7716        }
7717
7718        /// Sets or clears the value of [mode][crate::model::bucket::IpFilter::mode].
7719        ///
7720        /// # Example
7721        /// ```ignore,no_run
7722        /// # use google_cloud_storage::model::bucket::IpFilter;
7723        /// let x = IpFilter::new().set_or_clear_mode(Some("example"));
7724        /// let x = IpFilter::new().set_or_clear_mode(None::<String>);
7725        /// ```
7726        pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
7727        where
7728            T: std::convert::Into<std::string::String>,
7729        {
7730            self.mode = v.map(|x| x.into());
7731            self
7732        }
7733
7734        /// Sets the value of [public_network_source][crate::model::bucket::IpFilter::public_network_source].
7735        ///
7736        /// # Example
7737        /// ```ignore,no_run
7738        /// # use google_cloud_storage::model::bucket::IpFilter;
7739        /// use google_cloud_storage::model::bucket::ip_filter::PublicNetworkSource;
7740        /// let x = IpFilter::new().set_public_network_source(PublicNetworkSource::default()/* use setters */);
7741        /// ```
7742        pub fn set_public_network_source<T>(mut self, v: T) -> Self
7743        where
7744            T: std::convert::Into<crate::model::bucket::ip_filter::PublicNetworkSource>,
7745        {
7746            self.public_network_source = std::option::Option::Some(v.into());
7747            self
7748        }
7749
7750        /// Sets or clears the value of [public_network_source][crate::model::bucket::IpFilter::public_network_source].
7751        ///
7752        /// # Example
7753        /// ```ignore,no_run
7754        /// # use google_cloud_storage::model::bucket::IpFilter;
7755        /// use google_cloud_storage::model::bucket::ip_filter::PublicNetworkSource;
7756        /// let x = IpFilter::new().set_or_clear_public_network_source(Some(PublicNetworkSource::default()/* use setters */));
7757        /// let x = IpFilter::new().set_or_clear_public_network_source(None::<PublicNetworkSource>);
7758        /// ```
7759        pub fn set_or_clear_public_network_source<T>(mut self, v: std::option::Option<T>) -> Self
7760        where
7761            T: std::convert::Into<crate::model::bucket::ip_filter::PublicNetworkSource>,
7762        {
7763            self.public_network_source = v.map(|x| x.into());
7764            self
7765        }
7766
7767        /// Sets the value of [vpc_network_sources][crate::model::bucket::IpFilter::vpc_network_sources].
7768        ///
7769        /// # Example
7770        /// ```ignore,no_run
7771        /// # use google_cloud_storage::model::bucket::IpFilter;
7772        /// use google_cloud_storage::model::bucket::ip_filter::VpcNetworkSource;
7773        /// let x = IpFilter::new()
7774        ///     .set_vpc_network_sources([
7775        ///         VpcNetworkSource::default()/* use setters */,
7776        ///         VpcNetworkSource::default()/* use (different) setters */,
7777        ///     ]);
7778        /// ```
7779        pub fn set_vpc_network_sources<T, V>(mut self, v: T) -> Self
7780        where
7781            T: std::iter::IntoIterator<Item = V>,
7782            V: std::convert::Into<crate::model::bucket::ip_filter::VpcNetworkSource>,
7783        {
7784            use std::iter::Iterator;
7785            self.vpc_network_sources = v.into_iter().map(|i| i.into()).collect();
7786            self
7787        }
7788
7789        /// Sets the value of [allow_cross_org_vpcs][crate::model::bucket::IpFilter::allow_cross_org_vpcs].
7790        ///
7791        /// # Example
7792        /// ```ignore,no_run
7793        /// # use google_cloud_storage::model::bucket::IpFilter;
7794        /// let x = IpFilter::new().set_allow_cross_org_vpcs(true);
7795        /// ```
7796        pub fn set_allow_cross_org_vpcs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7797            self.allow_cross_org_vpcs = v.into();
7798            self
7799        }
7800
7801        /// Sets the value of [allow_all_service_agent_access][crate::model::bucket::IpFilter::allow_all_service_agent_access].
7802        ///
7803        /// # Example
7804        /// ```ignore,no_run
7805        /// # use google_cloud_storage::model::bucket::IpFilter;
7806        /// let x = IpFilter::new().set_allow_all_service_agent_access(true);
7807        /// ```
7808        pub fn set_allow_all_service_agent_access<T>(mut self, v: T) -> Self
7809        where
7810            T: std::convert::Into<bool>,
7811        {
7812            self.allow_all_service_agent_access = std::option::Option::Some(v.into());
7813            self
7814        }
7815
7816        /// Sets or clears the value of [allow_all_service_agent_access][crate::model::bucket::IpFilter::allow_all_service_agent_access].
7817        ///
7818        /// # Example
7819        /// ```ignore,no_run
7820        /// # use google_cloud_storage::model::bucket::IpFilter;
7821        /// let x = IpFilter::new().set_or_clear_allow_all_service_agent_access(Some(false));
7822        /// let x = IpFilter::new().set_or_clear_allow_all_service_agent_access(None::<bool>);
7823        /// ```
7824        pub fn set_or_clear_allow_all_service_agent_access<T>(
7825            mut self,
7826            v: std::option::Option<T>,
7827        ) -> Self
7828        where
7829            T: std::convert::Into<bool>,
7830        {
7831            self.allow_all_service_agent_access = v.map(|x| x.into());
7832            self
7833        }
7834    }
7835
7836    impl wkt::message::Message for IpFilter {
7837        fn typename() -> &'static str {
7838            "type.googleapis.com/google.storage.v2.Bucket.IpFilter"
7839        }
7840    }
7841
7842    /// Defines additional types related to [IpFilter].
7843    pub mod ip_filter {
7844        #[allow(unused_imports)]
7845        use super::*;
7846
7847        /// The public network IP address ranges that can access the bucket and its
7848        /// data.
7849        #[derive(Clone, Default, PartialEq)]
7850        #[non_exhaustive]
7851        pub struct PublicNetworkSource {
7852            /// Optional. The list of IPv4 and IPv6 cidr blocks that are allowed to
7853            /// operate or access the bucket and its underlying objects.
7854            pub allowed_ip_cidr_ranges: std::vec::Vec<std::string::String>,
7855
7856            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7857        }
7858
7859        impl PublicNetworkSource {
7860            pub fn new() -> Self {
7861                std::default::Default::default()
7862            }
7863
7864            /// Sets the value of [allowed_ip_cidr_ranges][crate::model::bucket::ip_filter::PublicNetworkSource::allowed_ip_cidr_ranges].
7865            ///
7866            /// # Example
7867            /// ```ignore,no_run
7868            /// # use google_cloud_storage::model::bucket::ip_filter::PublicNetworkSource;
7869            /// let x = PublicNetworkSource::new().set_allowed_ip_cidr_ranges(["a", "b", "c"]);
7870            /// ```
7871            pub fn set_allowed_ip_cidr_ranges<T, V>(mut self, v: T) -> Self
7872            where
7873                T: std::iter::IntoIterator<Item = V>,
7874                V: std::convert::Into<std::string::String>,
7875            {
7876                use std::iter::Iterator;
7877                self.allowed_ip_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
7878                self
7879            }
7880        }
7881
7882        impl wkt::message::Message for PublicNetworkSource {
7883            fn typename() -> &'static str {
7884                "type.googleapis.com/google.storage.v2.Bucket.IpFilter.PublicNetworkSource"
7885            }
7886        }
7887
7888        /// The list of VPC networks that can access the bucket.
7889        #[derive(Clone, Default, PartialEq)]
7890        #[non_exhaustive]
7891        pub struct VpcNetworkSource {
7892            /// Name of the network.
7893            ///
7894            /// Format: `projects/PROJECT_ID/global/networks/NETWORK_NAME`
7895            pub network: std::option::Option<std::string::String>,
7896
7897            /// Optional. The list of public or private IPv4 and IPv6 CIDR ranges that
7898            /// can access the bucket. In the CIDR IP address block, the specified IP
7899            /// address must be properly truncated, meaning all the host bits must be
7900            /// zero or else the input is considered malformed. For example,
7901            /// `192.0.2.0/24` is accepted but `192.0.2.1/24` is not. Similarly, for
7902            /// IPv6, `2001:db8::/32` is accepted whereas `2001:db8::1/32` is not.
7903            pub allowed_ip_cidr_ranges: std::vec::Vec<std::string::String>,
7904
7905            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7906        }
7907
7908        impl VpcNetworkSource {
7909            pub fn new() -> Self {
7910                std::default::Default::default()
7911            }
7912
7913            /// Sets the value of [network][crate::model::bucket::ip_filter::VpcNetworkSource::network].
7914            ///
7915            /// # Example
7916            /// ```ignore,no_run
7917            /// # use google_cloud_storage::model::bucket::ip_filter::VpcNetworkSource;
7918            /// let x = VpcNetworkSource::new().set_network("example");
7919            /// ```
7920            pub fn set_network<T>(mut self, v: T) -> Self
7921            where
7922                T: std::convert::Into<std::string::String>,
7923            {
7924                self.network = std::option::Option::Some(v.into());
7925                self
7926            }
7927
7928            /// Sets or clears the value of [network][crate::model::bucket::ip_filter::VpcNetworkSource::network].
7929            ///
7930            /// # Example
7931            /// ```ignore,no_run
7932            /// # use google_cloud_storage::model::bucket::ip_filter::VpcNetworkSource;
7933            /// let x = VpcNetworkSource::new().set_or_clear_network(Some("example"));
7934            /// let x = VpcNetworkSource::new().set_or_clear_network(None::<String>);
7935            /// ```
7936            pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
7937            where
7938                T: std::convert::Into<std::string::String>,
7939            {
7940                self.network = v.map(|x| x.into());
7941                self
7942            }
7943
7944            /// Sets the value of [allowed_ip_cidr_ranges][crate::model::bucket::ip_filter::VpcNetworkSource::allowed_ip_cidr_ranges].
7945            ///
7946            /// # Example
7947            /// ```ignore,no_run
7948            /// # use google_cloud_storage::model::bucket::ip_filter::VpcNetworkSource;
7949            /// let x = VpcNetworkSource::new().set_allowed_ip_cidr_ranges(["a", "b", "c"]);
7950            /// ```
7951            pub fn set_allowed_ip_cidr_ranges<T, V>(mut self, v: T) -> Self
7952            where
7953                T: std::iter::IntoIterator<Item = V>,
7954                V: std::convert::Into<std::string::String>,
7955            {
7956                use std::iter::Iterator;
7957                self.allowed_ip_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
7958                self
7959            }
7960        }
7961
7962        impl wkt::message::Message for VpcNetworkSource {
7963            fn typename() -> &'static str {
7964                "type.googleapis.com/google.storage.v2.Bucket.IpFilter.VpcNetworkSource"
7965            }
7966        }
7967    }
7968
7969    /// Configuration for a bucket's hierarchical namespace feature.
7970    #[derive(Clone, Default, PartialEq)]
7971    #[non_exhaustive]
7972    pub struct HierarchicalNamespace {
7973        /// Optional. Enables the hierarchical namespace feature.
7974        pub enabled: bool,
7975
7976        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7977    }
7978
7979    impl HierarchicalNamespace {
7980        pub fn new() -> Self {
7981            std::default::Default::default()
7982        }
7983
7984        /// Sets the value of [enabled][crate::model::bucket::HierarchicalNamespace::enabled].
7985        ///
7986        /// # Example
7987        /// ```ignore,no_run
7988        /// # use google_cloud_storage::model::bucket::HierarchicalNamespace;
7989        /// let x = HierarchicalNamespace::new().set_enabled(true);
7990        /// ```
7991        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7992            self.enabled = v.into();
7993            self
7994        }
7995    }
7996
7997    impl wkt::message::Message for HierarchicalNamespace {
7998        fn typename() -> &'static str {
7999            "type.googleapis.com/google.storage.v2.Bucket.HierarchicalNamespace"
8000        }
8001    }
8002}
8003
8004/// An access-control entry.
8005#[derive(Clone, Default, PartialEq)]
8006#[non_exhaustive]
8007pub struct BucketAccessControl {
8008    /// Optional. The access permission for the entity.
8009    pub role: std::string::String,
8010
8011    /// Optional. The ID of the access-control entry.
8012    pub id: std::string::String,
8013
8014    /// Optional. The entity holding the permission, in one of the following forms:
8015    ///
8016    /// * `user-{userid}`
8017    /// * `user-{email}`
8018    /// * `group-{groupid}`
8019    /// * `group-{email}`
8020    /// * `domain-{domain}`
8021    /// * `project-{team}-{projectnumber}`
8022    /// * `project-{team}-{projectid}`
8023    /// * `allUsers`
8024    /// * `allAuthenticatedUsers`
8025    ///   Examples:
8026    /// * The user `liz@example.com` would be `user-liz@example.com`.
8027    /// * The group `example@googlegroups.com` would be
8028    ///   `group-example@googlegroups.com`
8029    /// * All members of the Google Apps for Business domain `example.com` would be
8030    ///   `domain-example.com`
8031    ///   For project entities, `project-{team}-{projectnumber}` format is
8032    ///   returned on response.
8033    pub entity: std::string::String,
8034
8035    /// Output only. The alternative entity format, if exists. For project
8036    /// entities, `project-{team}-{projectid}` format is returned in the response.
8037    pub entity_alt: std::string::String,
8038
8039    /// Optional. The ID for the entity, if any.
8040    pub entity_id: std::string::String,
8041
8042    /// Optional. The `etag` of the `BucketAccessControl`.
8043    /// If included in the metadata of an update or delete request message, the
8044    /// operation operation is only performed if the etag matches that of the
8045    /// bucket's `BucketAccessControl`.
8046    pub etag: std::string::String,
8047
8048    /// Optional. The email address associated with the entity, if any.
8049    pub email: std::string::String,
8050
8051    /// Optional. The domain associated with the entity, if any.
8052    pub domain: std::string::String,
8053
8054    /// Optional. The project team associated with the entity, if any.
8055    pub project_team: std::option::Option<crate::model::ProjectTeam>,
8056
8057    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8058}
8059
8060impl BucketAccessControl {
8061    pub fn new() -> Self {
8062        std::default::Default::default()
8063    }
8064
8065    /// Sets the value of [role][crate::model::BucketAccessControl::role].
8066    ///
8067    /// # Example
8068    /// ```ignore,no_run
8069    /// # use google_cloud_storage::model::BucketAccessControl;
8070    /// let x = BucketAccessControl::new().set_role("example");
8071    /// ```
8072    pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8073        self.role = v.into();
8074        self
8075    }
8076
8077    /// Sets the value of [id][crate::model::BucketAccessControl::id].
8078    ///
8079    /// # Example
8080    /// ```ignore,no_run
8081    /// # use google_cloud_storage::model::BucketAccessControl;
8082    /// let x = BucketAccessControl::new().set_id("example");
8083    /// ```
8084    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8085        self.id = v.into();
8086        self
8087    }
8088
8089    /// Sets the value of [entity][crate::model::BucketAccessControl::entity].
8090    ///
8091    /// # Example
8092    /// ```ignore,no_run
8093    /// # use google_cloud_storage::model::BucketAccessControl;
8094    /// let x = BucketAccessControl::new().set_entity("example");
8095    /// ```
8096    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8097        self.entity = v.into();
8098        self
8099    }
8100
8101    /// Sets the value of [entity_alt][crate::model::BucketAccessControl::entity_alt].
8102    ///
8103    /// # Example
8104    /// ```ignore,no_run
8105    /// # use google_cloud_storage::model::BucketAccessControl;
8106    /// let x = BucketAccessControl::new().set_entity_alt("example");
8107    /// ```
8108    pub fn set_entity_alt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8109        self.entity_alt = v.into();
8110        self
8111    }
8112
8113    /// Sets the value of [entity_id][crate::model::BucketAccessControl::entity_id].
8114    ///
8115    /// # Example
8116    /// ```ignore,no_run
8117    /// # use google_cloud_storage::model::BucketAccessControl;
8118    /// let x = BucketAccessControl::new().set_entity_id("example");
8119    /// ```
8120    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8121        self.entity_id = v.into();
8122        self
8123    }
8124
8125    /// Sets the value of [etag][crate::model::BucketAccessControl::etag].
8126    ///
8127    /// # Example
8128    /// ```ignore,no_run
8129    /// # use google_cloud_storage::model::BucketAccessControl;
8130    /// let x = BucketAccessControl::new().set_etag("example");
8131    /// ```
8132    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8133        self.etag = v.into();
8134        self
8135    }
8136
8137    /// Sets the value of [email][crate::model::BucketAccessControl::email].
8138    ///
8139    /// # Example
8140    /// ```ignore,no_run
8141    /// # use google_cloud_storage::model::BucketAccessControl;
8142    /// let x = BucketAccessControl::new().set_email("example");
8143    /// ```
8144    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8145        self.email = v.into();
8146        self
8147    }
8148
8149    /// Sets the value of [domain][crate::model::BucketAccessControl::domain].
8150    ///
8151    /// # Example
8152    /// ```ignore,no_run
8153    /// # use google_cloud_storage::model::BucketAccessControl;
8154    /// let x = BucketAccessControl::new().set_domain("example");
8155    /// ```
8156    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8157        self.domain = v.into();
8158        self
8159    }
8160
8161    /// Sets the value of [project_team][crate::model::BucketAccessControl::project_team].
8162    ///
8163    /// # Example
8164    /// ```ignore,no_run
8165    /// # use google_cloud_storage::model::BucketAccessControl;
8166    /// use google_cloud_storage::model::ProjectTeam;
8167    /// let x = BucketAccessControl::new().set_project_team(ProjectTeam::default()/* use setters */);
8168    /// ```
8169    pub fn set_project_team<T>(mut self, v: T) -> Self
8170    where
8171        T: std::convert::Into<crate::model::ProjectTeam>,
8172    {
8173        self.project_team = std::option::Option::Some(v.into());
8174        self
8175    }
8176
8177    /// Sets or clears the value of [project_team][crate::model::BucketAccessControl::project_team].
8178    ///
8179    /// # Example
8180    /// ```ignore,no_run
8181    /// # use google_cloud_storage::model::BucketAccessControl;
8182    /// use google_cloud_storage::model::ProjectTeam;
8183    /// let x = BucketAccessControl::new().set_or_clear_project_team(Some(ProjectTeam::default()/* use setters */));
8184    /// let x = BucketAccessControl::new().set_or_clear_project_team(None::<ProjectTeam>);
8185    /// ```
8186    pub fn set_or_clear_project_team<T>(mut self, v: std::option::Option<T>) -> Self
8187    where
8188        T: std::convert::Into<crate::model::ProjectTeam>,
8189    {
8190        self.project_team = v.map(|x| x.into());
8191        self
8192    }
8193}
8194
8195impl wkt::message::Message for BucketAccessControl {
8196    fn typename() -> &'static str {
8197        "type.googleapis.com/google.storage.v2.BucketAccessControl"
8198    }
8199}
8200
8201/// Message used for storing full (not subrange) object checksums.
8202#[derive(Clone, Default, PartialEq)]
8203#[non_exhaustive]
8204pub struct ObjectChecksums {
8205    /// CRC32C digest of the object data. Computed by the Cloud Storage service for
8206    /// all written objects.
8207    /// If set in a WriteObjectRequest, service validates that the stored
8208    /// object matches this checksum.
8209    pub crc32c: std::option::Option<u32>,
8210
8211    /// Optional. 128 bit MD5 hash of the object data. For more information about
8212    /// using the MD5 hash, see [Data validation and change
8213    /// detection](https://cloud.google.com/storage/docs/data-validation). Not all
8214    /// objects provide an MD5 hash. For example, composite objects provide only
8215    /// crc32c hashes. This value is equivalent to running `cat object.txt |
8216    /// openssl md5 -binary`
8217    pub md5_hash: ::bytes::Bytes,
8218
8219    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8220}
8221
8222impl ObjectChecksums {
8223    pub fn new() -> Self {
8224        std::default::Default::default()
8225    }
8226
8227    /// Sets the value of [crc32c][crate::model::ObjectChecksums::crc32c].
8228    ///
8229    /// # Example
8230    /// ```ignore,no_run
8231    /// # use google_cloud_storage::model::ObjectChecksums;
8232    /// let x = ObjectChecksums::new().set_crc32c(42_u32);
8233    /// ```
8234    pub fn set_crc32c<T>(mut self, v: T) -> Self
8235    where
8236        T: std::convert::Into<u32>,
8237    {
8238        self.crc32c = std::option::Option::Some(v.into());
8239        self
8240    }
8241
8242    /// Sets or clears the value of [crc32c][crate::model::ObjectChecksums::crc32c].
8243    ///
8244    /// # Example
8245    /// ```ignore,no_run
8246    /// # use google_cloud_storage::model::ObjectChecksums;
8247    /// let x = ObjectChecksums::new().set_or_clear_crc32c(Some(42_u32));
8248    /// let x = ObjectChecksums::new().set_or_clear_crc32c(None::<u32>);
8249    /// ```
8250    pub fn set_or_clear_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
8251    where
8252        T: std::convert::Into<u32>,
8253    {
8254        self.crc32c = v.map(|x| x.into());
8255        self
8256    }
8257
8258    /// Sets the value of [md5_hash][crate::model::ObjectChecksums::md5_hash].
8259    ///
8260    /// # Example
8261    /// ```ignore,no_run
8262    /// # use google_cloud_storage::model::ObjectChecksums;
8263    /// let x = ObjectChecksums::new().set_md5_hash(bytes::Bytes::from_static(b"example"));
8264    /// ```
8265    pub fn set_md5_hash<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
8266        self.md5_hash = v.into();
8267        self
8268    }
8269}
8270
8271impl wkt::message::Message for ObjectChecksums {
8272    fn typename() -> &'static str {
8273        "type.googleapis.com/google.storage.v2.ObjectChecksums"
8274    }
8275}
8276
8277/// The payload of a single user-defined object context.
8278#[derive(Clone, Default, PartialEq)]
8279#[non_exhaustive]
8280pub struct ObjectCustomContextPayload {
8281    /// Required. The value of the object context.
8282    pub value: std::string::String,
8283
8284    /// Output only. The time at which the object context was created.
8285    pub create_time: std::option::Option<wkt::Timestamp>,
8286
8287    /// Output only. The time at which the object context was last updated.
8288    pub update_time: std::option::Option<wkt::Timestamp>,
8289
8290    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8291}
8292
8293impl ObjectCustomContextPayload {
8294    pub fn new() -> Self {
8295        std::default::Default::default()
8296    }
8297
8298    /// Sets the value of [value][crate::model::ObjectCustomContextPayload::value].
8299    ///
8300    /// # Example
8301    /// ```ignore,no_run
8302    /// # use google_cloud_storage::model::ObjectCustomContextPayload;
8303    /// let x = ObjectCustomContextPayload::new().set_value("example");
8304    /// ```
8305    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8306        self.value = v.into();
8307        self
8308    }
8309
8310    /// Sets the value of [create_time][crate::model::ObjectCustomContextPayload::create_time].
8311    ///
8312    /// # Example
8313    /// ```ignore,no_run
8314    /// # use google_cloud_storage::model::ObjectCustomContextPayload;
8315    /// use wkt::Timestamp;
8316    /// let x = ObjectCustomContextPayload::new().set_create_time(Timestamp::default()/* use setters */);
8317    /// ```
8318    pub fn set_create_time<T>(mut self, v: T) -> Self
8319    where
8320        T: std::convert::Into<wkt::Timestamp>,
8321    {
8322        self.create_time = std::option::Option::Some(v.into());
8323        self
8324    }
8325
8326    /// Sets or clears the value of [create_time][crate::model::ObjectCustomContextPayload::create_time].
8327    ///
8328    /// # Example
8329    /// ```ignore,no_run
8330    /// # use google_cloud_storage::model::ObjectCustomContextPayload;
8331    /// use wkt::Timestamp;
8332    /// let x = ObjectCustomContextPayload::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8333    /// let x = ObjectCustomContextPayload::new().set_or_clear_create_time(None::<Timestamp>);
8334    /// ```
8335    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8336    where
8337        T: std::convert::Into<wkt::Timestamp>,
8338    {
8339        self.create_time = v.map(|x| x.into());
8340        self
8341    }
8342
8343    /// Sets the value of [update_time][crate::model::ObjectCustomContextPayload::update_time].
8344    ///
8345    /// # Example
8346    /// ```ignore,no_run
8347    /// # use google_cloud_storage::model::ObjectCustomContextPayload;
8348    /// use wkt::Timestamp;
8349    /// let x = ObjectCustomContextPayload::new().set_update_time(Timestamp::default()/* use setters */);
8350    /// ```
8351    pub fn set_update_time<T>(mut self, v: T) -> Self
8352    where
8353        T: std::convert::Into<wkt::Timestamp>,
8354    {
8355        self.update_time = std::option::Option::Some(v.into());
8356        self
8357    }
8358
8359    /// Sets or clears the value of [update_time][crate::model::ObjectCustomContextPayload::update_time].
8360    ///
8361    /// # Example
8362    /// ```ignore,no_run
8363    /// # use google_cloud_storage::model::ObjectCustomContextPayload;
8364    /// use wkt::Timestamp;
8365    /// let x = ObjectCustomContextPayload::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8366    /// let x = ObjectCustomContextPayload::new().set_or_clear_update_time(None::<Timestamp>);
8367    /// ```
8368    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8369    where
8370        T: std::convert::Into<wkt::Timestamp>,
8371    {
8372        self.update_time = v.map(|x| x.into());
8373        self
8374    }
8375}
8376
8377impl wkt::message::Message for ObjectCustomContextPayload {
8378    fn typename() -> &'static str {
8379        "type.googleapis.com/google.storage.v2.ObjectCustomContextPayload"
8380    }
8381}
8382
8383/// All contexts of an object grouped by type.
8384#[derive(Clone, Default, PartialEq)]
8385#[non_exhaustive]
8386pub struct ObjectContexts {
8387    /// Optional. User-defined object contexts.
8388    /// The maximum key or value size is `256` characters.
8389    /// The maximum number of entries is `50`.
8390    /// The maximum total serialized size of all entries is `25KiB`.
8391    pub custom:
8392        std::collections::HashMap<std::string::String, crate::model::ObjectCustomContextPayload>,
8393
8394    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8395}
8396
8397impl ObjectContexts {
8398    pub fn new() -> Self {
8399        std::default::Default::default()
8400    }
8401
8402    /// Sets the value of [custom][crate::model::ObjectContexts::custom].
8403    ///
8404    /// # Example
8405    /// ```ignore,no_run
8406    /// # use google_cloud_storage::model::ObjectContexts;
8407    /// use google_cloud_storage::model::ObjectCustomContextPayload;
8408    /// let x = ObjectContexts::new().set_custom([
8409    ///     ("key0", ObjectCustomContextPayload::default()/* use setters */),
8410    ///     ("key1", ObjectCustomContextPayload::default()/* use (different) setters */),
8411    /// ]);
8412    /// ```
8413    pub fn set_custom<T, K, V>(mut self, v: T) -> Self
8414    where
8415        T: std::iter::IntoIterator<Item = (K, V)>,
8416        K: std::convert::Into<std::string::String>,
8417        V: std::convert::Into<crate::model::ObjectCustomContextPayload>,
8418    {
8419        use std::iter::Iterator;
8420        self.custom = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8421        self
8422    }
8423}
8424
8425impl wkt::message::Message for ObjectContexts {
8426    fn typename() -> &'static str {
8427        "type.googleapis.com/google.storage.v2.ObjectContexts"
8428    }
8429}
8430
8431/// Describes the customer-supplied encryption key mechanism used to store an
8432/// object's data at rest.
8433#[derive(Clone, Default, PartialEq)]
8434#[non_exhaustive]
8435pub struct CustomerEncryption {
8436    /// Optional. The encryption algorithm.
8437    pub encryption_algorithm: std::string::String,
8438
8439    /// Optional. SHA256 hash value of the encryption key.
8440    /// In raw bytes format (not base64-encoded).
8441    pub key_sha256_bytes: ::bytes::Bytes,
8442
8443    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8444}
8445
8446impl CustomerEncryption {
8447    pub fn new() -> Self {
8448        std::default::Default::default()
8449    }
8450
8451    /// Sets the value of [encryption_algorithm][crate::model::CustomerEncryption::encryption_algorithm].
8452    ///
8453    /// # Example
8454    /// ```ignore,no_run
8455    /// # use google_cloud_storage::model::CustomerEncryption;
8456    /// let x = CustomerEncryption::new().set_encryption_algorithm("example");
8457    /// ```
8458    pub fn set_encryption_algorithm<T: std::convert::Into<std::string::String>>(
8459        mut self,
8460        v: T,
8461    ) -> Self {
8462        self.encryption_algorithm = v.into();
8463        self
8464    }
8465
8466    /// Sets the value of [key_sha256_bytes][crate::model::CustomerEncryption::key_sha256_bytes].
8467    ///
8468    /// # Example
8469    /// ```ignore,no_run
8470    /// # use google_cloud_storage::model::CustomerEncryption;
8471    /// let x = CustomerEncryption::new().set_key_sha256_bytes(bytes::Bytes::from_static(b"example"));
8472    /// ```
8473    pub fn set_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
8474        self.key_sha256_bytes = v.into();
8475        self
8476    }
8477}
8478
8479impl wkt::message::Message for CustomerEncryption {
8480    fn typename() -> &'static str {
8481        "type.googleapis.com/google.storage.v2.CustomerEncryption"
8482    }
8483}
8484
8485/// An object.
8486#[derive(Clone, Default, PartialEq)]
8487#[non_exhaustive]
8488pub struct Object {
8489    /// Immutable. The name of this object. Nearly any sequence of unicode
8490    /// characters is valid. See
8491    /// [Guidelines](https://cloud.google.com/storage/docs/objects#naming).
8492    /// Example: `test.txt`
8493    /// The `name` field by itself does not uniquely identify a Cloud Storage
8494    /// object. A Cloud Storage object is uniquely identified by the tuple of
8495    /// (bucket, object, generation).
8496    pub name: std::string::String,
8497
8498    /// Immutable. The name of the bucket containing this object.
8499    pub bucket: std::string::String,
8500
8501    /// Optional. The `etag` of an object.
8502    /// If included in the metadata of an update or delete request message, the
8503    /// operation is only performed if the etag matches that of the live
8504    /// object.
8505    pub etag: std::string::String,
8506
8507    /// Immutable. The content generation of this object. Used for object
8508    /// versioning.
8509    pub generation: i64,
8510
8511    /// Output only. Restore token used to differentiate deleted objects with the
8512    /// same name and generation. This field is output only, and only set for
8513    /// deleted objects in HNS buckets.
8514    pub restore_token: std::option::Option<std::string::String>,
8515
8516    /// Output only. The version of the metadata for this generation of this
8517    /// object. Used for preconditions and for detecting changes in metadata. A
8518    /// metageneration number is only meaningful in the context of a particular
8519    /// generation of a particular object.
8520    pub metageneration: i64,
8521
8522    /// Optional. Storage class of the object.
8523    pub storage_class: std::string::String,
8524
8525    /// Output only. Content-Length of the object data in bytes, matching
8526    /// [RFC 7230 §3.3.2](<https://tools.ietf.org/html/rfc7230#section-3.3.2>]).
8527    pub size: i64,
8528
8529    /// Optional. Content-Encoding of the object data, matching
8530    /// [RFC 7231 §3.1.2.2](https://tools.ietf.org/html/rfc7231#section-3.1.2.2)
8531    pub content_encoding: std::string::String,
8532
8533    /// Optional. Content-Disposition of the object data, matching
8534    /// [RFC 6266](https://tools.ietf.org/html/rfc6266).
8535    pub content_disposition: std::string::String,
8536
8537    /// Optional. Cache-Control directive for the object data, matching
8538    /// [RFC 7234 §5.2](https://tools.ietf.org/html/rfc7234#section-5.2).
8539    /// If omitted, and the object is accessible to all anonymous users, the
8540    /// default is `public, max-age=3600`.
8541    pub cache_control: std::string::String,
8542
8543    /// Optional. Access controls on the object.
8544    /// If `iam_config.uniform_bucket_level_access` is enabled on the parent
8545    /// bucket, requests to set, read, or modify acl is an error.
8546    pub acl: std::vec::Vec<crate::model::ObjectAccessControl>,
8547
8548    /// Optional. Content-Language of the object data, matching
8549    /// [RFC 7231 §3.1.3.2](https://tools.ietf.org/html/rfc7231#section-3.1.3.2).
8550    pub content_language: std::string::String,
8551
8552    /// Output only. If this object is noncurrent, this is the time when the object
8553    /// became noncurrent.
8554    pub delete_time: std::option::Option<wkt::Timestamp>,
8555
8556    /// Output only. The time when the object was finalized.
8557    pub finalize_time: std::option::Option<wkt::Timestamp>,
8558
8559    /// Optional. Content-Type of the object data, matching
8560    /// [RFC 7231 §3.1.1.5](https://tools.ietf.org/html/rfc7231#section-3.1.1.5).
8561    /// If an object is stored without a Content-Type, it is served as
8562    /// `application/octet-stream`.
8563    pub content_type: std::string::String,
8564
8565    /// Output only. The creation time of the object.
8566    pub create_time: std::option::Option<wkt::Timestamp>,
8567
8568    /// Output only. Number of underlying components that make up this object.
8569    /// Components are accumulated by compose operations.
8570    pub component_count: i32,
8571
8572    /// Output only. Hashes for the data part of this object. This field is used
8573    /// for output only and is silently ignored if provided in requests. The
8574    /// checksums of the complete object regardless of data range. If the object is
8575    /// downloaded in full, the client should compute one of these checksums over
8576    /// the downloaded object and compare it against the value provided here.
8577    pub checksums: std::option::Option<crate::model::ObjectChecksums>,
8578
8579    /// Output only. The modification time of the object metadata.
8580    /// Set initially to object creation time and then updated whenever any
8581    /// metadata of the object changes. This includes changes made by a requester,
8582    /// such as modifying custom metadata, as well as changes made by Cloud Storage
8583    /// on behalf of a requester, such as changing the storage class based on an
8584    /// Object Lifecycle Configuration.
8585    pub update_time: std::option::Option<wkt::Timestamp>,
8586
8587    /// Optional. Cloud KMS Key used to encrypt this object, if the object is
8588    /// encrypted by such a key.
8589    pub kms_key: std::string::String,
8590
8591    /// Output only. The time at which the object's storage class was last changed.
8592    /// When the object is initially created, it is set to `time_created`.
8593    pub update_storage_class_time: std::option::Option<wkt::Timestamp>,
8594
8595    /// Optional. Whether an object is under temporary hold. While this flag is set
8596    /// to true, the object is protected against deletion and overwrites.  A common
8597    /// use case of this flag is regulatory investigations where objects need to be
8598    /// retained while the investigation is ongoing. Note that unlike event-based
8599    /// hold, temporary hold does not impact retention expiration time of an
8600    /// object.
8601    pub temporary_hold: bool,
8602
8603    /// Optional. A server-determined value that specifies the earliest time that
8604    /// the object's retention period expires. Note 1: This field is not provided
8605    /// for objects with an active event-based hold, since retention expiration is
8606    /// unknown until the hold is removed. Note 2: This value can be provided even
8607    /// when temporary hold is set (so that the user can reason about policy
8608    /// without having to first unset the temporary hold).
8609    pub retention_expire_time: std::option::Option<wkt::Timestamp>,
8610
8611    /// Optional. User-provided metadata, in key/value pairs.
8612    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
8613
8614    /// Optional. User-defined or system-defined object contexts. Each object
8615    /// context is a key-payload pair, where the key provides the identification
8616    /// and the payload holds the associated value and additional metadata.
8617    pub contexts: std::option::Option<crate::model::ObjectContexts>,
8618
8619    /// Whether an object is under event-based hold.
8620    /// An event-based hold is a way to force the retention of an object until
8621    /// after some event occurs. Once the hold is released by explicitly setting
8622    /// this field to `false`, the object becomes subject to any bucket-level
8623    /// retention policy, except that the retention duration is calculated
8624    /// from the time the event based hold was lifted, rather than the time the
8625    /// object was created.
8626    ///
8627    /// In a `WriteObject` request, not setting this field implies that the value
8628    /// should be taken from the parent bucket's `default_event_based_hold` field.
8629    /// In a response, this field is always set to `true` or `false`.
8630    pub event_based_hold: std::option::Option<bool>,
8631
8632    /// Output only. The owner of the object. This is always the uploader of the
8633    /// object.
8634    pub owner: std::option::Option<crate::model::Owner>,
8635
8636    /// Optional. Metadata of customer-supplied encryption key, if the object is
8637    /// encrypted by such a key.
8638    pub customer_encryption: std::option::Option<crate::model::CustomerEncryption>,
8639
8640    /// Optional. A user-specified timestamp set on an object.
8641    pub custom_time: std::option::Option<wkt::Timestamp>,
8642
8643    /// Output only. This is the time when the object became soft-deleted.
8644    ///
8645    /// Soft-deleted objects are only accessible if a soft_delete_policy is
8646    /// enabled. Also see `hard_delete_time`.
8647    pub soft_delete_time: std::option::Option<wkt::Timestamp>,
8648
8649    /// Output only. The time when the object is permanently deleted.
8650    ///
8651    /// Only set when an object becomes soft-deleted with a `soft_delete_policy`.
8652    /// Otherwise, the object is not accessible.
8653    pub hard_delete_time: std::option::Option<wkt::Timestamp>,
8654
8655    /// Optional. Retention configuration of this object.
8656    /// Might only be configured if the bucket has object retention enabled.
8657    pub retention: std::option::Option<crate::model::object::Retention>,
8658
8659    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8660}
8661
8662impl Object {
8663    pub fn new() -> Self {
8664        std::default::Default::default()
8665    }
8666
8667    /// Sets the value of [name][crate::model::Object::name].
8668    ///
8669    /// # Example
8670    /// ```ignore,no_run
8671    /// # use google_cloud_storage::model::Object;
8672    /// let x = Object::new().set_name("example");
8673    /// ```
8674    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8675        self.name = v.into();
8676        self
8677    }
8678
8679    /// Sets the value of [bucket][crate::model::Object::bucket].
8680    ///
8681    /// # Example
8682    /// ```ignore,no_run
8683    /// # use google_cloud_storage::model::Object;
8684    /// let x = Object::new().set_bucket("example");
8685    /// ```
8686    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8687        self.bucket = v.into();
8688        self
8689    }
8690
8691    /// Sets the value of [etag][crate::model::Object::etag].
8692    ///
8693    /// # Example
8694    /// ```ignore,no_run
8695    /// # use google_cloud_storage::model::Object;
8696    /// let x = Object::new().set_etag("example");
8697    /// ```
8698    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8699        self.etag = v.into();
8700        self
8701    }
8702
8703    /// Sets the value of [generation][crate::model::Object::generation].
8704    ///
8705    /// # Example
8706    /// ```ignore,no_run
8707    /// # use google_cloud_storage::model::Object;
8708    /// let x = Object::new().set_generation(42);
8709    /// ```
8710    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8711        self.generation = v.into();
8712        self
8713    }
8714
8715    /// Sets the value of [restore_token][crate::model::Object::restore_token].
8716    ///
8717    /// # Example
8718    /// ```ignore,no_run
8719    /// # use google_cloud_storage::model::Object;
8720    /// let x = Object::new().set_restore_token("example");
8721    /// ```
8722    pub fn set_restore_token<T>(mut self, v: T) -> Self
8723    where
8724        T: std::convert::Into<std::string::String>,
8725    {
8726        self.restore_token = std::option::Option::Some(v.into());
8727        self
8728    }
8729
8730    /// Sets or clears the value of [restore_token][crate::model::Object::restore_token].
8731    ///
8732    /// # Example
8733    /// ```ignore,no_run
8734    /// # use google_cloud_storage::model::Object;
8735    /// let x = Object::new().set_or_clear_restore_token(Some("example"));
8736    /// let x = Object::new().set_or_clear_restore_token(None::<String>);
8737    /// ```
8738    pub fn set_or_clear_restore_token<T>(mut self, v: std::option::Option<T>) -> Self
8739    where
8740        T: std::convert::Into<std::string::String>,
8741    {
8742        self.restore_token = v.map(|x| x.into());
8743        self
8744    }
8745
8746    /// Sets the value of [metageneration][crate::model::Object::metageneration].
8747    ///
8748    /// # Example
8749    /// ```ignore,no_run
8750    /// # use google_cloud_storage::model::Object;
8751    /// let x = Object::new().set_metageneration(42);
8752    /// ```
8753    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8754        self.metageneration = v.into();
8755        self
8756    }
8757
8758    /// Sets the value of [storage_class][crate::model::Object::storage_class].
8759    ///
8760    /// # Example
8761    /// ```ignore,no_run
8762    /// # use google_cloud_storage::model::Object;
8763    /// let x = Object::new().set_storage_class("example");
8764    /// ```
8765    pub fn set_storage_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8766        self.storage_class = v.into();
8767        self
8768    }
8769
8770    /// Sets the value of [size][crate::model::Object::size].
8771    ///
8772    /// # Example
8773    /// ```ignore,no_run
8774    /// # use google_cloud_storage::model::Object;
8775    /// let x = Object::new().set_size(42);
8776    /// ```
8777    pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8778        self.size = v.into();
8779        self
8780    }
8781
8782    /// Sets the value of [content_encoding][crate::model::Object::content_encoding].
8783    ///
8784    /// # Example
8785    /// ```ignore,no_run
8786    /// # use google_cloud_storage::model::Object;
8787    /// let x = Object::new().set_content_encoding("example");
8788    /// ```
8789    pub fn set_content_encoding<T: std::convert::Into<std::string::String>>(
8790        mut self,
8791        v: T,
8792    ) -> Self {
8793        self.content_encoding = v.into();
8794        self
8795    }
8796
8797    /// Sets the value of [content_disposition][crate::model::Object::content_disposition].
8798    ///
8799    /// # Example
8800    /// ```ignore,no_run
8801    /// # use google_cloud_storage::model::Object;
8802    /// let x = Object::new().set_content_disposition("example");
8803    /// ```
8804    pub fn set_content_disposition<T: std::convert::Into<std::string::String>>(
8805        mut self,
8806        v: T,
8807    ) -> Self {
8808        self.content_disposition = v.into();
8809        self
8810    }
8811
8812    /// Sets the value of [cache_control][crate::model::Object::cache_control].
8813    ///
8814    /// # Example
8815    /// ```ignore,no_run
8816    /// # use google_cloud_storage::model::Object;
8817    /// let x = Object::new().set_cache_control("example");
8818    /// ```
8819    pub fn set_cache_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8820        self.cache_control = v.into();
8821        self
8822    }
8823
8824    /// Sets the value of [acl][crate::model::Object::acl].
8825    ///
8826    /// # Example
8827    /// ```ignore,no_run
8828    /// # use google_cloud_storage::model::Object;
8829    /// use google_cloud_storage::model::ObjectAccessControl;
8830    /// let x = Object::new()
8831    ///     .set_acl([
8832    ///         ObjectAccessControl::default()/* use setters */,
8833    ///         ObjectAccessControl::default()/* use (different) setters */,
8834    ///     ]);
8835    /// ```
8836    pub fn set_acl<T, V>(mut self, v: T) -> Self
8837    where
8838        T: std::iter::IntoIterator<Item = V>,
8839        V: std::convert::Into<crate::model::ObjectAccessControl>,
8840    {
8841        use std::iter::Iterator;
8842        self.acl = v.into_iter().map(|i| i.into()).collect();
8843        self
8844    }
8845
8846    /// Sets the value of [content_language][crate::model::Object::content_language].
8847    ///
8848    /// # Example
8849    /// ```ignore,no_run
8850    /// # use google_cloud_storage::model::Object;
8851    /// let x = Object::new().set_content_language("example");
8852    /// ```
8853    pub fn set_content_language<T: std::convert::Into<std::string::String>>(
8854        mut self,
8855        v: T,
8856    ) -> Self {
8857        self.content_language = v.into();
8858        self
8859    }
8860
8861    /// Sets the value of [delete_time][crate::model::Object::delete_time].
8862    ///
8863    /// # Example
8864    /// ```ignore,no_run
8865    /// # use google_cloud_storage::model::Object;
8866    /// use wkt::Timestamp;
8867    /// let x = Object::new().set_delete_time(Timestamp::default()/* use setters */);
8868    /// ```
8869    pub fn set_delete_time<T>(mut self, v: T) -> Self
8870    where
8871        T: std::convert::Into<wkt::Timestamp>,
8872    {
8873        self.delete_time = std::option::Option::Some(v.into());
8874        self
8875    }
8876
8877    /// Sets or clears the value of [delete_time][crate::model::Object::delete_time].
8878    ///
8879    /// # Example
8880    /// ```ignore,no_run
8881    /// # use google_cloud_storage::model::Object;
8882    /// use wkt::Timestamp;
8883    /// let x = Object::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
8884    /// let x = Object::new().set_or_clear_delete_time(None::<Timestamp>);
8885    /// ```
8886    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
8887    where
8888        T: std::convert::Into<wkt::Timestamp>,
8889    {
8890        self.delete_time = v.map(|x| x.into());
8891        self
8892    }
8893
8894    /// Sets the value of [finalize_time][crate::model::Object::finalize_time].
8895    ///
8896    /// # Example
8897    /// ```ignore,no_run
8898    /// # use google_cloud_storage::model::Object;
8899    /// use wkt::Timestamp;
8900    /// let x = Object::new().set_finalize_time(Timestamp::default()/* use setters */);
8901    /// ```
8902    pub fn set_finalize_time<T>(mut self, v: T) -> Self
8903    where
8904        T: std::convert::Into<wkt::Timestamp>,
8905    {
8906        self.finalize_time = std::option::Option::Some(v.into());
8907        self
8908    }
8909
8910    /// Sets or clears the value of [finalize_time][crate::model::Object::finalize_time].
8911    ///
8912    /// # Example
8913    /// ```ignore,no_run
8914    /// # use google_cloud_storage::model::Object;
8915    /// use wkt::Timestamp;
8916    /// let x = Object::new().set_or_clear_finalize_time(Some(Timestamp::default()/* use setters */));
8917    /// let x = Object::new().set_or_clear_finalize_time(None::<Timestamp>);
8918    /// ```
8919    pub fn set_or_clear_finalize_time<T>(mut self, v: std::option::Option<T>) -> Self
8920    where
8921        T: std::convert::Into<wkt::Timestamp>,
8922    {
8923        self.finalize_time = v.map(|x| x.into());
8924        self
8925    }
8926
8927    /// Sets the value of [content_type][crate::model::Object::content_type].
8928    ///
8929    /// # Example
8930    /// ```ignore,no_run
8931    /// # use google_cloud_storage::model::Object;
8932    /// let x = Object::new().set_content_type("example");
8933    /// ```
8934    pub fn set_content_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8935        self.content_type = v.into();
8936        self
8937    }
8938
8939    /// Sets the value of [create_time][crate::model::Object::create_time].
8940    ///
8941    /// # Example
8942    /// ```ignore,no_run
8943    /// # use google_cloud_storage::model::Object;
8944    /// use wkt::Timestamp;
8945    /// let x = Object::new().set_create_time(Timestamp::default()/* use setters */);
8946    /// ```
8947    pub fn set_create_time<T>(mut self, v: T) -> Self
8948    where
8949        T: std::convert::Into<wkt::Timestamp>,
8950    {
8951        self.create_time = std::option::Option::Some(v.into());
8952        self
8953    }
8954
8955    /// Sets or clears the value of [create_time][crate::model::Object::create_time].
8956    ///
8957    /// # Example
8958    /// ```ignore,no_run
8959    /// # use google_cloud_storage::model::Object;
8960    /// use wkt::Timestamp;
8961    /// let x = Object::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8962    /// let x = Object::new().set_or_clear_create_time(None::<Timestamp>);
8963    /// ```
8964    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8965    where
8966        T: std::convert::Into<wkt::Timestamp>,
8967    {
8968        self.create_time = v.map(|x| x.into());
8969        self
8970    }
8971
8972    /// Sets the value of [component_count][crate::model::Object::component_count].
8973    ///
8974    /// # Example
8975    /// ```ignore,no_run
8976    /// # use google_cloud_storage::model::Object;
8977    /// let x = Object::new().set_component_count(42);
8978    /// ```
8979    pub fn set_component_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8980        self.component_count = v.into();
8981        self
8982    }
8983
8984    /// Sets the value of [checksums][crate::model::Object::checksums].
8985    ///
8986    /// # Example
8987    /// ```ignore,no_run
8988    /// # use google_cloud_storage::model::Object;
8989    /// use google_cloud_storage::model::ObjectChecksums;
8990    /// let x = Object::new().set_checksums(ObjectChecksums::default()/* use setters */);
8991    /// ```
8992    pub fn set_checksums<T>(mut self, v: T) -> Self
8993    where
8994        T: std::convert::Into<crate::model::ObjectChecksums>,
8995    {
8996        self.checksums = std::option::Option::Some(v.into());
8997        self
8998    }
8999
9000    /// Sets or clears the value of [checksums][crate::model::Object::checksums].
9001    ///
9002    /// # Example
9003    /// ```ignore,no_run
9004    /// # use google_cloud_storage::model::Object;
9005    /// use google_cloud_storage::model::ObjectChecksums;
9006    /// let x = Object::new().set_or_clear_checksums(Some(ObjectChecksums::default()/* use setters */));
9007    /// let x = Object::new().set_or_clear_checksums(None::<ObjectChecksums>);
9008    /// ```
9009    pub fn set_or_clear_checksums<T>(mut self, v: std::option::Option<T>) -> Self
9010    where
9011        T: std::convert::Into<crate::model::ObjectChecksums>,
9012    {
9013        self.checksums = v.map(|x| x.into());
9014        self
9015    }
9016
9017    /// Sets the value of [update_time][crate::model::Object::update_time].
9018    ///
9019    /// # Example
9020    /// ```ignore,no_run
9021    /// # use google_cloud_storage::model::Object;
9022    /// use wkt::Timestamp;
9023    /// let x = Object::new().set_update_time(Timestamp::default()/* use setters */);
9024    /// ```
9025    pub fn set_update_time<T>(mut self, v: T) -> Self
9026    where
9027        T: std::convert::Into<wkt::Timestamp>,
9028    {
9029        self.update_time = std::option::Option::Some(v.into());
9030        self
9031    }
9032
9033    /// Sets or clears the value of [update_time][crate::model::Object::update_time].
9034    ///
9035    /// # Example
9036    /// ```ignore,no_run
9037    /// # use google_cloud_storage::model::Object;
9038    /// use wkt::Timestamp;
9039    /// let x = Object::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9040    /// let x = Object::new().set_or_clear_update_time(None::<Timestamp>);
9041    /// ```
9042    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9043    where
9044        T: std::convert::Into<wkt::Timestamp>,
9045    {
9046        self.update_time = v.map(|x| x.into());
9047        self
9048    }
9049
9050    /// Sets the value of [kms_key][crate::model::Object::kms_key].
9051    ///
9052    /// # Example
9053    /// ```ignore,no_run
9054    /// # use google_cloud_storage::model::Object;
9055    /// let x = Object::new().set_kms_key("example");
9056    /// ```
9057    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9058        self.kms_key = v.into();
9059        self
9060    }
9061
9062    /// Sets the value of [update_storage_class_time][crate::model::Object::update_storage_class_time].
9063    ///
9064    /// # Example
9065    /// ```ignore,no_run
9066    /// # use google_cloud_storage::model::Object;
9067    /// use wkt::Timestamp;
9068    /// let x = Object::new().set_update_storage_class_time(Timestamp::default()/* use setters */);
9069    /// ```
9070    pub fn set_update_storage_class_time<T>(mut self, v: T) -> Self
9071    where
9072        T: std::convert::Into<wkt::Timestamp>,
9073    {
9074        self.update_storage_class_time = std::option::Option::Some(v.into());
9075        self
9076    }
9077
9078    /// Sets or clears the value of [update_storage_class_time][crate::model::Object::update_storage_class_time].
9079    ///
9080    /// # Example
9081    /// ```ignore,no_run
9082    /// # use google_cloud_storage::model::Object;
9083    /// use wkt::Timestamp;
9084    /// let x = Object::new().set_or_clear_update_storage_class_time(Some(Timestamp::default()/* use setters */));
9085    /// let x = Object::new().set_or_clear_update_storage_class_time(None::<Timestamp>);
9086    /// ```
9087    pub fn set_or_clear_update_storage_class_time<T>(mut self, v: std::option::Option<T>) -> Self
9088    where
9089        T: std::convert::Into<wkt::Timestamp>,
9090    {
9091        self.update_storage_class_time = v.map(|x| x.into());
9092        self
9093    }
9094
9095    /// Sets the value of [temporary_hold][crate::model::Object::temporary_hold].
9096    ///
9097    /// # Example
9098    /// ```ignore,no_run
9099    /// # use google_cloud_storage::model::Object;
9100    /// let x = Object::new().set_temporary_hold(true);
9101    /// ```
9102    pub fn set_temporary_hold<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9103        self.temporary_hold = v.into();
9104        self
9105    }
9106
9107    /// Sets the value of [retention_expire_time][crate::model::Object::retention_expire_time].
9108    ///
9109    /// # Example
9110    /// ```ignore,no_run
9111    /// # use google_cloud_storage::model::Object;
9112    /// use wkt::Timestamp;
9113    /// let x = Object::new().set_retention_expire_time(Timestamp::default()/* use setters */);
9114    /// ```
9115    pub fn set_retention_expire_time<T>(mut self, v: T) -> Self
9116    where
9117        T: std::convert::Into<wkt::Timestamp>,
9118    {
9119        self.retention_expire_time = std::option::Option::Some(v.into());
9120        self
9121    }
9122
9123    /// Sets or clears the value of [retention_expire_time][crate::model::Object::retention_expire_time].
9124    ///
9125    /// # Example
9126    /// ```ignore,no_run
9127    /// # use google_cloud_storage::model::Object;
9128    /// use wkt::Timestamp;
9129    /// let x = Object::new().set_or_clear_retention_expire_time(Some(Timestamp::default()/* use setters */));
9130    /// let x = Object::new().set_or_clear_retention_expire_time(None::<Timestamp>);
9131    /// ```
9132    pub fn set_or_clear_retention_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
9133    where
9134        T: std::convert::Into<wkt::Timestamp>,
9135    {
9136        self.retention_expire_time = v.map(|x| x.into());
9137        self
9138    }
9139
9140    /// Sets the value of [metadata][crate::model::Object::metadata].
9141    ///
9142    /// # Example
9143    /// ```ignore,no_run
9144    /// # use google_cloud_storage::model::Object;
9145    /// let x = Object::new().set_metadata([
9146    ///     ("key0", "abc"),
9147    ///     ("key1", "xyz"),
9148    /// ]);
9149    /// ```
9150    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
9151    where
9152        T: std::iter::IntoIterator<Item = (K, V)>,
9153        K: std::convert::Into<std::string::String>,
9154        V: std::convert::Into<std::string::String>,
9155    {
9156        use std::iter::Iterator;
9157        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9158        self
9159    }
9160
9161    /// Sets the value of [contexts][crate::model::Object::contexts].
9162    ///
9163    /// # Example
9164    /// ```ignore,no_run
9165    /// # use google_cloud_storage::model::Object;
9166    /// use google_cloud_storage::model::ObjectContexts;
9167    /// let x = Object::new().set_contexts(ObjectContexts::default()/* use setters */);
9168    /// ```
9169    pub fn set_contexts<T>(mut self, v: T) -> Self
9170    where
9171        T: std::convert::Into<crate::model::ObjectContexts>,
9172    {
9173        self.contexts = std::option::Option::Some(v.into());
9174        self
9175    }
9176
9177    /// Sets or clears the value of [contexts][crate::model::Object::contexts].
9178    ///
9179    /// # Example
9180    /// ```ignore,no_run
9181    /// # use google_cloud_storage::model::Object;
9182    /// use google_cloud_storage::model::ObjectContexts;
9183    /// let x = Object::new().set_or_clear_contexts(Some(ObjectContexts::default()/* use setters */));
9184    /// let x = Object::new().set_or_clear_contexts(None::<ObjectContexts>);
9185    /// ```
9186    pub fn set_or_clear_contexts<T>(mut self, v: std::option::Option<T>) -> Self
9187    where
9188        T: std::convert::Into<crate::model::ObjectContexts>,
9189    {
9190        self.contexts = v.map(|x| x.into());
9191        self
9192    }
9193
9194    /// Sets the value of [event_based_hold][crate::model::Object::event_based_hold].
9195    ///
9196    /// # Example
9197    /// ```ignore,no_run
9198    /// # use google_cloud_storage::model::Object;
9199    /// let x = Object::new().set_event_based_hold(true);
9200    /// ```
9201    pub fn set_event_based_hold<T>(mut self, v: T) -> Self
9202    where
9203        T: std::convert::Into<bool>,
9204    {
9205        self.event_based_hold = std::option::Option::Some(v.into());
9206        self
9207    }
9208
9209    /// Sets or clears the value of [event_based_hold][crate::model::Object::event_based_hold].
9210    ///
9211    /// # Example
9212    /// ```ignore,no_run
9213    /// # use google_cloud_storage::model::Object;
9214    /// let x = Object::new().set_or_clear_event_based_hold(Some(false));
9215    /// let x = Object::new().set_or_clear_event_based_hold(None::<bool>);
9216    /// ```
9217    pub fn set_or_clear_event_based_hold<T>(mut self, v: std::option::Option<T>) -> Self
9218    where
9219        T: std::convert::Into<bool>,
9220    {
9221        self.event_based_hold = v.map(|x| x.into());
9222        self
9223    }
9224
9225    /// Sets the value of [owner][crate::model::Object::owner].
9226    ///
9227    /// # Example
9228    /// ```ignore,no_run
9229    /// # use google_cloud_storage::model::Object;
9230    /// use google_cloud_storage::model::Owner;
9231    /// let x = Object::new().set_owner(Owner::default()/* use setters */);
9232    /// ```
9233    pub fn set_owner<T>(mut self, v: T) -> Self
9234    where
9235        T: std::convert::Into<crate::model::Owner>,
9236    {
9237        self.owner = std::option::Option::Some(v.into());
9238        self
9239    }
9240
9241    /// Sets or clears the value of [owner][crate::model::Object::owner].
9242    ///
9243    /// # Example
9244    /// ```ignore,no_run
9245    /// # use google_cloud_storage::model::Object;
9246    /// use google_cloud_storage::model::Owner;
9247    /// let x = Object::new().set_or_clear_owner(Some(Owner::default()/* use setters */));
9248    /// let x = Object::new().set_or_clear_owner(None::<Owner>);
9249    /// ```
9250    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
9251    where
9252        T: std::convert::Into<crate::model::Owner>,
9253    {
9254        self.owner = v.map(|x| x.into());
9255        self
9256    }
9257
9258    /// Sets the value of [customer_encryption][crate::model::Object::customer_encryption].
9259    ///
9260    /// # Example
9261    /// ```ignore,no_run
9262    /// # use google_cloud_storage::model::Object;
9263    /// use google_cloud_storage::model::CustomerEncryption;
9264    /// let x = Object::new().set_customer_encryption(CustomerEncryption::default()/* use setters */);
9265    /// ```
9266    pub fn set_customer_encryption<T>(mut self, v: T) -> Self
9267    where
9268        T: std::convert::Into<crate::model::CustomerEncryption>,
9269    {
9270        self.customer_encryption = std::option::Option::Some(v.into());
9271        self
9272    }
9273
9274    /// Sets or clears the value of [customer_encryption][crate::model::Object::customer_encryption].
9275    ///
9276    /// # Example
9277    /// ```ignore,no_run
9278    /// # use google_cloud_storage::model::Object;
9279    /// use google_cloud_storage::model::CustomerEncryption;
9280    /// let x = Object::new().set_or_clear_customer_encryption(Some(CustomerEncryption::default()/* use setters */));
9281    /// let x = Object::new().set_or_clear_customer_encryption(None::<CustomerEncryption>);
9282    /// ```
9283    pub fn set_or_clear_customer_encryption<T>(mut self, v: std::option::Option<T>) -> Self
9284    where
9285        T: std::convert::Into<crate::model::CustomerEncryption>,
9286    {
9287        self.customer_encryption = v.map(|x| x.into());
9288        self
9289    }
9290
9291    /// Sets the value of [custom_time][crate::model::Object::custom_time].
9292    ///
9293    /// # Example
9294    /// ```ignore,no_run
9295    /// # use google_cloud_storage::model::Object;
9296    /// use wkt::Timestamp;
9297    /// let x = Object::new().set_custom_time(Timestamp::default()/* use setters */);
9298    /// ```
9299    pub fn set_custom_time<T>(mut self, v: T) -> Self
9300    where
9301        T: std::convert::Into<wkt::Timestamp>,
9302    {
9303        self.custom_time = std::option::Option::Some(v.into());
9304        self
9305    }
9306
9307    /// Sets or clears the value of [custom_time][crate::model::Object::custom_time].
9308    ///
9309    /// # Example
9310    /// ```ignore,no_run
9311    /// # use google_cloud_storage::model::Object;
9312    /// use wkt::Timestamp;
9313    /// let x = Object::new().set_or_clear_custom_time(Some(Timestamp::default()/* use setters */));
9314    /// let x = Object::new().set_or_clear_custom_time(None::<Timestamp>);
9315    /// ```
9316    pub fn set_or_clear_custom_time<T>(mut self, v: std::option::Option<T>) -> Self
9317    where
9318        T: std::convert::Into<wkt::Timestamp>,
9319    {
9320        self.custom_time = v.map(|x| x.into());
9321        self
9322    }
9323
9324    /// Sets the value of [soft_delete_time][crate::model::Object::soft_delete_time].
9325    ///
9326    /// # Example
9327    /// ```ignore,no_run
9328    /// # use google_cloud_storage::model::Object;
9329    /// use wkt::Timestamp;
9330    /// let x = Object::new().set_soft_delete_time(Timestamp::default()/* use setters */);
9331    /// ```
9332    pub fn set_soft_delete_time<T>(mut self, v: T) -> Self
9333    where
9334        T: std::convert::Into<wkt::Timestamp>,
9335    {
9336        self.soft_delete_time = std::option::Option::Some(v.into());
9337        self
9338    }
9339
9340    /// Sets or clears the value of [soft_delete_time][crate::model::Object::soft_delete_time].
9341    ///
9342    /// # Example
9343    /// ```ignore,no_run
9344    /// # use google_cloud_storage::model::Object;
9345    /// use wkt::Timestamp;
9346    /// let x = Object::new().set_or_clear_soft_delete_time(Some(Timestamp::default()/* use setters */));
9347    /// let x = Object::new().set_or_clear_soft_delete_time(None::<Timestamp>);
9348    /// ```
9349    pub fn set_or_clear_soft_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
9350    where
9351        T: std::convert::Into<wkt::Timestamp>,
9352    {
9353        self.soft_delete_time = v.map(|x| x.into());
9354        self
9355    }
9356
9357    /// Sets the value of [hard_delete_time][crate::model::Object::hard_delete_time].
9358    ///
9359    /// # Example
9360    /// ```ignore,no_run
9361    /// # use google_cloud_storage::model::Object;
9362    /// use wkt::Timestamp;
9363    /// let x = Object::new().set_hard_delete_time(Timestamp::default()/* use setters */);
9364    /// ```
9365    pub fn set_hard_delete_time<T>(mut self, v: T) -> Self
9366    where
9367        T: std::convert::Into<wkt::Timestamp>,
9368    {
9369        self.hard_delete_time = std::option::Option::Some(v.into());
9370        self
9371    }
9372
9373    /// Sets or clears the value of [hard_delete_time][crate::model::Object::hard_delete_time].
9374    ///
9375    /// # Example
9376    /// ```ignore,no_run
9377    /// # use google_cloud_storage::model::Object;
9378    /// use wkt::Timestamp;
9379    /// let x = Object::new().set_or_clear_hard_delete_time(Some(Timestamp::default()/* use setters */));
9380    /// let x = Object::new().set_or_clear_hard_delete_time(None::<Timestamp>);
9381    /// ```
9382    pub fn set_or_clear_hard_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
9383    where
9384        T: std::convert::Into<wkt::Timestamp>,
9385    {
9386        self.hard_delete_time = v.map(|x| x.into());
9387        self
9388    }
9389
9390    /// Sets the value of [retention][crate::model::Object::retention].
9391    ///
9392    /// # Example
9393    /// ```ignore,no_run
9394    /// # use google_cloud_storage::model::Object;
9395    /// use google_cloud_storage::model::object::Retention;
9396    /// let x = Object::new().set_retention(Retention::default()/* use setters */);
9397    /// ```
9398    pub fn set_retention<T>(mut self, v: T) -> Self
9399    where
9400        T: std::convert::Into<crate::model::object::Retention>,
9401    {
9402        self.retention = std::option::Option::Some(v.into());
9403        self
9404    }
9405
9406    /// Sets or clears the value of [retention][crate::model::Object::retention].
9407    ///
9408    /// # Example
9409    /// ```ignore,no_run
9410    /// # use google_cloud_storage::model::Object;
9411    /// use google_cloud_storage::model::object::Retention;
9412    /// let x = Object::new().set_or_clear_retention(Some(Retention::default()/* use setters */));
9413    /// let x = Object::new().set_or_clear_retention(None::<Retention>);
9414    /// ```
9415    pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
9416    where
9417        T: std::convert::Into<crate::model::object::Retention>,
9418    {
9419        self.retention = v.map(|x| x.into());
9420        self
9421    }
9422}
9423
9424impl wkt::message::Message for Object {
9425    fn typename() -> &'static str {
9426        "type.googleapis.com/google.storage.v2.Object"
9427    }
9428}
9429
9430/// Defines additional types related to [Object].
9431pub mod object {
9432    #[allow(unused_imports)]
9433    use super::*;
9434
9435    /// Specifies retention parameters of the object. Objects under retention
9436    /// cannot be deleted or overwritten until their retention expires.
9437    #[derive(Clone, Default, PartialEq)]
9438    #[non_exhaustive]
9439    pub struct Retention {
9440        /// Optional. The mode of the Retention.
9441        pub mode: crate::model::object::retention::Mode,
9442
9443        /// Optional. The timestamp that the object needs to be retained until.
9444        /// Value cannot be set in the past or more than 100 years in the future.
9445        pub retain_until_time: std::option::Option<wkt::Timestamp>,
9446
9447        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9448    }
9449
9450    impl Retention {
9451        pub fn new() -> Self {
9452            std::default::Default::default()
9453        }
9454
9455        /// Sets the value of [mode][crate::model::object::Retention::mode].
9456        ///
9457        /// # Example
9458        /// ```ignore,no_run
9459        /// # use google_cloud_storage::model::object::Retention;
9460        /// use google_cloud_storage::model::object::retention::Mode;
9461        /// let x0 = Retention::new().set_mode(Mode::Unlocked);
9462        /// let x1 = Retention::new().set_mode(Mode::Locked);
9463        /// ```
9464        pub fn set_mode<T: std::convert::Into<crate::model::object::retention::Mode>>(
9465            mut self,
9466            v: T,
9467        ) -> Self {
9468            self.mode = v.into();
9469            self
9470        }
9471
9472        /// Sets the value of [retain_until_time][crate::model::object::Retention::retain_until_time].
9473        ///
9474        /// # Example
9475        /// ```ignore,no_run
9476        /// # use google_cloud_storage::model::object::Retention;
9477        /// use wkt::Timestamp;
9478        /// let x = Retention::new().set_retain_until_time(Timestamp::default()/* use setters */);
9479        /// ```
9480        pub fn set_retain_until_time<T>(mut self, v: T) -> Self
9481        where
9482            T: std::convert::Into<wkt::Timestamp>,
9483        {
9484            self.retain_until_time = std::option::Option::Some(v.into());
9485            self
9486        }
9487
9488        /// Sets or clears the value of [retain_until_time][crate::model::object::Retention::retain_until_time].
9489        ///
9490        /// # Example
9491        /// ```ignore,no_run
9492        /// # use google_cloud_storage::model::object::Retention;
9493        /// use wkt::Timestamp;
9494        /// let x = Retention::new().set_or_clear_retain_until_time(Some(Timestamp::default()/* use setters */));
9495        /// let x = Retention::new().set_or_clear_retain_until_time(None::<Timestamp>);
9496        /// ```
9497        pub fn set_or_clear_retain_until_time<T>(mut self, v: std::option::Option<T>) -> Self
9498        where
9499            T: std::convert::Into<wkt::Timestamp>,
9500        {
9501            self.retain_until_time = v.map(|x| x.into());
9502            self
9503        }
9504    }
9505
9506    impl wkt::message::Message for Retention {
9507        fn typename() -> &'static str {
9508            "type.googleapis.com/google.storage.v2.Object.Retention"
9509        }
9510    }
9511
9512    /// Defines additional types related to [Retention].
9513    pub mod retention {
9514        #[allow(unused_imports)]
9515        use super::*;
9516
9517        /// Retention mode values.
9518        ///
9519        /// # Working with unknown values
9520        ///
9521        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9522        /// additional enum variants at any time. Adding new variants is not considered
9523        /// a breaking change. Applications should write their code in anticipation of:
9524        ///
9525        /// - New values appearing in future releases of the client library, **and**
9526        /// - New values received dynamically, without application changes.
9527        ///
9528        /// Please consult the [Working with enums] section in the user guide for some
9529        /// guidelines.
9530        ///
9531        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9532        #[derive(Clone, Debug, PartialEq)]
9533        #[non_exhaustive]
9534        pub enum Mode {
9535            /// No specified mode. Object is not under retention.
9536            Unspecified,
9537            /// Retention period might be decreased or increased.
9538            /// The Retention configuration might be removed.
9539            /// The mode might be changed to locked.
9540            Unlocked,
9541            /// Retention period might be increased.
9542            /// The Retention configuration cannot be removed.
9543            /// The mode cannot be changed.
9544            Locked,
9545            /// If set, the enum was initialized with an unknown value.
9546            ///
9547            /// Applications can examine the value using [Mode::value] or
9548            /// [Mode::name].
9549            UnknownValue(mode::UnknownValue),
9550        }
9551
9552        #[doc(hidden)]
9553        pub mod mode {
9554            #[allow(unused_imports)]
9555            use super::*;
9556            #[derive(Clone, Debug, PartialEq)]
9557            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9558        }
9559
9560        impl Mode {
9561            /// Gets the enum value.
9562            ///
9563            /// Returns `None` if the enum contains an unknown value deserialized from
9564            /// the string representation of enums.
9565            pub fn value(&self) -> std::option::Option<i32> {
9566                match self {
9567                    Self::Unspecified => std::option::Option::Some(0),
9568                    Self::Unlocked => std::option::Option::Some(1),
9569                    Self::Locked => std::option::Option::Some(2),
9570                    Self::UnknownValue(u) => u.0.value(),
9571                }
9572            }
9573
9574            /// Gets the enum value as a string.
9575            ///
9576            /// Returns `None` if the enum contains an unknown value deserialized from
9577            /// the integer representation of enums.
9578            pub fn name(&self) -> std::option::Option<&str> {
9579                match self {
9580                    Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
9581                    Self::Unlocked => std::option::Option::Some("UNLOCKED"),
9582                    Self::Locked => std::option::Option::Some("LOCKED"),
9583                    Self::UnknownValue(u) => u.0.name(),
9584                }
9585            }
9586        }
9587
9588        impl std::default::Default for Mode {
9589            fn default() -> Self {
9590                use std::convert::From;
9591                Self::from(0)
9592            }
9593        }
9594
9595        impl std::fmt::Display for Mode {
9596            fn fmt(
9597                &self,
9598                f: &mut std::fmt::Formatter<'_>,
9599            ) -> std::result::Result<(), std::fmt::Error> {
9600                wkt::internal::display_enum(f, self.name(), self.value())
9601            }
9602        }
9603
9604        impl std::convert::From<i32> for Mode {
9605            fn from(value: i32) -> Self {
9606                match value {
9607                    0 => Self::Unspecified,
9608                    1 => Self::Unlocked,
9609                    2 => Self::Locked,
9610                    _ => Self::UnknownValue(mode::UnknownValue(
9611                        wkt::internal::UnknownEnumValue::Integer(value),
9612                    )),
9613                }
9614            }
9615        }
9616
9617        impl std::convert::From<&str> for Mode {
9618            fn from(value: &str) -> Self {
9619                use std::string::ToString;
9620                match value {
9621                    "MODE_UNSPECIFIED" => Self::Unspecified,
9622                    "UNLOCKED" => Self::Unlocked,
9623                    "LOCKED" => Self::Locked,
9624                    _ => Self::UnknownValue(mode::UnknownValue(
9625                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9626                    )),
9627                }
9628            }
9629        }
9630
9631        impl serde::ser::Serialize for Mode {
9632            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9633            where
9634                S: serde::Serializer,
9635            {
9636                match self {
9637                    Self::Unspecified => serializer.serialize_i32(0),
9638                    Self::Unlocked => serializer.serialize_i32(1),
9639                    Self::Locked => serializer.serialize_i32(2),
9640                    Self::UnknownValue(u) => u.0.serialize(serializer),
9641                }
9642            }
9643        }
9644
9645        impl<'de> serde::de::Deserialize<'de> for Mode {
9646            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9647            where
9648                D: serde::Deserializer<'de>,
9649            {
9650                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
9651                    ".google.storage.v2.Object.Retention.Mode",
9652                ))
9653            }
9654        }
9655    }
9656}
9657
9658/// An access-control entry.
9659#[derive(Clone, Default, PartialEq)]
9660#[non_exhaustive]
9661pub struct ObjectAccessControl {
9662    /// Optional. The access permission for the entity. One of the following
9663    /// values:
9664    ///
9665    /// * `READER`
9666    /// * `WRITER`
9667    /// * `OWNER`
9668    pub role: std::string::String,
9669
9670    /// Optional. The ID of the access-control entry.
9671    pub id: std::string::String,
9672
9673    /// Optional. The entity holding the permission, in one of the following forms:
9674    ///
9675    /// * `user-{userid}`
9676    /// * `user-{email}`
9677    /// * `group-{groupid}`
9678    /// * `group-{email}`
9679    /// * `domain-{domain}`
9680    /// * `project-{team}-{projectnumber}`
9681    /// * `project-{team}-{projectid}`
9682    /// * `allUsers`
9683    /// * `allAuthenticatedUsers`
9684    ///   Examples:
9685    /// * The user `liz@example.com` would be `user-liz@example.com`.
9686    /// * The group `example@googlegroups.com` would be
9687    ///   `group-example@googlegroups.com`.
9688    /// * All members of the Google Apps for Business domain `example.com` would be
9689    ///   `domain-example.com`.
9690    ///   For project entities, `project-{team}-{projectnumber}` format is
9691    ///   returned in the response.
9692    pub entity: std::string::String,
9693
9694    /// Output only. The alternative entity format, if exists. For project
9695    /// entities, `project-{team}-{projectid}` format is returned in the response.
9696    pub entity_alt: std::string::String,
9697
9698    /// Optional. The ID for the entity, if any.
9699    pub entity_id: std::string::String,
9700
9701    /// Optional. The etag of the ObjectAccessControl.
9702    /// If included in the metadata of an update or delete request message, the
9703    /// operation is only performed if the etag matches that of the live
9704    /// object's ObjectAccessControl.
9705    pub etag: std::string::String,
9706
9707    /// Optional. The email address associated with the entity, if any.
9708    pub email: std::string::String,
9709
9710    /// Optional. The domain associated with the entity, if any.
9711    pub domain: std::string::String,
9712
9713    /// Optional. The project team associated with the entity, if any.
9714    pub project_team: std::option::Option<crate::model::ProjectTeam>,
9715
9716    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9717}
9718
9719impl ObjectAccessControl {
9720    pub fn new() -> Self {
9721        std::default::Default::default()
9722    }
9723
9724    /// Sets the value of [role][crate::model::ObjectAccessControl::role].
9725    ///
9726    /// # Example
9727    /// ```ignore,no_run
9728    /// # use google_cloud_storage::model::ObjectAccessControl;
9729    /// let x = ObjectAccessControl::new().set_role("example");
9730    /// ```
9731    pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9732        self.role = v.into();
9733        self
9734    }
9735
9736    /// Sets the value of [id][crate::model::ObjectAccessControl::id].
9737    ///
9738    /// # Example
9739    /// ```ignore,no_run
9740    /// # use google_cloud_storage::model::ObjectAccessControl;
9741    /// let x = ObjectAccessControl::new().set_id("example");
9742    /// ```
9743    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9744        self.id = v.into();
9745        self
9746    }
9747
9748    /// Sets the value of [entity][crate::model::ObjectAccessControl::entity].
9749    ///
9750    /// # Example
9751    /// ```ignore,no_run
9752    /// # use google_cloud_storage::model::ObjectAccessControl;
9753    /// let x = ObjectAccessControl::new().set_entity("example");
9754    /// ```
9755    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9756        self.entity = v.into();
9757        self
9758    }
9759
9760    /// Sets the value of [entity_alt][crate::model::ObjectAccessControl::entity_alt].
9761    ///
9762    /// # Example
9763    /// ```ignore,no_run
9764    /// # use google_cloud_storage::model::ObjectAccessControl;
9765    /// let x = ObjectAccessControl::new().set_entity_alt("example");
9766    /// ```
9767    pub fn set_entity_alt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9768        self.entity_alt = v.into();
9769        self
9770    }
9771
9772    /// Sets the value of [entity_id][crate::model::ObjectAccessControl::entity_id].
9773    ///
9774    /// # Example
9775    /// ```ignore,no_run
9776    /// # use google_cloud_storage::model::ObjectAccessControl;
9777    /// let x = ObjectAccessControl::new().set_entity_id("example");
9778    /// ```
9779    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9780        self.entity_id = v.into();
9781        self
9782    }
9783
9784    /// Sets the value of [etag][crate::model::ObjectAccessControl::etag].
9785    ///
9786    /// # Example
9787    /// ```ignore,no_run
9788    /// # use google_cloud_storage::model::ObjectAccessControl;
9789    /// let x = ObjectAccessControl::new().set_etag("example");
9790    /// ```
9791    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9792        self.etag = v.into();
9793        self
9794    }
9795
9796    /// Sets the value of [email][crate::model::ObjectAccessControl::email].
9797    ///
9798    /// # Example
9799    /// ```ignore,no_run
9800    /// # use google_cloud_storage::model::ObjectAccessControl;
9801    /// let x = ObjectAccessControl::new().set_email("example");
9802    /// ```
9803    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9804        self.email = v.into();
9805        self
9806    }
9807
9808    /// Sets the value of [domain][crate::model::ObjectAccessControl::domain].
9809    ///
9810    /// # Example
9811    /// ```ignore,no_run
9812    /// # use google_cloud_storage::model::ObjectAccessControl;
9813    /// let x = ObjectAccessControl::new().set_domain("example");
9814    /// ```
9815    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9816        self.domain = v.into();
9817        self
9818    }
9819
9820    /// Sets the value of [project_team][crate::model::ObjectAccessControl::project_team].
9821    ///
9822    /// # Example
9823    /// ```ignore,no_run
9824    /// # use google_cloud_storage::model::ObjectAccessControl;
9825    /// use google_cloud_storage::model::ProjectTeam;
9826    /// let x = ObjectAccessControl::new().set_project_team(ProjectTeam::default()/* use setters */);
9827    /// ```
9828    pub fn set_project_team<T>(mut self, v: T) -> Self
9829    where
9830        T: std::convert::Into<crate::model::ProjectTeam>,
9831    {
9832        self.project_team = std::option::Option::Some(v.into());
9833        self
9834    }
9835
9836    /// Sets or clears the value of [project_team][crate::model::ObjectAccessControl::project_team].
9837    ///
9838    /// # Example
9839    /// ```ignore,no_run
9840    /// # use google_cloud_storage::model::ObjectAccessControl;
9841    /// use google_cloud_storage::model::ProjectTeam;
9842    /// let x = ObjectAccessControl::new().set_or_clear_project_team(Some(ProjectTeam::default()/* use setters */));
9843    /// let x = ObjectAccessControl::new().set_or_clear_project_team(None::<ProjectTeam>);
9844    /// ```
9845    pub fn set_or_clear_project_team<T>(mut self, v: std::option::Option<T>) -> Self
9846    where
9847        T: std::convert::Into<crate::model::ProjectTeam>,
9848    {
9849        self.project_team = v.map(|x| x.into());
9850        self
9851    }
9852}
9853
9854impl wkt::message::Message for ObjectAccessControl {
9855    fn typename() -> &'static str {
9856        "type.googleapis.com/google.storage.v2.ObjectAccessControl"
9857    }
9858}
9859
9860/// The result of a call to Objects.ListObjects
9861#[derive(Clone, Default, PartialEq)]
9862#[non_exhaustive]
9863pub struct ListObjectsResponse {
9864    /// The list of items.
9865    pub objects: std::vec::Vec<crate::model::Object>,
9866
9867    /// The list of prefixes of objects matching-but-not-listed up to and including
9868    /// the requested delimiter.
9869    pub prefixes: std::vec::Vec<std::string::String>,
9870
9871    /// The continuation token, used to page through large result sets. Provide
9872    /// this value in a subsequent request to return the next page of results.
9873    pub next_page_token: std::string::String,
9874
9875    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9876}
9877
9878impl ListObjectsResponse {
9879    pub fn new() -> Self {
9880        std::default::Default::default()
9881    }
9882
9883    /// Sets the value of [objects][crate::model::ListObjectsResponse::objects].
9884    ///
9885    /// # Example
9886    /// ```ignore,no_run
9887    /// # use google_cloud_storage::model::ListObjectsResponse;
9888    /// use google_cloud_storage::model::Object;
9889    /// let x = ListObjectsResponse::new()
9890    ///     .set_objects([
9891    ///         Object::default()/* use setters */,
9892    ///         Object::default()/* use (different) setters */,
9893    ///     ]);
9894    /// ```
9895    pub fn set_objects<T, V>(mut self, v: T) -> Self
9896    where
9897        T: std::iter::IntoIterator<Item = V>,
9898        V: std::convert::Into<crate::model::Object>,
9899    {
9900        use std::iter::Iterator;
9901        self.objects = v.into_iter().map(|i| i.into()).collect();
9902        self
9903    }
9904
9905    /// Sets the value of [prefixes][crate::model::ListObjectsResponse::prefixes].
9906    ///
9907    /// # Example
9908    /// ```ignore,no_run
9909    /// # use google_cloud_storage::model::ListObjectsResponse;
9910    /// let x = ListObjectsResponse::new().set_prefixes(["a", "b", "c"]);
9911    /// ```
9912    pub fn set_prefixes<T, V>(mut self, v: T) -> Self
9913    where
9914        T: std::iter::IntoIterator<Item = V>,
9915        V: std::convert::Into<std::string::String>,
9916    {
9917        use std::iter::Iterator;
9918        self.prefixes = v.into_iter().map(|i| i.into()).collect();
9919        self
9920    }
9921
9922    /// Sets the value of [next_page_token][crate::model::ListObjectsResponse::next_page_token].
9923    ///
9924    /// # Example
9925    /// ```ignore,no_run
9926    /// # use google_cloud_storage::model::ListObjectsResponse;
9927    /// let x = ListObjectsResponse::new().set_next_page_token("example");
9928    /// ```
9929    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9930        self.next_page_token = v.into();
9931        self
9932    }
9933}
9934
9935impl wkt::message::Message for ListObjectsResponse {
9936    fn typename() -> &'static str {
9937        "type.googleapis.com/google.storage.v2.ListObjectsResponse"
9938    }
9939}
9940
9941#[doc(hidden)]
9942impl google_cloud_gax::paginator::internal::PageableResponse for ListObjectsResponse {
9943    type PageItem = crate::model::Object;
9944
9945    fn items(self) -> std::vec::Vec<Self::PageItem> {
9946        self.objects
9947    }
9948
9949    fn next_page_token(&self) -> std::string::String {
9950        use std::clone::Clone;
9951        self.next_page_token.clone()
9952    }
9953}
9954
9955/// Represents the Viewers, Editors, or Owners of a given project.
9956#[derive(Clone, Default, PartialEq)]
9957#[non_exhaustive]
9958pub struct ProjectTeam {
9959    /// Optional. The project number.
9960    pub project_number: std::string::String,
9961
9962    /// Optional. The team.
9963    pub team: std::string::String,
9964
9965    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9966}
9967
9968impl ProjectTeam {
9969    pub fn new() -> Self {
9970        std::default::Default::default()
9971    }
9972
9973    /// Sets the value of [project_number][crate::model::ProjectTeam::project_number].
9974    ///
9975    /// # Example
9976    /// ```ignore,no_run
9977    /// # use google_cloud_storage::model::ProjectTeam;
9978    /// let x = ProjectTeam::new().set_project_number("example");
9979    /// ```
9980    pub fn set_project_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9981        self.project_number = v.into();
9982        self
9983    }
9984
9985    /// Sets the value of [team][crate::model::ProjectTeam::team].
9986    ///
9987    /// # Example
9988    /// ```ignore,no_run
9989    /// # use google_cloud_storage::model::ProjectTeam;
9990    /// let x = ProjectTeam::new().set_team("example");
9991    /// ```
9992    pub fn set_team<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9993        self.team = v.into();
9994        self
9995    }
9996}
9997
9998impl wkt::message::Message for ProjectTeam {
9999    fn typename() -> &'static str {
10000        "type.googleapis.com/google.storage.v2.ProjectTeam"
10001    }
10002}
10003
10004/// The owner of a specific resource.
10005#[derive(Clone, Default, PartialEq)]
10006#[non_exhaustive]
10007pub struct Owner {
10008    /// Optional. The entity, in the form `user-`*userId*.
10009    pub entity: std::string::String,
10010
10011    /// Optional. The ID for the entity.
10012    pub entity_id: std::string::String,
10013
10014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10015}
10016
10017impl Owner {
10018    pub fn new() -> Self {
10019        std::default::Default::default()
10020    }
10021
10022    /// Sets the value of [entity][crate::model::Owner::entity].
10023    ///
10024    /// # Example
10025    /// ```ignore,no_run
10026    /// # use google_cloud_storage::model::Owner;
10027    /// let x = Owner::new().set_entity("example");
10028    /// ```
10029    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10030        self.entity = v.into();
10031        self
10032    }
10033
10034    /// Sets the value of [entity_id][crate::model::Owner::entity_id].
10035    ///
10036    /// # Example
10037    /// ```ignore,no_run
10038    /// # use google_cloud_storage::model::Owner;
10039    /// let x = Owner::new().set_entity_id("example");
10040    /// ```
10041    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10042        self.entity_id = v.into();
10043        self
10044    }
10045}
10046
10047impl wkt::message::Message for Owner {
10048    fn typename() -> &'static str {
10049        "type.googleapis.com/google.storage.v2.Owner"
10050    }
10051}