Skip to main content

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