google_cloud_storage/generated/gapic/
model.rs

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