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.
25#[derive(Clone, Default, PartialEq)]
26#[non_exhaustive]
27pub struct DeleteBucketRequest {
28    /// Required. Name of a bucket to delete.
29    pub name: std::string::String,
30
31    /// If set, only deletes the bucket if its metageneration matches this value.
32    pub if_metageneration_match: std::option::Option<i64>,
33
34    /// If set, only deletes the bucket if its metageneration does not match this
35    /// value.
36    pub if_metageneration_not_match: std::option::Option<i64>,
37
38    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
39}
40
41impl DeleteBucketRequest {
42    pub fn new() -> Self {
43        std::default::Default::default()
44    }
45
46    /// Sets the value of [name][crate::model::DeleteBucketRequest::name].
47    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
48        self.name = v.into();
49        self
50    }
51
52    /// Sets the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
53    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
54    where
55        T: std::convert::Into<i64>,
56    {
57        self.if_metageneration_match = std::option::Option::Some(v.into());
58        self
59    }
60
61    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
62    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
63    where
64        T: std::convert::Into<i64>,
65    {
66        self.if_metageneration_match = v.map(|x| x.into());
67        self
68    }
69
70    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
71    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
72    where
73        T: std::convert::Into<i64>,
74    {
75        self.if_metageneration_not_match = std::option::Option::Some(v.into());
76        self
77    }
78
79    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
80    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
81    where
82        T: std::convert::Into<i64>,
83    {
84        self.if_metageneration_not_match = v.map(|x| x.into());
85        self
86    }
87}
88
89impl wkt::message::Message for DeleteBucketRequest {
90    fn typename() -> &'static str {
91        "type.googleapis.com/google.storage.v2.DeleteBucketRequest"
92    }
93}
94
95/// Request message for GetBucket.
96#[derive(Clone, Default, PartialEq)]
97#[non_exhaustive]
98pub struct GetBucketRequest {
99    /// Required. Name of a bucket.
100    pub name: std::string::String,
101
102    /// If set, and if the bucket's current metageneration does not match the
103    /// specified value, the request will return an error.
104    pub if_metageneration_match: std::option::Option<i64>,
105
106    /// If set, and if the bucket's current metageneration matches the specified
107    /// value, the request will return an error.
108    pub if_metageneration_not_match: std::option::Option<i64>,
109
110    /// Mask specifying which fields to read.
111    /// A "*" field may be used to indicate all fields.
112    /// If no mask is specified, will default to all fields.
113    pub read_mask: std::option::Option<wkt::FieldMask>,
114
115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
116}
117
118impl GetBucketRequest {
119    pub fn new() -> Self {
120        std::default::Default::default()
121    }
122
123    /// Sets the value of [name][crate::model::GetBucketRequest::name].
124    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
125        self.name = v.into();
126        self
127    }
128
129    /// Sets the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
130    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
131    where
132        T: std::convert::Into<i64>,
133    {
134        self.if_metageneration_match = std::option::Option::Some(v.into());
135        self
136    }
137
138    /// Sets or clears the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
139    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
140    where
141        T: std::convert::Into<i64>,
142    {
143        self.if_metageneration_match = v.map(|x| x.into());
144        self
145    }
146
147    /// Sets the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
148    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
149    where
150        T: std::convert::Into<i64>,
151    {
152        self.if_metageneration_not_match = std::option::Option::Some(v.into());
153        self
154    }
155
156    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
157    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
158    where
159        T: std::convert::Into<i64>,
160    {
161        self.if_metageneration_not_match = v.map(|x| x.into());
162        self
163    }
164
165    /// Sets the value of [read_mask][crate::model::GetBucketRequest::read_mask].
166    pub fn set_read_mask<T>(mut self, v: T) -> Self
167    where
168        T: std::convert::Into<wkt::FieldMask>,
169    {
170        self.read_mask = std::option::Option::Some(v.into());
171        self
172    }
173
174    /// Sets or clears the value of [read_mask][crate::model::GetBucketRequest::read_mask].
175    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
176    where
177        T: std::convert::Into<wkt::FieldMask>,
178    {
179        self.read_mask = v.map(|x| x.into());
180        self
181    }
182}
183
184impl wkt::message::Message for GetBucketRequest {
185    fn typename() -> &'static str {
186        "type.googleapis.com/google.storage.v2.GetBucketRequest"
187    }
188}
189
190/// Request message for CreateBucket.
191#[derive(Clone, Default, PartialEq)]
192#[non_exhaustive]
193pub struct CreateBucketRequest {
194    /// Required. The project to which this bucket will belong. This field must
195    /// either be empty or `projects/_`. The project ID that owns this bucket
196    /// should be specified in the `bucket.project` field.
197    pub parent: std::string::String,
198
199    /// Optional. Properties of the new bucket being inserted.
200    /// The name of the bucket is specified in the `bucket_id` field. Populating
201    /// `bucket.name` field will result in an error.
202    /// The project of the bucket must be specified in the `bucket.project` field.
203    /// This field must be in `projects/{projectIdentifier}` format,
204    /// {projectIdentifier} can be the project ID or project number. The `parent`
205    /// field must be either empty or `projects/_`.
206    pub bucket: std::option::Option<crate::model::Bucket>,
207
208    /// Required. The ID to use for this bucket, which will become the final
209    /// component of the bucket's resource name. For example, the value `foo` might
210    /// result in a bucket with the name `projects/123456/buckets/foo`.
211    pub bucket_id: std::string::String,
212
213    /// Optional. Apply a predefined set of access controls to this bucket.
214    /// Valid values are "authenticatedRead", "private", "projectPrivate",
215    /// "publicRead", or "publicReadWrite".
216    pub predefined_acl: std::string::String,
217
218    /// Optional. Apply a predefined set of default object access controls to this
219    /// bucket. Valid values are "authenticatedRead", "bucketOwnerFullControl",
220    /// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
221    pub predefined_default_object_acl: std::string::String,
222
223    /// Optional. If true, enable object retention on the bucket.
224    pub enable_object_retention: bool,
225
226    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
227}
228
229impl CreateBucketRequest {
230    pub fn new() -> Self {
231        std::default::Default::default()
232    }
233
234    /// Sets the value of [parent][crate::model::CreateBucketRequest::parent].
235    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
236        self.parent = v.into();
237        self
238    }
239
240    /// Sets the value of [bucket][crate::model::CreateBucketRequest::bucket].
241    pub fn set_bucket<T>(mut self, v: T) -> Self
242    where
243        T: std::convert::Into<crate::model::Bucket>,
244    {
245        self.bucket = std::option::Option::Some(v.into());
246        self
247    }
248
249    /// Sets or clears the value of [bucket][crate::model::CreateBucketRequest::bucket].
250    pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
251    where
252        T: std::convert::Into<crate::model::Bucket>,
253    {
254        self.bucket = v.map(|x| x.into());
255        self
256    }
257
258    /// Sets the value of [bucket_id][crate::model::CreateBucketRequest::bucket_id].
259    pub fn set_bucket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
260        self.bucket_id = v.into();
261        self
262    }
263
264    /// Sets the value of [predefined_acl][crate::model::CreateBucketRequest::predefined_acl].
265    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
266        self.predefined_acl = v.into();
267        self
268    }
269
270    /// Sets the value of [predefined_default_object_acl][crate::model::CreateBucketRequest::predefined_default_object_acl].
271    pub fn set_predefined_default_object_acl<T: std::convert::Into<std::string::String>>(
272        mut self,
273        v: T,
274    ) -> Self {
275        self.predefined_default_object_acl = v.into();
276        self
277    }
278
279    /// Sets the value of [enable_object_retention][crate::model::CreateBucketRequest::enable_object_retention].
280    pub fn set_enable_object_retention<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
281        self.enable_object_retention = v.into();
282        self
283    }
284}
285
286impl wkt::message::Message for CreateBucketRequest {
287    fn typename() -> &'static str {
288        "type.googleapis.com/google.storage.v2.CreateBucketRequest"
289    }
290}
291
292/// Request message for ListBuckets.
293#[derive(Clone, Default, PartialEq)]
294#[non_exhaustive]
295pub struct ListBucketsRequest {
296    /// Required. The project whose buckets we are listing.
297    pub parent: std::string::String,
298
299    /// Optional. Maximum number of buckets to return in a single response. The
300    /// service will use this parameter or 1,000 items, whichever is smaller. If
301    /// "acl" is present in the read_mask, the service will use this parameter of
302    /// 200 items, whichever is smaller.
303    pub page_size: i32,
304
305    /// Optional. A previously-returned page token representing part of the larger
306    /// set of results to view.
307    pub page_token: std::string::String,
308
309    /// Optional. Filter results to buckets whose names begin with this prefix.
310    pub prefix: std::string::String,
311
312    /// Mask specifying which fields to read from each result.
313    /// If no mask is specified, will default to all fields except items.owner,
314    /// items.acl, and items.default_object_acl.
315    ///
316    /// * may be used to mean "all fields".
317    pub read_mask: std::option::Option<wkt::FieldMask>,
318
319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
320}
321
322impl ListBucketsRequest {
323    pub fn new() -> Self {
324        std::default::Default::default()
325    }
326
327    /// Sets the value of [parent][crate::model::ListBucketsRequest::parent].
328    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
329        self.parent = v.into();
330        self
331    }
332
333    /// Sets the value of [page_size][crate::model::ListBucketsRequest::page_size].
334    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
335        self.page_size = v.into();
336        self
337    }
338
339    /// Sets the value of [page_token][crate::model::ListBucketsRequest::page_token].
340    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
341        self.page_token = v.into();
342        self
343    }
344
345    /// Sets the value of [prefix][crate::model::ListBucketsRequest::prefix].
346    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
347        self.prefix = v.into();
348        self
349    }
350
351    /// Sets the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
352    pub fn set_read_mask<T>(mut self, v: T) -> Self
353    where
354        T: std::convert::Into<wkt::FieldMask>,
355    {
356        self.read_mask = std::option::Option::Some(v.into());
357        self
358    }
359
360    /// Sets or clears the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
361    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
362    where
363        T: std::convert::Into<wkt::FieldMask>,
364    {
365        self.read_mask = v.map(|x| x.into());
366        self
367    }
368}
369
370impl wkt::message::Message for ListBucketsRequest {
371    fn typename() -> &'static str {
372        "type.googleapis.com/google.storage.v2.ListBucketsRequest"
373    }
374}
375
376/// The result of a call to Buckets.ListBuckets
377#[derive(Clone, Default, PartialEq)]
378#[non_exhaustive]
379pub struct ListBucketsResponse {
380    /// The list of items.
381    pub buckets: std::vec::Vec<crate::model::Bucket>,
382
383    /// The continuation token, used to page through large result sets. Provide
384    /// this value in a subsequent request to return the next page of results.
385    pub next_page_token: std::string::String,
386
387    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
388}
389
390impl ListBucketsResponse {
391    pub fn new() -> Self {
392        std::default::Default::default()
393    }
394
395    /// Sets the value of [buckets][crate::model::ListBucketsResponse::buckets].
396    pub fn set_buckets<T, V>(mut self, v: T) -> Self
397    where
398        T: std::iter::IntoIterator<Item = V>,
399        V: std::convert::Into<crate::model::Bucket>,
400    {
401        use std::iter::Iterator;
402        self.buckets = v.into_iter().map(|i| i.into()).collect();
403        self
404    }
405
406    /// Sets the value of [next_page_token][crate::model::ListBucketsResponse::next_page_token].
407    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
408        self.next_page_token = v.into();
409        self
410    }
411}
412
413impl wkt::message::Message for ListBucketsResponse {
414    fn typename() -> &'static str {
415        "type.googleapis.com/google.storage.v2.ListBucketsResponse"
416    }
417}
418
419#[doc(hidden)]
420impl gax::paginator::internal::PageableResponse for ListBucketsResponse {
421    type PageItem = crate::model::Bucket;
422
423    fn items(self) -> std::vec::Vec<Self::PageItem> {
424        self.buckets
425    }
426
427    fn next_page_token(&self) -> std::string::String {
428        use std::clone::Clone;
429        self.next_page_token.clone()
430    }
431}
432
433/// Request message for LockBucketRetentionPolicyRequest.
434#[derive(Clone, Default, PartialEq)]
435#[non_exhaustive]
436pub struct LockBucketRetentionPolicyRequest {
437    /// Required. Name of a bucket.
438    pub bucket: std::string::String,
439
440    /// Required. Makes the operation conditional on whether bucket's current
441    /// metageneration matches the given value. Must be positive.
442    pub if_metageneration_match: i64,
443
444    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
445}
446
447impl LockBucketRetentionPolicyRequest {
448    pub fn new() -> Self {
449        std::default::Default::default()
450    }
451
452    /// Sets the value of [bucket][crate::model::LockBucketRetentionPolicyRequest::bucket].
453    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
454        self.bucket = v.into();
455        self
456    }
457
458    /// Sets the value of [if_metageneration_match][crate::model::LockBucketRetentionPolicyRequest::if_metageneration_match].
459    pub fn set_if_metageneration_match<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
460        self.if_metageneration_match = v.into();
461        self
462    }
463}
464
465impl wkt::message::Message for LockBucketRetentionPolicyRequest {
466    fn typename() -> &'static str {
467        "type.googleapis.com/google.storage.v2.LockBucketRetentionPolicyRequest"
468    }
469}
470
471/// Request for UpdateBucket method.
472#[derive(Clone, Default, PartialEq)]
473#[non_exhaustive]
474pub struct UpdateBucketRequest {
475    /// Required. The bucket to update.
476    /// The bucket's `name` field will be used to identify the bucket.
477    pub bucket: std::option::Option<crate::model::Bucket>,
478
479    /// If set, will only modify the bucket if its metageneration matches this
480    /// value.
481    pub if_metageneration_match: std::option::Option<i64>,
482
483    /// If set, will only modify the bucket if its metageneration does not match
484    /// this value.
485    pub if_metageneration_not_match: std::option::Option<i64>,
486
487    /// Optional. Apply a predefined set of access controls to this bucket.
488    /// Valid values are "authenticatedRead", "private", "projectPrivate",
489    /// "publicRead", or "publicReadWrite".
490    pub predefined_acl: std::string::String,
491
492    /// Optional. Apply a predefined set of default object access controls to this
493    /// bucket. Valid values are "authenticatedRead", "bucketOwnerFullControl",
494    /// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
495    pub predefined_default_object_acl: std::string::String,
496
497    /// Required. List of fields to be updated.
498    ///
499    /// To specify ALL fields, equivalent to the JSON API's "update" function,
500    /// specify a single field with the value `*`. Note: not recommended. If a new
501    /// field is introduced at a later time, an older client updating with the `*`
502    /// may accidentally reset the new field's value.
503    ///
504    /// Not specifying any fields is an error.
505    pub update_mask: std::option::Option<wkt::FieldMask>,
506
507    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
508}
509
510impl UpdateBucketRequest {
511    pub fn new() -> Self {
512        std::default::Default::default()
513    }
514
515    /// Sets the value of [bucket][crate::model::UpdateBucketRequest::bucket].
516    pub fn set_bucket<T>(mut self, v: T) -> Self
517    where
518        T: std::convert::Into<crate::model::Bucket>,
519    {
520        self.bucket = std::option::Option::Some(v.into());
521        self
522    }
523
524    /// Sets or clears the value of [bucket][crate::model::UpdateBucketRequest::bucket].
525    pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
526    where
527        T: std::convert::Into<crate::model::Bucket>,
528    {
529        self.bucket = v.map(|x| x.into());
530        self
531    }
532
533    /// Sets the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
534    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
535    where
536        T: std::convert::Into<i64>,
537    {
538        self.if_metageneration_match = std::option::Option::Some(v.into());
539        self
540    }
541
542    /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
543    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
544    where
545        T: std::convert::Into<i64>,
546    {
547        self.if_metageneration_match = v.map(|x| x.into());
548        self
549    }
550
551    /// Sets the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
552    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
553    where
554        T: std::convert::Into<i64>,
555    {
556        self.if_metageneration_not_match = std::option::Option::Some(v.into());
557        self
558    }
559
560    /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
561    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
562    where
563        T: std::convert::Into<i64>,
564    {
565        self.if_metageneration_not_match = v.map(|x| x.into());
566        self
567    }
568
569    /// Sets the value of [predefined_acl][crate::model::UpdateBucketRequest::predefined_acl].
570    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
571        self.predefined_acl = v.into();
572        self
573    }
574
575    /// Sets the value of [predefined_default_object_acl][crate::model::UpdateBucketRequest::predefined_default_object_acl].
576    pub fn set_predefined_default_object_acl<T: std::convert::Into<std::string::String>>(
577        mut self,
578        v: T,
579    ) -> Self {
580        self.predefined_default_object_acl = v.into();
581        self
582    }
583
584    /// Sets the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
585    pub fn set_update_mask<T>(mut self, v: T) -> Self
586    where
587        T: std::convert::Into<wkt::FieldMask>,
588    {
589        self.update_mask = std::option::Option::Some(v.into());
590        self
591    }
592
593    /// Sets or clears the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
594    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
595    where
596        T: std::convert::Into<wkt::FieldMask>,
597    {
598        self.update_mask = v.map(|x| x.into());
599        self
600    }
601}
602
603impl wkt::message::Message for UpdateBucketRequest {
604    fn typename() -> &'static str {
605        "type.googleapis.com/google.storage.v2.UpdateBucketRequest"
606    }
607}
608
609/// Request message for ComposeObject.
610#[derive(Clone, Default, PartialEq)]
611#[non_exhaustive]
612pub struct ComposeObjectRequest {
613    /// Required. Properties of the resulting object.
614    pub destination: std::option::Option<crate::model::Object>,
615
616    /// Optional. The list of source objects that will be concatenated into a
617    /// single object.
618    pub source_objects: std::vec::Vec<crate::model::compose_object_request::SourceObject>,
619
620    /// Optional. Apply a predefined set of access controls to the destination
621    /// object. Valid values are "authenticatedRead", "bucketOwnerFullControl",
622    /// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
623    pub destination_predefined_acl: std::string::String,
624
625    /// Makes the operation conditional on whether the object's current generation
626    /// matches the given value. Setting to 0 makes the operation succeed only if
627    /// there are no live versions of the object.
628    pub if_generation_match: std::option::Option<i64>,
629
630    /// Makes the operation conditional on whether the object's current
631    /// metageneration matches the given value.
632    pub if_metageneration_match: std::option::Option<i64>,
633
634    /// Optional. Resource name of the Cloud KMS key, of the form
635    /// `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
636    /// that will be used to encrypt the object. Overrides the object
637    /// metadata's `kms_key_name` value, if any.
638    pub kms_key: std::string::String,
639
640    /// Optional. A set of parameters common to Storage API requests concerning an
641    /// object.
642    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
643
644    /// Optional. The checksums of the complete object. This will be validated
645    /// against the combined checksums of the component objects.
646    pub object_checksums: std::option::Option<crate::model::ObjectChecksums>,
647
648    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
649}
650
651impl ComposeObjectRequest {
652    pub fn new() -> Self {
653        std::default::Default::default()
654    }
655
656    /// Sets the value of [destination][crate::model::ComposeObjectRequest::destination].
657    pub fn set_destination<T>(mut self, v: T) -> Self
658    where
659        T: std::convert::Into<crate::model::Object>,
660    {
661        self.destination = std::option::Option::Some(v.into());
662        self
663    }
664
665    /// Sets or clears the value of [destination][crate::model::ComposeObjectRequest::destination].
666    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
667    where
668        T: std::convert::Into<crate::model::Object>,
669    {
670        self.destination = v.map(|x| x.into());
671        self
672    }
673
674    /// Sets the value of [source_objects][crate::model::ComposeObjectRequest::source_objects].
675    pub fn set_source_objects<T, V>(mut self, v: T) -> Self
676    where
677        T: std::iter::IntoIterator<Item = V>,
678        V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
679    {
680        use std::iter::Iterator;
681        self.source_objects = v.into_iter().map(|i| i.into()).collect();
682        self
683    }
684
685    /// Sets the value of [destination_predefined_acl][crate::model::ComposeObjectRequest::destination_predefined_acl].
686    pub fn set_destination_predefined_acl<T: std::convert::Into<std::string::String>>(
687        mut self,
688        v: T,
689    ) -> Self {
690        self.destination_predefined_acl = v.into();
691        self
692    }
693
694    /// Sets the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
695    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
696    where
697        T: std::convert::Into<i64>,
698    {
699        self.if_generation_match = std::option::Option::Some(v.into());
700        self
701    }
702
703    /// Sets or clears the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
704    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
705    where
706        T: std::convert::Into<i64>,
707    {
708        self.if_generation_match = v.map(|x| x.into());
709        self
710    }
711
712    /// Sets the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
713    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
714    where
715        T: std::convert::Into<i64>,
716    {
717        self.if_metageneration_match = std::option::Option::Some(v.into());
718        self
719    }
720
721    /// Sets or clears the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
722    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
723    where
724        T: std::convert::Into<i64>,
725    {
726        self.if_metageneration_match = v.map(|x| x.into());
727        self
728    }
729
730    /// Sets the value of [kms_key][crate::model::ComposeObjectRequest::kms_key].
731    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
732        self.kms_key = v.into();
733        self
734    }
735
736    /// Sets the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
737    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
738    where
739        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
740    {
741        self.common_object_request_params = std::option::Option::Some(v.into());
742        self
743    }
744
745    /// Sets or clears the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
746    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
747    where
748        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
749    {
750        self.common_object_request_params = v.map(|x| x.into());
751        self
752    }
753
754    /// Sets the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
755    pub fn set_object_checksums<T>(mut self, v: T) -> Self
756    where
757        T: std::convert::Into<crate::model::ObjectChecksums>,
758    {
759        self.object_checksums = std::option::Option::Some(v.into());
760        self
761    }
762
763    /// Sets or clears the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
764    pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
765    where
766        T: std::convert::Into<crate::model::ObjectChecksums>,
767    {
768        self.object_checksums = v.map(|x| x.into());
769        self
770    }
771}
772
773impl wkt::message::Message for ComposeObjectRequest {
774    fn typename() -> &'static str {
775        "type.googleapis.com/google.storage.v2.ComposeObjectRequest"
776    }
777}
778
779/// Defines additional types related to [ComposeObjectRequest].
780pub mod compose_object_request {
781    #[allow(unused_imports)]
782    use super::*;
783
784    /// Description of a source object for a composition request.
785    #[derive(Clone, Default, PartialEq)]
786    #[non_exhaustive]
787    pub struct SourceObject {
788        /// Required. The source object's name. All source objects must reside in the
789        /// same bucket.
790        pub name: std::string::String,
791
792        /// Optional. The generation of this object to use as the source.
793        pub generation: i64,
794
795        /// Optional. Conditions that must be met for this operation to execute.
796        pub object_preconditions: std::option::Option<
797            crate::model::compose_object_request::source_object::ObjectPreconditions,
798        >,
799
800        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
801    }
802
803    impl SourceObject {
804        pub fn new() -> Self {
805            std::default::Default::default()
806        }
807
808        /// Sets the value of [name][crate::model::compose_object_request::SourceObject::name].
809        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
810            self.name = v.into();
811            self
812        }
813
814        /// Sets the value of [generation][crate::model::compose_object_request::SourceObject::generation].
815        pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
816            self.generation = v.into();
817            self
818        }
819
820        /// Sets the value of [object_preconditions][crate::model::compose_object_request::SourceObject::object_preconditions].
821        pub fn set_object_preconditions<T>(mut self, v: T) -> Self
822        where
823            T: std::convert::Into<
824                    crate::model::compose_object_request::source_object::ObjectPreconditions,
825                >,
826        {
827            self.object_preconditions = std::option::Option::Some(v.into());
828            self
829        }
830
831        /// Sets or clears the value of [object_preconditions][crate::model::compose_object_request::SourceObject::object_preconditions].
832        pub fn set_or_clear_object_preconditions<T>(mut self, v: std::option::Option<T>) -> Self
833        where
834            T: std::convert::Into<
835                    crate::model::compose_object_request::source_object::ObjectPreconditions,
836                >,
837        {
838            self.object_preconditions = v.map(|x| x.into());
839            self
840        }
841    }
842
843    impl wkt::message::Message for SourceObject {
844        fn typename() -> &'static str {
845            "type.googleapis.com/google.storage.v2.ComposeObjectRequest.SourceObject"
846        }
847    }
848
849    /// Defines additional types related to [SourceObject].
850    pub mod source_object {
851        #[allow(unused_imports)]
852        use super::*;
853
854        /// Preconditions for a source object of a composition request.
855        #[derive(Clone, Default, PartialEq)]
856        #[non_exhaustive]
857        pub struct ObjectPreconditions {
858            /// Only perform the composition if the generation of the source object
859            /// that would be used matches this value.  If this value and a generation
860            /// are both specified, they must be the same value or the call will fail.
861            pub if_generation_match: std::option::Option<i64>,
862
863            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
864        }
865
866        impl ObjectPreconditions {
867            pub fn new() -> Self {
868                std::default::Default::default()
869            }
870
871            /// Sets the value of [if_generation_match][crate::model::compose_object_request::source_object::ObjectPreconditions::if_generation_match].
872            pub fn set_if_generation_match<T>(mut self, v: T) -> Self
873            where
874                T: std::convert::Into<i64>,
875            {
876                self.if_generation_match = std::option::Option::Some(v.into());
877                self
878            }
879
880            /// Sets or clears the value of [if_generation_match][crate::model::compose_object_request::source_object::ObjectPreconditions::if_generation_match].
881            pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
882            where
883                T: std::convert::Into<i64>,
884            {
885                self.if_generation_match = v.map(|x| x.into());
886                self
887            }
888        }
889
890        impl wkt::message::Message for ObjectPreconditions {
891            fn typename() -> &'static str {
892                "type.googleapis.com/google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions"
893            }
894        }
895    }
896}
897
898/// Message for deleting an object.
899/// `bucket` and `object` **must** be set.
900#[derive(Clone, Default, PartialEq)]
901#[non_exhaustive]
902pub struct DeleteObjectRequest {
903    /// Required. Name of the bucket in which the object resides.
904    pub bucket: std::string::String,
905
906    /// Required. The name of the finalized object to delete.
907    /// Note: If you want to delete an unfinalized resumable upload please use
908    /// `CancelResumableWrite`.
909    pub object: std::string::String,
910
911    /// Optional. If present, permanently deletes a specific revision of this
912    /// object (as opposed to the latest version, the default).
913    pub generation: i64,
914
915    /// Makes the operation conditional on whether the object's current generation
916    /// matches the given value. Setting to 0 makes the operation succeed only if
917    /// there are no live versions of the object.
918    pub if_generation_match: std::option::Option<i64>,
919
920    /// Makes the operation conditional on whether the object's live generation
921    /// does not match the given value. If no live object exists, the precondition
922    /// fails. Setting to 0 makes the operation succeed only if there is a live
923    /// version of the object.
924    pub if_generation_not_match: std::option::Option<i64>,
925
926    /// Makes the operation conditional on whether the object's current
927    /// metageneration matches the given value.
928    pub if_metageneration_match: std::option::Option<i64>,
929
930    /// Makes the operation conditional on whether the object's current
931    /// metageneration does not match the given value.
932    pub if_metageneration_not_match: std::option::Option<i64>,
933
934    /// Optional. A set of parameters common to Storage API requests concerning an
935    /// object.
936    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
937
938    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
939}
940
941impl DeleteObjectRequest {
942    pub fn new() -> Self {
943        std::default::Default::default()
944    }
945
946    /// Sets the value of [bucket][crate::model::DeleteObjectRequest::bucket].
947    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
948        self.bucket = v.into();
949        self
950    }
951
952    /// Sets the value of [object][crate::model::DeleteObjectRequest::object].
953    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
954        self.object = v.into();
955        self
956    }
957
958    /// Sets the value of [generation][crate::model::DeleteObjectRequest::generation].
959    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
960        self.generation = v.into();
961        self
962    }
963
964    /// Sets the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
965    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
966    where
967        T: std::convert::Into<i64>,
968    {
969        self.if_generation_match = std::option::Option::Some(v.into());
970        self
971    }
972
973    /// Sets or clears the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
974    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
975    where
976        T: std::convert::Into<i64>,
977    {
978        self.if_generation_match = v.map(|x| x.into());
979        self
980    }
981
982    /// Sets the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
983    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
984    where
985        T: std::convert::Into<i64>,
986    {
987        self.if_generation_not_match = std::option::Option::Some(v.into());
988        self
989    }
990
991    /// Sets or clears the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
992    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
993    where
994        T: std::convert::Into<i64>,
995    {
996        self.if_generation_not_match = v.map(|x| x.into());
997        self
998    }
999
1000    /// Sets the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
1001    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1002    where
1003        T: std::convert::Into<i64>,
1004    {
1005        self.if_metageneration_match = std::option::Option::Some(v.into());
1006        self
1007    }
1008
1009    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
1010    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1011    where
1012        T: std::convert::Into<i64>,
1013    {
1014        self.if_metageneration_match = v.map(|x| x.into());
1015        self
1016    }
1017
1018    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
1019    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1020    where
1021        T: std::convert::Into<i64>,
1022    {
1023        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1024        self
1025    }
1026
1027    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
1028    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1029    where
1030        T: std::convert::Into<i64>,
1031    {
1032        self.if_metageneration_not_match = v.map(|x| x.into());
1033        self
1034    }
1035
1036    /// Sets the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
1037    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1038    where
1039        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1040    {
1041        self.common_object_request_params = std::option::Option::Some(v.into());
1042        self
1043    }
1044
1045    /// Sets or clears the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
1046    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
1047    where
1048        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1049    {
1050        self.common_object_request_params = v.map(|x| x.into());
1051        self
1052    }
1053}
1054
1055impl wkt::message::Message for DeleteObjectRequest {
1056    fn typename() -> &'static str {
1057        "type.googleapis.com/google.storage.v2.DeleteObjectRequest"
1058    }
1059}
1060
1061/// Message for restoring an object.
1062/// `bucket`, `object`, and `generation` **must** be set.
1063#[derive(Clone, Default, PartialEq)]
1064#[non_exhaustive]
1065pub struct RestoreObjectRequest {
1066    /// Required. Name of the bucket in which the object resides.
1067    pub bucket: std::string::String,
1068
1069    /// Required. The name of the object to restore.
1070    pub object: std::string::String,
1071
1072    /// Required. The specific revision of the object to restore.
1073    pub generation: i64,
1074
1075    /// Optional. Restore token used to differentiate soft-deleted objects with the
1076    /// same name and generation. Only applicable for hierarchical namespace
1077    /// buckets. This parameter is optional, and is only required in the rare case
1078    /// when there are multiple soft-deleted objects with the same name and
1079    /// generation.
1080    pub restore_token: std::string::String,
1081
1082    /// Makes the operation conditional on whether the object's current generation
1083    /// matches the given value. Setting to 0 makes the operation succeed only if
1084    /// there are no live versions of the object.
1085    pub if_generation_match: std::option::Option<i64>,
1086
1087    /// Makes the operation conditional on whether the object's live generation
1088    /// does not match the given value. If no live object exists, the precondition
1089    /// fails. Setting to 0 makes the operation succeed only if there is a live
1090    /// version of the object.
1091    pub if_generation_not_match: std::option::Option<i64>,
1092
1093    /// Makes the operation conditional on whether the object's current
1094    /// metageneration matches the given value.
1095    pub if_metageneration_match: std::option::Option<i64>,
1096
1097    /// Makes the operation conditional on whether the object's current
1098    /// metageneration does not match the given value.
1099    pub if_metageneration_not_match: std::option::Option<i64>,
1100
1101    /// If false or unset, the bucket's default object ACL will be used.
1102    /// If true, copy the source object's access controls.
1103    /// Return an error if bucket has UBLA enabled.
1104    pub copy_source_acl: std::option::Option<bool>,
1105
1106    /// Optional. A set of parameters common to Storage API requests concerning an
1107    /// object.
1108    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
1109
1110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1111}
1112
1113impl RestoreObjectRequest {
1114    pub fn new() -> Self {
1115        std::default::Default::default()
1116    }
1117
1118    /// Sets the value of [bucket][crate::model::RestoreObjectRequest::bucket].
1119    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1120        self.bucket = v.into();
1121        self
1122    }
1123
1124    /// Sets the value of [object][crate::model::RestoreObjectRequest::object].
1125    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1126        self.object = v.into();
1127        self
1128    }
1129
1130    /// Sets the value of [generation][crate::model::RestoreObjectRequest::generation].
1131    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1132        self.generation = v.into();
1133        self
1134    }
1135
1136    /// Sets the value of [restore_token][crate::model::RestoreObjectRequest::restore_token].
1137    pub fn set_restore_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1138        self.restore_token = v.into();
1139        self
1140    }
1141
1142    /// Sets the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
1143    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1144    where
1145        T: std::convert::Into<i64>,
1146    {
1147        self.if_generation_match = std::option::Option::Some(v.into());
1148        self
1149    }
1150
1151    /// Sets or clears the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
1152    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1153    where
1154        T: std::convert::Into<i64>,
1155    {
1156        self.if_generation_match = v.map(|x| x.into());
1157        self
1158    }
1159
1160    /// Sets the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
1161    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1162    where
1163        T: std::convert::Into<i64>,
1164    {
1165        self.if_generation_not_match = std::option::Option::Some(v.into());
1166        self
1167    }
1168
1169    /// Sets or clears the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
1170    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1171    where
1172        T: std::convert::Into<i64>,
1173    {
1174        self.if_generation_not_match = v.map(|x| x.into());
1175        self
1176    }
1177
1178    /// Sets the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
1179    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1180    where
1181        T: std::convert::Into<i64>,
1182    {
1183        self.if_metageneration_match = std::option::Option::Some(v.into());
1184        self
1185    }
1186
1187    /// Sets or clears the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
1188    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1189    where
1190        T: std::convert::Into<i64>,
1191    {
1192        self.if_metageneration_match = v.map(|x| x.into());
1193        self
1194    }
1195
1196    /// Sets the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
1197    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1198    where
1199        T: std::convert::Into<i64>,
1200    {
1201        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1202        self
1203    }
1204
1205    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
1206    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1207    where
1208        T: std::convert::Into<i64>,
1209    {
1210        self.if_metageneration_not_match = v.map(|x| x.into());
1211        self
1212    }
1213
1214    /// Sets the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
1215    pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1216    where
1217        T: std::convert::Into<bool>,
1218    {
1219        self.copy_source_acl = std::option::Option::Some(v.into());
1220        self
1221    }
1222
1223    /// Sets or clears the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
1224    pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1225    where
1226        T: std::convert::Into<bool>,
1227    {
1228        self.copy_source_acl = v.map(|x| x.into());
1229        self
1230    }
1231
1232    /// Sets the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
1233    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1234    where
1235        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1236    {
1237        self.common_object_request_params = std::option::Option::Some(v.into());
1238        self
1239    }
1240
1241    /// Sets or clears the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
1242    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
1243    where
1244        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1245    {
1246        self.common_object_request_params = v.map(|x| x.into());
1247        self
1248    }
1249}
1250
1251impl wkt::message::Message for RestoreObjectRequest {
1252    fn typename() -> &'static str {
1253        "type.googleapis.com/google.storage.v2.RestoreObjectRequest"
1254    }
1255}
1256
1257/// Request message for ReadObject.
1258#[derive(Clone, Default, PartialEq)]
1259#[non_exhaustive]
1260pub struct ReadObjectRequest {
1261    /// Required. The name of the bucket containing the object to read.
1262    pub bucket: std::string::String,
1263
1264    /// Required. The name of the object to read.
1265    pub object: std::string::String,
1266
1267    /// Optional. If present, selects a specific revision of this object (as
1268    /// opposed to the latest version, the default).
1269    pub generation: i64,
1270
1271    /// Optional. The offset for the first byte to return in the read, relative to
1272    /// the start of the object.
1273    ///
1274    /// A negative `read_offset` value will be interpreted as the number of bytes
1275    /// back from the end of the object to be returned. For example, if an object's
1276    /// length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
1277    /// `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
1278    /// a negative offset with magnitude larger than the size of the object will
1279    /// return the entire object.
1280    pub read_offset: i64,
1281
1282    /// Optional. The maximum number of `data` bytes the server is allowed to
1283    /// return in the sum of all `Object` messages. A `read_limit` of zero
1284    /// indicates that there is no limit, and a negative `read_limit` will cause an
1285    /// error.
1286    ///
1287    /// If the stream returns fewer bytes than allowed by the `read_limit` and no
1288    /// error occurred, the stream includes all data from the `read_offset` to the
1289    /// end of the resource.
1290    pub read_limit: i64,
1291
1292    /// Makes the operation conditional on whether the object's current generation
1293    /// matches the given value. Setting to 0 makes the operation succeed only if
1294    /// there are no live versions of the object.
1295    pub if_generation_match: std::option::Option<i64>,
1296
1297    /// Makes the operation conditional on whether the object's live generation
1298    /// does not match the given value. If no live object exists, the precondition
1299    /// fails. Setting to 0 makes the operation succeed only if there is a live
1300    /// version of the object.
1301    pub if_generation_not_match: std::option::Option<i64>,
1302
1303    /// Makes the operation conditional on whether the object's current
1304    /// metageneration matches the given value.
1305    pub if_metageneration_match: std::option::Option<i64>,
1306
1307    /// Makes the operation conditional on whether the object's current
1308    /// metageneration does not match the given value.
1309    pub if_metageneration_not_match: std::option::Option<i64>,
1310
1311    /// Optional. A set of parameters common to Storage API requests concerning an
1312    /// object.
1313    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
1314
1315    /// Mask specifying which fields to read.
1316    /// The checksummed_data field and its children will always be present.
1317    /// If no mask is specified, will default to all fields except metadata.owner
1318    /// and metadata.acl.
1319    ///
1320    /// * may be used to mean "all fields".
1321    pub read_mask: std::option::Option<wkt::FieldMask>,
1322
1323    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1324}
1325
1326impl ReadObjectRequest {
1327    pub fn new() -> Self {
1328        std::default::Default::default()
1329    }
1330
1331    /// Sets the value of [bucket][crate::model::ReadObjectRequest::bucket].
1332    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1333        self.bucket = v.into();
1334        self
1335    }
1336
1337    /// Sets the value of [object][crate::model::ReadObjectRequest::object].
1338    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1339        self.object = v.into();
1340        self
1341    }
1342
1343    /// Sets the value of [generation][crate::model::ReadObjectRequest::generation].
1344    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1345        self.generation = v.into();
1346        self
1347    }
1348
1349    /// Sets the value of [read_offset][crate::model::ReadObjectRequest::read_offset].
1350    pub fn set_read_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1351        self.read_offset = v.into();
1352        self
1353    }
1354
1355    /// Sets the value of [read_limit][crate::model::ReadObjectRequest::read_limit].
1356    pub fn set_read_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1357        self.read_limit = v.into();
1358        self
1359    }
1360
1361    /// Sets the value of [if_generation_match][crate::model::ReadObjectRequest::if_generation_match].
1362    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1363    where
1364        T: std::convert::Into<i64>,
1365    {
1366        self.if_generation_match = std::option::Option::Some(v.into());
1367        self
1368    }
1369
1370    /// Sets or clears the value of [if_generation_match][crate::model::ReadObjectRequest::if_generation_match].
1371    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1372    where
1373        T: std::convert::Into<i64>,
1374    {
1375        self.if_generation_match = v.map(|x| x.into());
1376        self
1377    }
1378
1379    /// Sets the value of [if_generation_not_match][crate::model::ReadObjectRequest::if_generation_not_match].
1380    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1381    where
1382        T: std::convert::Into<i64>,
1383    {
1384        self.if_generation_not_match = std::option::Option::Some(v.into());
1385        self
1386    }
1387
1388    /// Sets or clears the value of [if_generation_not_match][crate::model::ReadObjectRequest::if_generation_not_match].
1389    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1390    where
1391        T: std::convert::Into<i64>,
1392    {
1393        self.if_generation_not_match = v.map(|x| x.into());
1394        self
1395    }
1396
1397    /// Sets the value of [if_metageneration_match][crate::model::ReadObjectRequest::if_metageneration_match].
1398    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1399    where
1400        T: std::convert::Into<i64>,
1401    {
1402        self.if_metageneration_match = std::option::Option::Some(v.into());
1403        self
1404    }
1405
1406    /// Sets or clears the value of [if_metageneration_match][crate::model::ReadObjectRequest::if_metageneration_match].
1407    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1408    where
1409        T: std::convert::Into<i64>,
1410    {
1411        self.if_metageneration_match = v.map(|x| x.into());
1412        self
1413    }
1414
1415    /// Sets the value of [if_metageneration_not_match][crate::model::ReadObjectRequest::if_metageneration_not_match].
1416    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1417    where
1418        T: std::convert::Into<i64>,
1419    {
1420        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1421        self
1422    }
1423
1424    /// Sets or clears the value of [if_metageneration_not_match][crate::model::ReadObjectRequest::if_metageneration_not_match].
1425    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1426    where
1427        T: std::convert::Into<i64>,
1428    {
1429        self.if_metageneration_not_match = v.map(|x| x.into());
1430        self
1431    }
1432
1433    /// Sets the value of [common_object_request_params][crate::model::ReadObjectRequest::common_object_request_params].
1434    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1435    where
1436        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1437    {
1438        self.common_object_request_params = std::option::Option::Some(v.into());
1439        self
1440    }
1441
1442    /// Sets or clears the value of [common_object_request_params][crate::model::ReadObjectRequest::common_object_request_params].
1443    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
1444    where
1445        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1446    {
1447        self.common_object_request_params = v.map(|x| x.into());
1448        self
1449    }
1450
1451    /// Sets the value of [read_mask][crate::model::ReadObjectRequest::read_mask].
1452    pub fn set_read_mask<T>(mut self, v: T) -> Self
1453    where
1454        T: std::convert::Into<wkt::FieldMask>,
1455    {
1456        self.read_mask = std::option::Option::Some(v.into());
1457        self
1458    }
1459
1460    /// Sets or clears the value of [read_mask][crate::model::ReadObjectRequest::read_mask].
1461    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1462    where
1463        T: std::convert::Into<wkt::FieldMask>,
1464    {
1465        self.read_mask = v.map(|x| x.into());
1466        self
1467    }
1468}
1469
1470impl wkt::message::Message for ReadObjectRequest {
1471    fn typename() -> &'static str {
1472        "type.googleapis.com/google.storage.v2.ReadObjectRequest"
1473    }
1474}
1475
1476/// Request message for GetObject.
1477#[derive(Clone, Default, PartialEq)]
1478#[non_exhaustive]
1479pub struct GetObjectRequest {
1480    /// Required. Name of the bucket in which the object resides.
1481    pub bucket: std::string::String,
1482
1483    /// Required. Name of the object.
1484    pub object: std::string::String,
1485
1486    /// Optional. If present, selects a specific revision of this object (as
1487    /// opposed to the latest version, the default).
1488    pub generation: i64,
1489
1490    /// If true, return the soft-deleted version of this object.
1491    pub soft_deleted: std::option::Option<bool>,
1492
1493    /// Makes the operation conditional on whether the object's current generation
1494    /// matches the given value. Setting to 0 makes the operation succeed only if
1495    /// there are no live versions of the object.
1496    pub if_generation_match: std::option::Option<i64>,
1497
1498    /// Makes the operation conditional on whether the object's live generation
1499    /// does not match the given value. If no live object exists, the precondition
1500    /// fails. Setting to 0 makes the operation succeed only if there is a live
1501    /// version of the object.
1502    pub if_generation_not_match: std::option::Option<i64>,
1503
1504    /// Makes the operation conditional on whether the object's current
1505    /// metageneration matches the given value.
1506    pub if_metageneration_match: std::option::Option<i64>,
1507
1508    /// Makes the operation conditional on whether the object's current
1509    /// metageneration does not match the given value.
1510    pub if_metageneration_not_match: std::option::Option<i64>,
1511
1512    /// Optional. A set of parameters common to Storage API requests concerning an
1513    /// object.
1514    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
1515
1516    /// Mask specifying which fields to read.
1517    /// If no mask is specified, will default to all fields except metadata.acl and
1518    /// metadata.owner.
1519    ///
1520    /// * may be used to mean "all fields".
1521    pub read_mask: std::option::Option<wkt::FieldMask>,
1522
1523    /// Optional. Restore token used to differentiate soft-deleted objects with the
1524    /// same name and generation. Only applicable for hierarchical namespace
1525    /// buckets and if soft_deleted is set to true. This parameter is optional, and
1526    /// is only required in the rare case when there are multiple soft-deleted
1527    /// objects with the same name and generation.
1528    pub restore_token: std::string::String,
1529
1530    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1531}
1532
1533impl GetObjectRequest {
1534    pub fn new() -> Self {
1535        std::default::Default::default()
1536    }
1537
1538    /// Sets the value of [bucket][crate::model::GetObjectRequest::bucket].
1539    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1540        self.bucket = v.into();
1541        self
1542    }
1543
1544    /// Sets the value of [object][crate::model::GetObjectRequest::object].
1545    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1546        self.object = v.into();
1547        self
1548    }
1549
1550    /// Sets the value of [generation][crate::model::GetObjectRequest::generation].
1551    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1552        self.generation = v.into();
1553        self
1554    }
1555
1556    /// Sets the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
1557    pub fn set_soft_deleted<T>(mut self, v: T) -> Self
1558    where
1559        T: std::convert::Into<bool>,
1560    {
1561        self.soft_deleted = std::option::Option::Some(v.into());
1562        self
1563    }
1564
1565    /// Sets or clears the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
1566    pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
1567    where
1568        T: std::convert::Into<bool>,
1569    {
1570        self.soft_deleted = v.map(|x| x.into());
1571        self
1572    }
1573
1574    /// Sets the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
1575    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1576    where
1577        T: std::convert::Into<i64>,
1578    {
1579        self.if_generation_match = std::option::Option::Some(v.into());
1580        self
1581    }
1582
1583    /// Sets or clears the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
1584    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1585    where
1586        T: std::convert::Into<i64>,
1587    {
1588        self.if_generation_match = v.map(|x| x.into());
1589        self
1590    }
1591
1592    /// Sets the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
1593    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1594    where
1595        T: std::convert::Into<i64>,
1596    {
1597        self.if_generation_not_match = std::option::Option::Some(v.into());
1598        self
1599    }
1600
1601    /// Sets or clears the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
1602    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1603    where
1604        T: std::convert::Into<i64>,
1605    {
1606        self.if_generation_not_match = v.map(|x| x.into());
1607        self
1608    }
1609
1610    /// Sets the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
1611    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1612    where
1613        T: std::convert::Into<i64>,
1614    {
1615        self.if_metageneration_match = std::option::Option::Some(v.into());
1616        self
1617    }
1618
1619    /// Sets or clears the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
1620    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1621    where
1622        T: std::convert::Into<i64>,
1623    {
1624        self.if_metageneration_match = v.map(|x| x.into());
1625        self
1626    }
1627
1628    /// Sets the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
1629    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1630    where
1631        T: std::convert::Into<i64>,
1632    {
1633        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1634        self
1635    }
1636
1637    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
1638    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1639    where
1640        T: std::convert::Into<i64>,
1641    {
1642        self.if_metageneration_not_match = v.map(|x| x.into());
1643        self
1644    }
1645
1646    /// Sets the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
1647    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1648    where
1649        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1650    {
1651        self.common_object_request_params = std::option::Option::Some(v.into());
1652        self
1653    }
1654
1655    /// Sets or clears the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
1656    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
1657    where
1658        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1659    {
1660        self.common_object_request_params = v.map(|x| x.into());
1661        self
1662    }
1663
1664    /// Sets the value of [read_mask][crate::model::GetObjectRequest::read_mask].
1665    pub fn set_read_mask<T>(mut self, v: T) -> Self
1666    where
1667        T: std::convert::Into<wkt::FieldMask>,
1668    {
1669        self.read_mask = std::option::Option::Some(v.into());
1670        self
1671    }
1672
1673    /// Sets or clears the value of [read_mask][crate::model::GetObjectRequest::read_mask].
1674    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1675    where
1676        T: std::convert::Into<wkt::FieldMask>,
1677    {
1678        self.read_mask = v.map(|x| x.into());
1679        self
1680    }
1681
1682    /// Sets the value of [restore_token][crate::model::GetObjectRequest::restore_token].
1683    pub fn set_restore_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1684        self.restore_token = v.into();
1685        self
1686    }
1687}
1688
1689impl wkt::message::Message for GetObjectRequest {
1690    fn typename() -> &'static str {
1691        "type.googleapis.com/google.storage.v2.GetObjectRequest"
1692    }
1693}
1694
1695/// Describes an attempt to insert an object, possibly over multiple requests.
1696#[derive(Clone, Default, PartialEq)]
1697#[non_exhaustive]
1698pub struct WriteObjectSpec {
1699    /// Required. Destination object, including its name and its metadata.
1700    pub resource: std::option::Option<crate::model::Object>,
1701
1702    /// Optional. Apply a predefined set of access controls to this object.
1703    /// Valid values are "authenticatedRead", "bucketOwnerFullControl",
1704    /// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
1705    pub predefined_acl: std::string::String,
1706
1707    /// Makes the operation conditional on whether the object's current
1708    /// generation matches the given value. Setting to 0 makes the operation
1709    /// succeed only if there are no live versions of the object.
1710    pub if_generation_match: std::option::Option<i64>,
1711
1712    /// Makes the operation conditional on whether the object's live
1713    /// generation does not match the given value. If no live object exists, the
1714    /// precondition fails. Setting to 0 makes the operation succeed only if
1715    /// there is a live version of the object.
1716    pub if_generation_not_match: std::option::Option<i64>,
1717
1718    /// Makes the operation conditional on whether the object's current
1719    /// metageneration matches the given value.
1720    pub if_metageneration_match: std::option::Option<i64>,
1721
1722    /// Makes the operation conditional on whether the object's current
1723    /// metageneration does not match the given value.
1724    pub if_metageneration_not_match: std::option::Option<i64>,
1725
1726    /// The expected final object size being uploaded.
1727    /// If this value is set, closing the stream after writing fewer or more than
1728    /// `object_size` bytes will result in an OUT_OF_RANGE error.
1729    ///
1730    /// This situation is considered a client error, and if such an error occurs
1731    /// you must start the upload over from scratch, this time sending the correct
1732    /// number of bytes.
1733    pub object_size: std::option::Option<i64>,
1734
1735    /// If true, the object will be created in appendable mode.
1736    /// This field may only be set when using BidiWriteObject.
1737    pub appendable: std::option::Option<bool>,
1738
1739    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1740}
1741
1742impl WriteObjectSpec {
1743    pub fn new() -> Self {
1744        std::default::Default::default()
1745    }
1746
1747    /// Sets the value of [resource][crate::model::WriteObjectSpec::resource].
1748    pub fn set_resource<T>(mut self, v: T) -> Self
1749    where
1750        T: std::convert::Into<crate::model::Object>,
1751    {
1752        self.resource = std::option::Option::Some(v.into());
1753        self
1754    }
1755
1756    /// Sets or clears the value of [resource][crate::model::WriteObjectSpec::resource].
1757    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
1758    where
1759        T: std::convert::Into<crate::model::Object>,
1760    {
1761        self.resource = v.map(|x| x.into());
1762        self
1763    }
1764
1765    /// Sets the value of [predefined_acl][crate::model::WriteObjectSpec::predefined_acl].
1766    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1767        self.predefined_acl = v.into();
1768        self
1769    }
1770
1771    /// Sets the value of [if_generation_match][crate::model::WriteObjectSpec::if_generation_match].
1772    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1773    where
1774        T: std::convert::Into<i64>,
1775    {
1776        self.if_generation_match = std::option::Option::Some(v.into());
1777        self
1778    }
1779
1780    /// Sets or clears the value of [if_generation_match][crate::model::WriteObjectSpec::if_generation_match].
1781    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1782    where
1783        T: std::convert::Into<i64>,
1784    {
1785        self.if_generation_match = v.map(|x| x.into());
1786        self
1787    }
1788
1789    /// Sets the value of [if_generation_not_match][crate::model::WriteObjectSpec::if_generation_not_match].
1790    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1791    where
1792        T: std::convert::Into<i64>,
1793    {
1794        self.if_generation_not_match = std::option::Option::Some(v.into());
1795        self
1796    }
1797
1798    /// Sets or clears the value of [if_generation_not_match][crate::model::WriteObjectSpec::if_generation_not_match].
1799    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1800    where
1801        T: std::convert::Into<i64>,
1802    {
1803        self.if_generation_not_match = v.map(|x| x.into());
1804        self
1805    }
1806
1807    /// Sets the value of [if_metageneration_match][crate::model::WriteObjectSpec::if_metageneration_match].
1808    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1809    where
1810        T: std::convert::Into<i64>,
1811    {
1812        self.if_metageneration_match = std::option::Option::Some(v.into());
1813        self
1814    }
1815
1816    /// Sets or clears the value of [if_metageneration_match][crate::model::WriteObjectSpec::if_metageneration_match].
1817    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1818    where
1819        T: std::convert::Into<i64>,
1820    {
1821        self.if_metageneration_match = v.map(|x| x.into());
1822        self
1823    }
1824
1825    /// Sets the value of [if_metageneration_not_match][crate::model::WriteObjectSpec::if_metageneration_not_match].
1826    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1827    where
1828        T: std::convert::Into<i64>,
1829    {
1830        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1831        self
1832    }
1833
1834    /// Sets or clears the value of [if_metageneration_not_match][crate::model::WriteObjectSpec::if_metageneration_not_match].
1835    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1836    where
1837        T: std::convert::Into<i64>,
1838    {
1839        self.if_metageneration_not_match = v.map(|x| x.into());
1840        self
1841    }
1842
1843    /// Sets the value of [object_size][crate::model::WriteObjectSpec::object_size].
1844    pub fn set_object_size<T>(mut self, v: T) -> Self
1845    where
1846        T: std::convert::Into<i64>,
1847    {
1848        self.object_size = std::option::Option::Some(v.into());
1849        self
1850    }
1851
1852    /// Sets or clears the value of [object_size][crate::model::WriteObjectSpec::object_size].
1853    pub fn set_or_clear_object_size<T>(mut self, v: std::option::Option<T>) -> Self
1854    where
1855        T: std::convert::Into<i64>,
1856    {
1857        self.object_size = v.map(|x| x.into());
1858        self
1859    }
1860
1861    /// Sets the value of [appendable][crate::model::WriteObjectSpec::appendable].
1862    pub fn set_appendable<T>(mut self, v: T) -> Self
1863    where
1864        T: std::convert::Into<bool>,
1865    {
1866        self.appendable = std::option::Option::Some(v.into());
1867        self
1868    }
1869
1870    /// Sets or clears the value of [appendable][crate::model::WriteObjectSpec::appendable].
1871    pub fn set_or_clear_appendable<T>(mut self, v: std::option::Option<T>) -> Self
1872    where
1873        T: std::convert::Into<bool>,
1874    {
1875        self.appendable = v.map(|x| x.into());
1876        self
1877    }
1878}
1879
1880impl wkt::message::Message for WriteObjectSpec {
1881    fn typename() -> &'static str {
1882        "type.googleapis.com/google.storage.v2.WriteObjectSpec"
1883    }
1884}
1885
1886/// Request message for ListObjects.
1887#[derive(Clone, Default, PartialEq)]
1888#[non_exhaustive]
1889pub struct ListObjectsRequest {
1890    /// Required. Name of the bucket in which to look for objects.
1891    pub parent: std::string::String,
1892
1893    /// Optional. Maximum number of `items` plus `prefixes` to return
1894    /// in a single page of responses. As duplicate `prefixes` are
1895    /// omitted, fewer total results may be returned than requested. The service
1896    /// will use this parameter or 1,000 items, whichever is smaller.
1897    pub page_size: i32,
1898
1899    /// Optional. A previously-returned page token representing part of the larger
1900    /// set of results to view.
1901    pub page_token: std::string::String,
1902
1903    /// Optional. If set, returns results in a directory-like mode. `items` will
1904    /// contain only objects whose names, aside from the `prefix`, do not contain
1905    /// `delimiter`. Objects whose names, aside from the `prefix`, contain
1906    /// `delimiter` will have their name, truncated after the `delimiter`, returned
1907    /// in `prefixes`. Duplicate `prefixes` are omitted.
1908    pub delimiter: std::string::String,
1909
1910    /// Optional. If true, objects that end in exactly one instance of `delimiter`
1911    /// will have their metadata included in `items` in addition to
1912    /// `prefixes`.
1913    pub include_trailing_delimiter: bool,
1914
1915    /// Optional. Filter results to objects whose names begin with this prefix.
1916    pub prefix: std::string::String,
1917
1918    /// Optional. If `true`, lists all versions of an object as distinct results.
1919    /// For more information, see
1920    /// [Object
1921    /// Versioning](https://cloud.google.com/storage/docs/object-versioning).
1922    pub versions: bool,
1923
1924    /// Mask specifying which fields to read from each result.
1925    /// If no mask is specified, will default to all fields except items.acl and
1926    /// items.owner.
1927    ///
1928    /// * may be used to mean "all fields".
1929    pub read_mask: std::option::Option<wkt::FieldMask>,
1930
1931    /// Optional. Filter results to objects whose names are lexicographically equal
1932    /// to or after lexicographic_start. If lexicographic_end is also set, the
1933    /// objects listed have names between lexicographic_start (inclusive) and
1934    /// lexicographic_end (exclusive).
1935    pub lexicographic_start: std::string::String,
1936
1937    /// Optional. Filter results to objects whose names are lexicographically
1938    /// before lexicographic_end. If lexicographic_start is also set, the objects
1939    /// listed have names between lexicographic_start (inclusive) and
1940    /// lexicographic_end (exclusive).
1941    pub lexicographic_end: std::string::String,
1942
1943    /// Optional. If true, only list all soft-deleted versions of the object.
1944    /// Soft delete policy is required to set this option.
1945    pub soft_deleted: bool,
1946
1947    /// Optional. If true, will also include folders and managed folders (besides
1948    /// objects) in the returned `prefixes`. Requires `delimiter` to be set to '/'.
1949    pub include_folders_as_prefixes: bool,
1950
1951    /// Optional. Filter results to objects and prefixes that match this glob
1952    /// pattern. See [List Objects Using
1953    /// Glob](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob)
1954    /// for the full syntax.
1955    pub match_glob: std::string::String,
1956
1957    /// Optional. Filter the returned objects. Currently only supported for the
1958    /// `contexts` field. If `delimiter` is set, the returned `prefixes` are exempt
1959    /// from this filter.
1960    pub filter: std::string::String,
1961
1962    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1963}
1964
1965impl ListObjectsRequest {
1966    pub fn new() -> Self {
1967        std::default::Default::default()
1968    }
1969
1970    /// Sets the value of [parent][crate::model::ListObjectsRequest::parent].
1971    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1972        self.parent = v.into();
1973        self
1974    }
1975
1976    /// Sets the value of [page_size][crate::model::ListObjectsRequest::page_size].
1977    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1978        self.page_size = v.into();
1979        self
1980    }
1981
1982    /// Sets the value of [page_token][crate::model::ListObjectsRequest::page_token].
1983    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1984        self.page_token = v.into();
1985        self
1986    }
1987
1988    /// Sets the value of [delimiter][crate::model::ListObjectsRequest::delimiter].
1989    pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1990        self.delimiter = v.into();
1991        self
1992    }
1993
1994    /// Sets the value of [include_trailing_delimiter][crate::model::ListObjectsRequest::include_trailing_delimiter].
1995    pub fn set_include_trailing_delimiter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1996        self.include_trailing_delimiter = v.into();
1997        self
1998    }
1999
2000    /// Sets the value of [prefix][crate::model::ListObjectsRequest::prefix].
2001    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2002        self.prefix = v.into();
2003        self
2004    }
2005
2006    /// Sets the value of [versions][crate::model::ListObjectsRequest::versions].
2007    pub fn set_versions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2008        self.versions = v.into();
2009        self
2010    }
2011
2012    /// Sets the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
2013    pub fn set_read_mask<T>(mut self, v: T) -> Self
2014    where
2015        T: std::convert::Into<wkt::FieldMask>,
2016    {
2017        self.read_mask = std::option::Option::Some(v.into());
2018        self
2019    }
2020
2021    /// Sets or clears the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
2022    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2023    where
2024        T: std::convert::Into<wkt::FieldMask>,
2025    {
2026        self.read_mask = v.map(|x| x.into());
2027        self
2028    }
2029
2030    /// Sets the value of [lexicographic_start][crate::model::ListObjectsRequest::lexicographic_start].
2031    pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
2032        mut self,
2033        v: T,
2034    ) -> Self {
2035        self.lexicographic_start = v.into();
2036        self
2037    }
2038
2039    /// Sets the value of [lexicographic_end][crate::model::ListObjectsRequest::lexicographic_end].
2040    pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
2041        mut self,
2042        v: T,
2043    ) -> Self {
2044        self.lexicographic_end = v.into();
2045        self
2046    }
2047
2048    /// Sets the value of [soft_deleted][crate::model::ListObjectsRequest::soft_deleted].
2049    pub fn set_soft_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2050        self.soft_deleted = v.into();
2051        self
2052    }
2053
2054    /// Sets the value of [include_folders_as_prefixes][crate::model::ListObjectsRequest::include_folders_as_prefixes].
2055    pub fn set_include_folders_as_prefixes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2056        self.include_folders_as_prefixes = v.into();
2057        self
2058    }
2059
2060    /// Sets the value of [match_glob][crate::model::ListObjectsRequest::match_glob].
2061    pub fn set_match_glob<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2062        self.match_glob = v.into();
2063        self
2064    }
2065
2066    /// Sets the value of [filter][crate::model::ListObjectsRequest::filter].
2067    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2068        self.filter = v.into();
2069        self
2070    }
2071}
2072
2073impl wkt::message::Message for ListObjectsRequest {
2074    fn typename() -> &'static str {
2075        "type.googleapis.com/google.storage.v2.ListObjectsRequest"
2076    }
2077}
2078
2079/// Request message for RewriteObject.
2080/// If the source object is encrypted using a Customer-Supplied Encryption Key
2081/// the key information must be provided in the copy_source_encryption_algorithm,
2082/// copy_source_encryption_key_bytes, and copy_source_encryption_key_sha256_bytes
2083/// fields. If the destination object should be encrypted the keying information
2084/// should be provided in the encryption_algorithm, encryption_key_bytes, and
2085/// encryption_key_sha256_bytes fields of the
2086/// common_object_request_params.customer_encryption field.
2087#[derive(Clone, Default, PartialEq)]
2088#[non_exhaustive]
2089pub struct RewriteObjectRequest {
2090    /// Required. Immutable. The name of the destination object.
2091    /// See the
2092    /// [Naming Guidelines](https://cloud.google.com/storage/docs/objects#naming).
2093    /// Example: `test.txt`
2094    /// The `name` field by itself does not uniquely identify a Cloud Storage
2095    /// object. A Cloud Storage object is uniquely identified by the tuple of
2096    /// (bucket, object, generation).
2097    pub destination_name: std::string::String,
2098
2099    /// Required. Immutable. The name of the bucket containing the destination
2100    /// object.
2101    pub destination_bucket: std::string::String,
2102
2103    /// Optional. The name of the Cloud KMS key that will be used to encrypt the
2104    /// destination object. The Cloud KMS key must be located in same location as
2105    /// the object. If the parameter is not specified, the request uses the
2106    /// destination bucket's default encryption key, if any, or else the
2107    /// Google-managed encryption key.
2108    pub destination_kms_key: std::string::String,
2109
2110    /// Optional. Properties of the destination, post-rewrite object.
2111    /// The `name`, `bucket` and `kms_key` fields must not be populated (these
2112    /// values are specified in the `destination_name`, `destination_bucket`, and
2113    /// `destination_kms_key` fields).
2114    /// If `destination` is present it will be used to construct the destination
2115    /// object's metadata; otherwise the destination object's metadata will be
2116    /// copied from the source object.
2117    pub destination: std::option::Option<crate::model::Object>,
2118
2119    /// Required. Name of the bucket in which to find the source object.
2120    pub source_bucket: std::string::String,
2121
2122    /// Required. Name of the source object.
2123    pub source_object: std::string::String,
2124
2125    /// Optional. If present, selects a specific revision of the source object (as
2126    /// opposed to the latest version, the default).
2127    pub source_generation: i64,
2128
2129    /// Optional. Include this field (from the previous rewrite response) on each
2130    /// rewrite request after the first one, until the rewrite response 'done' flag
2131    /// is true. Calls that provide a rewriteToken can omit all other request
2132    /// fields, but if included those fields must match the values provided in the
2133    /// first rewrite request.
2134    pub rewrite_token: std::string::String,
2135
2136    /// Optional. Apply a predefined set of access controls to the destination
2137    /// object. Valid values are "authenticatedRead", "bucketOwnerFullControl",
2138    /// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
2139    pub destination_predefined_acl: std::string::String,
2140
2141    /// Makes the operation conditional on whether the object's current generation
2142    /// matches the given value. Setting to 0 makes the operation succeed only if
2143    /// there are no live versions of the object.
2144    pub if_generation_match: std::option::Option<i64>,
2145
2146    /// Makes the operation conditional on whether the object's live generation
2147    /// does not match the given value. If no live object exists, the precondition
2148    /// fails. Setting to 0 makes the operation succeed only if there is a live
2149    /// version of the object.
2150    pub if_generation_not_match: std::option::Option<i64>,
2151
2152    /// Makes the operation conditional on whether the destination object's current
2153    /// metageneration matches the given value.
2154    pub if_metageneration_match: std::option::Option<i64>,
2155
2156    /// Makes the operation conditional on whether the destination object's current
2157    /// metageneration does not match the given value.
2158    pub if_metageneration_not_match: std::option::Option<i64>,
2159
2160    /// Makes the operation conditional on whether the source object's live
2161    /// generation matches the given value.
2162    pub if_source_generation_match: std::option::Option<i64>,
2163
2164    /// Makes the operation conditional on whether the source object's live
2165    /// generation does not match the given value.
2166    pub if_source_generation_not_match: std::option::Option<i64>,
2167
2168    /// Makes the operation conditional on whether the source object's current
2169    /// metageneration matches the given value.
2170    pub if_source_metageneration_match: std::option::Option<i64>,
2171
2172    /// Makes the operation conditional on whether the source object's current
2173    /// metageneration does not match the given value.
2174    pub if_source_metageneration_not_match: std::option::Option<i64>,
2175
2176    /// Optional. The maximum number of bytes that will be rewritten per rewrite
2177    /// request. Most callers shouldn't need to specify this parameter - it is
2178    /// primarily in place to support testing. If specified the value must be an
2179    /// integral multiple of 1 MiB (1048576). Also, this only applies to requests
2180    /// where the source and destination span locations and/or storage classes.
2181    /// Finally, this value must not change across rewrite calls else you'll get an
2182    /// error that the `rewriteToken` is invalid.
2183    pub max_bytes_rewritten_per_call: i64,
2184
2185    /// Optional. The algorithm used to encrypt the source object, if any. Used if
2186    /// the source object was encrypted with a Customer-Supplied Encryption Key.
2187    pub copy_source_encryption_algorithm: std::string::String,
2188
2189    /// Optional. The raw bytes (not base64-encoded) AES-256 encryption key used to
2190    /// encrypt the source object, if it was encrypted with a Customer-Supplied
2191    /// Encryption Key.
2192    pub copy_source_encryption_key_bytes: ::bytes::Bytes,
2193
2194    /// Optional. The raw bytes (not base64-encoded) SHA256 hash of the encryption
2195    /// key used to encrypt the source object, if it was encrypted with a
2196    /// Customer-Supplied Encryption Key.
2197    pub copy_source_encryption_key_sha256_bytes: ::bytes::Bytes,
2198
2199    /// Optional. A set of parameters common to Storage API requests concerning an
2200    /// object.
2201    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
2202
2203    /// Optional. The checksums of the complete object. This will be used to
2204    /// validate the destination object after rewriting.
2205    pub object_checksums: std::option::Option<crate::model::ObjectChecksums>,
2206
2207    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2208}
2209
2210impl RewriteObjectRequest {
2211    pub fn new() -> Self {
2212        std::default::Default::default()
2213    }
2214
2215    /// Sets the value of [destination_name][crate::model::RewriteObjectRequest::destination_name].
2216    pub fn set_destination_name<T: std::convert::Into<std::string::String>>(
2217        mut self,
2218        v: T,
2219    ) -> Self {
2220        self.destination_name = v.into();
2221        self
2222    }
2223
2224    /// Sets the value of [destination_bucket][crate::model::RewriteObjectRequest::destination_bucket].
2225    pub fn set_destination_bucket<T: std::convert::Into<std::string::String>>(
2226        mut self,
2227        v: T,
2228    ) -> Self {
2229        self.destination_bucket = v.into();
2230        self
2231    }
2232
2233    /// Sets the value of [destination_kms_key][crate::model::RewriteObjectRequest::destination_kms_key].
2234    pub fn set_destination_kms_key<T: std::convert::Into<std::string::String>>(
2235        mut self,
2236        v: T,
2237    ) -> Self {
2238        self.destination_kms_key = v.into();
2239        self
2240    }
2241
2242    /// Sets the value of [destination][crate::model::RewriteObjectRequest::destination].
2243    pub fn set_destination<T>(mut self, v: T) -> Self
2244    where
2245        T: std::convert::Into<crate::model::Object>,
2246    {
2247        self.destination = std::option::Option::Some(v.into());
2248        self
2249    }
2250
2251    /// Sets or clears the value of [destination][crate::model::RewriteObjectRequest::destination].
2252    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
2253    where
2254        T: std::convert::Into<crate::model::Object>,
2255    {
2256        self.destination = v.map(|x| x.into());
2257        self
2258    }
2259
2260    /// Sets the value of [source_bucket][crate::model::RewriteObjectRequest::source_bucket].
2261    pub fn set_source_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2262        self.source_bucket = v.into();
2263        self
2264    }
2265
2266    /// Sets the value of [source_object][crate::model::RewriteObjectRequest::source_object].
2267    pub fn set_source_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2268        self.source_object = v.into();
2269        self
2270    }
2271
2272    /// Sets the value of [source_generation][crate::model::RewriteObjectRequest::source_generation].
2273    pub fn set_source_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2274        self.source_generation = v.into();
2275        self
2276    }
2277
2278    /// Sets the value of [rewrite_token][crate::model::RewriteObjectRequest::rewrite_token].
2279    pub fn set_rewrite_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2280        self.rewrite_token = v.into();
2281        self
2282    }
2283
2284    /// Sets the value of [destination_predefined_acl][crate::model::RewriteObjectRequest::destination_predefined_acl].
2285    pub fn set_destination_predefined_acl<T: std::convert::Into<std::string::String>>(
2286        mut self,
2287        v: T,
2288    ) -> Self {
2289        self.destination_predefined_acl = v.into();
2290        self
2291    }
2292
2293    /// Sets the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
2294    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2295    where
2296        T: std::convert::Into<i64>,
2297    {
2298        self.if_generation_match = std::option::Option::Some(v.into());
2299        self
2300    }
2301
2302    /// Sets or clears the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
2303    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2304    where
2305        T: std::convert::Into<i64>,
2306    {
2307        self.if_generation_match = v.map(|x| x.into());
2308        self
2309    }
2310
2311    /// Sets the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
2312    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2313    where
2314        T: std::convert::Into<i64>,
2315    {
2316        self.if_generation_not_match = std::option::Option::Some(v.into());
2317        self
2318    }
2319
2320    /// Sets or clears the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
2321    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2322    where
2323        T: std::convert::Into<i64>,
2324    {
2325        self.if_generation_not_match = v.map(|x| x.into());
2326        self
2327    }
2328
2329    /// Sets the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
2330    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2331    where
2332        T: std::convert::Into<i64>,
2333    {
2334        self.if_metageneration_match = std::option::Option::Some(v.into());
2335        self
2336    }
2337
2338    /// Sets or clears the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
2339    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2340    where
2341        T: std::convert::Into<i64>,
2342    {
2343        self.if_metageneration_match = v.map(|x| x.into());
2344        self
2345    }
2346
2347    /// Sets the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
2348    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2349    where
2350        T: std::convert::Into<i64>,
2351    {
2352        self.if_metageneration_not_match = std::option::Option::Some(v.into());
2353        self
2354    }
2355
2356    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
2357    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2358    where
2359        T: std::convert::Into<i64>,
2360    {
2361        self.if_metageneration_not_match = v.map(|x| x.into());
2362        self
2363    }
2364
2365    /// Sets the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
2366    pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2367    where
2368        T: std::convert::Into<i64>,
2369    {
2370        self.if_source_generation_match = std::option::Option::Some(v.into());
2371        self
2372    }
2373
2374    /// Sets or clears the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
2375    pub fn set_or_clear_if_source_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2376    where
2377        T: std::convert::Into<i64>,
2378    {
2379        self.if_source_generation_match = v.map(|x| x.into());
2380        self
2381    }
2382
2383    /// Sets the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
2384    pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2385    where
2386        T: std::convert::Into<i64>,
2387    {
2388        self.if_source_generation_not_match = std::option::Option::Some(v.into());
2389        self
2390    }
2391
2392    /// Sets or clears the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
2393    pub fn set_or_clear_if_source_generation_not_match<T>(
2394        mut self,
2395        v: std::option::Option<T>,
2396    ) -> Self
2397    where
2398        T: std::convert::Into<i64>,
2399    {
2400        self.if_source_generation_not_match = v.map(|x| x.into());
2401        self
2402    }
2403
2404    /// Sets the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
2405    pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2406    where
2407        T: std::convert::Into<i64>,
2408    {
2409        self.if_source_metageneration_match = std::option::Option::Some(v.into());
2410        self
2411    }
2412
2413    /// Sets or clears the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
2414    pub fn set_or_clear_if_source_metageneration_match<T>(
2415        mut self,
2416        v: std::option::Option<T>,
2417    ) -> Self
2418    where
2419        T: std::convert::Into<i64>,
2420    {
2421        self.if_source_metageneration_match = v.map(|x| x.into());
2422        self
2423    }
2424
2425    /// Sets the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
2426    pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2427    where
2428        T: std::convert::Into<i64>,
2429    {
2430        self.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2431        self
2432    }
2433
2434    /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
2435    pub fn set_or_clear_if_source_metageneration_not_match<T>(
2436        mut self,
2437        v: std::option::Option<T>,
2438    ) -> Self
2439    where
2440        T: std::convert::Into<i64>,
2441    {
2442        self.if_source_metageneration_not_match = v.map(|x| x.into());
2443        self
2444    }
2445
2446    /// Sets the value of [max_bytes_rewritten_per_call][crate::model::RewriteObjectRequest::max_bytes_rewritten_per_call].
2447    pub fn set_max_bytes_rewritten_per_call<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2448        self.max_bytes_rewritten_per_call = v.into();
2449        self
2450    }
2451
2452    /// Sets the value of [copy_source_encryption_algorithm][crate::model::RewriteObjectRequest::copy_source_encryption_algorithm].
2453    pub fn set_copy_source_encryption_algorithm<T: std::convert::Into<std::string::String>>(
2454        mut self,
2455        v: T,
2456    ) -> Self {
2457        self.copy_source_encryption_algorithm = v.into();
2458        self
2459    }
2460
2461    /// Sets the value of [copy_source_encryption_key_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_bytes].
2462    pub fn set_copy_source_encryption_key_bytes<T: std::convert::Into<::bytes::Bytes>>(
2463        mut self,
2464        v: T,
2465    ) -> Self {
2466        self.copy_source_encryption_key_bytes = v.into();
2467        self
2468    }
2469
2470    /// Sets the value of [copy_source_encryption_key_sha256_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_sha256_bytes].
2471    pub fn set_copy_source_encryption_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(
2472        mut self,
2473        v: T,
2474    ) -> Self {
2475        self.copy_source_encryption_key_sha256_bytes = v.into();
2476        self
2477    }
2478
2479    /// Sets the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
2480    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2481    where
2482        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2483    {
2484        self.common_object_request_params = std::option::Option::Some(v.into());
2485        self
2486    }
2487
2488    /// Sets or clears the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
2489    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
2490    where
2491        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2492    {
2493        self.common_object_request_params = v.map(|x| x.into());
2494        self
2495    }
2496
2497    /// Sets the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
2498    pub fn set_object_checksums<T>(mut self, v: T) -> Self
2499    where
2500        T: std::convert::Into<crate::model::ObjectChecksums>,
2501    {
2502        self.object_checksums = std::option::Option::Some(v.into());
2503        self
2504    }
2505
2506    /// Sets or clears the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
2507    pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
2508    where
2509        T: std::convert::Into<crate::model::ObjectChecksums>,
2510    {
2511        self.object_checksums = v.map(|x| x.into());
2512        self
2513    }
2514}
2515
2516impl wkt::message::Message for RewriteObjectRequest {
2517    fn typename() -> &'static str {
2518        "type.googleapis.com/google.storage.v2.RewriteObjectRequest"
2519    }
2520}
2521
2522/// A rewrite response.
2523#[derive(Clone, Default, PartialEq)]
2524#[non_exhaustive]
2525pub struct RewriteResponse {
2526    /// The total bytes written so far, which can be used to provide a waiting user
2527    /// with a progress indicator. This property is always present in the response.
2528    pub total_bytes_rewritten: i64,
2529
2530    /// The total size of the object being copied in bytes. This property is always
2531    /// present in the response.
2532    pub object_size: i64,
2533
2534    /// `true` if the copy is finished; otherwise, `false` if
2535    /// the copy is in progress. This property is always present in the response.
2536    pub done: bool,
2537
2538    /// A token to use in subsequent requests to continue copying data. This token
2539    /// is present in the response only when there is more data to copy.
2540    pub rewrite_token: std::string::String,
2541
2542    /// A resource containing the metadata for the copied-to object. This property
2543    /// is present in the response only when copying completes.
2544    pub resource: std::option::Option<crate::model::Object>,
2545
2546    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2547}
2548
2549impl RewriteResponse {
2550    pub fn new() -> Self {
2551        std::default::Default::default()
2552    }
2553
2554    /// Sets the value of [total_bytes_rewritten][crate::model::RewriteResponse::total_bytes_rewritten].
2555    pub fn set_total_bytes_rewritten<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2556        self.total_bytes_rewritten = v.into();
2557        self
2558    }
2559
2560    /// Sets the value of [object_size][crate::model::RewriteResponse::object_size].
2561    pub fn set_object_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2562        self.object_size = v.into();
2563        self
2564    }
2565
2566    /// Sets the value of [done][crate::model::RewriteResponse::done].
2567    pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2568        self.done = v.into();
2569        self
2570    }
2571
2572    /// Sets the value of [rewrite_token][crate::model::RewriteResponse::rewrite_token].
2573    pub fn set_rewrite_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2574        self.rewrite_token = v.into();
2575        self
2576    }
2577
2578    /// Sets the value of [resource][crate::model::RewriteResponse::resource].
2579    pub fn set_resource<T>(mut self, v: T) -> Self
2580    where
2581        T: std::convert::Into<crate::model::Object>,
2582    {
2583        self.resource = std::option::Option::Some(v.into());
2584        self
2585    }
2586
2587    /// Sets or clears the value of [resource][crate::model::RewriteResponse::resource].
2588    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2589    where
2590        T: std::convert::Into<crate::model::Object>,
2591    {
2592        self.resource = v.map(|x| x.into());
2593        self
2594    }
2595}
2596
2597impl wkt::message::Message for RewriteResponse {
2598    fn typename() -> &'static str {
2599        "type.googleapis.com/google.storage.v2.RewriteResponse"
2600    }
2601}
2602
2603/// Request message for MoveObject.
2604#[derive(Clone, Default, PartialEq)]
2605#[non_exhaustive]
2606pub struct MoveObjectRequest {
2607    /// Required. Name of the bucket in which the object resides.
2608    pub bucket: std::string::String,
2609
2610    /// Required. Name of the source object.
2611    pub source_object: std::string::String,
2612
2613    /// Required. Name of the destination object.
2614    pub destination_object: std::string::String,
2615
2616    /// Optional. Makes the operation conditional on whether the source object's
2617    /// current generation matches the given value. `if_source_generation_match`
2618    /// and `if_source_generation_not_match` conditions are mutually exclusive:
2619    /// it's an error for both of them to be set in the request.
2620    pub if_source_generation_match: std::option::Option<i64>,
2621
2622    /// Optional. Makes the operation conditional on whether the source object's
2623    /// current generation does not match the given value.
2624    /// `if_source_generation_match` and `if_source_generation_not_match`
2625    /// conditions are mutually exclusive: it's an error for both of them to be set
2626    /// in the request.
2627    pub if_source_generation_not_match: std::option::Option<i64>,
2628
2629    /// Optional. Makes the operation conditional on whether the source object's
2630    /// current metageneration matches the given value.
2631    /// `if_source_metageneration_match` and `if_source_metageneration_not_match`
2632    /// conditions are mutually exclusive: it's an error for both of them to be set
2633    /// in the request.
2634    pub if_source_metageneration_match: std::option::Option<i64>,
2635
2636    /// Optional. Makes the operation conditional on whether the source object's
2637    /// current metageneration does not match the given value.
2638    /// `if_source_metageneration_match` and `if_source_metageneration_not_match`
2639    /// conditions are mutually exclusive: it's an error for both of them to be set
2640    /// in the request.
2641    pub if_source_metageneration_not_match: std::option::Option<i64>,
2642
2643    /// Optional. Makes the operation conditional on whether the destination
2644    /// object's current generation matches the given value. Setting to 0 makes the
2645    /// operation succeed only if there are no live versions of the object.
2646    /// `if_generation_match` and `if_generation_not_match` conditions are mutually
2647    /// exclusive: it's an error for both of them to be set in the request.
2648    pub if_generation_match: std::option::Option<i64>,
2649
2650    /// Optional. Makes the operation conditional on whether the destination
2651    /// object's current generation does not match the given value. If no live
2652    /// object exists, the precondition fails. Setting to 0 makes the operation
2653    /// succeed only if there is a live version of the object.
2654    /// `if_generation_match` and `if_generation_not_match` conditions are mutually
2655    /// exclusive: it's an error for both of them to be set in the request.
2656    pub if_generation_not_match: std::option::Option<i64>,
2657
2658    /// Optional. Makes the operation conditional on whether the destination
2659    /// object's current metageneration matches the given value.
2660    /// `if_metageneration_match` and `if_metageneration_not_match` conditions are
2661    /// mutually exclusive: it's an error for both of them to be set in the
2662    /// request.
2663    pub if_metageneration_match: std::option::Option<i64>,
2664
2665    /// Optional. Makes the operation conditional on whether the destination
2666    /// object's current metageneration does not match the given value.
2667    /// `if_metageneration_match` and `if_metageneration_not_match` conditions are
2668    /// mutually exclusive: it's an error for both of them to be set in the
2669    /// request.
2670    pub if_metageneration_not_match: std::option::Option<i64>,
2671
2672    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2673}
2674
2675impl MoveObjectRequest {
2676    pub fn new() -> Self {
2677        std::default::Default::default()
2678    }
2679
2680    /// Sets the value of [bucket][crate::model::MoveObjectRequest::bucket].
2681    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2682        self.bucket = v.into();
2683        self
2684    }
2685
2686    /// Sets the value of [source_object][crate::model::MoveObjectRequest::source_object].
2687    pub fn set_source_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2688        self.source_object = v.into();
2689        self
2690    }
2691
2692    /// Sets the value of [destination_object][crate::model::MoveObjectRequest::destination_object].
2693    pub fn set_destination_object<T: std::convert::Into<std::string::String>>(
2694        mut self,
2695        v: T,
2696    ) -> Self {
2697        self.destination_object = v.into();
2698        self
2699    }
2700
2701    /// Sets the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
2702    pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2703    where
2704        T: std::convert::Into<i64>,
2705    {
2706        self.if_source_generation_match = std::option::Option::Some(v.into());
2707        self
2708    }
2709
2710    /// Sets or clears the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
2711    pub fn set_or_clear_if_source_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2712    where
2713        T: std::convert::Into<i64>,
2714    {
2715        self.if_source_generation_match = v.map(|x| x.into());
2716        self
2717    }
2718
2719    /// Sets the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
2720    pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2721    where
2722        T: std::convert::Into<i64>,
2723    {
2724        self.if_source_generation_not_match = std::option::Option::Some(v.into());
2725        self
2726    }
2727
2728    /// Sets or clears the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
2729    pub fn set_or_clear_if_source_generation_not_match<T>(
2730        mut self,
2731        v: std::option::Option<T>,
2732    ) -> Self
2733    where
2734        T: std::convert::Into<i64>,
2735    {
2736        self.if_source_generation_not_match = v.map(|x| x.into());
2737        self
2738    }
2739
2740    /// Sets the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
2741    pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2742    where
2743        T: std::convert::Into<i64>,
2744    {
2745        self.if_source_metageneration_match = std::option::Option::Some(v.into());
2746        self
2747    }
2748
2749    /// Sets or clears the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
2750    pub fn set_or_clear_if_source_metageneration_match<T>(
2751        mut self,
2752        v: std::option::Option<T>,
2753    ) -> Self
2754    where
2755        T: std::convert::Into<i64>,
2756    {
2757        self.if_source_metageneration_match = v.map(|x| x.into());
2758        self
2759    }
2760
2761    /// Sets the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
2762    pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2763    where
2764        T: std::convert::Into<i64>,
2765    {
2766        self.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2767        self
2768    }
2769
2770    /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
2771    pub fn set_or_clear_if_source_metageneration_not_match<T>(
2772        mut self,
2773        v: std::option::Option<T>,
2774    ) -> Self
2775    where
2776        T: std::convert::Into<i64>,
2777    {
2778        self.if_source_metageneration_not_match = v.map(|x| x.into());
2779        self
2780    }
2781
2782    /// Sets the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
2783    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2784    where
2785        T: std::convert::Into<i64>,
2786    {
2787        self.if_generation_match = std::option::Option::Some(v.into());
2788        self
2789    }
2790
2791    /// Sets or clears the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
2792    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2793    where
2794        T: std::convert::Into<i64>,
2795    {
2796        self.if_generation_match = v.map(|x| x.into());
2797        self
2798    }
2799
2800    /// Sets the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
2801    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2802    where
2803        T: std::convert::Into<i64>,
2804    {
2805        self.if_generation_not_match = std::option::Option::Some(v.into());
2806        self
2807    }
2808
2809    /// Sets or clears the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
2810    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2811    where
2812        T: std::convert::Into<i64>,
2813    {
2814        self.if_generation_not_match = v.map(|x| x.into());
2815        self
2816    }
2817
2818    /// Sets the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
2819    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2820    where
2821        T: std::convert::Into<i64>,
2822    {
2823        self.if_metageneration_match = std::option::Option::Some(v.into());
2824        self
2825    }
2826
2827    /// Sets or clears the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
2828    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2829    where
2830        T: std::convert::Into<i64>,
2831    {
2832        self.if_metageneration_match = v.map(|x| x.into());
2833        self
2834    }
2835
2836    /// Sets the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
2837    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2838    where
2839        T: std::convert::Into<i64>,
2840    {
2841        self.if_metageneration_not_match = std::option::Option::Some(v.into());
2842        self
2843    }
2844
2845    /// Sets or clears the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
2846    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2847    where
2848        T: std::convert::Into<i64>,
2849    {
2850        self.if_metageneration_not_match = v.map(|x| x.into());
2851        self
2852    }
2853}
2854
2855impl wkt::message::Message for MoveObjectRequest {
2856    fn typename() -> &'static str {
2857        "type.googleapis.com/google.storage.v2.MoveObjectRequest"
2858    }
2859}
2860
2861/// Request message for UpdateObject.
2862#[derive(Clone, Default, PartialEq)]
2863#[non_exhaustive]
2864pub struct UpdateObjectRequest {
2865    /// Required. The object to update.
2866    /// The object's bucket and name fields are used to identify the object to
2867    /// update. If present, the object's generation field selects a specific
2868    /// revision of this object whose metadata should be updated. Otherwise,
2869    /// assumes the live version of the object.
2870    pub object: std::option::Option<crate::model::Object>,
2871
2872    /// Makes the operation conditional on whether the object's current generation
2873    /// matches the given value. Setting to 0 makes the operation succeed only if
2874    /// there are no live versions of the object.
2875    pub if_generation_match: std::option::Option<i64>,
2876
2877    /// Makes the operation conditional on whether the object's live generation
2878    /// does not match the given value. If no live object exists, the precondition
2879    /// fails. Setting to 0 makes the operation succeed only if there is a live
2880    /// version of the object.
2881    pub if_generation_not_match: std::option::Option<i64>,
2882
2883    /// Makes the operation conditional on whether the object's current
2884    /// metageneration matches the given value.
2885    pub if_metageneration_match: std::option::Option<i64>,
2886
2887    /// Makes the operation conditional on whether the object's current
2888    /// metageneration does not match the given value.
2889    pub if_metageneration_not_match: std::option::Option<i64>,
2890
2891    /// Optional. Apply a predefined set of access controls to this object.
2892    /// Valid values are "authenticatedRead", "bucketOwnerFullControl",
2893    /// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
2894    pub predefined_acl: std::string::String,
2895
2896    /// Required. List of fields to be updated.
2897    ///
2898    /// To specify ALL fields, equivalent to the JSON API's "update" function,
2899    /// specify a single field with the value `*`. Note: not recommended. If a new
2900    /// field is introduced at a later time, an older client updating with the `*`
2901    /// may accidentally reset the new field's value.
2902    ///
2903    /// Not specifying any fields is an error.
2904    pub update_mask: std::option::Option<wkt::FieldMask>,
2905
2906    /// Optional. A set of parameters common to Storage API requests concerning an
2907    /// object.
2908    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,
2909
2910    /// Optional. Overrides the unlocked retention config on the object.
2911    pub override_unlocked_retention: bool,
2912
2913    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2914}
2915
2916impl UpdateObjectRequest {
2917    pub fn new() -> Self {
2918        std::default::Default::default()
2919    }
2920
2921    /// Sets the value of [object][crate::model::UpdateObjectRequest::object].
2922    pub fn set_object<T>(mut self, v: T) -> Self
2923    where
2924        T: std::convert::Into<crate::model::Object>,
2925    {
2926        self.object = std::option::Option::Some(v.into());
2927        self
2928    }
2929
2930    /// Sets or clears the value of [object][crate::model::UpdateObjectRequest::object].
2931    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2932    where
2933        T: std::convert::Into<crate::model::Object>,
2934    {
2935        self.object = v.map(|x| x.into());
2936        self
2937    }
2938
2939    /// Sets the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
2940    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2941    where
2942        T: std::convert::Into<i64>,
2943    {
2944        self.if_generation_match = std::option::Option::Some(v.into());
2945        self
2946    }
2947
2948    /// Sets or clears the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
2949    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2950    where
2951        T: std::convert::Into<i64>,
2952    {
2953        self.if_generation_match = v.map(|x| x.into());
2954        self
2955    }
2956
2957    /// Sets the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
2958    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2959    where
2960        T: std::convert::Into<i64>,
2961    {
2962        self.if_generation_not_match = std::option::Option::Some(v.into());
2963        self
2964    }
2965
2966    /// Sets or clears the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
2967    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2968    where
2969        T: std::convert::Into<i64>,
2970    {
2971        self.if_generation_not_match = v.map(|x| x.into());
2972        self
2973    }
2974
2975    /// Sets the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
2976    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2977    where
2978        T: std::convert::Into<i64>,
2979    {
2980        self.if_metageneration_match = std::option::Option::Some(v.into());
2981        self
2982    }
2983
2984    /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
2985    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2986    where
2987        T: std::convert::Into<i64>,
2988    {
2989        self.if_metageneration_match = v.map(|x| x.into());
2990        self
2991    }
2992
2993    /// Sets the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
2994    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2995    where
2996        T: std::convert::Into<i64>,
2997    {
2998        self.if_metageneration_not_match = std::option::Option::Some(v.into());
2999        self
3000    }
3001
3002    /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
3003    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
3004    where
3005        T: std::convert::Into<i64>,
3006    {
3007        self.if_metageneration_not_match = v.map(|x| x.into());
3008        self
3009    }
3010
3011    /// Sets the value of [predefined_acl][crate::model::UpdateObjectRequest::predefined_acl].
3012    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3013        self.predefined_acl = v.into();
3014        self
3015    }
3016
3017    /// Sets the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
3018    pub fn set_update_mask<T>(mut self, v: T) -> Self
3019    where
3020        T: std::convert::Into<wkt::FieldMask>,
3021    {
3022        self.update_mask = std::option::Option::Some(v.into());
3023        self
3024    }
3025
3026    /// Sets or clears the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
3027    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3028    where
3029        T: std::convert::Into<wkt::FieldMask>,
3030    {
3031        self.update_mask = v.map(|x| x.into());
3032        self
3033    }
3034
3035    /// Sets the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
3036    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
3037    where
3038        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
3039    {
3040        self.common_object_request_params = std::option::Option::Some(v.into());
3041        self
3042    }
3043
3044    /// Sets or clears the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
3045    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
3046    where
3047        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
3048    {
3049        self.common_object_request_params = v.map(|x| x.into());
3050        self
3051    }
3052
3053    /// Sets the value of [override_unlocked_retention][crate::model::UpdateObjectRequest::override_unlocked_retention].
3054    pub fn set_override_unlocked_retention<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3055        self.override_unlocked_retention = v.into();
3056        self
3057    }
3058}
3059
3060impl wkt::message::Message for UpdateObjectRequest {
3061    fn typename() -> &'static str {
3062        "type.googleapis.com/google.storage.v2.UpdateObjectRequest"
3063    }
3064}
3065
3066/// Parameters that can be passed to any object request.
3067#[derive(Clone, Default, PartialEq)]
3068#[non_exhaustive]
3069pub struct CommonObjectRequestParams {
3070    /// Optional. Encryption algorithm used with the Customer-Supplied Encryption
3071    /// Keys feature.
3072    pub encryption_algorithm: std::string::String,
3073
3074    /// Optional. Encryption key used with the Customer-Supplied Encryption Keys
3075    /// feature. In raw bytes format (not base64-encoded).
3076    pub encryption_key_bytes: ::bytes::Bytes,
3077
3078    /// Optional. SHA256 hash of encryption key used with the Customer-Supplied
3079    /// Encryption Keys feature.
3080    pub encryption_key_sha256_bytes: ::bytes::Bytes,
3081
3082    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3083}
3084
3085impl CommonObjectRequestParams {
3086    pub fn new() -> Self {
3087        std::default::Default::default()
3088    }
3089
3090    /// Sets the value of [encryption_algorithm][crate::model::CommonObjectRequestParams::encryption_algorithm].
3091    pub fn set_encryption_algorithm<T: std::convert::Into<std::string::String>>(
3092        mut self,
3093        v: T,
3094    ) -> Self {
3095        self.encryption_algorithm = v.into();
3096        self
3097    }
3098
3099    /// Sets the value of [encryption_key_bytes][crate::model::CommonObjectRequestParams::encryption_key_bytes].
3100    pub fn set_encryption_key_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
3101        self.encryption_key_bytes = v.into();
3102        self
3103    }
3104
3105    /// Sets the value of [encryption_key_sha256_bytes][crate::model::CommonObjectRequestParams::encryption_key_sha256_bytes].
3106    pub fn set_encryption_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(
3107        mut self,
3108        v: T,
3109    ) -> Self {
3110        self.encryption_key_sha256_bytes = v.into();
3111        self
3112    }
3113}
3114
3115impl wkt::message::Message for CommonObjectRequestParams {
3116    fn typename() -> &'static str {
3117        "type.googleapis.com/google.storage.v2.CommonObjectRequestParams"
3118    }
3119}
3120
3121/// A bucket.
3122#[derive(Clone, Default, PartialEq)]
3123#[non_exhaustive]
3124pub struct Bucket {
3125    /// Identifier. The name of the bucket.
3126    /// Format: `projects/{project}/buckets/{bucket}`
3127    pub name: std::string::String,
3128
3129    /// Output only. The user-chosen part of the bucket name. The `{bucket}`
3130    /// portion of the `name` field. For globally unique buckets, this is equal to
3131    /// the "bucket name" of other Cloud Storage APIs. Example: "pub".
3132    pub bucket_id: std::string::String,
3133
3134    /// The etag of the bucket.
3135    /// If included in the metadata of an UpdateBucketRequest, the operation will
3136    /// only be performed if the etag matches that of the bucket.
3137    pub etag: std::string::String,
3138
3139    /// Immutable. The project which owns this bucket, in the format of
3140    /// "projects/{projectIdentifier}".
3141    /// {projectIdentifier} can be the project ID or project number.
3142    /// Output values will always be in project number format.
3143    pub project: std::string::String,
3144
3145    /// Output only. The metadata generation of this bucket.
3146    pub metageneration: i64,
3147
3148    /// Immutable. The location of the bucket. Object data for objects in the
3149    /// bucket resides in physical storage within this region.  Defaults to `US`.
3150    /// See the
3151    /// [<https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations>"][developer's
3152    /// guide] for the authoritative list. Attempting to update this field after
3153    /// the bucket is created will result in an error.
3154    pub location: std::string::String,
3155
3156    /// Output only. The location type of the bucket (region, dual-region,
3157    /// multi-region, etc).
3158    pub location_type: std::string::String,
3159
3160    /// Optional. The bucket's default storage class, used whenever no storageClass
3161    /// is specified for a newly-created object. This defines how objects in the
3162    /// bucket are stored and determines the SLA and the cost of storage.
3163    /// If this value is not specified when the bucket is created, it will default
3164    /// to `STANDARD`. For more information, see
3165    /// <https://developers.google.com/storage/docs/storage-classes>.
3166    pub storage_class: std::string::String,
3167
3168    /// Optional. The recovery point objective for cross-region replication of the
3169    /// bucket. Applicable only for dual- and multi-region buckets. "DEFAULT" uses
3170    /// default replication. "ASYNC_TURBO" enables turbo replication, valid for
3171    /// dual-region buckets only. If rpo is not specified when the bucket is
3172    /// created, it defaults to "DEFAULT". For more information, see
3173    /// <https://cloud.google.com/storage/docs/availability-durability#turbo-replication>.
3174    pub rpo: std::string::String,
3175
3176    /// Optional. Access controls on the bucket.
3177    /// If iam_config.uniform_bucket_level_access is enabled on this bucket,
3178    /// requests to set, read, or modify acl is an error.
3179    pub acl: std::vec::Vec<crate::model::BucketAccessControl>,
3180
3181    /// Optional. Default access controls to apply to new objects when no ACL is
3182    /// provided. If iam_config.uniform_bucket_level_access is enabled on this
3183    /// bucket, requests to set, read, or modify acl is an error.
3184    pub default_object_acl: std::vec::Vec<crate::model::ObjectAccessControl>,
3185
3186    /// Optional. The bucket's lifecycle config. See
3187    /// [<https://developers.google.com/storage/docs/lifecycle>]Lifecycle Management]
3188    /// for more information.
3189    pub lifecycle: std::option::Option<crate::model::bucket::Lifecycle>,
3190
3191    /// Output only. The creation time of the bucket.
3192    pub create_time: std::option::Option<wkt::Timestamp>,
3193
3194    /// Optional. The bucket's [<https://www.w3.org/TR/cors/>][Cross-Origin Resource
3195    /// Sharing] (CORS) config.
3196    pub cors: std::vec::Vec<crate::model::bucket::Cors>,
3197
3198    /// Output only. The modification time of the bucket.
3199    pub update_time: std::option::Option<wkt::Timestamp>,
3200
3201    /// Optional. The default value for event-based hold on newly created objects
3202    /// in this bucket.  Event-based hold is a way to retain objects indefinitely
3203    /// until an event occurs, signified by the hold's release. After being
3204    /// released, such objects will be subject to bucket-level retention (if any).
3205    /// One sample use case of this flag is for banks to hold loan documents for at
3206    /// least 3 years after loan is paid in full. Here, bucket-level retention is 3
3207    /// years and the event is loan being paid in full. In this example, these
3208    /// objects will be held intact for any number of years until the event has
3209    /// occurred (event-based hold on the object is released) and then 3 more years
3210    /// after that. That means retention duration of the objects begins from the
3211    /// moment event-based hold transitioned from true to false.  Objects under
3212    /// event-based hold cannot be deleted, overwritten or archived until the hold
3213    /// is removed.
3214    pub default_event_based_hold: bool,
3215
3216    /// Optional. User-provided labels, in key/value pairs.
3217    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3218
3219    /// Optional. The bucket's website config, controlling how the service behaves
3220    /// when accessing bucket contents as a web site. See the
3221    /// [<https://cloud.google.com/storage/docs/static-website>][Static Website
3222    /// Examples] for more information.
3223    pub website: std::option::Option<crate::model::bucket::Website>,
3224
3225    /// Optional. The bucket's versioning config.
3226    pub versioning: std::option::Option<crate::model::bucket::Versioning>,
3227
3228    /// Optional. The bucket's logging config, which defines the destination bucket
3229    /// and name prefix (if any) for the current bucket's logs.
3230    pub logging: std::option::Option<crate::model::bucket::Logging>,
3231
3232    /// Output only. The owner of the bucket. This is always the project team's
3233    /// owner group.
3234    pub owner: std::option::Option<crate::model::Owner>,
3235
3236    /// Optional. Encryption config for a bucket.
3237    pub encryption: std::option::Option<crate::model::bucket::Encryption>,
3238
3239    /// Optional. The bucket's billing config.
3240    pub billing: std::option::Option<crate::model::bucket::Billing>,
3241
3242    /// Optional. The bucket's retention policy. The retention policy enforces a
3243    /// minimum retention time for all objects contained in the bucket, based on
3244    /// their creation time. Any attempt to overwrite or delete objects younger
3245    /// than the retention period will result in a PERMISSION_DENIED error.  An
3246    /// unlocked retention policy can be modified or removed from the bucket via a
3247    /// storage.buckets.update operation. A locked retention policy cannot be
3248    /// removed or shortened in duration for the lifetime of the bucket.
3249    /// Attempting to remove or decrease period of a locked retention policy will
3250    /// result in a PERMISSION_DENIED error.
3251    pub retention_policy: std::option::Option<crate::model::bucket::RetentionPolicy>,
3252
3253    /// Optional. The bucket's IAM config.
3254    pub iam_config: std::option::Option<crate::model::bucket::IamConfig>,
3255
3256    /// Optional. Reserved for future use.
3257    pub satisfies_pzs: bool,
3258
3259    /// Optional. Configuration that, if present, specifies the data placement for
3260    /// a
3261    /// [<https://cloud.google.com/storage/docs/locations#location-dr>][configurable
3262    /// dual-region].
3263    pub custom_placement_config: std::option::Option<crate::model::bucket::CustomPlacementConfig>,
3264
3265    /// Optional. The bucket's Autoclass configuration. If there is no
3266    /// configuration, the Autoclass feature will be disabled and have no effect on
3267    /// the bucket.
3268    pub autoclass: std::option::Option<crate::model::bucket::Autoclass>,
3269
3270    /// Optional. The bucket's hierarchical namespace configuration. If there is no
3271    /// configuration, the hierarchical namespace feature will be disabled and have
3272    /// no effect on the bucket.
3273    pub hierarchical_namespace: std::option::Option<crate::model::bucket::HierarchicalNamespace>,
3274
3275    /// Optional. The bucket's soft delete policy. The soft delete policy prevents
3276    /// soft-deleted objects from being permanently deleted.
3277    pub soft_delete_policy: std::option::Option<crate::model::bucket::SoftDeletePolicy>,
3278
3279    /// Optional. The bucket's object retention configuration. Must be enabled
3280    /// before objects in the bucket may have retention configured.
3281    pub object_retention: std::option::Option<crate::model::bucket::ObjectRetention>,
3282
3283    /// Optional. The bucket's IP filter configuration.
3284    pub ip_filter: std::option::Option<crate::model::bucket::IpFilter>,
3285
3286    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3287}
3288
3289impl Bucket {
3290    pub fn new() -> Self {
3291        std::default::Default::default()
3292    }
3293
3294    /// Sets the value of [name][crate::model::Bucket::name].
3295    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3296        self.name = v.into();
3297        self
3298    }
3299
3300    /// Sets the value of [bucket_id][crate::model::Bucket::bucket_id].
3301    pub fn set_bucket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3302        self.bucket_id = v.into();
3303        self
3304    }
3305
3306    /// Sets the value of [etag][crate::model::Bucket::etag].
3307    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3308        self.etag = v.into();
3309        self
3310    }
3311
3312    /// Sets the value of [project][crate::model::Bucket::project].
3313    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3314        self.project = v.into();
3315        self
3316    }
3317
3318    /// Sets the value of [metageneration][crate::model::Bucket::metageneration].
3319    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3320        self.metageneration = v.into();
3321        self
3322    }
3323
3324    /// Sets the value of [location][crate::model::Bucket::location].
3325    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3326        self.location = v.into();
3327        self
3328    }
3329
3330    /// Sets the value of [location_type][crate::model::Bucket::location_type].
3331    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3332        self.location_type = v.into();
3333        self
3334    }
3335
3336    /// Sets the value of [storage_class][crate::model::Bucket::storage_class].
3337    pub fn set_storage_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3338        self.storage_class = v.into();
3339        self
3340    }
3341
3342    /// Sets the value of [rpo][crate::model::Bucket::rpo].
3343    pub fn set_rpo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3344        self.rpo = v.into();
3345        self
3346    }
3347
3348    /// Sets the value of [acl][crate::model::Bucket::acl].
3349    pub fn set_acl<T, V>(mut self, v: T) -> Self
3350    where
3351        T: std::iter::IntoIterator<Item = V>,
3352        V: std::convert::Into<crate::model::BucketAccessControl>,
3353    {
3354        use std::iter::Iterator;
3355        self.acl = v.into_iter().map(|i| i.into()).collect();
3356        self
3357    }
3358
3359    /// Sets the value of [default_object_acl][crate::model::Bucket::default_object_acl].
3360    pub fn set_default_object_acl<T, V>(mut self, v: T) -> Self
3361    where
3362        T: std::iter::IntoIterator<Item = V>,
3363        V: std::convert::Into<crate::model::ObjectAccessControl>,
3364    {
3365        use std::iter::Iterator;
3366        self.default_object_acl = v.into_iter().map(|i| i.into()).collect();
3367        self
3368    }
3369
3370    /// Sets the value of [lifecycle][crate::model::Bucket::lifecycle].
3371    pub fn set_lifecycle<T>(mut self, v: T) -> Self
3372    where
3373        T: std::convert::Into<crate::model::bucket::Lifecycle>,
3374    {
3375        self.lifecycle = std::option::Option::Some(v.into());
3376        self
3377    }
3378
3379    /// Sets or clears the value of [lifecycle][crate::model::Bucket::lifecycle].
3380    pub fn set_or_clear_lifecycle<T>(mut self, v: std::option::Option<T>) -> Self
3381    where
3382        T: std::convert::Into<crate::model::bucket::Lifecycle>,
3383    {
3384        self.lifecycle = v.map(|x| x.into());
3385        self
3386    }
3387
3388    /// Sets the value of [create_time][crate::model::Bucket::create_time].
3389    pub fn set_create_time<T>(mut self, v: T) -> Self
3390    where
3391        T: std::convert::Into<wkt::Timestamp>,
3392    {
3393        self.create_time = std::option::Option::Some(v.into());
3394        self
3395    }
3396
3397    /// Sets or clears the value of [create_time][crate::model::Bucket::create_time].
3398    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3399    where
3400        T: std::convert::Into<wkt::Timestamp>,
3401    {
3402        self.create_time = v.map(|x| x.into());
3403        self
3404    }
3405
3406    /// Sets the value of [cors][crate::model::Bucket::cors].
3407    pub fn set_cors<T, V>(mut self, v: T) -> Self
3408    where
3409        T: std::iter::IntoIterator<Item = V>,
3410        V: std::convert::Into<crate::model::bucket::Cors>,
3411    {
3412        use std::iter::Iterator;
3413        self.cors = v.into_iter().map(|i| i.into()).collect();
3414        self
3415    }
3416
3417    /// Sets the value of [update_time][crate::model::Bucket::update_time].
3418    pub fn set_update_time<T>(mut self, v: T) -> Self
3419    where
3420        T: std::convert::Into<wkt::Timestamp>,
3421    {
3422        self.update_time = std::option::Option::Some(v.into());
3423        self
3424    }
3425
3426    /// Sets or clears the value of [update_time][crate::model::Bucket::update_time].
3427    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3428    where
3429        T: std::convert::Into<wkt::Timestamp>,
3430    {
3431        self.update_time = v.map(|x| x.into());
3432        self
3433    }
3434
3435    /// Sets the value of [default_event_based_hold][crate::model::Bucket::default_event_based_hold].
3436    pub fn set_default_event_based_hold<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3437        self.default_event_based_hold = v.into();
3438        self
3439    }
3440
3441    /// Sets the value of [labels][crate::model::Bucket::labels].
3442    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3443    where
3444        T: std::iter::IntoIterator<Item = (K, V)>,
3445        K: std::convert::Into<std::string::String>,
3446        V: std::convert::Into<std::string::String>,
3447    {
3448        use std::iter::Iterator;
3449        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3450        self
3451    }
3452
3453    /// Sets the value of [website][crate::model::Bucket::website].
3454    pub fn set_website<T>(mut self, v: T) -> Self
3455    where
3456        T: std::convert::Into<crate::model::bucket::Website>,
3457    {
3458        self.website = std::option::Option::Some(v.into());
3459        self
3460    }
3461
3462    /// Sets or clears the value of [website][crate::model::Bucket::website].
3463    pub fn set_or_clear_website<T>(mut self, v: std::option::Option<T>) -> Self
3464    where
3465        T: std::convert::Into<crate::model::bucket::Website>,
3466    {
3467        self.website = v.map(|x| x.into());
3468        self
3469    }
3470
3471    /// Sets the value of [versioning][crate::model::Bucket::versioning].
3472    pub fn set_versioning<T>(mut self, v: T) -> Self
3473    where
3474        T: std::convert::Into<crate::model::bucket::Versioning>,
3475    {
3476        self.versioning = std::option::Option::Some(v.into());
3477        self
3478    }
3479
3480    /// Sets or clears the value of [versioning][crate::model::Bucket::versioning].
3481    pub fn set_or_clear_versioning<T>(mut self, v: std::option::Option<T>) -> Self
3482    where
3483        T: std::convert::Into<crate::model::bucket::Versioning>,
3484    {
3485        self.versioning = v.map(|x| x.into());
3486        self
3487    }
3488
3489    /// Sets the value of [logging][crate::model::Bucket::logging].
3490    pub fn set_logging<T>(mut self, v: T) -> Self
3491    where
3492        T: std::convert::Into<crate::model::bucket::Logging>,
3493    {
3494        self.logging = std::option::Option::Some(v.into());
3495        self
3496    }
3497
3498    /// Sets or clears the value of [logging][crate::model::Bucket::logging].
3499    pub fn set_or_clear_logging<T>(mut self, v: std::option::Option<T>) -> Self
3500    where
3501        T: std::convert::Into<crate::model::bucket::Logging>,
3502    {
3503        self.logging = v.map(|x| x.into());
3504        self
3505    }
3506
3507    /// Sets the value of [owner][crate::model::Bucket::owner].
3508    pub fn set_owner<T>(mut self, v: T) -> Self
3509    where
3510        T: std::convert::Into<crate::model::Owner>,
3511    {
3512        self.owner = std::option::Option::Some(v.into());
3513        self
3514    }
3515
3516    /// Sets or clears the value of [owner][crate::model::Bucket::owner].
3517    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
3518    where
3519        T: std::convert::Into<crate::model::Owner>,
3520    {
3521        self.owner = v.map(|x| x.into());
3522        self
3523    }
3524
3525    /// Sets the value of [encryption][crate::model::Bucket::encryption].
3526    pub fn set_encryption<T>(mut self, v: T) -> Self
3527    where
3528        T: std::convert::Into<crate::model::bucket::Encryption>,
3529    {
3530        self.encryption = std::option::Option::Some(v.into());
3531        self
3532    }
3533
3534    /// Sets or clears the value of [encryption][crate::model::Bucket::encryption].
3535    pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
3536    where
3537        T: std::convert::Into<crate::model::bucket::Encryption>,
3538    {
3539        self.encryption = v.map(|x| x.into());
3540        self
3541    }
3542
3543    /// Sets the value of [billing][crate::model::Bucket::billing].
3544    pub fn set_billing<T>(mut self, v: T) -> Self
3545    where
3546        T: std::convert::Into<crate::model::bucket::Billing>,
3547    {
3548        self.billing = std::option::Option::Some(v.into());
3549        self
3550    }
3551
3552    /// Sets or clears the value of [billing][crate::model::Bucket::billing].
3553    pub fn set_or_clear_billing<T>(mut self, v: std::option::Option<T>) -> Self
3554    where
3555        T: std::convert::Into<crate::model::bucket::Billing>,
3556    {
3557        self.billing = v.map(|x| x.into());
3558        self
3559    }
3560
3561    /// Sets the value of [retention_policy][crate::model::Bucket::retention_policy].
3562    pub fn set_retention_policy<T>(mut self, v: T) -> Self
3563    where
3564        T: std::convert::Into<crate::model::bucket::RetentionPolicy>,
3565    {
3566        self.retention_policy = std::option::Option::Some(v.into());
3567        self
3568    }
3569
3570    /// Sets or clears the value of [retention_policy][crate::model::Bucket::retention_policy].
3571    pub fn set_or_clear_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3572    where
3573        T: std::convert::Into<crate::model::bucket::RetentionPolicy>,
3574    {
3575        self.retention_policy = v.map(|x| x.into());
3576        self
3577    }
3578
3579    /// Sets the value of [iam_config][crate::model::Bucket::iam_config].
3580    pub fn set_iam_config<T>(mut self, v: T) -> Self
3581    where
3582        T: std::convert::Into<crate::model::bucket::IamConfig>,
3583    {
3584        self.iam_config = std::option::Option::Some(v.into());
3585        self
3586    }
3587
3588    /// Sets or clears the value of [iam_config][crate::model::Bucket::iam_config].
3589    pub fn set_or_clear_iam_config<T>(mut self, v: std::option::Option<T>) -> Self
3590    where
3591        T: std::convert::Into<crate::model::bucket::IamConfig>,
3592    {
3593        self.iam_config = v.map(|x| x.into());
3594        self
3595    }
3596
3597    /// Sets the value of [satisfies_pzs][crate::model::Bucket::satisfies_pzs].
3598    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3599        self.satisfies_pzs = v.into();
3600        self
3601    }
3602
3603    /// Sets the value of [custom_placement_config][crate::model::Bucket::custom_placement_config].
3604    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
3605    where
3606        T: std::convert::Into<crate::model::bucket::CustomPlacementConfig>,
3607    {
3608        self.custom_placement_config = std::option::Option::Some(v.into());
3609        self
3610    }
3611
3612    /// Sets or clears the value of [custom_placement_config][crate::model::Bucket::custom_placement_config].
3613    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
3614    where
3615        T: std::convert::Into<crate::model::bucket::CustomPlacementConfig>,
3616    {
3617        self.custom_placement_config = v.map(|x| x.into());
3618        self
3619    }
3620
3621    /// Sets the value of [autoclass][crate::model::Bucket::autoclass].
3622    pub fn set_autoclass<T>(mut self, v: T) -> Self
3623    where
3624        T: std::convert::Into<crate::model::bucket::Autoclass>,
3625    {
3626        self.autoclass = std::option::Option::Some(v.into());
3627        self
3628    }
3629
3630    /// Sets or clears the value of [autoclass][crate::model::Bucket::autoclass].
3631    pub fn set_or_clear_autoclass<T>(mut self, v: std::option::Option<T>) -> Self
3632    where
3633        T: std::convert::Into<crate::model::bucket::Autoclass>,
3634    {
3635        self.autoclass = v.map(|x| x.into());
3636        self
3637    }
3638
3639    /// Sets the value of [hierarchical_namespace][crate::model::Bucket::hierarchical_namespace].
3640    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
3641    where
3642        T: std::convert::Into<crate::model::bucket::HierarchicalNamespace>,
3643    {
3644        self.hierarchical_namespace = std::option::Option::Some(v.into());
3645        self
3646    }
3647
3648    /// Sets or clears the value of [hierarchical_namespace][crate::model::Bucket::hierarchical_namespace].
3649    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
3650    where
3651        T: std::convert::Into<crate::model::bucket::HierarchicalNamespace>,
3652    {
3653        self.hierarchical_namespace = v.map(|x| x.into());
3654        self
3655    }
3656
3657    /// Sets the value of [soft_delete_policy][crate::model::Bucket::soft_delete_policy].
3658    pub fn set_soft_delete_policy<T>(mut self, v: T) -> Self
3659    where
3660        T: std::convert::Into<crate::model::bucket::SoftDeletePolicy>,
3661    {
3662        self.soft_delete_policy = std::option::Option::Some(v.into());
3663        self
3664    }
3665
3666    /// Sets or clears the value of [soft_delete_policy][crate::model::Bucket::soft_delete_policy].
3667    pub fn set_or_clear_soft_delete_policy<T>(mut self, v: std::option::Option<T>) -> Self
3668    where
3669        T: std::convert::Into<crate::model::bucket::SoftDeletePolicy>,
3670    {
3671        self.soft_delete_policy = v.map(|x| x.into());
3672        self
3673    }
3674
3675    /// Sets the value of [object_retention][crate::model::Bucket::object_retention].
3676    pub fn set_object_retention<T>(mut self, v: T) -> Self
3677    where
3678        T: std::convert::Into<crate::model::bucket::ObjectRetention>,
3679    {
3680        self.object_retention = std::option::Option::Some(v.into());
3681        self
3682    }
3683
3684    /// Sets or clears the value of [object_retention][crate::model::Bucket::object_retention].
3685    pub fn set_or_clear_object_retention<T>(mut self, v: std::option::Option<T>) -> Self
3686    where
3687        T: std::convert::Into<crate::model::bucket::ObjectRetention>,
3688    {
3689        self.object_retention = v.map(|x| x.into());
3690        self
3691    }
3692
3693    /// Sets the value of [ip_filter][crate::model::Bucket::ip_filter].
3694    pub fn set_ip_filter<T>(mut self, v: T) -> Self
3695    where
3696        T: std::convert::Into<crate::model::bucket::IpFilter>,
3697    {
3698        self.ip_filter = std::option::Option::Some(v.into());
3699        self
3700    }
3701
3702    /// Sets or clears the value of [ip_filter][crate::model::Bucket::ip_filter].
3703    pub fn set_or_clear_ip_filter<T>(mut self, v: std::option::Option<T>) -> Self
3704    where
3705        T: std::convert::Into<crate::model::bucket::IpFilter>,
3706    {
3707        self.ip_filter = v.map(|x| x.into());
3708        self
3709    }
3710}
3711
3712impl wkt::message::Message for Bucket {
3713    fn typename() -> &'static str {
3714        "type.googleapis.com/google.storage.v2.Bucket"
3715    }
3716}
3717
3718/// Defines additional types related to [Bucket].
3719pub mod bucket {
3720    #[allow(unused_imports)]
3721    use super::*;
3722
3723    /// Billing properties of a bucket.
3724    #[derive(Clone, Default, PartialEq)]
3725    #[non_exhaustive]
3726    pub struct Billing {
3727        /// Optional. When set to true, Requester Pays is enabled for this bucket.
3728        pub requester_pays: bool,
3729
3730        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3731    }
3732
3733    impl Billing {
3734        pub fn new() -> Self {
3735            std::default::Default::default()
3736        }
3737
3738        /// Sets the value of [requester_pays][crate::model::bucket::Billing::requester_pays].
3739        pub fn set_requester_pays<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3740            self.requester_pays = v.into();
3741            self
3742        }
3743    }
3744
3745    impl wkt::message::Message for Billing {
3746        fn typename() -> &'static str {
3747            "type.googleapis.com/google.storage.v2.Bucket.Billing"
3748        }
3749    }
3750
3751    /// Cross-Origin Response sharing (CORS) properties for a bucket.
3752    /// For more on Cloud Storage and CORS, see
3753    /// <https://cloud.google.com/storage/docs/cross-origin>.
3754    /// For more on CORS in general, see <https://tools.ietf.org/html/rfc6454>.
3755    #[derive(Clone, Default, PartialEq)]
3756    #[non_exhaustive]
3757    pub struct Cors {
3758        /// Optional. The list of Origins eligible to receive CORS response headers.
3759        /// See [<https://tools.ietf.org/html/rfc6454>][RFC 6454] for more on origins.
3760        /// Note: "*" is permitted in the list of origins, and means "any Origin".
3761        pub origin: std::vec::Vec<std::string::String>,
3762
3763        /// Optional. The list of HTTP methods on which to include CORS response
3764        /// headers,
3765        /// (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
3766        /// methods, and means "any method".
3767        pub method: std::vec::Vec<std::string::String>,
3768
3769        /// Optional. The list of HTTP headers other than the
3770        /// [<https://www.w3.org/TR/cors/#simple-response-header>][simple response
3771        /// headers] to give permission for the user-agent to share across domains.
3772        pub response_header: std::vec::Vec<std::string::String>,
3773
3774        /// Optional. The value, in seconds, to return in the
3775        /// [<https://www.w3.org/TR/cors/#access-control-max-age-response-header>][Access-Control-Max-Age
3776        /// header] used in preflight responses.
3777        pub max_age_seconds: i32,
3778
3779        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3780    }
3781
3782    impl Cors {
3783        pub fn new() -> Self {
3784            std::default::Default::default()
3785        }
3786
3787        /// Sets the value of [origin][crate::model::bucket::Cors::origin].
3788        pub fn set_origin<T, V>(mut self, v: T) -> Self
3789        where
3790            T: std::iter::IntoIterator<Item = V>,
3791            V: std::convert::Into<std::string::String>,
3792        {
3793            use std::iter::Iterator;
3794            self.origin = v.into_iter().map(|i| i.into()).collect();
3795            self
3796        }
3797
3798        /// Sets the value of [method][crate::model::bucket::Cors::method].
3799        pub fn set_method<T, V>(mut self, v: T) -> Self
3800        where
3801            T: std::iter::IntoIterator<Item = V>,
3802            V: std::convert::Into<std::string::String>,
3803        {
3804            use std::iter::Iterator;
3805            self.method = v.into_iter().map(|i| i.into()).collect();
3806            self
3807        }
3808
3809        /// Sets the value of [response_header][crate::model::bucket::Cors::response_header].
3810        pub fn set_response_header<T, V>(mut self, v: T) -> Self
3811        where
3812            T: std::iter::IntoIterator<Item = V>,
3813            V: std::convert::Into<std::string::String>,
3814        {
3815            use std::iter::Iterator;
3816            self.response_header = v.into_iter().map(|i| i.into()).collect();
3817            self
3818        }
3819
3820        /// Sets the value of [max_age_seconds][crate::model::bucket::Cors::max_age_seconds].
3821        pub fn set_max_age_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3822            self.max_age_seconds = v.into();
3823            self
3824        }
3825    }
3826
3827    impl wkt::message::Message for Cors {
3828        fn typename() -> &'static str {
3829            "type.googleapis.com/google.storage.v2.Bucket.Cors"
3830        }
3831    }
3832
3833    /// Encryption properties of a bucket.
3834    #[derive(Clone, Default, PartialEq)]
3835    #[non_exhaustive]
3836    pub struct Encryption {
3837        /// Optional. The name of the Cloud KMS key that will be used to encrypt
3838        /// objects inserted into this bucket, if no encryption method is specified.
3839        pub default_kms_key: std::string::String,
3840
3841        /// Optional. If omitted, then new objects with GMEK encryption-type is
3842        /// allowed. If set, then new objects created in this bucket must comply with
3843        /// enforcement config. Changing this has no effect on existing objects; it
3844        /// applies to new objects only.
3845        pub google_managed_encryption_enforcement_config: std::option::Option<
3846            crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
3847        >,
3848
3849        /// Optional. If omitted, then new objects with CMEK encryption-type is
3850        /// allowed. If set, then new objects created in this bucket must comply with
3851        /// enforcement config. Changing this has no effect on existing objects; it
3852        /// applies to new objects only.
3853        pub customer_managed_encryption_enforcement_config: std::option::Option<
3854            crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
3855        >,
3856
3857        /// Optional. If omitted, then new objects with CSEK encryption-type is
3858        /// allowed. If set, then new objects created in this bucket must comply with
3859        /// enforcement config. Changing this has no effect on existing objects; it
3860        /// applies to new objects only.
3861        pub customer_supplied_encryption_enforcement_config: std::option::Option<
3862            crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
3863        >,
3864
3865        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3866    }
3867
3868    impl Encryption {
3869        pub fn new() -> Self {
3870            std::default::Default::default()
3871        }
3872
3873        /// Sets the value of [default_kms_key][crate::model::bucket::Encryption::default_kms_key].
3874        pub fn set_default_kms_key<T: std::convert::Into<std::string::String>>(
3875            mut self,
3876            v: T,
3877        ) -> Self {
3878            self.default_kms_key = v.into();
3879            self
3880        }
3881
3882        /// Sets the value of [google_managed_encryption_enforcement_config][crate::model::bucket::Encryption::google_managed_encryption_enforcement_config].
3883        pub fn set_google_managed_encryption_enforcement_config<T>(mut self, v: T) -> Self
3884        where
3885            T: std::convert::Into<
3886                    crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
3887                >,
3888        {
3889            self.google_managed_encryption_enforcement_config = std::option::Option::Some(v.into());
3890            self
3891        }
3892
3893        /// Sets or clears the value of [google_managed_encryption_enforcement_config][crate::model::bucket::Encryption::google_managed_encryption_enforcement_config].
3894        pub fn set_or_clear_google_managed_encryption_enforcement_config<T>(
3895            mut self,
3896            v: std::option::Option<T>,
3897        ) -> Self
3898        where
3899            T: std::convert::Into<
3900                    crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
3901                >,
3902        {
3903            self.google_managed_encryption_enforcement_config = v.map(|x| x.into());
3904            self
3905        }
3906
3907        /// Sets the value of [customer_managed_encryption_enforcement_config][crate::model::bucket::Encryption::customer_managed_encryption_enforcement_config].
3908        pub fn set_customer_managed_encryption_enforcement_config<T>(mut self, v: T) -> Self
3909        where
3910            T: std::convert::Into<
3911                    crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
3912                >,
3913        {
3914            self.customer_managed_encryption_enforcement_config =
3915                std::option::Option::Some(v.into());
3916            self
3917        }
3918
3919        /// Sets or clears the value of [customer_managed_encryption_enforcement_config][crate::model::bucket::Encryption::customer_managed_encryption_enforcement_config].
3920        pub fn set_or_clear_customer_managed_encryption_enforcement_config<T>(
3921            mut self,
3922            v: std::option::Option<T>,
3923        ) -> Self
3924        where
3925            T: std::convert::Into<
3926                    crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
3927                >,
3928        {
3929            self.customer_managed_encryption_enforcement_config = v.map(|x| x.into());
3930            self
3931        }
3932
3933        /// Sets the value of [customer_supplied_encryption_enforcement_config][crate::model::bucket::Encryption::customer_supplied_encryption_enforcement_config].
3934        pub fn set_customer_supplied_encryption_enforcement_config<T>(mut self, v: T) -> Self
3935        where
3936            T: std::convert::Into<
3937                    crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
3938                >,
3939        {
3940            self.customer_supplied_encryption_enforcement_config =
3941                std::option::Option::Some(v.into());
3942            self
3943        }
3944
3945        /// Sets or clears the value of [customer_supplied_encryption_enforcement_config][crate::model::bucket::Encryption::customer_supplied_encryption_enforcement_config].
3946        pub fn set_or_clear_customer_supplied_encryption_enforcement_config<T>(
3947            mut self,
3948            v: std::option::Option<T>,
3949        ) -> Self
3950        where
3951            T: std::convert::Into<
3952                    crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
3953                >,
3954        {
3955            self.customer_supplied_encryption_enforcement_config = v.map(|x| x.into());
3956            self
3957        }
3958    }
3959
3960    impl wkt::message::Message for Encryption {
3961        fn typename() -> &'static str {
3962            "type.googleapis.com/google.storage.v2.Bucket.Encryption"
3963        }
3964    }
3965
3966    /// Defines additional types related to [Encryption].
3967    pub mod encryption {
3968        #[allow(unused_imports)]
3969        use super::*;
3970
3971        /// Google Managed Encryption (GMEK) enforcement config of a bucket.
3972        #[derive(Clone, Default, PartialEq)]
3973        #[non_exhaustive]
3974        pub struct GoogleManagedEncryptionEnforcementConfig {
3975            /// Restriction mode for google-managed encryption for new objects within
3976            /// the bucket. Valid values are: "NotRestricted", "FullyRestricted".
3977            /// If `NotRestricted` or unset, creation of new objects with
3978            /// google-managed encryption is allowed.
3979            /// If `FullyRestricted`, new objects can't be created using google-managed
3980            /// encryption.
3981            pub restriction_mode: std::option::Option<std::string::String>,
3982
3983            /// Time from which the config was effective. This is service-provided.
3984            pub effective_time: std::option::Option<wkt::Timestamp>,
3985
3986            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3987        }
3988
3989        impl GoogleManagedEncryptionEnforcementConfig {
3990            pub fn new() -> Self {
3991                std::default::Default::default()
3992            }
3993
3994            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::restriction_mode].
3995            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
3996            where
3997                T: std::convert::Into<std::string::String>,
3998            {
3999                self.restriction_mode = std::option::Option::Some(v.into());
4000                self
4001            }
4002
4003            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::restriction_mode].
4004            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
4005            where
4006                T: std::convert::Into<std::string::String>,
4007            {
4008                self.restriction_mode = v.map(|x| x.into());
4009                self
4010            }
4011
4012            /// Sets the value of [effective_time][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::effective_time].
4013            pub fn set_effective_time<T>(mut self, v: T) -> Self
4014            where
4015                T: std::convert::Into<wkt::Timestamp>,
4016            {
4017                self.effective_time = std::option::Option::Some(v.into());
4018                self
4019            }
4020
4021            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::effective_time].
4022            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
4023            where
4024                T: std::convert::Into<wkt::Timestamp>,
4025            {
4026                self.effective_time = v.map(|x| x.into());
4027                self
4028            }
4029        }
4030
4031        impl wkt::message::Message for GoogleManagedEncryptionEnforcementConfig {
4032            fn typename() -> &'static str {
4033                "type.googleapis.com/google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig"
4034            }
4035        }
4036
4037        /// Customer Managed Encryption (CMEK) enforcement config of a bucket.
4038        #[derive(Clone, Default, PartialEq)]
4039        #[non_exhaustive]
4040        pub struct CustomerManagedEncryptionEnforcementConfig {
4041            /// Restriction mode for customer-managed encryption for new objects within
4042            /// the bucket. Valid values are: "NotRestricted", "FullyRestricted".
4043            /// If `NotRestricted` or unset, creation of new objects with
4044            /// customer-managed encryption is allowed.
4045            /// If `FullyRestricted`, new objects can't be created using
4046            /// customer-managed encryption.
4047            pub restriction_mode: std::option::Option<std::string::String>,
4048
4049            /// Time from which the config was effective. This is service-provided.
4050            pub effective_time: std::option::Option<wkt::Timestamp>,
4051
4052            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4053        }
4054
4055        impl CustomerManagedEncryptionEnforcementConfig {
4056            pub fn new() -> Self {
4057                std::default::Default::default()
4058            }
4059
4060            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::restriction_mode].
4061            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
4062            where
4063                T: std::convert::Into<std::string::String>,
4064            {
4065                self.restriction_mode = std::option::Option::Some(v.into());
4066                self
4067            }
4068
4069            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::restriction_mode].
4070            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
4071            where
4072                T: std::convert::Into<std::string::String>,
4073            {
4074                self.restriction_mode = v.map(|x| x.into());
4075                self
4076            }
4077
4078            /// Sets the value of [effective_time][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::effective_time].
4079            pub fn set_effective_time<T>(mut self, v: T) -> Self
4080            where
4081                T: std::convert::Into<wkt::Timestamp>,
4082            {
4083                self.effective_time = std::option::Option::Some(v.into());
4084                self
4085            }
4086
4087            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::effective_time].
4088            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
4089            where
4090                T: std::convert::Into<wkt::Timestamp>,
4091            {
4092                self.effective_time = v.map(|x| x.into());
4093                self
4094            }
4095        }
4096
4097        impl wkt::message::Message for CustomerManagedEncryptionEnforcementConfig {
4098            fn typename() -> &'static str {
4099                "type.googleapis.com/google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig"
4100            }
4101        }
4102
4103        /// Customer Supplied Encryption (CSEK) enforcement config of a bucket.
4104        #[derive(Clone, Default, PartialEq)]
4105        #[non_exhaustive]
4106        pub struct CustomerSuppliedEncryptionEnforcementConfig {
4107            /// Restriction mode for customer-supplied encryption for new objects
4108            /// within the bucket. Valid values are: "NotRestricted",
4109            /// "FullyRestricted".
4110            /// If `NotRestricted` or unset, creation of new objects with
4111            /// customer-supplied encryption is allowed.
4112            /// If `FullyRestricted`, new objects can't be created using
4113            /// customer-supplied encryption.
4114            pub restriction_mode: std::option::Option<std::string::String>,
4115
4116            /// Time from which the config was effective. This is service-provided.
4117            pub effective_time: std::option::Option<wkt::Timestamp>,
4118
4119            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4120        }
4121
4122        impl CustomerSuppliedEncryptionEnforcementConfig {
4123            pub fn new() -> Self {
4124                std::default::Default::default()
4125            }
4126
4127            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::restriction_mode].
4128            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
4129            where
4130                T: std::convert::Into<std::string::String>,
4131            {
4132                self.restriction_mode = std::option::Option::Some(v.into());
4133                self
4134            }
4135
4136            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::restriction_mode].
4137            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
4138            where
4139                T: std::convert::Into<std::string::String>,
4140            {
4141                self.restriction_mode = v.map(|x| x.into());
4142                self
4143            }
4144
4145            /// Sets the value of [effective_time][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::effective_time].
4146            pub fn set_effective_time<T>(mut self, v: T) -> Self
4147            where
4148                T: std::convert::Into<wkt::Timestamp>,
4149            {
4150                self.effective_time = std::option::Option::Some(v.into());
4151                self
4152            }
4153
4154            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::effective_time].
4155            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
4156            where
4157                T: std::convert::Into<wkt::Timestamp>,
4158            {
4159                self.effective_time = v.map(|x| x.into());
4160                self
4161            }
4162        }
4163
4164        impl wkt::message::Message for CustomerSuppliedEncryptionEnforcementConfig {
4165            fn typename() -> &'static str {
4166                "type.googleapis.com/google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig"
4167            }
4168        }
4169    }
4170
4171    /// Bucket restriction options.
4172    #[derive(Clone, Default, PartialEq)]
4173    #[non_exhaustive]
4174    pub struct IamConfig {
4175        /// Optional. Bucket restriction options currently enforced on the bucket.
4176        pub uniform_bucket_level_access:
4177            std::option::Option<crate::model::bucket::iam_config::UniformBucketLevelAccess>,
4178
4179        /// Optional. Whether IAM will enforce public access prevention. Valid values
4180        /// are "enforced" or "inherited".
4181        pub public_access_prevention: std::string::String,
4182
4183        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4184    }
4185
4186    impl IamConfig {
4187        pub fn new() -> Self {
4188            std::default::Default::default()
4189        }
4190
4191        /// Sets the value of [uniform_bucket_level_access][crate::model::bucket::IamConfig::uniform_bucket_level_access].
4192        pub fn set_uniform_bucket_level_access<T>(mut self, v: T) -> Self
4193        where
4194            T: std::convert::Into<crate::model::bucket::iam_config::UniformBucketLevelAccess>,
4195        {
4196            self.uniform_bucket_level_access = std::option::Option::Some(v.into());
4197            self
4198        }
4199
4200        /// Sets or clears the value of [uniform_bucket_level_access][crate::model::bucket::IamConfig::uniform_bucket_level_access].
4201        pub fn set_or_clear_uniform_bucket_level_access<T>(
4202            mut self,
4203            v: std::option::Option<T>,
4204        ) -> Self
4205        where
4206            T: std::convert::Into<crate::model::bucket::iam_config::UniformBucketLevelAccess>,
4207        {
4208            self.uniform_bucket_level_access = v.map(|x| x.into());
4209            self
4210        }
4211
4212        /// Sets the value of [public_access_prevention][crate::model::bucket::IamConfig::public_access_prevention].
4213        pub fn set_public_access_prevention<T: std::convert::Into<std::string::String>>(
4214            mut self,
4215            v: T,
4216        ) -> Self {
4217            self.public_access_prevention = v.into();
4218            self
4219        }
4220    }
4221
4222    impl wkt::message::Message for IamConfig {
4223        fn typename() -> &'static str {
4224            "type.googleapis.com/google.storage.v2.Bucket.IamConfig"
4225        }
4226    }
4227
4228    /// Defines additional types related to [IamConfig].
4229    pub mod iam_config {
4230        #[allow(unused_imports)]
4231        use super::*;
4232
4233        /// Settings for Uniform Bucket level access.
4234        /// See <https://cloud.google.com/storage/docs/uniform-bucket-level-access>.
4235        #[derive(Clone, Default, PartialEq)]
4236        #[non_exhaustive]
4237        pub struct UniformBucketLevelAccess {
4238            /// Optional. If set, access checks only use bucket-level IAM policies or
4239            /// above.
4240            pub enabled: bool,
4241
4242            /// Optional. The deadline time for changing
4243            /// `iam_config.uniform_bucket_level_access.enabled` from `true` to
4244            /// `false`. Mutable until the specified deadline is reached, but not
4245            /// afterward.
4246            pub lock_time: std::option::Option<wkt::Timestamp>,
4247
4248            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4249        }
4250
4251        impl UniformBucketLevelAccess {
4252            pub fn new() -> Self {
4253                std::default::Default::default()
4254            }
4255
4256            /// Sets the value of [enabled][crate::model::bucket::iam_config::UniformBucketLevelAccess::enabled].
4257            pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4258                self.enabled = v.into();
4259                self
4260            }
4261
4262            /// Sets the value of [lock_time][crate::model::bucket::iam_config::UniformBucketLevelAccess::lock_time].
4263            pub fn set_lock_time<T>(mut self, v: T) -> Self
4264            where
4265                T: std::convert::Into<wkt::Timestamp>,
4266            {
4267                self.lock_time = std::option::Option::Some(v.into());
4268                self
4269            }
4270
4271            /// Sets or clears the value of [lock_time][crate::model::bucket::iam_config::UniformBucketLevelAccess::lock_time].
4272            pub fn set_or_clear_lock_time<T>(mut self, v: std::option::Option<T>) -> Self
4273            where
4274                T: std::convert::Into<wkt::Timestamp>,
4275            {
4276                self.lock_time = v.map(|x| x.into());
4277                self
4278            }
4279        }
4280
4281        impl wkt::message::Message for UniformBucketLevelAccess {
4282            fn typename() -> &'static str {
4283                "type.googleapis.com/google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess"
4284            }
4285        }
4286    }
4287
4288    /// Lifecycle properties of a bucket.
4289    /// For more information, see <https://cloud.google.com/storage/docs/lifecycle>.
4290    #[derive(Clone, Default, PartialEq)]
4291    #[non_exhaustive]
4292    pub struct Lifecycle {
4293        /// Optional. A lifecycle management rule, which is made of an action to take
4294        /// and the condition(s) under which the action will be taken.
4295        pub rule: std::vec::Vec<crate::model::bucket::lifecycle::Rule>,
4296
4297        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4298    }
4299
4300    impl Lifecycle {
4301        pub fn new() -> Self {
4302            std::default::Default::default()
4303        }
4304
4305        /// Sets the value of [rule][crate::model::bucket::Lifecycle::rule].
4306        pub fn set_rule<T, V>(mut self, v: T) -> Self
4307        where
4308            T: std::iter::IntoIterator<Item = V>,
4309            V: std::convert::Into<crate::model::bucket::lifecycle::Rule>,
4310        {
4311            use std::iter::Iterator;
4312            self.rule = v.into_iter().map(|i| i.into()).collect();
4313            self
4314        }
4315    }
4316
4317    impl wkt::message::Message for Lifecycle {
4318        fn typename() -> &'static str {
4319            "type.googleapis.com/google.storage.v2.Bucket.Lifecycle"
4320        }
4321    }
4322
4323    /// Defines additional types related to [Lifecycle].
4324    pub mod lifecycle {
4325        #[allow(unused_imports)]
4326        use super::*;
4327
4328        /// A lifecycle Rule, combining an action to take on an object and a
4329        /// condition which will trigger that action.
4330        #[derive(Clone, Default, PartialEq)]
4331        #[non_exhaustive]
4332        pub struct Rule {
4333            /// Optional. The action to take.
4334            pub action: std::option::Option<crate::model::bucket::lifecycle::rule::Action>,
4335
4336            /// Optional. The condition(s) under which the action will be taken.
4337            pub condition: std::option::Option<crate::model::bucket::lifecycle::rule::Condition>,
4338
4339            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4340        }
4341
4342        impl Rule {
4343            pub fn new() -> Self {
4344                std::default::Default::default()
4345            }
4346
4347            /// Sets the value of [action][crate::model::bucket::lifecycle::Rule::action].
4348            pub fn set_action<T>(mut self, v: T) -> Self
4349            where
4350                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Action>,
4351            {
4352                self.action = std::option::Option::Some(v.into());
4353                self
4354            }
4355
4356            /// Sets or clears the value of [action][crate::model::bucket::lifecycle::Rule::action].
4357            pub fn set_or_clear_action<T>(mut self, v: std::option::Option<T>) -> Self
4358            where
4359                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Action>,
4360            {
4361                self.action = v.map(|x| x.into());
4362                self
4363            }
4364
4365            /// Sets the value of [condition][crate::model::bucket::lifecycle::Rule::condition].
4366            pub fn set_condition<T>(mut self, v: T) -> Self
4367            where
4368                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Condition>,
4369            {
4370                self.condition = std::option::Option::Some(v.into());
4371                self
4372            }
4373
4374            /// Sets or clears the value of [condition][crate::model::bucket::lifecycle::Rule::condition].
4375            pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
4376            where
4377                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Condition>,
4378            {
4379                self.condition = v.map(|x| x.into());
4380                self
4381            }
4382        }
4383
4384        impl wkt::message::Message for Rule {
4385            fn typename() -> &'static str {
4386                "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule"
4387            }
4388        }
4389
4390        /// Defines additional types related to [Rule].
4391        pub mod rule {
4392            #[allow(unused_imports)]
4393            use super::*;
4394
4395            /// An action to take on an object.
4396            #[derive(Clone, Default, PartialEq)]
4397            #[non_exhaustive]
4398            pub struct Action {
4399                /// Optional. Type of the action. Currently, only `Delete`,
4400                /// `SetStorageClass`, and `AbortIncompleteMultipartUpload` are
4401                /// supported.
4402                pub r#type: std::string::String,
4403
4404                /// Optional. Target storage class. Required iff the type of the action
4405                /// is SetStorageClass.
4406                pub storage_class: std::string::String,
4407
4408                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4409            }
4410
4411            impl Action {
4412                pub fn new() -> Self {
4413                    std::default::Default::default()
4414                }
4415
4416                /// Sets the value of [r#type][crate::model::bucket::lifecycle::rule::Action::type].
4417                pub fn set_type<T: std::convert::Into<std::string::String>>(
4418                    mut self,
4419                    v: T,
4420                ) -> Self {
4421                    self.r#type = v.into();
4422                    self
4423                }
4424
4425                /// Sets the value of [storage_class][crate::model::bucket::lifecycle::rule::Action::storage_class].
4426                pub fn set_storage_class<T: std::convert::Into<std::string::String>>(
4427                    mut self,
4428                    v: T,
4429                ) -> Self {
4430                    self.storage_class = v.into();
4431                    self
4432                }
4433            }
4434
4435            impl wkt::message::Message for Action {
4436                fn typename() -> &'static str {
4437                    "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule.Action"
4438                }
4439            }
4440
4441            /// A condition of an object which triggers some action.
4442            #[derive(Clone, Default, PartialEq)]
4443            #[non_exhaustive]
4444            pub struct Condition {
4445                /// Age of an object (in days). This condition is satisfied when an
4446                /// object reaches the specified age.
4447                /// A value of 0 indicates that all objects immediately match this
4448                /// condition.
4449                pub age_days: std::option::Option<i32>,
4450
4451                /// Optional. This condition is satisfied when an object is created
4452                /// before midnight of the specified date in UTC.
4453                pub created_before: std::option::Option<gtype::model::Date>,
4454
4455                /// Relevant only for versioned objects. If the value is
4456                /// `true`, this condition matches live objects; if the value
4457                /// is `false`, it matches archived objects.
4458                pub is_live: std::option::Option<bool>,
4459
4460                /// Relevant only for versioned objects. If the value is N, this
4461                /// condition is satisfied when there are at least N versions (including
4462                /// the live version) newer than this version of the object.
4463                pub num_newer_versions: std::option::Option<i32>,
4464
4465                /// Optional. Objects having any of the storage classes specified by this
4466                /// condition will be matched. Values include `MULTI_REGIONAL`,
4467                /// `REGIONAL`, `NEARLINE`, `COLDLINE`, `STANDARD`, and
4468                /// `DURABLE_REDUCED_AVAILABILITY`.
4469                pub matches_storage_class: std::vec::Vec<std::string::String>,
4470
4471                /// Number of days that have elapsed since the custom timestamp set on an
4472                /// object.
4473                /// The value of the field must be a nonnegative integer.
4474                pub days_since_custom_time: std::option::Option<i32>,
4475
4476                /// Optional. An object matches this condition if the custom timestamp
4477                /// set on the object is before the specified date in UTC.
4478                pub custom_time_before: std::option::Option<gtype::model::Date>,
4479
4480                /// This condition is relevant only for versioned objects. An object
4481                /// version satisfies this condition only if these many days have been
4482                /// passed since it became noncurrent. The value of the field must be a
4483                /// nonnegative integer. If it's zero, the object version will become
4484                /// eligible for Lifecycle action as soon as it becomes noncurrent.
4485                pub days_since_noncurrent_time: std::option::Option<i32>,
4486
4487                /// Optional. This condition is relevant only for versioned objects. An
4488                /// object version satisfies this condition only if it became noncurrent
4489                /// before the specified date in UTC.
4490                pub noncurrent_time_before: std::option::Option<gtype::model::Date>,
4491
4492                /// Optional. List of object name prefixes. If any prefix exactly matches
4493                /// the beginning of the object name, the condition evaluates to true.
4494                pub matches_prefix: std::vec::Vec<std::string::String>,
4495
4496                /// Optional. List of object name suffixes. If any suffix exactly matches
4497                /// the end of the object name, the condition evaluates to true.
4498                pub matches_suffix: std::vec::Vec<std::string::String>,
4499
4500                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4501            }
4502
4503            impl Condition {
4504                pub fn new() -> Self {
4505                    std::default::Default::default()
4506                }
4507
4508                /// Sets the value of [age_days][crate::model::bucket::lifecycle::rule::Condition::age_days].
4509                pub fn set_age_days<T>(mut self, v: T) -> Self
4510                where
4511                    T: std::convert::Into<i32>,
4512                {
4513                    self.age_days = std::option::Option::Some(v.into());
4514                    self
4515                }
4516
4517                /// Sets or clears the value of [age_days][crate::model::bucket::lifecycle::rule::Condition::age_days].
4518                pub fn set_or_clear_age_days<T>(mut self, v: std::option::Option<T>) -> Self
4519                where
4520                    T: std::convert::Into<i32>,
4521                {
4522                    self.age_days = v.map(|x| x.into());
4523                    self
4524                }
4525
4526                /// Sets the value of [created_before][crate::model::bucket::lifecycle::rule::Condition::created_before].
4527                pub fn set_created_before<T>(mut self, v: T) -> Self
4528                where
4529                    T: std::convert::Into<gtype::model::Date>,
4530                {
4531                    self.created_before = std::option::Option::Some(v.into());
4532                    self
4533                }
4534
4535                /// Sets or clears the value of [created_before][crate::model::bucket::lifecycle::rule::Condition::created_before].
4536                pub fn set_or_clear_created_before<T>(mut self, v: std::option::Option<T>) -> Self
4537                where
4538                    T: std::convert::Into<gtype::model::Date>,
4539                {
4540                    self.created_before = v.map(|x| x.into());
4541                    self
4542                }
4543
4544                /// Sets the value of [is_live][crate::model::bucket::lifecycle::rule::Condition::is_live].
4545                pub fn set_is_live<T>(mut self, v: T) -> Self
4546                where
4547                    T: std::convert::Into<bool>,
4548                {
4549                    self.is_live = std::option::Option::Some(v.into());
4550                    self
4551                }
4552
4553                /// Sets or clears the value of [is_live][crate::model::bucket::lifecycle::rule::Condition::is_live].
4554                pub fn set_or_clear_is_live<T>(mut self, v: std::option::Option<T>) -> Self
4555                where
4556                    T: std::convert::Into<bool>,
4557                {
4558                    self.is_live = v.map(|x| x.into());
4559                    self
4560                }
4561
4562                /// Sets the value of [num_newer_versions][crate::model::bucket::lifecycle::rule::Condition::num_newer_versions].
4563                pub fn set_num_newer_versions<T>(mut self, v: T) -> Self
4564                where
4565                    T: std::convert::Into<i32>,
4566                {
4567                    self.num_newer_versions = std::option::Option::Some(v.into());
4568                    self
4569                }
4570
4571                /// Sets or clears the value of [num_newer_versions][crate::model::bucket::lifecycle::rule::Condition::num_newer_versions].
4572                pub fn set_or_clear_num_newer_versions<T>(
4573                    mut self,
4574                    v: std::option::Option<T>,
4575                ) -> Self
4576                where
4577                    T: std::convert::Into<i32>,
4578                {
4579                    self.num_newer_versions = v.map(|x| x.into());
4580                    self
4581                }
4582
4583                /// Sets the value of [matches_storage_class][crate::model::bucket::lifecycle::rule::Condition::matches_storage_class].
4584                pub fn set_matches_storage_class<T, V>(mut self, v: T) -> Self
4585                where
4586                    T: std::iter::IntoIterator<Item = V>,
4587                    V: std::convert::Into<std::string::String>,
4588                {
4589                    use std::iter::Iterator;
4590                    self.matches_storage_class = v.into_iter().map(|i| i.into()).collect();
4591                    self
4592                }
4593
4594                /// Sets the value of [days_since_custom_time][crate::model::bucket::lifecycle::rule::Condition::days_since_custom_time].
4595                pub fn set_days_since_custom_time<T>(mut self, v: T) -> Self
4596                where
4597                    T: std::convert::Into<i32>,
4598                {
4599                    self.days_since_custom_time = std::option::Option::Some(v.into());
4600                    self
4601                }
4602
4603                /// Sets or clears the value of [days_since_custom_time][crate::model::bucket::lifecycle::rule::Condition::days_since_custom_time].
4604                pub fn set_or_clear_days_since_custom_time<T>(
4605                    mut self,
4606                    v: std::option::Option<T>,
4607                ) -> Self
4608                where
4609                    T: std::convert::Into<i32>,
4610                {
4611                    self.days_since_custom_time = v.map(|x| x.into());
4612                    self
4613                }
4614
4615                /// Sets the value of [custom_time_before][crate::model::bucket::lifecycle::rule::Condition::custom_time_before].
4616                pub fn set_custom_time_before<T>(mut self, v: T) -> Self
4617                where
4618                    T: std::convert::Into<gtype::model::Date>,
4619                {
4620                    self.custom_time_before = std::option::Option::Some(v.into());
4621                    self
4622                }
4623
4624                /// Sets or clears the value of [custom_time_before][crate::model::bucket::lifecycle::rule::Condition::custom_time_before].
4625                pub fn set_or_clear_custom_time_before<T>(
4626                    mut self,
4627                    v: std::option::Option<T>,
4628                ) -> Self
4629                where
4630                    T: std::convert::Into<gtype::model::Date>,
4631                {
4632                    self.custom_time_before = v.map(|x| x.into());
4633                    self
4634                }
4635
4636                /// Sets the value of [days_since_noncurrent_time][crate::model::bucket::lifecycle::rule::Condition::days_since_noncurrent_time].
4637                pub fn set_days_since_noncurrent_time<T>(mut self, v: T) -> Self
4638                where
4639                    T: std::convert::Into<i32>,
4640                {
4641                    self.days_since_noncurrent_time = std::option::Option::Some(v.into());
4642                    self
4643                }
4644
4645                /// Sets or clears the value of [days_since_noncurrent_time][crate::model::bucket::lifecycle::rule::Condition::days_since_noncurrent_time].
4646                pub fn set_or_clear_days_since_noncurrent_time<T>(
4647                    mut self,
4648                    v: std::option::Option<T>,
4649                ) -> Self
4650                where
4651                    T: std::convert::Into<i32>,
4652                {
4653                    self.days_since_noncurrent_time = v.map(|x| x.into());
4654                    self
4655                }
4656
4657                /// Sets the value of [noncurrent_time_before][crate::model::bucket::lifecycle::rule::Condition::noncurrent_time_before].
4658                pub fn set_noncurrent_time_before<T>(mut self, v: T) -> Self
4659                where
4660                    T: std::convert::Into<gtype::model::Date>,
4661                {
4662                    self.noncurrent_time_before = std::option::Option::Some(v.into());
4663                    self
4664                }
4665
4666                /// Sets or clears the value of [noncurrent_time_before][crate::model::bucket::lifecycle::rule::Condition::noncurrent_time_before].
4667                pub fn set_or_clear_noncurrent_time_before<T>(
4668                    mut self,
4669                    v: std::option::Option<T>,
4670                ) -> Self
4671                where
4672                    T: std::convert::Into<gtype::model::Date>,
4673                {
4674                    self.noncurrent_time_before = v.map(|x| x.into());
4675                    self
4676                }
4677
4678                /// Sets the value of [matches_prefix][crate::model::bucket::lifecycle::rule::Condition::matches_prefix].
4679                pub fn set_matches_prefix<T, V>(mut self, v: T) -> Self
4680                where
4681                    T: std::iter::IntoIterator<Item = V>,
4682                    V: std::convert::Into<std::string::String>,
4683                {
4684                    use std::iter::Iterator;
4685                    self.matches_prefix = v.into_iter().map(|i| i.into()).collect();
4686                    self
4687                }
4688
4689                /// Sets the value of [matches_suffix][crate::model::bucket::lifecycle::rule::Condition::matches_suffix].
4690                pub fn set_matches_suffix<T, V>(mut self, v: T) -> Self
4691                where
4692                    T: std::iter::IntoIterator<Item = V>,
4693                    V: std::convert::Into<std::string::String>,
4694                {
4695                    use std::iter::Iterator;
4696                    self.matches_suffix = v.into_iter().map(|i| i.into()).collect();
4697                    self
4698                }
4699            }
4700
4701            impl wkt::message::Message for Condition {
4702                fn typename() -> &'static str {
4703                    "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule.Condition"
4704                }
4705            }
4706        }
4707    }
4708
4709    /// Logging-related properties of a bucket.
4710    #[derive(Clone, Default, PartialEq)]
4711    #[non_exhaustive]
4712    pub struct Logging {
4713        /// Optional. The destination bucket where the current bucket's logs should
4714        /// be placed, using path format (like `projects/123456/buckets/foo`).
4715        pub log_bucket: std::string::String,
4716
4717        /// Optional. A prefix for log object names.
4718        pub log_object_prefix: std::string::String,
4719
4720        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4721    }
4722
4723    impl Logging {
4724        pub fn new() -> Self {
4725            std::default::Default::default()
4726        }
4727
4728        /// Sets the value of [log_bucket][crate::model::bucket::Logging::log_bucket].
4729        pub fn set_log_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4730            self.log_bucket = v.into();
4731            self
4732        }
4733
4734        /// Sets the value of [log_object_prefix][crate::model::bucket::Logging::log_object_prefix].
4735        pub fn set_log_object_prefix<T: std::convert::Into<std::string::String>>(
4736            mut self,
4737            v: T,
4738        ) -> Self {
4739            self.log_object_prefix = v.into();
4740            self
4741        }
4742    }
4743
4744    impl wkt::message::Message for Logging {
4745        fn typename() -> &'static str {
4746            "type.googleapis.com/google.storage.v2.Bucket.Logging"
4747        }
4748    }
4749
4750    /// Object Retention related properties of a bucket.
4751    #[derive(Clone, Default, PartialEq)]
4752    #[non_exhaustive]
4753    pub struct ObjectRetention {
4754        /// Optional. Output only. If true, object retention is enabled for the
4755        /// bucket.
4756        pub enabled: bool,
4757
4758        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4759    }
4760
4761    impl ObjectRetention {
4762        pub fn new() -> Self {
4763            std::default::Default::default()
4764        }
4765
4766        /// Sets the value of [enabled][crate::model::bucket::ObjectRetention::enabled].
4767        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4768            self.enabled = v.into();
4769            self
4770        }
4771    }
4772
4773    impl wkt::message::Message for ObjectRetention {
4774        fn typename() -> &'static str {
4775            "type.googleapis.com/google.storage.v2.Bucket.ObjectRetention"
4776        }
4777    }
4778
4779    /// Retention policy properties of a bucket.
4780    #[derive(Clone, Default, PartialEq)]
4781    #[non_exhaustive]
4782    pub struct RetentionPolicy {
4783        /// Optional. Server-determined value that indicates the time from which
4784        /// policy was enforced and effective.
4785        pub effective_time: std::option::Option<wkt::Timestamp>,
4786
4787        /// Optional. Once locked, an object retention policy cannot be modified.
4788        pub is_locked: bool,
4789
4790        /// Optional. The duration that objects need to be retained. Retention
4791        /// duration must be greater than zero and less than 100 years. Note that
4792        /// enforcement of retention periods less than a day is not guaranteed. Such
4793        /// periods should only be used for testing purposes. Any `nanos` value
4794        /// specified will be rounded down to the nearest second.
4795        pub retention_duration: std::option::Option<wkt::Duration>,
4796
4797        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4798    }
4799
4800    impl RetentionPolicy {
4801        pub fn new() -> Self {
4802            std::default::Default::default()
4803        }
4804
4805        /// Sets the value of [effective_time][crate::model::bucket::RetentionPolicy::effective_time].
4806        pub fn set_effective_time<T>(mut self, v: T) -> Self
4807        where
4808            T: std::convert::Into<wkt::Timestamp>,
4809        {
4810            self.effective_time = std::option::Option::Some(v.into());
4811            self
4812        }
4813
4814        /// Sets or clears the value of [effective_time][crate::model::bucket::RetentionPolicy::effective_time].
4815        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
4816        where
4817            T: std::convert::Into<wkt::Timestamp>,
4818        {
4819            self.effective_time = v.map(|x| x.into());
4820            self
4821        }
4822
4823        /// Sets the value of [is_locked][crate::model::bucket::RetentionPolicy::is_locked].
4824        pub fn set_is_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4825            self.is_locked = v.into();
4826            self
4827        }
4828
4829        /// Sets the value of [retention_duration][crate::model::bucket::RetentionPolicy::retention_duration].
4830        pub fn set_retention_duration<T>(mut self, v: T) -> Self
4831        where
4832            T: std::convert::Into<wkt::Duration>,
4833        {
4834            self.retention_duration = std::option::Option::Some(v.into());
4835            self
4836        }
4837
4838        /// Sets or clears the value of [retention_duration][crate::model::bucket::RetentionPolicy::retention_duration].
4839        pub fn set_or_clear_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
4840        where
4841            T: std::convert::Into<wkt::Duration>,
4842        {
4843            self.retention_duration = v.map(|x| x.into());
4844            self
4845        }
4846    }
4847
4848    impl wkt::message::Message for RetentionPolicy {
4849        fn typename() -> &'static str {
4850            "type.googleapis.com/google.storage.v2.Bucket.RetentionPolicy"
4851        }
4852    }
4853
4854    /// Soft delete policy properties of a bucket.
4855    #[derive(Clone, Default, PartialEq)]
4856    #[non_exhaustive]
4857    pub struct SoftDeletePolicy {
4858        /// The period of time that soft-deleted objects in the bucket must be
4859        /// retained and cannot be permanently deleted. The duration must be greater
4860        /// than or equal to 7 days and less than 1 year.
4861        pub retention_duration: std::option::Option<wkt::Duration>,
4862
4863        /// Time from which the policy was effective. This is service-provided.
4864        pub effective_time: std::option::Option<wkt::Timestamp>,
4865
4866        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4867    }
4868
4869    impl SoftDeletePolicy {
4870        pub fn new() -> Self {
4871            std::default::Default::default()
4872        }
4873
4874        /// Sets the value of [retention_duration][crate::model::bucket::SoftDeletePolicy::retention_duration].
4875        pub fn set_retention_duration<T>(mut self, v: T) -> Self
4876        where
4877            T: std::convert::Into<wkt::Duration>,
4878        {
4879            self.retention_duration = std::option::Option::Some(v.into());
4880            self
4881        }
4882
4883        /// Sets or clears the value of [retention_duration][crate::model::bucket::SoftDeletePolicy::retention_duration].
4884        pub fn set_or_clear_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
4885        where
4886            T: std::convert::Into<wkt::Duration>,
4887        {
4888            self.retention_duration = v.map(|x| x.into());
4889            self
4890        }
4891
4892        /// Sets the value of [effective_time][crate::model::bucket::SoftDeletePolicy::effective_time].
4893        pub fn set_effective_time<T>(mut self, v: T) -> Self
4894        where
4895            T: std::convert::Into<wkt::Timestamp>,
4896        {
4897            self.effective_time = std::option::Option::Some(v.into());
4898            self
4899        }
4900
4901        /// Sets or clears the value of [effective_time][crate::model::bucket::SoftDeletePolicy::effective_time].
4902        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
4903        where
4904            T: std::convert::Into<wkt::Timestamp>,
4905        {
4906            self.effective_time = v.map(|x| x.into());
4907            self
4908        }
4909    }
4910
4911    impl wkt::message::Message for SoftDeletePolicy {
4912        fn typename() -> &'static str {
4913            "type.googleapis.com/google.storage.v2.Bucket.SoftDeletePolicy"
4914        }
4915    }
4916
4917    /// Properties of a bucket related to versioning.
4918    /// For more on Cloud Storage versioning, see
4919    /// <https://cloud.google.com/storage/docs/object-versioning>.
4920    #[derive(Clone, Default, PartialEq)]
4921    #[non_exhaustive]
4922    pub struct Versioning {
4923        /// Optional. While set to true, versioning is fully enabled for this bucket.
4924        pub enabled: bool,
4925
4926        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4927    }
4928
4929    impl Versioning {
4930        pub fn new() -> Self {
4931            std::default::Default::default()
4932        }
4933
4934        /// Sets the value of [enabled][crate::model::bucket::Versioning::enabled].
4935        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4936            self.enabled = v.into();
4937            self
4938        }
4939    }
4940
4941    impl wkt::message::Message for Versioning {
4942        fn typename() -> &'static str {
4943            "type.googleapis.com/google.storage.v2.Bucket.Versioning"
4944        }
4945    }
4946
4947    /// Properties of a bucket related to accessing the contents as a static
4948    /// website. For more on hosting a static website via Cloud Storage, see
4949    /// <https://cloud.google.com/storage/docs/hosting-static-website>.
4950    #[derive(Clone, Default, PartialEq)]
4951    #[non_exhaustive]
4952    pub struct Website {
4953        /// Optional. If the requested object path is missing, the service will
4954        /// ensure the path has a trailing '/', append this suffix, and attempt to
4955        /// retrieve the resulting object. This allows the creation of `index.html`
4956        /// objects to represent directory pages.
4957        pub main_page_suffix: std::string::String,
4958
4959        /// Optional. If the requested object path is missing, and any
4960        /// `mainPageSuffix` object is missing, if applicable, the service
4961        /// will return the named object from this bucket as the content for a
4962        /// [<https://tools.ietf.org/html/rfc7231#section-6.5.4>][404 Not Found]
4963        /// result.
4964        pub not_found_page: std::string::String,
4965
4966        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4967    }
4968
4969    impl Website {
4970        pub fn new() -> Self {
4971            std::default::Default::default()
4972        }
4973
4974        /// Sets the value of [main_page_suffix][crate::model::bucket::Website::main_page_suffix].
4975        pub fn set_main_page_suffix<T: std::convert::Into<std::string::String>>(
4976            mut self,
4977            v: T,
4978        ) -> Self {
4979            self.main_page_suffix = v.into();
4980            self
4981        }
4982
4983        /// Sets the value of [not_found_page][crate::model::bucket::Website::not_found_page].
4984        pub fn set_not_found_page<T: std::convert::Into<std::string::String>>(
4985            mut self,
4986            v: T,
4987        ) -> Self {
4988            self.not_found_page = v.into();
4989            self
4990        }
4991    }
4992
4993    impl wkt::message::Message for Website {
4994        fn typename() -> &'static str {
4995            "type.googleapis.com/google.storage.v2.Bucket.Website"
4996        }
4997    }
4998
4999    /// Configuration for Custom Dual Regions.  It should specify precisely two
5000    /// eligible regions within the same Multiregion. More information on regions
5001    /// may be found [here](https://cloud.google.com/storage/docs/locations).
5002    #[derive(Clone, Default, PartialEq)]
5003    #[non_exhaustive]
5004    pub struct CustomPlacementConfig {
5005        /// Optional. List of locations to use for data placement.
5006        pub data_locations: std::vec::Vec<std::string::String>,
5007
5008        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5009    }
5010
5011    impl CustomPlacementConfig {
5012        pub fn new() -> Self {
5013            std::default::Default::default()
5014        }
5015
5016        /// Sets the value of [data_locations][crate::model::bucket::CustomPlacementConfig::data_locations].
5017        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
5018        where
5019            T: std::iter::IntoIterator<Item = V>,
5020            V: std::convert::Into<std::string::String>,
5021        {
5022            use std::iter::Iterator;
5023            self.data_locations = v.into_iter().map(|i| i.into()).collect();
5024            self
5025        }
5026    }
5027
5028    impl wkt::message::Message for CustomPlacementConfig {
5029        fn typename() -> &'static str {
5030            "type.googleapis.com/google.storage.v2.Bucket.CustomPlacementConfig"
5031        }
5032    }
5033
5034    /// Configuration for a bucket's Autoclass feature.
5035    #[derive(Clone, Default, PartialEq)]
5036    #[non_exhaustive]
5037    pub struct Autoclass {
5038        /// Optional. Enables Autoclass.
5039        pub enabled: bool,
5040
5041        /// Output only. Latest instant at which the `enabled` field was set to true
5042        /// after being disabled/unconfigured or set to false after being enabled. If
5043        /// Autoclass is enabled when the bucket is created, the toggle_time is set
5044        /// to the bucket creation time.
5045        pub toggle_time: std::option::Option<wkt::Timestamp>,
5046
5047        /// An object in an Autoclass bucket will eventually cool down to the
5048        /// terminal storage class if there is no access to the object.
5049        /// The only valid values are NEARLINE and ARCHIVE.
5050        pub terminal_storage_class: std::option::Option<std::string::String>,
5051
5052        /// Output only. Latest instant at which the autoclass terminal storage class
5053        /// was updated.
5054        pub terminal_storage_class_update_time: std::option::Option<wkt::Timestamp>,
5055
5056        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5057    }
5058
5059    impl Autoclass {
5060        pub fn new() -> Self {
5061            std::default::Default::default()
5062        }
5063
5064        /// Sets the value of [enabled][crate::model::bucket::Autoclass::enabled].
5065        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5066            self.enabled = v.into();
5067            self
5068        }
5069
5070        /// Sets the value of [toggle_time][crate::model::bucket::Autoclass::toggle_time].
5071        pub fn set_toggle_time<T>(mut self, v: T) -> Self
5072        where
5073            T: std::convert::Into<wkt::Timestamp>,
5074        {
5075            self.toggle_time = std::option::Option::Some(v.into());
5076            self
5077        }
5078
5079        /// Sets or clears the value of [toggle_time][crate::model::bucket::Autoclass::toggle_time].
5080        pub fn set_or_clear_toggle_time<T>(mut self, v: std::option::Option<T>) -> Self
5081        where
5082            T: std::convert::Into<wkt::Timestamp>,
5083        {
5084            self.toggle_time = v.map(|x| x.into());
5085            self
5086        }
5087
5088        /// Sets the value of [terminal_storage_class][crate::model::bucket::Autoclass::terminal_storage_class].
5089        pub fn set_terminal_storage_class<T>(mut self, v: T) -> Self
5090        where
5091            T: std::convert::Into<std::string::String>,
5092        {
5093            self.terminal_storage_class = std::option::Option::Some(v.into());
5094            self
5095        }
5096
5097        /// Sets or clears the value of [terminal_storage_class][crate::model::bucket::Autoclass::terminal_storage_class].
5098        pub fn set_or_clear_terminal_storage_class<T>(mut self, v: std::option::Option<T>) -> Self
5099        where
5100            T: std::convert::Into<std::string::String>,
5101        {
5102            self.terminal_storage_class = v.map(|x| x.into());
5103            self
5104        }
5105
5106        /// Sets the value of [terminal_storage_class_update_time][crate::model::bucket::Autoclass::terminal_storage_class_update_time].
5107        pub fn set_terminal_storage_class_update_time<T>(mut self, v: T) -> Self
5108        where
5109            T: std::convert::Into<wkt::Timestamp>,
5110        {
5111            self.terminal_storage_class_update_time = std::option::Option::Some(v.into());
5112            self
5113        }
5114
5115        /// Sets or clears the value of [terminal_storage_class_update_time][crate::model::bucket::Autoclass::terminal_storage_class_update_time].
5116        pub fn set_or_clear_terminal_storage_class_update_time<T>(
5117            mut self,
5118            v: std::option::Option<T>,
5119        ) -> Self
5120        where
5121            T: std::convert::Into<wkt::Timestamp>,
5122        {
5123            self.terminal_storage_class_update_time = v.map(|x| x.into());
5124            self
5125        }
5126    }
5127
5128    impl wkt::message::Message for Autoclass {
5129        fn typename() -> &'static str {
5130            "type.googleapis.com/google.storage.v2.Bucket.Autoclass"
5131        }
5132    }
5133
5134    /// The [bucket IP
5135    /// filtering](https://cloud.google.com/storage/docs/ip-filtering-overview)
5136    /// configuration. Specifies the network sources that can access the bucket, as
5137    /// well as its underlying objects.
5138    #[derive(Clone, Default, PartialEq)]
5139    #[non_exhaustive]
5140    pub struct IpFilter {
5141        /// The state of the IP filter configuration. Valid values are `Enabled` and
5142        /// `Disabled`. When set to `Enabled`, IP filtering rules are applied to a
5143        /// bucket and all incoming requests to the bucket are evaluated against
5144        /// these rules. When set to `Disabled`, IP filtering rules are not applied
5145        /// to a bucket.".
5146        pub mode: std::option::Option<std::string::String>,
5147
5148        /// Public IPs allowed to operate or access the bucket.
5149        pub public_network_source:
5150            std::option::Option<crate::model::bucket::ip_filter::PublicNetworkSource>,
5151
5152        /// Optional. The list of network sources that are allowed to access
5153        /// operations on the bucket or the underlying objects.
5154        pub vpc_network_sources: std::vec::Vec<crate::model::bucket::ip_filter::VpcNetworkSource>,
5155
5156        /// Optional. Whether or not to allow VPCs from orgs different than the
5157        /// bucket's parent org to access the bucket. When set to true, validations
5158        /// on the existence of the VPCs won't be performed. If set to false, each
5159        /// VPC network source will be checked to belong to the same org as the
5160        /// bucket as well as validated for existence.
5161        pub allow_cross_org_vpcs: bool,
5162
5163        /// Whether or not to allow all P4SA access to the bucket. When set to true,
5164        /// IP filter config validation will not apply.
5165        pub allow_all_service_agent_access: std::option::Option<bool>,
5166
5167        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5168    }
5169
5170    impl IpFilter {
5171        pub fn new() -> Self {
5172            std::default::Default::default()
5173        }
5174
5175        /// Sets the value of [mode][crate::model::bucket::IpFilter::mode].
5176        pub fn set_mode<T>(mut self, v: T) -> Self
5177        where
5178            T: std::convert::Into<std::string::String>,
5179        {
5180            self.mode = std::option::Option::Some(v.into());
5181            self
5182        }
5183
5184        /// Sets or clears the value of [mode][crate::model::bucket::IpFilter::mode].
5185        pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
5186        where
5187            T: std::convert::Into<std::string::String>,
5188        {
5189            self.mode = v.map(|x| x.into());
5190            self
5191        }
5192
5193        /// Sets the value of [public_network_source][crate::model::bucket::IpFilter::public_network_source].
5194        pub fn set_public_network_source<T>(mut self, v: T) -> Self
5195        where
5196            T: std::convert::Into<crate::model::bucket::ip_filter::PublicNetworkSource>,
5197        {
5198            self.public_network_source = std::option::Option::Some(v.into());
5199            self
5200        }
5201
5202        /// Sets or clears the value of [public_network_source][crate::model::bucket::IpFilter::public_network_source].
5203        pub fn set_or_clear_public_network_source<T>(mut self, v: std::option::Option<T>) -> Self
5204        where
5205            T: std::convert::Into<crate::model::bucket::ip_filter::PublicNetworkSource>,
5206        {
5207            self.public_network_source = v.map(|x| x.into());
5208            self
5209        }
5210
5211        /// Sets the value of [vpc_network_sources][crate::model::bucket::IpFilter::vpc_network_sources].
5212        pub fn set_vpc_network_sources<T, V>(mut self, v: T) -> Self
5213        where
5214            T: std::iter::IntoIterator<Item = V>,
5215            V: std::convert::Into<crate::model::bucket::ip_filter::VpcNetworkSource>,
5216        {
5217            use std::iter::Iterator;
5218            self.vpc_network_sources = v.into_iter().map(|i| i.into()).collect();
5219            self
5220        }
5221
5222        /// Sets the value of [allow_cross_org_vpcs][crate::model::bucket::IpFilter::allow_cross_org_vpcs].
5223        pub fn set_allow_cross_org_vpcs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5224            self.allow_cross_org_vpcs = v.into();
5225            self
5226        }
5227
5228        /// Sets the value of [allow_all_service_agent_access][crate::model::bucket::IpFilter::allow_all_service_agent_access].
5229        pub fn set_allow_all_service_agent_access<T>(mut self, v: T) -> Self
5230        where
5231            T: std::convert::Into<bool>,
5232        {
5233            self.allow_all_service_agent_access = std::option::Option::Some(v.into());
5234            self
5235        }
5236
5237        /// Sets or clears the value of [allow_all_service_agent_access][crate::model::bucket::IpFilter::allow_all_service_agent_access].
5238        pub fn set_or_clear_allow_all_service_agent_access<T>(
5239            mut self,
5240            v: std::option::Option<T>,
5241        ) -> Self
5242        where
5243            T: std::convert::Into<bool>,
5244        {
5245            self.allow_all_service_agent_access = v.map(|x| x.into());
5246            self
5247        }
5248    }
5249
5250    impl wkt::message::Message for IpFilter {
5251        fn typename() -> &'static str {
5252            "type.googleapis.com/google.storage.v2.Bucket.IpFilter"
5253        }
5254    }
5255
5256    /// Defines additional types related to [IpFilter].
5257    pub mod ip_filter {
5258        #[allow(unused_imports)]
5259        use super::*;
5260
5261        /// The public network IP address ranges that can access the bucket and its
5262        /// data.
5263        #[derive(Clone, Default, PartialEq)]
5264        #[non_exhaustive]
5265        pub struct PublicNetworkSource {
5266            /// Optional. The list of IPv4 and IPv6 cidr blocks that are allowed to
5267            /// operate or access the bucket and its underlying objects.
5268            pub allowed_ip_cidr_ranges: std::vec::Vec<std::string::String>,
5269
5270            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5271        }
5272
5273        impl PublicNetworkSource {
5274            pub fn new() -> Self {
5275                std::default::Default::default()
5276            }
5277
5278            /// Sets the value of [allowed_ip_cidr_ranges][crate::model::bucket::ip_filter::PublicNetworkSource::allowed_ip_cidr_ranges].
5279            pub fn set_allowed_ip_cidr_ranges<T, V>(mut self, v: T) -> Self
5280            where
5281                T: std::iter::IntoIterator<Item = V>,
5282                V: std::convert::Into<std::string::String>,
5283            {
5284                use std::iter::Iterator;
5285                self.allowed_ip_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
5286                self
5287            }
5288        }
5289
5290        impl wkt::message::Message for PublicNetworkSource {
5291            fn typename() -> &'static str {
5292                "type.googleapis.com/google.storage.v2.Bucket.IpFilter.PublicNetworkSource"
5293            }
5294        }
5295
5296        /// The list of VPC networks that can access the bucket.
5297        #[derive(Clone, Default, PartialEq)]
5298        #[non_exhaustive]
5299        pub struct VpcNetworkSource {
5300            /// Name of the network.
5301            ///
5302            /// Format: `projects/PROJECT_ID/global/networks/NETWORK_NAME`
5303            pub network: std::option::Option<std::string::String>,
5304
5305            /// Optional. The list of public or private IPv4 and IPv6 CIDR ranges that
5306            /// can access the bucket. In the CIDR IP address block, the specified IP
5307            /// address must be properly truncated, meaning all the host bits must be
5308            /// zero or else the input is considered malformed. For example,
5309            /// `192.0.2.0/24` is accepted but `192.0.2.1/24` is not. Similarly, for
5310            /// IPv6, `2001:db8::/32` is accepted whereas `2001:db8::1/32` is not.
5311            pub allowed_ip_cidr_ranges: std::vec::Vec<std::string::String>,
5312
5313            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5314        }
5315
5316        impl VpcNetworkSource {
5317            pub fn new() -> Self {
5318                std::default::Default::default()
5319            }
5320
5321            /// Sets the value of [network][crate::model::bucket::ip_filter::VpcNetworkSource::network].
5322            pub fn set_network<T>(mut self, v: T) -> Self
5323            where
5324                T: std::convert::Into<std::string::String>,
5325            {
5326                self.network = std::option::Option::Some(v.into());
5327                self
5328            }
5329
5330            /// Sets or clears the value of [network][crate::model::bucket::ip_filter::VpcNetworkSource::network].
5331            pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
5332            where
5333                T: std::convert::Into<std::string::String>,
5334            {
5335                self.network = v.map(|x| x.into());
5336                self
5337            }
5338
5339            /// Sets the value of [allowed_ip_cidr_ranges][crate::model::bucket::ip_filter::VpcNetworkSource::allowed_ip_cidr_ranges].
5340            pub fn set_allowed_ip_cidr_ranges<T, V>(mut self, v: T) -> Self
5341            where
5342                T: std::iter::IntoIterator<Item = V>,
5343                V: std::convert::Into<std::string::String>,
5344            {
5345                use std::iter::Iterator;
5346                self.allowed_ip_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
5347                self
5348            }
5349        }
5350
5351        impl wkt::message::Message for VpcNetworkSource {
5352            fn typename() -> &'static str {
5353                "type.googleapis.com/google.storage.v2.Bucket.IpFilter.VpcNetworkSource"
5354            }
5355        }
5356    }
5357
5358    /// Configuration for a bucket's hierarchical namespace feature.
5359    #[derive(Clone, Default, PartialEq)]
5360    #[non_exhaustive]
5361    pub struct HierarchicalNamespace {
5362        /// Optional. Enables the hierarchical namespace feature.
5363        pub enabled: bool,
5364
5365        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5366    }
5367
5368    impl HierarchicalNamespace {
5369        pub fn new() -> Self {
5370            std::default::Default::default()
5371        }
5372
5373        /// Sets the value of [enabled][crate::model::bucket::HierarchicalNamespace::enabled].
5374        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5375            self.enabled = v.into();
5376            self
5377        }
5378    }
5379
5380    impl wkt::message::Message for HierarchicalNamespace {
5381        fn typename() -> &'static str {
5382            "type.googleapis.com/google.storage.v2.Bucket.HierarchicalNamespace"
5383        }
5384    }
5385}
5386
5387/// An access-control entry.
5388#[derive(Clone, Default, PartialEq)]
5389#[non_exhaustive]
5390pub struct BucketAccessControl {
5391    /// Optional. The access permission for the entity.
5392    pub role: std::string::String,
5393
5394    /// Optional. The ID of the access-control entry.
5395    pub id: std::string::String,
5396
5397    /// Optional. The entity holding the permission, in one of the following forms:
5398    ///
5399    /// * `user-{userid}`
5400    /// * `user-{email}`
5401    /// * `group-{groupid}`
5402    /// * `group-{email}`
5403    /// * `domain-{domain}`
5404    /// * `project-{team}-{projectnumber}`
5405    /// * `project-{team}-{projectid}`
5406    /// * `allUsers`
5407    /// * `allAuthenticatedUsers`
5408    ///   Examples:
5409    /// * The user `liz@example.com` would be `user-liz@example.com`.
5410    /// * The group `example@googlegroups.com` would be
5411    ///   `group-example@googlegroups.com`
5412    /// * All members of the Google Apps for Business domain `example.com` would be
5413    ///   `domain-example.com`
5414    ///   For project entities, `project-{team}-{projectnumber}` format will be
5415    ///   returned on response.
5416    pub entity: std::string::String,
5417
5418    /// Output only. The alternative entity format, if exists. For project
5419    /// entities, `project-{team}-{projectid}` format will be returned on response.
5420    pub entity_alt: std::string::String,
5421
5422    /// Optional. The ID for the entity, if any.
5423    pub entity_id: std::string::String,
5424
5425    /// Optional. The etag of the BucketAccessControl.
5426    /// If included in the metadata of an update or delete request message, the
5427    /// operation operation will only be performed if the etag matches that of the
5428    /// bucket's BucketAccessControl.
5429    pub etag: std::string::String,
5430
5431    /// Optional. The email address associated with the entity, if any.
5432    pub email: std::string::String,
5433
5434    /// Optional. The domain associated with the entity, if any.
5435    pub domain: std::string::String,
5436
5437    /// Optional. The project team associated with the entity, if any.
5438    pub project_team: std::option::Option<crate::model::ProjectTeam>,
5439
5440    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5441}
5442
5443impl BucketAccessControl {
5444    pub fn new() -> Self {
5445        std::default::Default::default()
5446    }
5447
5448    /// Sets the value of [role][crate::model::BucketAccessControl::role].
5449    pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5450        self.role = v.into();
5451        self
5452    }
5453
5454    /// Sets the value of [id][crate::model::BucketAccessControl::id].
5455    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5456        self.id = v.into();
5457        self
5458    }
5459
5460    /// Sets the value of [entity][crate::model::BucketAccessControl::entity].
5461    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5462        self.entity = v.into();
5463        self
5464    }
5465
5466    /// Sets the value of [entity_alt][crate::model::BucketAccessControl::entity_alt].
5467    pub fn set_entity_alt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5468        self.entity_alt = v.into();
5469        self
5470    }
5471
5472    /// Sets the value of [entity_id][crate::model::BucketAccessControl::entity_id].
5473    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5474        self.entity_id = v.into();
5475        self
5476    }
5477
5478    /// Sets the value of [etag][crate::model::BucketAccessControl::etag].
5479    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5480        self.etag = v.into();
5481        self
5482    }
5483
5484    /// Sets the value of [email][crate::model::BucketAccessControl::email].
5485    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5486        self.email = v.into();
5487        self
5488    }
5489
5490    /// Sets the value of [domain][crate::model::BucketAccessControl::domain].
5491    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5492        self.domain = v.into();
5493        self
5494    }
5495
5496    /// Sets the value of [project_team][crate::model::BucketAccessControl::project_team].
5497    pub fn set_project_team<T>(mut self, v: T) -> Self
5498    where
5499        T: std::convert::Into<crate::model::ProjectTeam>,
5500    {
5501        self.project_team = std::option::Option::Some(v.into());
5502        self
5503    }
5504
5505    /// Sets or clears the value of [project_team][crate::model::BucketAccessControl::project_team].
5506    pub fn set_or_clear_project_team<T>(mut self, v: std::option::Option<T>) -> Self
5507    where
5508        T: std::convert::Into<crate::model::ProjectTeam>,
5509    {
5510        self.project_team = v.map(|x| x.into());
5511        self
5512    }
5513}
5514
5515impl wkt::message::Message for BucketAccessControl {
5516    fn typename() -> &'static str {
5517        "type.googleapis.com/google.storage.v2.BucketAccessControl"
5518    }
5519}
5520
5521/// Message used for storing full (not subrange) object checksums.
5522#[derive(Clone, Default, PartialEq)]
5523#[non_exhaustive]
5524pub struct ObjectChecksums {
5525    /// CRC32C digest of the object data. Computed by the Cloud Storage service for
5526    /// all written objects.
5527    /// If set in a WriteObjectRequest, service will validate that the stored
5528    /// object matches this checksum.
5529    pub crc32c: std::option::Option<u32>,
5530
5531    /// Optional. 128 bit MD5 hash of the object data.
5532    /// For more information about using the MD5 hash, see
5533    /// [<https://cloud.google.com/storage/docs/hashes-etags#json-api>][Hashes and
5534    /// ETags: Best Practices].
5535    /// Not all objects will provide an MD5 hash. For example, composite objects
5536    /// provide only crc32c hashes. This value is equivalent to running `cat
5537    /// object.txt | openssl md5 -binary`
5538    pub md5_hash: ::bytes::Bytes,
5539
5540    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5541}
5542
5543impl ObjectChecksums {
5544    pub fn new() -> Self {
5545        std::default::Default::default()
5546    }
5547
5548    /// Sets the value of [crc32c][crate::model::ObjectChecksums::crc32c].
5549    pub fn set_crc32c<T>(mut self, v: T) -> Self
5550    where
5551        T: std::convert::Into<u32>,
5552    {
5553        self.crc32c = std::option::Option::Some(v.into());
5554        self
5555    }
5556
5557    /// Sets or clears the value of [crc32c][crate::model::ObjectChecksums::crc32c].
5558    pub fn set_or_clear_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
5559    where
5560        T: std::convert::Into<u32>,
5561    {
5562        self.crc32c = v.map(|x| x.into());
5563        self
5564    }
5565
5566    /// Sets the value of [md5_hash][crate::model::ObjectChecksums::md5_hash].
5567    pub fn set_md5_hash<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5568        self.md5_hash = v.into();
5569        self
5570    }
5571}
5572
5573impl wkt::message::Message for ObjectChecksums {
5574    fn typename() -> &'static str {
5575        "type.googleapis.com/google.storage.v2.ObjectChecksums"
5576    }
5577}
5578
5579/// The payload of a single user-defined object context.
5580#[derive(Clone, Default, PartialEq)]
5581#[non_exhaustive]
5582pub struct ObjectCustomContextPayload {
5583    /// Required. The value of the object context.
5584    pub value: std::string::String,
5585
5586    /// Output only. The time at which the object context was created.
5587    pub create_time: std::option::Option<wkt::Timestamp>,
5588
5589    /// Output only. The time at which the object context was last updated.
5590    pub update_time: std::option::Option<wkt::Timestamp>,
5591
5592    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5593}
5594
5595impl ObjectCustomContextPayload {
5596    pub fn new() -> Self {
5597        std::default::Default::default()
5598    }
5599
5600    /// Sets the value of [value][crate::model::ObjectCustomContextPayload::value].
5601    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5602        self.value = v.into();
5603        self
5604    }
5605
5606    /// Sets the value of [create_time][crate::model::ObjectCustomContextPayload::create_time].
5607    pub fn set_create_time<T>(mut self, v: T) -> Self
5608    where
5609        T: std::convert::Into<wkt::Timestamp>,
5610    {
5611        self.create_time = std::option::Option::Some(v.into());
5612        self
5613    }
5614
5615    /// Sets or clears the value of [create_time][crate::model::ObjectCustomContextPayload::create_time].
5616    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5617    where
5618        T: std::convert::Into<wkt::Timestamp>,
5619    {
5620        self.create_time = v.map(|x| x.into());
5621        self
5622    }
5623
5624    /// Sets the value of [update_time][crate::model::ObjectCustomContextPayload::update_time].
5625    pub fn set_update_time<T>(mut self, v: T) -> Self
5626    where
5627        T: std::convert::Into<wkt::Timestamp>,
5628    {
5629        self.update_time = std::option::Option::Some(v.into());
5630        self
5631    }
5632
5633    /// Sets or clears the value of [update_time][crate::model::ObjectCustomContextPayload::update_time].
5634    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5635    where
5636        T: std::convert::Into<wkt::Timestamp>,
5637    {
5638        self.update_time = v.map(|x| x.into());
5639        self
5640    }
5641}
5642
5643impl wkt::message::Message for ObjectCustomContextPayload {
5644    fn typename() -> &'static str {
5645        "type.googleapis.com/google.storage.v2.ObjectCustomContextPayload"
5646    }
5647}
5648
5649/// All contexts of an object grouped by type.
5650#[derive(Clone, Default, PartialEq)]
5651#[non_exhaustive]
5652pub struct ObjectContexts {
5653    /// Optional. User-defined object contexts.
5654    pub custom:
5655        std::collections::HashMap<std::string::String, crate::model::ObjectCustomContextPayload>,
5656
5657    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5658}
5659
5660impl ObjectContexts {
5661    pub fn new() -> Self {
5662        std::default::Default::default()
5663    }
5664
5665    /// Sets the value of [custom][crate::model::ObjectContexts::custom].
5666    pub fn set_custom<T, K, V>(mut self, v: T) -> Self
5667    where
5668        T: std::iter::IntoIterator<Item = (K, V)>,
5669        K: std::convert::Into<std::string::String>,
5670        V: std::convert::Into<crate::model::ObjectCustomContextPayload>,
5671    {
5672        use std::iter::Iterator;
5673        self.custom = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5674        self
5675    }
5676}
5677
5678impl wkt::message::Message for ObjectContexts {
5679    fn typename() -> &'static str {
5680        "type.googleapis.com/google.storage.v2.ObjectContexts"
5681    }
5682}
5683
5684/// Describes the Customer-Supplied Encryption Key mechanism used to store an
5685/// Object's data at rest.
5686#[derive(Clone, Default, PartialEq)]
5687#[non_exhaustive]
5688pub struct CustomerEncryption {
5689    /// Optional. The encryption algorithm.
5690    pub encryption_algorithm: std::string::String,
5691
5692    /// Optional. SHA256 hash value of the encryption key.
5693    /// In raw bytes format (not base64-encoded).
5694    pub key_sha256_bytes: ::bytes::Bytes,
5695
5696    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5697}
5698
5699impl CustomerEncryption {
5700    pub fn new() -> Self {
5701        std::default::Default::default()
5702    }
5703
5704    /// Sets the value of [encryption_algorithm][crate::model::CustomerEncryption::encryption_algorithm].
5705    pub fn set_encryption_algorithm<T: std::convert::Into<std::string::String>>(
5706        mut self,
5707        v: T,
5708    ) -> Self {
5709        self.encryption_algorithm = v.into();
5710        self
5711    }
5712
5713    /// Sets the value of [key_sha256_bytes][crate::model::CustomerEncryption::key_sha256_bytes].
5714    pub fn set_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5715        self.key_sha256_bytes = v.into();
5716        self
5717    }
5718}
5719
5720impl wkt::message::Message for CustomerEncryption {
5721    fn typename() -> &'static str {
5722        "type.googleapis.com/google.storage.v2.CustomerEncryption"
5723    }
5724}
5725
5726/// An object.
5727#[derive(Clone, Default, PartialEq)]
5728#[non_exhaustive]
5729pub struct Object {
5730    /// Immutable. The name of this object. Nearly any sequence of unicode
5731    /// characters is valid. See
5732    /// [Guidelines](https://cloud.google.com/storage/docs/objects#naming).
5733    /// Example: `test.txt`
5734    /// The `name` field by itself does not uniquely identify a Cloud Storage
5735    /// object. A Cloud Storage object is uniquely identified by the tuple of
5736    /// (bucket, object, generation).
5737    pub name: std::string::String,
5738
5739    /// Immutable. The name of the bucket containing this object.
5740    pub bucket: std::string::String,
5741
5742    /// Optional. The etag of the object.
5743    /// If included in the metadata of an update or delete request message, the
5744    /// operation will only be performed if the etag matches that of the live
5745    /// object.
5746    pub etag: std::string::String,
5747
5748    /// Immutable. The content generation of this object. Used for object
5749    /// versioning.
5750    pub generation: i64,
5751
5752    /// Output only. Restore token used to differentiate deleted objects with the
5753    /// same name and generation. This field is output only, and only set for
5754    /// deleted objects in HNS buckets.
5755    pub restore_token: std::option::Option<std::string::String>,
5756
5757    /// Output only. The version of the metadata for this generation of this
5758    /// object. Used for preconditions and for detecting changes in metadata. A
5759    /// metageneration number is only meaningful in the context of a particular
5760    /// generation of a particular object.
5761    pub metageneration: i64,
5762
5763    /// Optional. Storage class of the object.
5764    pub storage_class: std::string::String,
5765
5766    /// Output only. Content-Length of the object data in bytes, matching
5767    /// [<https://tools.ietf.org/html/rfc7230#section-3.3.2>][RFC 7230 §3.3.2].
5768    pub size: i64,
5769
5770    /// Optional. Content-Encoding of the object data, matching
5771    /// [<https://tools.ietf.org/html/rfc7231#section-3.1.2.2>][RFC 7231 §3.1.2.2]
5772    pub content_encoding: std::string::String,
5773
5774    /// Optional. Content-Disposition of the object data, matching
5775    /// [<https://tools.ietf.org/html/rfc6266>][RFC 6266].
5776    pub content_disposition: std::string::String,
5777
5778    /// Optional. Cache-Control directive for the object data, matching
5779    /// [<https://tools.ietf.org/html/rfc7234#section-5.2>"][RFC 7234 §5.2].
5780    /// If omitted, and the object is accessible to all anonymous users, the
5781    /// default will be `public, max-age=3600`.
5782    pub cache_control: std::string::String,
5783
5784    /// Optional. Access controls on the object.
5785    /// If iam_config.uniform_bucket_level_access is enabled on the parent
5786    /// bucket, requests to set, read, or modify acl is an error.
5787    pub acl: std::vec::Vec<crate::model::ObjectAccessControl>,
5788
5789    /// Optional. Content-Language of the object data, matching
5790    /// [<https://tools.ietf.org/html/rfc7231#section-3.1.3.2>][RFC 7231 §3.1.3.2].
5791    pub content_language: std::string::String,
5792
5793    /// Output only. If this object is noncurrent, this is the time when the object
5794    /// became noncurrent.
5795    pub delete_time: std::option::Option<wkt::Timestamp>,
5796
5797    /// Output only. The time when the object was finalized.
5798    pub finalize_time: std::option::Option<wkt::Timestamp>,
5799
5800    /// Optional. Content-Type of the object data, matching
5801    /// [<https://tools.ietf.org/html/rfc7231#section-3.1.1.5>][RFC 7231 §3.1.1.5].
5802    /// If an object is stored without a Content-Type, it is served as
5803    /// `application/octet-stream`.
5804    pub content_type: std::string::String,
5805
5806    /// Output only. The creation time of the object.
5807    pub create_time: std::option::Option<wkt::Timestamp>,
5808
5809    /// Output only. Number of underlying components that make up this object.
5810    /// Components are accumulated by compose operations.
5811    pub component_count: i32,
5812
5813    /// Output only. Hashes for the data part of this object. This field is used
5814    /// for output only and will be silently ignored if provided in requests. The
5815    /// checksums of the complete object regardless of data range. If the object is
5816    /// downloaded in full, the client should compute one of these checksums over
5817    /// the downloaded object and compare it against the value provided here.
5818    pub checksums: std::option::Option<crate::model::ObjectChecksums>,
5819
5820    /// Output only. The modification time of the object metadata.
5821    /// Set initially to object creation time and then updated whenever any
5822    /// metadata of the object changes. This includes changes made by a requester,
5823    /// such as modifying custom metadata, as well as changes made by Cloud Storage
5824    /// on behalf of a requester, such as changing the storage class based on an
5825    /// Object Lifecycle Configuration.
5826    pub update_time: std::option::Option<wkt::Timestamp>,
5827
5828    /// Optional. Cloud KMS Key used to encrypt this object, if the object is
5829    /// encrypted by such a key.
5830    pub kms_key: std::string::String,
5831
5832    /// Output only. The time at which the object's storage class was last changed.
5833    /// When the object is initially created, it will be set to time_created.
5834    pub update_storage_class_time: std::option::Option<wkt::Timestamp>,
5835
5836    /// Optional. Whether an object is under temporary hold. While this flag is set
5837    /// to true, the object is protected against deletion and overwrites.  A common
5838    /// use case of this flag is regulatory investigations where objects need to be
5839    /// retained while the investigation is ongoing. Note that unlike event-based
5840    /// hold, temporary hold does not impact retention expiration time of an
5841    /// object.
5842    pub temporary_hold: bool,
5843
5844    /// Optional. A server-determined value that specifies the earliest time that
5845    /// the object's retention period expires. Note 1: This field is not provided
5846    /// for objects with an active event-based hold, since retention expiration is
5847    /// unknown until the hold is removed. Note 2: This value can be provided even
5848    /// when temporary hold is set (so that the user can reason about policy
5849    /// without having to first unset the temporary hold).
5850    pub retention_expire_time: std::option::Option<wkt::Timestamp>,
5851
5852    /// Optional. User-provided metadata, in key/value pairs.
5853    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
5854
5855    /// Optional. User-defined or system-defined object contexts. Each object
5856    /// context is a key-payload pair, where the key provides the identification
5857    /// and the payload holds the associated value and additional metadata.
5858    pub contexts: std::option::Option<crate::model::ObjectContexts>,
5859
5860    /// Whether an object is under event-based hold.
5861    /// An event-based hold is a way to force the retention of an object until
5862    /// after some event occurs. Once the hold is released by explicitly setting
5863    /// this field to false, the object will become subject to any bucket-level
5864    /// retention policy, except that the retention duration will be calculated
5865    /// from the time the event based hold was lifted, rather than the time the
5866    /// object was created.
5867    ///
5868    /// In a WriteObject request, not setting this field implies that the value
5869    /// should be taken from the parent bucket's "default_event_based_hold" field.
5870    /// In a response, this field will always be set to true or false.
5871    pub event_based_hold: std::option::Option<bool>,
5872
5873    /// Output only. The owner of the object. This will always be the uploader of
5874    /// the object.
5875    pub owner: std::option::Option<crate::model::Owner>,
5876
5877    /// Optional. Metadata of Customer-Supplied Encryption Key, if the object is
5878    /// encrypted by such a key.
5879    pub customer_encryption: std::option::Option<crate::model::CustomerEncryption>,
5880
5881    /// Optional. A user-specified timestamp set on an object.
5882    pub custom_time: std::option::Option<wkt::Timestamp>,
5883
5884    /// Output only. This is the time when the object became soft-deleted.
5885    ///
5886    /// Soft-deleted objects are only accessible if a soft_delete_policy is
5887    /// enabled. Also see hard_delete_time.
5888    pub soft_delete_time: std::option::Option<wkt::Timestamp>,
5889
5890    /// Output only. The time when the object will be permanently deleted.
5891    ///
5892    /// Only set when an object becomes soft-deleted with a soft_delete_policy.
5893    /// Otherwise, the object will not be accessible.
5894    pub hard_delete_time: std::option::Option<wkt::Timestamp>,
5895
5896    /// Optional. Retention configuration of this object.
5897    /// May only be configured if the bucket has object retention enabled.
5898    pub retention: std::option::Option<crate::model::object::Retention>,
5899
5900    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5901}
5902
5903impl Object {
5904    pub fn new() -> Self {
5905        std::default::Default::default()
5906    }
5907
5908    /// Sets the value of [name][crate::model::Object::name].
5909    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5910        self.name = v.into();
5911        self
5912    }
5913
5914    /// Sets the value of [bucket][crate::model::Object::bucket].
5915    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5916        self.bucket = v.into();
5917        self
5918    }
5919
5920    /// Sets the value of [etag][crate::model::Object::etag].
5921    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5922        self.etag = v.into();
5923        self
5924    }
5925
5926    /// Sets the value of [generation][crate::model::Object::generation].
5927    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5928        self.generation = v.into();
5929        self
5930    }
5931
5932    /// Sets the value of [restore_token][crate::model::Object::restore_token].
5933    pub fn set_restore_token<T>(mut self, v: T) -> Self
5934    where
5935        T: std::convert::Into<std::string::String>,
5936    {
5937        self.restore_token = std::option::Option::Some(v.into());
5938        self
5939    }
5940
5941    /// Sets or clears the value of [restore_token][crate::model::Object::restore_token].
5942    pub fn set_or_clear_restore_token<T>(mut self, v: std::option::Option<T>) -> Self
5943    where
5944        T: std::convert::Into<std::string::String>,
5945    {
5946        self.restore_token = v.map(|x| x.into());
5947        self
5948    }
5949
5950    /// Sets the value of [metageneration][crate::model::Object::metageneration].
5951    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5952        self.metageneration = v.into();
5953        self
5954    }
5955
5956    /// Sets the value of [storage_class][crate::model::Object::storage_class].
5957    pub fn set_storage_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5958        self.storage_class = v.into();
5959        self
5960    }
5961
5962    /// Sets the value of [size][crate::model::Object::size].
5963    pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5964        self.size = v.into();
5965        self
5966    }
5967
5968    /// Sets the value of [content_encoding][crate::model::Object::content_encoding].
5969    pub fn set_content_encoding<T: std::convert::Into<std::string::String>>(
5970        mut self,
5971        v: T,
5972    ) -> Self {
5973        self.content_encoding = v.into();
5974        self
5975    }
5976
5977    /// Sets the value of [content_disposition][crate::model::Object::content_disposition].
5978    pub fn set_content_disposition<T: std::convert::Into<std::string::String>>(
5979        mut self,
5980        v: T,
5981    ) -> Self {
5982        self.content_disposition = v.into();
5983        self
5984    }
5985
5986    /// Sets the value of [cache_control][crate::model::Object::cache_control].
5987    pub fn set_cache_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5988        self.cache_control = v.into();
5989        self
5990    }
5991
5992    /// Sets the value of [acl][crate::model::Object::acl].
5993    pub fn set_acl<T, V>(mut self, v: T) -> Self
5994    where
5995        T: std::iter::IntoIterator<Item = V>,
5996        V: std::convert::Into<crate::model::ObjectAccessControl>,
5997    {
5998        use std::iter::Iterator;
5999        self.acl = v.into_iter().map(|i| i.into()).collect();
6000        self
6001    }
6002
6003    /// Sets the value of [content_language][crate::model::Object::content_language].
6004    pub fn set_content_language<T: std::convert::Into<std::string::String>>(
6005        mut self,
6006        v: T,
6007    ) -> Self {
6008        self.content_language = v.into();
6009        self
6010    }
6011
6012    /// Sets the value of [delete_time][crate::model::Object::delete_time].
6013    pub fn set_delete_time<T>(mut self, v: T) -> Self
6014    where
6015        T: std::convert::Into<wkt::Timestamp>,
6016    {
6017        self.delete_time = std::option::Option::Some(v.into());
6018        self
6019    }
6020
6021    /// Sets or clears the value of [delete_time][crate::model::Object::delete_time].
6022    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
6023    where
6024        T: std::convert::Into<wkt::Timestamp>,
6025    {
6026        self.delete_time = v.map(|x| x.into());
6027        self
6028    }
6029
6030    /// Sets the value of [finalize_time][crate::model::Object::finalize_time].
6031    pub fn set_finalize_time<T>(mut self, v: T) -> Self
6032    where
6033        T: std::convert::Into<wkt::Timestamp>,
6034    {
6035        self.finalize_time = std::option::Option::Some(v.into());
6036        self
6037    }
6038
6039    /// Sets or clears the value of [finalize_time][crate::model::Object::finalize_time].
6040    pub fn set_or_clear_finalize_time<T>(mut self, v: std::option::Option<T>) -> Self
6041    where
6042        T: std::convert::Into<wkt::Timestamp>,
6043    {
6044        self.finalize_time = v.map(|x| x.into());
6045        self
6046    }
6047
6048    /// Sets the value of [content_type][crate::model::Object::content_type].
6049    pub fn set_content_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6050        self.content_type = v.into();
6051        self
6052    }
6053
6054    /// Sets the value of [create_time][crate::model::Object::create_time].
6055    pub fn set_create_time<T>(mut self, v: T) -> Self
6056    where
6057        T: std::convert::Into<wkt::Timestamp>,
6058    {
6059        self.create_time = std::option::Option::Some(v.into());
6060        self
6061    }
6062
6063    /// Sets or clears the value of [create_time][crate::model::Object::create_time].
6064    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6065    where
6066        T: std::convert::Into<wkt::Timestamp>,
6067    {
6068        self.create_time = v.map(|x| x.into());
6069        self
6070    }
6071
6072    /// Sets the value of [component_count][crate::model::Object::component_count].
6073    pub fn set_component_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6074        self.component_count = v.into();
6075        self
6076    }
6077
6078    /// Sets the value of [checksums][crate::model::Object::checksums].
6079    pub fn set_checksums<T>(mut self, v: T) -> Self
6080    where
6081        T: std::convert::Into<crate::model::ObjectChecksums>,
6082    {
6083        self.checksums = std::option::Option::Some(v.into());
6084        self
6085    }
6086
6087    /// Sets or clears the value of [checksums][crate::model::Object::checksums].
6088    pub fn set_or_clear_checksums<T>(mut self, v: std::option::Option<T>) -> Self
6089    where
6090        T: std::convert::Into<crate::model::ObjectChecksums>,
6091    {
6092        self.checksums = v.map(|x| x.into());
6093        self
6094    }
6095
6096    /// Sets the value of [update_time][crate::model::Object::update_time].
6097    pub fn set_update_time<T>(mut self, v: T) -> Self
6098    where
6099        T: std::convert::Into<wkt::Timestamp>,
6100    {
6101        self.update_time = std::option::Option::Some(v.into());
6102        self
6103    }
6104
6105    /// Sets or clears the value of [update_time][crate::model::Object::update_time].
6106    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6107    where
6108        T: std::convert::Into<wkt::Timestamp>,
6109    {
6110        self.update_time = v.map(|x| x.into());
6111        self
6112    }
6113
6114    /// Sets the value of [kms_key][crate::model::Object::kms_key].
6115    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6116        self.kms_key = v.into();
6117        self
6118    }
6119
6120    /// Sets the value of [update_storage_class_time][crate::model::Object::update_storage_class_time].
6121    pub fn set_update_storage_class_time<T>(mut self, v: T) -> Self
6122    where
6123        T: std::convert::Into<wkt::Timestamp>,
6124    {
6125        self.update_storage_class_time = std::option::Option::Some(v.into());
6126        self
6127    }
6128
6129    /// Sets or clears the value of [update_storage_class_time][crate::model::Object::update_storage_class_time].
6130    pub fn set_or_clear_update_storage_class_time<T>(mut self, v: std::option::Option<T>) -> Self
6131    where
6132        T: std::convert::Into<wkt::Timestamp>,
6133    {
6134        self.update_storage_class_time = v.map(|x| x.into());
6135        self
6136    }
6137
6138    /// Sets the value of [temporary_hold][crate::model::Object::temporary_hold].
6139    pub fn set_temporary_hold<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6140        self.temporary_hold = v.into();
6141        self
6142    }
6143
6144    /// Sets the value of [retention_expire_time][crate::model::Object::retention_expire_time].
6145    pub fn set_retention_expire_time<T>(mut self, v: T) -> Self
6146    where
6147        T: std::convert::Into<wkt::Timestamp>,
6148    {
6149        self.retention_expire_time = std::option::Option::Some(v.into());
6150        self
6151    }
6152
6153    /// Sets or clears the value of [retention_expire_time][crate::model::Object::retention_expire_time].
6154    pub fn set_or_clear_retention_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
6155    where
6156        T: std::convert::Into<wkt::Timestamp>,
6157    {
6158        self.retention_expire_time = v.map(|x| x.into());
6159        self
6160    }
6161
6162    /// Sets the value of [metadata][crate::model::Object::metadata].
6163    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
6164    where
6165        T: std::iter::IntoIterator<Item = (K, V)>,
6166        K: std::convert::Into<std::string::String>,
6167        V: std::convert::Into<std::string::String>,
6168    {
6169        use std::iter::Iterator;
6170        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6171        self
6172    }
6173
6174    /// Sets the value of [contexts][crate::model::Object::contexts].
6175    pub fn set_contexts<T>(mut self, v: T) -> Self
6176    where
6177        T: std::convert::Into<crate::model::ObjectContexts>,
6178    {
6179        self.contexts = std::option::Option::Some(v.into());
6180        self
6181    }
6182
6183    /// Sets or clears the value of [contexts][crate::model::Object::contexts].
6184    pub fn set_or_clear_contexts<T>(mut self, v: std::option::Option<T>) -> Self
6185    where
6186        T: std::convert::Into<crate::model::ObjectContexts>,
6187    {
6188        self.contexts = v.map(|x| x.into());
6189        self
6190    }
6191
6192    /// Sets the value of [event_based_hold][crate::model::Object::event_based_hold].
6193    pub fn set_event_based_hold<T>(mut self, v: T) -> Self
6194    where
6195        T: std::convert::Into<bool>,
6196    {
6197        self.event_based_hold = std::option::Option::Some(v.into());
6198        self
6199    }
6200
6201    /// Sets or clears the value of [event_based_hold][crate::model::Object::event_based_hold].
6202    pub fn set_or_clear_event_based_hold<T>(mut self, v: std::option::Option<T>) -> Self
6203    where
6204        T: std::convert::Into<bool>,
6205    {
6206        self.event_based_hold = v.map(|x| x.into());
6207        self
6208    }
6209
6210    /// Sets the value of [owner][crate::model::Object::owner].
6211    pub fn set_owner<T>(mut self, v: T) -> Self
6212    where
6213        T: std::convert::Into<crate::model::Owner>,
6214    {
6215        self.owner = std::option::Option::Some(v.into());
6216        self
6217    }
6218
6219    /// Sets or clears the value of [owner][crate::model::Object::owner].
6220    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
6221    where
6222        T: std::convert::Into<crate::model::Owner>,
6223    {
6224        self.owner = v.map(|x| x.into());
6225        self
6226    }
6227
6228    /// Sets the value of [customer_encryption][crate::model::Object::customer_encryption].
6229    pub fn set_customer_encryption<T>(mut self, v: T) -> Self
6230    where
6231        T: std::convert::Into<crate::model::CustomerEncryption>,
6232    {
6233        self.customer_encryption = std::option::Option::Some(v.into());
6234        self
6235    }
6236
6237    /// Sets or clears the value of [customer_encryption][crate::model::Object::customer_encryption].
6238    pub fn set_or_clear_customer_encryption<T>(mut self, v: std::option::Option<T>) -> Self
6239    where
6240        T: std::convert::Into<crate::model::CustomerEncryption>,
6241    {
6242        self.customer_encryption = v.map(|x| x.into());
6243        self
6244    }
6245
6246    /// Sets the value of [custom_time][crate::model::Object::custom_time].
6247    pub fn set_custom_time<T>(mut self, v: T) -> Self
6248    where
6249        T: std::convert::Into<wkt::Timestamp>,
6250    {
6251        self.custom_time = std::option::Option::Some(v.into());
6252        self
6253    }
6254
6255    /// Sets or clears the value of [custom_time][crate::model::Object::custom_time].
6256    pub fn set_or_clear_custom_time<T>(mut self, v: std::option::Option<T>) -> Self
6257    where
6258        T: std::convert::Into<wkt::Timestamp>,
6259    {
6260        self.custom_time = v.map(|x| x.into());
6261        self
6262    }
6263
6264    /// Sets the value of [soft_delete_time][crate::model::Object::soft_delete_time].
6265    pub fn set_soft_delete_time<T>(mut self, v: T) -> Self
6266    where
6267        T: std::convert::Into<wkt::Timestamp>,
6268    {
6269        self.soft_delete_time = std::option::Option::Some(v.into());
6270        self
6271    }
6272
6273    /// Sets or clears the value of [soft_delete_time][crate::model::Object::soft_delete_time].
6274    pub fn set_or_clear_soft_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
6275    where
6276        T: std::convert::Into<wkt::Timestamp>,
6277    {
6278        self.soft_delete_time = v.map(|x| x.into());
6279        self
6280    }
6281
6282    /// Sets the value of [hard_delete_time][crate::model::Object::hard_delete_time].
6283    pub fn set_hard_delete_time<T>(mut self, v: T) -> Self
6284    where
6285        T: std::convert::Into<wkt::Timestamp>,
6286    {
6287        self.hard_delete_time = std::option::Option::Some(v.into());
6288        self
6289    }
6290
6291    /// Sets or clears the value of [hard_delete_time][crate::model::Object::hard_delete_time].
6292    pub fn set_or_clear_hard_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
6293    where
6294        T: std::convert::Into<wkt::Timestamp>,
6295    {
6296        self.hard_delete_time = v.map(|x| x.into());
6297        self
6298    }
6299
6300    /// Sets the value of [retention][crate::model::Object::retention].
6301    pub fn set_retention<T>(mut self, v: T) -> Self
6302    where
6303        T: std::convert::Into<crate::model::object::Retention>,
6304    {
6305        self.retention = std::option::Option::Some(v.into());
6306        self
6307    }
6308
6309    /// Sets or clears the value of [retention][crate::model::Object::retention].
6310    pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
6311    where
6312        T: std::convert::Into<crate::model::object::Retention>,
6313    {
6314        self.retention = v.map(|x| x.into());
6315        self
6316    }
6317}
6318
6319impl wkt::message::Message for Object {
6320    fn typename() -> &'static str {
6321        "type.googleapis.com/google.storage.v2.Object"
6322    }
6323}
6324
6325/// Defines additional types related to [Object].
6326pub mod object {
6327    #[allow(unused_imports)]
6328    use super::*;
6329
6330    /// Specifies retention parameters of the object. Objects under retention
6331    /// cannot be deleted or overwritten until their retention expires.
6332    #[derive(Clone, Default, PartialEq)]
6333    #[non_exhaustive]
6334    pub struct Retention {
6335        /// Optional. The mode of the Retention.
6336        pub mode: crate::model::object::retention::Mode,
6337
6338        /// Optional. The timestamp that the object needs to be retained until.
6339        /// Value cannot be set in the past or more than 100 years in the future.
6340        pub retain_until_time: std::option::Option<wkt::Timestamp>,
6341
6342        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6343    }
6344
6345    impl Retention {
6346        pub fn new() -> Self {
6347            std::default::Default::default()
6348        }
6349
6350        /// Sets the value of [mode][crate::model::object::Retention::mode].
6351        pub fn set_mode<T: std::convert::Into<crate::model::object::retention::Mode>>(
6352            mut self,
6353            v: T,
6354        ) -> Self {
6355            self.mode = v.into();
6356            self
6357        }
6358
6359        /// Sets the value of [retain_until_time][crate::model::object::Retention::retain_until_time].
6360        pub fn set_retain_until_time<T>(mut self, v: T) -> Self
6361        where
6362            T: std::convert::Into<wkt::Timestamp>,
6363        {
6364            self.retain_until_time = std::option::Option::Some(v.into());
6365            self
6366        }
6367
6368        /// Sets or clears the value of [retain_until_time][crate::model::object::Retention::retain_until_time].
6369        pub fn set_or_clear_retain_until_time<T>(mut self, v: std::option::Option<T>) -> Self
6370        where
6371            T: std::convert::Into<wkt::Timestamp>,
6372        {
6373            self.retain_until_time = v.map(|x| x.into());
6374            self
6375        }
6376    }
6377
6378    impl wkt::message::Message for Retention {
6379        fn typename() -> &'static str {
6380            "type.googleapis.com/google.storage.v2.Object.Retention"
6381        }
6382    }
6383
6384    /// Defines additional types related to [Retention].
6385    pub mod retention {
6386        #[allow(unused_imports)]
6387        use super::*;
6388
6389        /// Retention mode values.
6390        ///
6391        /// # Working with unknown values
6392        ///
6393        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6394        /// additional enum variants at any time. Adding new variants is not considered
6395        /// a breaking change. Applications should write their code in anticipation of:
6396        ///
6397        /// - New values appearing in future releases of the client library, **and**
6398        /// - New values received dynamically, without application changes.
6399        ///
6400        /// Please consult the [Working with enums] section in the user guide for some
6401        /// guidelines.
6402        ///
6403        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6404        #[derive(Clone, Debug, PartialEq)]
6405        #[non_exhaustive]
6406        pub enum Mode {
6407            /// No specified mode. Object is not under retention.
6408            Unspecified,
6409            /// Retention period may be decreased or increased.
6410            /// The Retention configuration may be removed.
6411            /// The mode may be changed to locked.
6412            Unlocked,
6413            /// Retention period may be increased.
6414            /// The Retention configuration cannot be removed.
6415            /// The mode cannot be changed.
6416            Locked,
6417            /// If set, the enum was initialized with an unknown value.
6418            ///
6419            /// Applications can examine the value using [Mode::value] or
6420            /// [Mode::name].
6421            UnknownValue(mode::UnknownValue),
6422        }
6423
6424        #[doc(hidden)]
6425        pub mod mode {
6426            #[allow(unused_imports)]
6427            use super::*;
6428            #[derive(Clone, Debug, PartialEq)]
6429            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6430        }
6431
6432        impl Mode {
6433            /// Gets the enum value.
6434            ///
6435            /// Returns `None` if the enum contains an unknown value deserialized from
6436            /// the string representation of enums.
6437            pub fn value(&self) -> std::option::Option<i32> {
6438                match self {
6439                    Self::Unspecified => std::option::Option::Some(0),
6440                    Self::Unlocked => std::option::Option::Some(1),
6441                    Self::Locked => std::option::Option::Some(2),
6442                    Self::UnknownValue(u) => u.0.value(),
6443                }
6444            }
6445
6446            /// Gets the enum value as a string.
6447            ///
6448            /// Returns `None` if the enum contains an unknown value deserialized from
6449            /// the integer representation of enums.
6450            pub fn name(&self) -> std::option::Option<&str> {
6451                match self {
6452                    Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
6453                    Self::Unlocked => std::option::Option::Some("UNLOCKED"),
6454                    Self::Locked => std::option::Option::Some("LOCKED"),
6455                    Self::UnknownValue(u) => u.0.name(),
6456                }
6457            }
6458        }
6459
6460        impl std::default::Default for Mode {
6461            fn default() -> Self {
6462                use std::convert::From;
6463                Self::from(0)
6464            }
6465        }
6466
6467        impl std::fmt::Display for Mode {
6468            fn fmt(
6469                &self,
6470                f: &mut std::fmt::Formatter<'_>,
6471            ) -> std::result::Result<(), std::fmt::Error> {
6472                wkt::internal::display_enum(f, self.name(), self.value())
6473            }
6474        }
6475
6476        impl std::convert::From<i32> for Mode {
6477            fn from(value: i32) -> Self {
6478                match value {
6479                    0 => Self::Unspecified,
6480                    1 => Self::Unlocked,
6481                    2 => Self::Locked,
6482                    _ => Self::UnknownValue(mode::UnknownValue(
6483                        wkt::internal::UnknownEnumValue::Integer(value),
6484                    )),
6485                }
6486            }
6487        }
6488
6489        impl std::convert::From<&str> for Mode {
6490            fn from(value: &str) -> Self {
6491                use std::string::ToString;
6492                match value {
6493                    "MODE_UNSPECIFIED" => Self::Unspecified,
6494                    "UNLOCKED" => Self::Unlocked,
6495                    "LOCKED" => Self::Locked,
6496                    _ => Self::UnknownValue(mode::UnknownValue(
6497                        wkt::internal::UnknownEnumValue::String(value.to_string()),
6498                    )),
6499                }
6500            }
6501        }
6502
6503        impl serde::ser::Serialize for Mode {
6504            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6505            where
6506                S: serde::Serializer,
6507            {
6508                match self {
6509                    Self::Unspecified => serializer.serialize_i32(0),
6510                    Self::Unlocked => serializer.serialize_i32(1),
6511                    Self::Locked => serializer.serialize_i32(2),
6512                    Self::UnknownValue(u) => u.0.serialize(serializer),
6513                }
6514            }
6515        }
6516
6517        impl<'de> serde::de::Deserialize<'de> for Mode {
6518            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6519            where
6520                D: serde::Deserializer<'de>,
6521            {
6522                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
6523                    ".google.storage.v2.Object.Retention.Mode",
6524                ))
6525            }
6526        }
6527    }
6528}
6529
6530/// An access-control entry.
6531#[derive(Clone, Default, PartialEq)]
6532#[non_exhaustive]
6533pub struct ObjectAccessControl {
6534    /// Optional. The access permission for the entity. One of the following
6535    /// values:
6536    ///
6537    /// * `READER`
6538    /// * `WRITER`
6539    /// * `OWNER`
6540    pub role: std::string::String,
6541
6542    /// Optional. The ID of the access-control entry.
6543    pub id: std::string::String,
6544
6545    /// Optional. The entity holding the permission, in one of the following forms:
6546    ///
6547    /// * `user-{userid}`
6548    /// * `user-{email}`
6549    /// * `group-{groupid}`
6550    /// * `group-{email}`
6551    /// * `domain-{domain}`
6552    /// * `project-{team}-{projectnumber}`
6553    /// * `project-{team}-{projectid}`
6554    /// * `allUsers`
6555    /// * `allAuthenticatedUsers`
6556    ///   Examples:
6557    /// * The user `liz@example.com` would be `user-liz@example.com`.
6558    /// * The group `example@googlegroups.com` would be
6559    ///   `group-example@googlegroups.com`.
6560    /// * All members of the Google Apps for Business domain `example.com` would be
6561    ///   `domain-example.com`.
6562    ///   For project entities, `project-{team}-{projectnumber}` format will be
6563    ///   returned on response.
6564    pub entity: std::string::String,
6565
6566    /// Output only. The alternative entity format, if exists. For project
6567    /// entities, `project-{team}-{projectid}` format will be returned on response.
6568    pub entity_alt: std::string::String,
6569
6570    /// Optional. The ID for the entity, if any.
6571    pub entity_id: std::string::String,
6572
6573    /// Optional. The etag of the ObjectAccessControl.
6574    /// If included in the metadata of an update or delete request message, the
6575    /// operation will only be performed if the etag matches that of the live
6576    /// object's ObjectAccessControl.
6577    pub etag: std::string::String,
6578
6579    /// Optional. The email address associated with the entity, if any.
6580    pub email: std::string::String,
6581
6582    /// Optional. The domain associated with the entity, if any.
6583    pub domain: std::string::String,
6584
6585    /// Optional. The project team associated with the entity, if any.
6586    pub project_team: std::option::Option<crate::model::ProjectTeam>,
6587
6588    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6589}
6590
6591impl ObjectAccessControl {
6592    pub fn new() -> Self {
6593        std::default::Default::default()
6594    }
6595
6596    /// Sets the value of [role][crate::model::ObjectAccessControl::role].
6597    pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6598        self.role = v.into();
6599        self
6600    }
6601
6602    /// Sets the value of [id][crate::model::ObjectAccessControl::id].
6603    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6604        self.id = v.into();
6605        self
6606    }
6607
6608    /// Sets the value of [entity][crate::model::ObjectAccessControl::entity].
6609    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6610        self.entity = v.into();
6611        self
6612    }
6613
6614    /// Sets the value of [entity_alt][crate::model::ObjectAccessControl::entity_alt].
6615    pub fn set_entity_alt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6616        self.entity_alt = v.into();
6617        self
6618    }
6619
6620    /// Sets the value of [entity_id][crate::model::ObjectAccessControl::entity_id].
6621    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6622        self.entity_id = v.into();
6623        self
6624    }
6625
6626    /// Sets the value of [etag][crate::model::ObjectAccessControl::etag].
6627    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6628        self.etag = v.into();
6629        self
6630    }
6631
6632    /// Sets the value of [email][crate::model::ObjectAccessControl::email].
6633    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6634        self.email = v.into();
6635        self
6636    }
6637
6638    /// Sets the value of [domain][crate::model::ObjectAccessControl::domain].
6639    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6640        self.domain = v.into();
6641        self
6642    }
6643
6644    /// Sets the value of [project_team][crate::model::ObjectAccessControl::project_team].
6645    pub fn set_project_team<T>(mut self, v: T) -> Self
6646    where
6647        T: std::convert::Into<crate::model::ProjectTeam>,
6648    {
6649        self.project_team = std::option::Option::Some(v.into());
6650        self
6651    }
6652
6653    /// Sets or clears the value of [project_team][crate::model::ObjectAccessControl::project_team].
6654    pub fn set_or_clear_project_team<T>(mut self, v: std::option::Option<T>) -> Self
6655    where
6656        T: std::convert::Into<crate::model::ProjectTeam>,
6657    {
6658        self.project_team = v.map(|x| x.into());
6659        self
6660    }
6661}
6662
6663impl wkt::message::Message for ObjectAccessControl {
6664    fn typename() -> &'static str {
6665        "type.googleapis.com/google.storage.v2.ObjectAccessControl"
6666    }
6667}
6668
6669/// The result of a call to Objects.ListObjects
6670#[derive(Clone, Default, PartialEq)]
6671#[non_exhaustive]
6672pub struct ListObjectsResponse {
6673    /// The list of items.
6674    pub objects: std::vec::Vec<crate::model::Object>,
6675
6676    /// The list of prefixes of objects matching-but-not-listed up to and including
6677    /// the requested delimiter.
6678    pub prefixes: std::vec::Vec<std::string::String>,
6679
6680    /// The continuation token, used to page through large result sets. Provide
6681    /// this value in a subsequent request to return the next page of results.
6682    pub next_page_token: std::string::String,
6683
6684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6685}
6686
6687impl ListObjectsResponse {
6688    pub fn new() -> Self {
6689        std::default::Default::default()
6690    }
6691
6692    /// Sets the value of [objects][crate::model::ListObjectsResponse::objects].
6693    pub fn set_objects<T, V>(mut self, v: T) -> Self
6694    where
6695        T: std::iter::IntoIterator<Item = V>,
6696        V: std::convert::Into<crate::model::Object>,
6697    {
6698        use std::iter::Iterator;
6699        self.objects = v.into_iter().map(|i| i.into()).collect();
6700        self
6701    }
6702
6703    /// Sets the value of [prefixes][crate::model::ListObjectsResponse::prefixes].
6704    pub fn set_prefixes<T, V>(mut self, v: T) -> Self
6705    where
6706        T: std::iter::IntoIterator<Item = V>,
6707        V: std::convert::Into<std::string::String>,
6708    {
6709        use std::iter::Iterator;
6710        self.prefixes = v.into_iter().map(|i| i.into()).collect();
6711        self
6712    }
6713
6714    /// Sets the value of [next_page_token][crate::model::ListObjectsResponse::next_page_token].
6715    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6716        self.next_page_token = v.into();
6717        self
6718    }
6719}
6720
6721impl wkt::message::Message for ListObjectsResponse {
6722    fn typename() -> &'static str {
6723        "type.googleapis.com/google.storage.v2.ListObjectsResponse"
6724    }
6725}
6726
6727#[doc(hidden)]
6728impl gax::paginator::internal::PageableResponse for ListObjectsResponse {
6729    type PageItem = crate::model::Object;
6730
6731    fn items(self) -> std::vec::Vec<Self::PageItem> {
6732        self.objects
6733    }
6734
6735    fn next_page_token(&self) -> std::string::String {
6736        use std::clone::Clone;
6737        self.next_page_token.clone()
6738    }
6739}
6740
6741/// Represents the Viewers, Editors, or Owners of a given project.
6742#[derive(Clone, Default, PartialEq)]
6743#[non_exhaustive]
6744pub struct ProjectTeam {
6745    /// Optional. The project number.
6746    pub project_number: std::string::String,
6747
6748    /// Optional. The team.
6749    pub team: std::string::String,
6750
6751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6752}
6753
6754impl ProjectTeam {
6755    pub fn new() -> Self {
6756        std::default::Default::default()
6757    }
6758
6759    /// Sets the value of [project_number][crate::model::ProjectTeam::project_number].
6760    pub fn set_project_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6761        self.project_number = v.into();
6762        self
6763    }
6764
6765    /// Sets the value of [team][crate::model::ProjectTeam::team].
6766    pub fn set_team<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6767        self.team = v.into();
6768        self
6769    }
6770}
6771
6772impl wkt::message::Message for ProjectTeam {
6773    fn typename() -> &'static str {
6774        "type.googleapis.com/google.storage.v2.ProjectTeam"
6775    }
6776}
6777
6778/// The owner of a specific resource.
6779#[derive(Clone, Default, PartialEq)]
6780#[non_exhaustive]
6781pub struct Owner {
6782    /// Optional. The entity, in the form `user-`*userId*.
6783    pub entity: std::string::String,
6784
6785    /// Optional. The ID for the entity.
6786    pub entity_id: std::string::String,
6787
6788    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6789}
6790
6791impl Owner {
6792    pub fn new() -> Self {
6793        std::default::Default::default()
6794    }
6795
6796    /// Sets the value of [entity][crate::model::Owner::entity].
6797    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6798        self.entity = v.into();
6799        self
6800    }
6801
6802    /// Sets the value of [entity_id][crate::model::Owner::entity_id].
6803    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6804        self.entity_id = v.into();
6805        self
6806    }
6807}
6808
6809impl wkt::message::Message for Owner {
6810    fn typename() -> &'static str {
6811        "type.googleapis.com/google.storage.v2.Owner"
6812    }
6813}