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