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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// A resource that represents a Secure Source Manager instance.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Instance {
45    /// Identifier. A unique identifier for an instance. The name should be of the
46    /// format:
47    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`
48    ///
49    /// `project_number`: Maps to a unique int64 id assigned to each project.
50    ///
51    /// `location_id`: Refers to the region where the instance will be deployed.
52    /// Since Secure Source Manager is a regional service, it must be one of the
53    /// valid GCP regions.
54    ///
55    /// `instance_id`: User provided name for the instance, must be unique for a
56    /// project_number and location_id combination.
57    pub name: std::string::String,
58
59    /// Output only. Create timestamp.
60    pub create_time: std::option::Option<wkt::Timestamp>,
61
62    /// Output only. Update timestamp.
63    pub update_time: std::option::Option<wkt::Timestamp>,
64
65    /// Optional. Labels as key value pairs.
66    /// Keys and values can contain only lowercase letters, numeric characters,
67    /// underscores, and dashes.
68    /// For more information, see [Requirements for
69    /// labels](https://cloud.google.com/resource-manager/docs/best-practices-labels#label_encoding).
70    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
71
72    /// Optional. Private settings for private instance.
73    pub private_config: std::option::Option<crate::model::instance::PrivateConfig>,
74
75    /// Output only. Current state of the instance.
76    pub state: crate::model::instance::State,
77
78    /// Output only. An optional field providing information about the current
79    /// instance state.
80    pub state_note: crate::model::instance::StateNote,
81
82    /// Optional. Immutable. Customer-managed encryption key name, in the format
83    /// projects/*/locations/*/keyRings/*/cryptoKeys/*.
84    pub kms_key: std::string::String,
85
86    /// Output only. A list of hostnames for this instance.
87    pub host_config: std::option::Option<crate::model::instance::HostConfig>,
88
89    /// Optional. Configuration for Workforce Identity Federation to support
90    /// third party identity provider. If unset, defaults to the Google OIDC IdP.
91    pub workforce_identity_federation_config:
92        std::option::Option<crate::model::instance::WorkforceIdentityFederationConfig>,
93
94    /// Output only. Reserved for future use.
95    pub satisfies_pzi: bool,
96
97    /// Output only. Reserved for future use.
98    pub satisfies_pzs: bool,
99
100    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
101}
102
103impl Instance {
104    /// Creates a new default instance.
105    pub fn new() -> Self {
106        std::default::Default::default()
107    }
108
109    /// Sets the value of [name][crate::model::Instance::name].
110    ///
111    /// # Example
112    /// ```ignore,no_run
113    /// # use google_cloud_securesourcemanager_v1::model::Instance;
114    /// # let project_id = "project_id";
115    /// # let location_id = "location_id";
116    /// # let instance_id = "instance_id";
117    /// let x = Instance::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
118    /// ```
119    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120        self.name = v.into();
121        self
122    }
123
124    /// Sets the value of [create_time][crate::model::Instance::create_time].
125    ///
126    /// # Example
127    /// ```ignore,no_run
128    /// # use google_cloud_securesourcemanager_v1::model::Instance;
129    /// use wkt::Timestamp;
130    /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
131    /// ```
132    pub fn set_create_time<T>(mut self, v: T) -> Self
133    where
134        T: std::convert::Into<wkt::Timestamp>,
135    {
136        self.create_time = std::option::Option::Some(v.into());
137        self
138    }
139
140    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
141    ///
142    /// # Example
143    /// ```ignore,no_run
144    /// # use google_cloud_securesourcemanager_v1::model::Instance;
145    /// use wkt::Timestamp;
146    /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
147    /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
148    /// ```
149    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
150    where
151        T: std::convert::Into<wkt::Timestamp>,
152    {
153        self.create_time = v.map(|x| x.into());
154        self
155    }
156
157    /// Sets the value of [update_time][crate::model::Instance::update_time].
158    ///
159    /// # Example
160    /// ```ignore,no_run
161    /// # use google_cloud_securesourcemanager_v1::model::Instance;
162    /// use wkt::Timestamp;
163    /// let x = Instance::new().set_update_time(Timestamp::default()/* use setters */);
164    /// ```
165    pub fn set_update_time<T>(mut self, v: T) -> Self
166    where
167        T: std::convert::Into<wkt::Timestamp>,
168    {
169        self.update_time = std::option::Option::Some(v.into());
170        self
171    }
172
173    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
174    ///
175    /// # Example
176    /// ```ignore,no_run
177    /// # use google_cloud_securesourcemanager_v1::model::Instance;
178    /// use wkt::Timestamp;
179    /// let x = Instance::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
180    /// let x = Instance::new().set_or_clear_update_time(None::<Timestamp>);
181    /// ```
182    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
183    where
184        T: std::convert::Into<wkt::Timestamp>,
185    {
186        self.update_time = v.map(|x| x.into());
187        self
188    }
189
190    /// Sets the value of [labels][crate::model::Instance::labels].
191    ///
192    /// # Example
193    /// ```ignore,no_run
194    /// # use google_cloud_securesourcemanager_v1::model::Instance;
195    /// let x = Instance::new().set_labels([
196    ///     ("key0", "abc"),
197    ///     ("key1", "xyz"),
198    /// ]);
199    /// ```
200    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
201    where
202        T: std::iter::IntoIterator<Item = (K, V)>,
203        K: std::convert::Into<std::string::String>,
204        V: std::convert::Into<std::string::String>,
205    {
206        use std::iter::Iterator;
207        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
208        self
209    }
210
211    /// Sets the value of [private_config][crate::model::Instance::private_config].
212    ///
213    /// # Example
214    /// ```ignore,no_run
215    /// # use google_cloud_securesourcemanager_v1::model::Instance;
216    /// use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
217    /// let x = Instance::new().set_private_config(PrivateConfig::default()/* use setters */);
218    /// ```
219    pub fn set_private_config<T>(mut self, v: T) -> Self
220    where
221        T: std::convert::Into<crate::model::instance::PrivateConfig>,
222    {
223        self.private_config = std::option::Option::Some(v.into());
224        self
225    }
226
227    /// Sets or clears the value of [private_config][crate::model::Instance::private_config].
228    ///
229    /// # Example
230    /// ```ignore,no_run
231    /// # use google_cloud_securesourcemanager_v1::model::Instance;
232    /// use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
233    /// let x = Instance::new().set_or_clear_private_config(Some(PrivateConfig::default()/* use setters */));
234    /// let x = Instance::new().set_or_clear_private_config(None::<PrivateConfig>);
235    /// ```
236    pub fn set_or_clear_private_config<T>(mut self, v: std::option::Option<T>) -> Self
237    where
238        T: std::convert::Into<crate::model::instance::PrivateConfig>,
239    {
240        self.private_config = v.map(|x| x.into());
241        self
242    }
243
244    /// Sets the value of [state][crate::model::Instance::state].
245    ///
246    /// # Example
247    /// ```ignore,no_run
248    /// # use google_cloud_securesourcemanager_v1::model::Instance;
249    /// use google_cloud_securesourcemanager_v1::model::instance::State;
250    /// let x0 = Instance::new().set_state(State::Creating);
251    /// let x1 = Instance::new().set_state(State::Active);
252    /// let x2 = Instance::new().set_state(State::Deleting);
253    /// ```
254    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
255        self.state = v.into();
256        self
257    }
258
259    /// Sets the value of [state_note][crate::model::Instance::state_note].
260    ///
261    /// # Example
262    /// ```ignore,no_run
263    /// # use google_cloud_securesourcemanager_v1::model::Instance;
264    /// use google_cloud_securesourcemanager_v1::model::instance::StateNote;
265    /// let x0 = Instance::new().set_state_note(StateNote::PausedCmekUnavailable);
266    /// ```
267    pub fn set_state_note<T: std::convert::Into<crate::model::instance::StateNote>>(
268        mut self,
269        v: T,
270    ) -> Self {
271        self.state_note = v.into();
272        self
273    }
274
275    /// Sets the value of [kms_key][crate::model::Instance::kms_key].
276    ///
277    /// # Example
278    /// ```ignore,no_run
279    /// # use google_cloud_securesourcemanager_v1::model::Instance;
280    /// let x = Instance::new().set_kms_key("example");
281    /// ```
282    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
283        self.kms_key = v.into();
284        self
285    }
286
287    /// Sets the value of [host_config][crate::model::Instance::host_config].
288    ///
289    /// # Example
290    /// ```ignore,no_run
291    /// # use google_cloud_securesourcemanager_v1::model::Instance;
292    /// use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
293    /// let x = Instance::new().set_host_config(HostConfig::default()/* use setters */);
294    /// ```
295    pub fn set_host_config<T>(mut self, v: T) -> Self
296    where
297        T: std::convert::Into<crate::model::instance::HostConfig>,
298    {
299        self.host_config = std::option::Option::Some(v.into());
300        self
301    }
302
303    /// Sets or clears the value of [host_config][crate::model::Instance::host_config].
304    ///
305    /// # Example
306    /// ```ignore,no_run
307    /// # use google_cloud_securesourcemanager_v1::model::Instance;
308    /// use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
309    /// let x = Instance::new().set_or_clear_host_config(Some(HostConfig::default()/* use setters */));
310    /// let x = Instance::new().set_or_clear_host_config(None::<HostConfig>);
311    /// ```
312    pub fn set_or_clear_host_config<T>(mut self, v: std::option::Option<T>) -> Self
313    where
314        T: std::convert::Into<crate::model::instance::HostConfig>,
315    {
316        self.host_config = v.map(|x| x.into());
317        self
318    }
319
320    /// Sets the value of [workforce_identity_federation_config][crate::model::Instance::workforce_identity_federation_config].
321    ///
322    /// # Example
323    /// ```ignore,no_run
324    /// # use google_cloud_securesourcemanager_v1::model::Instance;
325    /// use google_cloud_securesourcemanager_v1::model::instance::WorkforceIdentityFederationConfig;
326    /// let x = Instance::new().set_workforce_identity_federation_config(WorkforceIdentityFederationConfig::default()/* use setters */);
327    /// ```
328    pub fn set_workforce_identity_federation_config<T>(mut self, v: T) -> Self
329    where
330        T: std::convert::Into<crate::model::instance::WorkforceIdentityFederationConfig>,
331    {
332        self.workforce_identity_federation_config = std::option::Option::Some(v.into());
333        self
334    }
335
336    /// Sets or clears the value of [workforce_identity_federation_config][crate::model::Instance::workforce_identity_federation_config].
337    ///
338    /// # Example
339    /// ```ignore,no_run
340    /// # use google_cloud_securesourcemanager_v1::model::Instance;
341    /// use google_cloud_securesourcemanager_v1::model::instance::WorkforceIdentityFederationConfig;
342    /// let x = Instance::new().set_or_clear_workforce_identity_federation_config(Some(WorkforceIdentityFederationConfig::default()/* use setters */));
343    /// let x = Instance::new().set_or_clear_workforce_identity_federation_config(None::<WorkforceIdentityFederationConfig>);
344    /// ```
345    pub fn set_or_clear_workforce_identity_federation_config<T>(
346        mut self,
347        v: std::option::Option<T>,
348    ) -> Self
349    where
350        T: std::convert::Into<crate::model::instance::WorkforceIdentityFederationConfig>,
351    {
352        self.workforce_identity_federation_config = v.map(|x| x.into());
353        self
354    }
355
356    /// Sets the value of [satisfies_pzi][crate::model::Instance::satisfies_pzi].
357    ///
358    /// # Example
359    /// ```ignore,no_run
360    /// # use google_cloud_securesourcemanager_v1::model::Instance;
361    /// let x = Instance::new().set_satisfies_pzi(true);
362    /// ```
363    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
364        self.satisfies_pzi = v.into();
365        self
366    }
367
368    /// Sets the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
369    ///
370    /// # Example
371    /// ```ignore,no_run
372    /// # use google_cloud_securesourcemanager_v1::model::Instance;
373    /// let x = Instance::new().set_satisfies_pzs(true);
374    /// ```
375    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
376        self.satisfies_pzs = v.into();
377        self
378    }
379}
380
381impl wkt::message::Message for Instance {
382    fn typename() -> &'static str {
383        "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance"
384    }
385}
386
387/// Defines additional types related to [Instance].
388pub mod instance {
389    #[allow(unused_imports)]
390    use super::*;
391
392    /// HostConfig has different instance endpoints.
393    #[derive(Clone, Default, PartialEq)]
394    #[non_exhaustive]
395    pub struct HostConfig {
396        /// Output only. HTML hostname.
397        pub html: std::string::String,
398
399        /// Output only. API hostname.
400        pub api: std::string::String,
401
402        /// Output only. Git HTTP hostname.
403        pub git_http: std::string::String,
404
405        /// Output only. Git SSH hostname.
406        pub git_ssh: std::string::String,
407
408        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
409    }
410
411    impl HostConfig {
412        /// Creates a new default instance.
413        pub fn new() -> Self {
414            std::default::Default::default()
415        }
416
417        /// Sets the value of [html][crate::model::instance::HostConfig::html].
418        ///
419        /// # Example
420        /// ```ignore,no_run
421        /// # use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
422        /// let x = HostConfig::new().set_html("example");
423        /// ```
424        pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
425            self.html = v.into();
426            self
427        }
428
429        /// Sets the value of [api][crate::model::instance::HostConfig::api].
430        ///
431        /// # Example
432        /// ```ignore,no_run
433        /// # use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
434        /// let x = HostConfig::new().set_api("example");
435        /// ```
436        pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
437            self.api = v.into();
438            self
439        }
440
441        /// Sets the value of [git_http][crate::model::instance::HostConfig::git_http].
442        ///
443        /// # Example
444        /// ```ignore,no_run
445        /// # use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
446        /// let x = HostConfig::new().set_git_http("example");
447        /// ```
448        pub fn set_git_http<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
449            self.git_http = v.into();
450            self
451        }
452
453        /// Sets the value of [git_ssh][crate::model::instance::HostConfig::git_ssh].
454        ///
455        /// # Example
456        /// ```ignore,no_run
457        /// # use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
458        /// let x = HostConfig::new().set_git_ssh("example");
459        /// ```
460        pub fn set_git_ssh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
461            self.git_ssh = v.into();
462            self
463        }
464    }
465
466    impl wkt::message::Message for HostConfig {
467        fn typename() -> &'static str {
468            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.HostConfig"
469        }
470    }
471
472    /// PrivateConfig includes settings for private instance.
473    #[derive(Clone, Default, PartialEq)]
474    #[non_exhaustive]
475    pub struct PrivateConfig {
476        /// Required. Immutable. Indicate if it's private instance.
477        pub is_private: bool,
478
479        /// Optional. Immutable. CA pool resource, resource must in the format of
480        /// `projects/{project}/locations/{location}/caPools/{ca_pool}`.
481        pub ca_pool: std::string::String,
482
483        /// Output only. Service Attachment for HTTP, resource is in the format of
484        /// `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`.
485        pub http_service_attachment: std::string::String,
486
487        /// Output only. Service Attachment for SSH, resource is in the format of
488        /// `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`.
489        pub ssh_service_attachment: std::string::String,
490
491        /// Optional. Additional allowed projects for setting up PSC connections.
492        /// Instance host project is automatically allowed and does not need to be
493        /// included in this list.
494        pub psc_allowed_projects: std::vec::Vec<std::string::String>,
495
496        /// Optional. Custom host config for the instance.
497        pub custom_host_config:
498            std::option::Option<crate::model::instance::private_config::CustomHostConfig>,
499
500        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
501    }
502
503    impl PrivateConfig {
504        /// Creates a new default instance.
505        pub fn new() -> Self {
506            std::default::Default::default()
507        }
508
509        /// Sets the value of [is_private][crate::model::instance::PrivateConfig::is_private].
510        ///
511        /// # Example
512        /// ```ignore,no_run
513        /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
514        /// let x = PrivateConfig::new().set_is_private(true);
515        /// ```
516        pub fn set_is_private<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
517            self.is_private = v.into();
518            self
519        }
520
521        /// Sets the value of [ca_pool][crate::model::instance::PrivateConfig::ca_pool].
522        ///
523        /// # Example
524        /// ```ignore,no_run
525        /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
526        /// let x = PrivateConfig::new().set_ca_pool("example");
527        /// ```
528        pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
529            self.ca_pool = v.into();
530            self
531        }
532
533        /// Sets the value of [http_service_attachment][crate::model::instance::PrivateConfig::http_service_attachment].
534        ///
535        /// # Example
536        /// ```ignore,no_run
537        /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
538        /// let x = PrivateConfig::new().set_http_service_attachment("example");
539        /// ```
540        pub fn set_http_service_attachment<T: std::convert::Into<std::string::String>>(
541            mut self,
542            v: T,
543        ) -> Self {
544            self.http_service_attachment = v.into();
545            self
546        }
547
548        /// Sets the value of [ssh_service_attachment][crate::model::instance::PrivateConfig::ssh_service_attachment].
549        ///
550        /// # Example
551        /// ```ignore,no_run
552        /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
553        /// let x = PrivateConfig::new().set_ssh_service_attachment("example");
554        /// ```
555        pub fn set_ssh_service_attachment<T: std::convert::Into<std::string::String>>(
556            mut self,
557            v: T,
558        ) -> Self {
559            self.ssh_service_attachment = v.into();
560            self
561        }
562
563        /// Sets the value of [psc_allowed_projects][crate::model::instance::PrivateConfig::psc_allowed_projects].
564        ///
565        /// # Example
566        /// ```ignore,no_run
567        /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
568        /// let x = PrivateConfig::new().set_psc_allowed_projects(["a", "b", "c"]);
569        /// ```
570        pub fn set_psc_allowed_projects<T, V>(mut self, v: T) -> Self
571        where
572            T: std::iter::IntoIterator<Item = V>,
573            V: std::convert::Into<std::string::String>,
574        {
575            use std::iter::Iterator;
576            self.psc_allowed_projects = v.into_iter().map(|i| i.into()).collect();
577            self
578        }
579
580        /// Sets the value of [custom_host_config][crate::model::instance::PrivateConfig::custom_host_config].
581        ///
582        /// # Example
583        /// ```ignore,no_run
584        /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
585        /// use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
586        /// let x = PrivateConfig::new().set_custom_host_config(CustomHostConfig::default()/* use setters */);
587        /// ```
588        pub fn set_custom_host_config<T>(mut self, v: T) -> Self
589        where
590            T: std::convert::Into<crate::model::instance::private_config::CustomHostConfig>,
591        {
592            self.custom_host_config = std::option::Option::Some(v.into());
593            self
594        }
595
596        /// Sets or clears the value of [custom_host_config][crate::model::instance::PrivateConfig::custom_host_config].
597        ///
598        /// # Example
599        /// ```ignore,no_run
600        /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
601        /// use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
602        /// let x = PrivateConfig::new().set_or_clear_custom_host_config(Some(CustomHostConfig::default()/* use setters */));
603        /// let x = PrivateConfig::new().set_or_clear_custom_host_config(None::<CustomHostConfig>);
604        /// ```
605        pub fn set_or_clear_custom_host_config<T>(mut self, v: std::option::Option<T>) -> Self
606        where
607            T: std::convert::Into<crate::model::instance::private_config::CustomHostConfig>,
608        {
609            self.custom_host_config = v.map(|x| x.into());
610            self
611        }
612    }
613
614    impl wkt::message::Message for PrivateConfig {
615        fn typename() -> &'static str {
616            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.PrivateConfig"
617        }
618    }
619
620    /// Defines additional types related to [PrivateConfig].
621    pub mod private_config {
622        #[allow(unused_imports)]
623        use super::*;
624
625        /// Custom host config for the instance.
626        #[derive(Clone, Default, PartialEq)]
627        #[non_exhaustive]
628        pub struct CustomHostConfig {
629            /// Required. The custom UI hostname for the instance, e.g.,
630            /// "git.source.internal.mycompany.com"
631            pub html: std::string::String,
632
633            /// Required. The custom API hostname for the instance, e.g.,
634            /// "api.source.internal.mycompany.com"
635            pub api: std::string::String,
636
637            /// Required. The custom git ssh hostname for the instance, e.g.,
638            /// "ssh.source.internal.mycompany.com"
639            pub git_ssh: std::string::String,
640
641            /// Required. The custom git http hostname for the instance, e.g.,
642            /// "git.source.internal.mycompany.com"
643            pub git_http: std::string::String,
644
645            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
646        }
647
648        impl CustomHostConfig {
649            /// Creates a new default instance.
650            pub fn new() -> Self {
651                std::default::Default::default()
652            }
653
654            /// Sets the value of [html][crate::model::instance::private_config::CustomHostConfig::html].
655            ///
656            /// # Example
657            /// ```ignore,no_run
658            /// # use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
659            /// let x = CustomHostConfig::new().set_html("example");
660            /// ```
661            pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
662                self.html = v.into();
663                self
664            }
665
666            /// Sets the value of [api][crate::model::instance::private_config::CustomHostConfig::api].
667            ///
668            /// # Example
669            /// ```ignore,no_run
670            /// # use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
671            /// let x = CustomHostConfig::new().set_api("example");
672            /// ```
673            pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
674                self.api = v.into();
675                self
676            }
677
678            /// Sets the value of [git_ssh][crate::model::instance::private_config::CustomHostConfig::git_ssh].
679            ///
680            /// # Example
681            /// ```ignore,no_run
682            /// # use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
683            /// let x = CustomHostConfig::new().set_git_ssh("example");
684            /// ```
685            pub fn set_git_ssh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
686                self.git_ssh = v.into();
687                self
688            }
689
690            /// Sets the value of [git_http][crate::model::instance::private_config::CustomHostConfig::git_http].
691            ///
692            /// # Example
693            /// ```ignore,no_run
694            /// # use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
695            /// let x = CustomHostConfig::new().set_git_http("example");
696            /// ```
697            pub fn set_git_http<T: std::convert::Into<std::string::String>>(
698                mut self,
699                v: T,
700            ) -> Self {
701                self.git_http = v.into();
702                self
703            }
704        }
705
706        impl wkt::message::Message for CustomHostConfig {
707            fn typename() -> &'static str {
708                "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.PrivateConfig.CustomHostConfig"
709            }
710        }
711    }
712
713    /// WorkforceIdentityFederationConfig allows this instance to support users
714    /// from external identity providers.
715    #[derive(Clone, Default, PartialEq)]
716    #[non_exhaustive]
717    pub struct WorkforceIdentityFederationConfig {
718        /// Optional. Immutable. Whether Workforce Identity Federation is enabled.
719        pub enabled: bool,
720
721        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
722    }
723
724    impl WorkforceIdentityFederationConfig {
725        /// Creates a new default instance.
726        pub fn new() -> Self {
727            std::default::Default::default()
728        }
729
730        /// Sets the value of [enabled][crate::model::instance::WorkforceIdentityFederationConfig::enabled].
731        ///
732        /// # Example
733        /// ```ignore,no_run
734        /// # use google_cloud_securesourcemanager_v1::model::instance::WorkforceIdentityFederationConfig;
735        /// let x = WorkforceIdentityFederationConfig::new().set_enabled(true);
736        /// ```
737        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
738            self.enabled = v.into();
739            self
740        }
741    }
742
743    impl wkt::message::Message for WorkforceIdentityFederationConfig {
744        fn typename() -> &'static str {
745            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.WorkforceIdentityFederationConfig"
746        }
747    }
748
749    /// Secure Source Manager instance state.
750    ///
751    /// # Working with unknown values
752    ///
753    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
754    /// additional enum variants at any time. Adding new variants is not considered
755    /// a breaking change. Applications should write their code in anticipation of:
756    ///
757    /// - New values appearing in future releases of the client library, **and**
758    /// - New values received dynamically, without application changes.
759    ///
760    /// Please consult the [Working with enums] section in the user guide for some
761    /// guidelines.
762    ///
763    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
764    #[derive(Clone, Debug, PartialEq)]
765    #[non_exhaustive]
766    pub enum State {
767        /// Not set. This should only be the case for incoming requests.
768        Unspecified,
769        /// Instance is being created.
770        Creating,
771        /// Instance is ready.
772        Active,
773        /// Instance is being deleted.
774        Deleting,
775        /// Instance is paused.
776        Paused,
777        /// Instance is unknown, we are not sure if it's functioning.
778        Unknown,
779        /// If set, the enum was initialized with an unknown value.
780        ///
781        /// Applications can examine the value using [State::value] or
782        /// [State::name].
783        UnknownValue(state::UnknownValue),
784    }
785
786    #[doc(hidden)]
787    pub mod state {
788        #[allow(unused_imports)]
789        use super::*;
790        #[derive(Clone, Debug, PartialEq)]
791        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
792    }
793
794    impl State {
795        /// Gets the enum value.
796        ///
797        /// Returns `None` if the enum contains an unknown value deserialized from
798        /// the string representation of enums.
799        pub fn value(&self) -> std::option::Option<i32> {
800            match self {
801                Self::Unspecified => std::option::Option::Some(0),
802                Self::Creating => std::option::Option::Some(1),
803                Self::Active => std::option::Option::Some(2),
804                Self::Deleting => std::option::Option::Some(3),
805                Self::Paused => std::option::Option::Some(4),
806                Self::Unknown => std::option::Option::Some(6),
807                Self::UnknownValue(u) => u.0.value(),
808            }
809        }
810
811        /// Gets the enum value as a string.
812        ///
813        /// Returns `None` if the enum contains an unknown value deserialized from
814        /// the integer representation of enums.
815        pub fn name(&self) -> std::option::Option<&str> {
816            match self {
817                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
818                Self::Creating => std::option::Option::Some("CREATING"),
819                Self::Active => std::option::Option::Some("ACTIVE"),
820                Self::Deleting => std::option::Option::Some("DELETING"),
821                Self::Paused => std::option::Option::Some("PAUSED"),
822                Self::Unknown => std::option::Option::Some("UNKNOWN"),
823                Self::UnknownValue(u) => u.0.name(),
824            }
825        }
826    }
827
828    impl std::default::Default for State {
829        fn default() -> Self {
830            use std::convert::From;
831            Self::from(0)
832        }
833    }
834
835    impl std::fmt::Display for State {
836        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
837            wkt::internal::display_enum(f, self.name(), self.value())
838        }
839    }
840
841    impl std::convert::From<i32> for State {
842        fn from(value: i32) -> Self {
843            match value {
844                0 => Self::Unspecified,
845                1 => Self::Creating,
846                2 => Self::Active,
847                3 => Self::Deleting,
848                4 => Self::Paused,
849                6 => Self::Unknown,
850                _ => Self::UnknownValue(state::UnknownValue(
851                    wkt::internal::UnknownEnumValue::Integer(value),
852                )),
853            }
854        }
855    }
856
857    impl std::convert::From<&str> for State {
858        fn from(value: &str) -> Self {
859            use std::string::ToString;
860            match value {
861                "STATE_UNSPECIFIED" => Self::Unspecified,
862                "CREATING" => Self::Creating,
863                "ACTIVE" => Self::Active,
864                "DELETING" => Self::Deleting,
865                "PAUSED" => Self::Paused,
866                "UNKNOWN" => Self::Unknown,
867                _ => Self::UnknownValue(state::UnknownValue(
868                    wkt::internal::UnknownEnumValue::String(value.to_string()),
869                )),
870            }
871        }
872    }
873
874    impl serde::ser::Serialize for State {
875        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
876        where
877            S: serde::Serializer,
878        {
879            match self {
880                Self::Unspecified => serializer.serialize_i32(0),
881                Self::Creating => serializer.serialize_i32(1),
882                Self::Active => serializer.serialize_i32(2),
883                Self::Deleting => serializer.serialize_i32(3),
884                Self::Paused => serializer.serialize_i32(4),
885                Self::Unknown => serializer.serialize_i32(6),
886                Self::UnknownValue(u) => u.0.serialize(serializer),
887            }
888        }
889    }
890
891    impl<'de> serde::de::Deserialize<'de> for State {
892        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
893        where
894            D: serde::Deserializer<'de>,
895        {
896            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
897                ".google.cloud.securesourcemanager.v1.Instance.State",
898            ))
899        }
900    }
901
902    /// Provides information about the current instance state.
903    ///
904    /// # Working with unknown values
905    ///
906    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
907    /// additional enum variants at any time. Adding new variants is not considered
908    /// a breaking change. Applications should write their code in anticipation of:
909    ///
910    /// - New values appearing in future releases of the client library, **and**
911    /// - New values received dynamically, without application changes.
912    ///
913    /// Please consult the [Working with enums] section in the user guide for some
914    /// guidelines.
915    ///
916    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
917    #[derive(Clone, Debug, PartialEq)]
918    #[non_exhaustive]
919    pub enum StateNote {
920        /// STATE_NOTE_UNSPECIFIED as the first value of State.
921        Unspecified,
922        /// CMEK access is unavailable.
923        PausedCmekUnavailable,
924        /// INSTANCE_RESUMING indicates that the instance was previously paused
925        /// and is under the process of being brought back.
926        #[deprecated]
927        InstanceResuming,
928        /// If set, the enum was initialized with an unknown value.
929        ///
930        /// Applications can examine the value using [StateNote::value] or
931        /// [StateNote::name].
932        UnknownValue(state_note::UnknownValue),
933    }
934
935    #[doc(hidden)]
936    pub mod state_note {
937        #[allow(unused_imports)]
938        use super::*;
939        #[derive(Clone, Debug, PartialEq)]
940        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
941    }
942
943    impl StateNote {
944        /// Gets the enum value.
945        ///
946        /// Returns `None` if the enum contains an unknown value deserialized from
947        /// the string representation of enums.
948        pub fn value(&self) -> std::option::Option<i32> {
949            match self {
950                Self::Unspecified => std::option::Option::Some(0),
951                Self::PausedCmekUnavailable => std::option::Option::Some(1),
952                Self::InstanceResuming => std::option::Option::Some(2),
953                Self::UnknownValue(u) => u.0.value(),
954            }
955        }
956
957        /// Gets the enum value as a string.
958        ///
959        /// Returns `None` if the enum contains an unknown value deserialized from
960        /// the integer representation of enums.
961        pub fn name(&self) -> std::option::Option<&str> {
962            match self {
963                Self::Unspecified => std::option::Option::Some("STATE_NOTE_UNSPECIFIED"),
964                Self::PausedCmekUnavailable => std::option::Option::Some("PAUSED_CMEK_UNAVAILABLE"),
965                Self::InstanceResuming => std::option::Option::Some("INSTANCE_RESUMING"),
966                Self::UnknownValue(u) => u.0.name(),
967            }
968        }
969    }
970
971    impl std::default::Default for StateNote {
972        fn default() -> Self {
973            use std::convert::From;
974            Self::from(0)
975        }
976    }
977
978    impl std::fmt::Display for StateNote {
979        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
980            wkt::internal::display_enum(f, self.name(), self.value())
981        }
982    }
983
984    impl std::convert::From<i32> for StateNote {
985        fn from(value: i32) -> Self {
986            match value {
987                0 => Self::Unspecified,
988                1 => Self::PausedCmekUnavailable,
989                2 => Self::InstanceResuming,
990                _ => Self::UnknownValue(state_note::UnknownValue(
991                    wkt::internal::UnknownEnumValue::Integer(value),
992                )),
993            }
994        }
995    }
996
997    impl std::convert::From<&str> for StateNote {
998        fn from(value: &str) -> Self {
999            use std::string::ToString;
1000            match value {
1001                "STATE_NOTE_UNSPECIFIED" => Self::Unspecified,
1002                "PAUSED_CMEK_UNAVAILABLE" => Self::PausedCmekUnavailable,
1003                "INSTANCE_RESUMING" => Self::InstanceResuming,
1004                _ => Self::UnknownValue(state_note::UnknownValue(
1005                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1006                )),
1007            }
1008        }
1009    }
1010
1011    impl serde::ser::Serialize for StateNote {
1012        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1013        where
1014            S: serde::Serializer,
1015        {
1016            match self {
1017                Self::Unspecified => serializer.serialize_i32(0),
1018                Self::PausedCmekUnavailable => serializer.serialize_i32(1),
1019                Self::InstanceResuming => serializer.serialize_i32(2),
1020                Self::UnknownValue(u) => u.0.serialize(serializer),
1021            }
1022        }
1023    }
1024
1025    impl<'de> serde::de::Deserialize<'de> for StateNote {
1026        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1027        where
1028            D: serde::Deserializer<'de>,
1029        {
1030            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StateNote>::new(
1031                ".google.cloud.securesourcemanager.v1.Instance.StateNote",
1032            ))
1033        }
1034    }
1035}
1036
1037/// Metadata of a Secure Source Manager repository.
1038#[derive(Clone, Default, PartialEq)]
1039#[non_exhaustive]
1040pub struct Repository {
1041    /// Identifier. A unique identifier for a repository. The name should be of the
1042    /// format:
1043    /// `projects/{project}/locations/{location_id}/repositories/{repository_id}`
1044    pub name: std::string::String,
1045
1046    /// Optional. Description of the repository, which cannot exceed 500
1047    /// characters.
1048    pub description: std::string::String,
1049
1050    /// Optional. The name of the instance in which the repository is hosted,
1051    /// formatted as
1052    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`
1053    /// When creating repository via securesourcemanager.googleapis.com, this field
1054    /// is used as input. When creating repository via *.sourcemanager.dev, this
1055    /// field is output only.
1056    pub instance: std::string::String,
1057
1058    /// Output only. Unique identifier of the repository.
1059    pub uid: std::string::String,
1060
1061    /// Output only. Create timestamp.
1062    pub create_time: std::option::Option<wkt::Timestamp>,
1063
1064    /// Output only. Update timestamp.
1065    pub update_time: std::option::Option<wkt::Timestamp>,
1066
1067    /// Optional. This checksum is computed by the server based on the value of
1068    /// other fields, and may be sent on update and delete requests to ensure the
1069    /// client has an up-to-date value before proceeding.
1070    pub etag: std::string::String,
1071
1072    /// Output only. URIs for the repository.
1073    pub uris: std::option::Option<crate::model::repository::URIs>,
1074
1075    /// Input only. Initial configurations for the repository.
1076    pub initial_config: std::option::Option<crate::model::repository::InitialConfig>,
1077
1078    /// Optional. Repository level service account (BYOSA).
1079    pub service_account: std::string::String,
1080
1081    /// Optional. Provides configuration for scanning.
1082    pub scan_config: std::option::Option<crate::model::repository::ScanConfig>,
1083
1084    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1085}
1086
1087impl Repository {
1088    /// Creates a new default instance.
1089    pub fn new() -> Self {
1090        std::default::Default::default()
1091    }
1092
1093    /// Sets the value of [name][crate::model::Repository::name].
1094    ///
1095    /// # Example
1096    /// ```ignore,no_run
1097    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1098    /// # let project_id = "project_id";
1099    /// # let location_id = "location_id";
1100    /// # let repository_id = "repository_id";
1101    /// let x = Repository::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
1102    /// ```
1103    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1104        self.name = v.into();
1105        self
1106    }
1107
1108    /// Sets the value of [description][crate::model::Repository::description].
1109    ///
1110    /// # Example
1111    /// ```ignore,no_run
1112    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1113    /// let x = Repository::new().set_description("example");
1114    /// ```
1115    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1116        self.description = v.into();
1117        self
1118    }
1119
1120    /// Sets the value of [instance][crate::model::Repository::instance].
1121    ///
1122    /// # Example
1123    /// ```ignore,no_run
1124    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1125    /// # let project_id = "project_id";
1126    /// # let location_id = "location_id";
1127    /// # let instance_id = "instance_id";
1128    /// let x = Repository::new().set_instance(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
1129    /// ```
1130    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131        self.instance = v.into();
1132        self
1133    }
1134
1135    /// Sets the value of [uid][crate::model::Repository::uid].
1136    ///
1137    /// # Example
1138    /// ```ignore,no_run
1139    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1140    /// let x = Repository::new().set_uid("example");
1141    /// ```
1142    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1143        self.uid = v.into();
1144        self
1145    }
1146
1147    /// Sets the value of [create_time][crate::model::Repository::create_time].
1148    ///
1149    /// # Example
1150    /// ```ignore,no_run
1151    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1152    /// use wkt::Timestamp;
1153    /// let x = Repository::new().set_create_time(Timestamp::default()/* use setters */);
1154    /// ```
1155    pub fn set_create_time<T>(mut self, v: T) -> Self
1156    where
1157        T: std::convert::Into<wkt::Timestamp>,
1158    {
1159        self.create_time = std::option::Option::Some(v.into());
1160        self
1161    }
1162
1163    /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
1164    ///
1165    /// # Example
1166    /// ```ignore,no_run
1167    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1168    /// use wkt::Timestamp;
1169    /// let x = Repository::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1170    /// let x = Repository::new().set_or_clear_create_time(None::<Timestamp>);
1171    /// ```
1172    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1173    where
1174        T: std::convert::Into<wkt::Timestamp>,
1175    {
1176        self.create_time = v.map(|x| x.into());
1177        self
1178    }
1179
1180    /// Sets the value of [update_time][crate::model::Repository::update_time].
1181    ///
1182    /// # Example
1183    /// ```ignore,no_run
1184    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1185    /// use wkt::Timestamp;
1186    /// let x = Repository::new().set_update_time(Timestamp::default()/* use setters */);
1187    /// ```
1188    pub fn set_update_time<T>(mut self, v: T) -> Self
1189    where
1190        T: std::convert::Into<wkt::Timestamp>,
1191    {
1192        self.update_time = std::option::Option::Some(v.into());
1193        self
1194    }
1195
1196    /// Sets or clears the value of [update_time][crate::model::Repository::update_time].
1197    ///
1198    /// # Example
1199    /// ```ignore,no_run
1200    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1201    /// use wkt::Timestamp;
1202    /// let x = Repository::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1203    /// let x = Repository::new().set_or_clear_update_time(None::<Timestamp>);
1204    /// ```
1205    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1206    where
1207        T: std::convert::Into<wkt::Timestamp>,
1208    {
1209        self.update_time = v.map(|x| x.into());
1210        self
1211    }
1212
1213    /// Sets the value of [etag][crate::model::Repository::etag].
1214    ///
1215    /// # Example
1216    /// ```ignore,no_run
1217    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1218    /// let x = Repository::new().set_etag("example");
1219    /// ```
1220    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1221        self.etag = v.into();
1222        self
1223    }
1224
1225    /// Sets the value of [uris][crate::model::Repository::uris].
1226    ///
1227    /// # Example
1228    /// ```ignore,no_run
1229    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1230    /// use google_cloud_securesourcemanager_v1::model::repository::URIs;
1231    /// let x = Repository::new().set_uris(URIs::default()/* use setters */);
1232    /// ```
1233    pub fn set_uris<T>(mut self, v: T) -> Self
1234    where
1235        T: std::convert::Into<crate::model::repository::URIs>,
1236    {
1237        self.uris = std::option::Option::Some(v.into());
1238        self
1239    }
1240
1241    /// Sets or clears the value of [uris][crate::model::Repository::uris].
1242    ///
1243    /// # Example
1244    /// ```ignore,no_run
1245    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1246    /// use google_cloud_securesourcemanager_v1::model::repository::URIs;
1247    /// let x = Repository::new().set_or_clear_uris(Some(URIs::default()/* use setters */));
1248    /// let x = Repository::new().set_or_clear_uris(None::<URIs>);
1249    /// ```
1250    pub fn set_or_clear_uris<T>(mut self, v: std::option::Option<T>) -> Self
1251    where
1252        T: std::convert::Into<crate::model::repository::URIs>,
1253    {
1254        self.uris = v.map(|x| x.into());
1255        self
1256    }
1257
1258    /// Sets the value of [initial_config][crate::model::Repository::initial_config].
1259    ///
1260    /// # Example
1261    /// ```ignore,no_run
1262    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1263    /// use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1264    /// let x = Repository::new().set_initial_config(InitialConfig::default()/* use setters */);
1265    /// ```
1266    pub fn set_initial_config<T>(mut self, v: T) -> Self
1267    where
1268        T: std::convert::Into<crate::model::repository::InitialConfig>,
1269    {
1270        self.initial_config = std::option::Option::Some(v.into());
1271        self
1272    }
1273
1274    /// Sets or clears the value of [initial_config][crate::model::Repository::initial_config].
1275    ///
1276    /// # Example
1277    /// ```ignore,no_run
1278    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1279    /// use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1280    /// let x = Repository::new().set_or_clear_initial_config(Some(InitialConfig::default()/* use setters */));
1281    /// let x = Repository::new().set_or_clear_initial_config(None::<InitialConfig>);
1282    /// ```
1283    pub fn set_or_clear_initial_config<T>(mut self, v: std::option::Option<T>) -> Self
1284    where
1285        T: std::convert::Into<crate::model::repository::InitialConfig>,
1286    {
1287        self.initial_config = v.map(|x| x.into());
1288        self
1289    }
1290
1291    /// Sets the value of [service_account][crate::model::Repository::service_account].
1292    ///
1293    /// # Example
1294    /// ```ignore,no_run
1295    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1296    /// let x = Repository::new().set_service_account("example");
1297    /// ```
1298    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1299        self.service_account = v.into();
1300        self
1301    }
1302
1303    /// Sets the value of [scan_config][crate::model::Repository::scan_config].
1304    ///
1305    /// # Example
1306    /// ```ignore,no_run
1307    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1308    /// use google_cloud_securesourcemanager_v1::model::repository::ScanConfig;
1309    /// let x = Repository::new().set_scan_config(ScanConfig::default()/* use setters */);
1310    /// ```
1311    pub fn set_scan_config<T>(mut self, v: T) -> Self
1312    where
1313        T: std::convert::Into<crate::model::repository::ScanConfig>,
1314    {
1315        self.scan_config = std::option::Option::Some(v.into());
1316        self
1317    }
1318
1319    /// Sets or clears the value of [scan_config][crate::model::Repository::scan_config].
1320    ///
1321    /// # Example
1322    /// ```ignore,no_run
1323    /// # use google_cloud_securesourcemanager_v1::model::Repository;
1324    /// use google_cloud_securesourcemanager_v1::model::repository::ScanConfig;
1325    /// let x = Repository::new().set_or_clear_scan_config(Some(ScanConfig::default()/* use setters */));
1326    /// let x = Repository::new().set_or_clear_scan_config(None::<ScanConfig>);
1327    /// ```
1328    pub fn set_or_clear_scan_config<T>(mut self, v: std::option::Option<T>) -> Self
1329    where
1330        T: std::convert::Into<crate::model::repository::ScanConfig>,
1331    {
1332        self.scan_config = v.map(|x| x.into());
1333        self
1334    }
1335}
1336
1337impl wkt::message::Message for Repository {
1338    fn typename() -> &'static str {
1339        "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository"
1340    }
1341}
1342
1343/// Defines additional types related to [Repository].
1344pub mod repository {
1345    #[allow(unused_imports)]
1346    use super::*;
1347
1348    /// URIs for the repository.
1349    #[derive(Clone, Default, PartialEq)]
1350    #[non_exhaustive]
1351    pub struct URIs {
1352        /// Output only. HTML is the URI for user to view the repository in a
1353        /// browser.
1354        pub html: std::string::String,
1355
1356        /// Output only. git_https is the git HTTPS URI for git operations.
1357        pub git_https: std::string::String,
1358
1359        /// Output only. API is the URI for API access.
1360        pub api: std::string::String,
1361
1362        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1363    }
1364
1365    impl URIs {
1366        /// Creates a new default instance.
1367        pub fn new() -> Self {
1368            std::default::Default::default()
1369        }
1370
1371        /// Sets the value of [html][crate::model::repository::URIs::html].
1372        ///
1373        /// # Example
1374        /// ```ignore,no_run
1375        /// # use google_cloud_securesourcemanager_v1::model::repository::URIs;
1376        /// let x = URIs::new().set_html("example");
1377        /// ```
1378        pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1379            self.html = v.into();
1380            self
1381        }
1382
1383        /// Sets the value of [git_https][crate::model::repository::URIs::git_https].
1384        ///
1385        /// # Example
1386        /// ```ignore,no_run
1387        /// # use google_cloud_securesourcemanager_v1::model::repository::URIs;
1388        /// let x = URIs::new().set_git_https("example");
1389        /// ```
1390        pub fn set_git_https<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1391            self.git_https = v.into();
1392            self
1393        }
1394
1395        /// Sets the value of [api][crate::model::repository::URIs::api].
1396        ///
1397        /// # Example
1398        /// ```ignore,no_run
1399        /// # use google_cloud_securesourcemanager_v1::model::repository::URIs;
1400        /// let x = URIs::new().set_api("example");
1401        /// ```
1402        pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1403            self.api = v.into();
1404            self
1405        }
1406    }
1407
1408    impl wkt::message::Message for URIs {
1409        fn typename() -> &'static str {
1410            "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.URIs"
1411        }
1412    }
1413
1414    /// Repository initialization configuration.
1415    #[derive(Clone, Default, PartialEq)]
1416    #[non_exhaustive]
1417    pub struct InitialConfig {
1418        /// Default branch name of the repository.
1419        pub default_branch: std::string::String,
1420
1421        /// List of gitignore template names user can choose from.
1422        /// Valid values: actionscript, ada, agda, android,
1423        /// anjuta, ansible, appcelerator-titanium, app-engine, archives,
1424        /// arch-linux-packages, atmel-studio, autotools, backup, bazaar, bazel,
1425        /// bitrix, bricx-cc, c, cake-php, calabash, cf-wheels, chef-cookbook,
1426        /// clojure, cloud9, c-make, code-igniter, code-kit, code-sniffer,
1427        /// common-lisp, composer, concrete5, coq, cordova, cpp, craft-cms, cuda,
1428        /// cvs, d, dart, dart-editor, delphi, diff, dm, dreamweaver, dropbox,
1429        /// drupal, drupal-7, eagle, eclipse, eiffel-studio, elisp, elixir, elm,
1430        /// emacs, ensime, epi-server, erlang, esp-idf, espresso, exercism,
1431        /// expression-engine, ext-js, fancy, finale, flex-builder, force-dot-com,
1432        /// fortran, fuel-php, gcov, git-book, gnome-shell-extension, go, godot, gpg,
1433        /// gradle, grails, gwt, haskell, hugo, iar-ewarm, idris, igor-pro, images,
1434        /// infor-cms, java, jboss, jboss-4, jboss-6, jdeveloper, jekyll,
1435        /// jenkins-home, jenv, jet-brains, jigsaw, joomla, julia, jupyter-notebooks,
1436        /// kate, kdevelop4, kentico, ki-cad, kohana, kotlin, lab-view, laravel,
1437        /// lazarus, leiningen, lemon-stand, libre-office, lilypond, linux, lithium,
1438        /// logtalk, lua, lyx, mac-os, magento, magento-1, magento-2, matlab, maven,
1439        /// mercurial, mercury, metals, meta-programming-system, meteor,
1440        /// microsoft-office, model-sim, momentics, mono-develop, nanoc, net-beans,
1441        /// nikola, nim, ninja, node, notepad-pp, nwjs, objective--c, ocaml, octave,
1442        /// opa, open-cart, openssl, oracle-forms, otto, packer, patch, perl, perl6,
1443        /// phalcon, phoenix, pimcore, play-framework, plone, prestashop, processing,
1444        /// psoc-creator, puppet, pure-script, putty, python, qooxdoo, qt, r, racket,
1445        /// rails, raku, red, redcar, redis, rhodes-rhomobile, ros, ruby, rust, sam,
1446        /// sass, sbt, scala, scheme, scons, scrivener, sdcc, seam-gen, sketch-up,
1447        /// slick-edit, smalltalk, snap, splunk, stata, stella, sublime-text,
1448        /// sugar-crm, svn, swift, symfony, symphony-cms, synopsys-vcs, tags,
1449        /// terraform, tex, text-mate, textpattern, think-php, tortoise-git,
1450        /// turbo-gears-2, typo3, umbraco, unity, unreal-engine, vagrant, vim,
1451        /// virtual-env, virtuoso, visual-studio, visual-studio-code, vue, vvvv, waf,
1452        /// web-methods, windows, word-press, xcode, xilinx, xilinx-ise, xojo,
1453        /// yeoman, yii, zend-framework, zephir.
1454        pub gitignores: std::vec::Vec<std::string::String>,
1455
1456        /// License template name user can choose from.
1457        /// Valid values: license-0bsd, license-389-exception, aal, abstyles,
1458        /// adobe-2006, adobe-glyph, adsl, afl-1-1, afl-1-2, afl-2-0, afl-2-1,
1459        /// afl-3-0, afmparse, agpl-1-0, agpl-1-0-only, agpl-1-0-or-later,
1460        /// agpl-3-0-only, agpl-3-0-or-later, aladdin, amdplpa, aml, ampas, antlr-pd,
1461        /// antlr-pd-fallback, apache-1-0, apache-1-1, apache-2-0, apafml, apl-1-0,
1462        /// apsl-1-0, apsl-1-1, apsl-1-2, apsl-2-0, artistic-1-0, artistic-1-0-cl8,
1463        /// artistic-1-0-perl, artistic-2-0, autoconf-exception-2-0,
1464        /// autoconf-exception-3-0, bahyph, barr, beerware, bison-exception-2-2,
1465        /// bittorrent-1-0, bittorrent-1-1, blessing, blueoak-1-0-0,
1466        /// bootloader-exception, borceux, bsd-1-clause, bsd-2-clause,
1467        /// bsd-2-clause-freebsd, bsd-2-clause-netbsd, bsd-2-clause-patent,
1468        /// bsd-2-clause-views, bsd-3-clause, bsd-3-clause-attribution,
1469        /// bsd-3-clause-clear, bsd-3-clause-lbnl, bsd-3-clause-modification,
1470        /// bsd-3-clause-no-nuclear-license, bsd-3-clause-no-nuclear-license-2014,
1471        /// bsd-3-clause-no-nuclear-warranty, bsd-3-clause-open-mpi, bsd-4-clause,
1472        /// bsd-4-clause-shortened, bsd-4-clause-uc, bsd-protection, bsd-source-code,
1473        /// bsl-1-0, busl-1-1, cal-1-0, cal-1-0-combined-work-exception, caldera,
1474        /// catosl-1-1, cc0-1-0, cc-by-1-0, cc-by-2-0, cc-by-3-0, cc-by-3-0-at,
1475        /// cc-by-3-0-us, cc-by-4-0, cc-by-nc-1-0, cc-by-nc-2-0, cc-by-nc-3-0,
1476        /// cc-by-nc-4-0, cc-by-nc-nd-1-0, cc-by-nc-nd-2-0, cc-by-nc-nd-3-0,
1477        /// 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,
1478        /// cc-by-nc-sa-3-0, cc-by-nc-sa-4-0, cc-by-nd-1-0, cc-by-nd-2-0,
1479        /// 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,
1480        /// cc-by-sa-2-1-jp, cc-by-sa-3-0, cc-by-sa-3-0-at, cc-by-sa-4-0, cc-pddc,
1481        /// cddl-1-0, cddl-1-1, cdla-permissive-1-0, cdla-sharing-1-0, cecill-1-0,
1482        /// cecill-1-1, cecill-2-0, cecill-2-1, cecill-b, cecill-c, cern-ohl-1-1,
1483        /// cern-ohl-1-2, cern-ohl-p-2-0, cern-ohl-s-2-0, cern-ohl-w-2-0, clartistic,
1484        /// classpath-exception-2-0, clisp-exception-2-0, cnri-jython, cnri-python,
1485        /// cnri-python-gpl-compatible, condor-1-1, copyleft-next-0-3-0,
1486        /// copyleft-next-0-3-1, cpal-1-0, cpl-1-0, cpol-1-02, crossword,
1487        /// crystal-stacker, cua-opl-1-0, cube, c-uda-1-0, curl, d-fsl-1-0, diffmark,
1488        /// digirule-foss-exception, doc, dotseqn, drl-1-0, dsdp, dvipdfm, ecl-1-0,
1489        /// ecl-2-0, ecos-exception-2-0, efl-1-0, efl-2-0, egenix, entessa, epics,
1490        /// epl-1-0, epl-2-0, erlpl-1-1, etalab-2-0, eu-datagrid, eupl-1-0, eupl-1-1,
1491        /// eupl-1-2, eurosym, fair, fawkes-runtime-exception, fltk-exception,
1492        /// font-exception-2-0, frameworx-1-0, freebsd-doc, freeimage,
1493        /// freertos-exception-2-0, fsfap, fsful, fsfullr, ftl, gcc-exception-2-0,
1494        /// gcc-exception-3-1, gd, gfdl-1-1-invariants-only,
1495        /// gfdl-1-1-invariants-or-later, gfdl-1-1-no-invariants-only,
1496        /// gfdl-1-1-no-invariants-or-later, gfdl-1-1-only, gfdl-1-1-or-later,
1497        /// gfdl-1-2-invariants-only, gfdl-1-2-invariants-or-later,
1498        /// gfdl-1-2-no-invariants-only, gfdl-1-2-no-invariants-or-later,
1499        /// gfdl-1-2-only, gfdl-1-2-or-later, gfdl-1-3-invariants-only,
1500        /// gfdl-1-3-invariants-or-later, gfdl-1-3-no-invariants-only,
1501        /// gfdl-1-3-no-invariants-or-later, gfdl-1-3-only, gfdl-1-3-or-later,
1502        /// giftware, gl2ps, glide, glulxe, glwtpl, gnu-javamail-exception, gnuplot,
1503        /// gpl-1-0-only, gpl-1-0-or-later, gpl-2-0-only, gpl-2-0-or-later,
1504        /// gpl-3-0-linking-exception, gpl-3-0-linking-source-exception,
1505        /// gpl-3-0-only, gpl-3-0-or-later, gpl-cc-1-0, gsoap-1-3b, haskell-report,
1506        /// hippocratic-2-1, hpnd, hpnd-sell-variant, htmltidy,
1507        /// i2p-gpl-java-exception, ibm-pibs, icu, ijg, image-magick, imatix, imlib2,
1508        /// info-zip, intel, intel-acpi, interbase-1-0, ipa, ipl-1-0, isc,
1509        /// jasper-2-0, jpnic, json, lal-1-2, lal-1-3, latex2e, leptonica,
1510        /// lgpl-2-0-only, lgpl-2-0-or-later, lgpl-2-1-only, lgpl-2-1-or-later,
1511        /// lgpl-3-0-linking-exception, lgpl-3-0-only, lgpl-3-0-or-later, lgpllr,
1512        /// libpng, libpng-2-0, libselinux-1-0, libtiff, libtool-exception,
1513        /// liliq-p-1-1, liliq-r-1-1, liliq-rplus-1-1, linux-openib,
1514        /// linux-syscall-note, llvm-exception, lpl-1-0, lpl-1-02, lppl-1-0,
1515        /// lppl-1-1, lppl-1-2, lppl-1-3a, lppl-1-3c, lzma-exception, make-index,
1516        /// mif-exception, miros, mit, mit-0, mit-advertising, mit-cmu, mit-enna,
1517        /// mit-feh, mit-modern-variant, mitnfa, mit-open-group, motosoto, mpich2,
1518        /// mpl-1-0, mpl-1-1, mpl-2-0, mpl-2-0-no-copyleft-exception, ms-pl, ms-rl,
1519        /// mtll, mulanpsl-1-0, mulanpsl-2-0, multics, mup, naist-2003, nasa-1-3,
1520        /// naumen, nbpl-1-0, ncgl-uk-2-0, ncsa, netcdf, net-snmp, newsletr, ngpl,
1521        /// nist-pd, nist-pd-fallback, nlod-1-0, nlpl, nokia, nokia-qt-exception-1-1,
1522        /// nosl, noweb, npl-1-0, npl-1-1, nposl-3-0, nrl, ntp, ntp-0,
1523        /// ocaml-lgpl-linking-exception, occt-exception-1-0, occt-pl, oclc-2-0,
1524        /// odbl-1-0, odc-by-1-0, ofl-1-0, ofl-1-0-no-rfn, ofl-1-0-rfn, ofl-1-1,
1525        /// ofl-1-1-no-rfn, ofl-1-1-rfn, ogc-1-0, ogdl-taiwan-1-0, ogl-canada-2-0,
1526        /// ogl-uk-1-0, ogl-uk-2-0, ogl-uk-3-0, ogtsl, oldap-1-1, oldap-1-2,
1527        /// oldap-1-3, oldap-1-4, oldap-2-0, oldap-2-0-1, oldap-2-1, oldap-2-2,
1528        /// oldap-2-2-1, oldap-2-2-2, oldap-2-3, oldap-2-4, oldap-2-7, oml,
1529        /// openjdk-assembly-exception-1-0, openssl, openvpn-openssl-exception,
1530        /// opl-1-0, oset-pl-2-1, osl-1-0, osl-1-1, osl-2-0, osl-2-1, osl-3-0,
1531        /// o-uda-1-0, parity-6-0-0, parity-7-0-0, pddl-1-0, php-3-0, php-3-01,
1532        /// plexus, polyform-noncommercial-1-0-0, polyform-small-business-1-0-0,
1533        /// postgresql, psf-2-0, psfrag, ps-or-pdf-font-exception-20170817, psutils,
1534        /// python-2-0, qhull, qpl-1-0, qt-gpl-exception-1-0, qt-lgpl-exception-1-1,
1535        /// qwt-exception-1-0, rdisc, rhecos-1-1, rpl-1-1, rpsl-1-0, rsa-md, rscpl,
1536        /// ruby, saxpath, sax-pd, scea, sendmail, sendmail-8-23, sgi-b-1-0,
1537        /// sgi-b-1-1, sgi-b-2-0, shl-0-51, shl-2-0, shl-2-1, simpl-2-0, sissl,
1538        /// sissl-1-2, sleepycat, smlnj, smppl, snia, spencer-86, spencer-94,
1539        /// spencer-99, spl-1-0, ssh-openssh, ssh-short, sspl-1-0, sugarcrm-1-1-3,
1540        /// swift-exception, swl, tapr-ohl-1-0, tcl, tcp-wrappers, tmate, torque-1-1,
1541        /// tosl, tu-berlin-1-0, tu-berlin-2-0, u-boot-exception-2-0, ucl-1-0,
1542        /// unicode-dfs-2015, unicode-dfs-2016, unicode-tou,
1543        /// universal-foss-exception-1-0, unlicense, upl-1-0, vim, vostrom, vsl-1-0,
1544        /// w3c, w3c-19980720, w3c-20150513, watcom-1-0, wsuipa, wtfpl,
1545        /// wxwindows-exception-3-1, x11, xerox, xfree86-1-1, xinetd, xnet, xpp,
1546        /// xskat, ypl-1-0, ypl-1-1, zed, zend-2-0, zimbra-1-3, zimbra-1-4, zlib,
1547        /// zlib-acknowledgement, zpl-1-1, zpl-2-0, zpl-2-1.
1548        pub license: std::string::String,
1549
1550        /// README template name.
1551        /// Valid template name(s) are: default.
1552        pub readme: std::string::String,
1553
1554        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1555    }
1556
1557    impl InitialConfig {
1558        /// Creates a new default instance.
1559        pub fn new() -> Self {
1560            std::default::Default::default()
1561        }
1562
1563        /// Sets the value of [default_branch][crate::model::repository::InitialConfig::default_branch].
1564        ///
1565        /// # Example
1566        /// ```ignore,no_run
1567        /// # use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1568        /// let x = InitialConfig::new().set_default_branch("example");
1569        /// ```
1570        pub fn set_default_branch<T: std::convert::Into<std::string::String>>(
1571            mut self,
1572            v: T,
1573        ) -> Self {
1574            self.default_branch = v.into();
1575            self
1576        }
1577
1578        /// Sets the value of [gitignores][crate::model::repository::InitialConfig::gitignores].
1579        ///
1580        /// # Example
1581        /// ```ignore,no_run
1582        /// # use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1583        /// let x = InitialConfig::new().set_gitignores(["a", "b", "c"]);
1584        /// ```
1585        pub fn set_gitignores<T, V>(mut self, v: T) -> Self
1586        where
1587            T: std::iter::IntoIterator<Item = V>,
1588            V: std::convert::Into<std::string::String>,
1589        {
1590            use std::iter::Iterator;
1591            self.gitignores = v.into_iter().map(|i| i.into()).collect();
1592            self
1593        }
1594
1595        /// Sets the value of [license][crate::model::repository::InitialConfig::license].
1596        ///
1597        /// # Example
1598        /// ```ignore,no_run
1599        /// # use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1600        /// let x = InitialConfig::new().set_license("example");
1601        /// ```
1602        pub fn set_license<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1603            self.license = v.into();
1604            self
1605        }
1606
1607        /// Sets the value of [readme][crate::model::repository::InitialConfig::readme].
1608        ///
1609        /// # Example
1610        /// ```ignore,no_run
1611        /// # use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1612        /// let x = InitialConfig::new().set_readme("example");
1613        /// ```
1614        pub fn set_readme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1615            self.readme = v.into();
1616            self
1617        }
1618    }
1619
1620    impl wkt::message::Message for InitialConfig {
1621        fn typename() -> &'static str {
1622            "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.InitialConfig"
1623        }
1624    }
1625
1626    /// Configuration for scanning.
1627    #[derive(Clone, Default, PartialEq)]
1628    #[non_exhaustive]
1629    pub struct ScanConfig {
1630        /// Optional. Configuration for secret scanning.
1631        pub secret_scan_config:
1632            std::option::Option<crate::model::repository::scan_config::SecretScanConfig>,
1633
1634        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1635    }
1636
1637    impl ScanConfig {
1638        /// Creates a new default instance.
1639        pub fn new() -> Self {
1640            std::default::Default::default()
1641        }
1642
1643        /// Sets the value of [secret_scan_config][crate::model::repository::ScanConfig::secret_scan_config].
1644        ///
1645        /// # Example
1646        /// ```ignore,no_run
1647        /// # use google_cloud_securesourcemanager_v1::model::repository::ScanConfig;
1648        /// use google_cloud_securesourcemanager_v1::model::repository::scan_config::SecretScanConfig;
1649        /// let x = ScanConfig::new().set_secret_scan_config(SecretScanConfig::default()/* use setters */);
1650        /// ```
1651        pub fn set_secret_scan_config<T>(mut self, v: T) -> Self
1652        where
1653            T: std::convert::Into<crate::model::repository::scan_config::SecretScanConfig>,
1654        {
1655            self.secret_scan_config = std::option::Option::Some(v.into());
1656            self
1657        }
1658
1659        /// Sets or clears the value of [secret_scan_config][crate::model::repository::ScanConfig::secret_scan_config].
1660        ///
1661        /// # Example
1662        /// ```ignore,no_run
1663        /// # use google_cloud_securesourcemanager_v1::model::repository::ScanConfig;
1664        /// use google_cloud_securesourcemanager_v1::model::repository::scan_config::SecretScanConfig;
1665        /// let x = ScanConfig::new().set_or_clear_secret_scan_config(Some(SecretScanConfig::default()/* use setters */));
1666        /// let x = ScanConfig::new().set_or_clear_secret_scan_config(None::<SecretScanConfig>);
1667        /// ```
1668        pub fn set_or_clear_secret_scan_config<T>(mut self, v: std::option::Option<T>) -> Self
1669        where
1670            T: std::convert::Into<crate::model::repository::scan_config::SecretScanConfig>,
1671        {
1672            self.secret_scan_config = v.map(|x| x.into());
1673            self
1674        }
1675    }
1676
1677    impl wkt::message::Message for ScanConfig {
1678        fn typename() -> &'static str {
1679            "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.ScanConfig"
1680        }
1681    }
1682
1683    /// Defines additional types related to [ScanConfig].
1684    pub mod scan_config {
1685        #[allow(unused_imports)]
1686        use super::*;
1687
1688        /// Configuration for secret scanning.
1689        #[derive(Clone, Default, PartialEq)]
1690        #[non_exhaustive]
1691        pub struct SecretScanConfig {
1692            /// Optional. Enables secret scanning for the repository.
1693            pub enabled: bool,
1694
1695            /// Optional. The DLP inspect template to use for secret scanning.
1696            pub inspect_template: std::string::String,
1697
1698            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1699        }
1700
1701        impl SecretScanConfig {
1702            /// Creates a new default instance.
1703            pub fn new() -> Self {
1704                std::default::Default::default()
1705            }
1706
1707            /// Sets the value of [enabled][crate::model::repository::scan_config::SecretScanConfig::enabled].
1708            ///
1709            /// # Example
1710            /// ```ignore,no_run
1711            /// # use google_cloud_securesourcemanager_v1::model::repository::scan_config::SecretScanConfig;
1712            /// let x = SecretScanConfig::new().set_enabled(true);
1713            /// ```
1714            pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1715                self.enabled = v.into();
1716                self
1717            }
1718
1719            /// Sets the value of [inspect_template][crate::model::repository::scan_config::SecretScanConfig::inspect_template].
1720            ///
1721            /// # Example
1722            /// ```ignore,no_run
1723            /// # use google_cloud_securesourcemanager_v1::model::repository::scan_config::SecretScanConfig;
1724            /// let x = SecretScanConfig::new().set_inspect_template("example");
1725            /// ```
1726            pub fn set_inspect_template<T: std::convert::Into<std::string::String>>(
1727                mut self,
1728                v: T,
1729            ) -> Self {
1730                self.inspect_template = v.into();
1731                self
1732            }
1733        }
1734
1735        impl wkt::message::Message for SecretScanConfig {
1736            fn typename() -> &'static str {
1737                "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.ScanConfig.SecretScanConfig"
1738            }
1739        }
1740    }
1741}
1742
1743/// Metadata of a Secure Source Manager Hook.
1744#[derive(Clone, Default, PartialEq)]
1745#[non_exhaustive]
1746pub struct Hook {
1747    /// Identifier. A unique identifier for a Hook. The name should be of the
1748    /// format:
1749    /// `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`
1750    pub name: std::string::String,
1751
1752    /// Required. The target URI to which the payloads will be delivered.
1753    pub target_uri: std::string::String,
1754
1755    /// Optional. Determines if the hook disabled or not.
1756    /// Set to true to stop sending traffic.
1757    pub disabled: bool,
1758
1759    /// Optional. The events that trigger hook on.
1760    pub events: std::vec::Vec<crate::model::hook::HookEventType>,
1761
1762    /// Output only. Create timestamp.
1763    pub create_time: std::option::Option<wkt::Timestamp>,
1764
1765    /// Output only. Update timestamp.
1766    pub update_time: std::option::Option<wkt::Timestamp>,
1767
1768    /// Output only. Unique identifier of the hook.
1769    pub uid: std::string::String,
1770
1771    /// Optional. The trigger option for push events.
1772    pub push_option: std::option::Option<crate::model::hook::PushOption>,
1773
1774    /// Optional. The sensitive query string to be appended to the target URI.
1775    pub sensitive_query_string: std::string::String,
1776
1777    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1778}
1779
1780impl Hook {
1781    /// Creates a new default instance.
1782    pub fn new() -> Self {
1783        std::default::Default::default()
1784    }
1785
1786    /// Sets the value of [name][crate::model::Hook::name].
1787    ///
1788    /// # Example
1789    /// ```ignore,no_run
1790    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1791    /// # let project_id = "project_id";
1792    /// # let location_id = "location_id";
1793    /// # let repository_id = "repository_id";
1794    /// # let hook_id = "hook_id";
1795    /// let x = Hook::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}"));
1796    /// ```
1797    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1798        self.name = v.into();
1799        self
1800    }
1801
1802    /// Sets the value of [target_uri][crate::model::Hook::target_uri].
1803    ///
1804    /// # Example
1805    /// ```ignore,no_run
1806    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1807    /// let x = Hook::new().set_target_uri("example");
1808    /// ```
1809    pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1810        self.target_uri = v.into();
1811        self
1812    }
1813
1814    /// Sets the value of [disabled][crate::model::Hook::disabled].
1815    ///
1816    /// # Example
1817    /// ```ignore,no_run
1818    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1819    /// let x = Hook::new().set_disabled(true);
1820    /// ```
1821    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1822        self.disabled = v.into();
1823        self
1824    }
1825
1826    /// Sets the value of [events][crate::model::Hook::events].
1827    ///
1828    /// # Example
1829    /// ```ignore,no_run
1830    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1831    /// use google_cloud_securesourcemanager_v1::model::hook::HookEventType;
1832    /// let x = Hook::new().set_events([
1833    ///     HookEventType::Push,
1834    ///     HookEventType::PullRequest,
1835    ///     HookEventType::PullRequestComment,
1836    /// ]);
1837    /// ```
1838    pub fn set_events<T, V>(mut self, v: T) -> Self
1839    where
1840        T: std::iter::IntoIterator<Item = V>,
1841        V: std::convert::Into<crate::model::hook::HookEventType>,
1842    {
1843        use std::iter::Iterator;
1844        self.events = v.into_iter().map(|i| i.into()).collect();
1845        self
1846    }
1847
1848    /// Sets the value of [create_time][crate::model::Hook::create_time].
1849    ///
1850    /// # Example
1851    /// ```ignore,no_run
1852    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1853    /// use wkt::Timestamp;
1854    /// let x = Hook::new().set_create_time(Timestamp::default()/* use setters */);
1855    /// ```
1856    pub fn set_create_time<T>(mut self, v: T) -> Self
1857    where
1858        T: std::convert::Into<wkt::Timestamp>,
1859    {
1860        self.create_time = std::option::Option::Some(v.into());
1861        self
1862    }
1863
1864    /// Sets or clears the value of [create_time][crate::model::Hook::create_time].
1865    ///
1866    /// # Example
1867    /// ```ignore,no_run
1868    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1869    /// use wkt::Timestamp;
1870    /// let x = Hook::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1871    /// let x = Hook::new().set_or_clear_create_time(None::<Timestamp>);
1872    /// ```
1873    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1874    where
1875        T: std::convert::Into<wkt::Timestamp>,
1876    {
1877        self.create_time = v.map(|x| x.into());
1878        self
1879    }
1880
1881    /// Sets the value of [update_time][crate::model::Hook::update_time].
1882    ///
1883    /// # Example
1884    /// ```ignore,no_run
1885    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1886    /// use wkt::Timestamp;
1887    /// let x = Hook::new().set_update_time(Timestamp::default()/* use setters */);
1888    /// ```
1889    pub fn set_update_time<T>(mut self, v: T) -> Self
1890    where
1891        T: std::convert::Into<wkt::Timestamp>,
1892    {
1893        self.update_time = std::option::Option::Some(v.into());
1894        self
1895    }
1896
1897    /// Sets or clears the value of [update_time][crate::model::Hook::update_time].
1898    ///
1899    /// # Example
1900    /// ```ignore,no_run
1901    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1902    /// use wkt::Timestamp;
1903    /// let x = Hook::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1904    /// let x = Hook::new().set_or_clear_update_time(None::<Timestamp>);
1905    /// ```
1906    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1907    where
1908        T: std::convert::Into<wkt::Timestamp>,
1909    {
1910        self.update_time = v.map(|x| x.into());
1911        self
1912    }
1913
1914    /// Sets the value of [uid][crate::model::Hook::uid].
1915    ///
1916    /// # Example
1917    /// ```ignore,no_run
1918    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1919    /// let x = Hook::new().set_uid("example");
1920    /// ```
1921    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1922        self.uid = v.into();
1923        self
1924    }
1925
1926    /// Sets the value of [push_option][crate::model::Hook::push_option].
1927    ///
1928    /// # Example
1929    /// ```ignore,no_run
1930    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1931    /// use google_cloud_securesourcemanager_v1::model::hook::PushOption;
1932    /// let x = Hook::new().set_push_option(PushOption::default()/* use setters */);
1933    /// ```
1934    pub fn set_push_option<T>(mut self, v: T) -> Self
1935    where
1936        T: std::convert::Into<crate::model::hook::PushOption>,
1937    {
1938        self.push_option = std::option::Option::Some(v.into());
1939        self
1940    }
1941
1942    /// Sets or clears the value of [push_option][crate::model::Hook::push_option].
1943    ///
1944    /// # Example
1945    /// ```ignore,no_run
1946    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1947    /// use google_cloud_securesourcemanager_v1::model::hook::PushOption;
1948    /// let x = Hook::new().set_or_clear_push_option(Some(PushOption::default()/* use setters */));
1949    /// let x = Hook::new().set_or_clear_push_option(None::<PushOption>);
1950    /// ```
1951    pub fn set_or_clear_push_option<T>(mut self, v: std::option::Option<T>) -> Self
1952    where
1953        T: std::convert::Into<crate::model::hook::PushOption>,
1954    {
1955        self.push_option = v.map(|x| x.into());
1956        self
1957    }
1958
1959    /// Sets the value of [sensitive_query_string][crate::model::Hook::sensitive_query_string].
1960    ///
1961    /// # Example
1962    /// ```ignore,no_run
1963    /// # use google_cloud_securesourcemanager_v1::model::Hook;
1964    /// let x = Hook::new().set_sensitive_query_string("example");
1965    /// ```
1966    pub fn set_sensitive_query_string<T: std::convert::Into<std::string::String>>(
1967        mut self,
1968        v: T,
1969    ) -> Self {
1970        self.sensitive_query_string = v.into();
1971        self
1972    }
1973}
1974
1975impl wkt::message::Message for Hook {
1976    fn typename() -> &'static str {
1977        "type.googleapis.com/google.cloud.securesourcemanager.v1.Hook"
1978    }
1979}
1980
1981/// Defines additional types related to [Hook].
1982pub mod hook {
1983    #[allow(unused_imports)]
1984    use super::*;
1985
1986    #[allow(missing_docs)]
1987    #[derive(Clone, Default, PartialEq)]
1988    #[non_exhaustive]
1989    pub struct PushOption {
1990        /// Optional. Trigger hook for matching branches only.
1991        /// Specified as glob pattern. If empty or *, events for all branches are
1992        /// reported. Examples: main, {main,release*}.
1993        /// See <https://pkg.go.dev/github.com/gobwas/glob> documentation.
1994        pub branch_filter: std::string::String,
1995
1996        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1997    }
1998
1999    impl PushOption {
2000        /// Creates a new default instance.
2001        pub fn new() -> Self {
2002            std::default::Default::default()
2003        }
2004
2005        /// Sets the value of [branch_filter][crate::model::hook::PushOption::branch_filter].
2006        ///
2007        /// # Example
2008        /// ```ignore,no_run
2009        /// # use google_cloud_securesourcemanager_v1::model::hook::PushOption;
2010        /// let x = PushOption::new().set_branch_filter("example");
2011        /// ```
2012        pub fn set_branch_filter<T: std::convert::Into<std::string::String>>(
2013            mut self,
2014            v: T,
2015        ) -> Self {
2016            self.branch_filter = v.into();
2017            self
2018        }
2019    }
2020
2021    impl wkt::message::Message for PushOption {
2022        fn typename() -> &'static str {
2023            "type.googleapis.com/google.cloud.securesourcemanager.v1.Hook.PushOption"
2024        }
2025    }
2026
2027    /// Enum for [HookEventType].
2028    ///
2029    /// # Working with unknown values
2030    ///
2031    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2032    /// additional enum variants at any time. Adding new variants is not considered
2033    /// a breaking change. Applications should write their code in anticipation of:
2034    ///
2035    /// - New values appearing in future releases of the client library, **and**
2036    /// - New values received dynamically, without application changes.
2037    ///
2038    /// Please consult the [Working with enums] section in the user guide for some
2039    /// guidelines.
2040    ///
2041    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2042    #[derive(Clone, Debug, PartialEq)]
2043    #[non_exhaustive]
2044    pub enum HookEventType {
2045        /// Unspecified.
2046        Unspecified,
2047        /// Push events are triggered when pushing to the repository.
2048        Push,
2049        /// Pull request events are triggered when a pull request is opened, closed,
2050        /// reopened, or edited.
2051        PullRequest,
2052        /// Triggers when a general comment is added, edited, or deleted on a pull
2053        /// request.
2054        PullRequestComment,
2055        /// If set, the enum was initialized with an unknown value.
2056        ///
2057        /// Applications can examine the value using [HookEventType::value] or
2058        /// [HookEventType::name].
2059        UnknownValue(hook_event_type::UnknownValue),
2060    }
2061
2062    #[doc(hidden)]
2063    pub mod hook_event_type {
2064        #[allow(unused_imports)]
2065        use super::*;
2066        #[derive(Clone, Debug, PartialEq)]
2067        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2068    }
2069
2070    impl HookEventType {
2071        /// Gets the enum value.
2072        ///
2073        /// Returns `None` if the enum contains an unknown value deserialized from
2074        /// the string representation of enums.
2075        pub fn value(&self) -> std::option::Option<i32> {
2076            match self {
2077                Self::Unspecified => std::option::Option::Some(0),
2078                Self::Push => std::option::Option::Some(1),
2079                Self::PullRequest => std::option::Option::Some(2),
2080                Self::PullRequestComment => std::option::Option::Some(3),
2081                Self::UnknownValue(u) => u.0.value(),
2082            }
2083        }
2084
2085        /// Gets the enum value as a string.
2086        ///
2087        /// Returns `None` if the enum contains an unknown value deserialized from
2088        /// the integer representation of enums.
2089        pub fn name(&self) -> std::option::Option<&str> {
2090            match self {
2091                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
2092                Self::Push => std::option::Option::Some("PUSH"),
2093                Self::PullRequest => std::option::Option::Some("PULL_REQUEST"),
2094                Self::PullRequestComment => std::option::Option::Some("PULL_REQUEST_COMMENT"),
2095                Self::UnknownValue(u) => u.0.name(),
2096            }
2097        }
2098    }
2099
2100    impl std::default::Default for HookEventType {
2101        fn default() -> Self {
2102            use std::convert::From;
2103            Self::from(0)
2104        }
2105    }
2106
2107    impl std::fmt::Display for HookEventType {
2108        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2109            wkt::internal::display_enum(f, self.name(), self.value())
2110        }
2111    }
2112
2113    impl std::convert::From<i32> for HookEventType {
2114        fn from(value: i32) -> Self {
2115            match value {
2116                0 => Self::Unspecified,
2117                1 => Self::Push,
2118                2 => Self::PullRequest,
2119                3 => Self::PullRequestComment,
2120                _ => Self::UnknownValue(hook_event_type::UnknownValue(
2121                    wkt::internal::UnknownEnumValue::Integer(value),
2122                )),
2123            }
2124        }
2125    }
2126
2127    impl std::convert::From<&str> for HookEventType {
2128        fn from(value: &str) -> Self {
2129            use std::string::ToString;
2130            match value {
2131                "UNSPECIFIED" => Self::Unspecified,
2132                "PUSH" => Self::Push,
2133                "PULL_REQUEST" => Self::PullRequest,
2134                "PULL_REQUEST_COMMENT" => Self::PullRequestComment,
2135                _ => Self::UnknownValue(hook_event_type::UnknownValue(
2136                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2137                )),
2138            }
2139        }
2140    }
2141
2142    impl serde::ser::Serialize for HookEventType {
2143        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2144        where
2145            S: serde::Serializer,
2146        {
2147            match self {
2148                Self::Unspecified => serializer.serialize_i32(0),
2149                Self::Push => serializer.serialize_i32(1),
2150                Self::PullRequest => serializer.serialize_i32(2),
2151                Self::PullRequestComment => serializer.serialize_i32(3),
2152                Self::UnknownValue(u) => u.0.serialize(serializer),
2153            }
2154        }
2155    }
2156
2157    impl<'de> serde::de::Deserialize<'de> for HookEventType {
2158        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2159        where
2160            D: serde::Deserializer<'de>,
2161        {
2162            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HookEventType>::new(
2163                ".google.cloud.securesourcemanager.v1.Hook.HookEventType",
2164            ))
2165        }
2166    }
2167}
2168
2169/// Metadata of a BranchRule. BranchRule is the protection rule to enforce
2170/// pre-defined rules on designated branches within a repository.
2171#[derive(Clone, Default, PartialEq)]
2172#[non_exhaustive]
2173pub struct BranchRule {
2174    /// Identifier. A unique identifier for a BranchRule. The name should be of the
2175    /// format:
2176    /// `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`
2177    pub name: std::string::String,
2178
2179    /// Output only. Unique identifier of the repository.
2180    pub uid: std::string::String,
2181
2182    /// Output only. Create timestamp.
2183    pub create_time: std::option::Option<wkt::Timestamp>,
2184
2185    /// Output only. Update timestamp.
2186    pub update_time: std::option::Option<wkt::Timestamp>,
2187
2188    /// Optional. User annotations. These attributes can only be set and used by
2189    /// the user. See <https://google.aip.dev/128#annotations> for more details such
2190    /// as format and size limitations.
2191    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
2192
2193    /// Optional. This checksum is computed by the server based on the value of
2194    /// other fields, and may be sent on update and delete requests to ensure the
2195    /// client has an up-to-date value before proceeding.
2196    pub etag: std::string::String,
2197
2198    /// Optional. The pattern of the branch that can match to this BranchRule.
2199    /// Specified as regex.
2200    /// .* for all branches. Examples: main, (main|release.*).
2201    /// Current MVP phase only support `.*` for wildcard.
2202    pub include_pattern: std::string::String,
2203
2204    /// Optional. Determines if the branch rule is disabled or not.
2205    pub disabled: bool,
2206
2207    /// Optional. Determines if the branch rule requires a pull request or not.
2208    pub require_pull_request: bool,
2209
2210    /// Optional. The minimum number of reviews required for the branch rule to be
2211    /// matched.
2212    pub minimum_reviews_count: i32,
2213
2214    /// Optional. The minimum number of approvals required for the branch rule to
2215    /// be matched.
2216    pub minimum_approvals_count: i32,
2217
2218    /// Optional. Determines if code owners must approve before merging to the
2219    /// branch.
2220    pub require_code_owner_approval: bool,
2221
2222    /// Optional. Determines if require comments resolved before merging to the
2223    /// branch.
2224    pub require_comments_resolved: bool,
2225
2226    /// Optional. Determines if allow stale reviews or approvals before merging to
2227    /// the branch.
2228    pub allow_stale_reviews: bool,
2229
2230    /// Optional. Determines if require linear history before merging to the
2231    /// branch.
2232    pub require_linear_history: bool,
2233
2234    /// Optional. List of required status checks before merging to the branch.
2235    pub required_status_checks: std::vec::Vec<crate::model::branch_rule::Check>,
2236
2237    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2238}
2239
2240impl BranchRule {
2241    /// Creates a new default instance.
2242    pub fn new() -> Self {
2243        std::default::Default::default()
2244    }
2245
2246    /// Sets the value of [name][crate::model::BranchRule::name].
2247    ///
2248    /// # Example
2249    /// ```ignore,no_run
2250    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2251    /// # let project_id = "project_id";
2252    /// # let location_id = "location_id";
2253    /// # let repository_id = "repository_id";
2254    /// # let branch_rule_id = "branch_rule_id";
2255    /// let x = BranchRule::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/branchRules/{branch_rule_id}"));
2256    /// ```
2257    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2258        self.name = v.into();
2259        self
2260    }
2261
2262    /// Sets the value of [uid][crate::model::BranchRule::uid].
2263    ///
2264    /// # Example
2265    /// ```ignore,no_run
2266    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2267    /// let x = BranchRule::new().set_uid("example");
2268    /// ```
2269    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2270        self.uid = v.into();
2271        self
2272    }
2273
2274    /// Sets the value of [create_time][crate::model::BranchRule::create_time].
2275    ///
2276    /// # Example
2277    /// ```ignore,no_run
2278    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2279    /// use wkt::Timestamp;
2280    /// let x = BranchRule::new().set_create_time(Timestamp::default()/* use setters */);
2281    /// ```
2282    pub fn set_create_time<T>(mut self, v: T) -> Self
2283    where
2284        T: std::convert::Into<wkt::Timestamp>,
2285    {
2286        self.create_time = std::option::Option::Some(v.into());
2287        self
2288    }
2289
2290    /// Sets or clears the value of [create_time][crate::model::BranchRule::create_time].
2291    ///
2292    /// # Example
2293    /// ```ignore,no_run
2294    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2295    /// use wkt::Timestamp;
2296    /// let x = BranchRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2297    /// let x = BranchRule::new().set_or_clear_create_time(None::<Timestamp>);
2298    /// ```
2299    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2300    where
2301        T: std::convert::Into<wkt::Timestamp>,
2302    {
2303        self.create_time = v.map(|x| x.into());
2304        self
2305    }
2306
2307    /// Sets the value of [update_time][crate::model::BranchRule::update_time].
2308    ///
2309    /// # Example
2310    /// ```ignore,no_run
2311    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2312    /// use wkt::Timestamp;
2313    /// let x = BranchRule::new().set_update_time(Timestamp::default()/* use setters */);
2314    /// ```
2315    pub fn set_update_time<T>(mut self, v: T) -> Self
2316    where
2317        T: std::convert::Into<wkt::Timestamp>,
2318    {
2319        self.update_time = std::option::Option::Some(v.into());
2320        self
2321    }
2322
2323    /// Sets or clears the value of [update_time][crate::model::BranchRule::update_time].
2324    ///
2325    /// # Example
2326    /// ```ignore,no_run
2327    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2328    /// use wkt::Timestamp;
2329    /// let x = BranchRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2330    /// let x = BranchRule::new().set_or_clear_update_time(None::<Timestamp>);
2331    /// ```
2332    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2333    where
2334        T: std::convert::Into<wkt::Timestamp>,
2335    {
2336        self.update_time = v.map(|x| x.into());
2337        self
2338    }
2339
2340    /// Sets the value of [annotations][crate::model::BranchRule::annotations].
2341    ///
2342    /// # Example
2343    /// ```ignore,no_run
2344    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2345    /// let x = BranchRule::new().set_annotations([
2346    ///     ("key0", "abc"),
2347    ///     ("key1", "xyz"),
2348    /// ]);
2349    /// ```
2350    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
2351    where
2352        T: std::iter::IntoIterator<Item = (K, V)>,
2353        K: std::convert::Into<std::string::String>,
2354        V: std::convert::Into<std::string::String>,
2355    {
2356        use std::iter::Iterator;
2357        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2358        self
2359    }
2360
2361    /// Sets the value of [etag][crate::model::BranchRule::etag].
2362    ///
2363    /// # Example
2364    /// ```ignore,no_run
2365    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2366    /// let x = BranchRule::new().set_etag("example");
2367    /// ```
2368    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2369        self.etag = v.into();
2370        self
2371    }
2372
2373    /// Sets the value of [include_pattern][crate::model::BranchRule::include_pattern].
2374    ///
2375    /// # Example
2376    /// ```ignore,no_run
2377    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2378    /// let x = BranchRule::new().set_include_pattern("example");
2379    /// ```
2380    pub fn set_include_pattern<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2381        self.include_pattern = v.into();
2382        self
2383    }
2384
2385    /// Sets the value of [disabled][crate::model::BranchRule::disabled].
2386    ///
2387    /// # Example
2388    /// ```ignore,no_run
2389    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2390    /// let x = BranchRule::new().set_disabled(true);
2391    /// ```
2392    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2393        self.disabled = v.into();
2394        self
2395    }
2396
2397    /// Sets the value of [require_pull_request][crate::model::BranchRule::require_pull_request].
2398    ///
2399    /// # Example
2400    /// ```ignore,no_run
2401    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2402    /// let x = BranchRule::new().set_require_pull_request(true);
2403    /// ```
2404    pub fn set_require_pull_request<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2405        self.require_pull_request = v.into();
2406        self
2407    }
2408
2409    /// Sets the value of [minimum_reviews_count][crate::model::BranchRule::minimum_reviews_count].
2410    ///
2411    /// # Example
2412    /// ```ignore,no_run
2413    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2414    /// let x = BranchRule::new().set_minimum_reviews_count(42);
2415    /// ```
2416    pub fn set_minimum_reviews_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2417        self.minimum_reviews_count = v.into();
2418        self
2419    }
2420
2421    /// Sets the value of [minimum_approvals_count][crate::model::BranchRule::minimum_approvals_count].
2422    ///
2423    /// # Example
2424    /// ```ignore,no_run
2425    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2426    /// let x = BranchRule::new().set_minimum_approvals_count(42);
2427    /// ```
2428    pub fn set_minimum_approvals_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2429        self.minimum_approvals_count = v.into();
2430        self
2431    }
2432
2433    /// Sets the value of [require_code_owner_approval][crate::model::BranchRule::require_code_owner_approval].
2434    ///
2435    /// # Example
2436    /// ```ignore,no_run
2437    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2438    /// let x = BranchRule::new().set_require_code_owner_approval(true);
2439    /// ```
2440    pub fn set_require_code_owner_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2441        self.require_code_owner_approval = v.into();
2442        self
2443    }
2444
2445    /// Sets the value of [require_comments_resolved][crate::model::BranchRule::require_comments_resolved].
2446    ///
2447    /// # Example
2448    /// ```ignore,no_run
2449    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2450    /// let x = BranchRule::new().set_require_comments_resolved(true);
2451    /// ```
2452    pub fn set_require_comments_resolved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2453        self.require_comments_resolved = v.into();
2454        self
2455    }
2456
2457    /// Sets the value of [allow_stale_reviews][crate::model::BranchRule::allow_stale_reviews].
2458    ///
2459    /// # Example
2460    /// ```ignore,no_run
2461    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2462    /// let x = BranchRule::new().set_allow_stale_reviews(true);
2463    /// ```
2464    pub fn set_allow_stale_reviews<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2465        self.allow_stale_reviews = v.into();
2466        self
2467    }
2468
2469    /// Sets the value of [require_linear_history][crate::model::BranchRule::require_linear_history].
2470    ///
2471    /// # Example
2472    /// ```ignore,no_run
2473    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2474    /// let x = BranchRule::new().set_require_linear_history(true);
2475    /// ```
2476    pub fn set_require_linear_history<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2477        self.require_linear_history = v.into();
2478        self
2479    }
2480
2481    /// Sets the value of [required_status_checks][crate::model::BranchRule::required_status_checks].
2482    ///
2483    /// # Example
2484    /// ```ignore,no_run
2485    /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2486    /// use google_cloud_securesourcemanager_v1::model::branch_rule::Check;
2487    /// let x = BranchRule::new()
2488    ///     .set_required_status_checks([
2489    ///         Check::default()/* use setters */,
2490    ///         Check::default()/* use (different) setters */,
2491    ///     ]);
2492    /// ```
2493    pub fn set_required_status_checks<T, V>(mut self, v: T) -> Self
2494    where
2495        T: std::iter::IntoIterator<Item = V>,
2496        V: std::convert::Into<crate::model::branch_rule::Check>,
2497    {
2498        use std::iter::Iterator;
2499        self.required_status_checks = v.into_iter().map(|i| i.into()).collect();
2500        self
2501    }
2502}
2503
2504impl wkt::message::Message for BranchRule {
2505    fn typename() -> &'static str {
2506        "type.googleapis.com/google.cloud.securesourcemanager.v1.BranchRule"
2507    }
2508}
2509
2510/// Defines additional types related to [BranchRule].
2511pub mod branch_rule {
2512    #[allow(unused_imports)]
2513    use super::*;
2514
2515    /// Check is a type for status check.
2516    #[derive(Clone, Default, PartialEq)]
2517    #[non_exhaustive]
2518    pub struct Check {
2519        /// Required. The context of the check.
2520        pub context: std::string::String,
2521
2522        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2523    }
2524
2525    impl Check {
2526        /// Creates a new default instance.
2527        pub fn new() -> Self {
2528            std::default::Default::default()
2529        }
2530
2531        /// Sets the value of [context][crate::model::branch_rule::Check::context].
2532        ///
2533        /// # Example
2534        /// ```ignore,no_run
2535        /// # use google_cloud_securesourcemanager_v1::model::branch_rule::Check;
2536        /// let x = Check::new().set_context("example");
2537        /// ```
2538        pub fn set_context<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2539            self.context = v.into();
2540            self
2541        }
2542    }
2543
2544    impl wkt::message::Message for Check {
2545        fn typename() -> &'static str {
2546            "type.googleapis.com/google.cloud.securesourcemanager.v1.BranchRule.Check"
2547        }
2548    }
2549}
2550
2551/// Metadata of a PullRequest. PullRequest is the request
2552/// from a user to merge a branch (head) into another branch (base).
2553#[derive(Clone, Default, PartialEq)]
2554#[non_exhaustive]
2555pub struct PullRequest {
2556    /// Output only. Identifier. A unique identifier for a PullRequest. The number
2557    /// appended at the end is generated by the server. Format:
2558    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}`
2559    pub name: std::string::String,
2560
2561    /// Required. The pull request title.
2562    pub title: std::string::String,
2563
2564    /// Optional. The pull request body. Provides a detailed description of the
2565    /// changes.
2566    pub body: std::string::String,
2567
2568    /// Required. The branch to merge changes in.
2569    pub base: std::option::Option<crate::model::pull_request::Branch>,
2570
2571    /// Immutable. The branch containing the changes to be merged.
2572    pub head: std::option::Option<crate::model::pull_request::Branch>,
2573
2574    /// Output only. State of the pull request (open, closed or merged).
2575    pub state: crate::model::pull_request::State,
2576
2577    /// Output only. Creation timestamp.
2578    pub create_time: std::option::Option<wkt::Timestamp>,
2579
2580    /// Output only. Last updated timestamp.
2581    pub update_time: std::option::Option<wkt::Timestamp>,
2582
2583    /// Output only. Close timestamp (if closed or merged). Cleared when pull
2584    /// request is re-opened.
2585    pub close_time: std::option::Option<wkt::Timestamp>,
2586
2587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2588}
2589
2590impl PullRequest {
2591    /// Creates a new default instance.
2592    pub fn new() -> Self {
2593        std::default::Default::default()
2594    }
2595
2596    /// Sets the value of [name][crate::model::PullRequest::name].
2597    ///
2598    /// # Example
2599    /// ```ignore,no_run
2600    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2601    /// # let project_id = "project_id";
2602    /// # let location_id = "location_id";
2603    /// # let repository_id = "repository_id";
2604    /// # let pull_request_id = "pull_request_id";
2605    /// let x = PullRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
2606    /// ```
2607    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2608        self.name = v.into();
2609        self
2610    }
2611
2612    /// Sets the value of [title][crate::model::PullRequest::title].
2613    ///
2614    /// # Example
2615    /// ```ignore,no_run
2616    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2617    /// let x = PullRequest::new().set_title("example");
2618    /// ```
2619    pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2620        self.title = v.into();
2621        self
2622    }
2623
2624    /// Sets the value of [body][crate::model::PullRequest::body].
2625    ///
2626    /// # Example
2627    /// ```ignore,no_run
2628    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2629    /// let x = PullRequest::new().set_body("example");
2630    /// ```
2631    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2632        self.body = v.into();
2633        self
2634    }
2635
2636    /// Sets the value of [base][crate::model::PullRequest::base].
2637    ///
2638    /// # Example
2639    /// ```ignore,no_run
2640    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2641    /// use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2642    /// let x = PullRequest::new().set_base(Branch::default()/* use setters */);
2643    /// ```
2644    pub fn set_base<T>(mut self, v: T) -> Self
2645    where
2646        T: std::convert::Into<crate::model::pull_request::Branch>,
2647    {
2648        self.base = std::option::Option::Some(v.into());
2649        self
2650    }
2651
2652    /// Sets or clears the value of [base][crate::model::PullRequest::base].
2653    ///
2654    /// # Example
2655    /// ```ignore,no_run
2656    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2657    /// use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2658    /// let x = PullRequest::new().set_or_clear_base(Some(Branch::default()/* use setters */));
2659    /// let x = PullRequest::new().set_or_clear_base(None::<Branch>);
2660    /// ```
2661    pub fn set_or_clear_base<T>(mut self, v: std::option::Option<T>) -> Self
2662    where
2663        T: std::convert::Into<crate::model::pull_request::Branch>,
2664    {
2665        self.base = v.map(|x| x.into());
2666        self
2667    }
2668
2669    /// Sets the value of [head][crate::model::PullRequest::head].
2670    ///
2671    /// # Example
2672    /// ```ignore,no_run
2673    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2674    /// use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2675    /// let x = PullRequest::new().set_head(Branch::default()/* use setters */);
2676    /// ```
2677    pub fn set_head<T>(mut self, v: T) -> Self
2678    where
2679        T: std::convert::Into<crate::model::pull_request::Branch>,
2680    {
2681        self.head = std::option::Option::Some(v.into());
2682        self
2683    }
2684
2685    /// Sets or clears the value of [head][crate::model::PullRequest::head].
2686    ///
2687    /// # Example
2688    /// ```ignore,no_run
2689    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2690    /// use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2691    /// let x = PullRequest::new().set_or_clear_head(Some(Branch::default()/* use setters */));
2692    /// let x = PullRequest::new().set_or_clear_head(None::<Branch>);
2693    /// ```
2694    pub fn set_or_clear_head<T>(mut self, v: std::option::Option<T>) -> Self
2695    where
2696        T: std::convert::Into<crate::model::pull_request::Branch>,
2697    {
2698        self.head = v.map(|x| x.into());
2699        self
2700    }
2701
2702    /// Sets the value of [state][crate::model::PullRequest::state].
2703    ///
2704    /// # Example
2705    /// ```ignore,no_run
2706    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2707    /// use google_cloud_securesourcemanager_v1::model::pull_request::State;
2708    /// let x0 = PullRequest::new().set_state(State::Open);
2709    /// let x1 = PullRequest::new().set_state(State::Closed);
2710    /// let x2 = PullRequest::new().set_state(State::Merged);
2711    /// ```
2712    pub fn set_state<T: std::convert::Into<crate::model::pull_request::State>>(
2713        mut self,
2714        v: T,
2715    ) -> Self {
2716        self.state = v.into();
2717        self
2718    }
2719
2720    /// Sets the value of [create_time][crate::model::PullRequest::create_time].
2721    ///
2722    /// # Example
2723    /// ```ignore,no_run
2724    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2725    /// use wkt::Timestamp;
2726    /// let x = PullRequest::new().set_create_time(Timestamp::default()/* use setters */);
2727    /// ```
2728    pub fn set_create_time<T>(mut self, v: T) -> Self
2729    where
2730        T: std::convert::Into<wkt::Timestamp>,
2731    {
2732        self.create_time = std::option::Option::Some(v.into());
2733        self
2734    }
2735
2736    /// Sets or clears the value of [create_time][crate::model::PullRequest::create_time].
2737    ///
2738    /// # Example
2739    /// ```ignore,no_run
2740    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2741    /// use wkt::Timestamp;
2742    /// let x = PullRequest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2743    /// let x = PullRequest::new().set_or_clear_create_time(None::<Timestamp>);
2744    /// ```
2745    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2746    where
2747        T: std::convert::Into<wkt::Timestamp>,
2748    {
2749        self.create_time = v.map(|x| x.into());
2750        self
2751    }
2752
2753    /// Sets the value of [update_time][crate::model::PullRequest::update_time].
2754    ///
2755    /// # Example
2756    /// ```ignore,no_run
2757    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2758    /// use wkt::Timestamp;
2759    /// let x = PullRequest::new().set_update_time(Timestamp::default()/* use setters */);
2760    /// ```
2761    pub fn set_update_time<T>(mut self, v: T) -> Self
2762    where
2763        T: std::convert::Into<wkt::Timestamp>,
2764    {
2765        self.update_time = std::option::Option::Some(v.into());
2766        self
2767    }
2768
2769    /// Sets or clears the value of [update_time][crate::model::PullRequest::update_time].
2770    ///
2771    /// # Example
2772    /// ```ignore,no_run
2773    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2774    /// use wkt::Timestamp;
2775    /// let x = PullRequest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2776    /// let x = PullRequest::new().set_or_clear_update_time(None::<Timestamp>);
2777    /// ```
2778    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2779    where
2780        T: std::convert::Into<wkt::Timestamp>,
2781    {
2782        self.update_time = v.map(|x| x.into());
2783        self
2784    }
2785
2786    /// Sets the value of [close_time][crate::model::PullRequest::close_time].
2787    ///
2788    /// # Example
2789    /// ```ignore,no_run
2790    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2791    /// use wkt::Timestamp;
2792    /// let x = PullRequest::new().set_close_time(Timestamp::default()/* use setters */);
2793    /// ```
2794    pub fn set_close_time<T>(mut self, v: T) -> Self
2795    where
2796        T: std::convert::Into<wkt::Timestamp>,
2797    {
2798        self.close_time = std::option::Option::Some(v.into());
2799        self
2800    }
2801
2802    /// Sets or clears the value of [close_time][crate::model::PullRequest::close_time].
2803    ///
2804    /// # Example
2805    /// ```ignore,no_run
2806    /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2807    /// use wkt::Timestamp;
2808    /// let x = PullRequest::new().set_or_clear_close_time(Some(Timestamp::default()/* use setters */));
2809    /// let x = PullRequest::new().set_or_clear_close_time(None::<Timestamp>);
2810    /// ```
2811    pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
2812    where
2813        T: std::convert::Into<wkt::Timestamp>,
2814    {
2815        self.close_time = v.map(|x| x.into());
2816        self
2817    }
2818}
2819
2820impl wkt::message::Message for PullRequest {
2821    fn typename() -> &'static str {
2822        "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequest"
2823    }
2824}
2825
2826/// Defines additional types related to [PullRequest].
2827pub mod pull_request {
2828    #[allow(unused_imports)]
2829    use super::*;
2830
2831    /// Branch represents a branch involved in a pull request.
2832    #[derive(Clone, Default, PartialEq)]
2833    #[non_exhaustive]
2834    pub struct Branch {
2835        /// Required. Name of the branch.
2836        pub r#ref: std::string::String,
2837
2838        /// Output only. The commit at the tip of the branch.
2839        pub sha: std::string::String,
2840
2841        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2842    }
2843
2844    impl Branch {
2845        /// Creates a new default instance.
2846        pub fn new() -> Self {
2847            std::default::Default::default()
2848        }
2849
2850        /// Sets the value of [r#ref][crate::model::pull_request::Branch::ref].
2851        ///
2852        /// # Example
2853        /// ```ignore,no_run
2854        /// # use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2855        /// let x = Branch::new().set_ref("example");
2856        /// ```
2857        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2858            self.r#ref = v.into();
2859            self
2860        }
2861
2862        /// Sets the value of [sha][crate::model::pull_request::Branch::sha].
2863        ///
2864        /// # Example
2865        /// ```ignore,no_run
2866        /// # use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2867        /// let x = Branch::new().set_sha("example");
2868        /// ```
2869        pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2870            self.sha = v.into();
2871            self
2872        }
2873    }
2874
2875    impl wkt::message::Message for Branch {
2876        fn typename() -> &'static str {
2877            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequest.Branch"
2878        }
2879    }
2880
2881    /// State of the pull request.
2882    ///
2883    /// # Working with unknown values
2884    ///
2885    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2886    /// additional enum variants at any time. Adding new variants is not considered
2887    /// a breaking change. Applications should write their code in anticipation of:
2888    ///
2889    /// - New values appearing in future releases of the client library, **and**
2890    /// - New values received dynamically, without application changes.
2891    ///
2892    /// Please consult the [Working with enums] section in the user guide for some
2893    /// guidelines.
2894    ///
2895    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2896    #[derive(Clone, Debug, PartialEq)]
2897    #[non_exhaustive]
2898    pub enum State {
2899        /// Unspecified.
2900        Unspecified,
2901        /// An open pull request.
2902        Open,
2903        /// A closed pull request.
2904        Closed,
2905        /// A merged pull request.
2906        Merged,
2907        /// If set, the enum was initialized with an unknown value.
2908        ///
2909        /// Applications can examine the value using [State::value] or
2910        /// [State::name].
2911        UnknownValue(state::UnknownValue),
2912    }
2913
2914    #[doc(hidden)]
2915    pub mod state {
2916        #[allow(unused_imports)]
2917        use super::*;
2918        #[derive(Clone, Debug, PartialEq)]
2919        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2920    }
2921
2922    impl State {
2923        /// Gets the enum value.
2924        ///
2925        /// Returns `None` if the enum contains an unknown value deserialized from
2926        /// the string representation of enums.
2927        pub fn value(&self) -> std::option::Option<i32> {
2928            match self {
2929                Self::Unspecified => std::option::Option::Some(0),
2930                Self::Open => std::option::Option::Some(1),
2931                Self::Closed => std::option::Option::Some(2),
2932                Self::Merged => std::option::Option::Some(3),
2933                Self::UnknownValue(u) => u.0.value(),
2934            }
2935        }
2936
2937        /// Gets the enum value as a string.
2938        ///
2939        /// Returns `None` if the enum contains an unknown value deserialized from
2940        /// the integer representation of enums.
2941        pub fn name(&self) -> std::option::Option<&str> {
2942            match self {
2943                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2944                Self::Open => std::option::Option::Some("OPEN"),
2945                Self::Closed => std::option::Option::Some("CLOSED"),
2946                Self::Merged => std::option::Option::Some("MERGED"),
2947                Self::UnknownValue(u) => u.0.name(),
2948            }
2949        }
2950    }
2951
2952    impl std::default::Default for State {
2953        fn default() -> Self {
2954            use std::convert::From;
2955            Self::from(0)
2956        }
2957    }
2958
2959    impl std::fmt::Display for State {
2960        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2961            wkt::internal::display_enum(f, self.name(), self.value())
2962        }
2963    }
2964
2965    impl std::convert::From<i32> for State {
2966        fn from(value: i32) -> Self {
2967            match value {
2968                0 => Self::Unspecified,
2969                1 => Self::Open,
2970                2 => Self::Closed,
2971                3 => Self::Merged,
2972                _ => Self::UnknownValue(state::UnknownValue(
2973                    wkt::internal::UnknownEnumValue::Integer(value),
2974                )),
2975            }
2976        }
2977    }
2978
2979    impl std::convert::From<&str> for State {
2980        fn from(value: &str) -> Self {
2981            use std::string::ToString;
2982            match value {
2983                "STATE_UNSPECIFIED" => Self::Unspecified,
2984                "OPEN" => Self::Open,
2985                "CLOSED" => Self::Closed,
2986                "MERGED" => Self::Merged,
2987                _ => Self::UnknownValue(state::UnknownValue(
2988                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2989                )),
2990            }
2991        }
2992    }
2993
2994    impl serde::ser::Serialize for State {
2995        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2996        where
2997            S: serde::Serializer,
2998        {
2999            match self {
3000                Self::Unspecified => serializer.serialize_i32(0),
3001                Self::Open => serializer.serialize_i32(1),
3002                Self::Closed => serializer.serialize_i32(2),
3003                Self::Merged => serializer.serialize_i32(3),
3004                Self::UnknownValue(u) => u.0.serialize(serializer),
3005            }
3006        }
3007    }
3008
3009    impl<'de> serde::de::Deserialize<'de> for State {
3010        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3011        where
3012            D: serde::Deserializer<'de>,
3013        {
3014            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3015                ".google.cloud.securesourcemanager.v1.PullRequest.State",
3016            ))
3017        }
3018    }
3019}
3020
3021/// Metadata of a FileDiff. FileDiff represents a single file diff in a pull
3022/// request.
3023#[derive(Clone, Default, PartialEq)]
3024#[non_exhaustive]
3025pub struct FileDiff {
3026    /// Output only. The name of the file.
3027    pub name: std::string::String,
3028
3029    /// Output only. The action taken on the file (eg. added, modified, deleted).
3030    pub action: crate::model::file_diff::Action,
3031
3032    /// Output only. The commit pointing to the file changes.
3033    pub sha: std::string::String,
3034
3035    /// Output only. The git patch containing the file changes.
3036    pub patch: std::string::String,
3037
3038    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3039}
3040
3041impl FileDiff {
3042    /// Creates a new default instance.
3043    pub fn new() -> Self {
3044        std::default::Default::default()
3045    }
3046
3047    /// Sets the value of [name][crate::model::FileDiff::name].
3048    ///
3049    /// # Example
3050    /// ```ignore,no_run
3051    /// # use google_cloud_securesourcemanager_v1::model::FileDiff;
3052    /// let x = FileDiff::new().set_name("example");
3053    /// ```
3054    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3055        self.name = v.into();
3056        self
3057    }
3058
3059    /// Sets the value of [action][crate::model::FileDiff::action].
3060    ///
3061    /// # Example
3062    /// ```ignore,no_run
3063    /// # use google_cloud_securesourcemanager_v1::model::FileDiff;
3064    /// use google_cloud_securesourcemanager_v1::model::file_diff::Action;
3065    /// let x0 = FileDiff::new().set_action(Action::Added);
3066    /// let x1 = FileDiff::new().set_action(Action::Modified);
3067    /// let x2 = FileDiff::new().set_action(Action::Deleted);
3068    /// ```
3069    pub fn set_action<T: std::convert::Into<crate::model::file_diff::Action>>(
3070        mut self,
3071        v: T,
3072    ) -> Self {
3073        self.action = v.into();
3074        self
3075    }
3076
3077    /// Sets the value of [sha][crate::model::FileDiff::sha].
3078    ///
3079    /// # Example
3080    /// ```ignore,no_run
3081    /// # use google_cloud_securesourcemanager_v1::model::FileDiff;
3082    /// let x = FileDiff::new().set_sha("example");
3083    /// ```
3084    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3085        self.sha = v.into();
3086        self
3087    }
3088
3089    /// Sets the value of [patch][crate::model::FileDiff::patch].
3090    ///
3091    /// # Example
3092    /// ```ignore,no_run
3093    /// # use google_cloud_securesourcemanager_v1::model::FileDiff;
3094    /// let x = FileDiff::new().set_patch("example");
3095    /// ```
3096    pub fn set_patch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3097        self.patch = v.into();
3098        self
3099    }
3100}
3101
3102impl wkt::message::Message for FileDiff {
3103    fn typename() -> &'static str {
3104        "type.googleapis.com/google.cloud.securesourcemanager.v1.FileDiff"
3105    }
3106}
3107
3108/// Defines additional types related to [FileDiff].
3109pub mod file_diff {
3110    #[allow(unused_imports)]
3111    use super::*;
3112
3113    /// Action taken on the file.
3114    ///
3115    /// # Working with unknown values
3116    ///
3117    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3118    /// additional enum variants at any time. Adding new variants is not considered
3119    /// a breaking change. Applications should write their code in anticipation of:
3120    ///
3121    /// - New values appearing in future releases of the client library, **and**
3122    /// - New values received dynamically, without application changes.
3123    ///
3124    /// Please consult the [Working with enums] section in the user guide for some
3125    /// guidelines.
3126    ///
3127    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3128    #[derive(Clone, Debug, PartialEq)]
3129    #[non_exhaustive]
3130    pub enum Action {
3131        /// Unspecified.
3132        Unspecified,
3133        /// The file was added.
3134        Added,
3135        /// The file was modified.
3136        Modified,
3137        /// The file was deleted.
3138        Deleted,
3139        /// If set, the enum was initialized with an unknown value.
3140        ///
3141        /// Applications can examine the value using [Action::value] or
3142        /// [Action::name].
3143        UnknownValue(action::UnknownValue),
3144    }
3145
3146    #[doc(hidden)]
3147    pub mod action {
3148        #[allow(unused_imports)]
3149        use super::*;
3150        #[derive(Clone, Debug, PartialEq)]
3151        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3152    }
3153
3154    impl Action {
3155        /// Gets the enum value.
3156        ///
3157        /// Returns `None` if the enum contains an unknown value deserialized from
3158        /// the string representation of enums.
3159        pub fn value(&self) -> std::option::Option<i32> {
3160            match self {
3161                Self::Unspecified => std::option::Option::Some(0),
3162                Self::Added => std::option::Option::Some(1),
3163                Self::Modified => std::option::Option::Some(2),
3164                Self::Deleted => std::option::Option::Some(3),
3165                Self::UnknownValue(u) => u.0.value(),
3166            }
3167        }
3168
3169        /// Gets the enum value as a string.
3170        ///
3171        /// Returns `None` if the enum contains an unknown value deserialized from
3172        /// the integer representation of enums.
3173        pub fn name(&self) -> std::option::Option<&str> {
3174            match self {
3175                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
3176                Self::Added => std::option::Option::Some("ADDED"),
3177                Self::Modified => std::option::Option::Some("MODIFIED"),
3178                Self::Deleted => std::option::Option::Some("DELETED"),
3179                Self::UnknownValue(u) => u.0.name(),
3180            }
3181        }
3182    }
3183
3184    impl std::default::Default for Action {
3185        fn default() -> Self {
3186            use std::convert::From;
3187            Self::from(0)
3188        }
3189    }
3190
3191    impl std::fmt::Display for Action {
3192        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3193            wkt::internal::display_enum(f, self.name(), self.value())
3194        }
3195    }
3196
3197    impl std::convert::From<i32> for Action {
3198        fn from(value: i32) -> Self {
3199            match value {
3200                0 => Self::Unspecified,
3201                1 => Self::Added,
3202                2 => Self::Modified,
3203                3 => Self::Deleted,
3204                _ => Self::UnknownValue(action::UnknownValue(
3205                    wkt::internal::UnknownEnumValue::Integer(value),
3206                )),
3207            }
3208        }
3209    }
3210
3211    impl std::convert::From<&str> for Action {
3212        fn from(value: &str) -> Self {
3213            use std::string::ToString;
3214            match value {
3215                "ACTION_UNSPECIFIED" => Self::Unspecified,
3216                "ADDED" => Self::Added,
3217                "MODIFIED" => Self::Modified,
3218                "DELETED" => Self::Deleted,
3219                _ => Self::UnknownValue(action::UnknownValue(
3220                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3221                )),
3222            }
3223        }
3224    }
3225
3226    impl serde::ser::Serialize for Action {
3227        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3228        where
3229            S: serde::Serializer,
3230        {
3231            match self {
3232                Self::Unspecified => serializer.serialize_i32(0),
3233                Self::Added => serializer.serialize_i32(1),
3234                Self::Modified => serializer.serialize_i32(2),
3235                Self::Deleted => serializer.serialize_i32(3),
3236                Self::UnknownValue(u) => u.0.serialize(serializer),
3237            }
3238        }
3239    }
3240
3241    impl<'de> serde::de::Deserialize<'de> for Action {
3242        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3243        where
3244            D: serde::Deserializer<'de>,
3245        {
3246            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
3247                ".google.cloud.securesourcemanager.v1.FileDiff.Action",
3248            ))
3249        }
3250    }
3251}
3252
3253/// Metadata of an Issue.
3254#[derive(Clone, Default, PartialEq)]
3255#[non_exhaustive]
3256pub struct Issue {
3257    /// Identifier. Unique identifier for an issue. The issue id is generated by
3258    /// the server. Format:
3259    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`
3260    pub name: std::string::String,
3261
3262    /// Required. Issue title.
3263    pub title: std::string::String,
3264
3265    /// Optional. Issue body. Provides a detailed description of the issue.
3266    pub body: std::string::String,
3267
3268    /// Output only. State of the issue.
3269    pub state: crate::model::issue::State,
3270
3271    /// Output only. Creation timestamp.
3272    pub create_time: std::option::Option<wkt::Timestamp>,
3273
3274    /// Output only. Last updated timestamp.
3275    pub update_time: std::option::Option<wkt::Timestamp>,
3276
3277    /// Output only. Close timestamp (if closed). Cleared when is re-opened.
3278    pub close_time: std::option::Option<wkt::Timestamp>,
3279
3280    /// Optional. This checksum is computed by the server based on the value of
3281    /// other fields, and may be sent on update and delete requests to ensure the
3282    /// client has an up-to-date value before proceeding.
3283    pub etag: std::string::String,
3284
3285    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3286}
3287
3288impl Issue {
3289    /// Creates a new default instance.
3290    pub fn new() -> Self {
3291        std::default::Default::default()
3292    }
3293
3294    /// Sets the value of [name][crate::model::Issue::name].
3295    ///
3296    /// # Example
3297    /// ```ignore,no_run
3298    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3299    /// # let project_id = "project_id";
3300    /// # let location_id = "location_id";
3301    /// # let repository_id = "repository_id";
3302    /// # let issue_id = "issue_id";
3303    /// let x = Issue::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"));
3304    /// ```
3305    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3306        self.name = v.into();
3307        self
3308    }
3309
3310    /// Sets the value of [title][crate::model::Issue::title].
3311    ///
3312    /// # Example
3313    /// ```ignore,no_run
3314    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3315    /// let x = Issue::new().set_title("example");
3316    /// ```
3317    pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3318        self.title = v.into();
3319        self
3320    }
3321
3322    /// Sets the value of [body][crate::model::Issue::body].
3323    ///
3324    /// # Example
3325    /// ```ignore,no_run
3326    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3327    /// let x = Issue::new().set_body("example");
3328    /// ```
3329    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3330        self.body = v.into();
3331        self
3332    }
3333
3334    /// Sets the value of [state][crate::model::Issue::state].
3335    ///
3336    /// # Example
3337    /// ```ignore,no_run
3338    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3339    /// use google_cloud_securesourcemanager_v1::model::issue::State;
3340    /// let x0 = Issue::new().set_state(State::Open);
3341    /// let x1 = Issue::new().set_state(State::Closed);
3342    /// ```
3343    pub fn set_state<T: std::convert::Into<crate::model::issue::State>>(mut self, v: T) -> Self {
3344        self.state = v.into();
3345        self
3346    }
3347
3348    /// Sets the value of [create_time][crate::model::Issue::create_time].
3349    ///
3350    /// # Example
3351    /// ```ignore,no_run
3352    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3353    /// use wkt::Timestamp;
3354    /// let x = Issue::new().set_create_time(Timestamp::default()/* use setters */);
3355    /// ```
3356    pub fn set_create_time<T>(mut self, v: T) -> Self
3357    where
3358        T: std::convert::Into<wkt::Timestamp>,
3359    {
3360        self.create_time = std::option::Option::Some(v.into());
3361        self
3362    }
3363
3364    /// Sets or clears the value of [create_time][crate::model::Issue::create_time].
3365    ///
3366    /// # Example
3367    /// ```ignore,no_run
3368    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3369    /// use wkt::Timestamp;
3370    /// let x = Issue::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3371    /// let x = Issue::new().set_or_clear_create_time(None::<Timestamp>);
3372    /// ```
3373    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3374    where
3375        T: std::convert::Into<wkt::Timestamp>,
3376    {
3377        self.create_time = v.map(|x| x.into());
3378        self
3379    }
3380
3381    /// Sets the value of [update_time][crate::model::Issue::update_time].
3382    ///
3383    /// # Example
3384    /// ```ignore,no_run
3385    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3386    /// use wkt::Timestamp;
3387    /// let x = Issue::new().set_update_time(Timestamp::default()/* use setters */);
3388    /// ```
3389    pub fn set_update_time<T>(mut self, v: T) -> Self
3390    where
3391        T: std::convert::Into<wkt::Timestamp>,
3392    {
3393        self.update_time = std::option::Option::Some(v.into());
3394        self
3395    }
3396
3397    /// Sets or clears the value of [update_time][crate::model::Issue::update_time].
3398    ///
3399    /// # Example
3400    /// ```ignore,no_run
3401    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3402    /// use wkt::Timestamp;
3403    /// let x = Issue::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3404    /// let x = Issue::new().set_or_clear_update_time(None::<Timestamp>);
3405    /// ```
3406    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3407    where
3408        T: std::convert::Into<wkt::Timestamp>,
3409    {
3410        self.update_time = v.map(|x| x.into());
3411        self
3412    }
3413
3414    /// Sets the value of [close_time][crate::model::Issue::close_time].
3415    ///
3416    /// # Example
3417    /// ```ignore,no_run
3418    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3419    /// use wkt::Timestamp;
3420    /// let x = Issue::new().set_close_time(Timestamp::default()/* use setters */);
3421    /// ```
3422    pub fn set_close_time<T>(mut self, v: T) -> Self
3423    where
3424        T: std::convert::Into<wkt::Timestamp>,
3425    {
3426        self.close_time = std::option::Option::Some(v.into());
3427        self
3428    }
3429
3430    /// Sets or clears the value of [close_time][crate::model::Issue::close_time].
3431    ///
3432    /// # Example
3433    /// ```ignore,no_run
3434    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3435    /// use wkt::Timestamp;
3436    /// let x = Issue::new().set_or_clear_close_time(Some(Timestamp::default()/* use setters */));
3437    /// let x = Issue::new().set_or_clear_close_time(None::<Timestamp>);
3438    /// ```
3439    pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
3440    where
3441        T: std::convert::Into<wkt::Timestamp>,
3442    {
3443        self.close_time = v.map(|x| x.into());
3444        self
3445    }
3446
3447    /// Sets the value of [etag][crate::model::Issue::etag].
3448    ///
3449    /// # Example
3450    /// ```ignore,no_run
3451    /// # use google_cloud_securesourcemanager_v1::model::Issue;
3452    /// let x = Issue::new().set_etag("example");
3453    /// ```
3454    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3455        self.etag = v.into();
3456        self
3457    }
3458}
3459
3460impl wkt::message::Message for Issue {
3461    fn typename() -> &'static str {
3462        "type.googleapis.com/google.cloud.securesourcemanager.v1.Issue"
3463    }
3464}
3465
3466/// Defines additional types related to [Issue].
3467pub mod issue {
3468    #[allow(unused_imports)]
3469    use super::*;
3470
3471    /// Possible states of an issue.
3472    ///
3473    /// # Working with unknown values
3474    ///
3475    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3476    /// additional enum variants at any time. Adding new variants is not considered
3477    /// a breaking change. Applications should write their code in anticipation of:
3478    ///
3479    /// - New values appearing in future releases of the client library, **and**
3480    /// - New values received dynamically, without application changes.
3481    ///
3482    /// Please consult the [Working with enums] section in the user guide for some
3483    /// guidelines.
3484    ///
3485    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3486    #[derive(Clone, Debug, PartialEq)]
3487    #[non_exhaustive]
3488    pub enum State {
3489        /// Unspecified.
3490        Unspecified,
3491        /// An open issue.
3492        Open,
3493        /// A closed issue.
3494        Closed,
3495        /// If set, the enum was initialized with an unknown value.
3496        ///
3497        /// Applications can examine the value using [State::value] or
3498        /// [State::name].
3499        UnknownValue(state::UnknownValue),
3500    }
3501
3502    #[doc(hidden)]
3503    pub mod state {
3504        #[allow(unused_imports)]
3505        use super::*;
3506        #[derive(Clone, Debug, PartialEq)]
3507        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3508    }
3509
3510    impl State {
3511        /// Gets the enum value.
3512        ///
3513        /// Returns `None` if the enum contains an unknown value deserialized from
3514        /// the string representation of enums.
3515        pub fn value(&self) -> std::option::Option<i32> {
3516            match self {
3517                Self::Unspecified => std::option::Option::Some(0),
3518                Self::Open => std::option::Option::Some(1),
3519                Self::Closed => std::option::Option::Some(2),
3520                Self::UnknownValue(u) => u.0.value(),
3521            }
3522        }
3523
3524        /// Gets the enum value as a string.
3525        ///
3526        /// Returns `None` if the enum contains an unknown value deserialized from
3527        /// the integer representation of enums.
3528        pub fn name(&self) -> std::option::Option<&str> {
3529            match self {
3530                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3531                Self::Open => std::option::Option::Some("OPEN"),
3532                Self::Closed => std::option::Option::Some("CLOSED"),
3533                Self::UnknownValue(u) => u.0.name(),
3534            }
3535        }
3536    }
3537
3538    impl std::default::Default for State {
3539        fn default() -> Self {
3540            use std::convert::From;
3541            Self::from(0)
3542        }
3543    }
3544
3545    impl std::fmt::Display for State {
3546        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3547            wkt::internal::display_enum(f, self.name(), self.value())
3548        }
3549    }
3550
3551    impl std::convert::From<i32> for State {
3552        fn from(value: i32) -> Self {
3553            match value {
3554                0 => Self::Unspecified,
3555                1 => Self::Open,
3556                2 => Self::Closed,
3557                _ => Self::UnknownValue(state::UnknownValue(
3558                    wkt::internal::UnknownEnumValue::Integer(value),
3559                )),
3560            }
3561        }
3562    }
3563
3564    impl std::convert::From<&str> for State {
3565        fn from(value: &str) -> Self {
3566            use std::string::ToString;
3567            match value {
3568                "STATE_UNSPECIFIED" => Self::Unspecified,
3569                "OPEN" => Self::Open,
3570                "CLOSED" => Self::Closed,
3571                _ => Self::UnknownValue(state::UnknownValue(
3572                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3573                )),
3574            }
3575        }
3576    }
3577
3578    impl serde::ser::Serialize for State {
3579        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3580        where
3581            S: serde::Serializer,
3582        {
3583            match self {
3584                Self::Unspecified => serializer.serialize_i32(0),
3585                Self::Open => serializer.serialize_i32(1),
3586                Self::Closed => serializer.serialize_i32(2),
3587                Self::UnknownValue(u) => u.0.serialize(serializer),
3588            }
3589        }
3590    }
3591
3592    impl<'de> serde::de::Deserialize<'de> for State {
3593        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3594        where
3595            D: serde::Deserializer<'de>,
3596        {
3597            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3598                ".google.cloud.securesourcemanager.v1.Issue.State",
3599            ))
3600        }
3601    }
3602}
3603
3604/// IssueComment represents a comment on an issue.
3605#[derive(Clone, Default, PartialEq)]
3606#[non_exhaustive]
3607pub struct IssueComment {
3608    /// Identifier. Unique identifier for an issue comment. The comment id is
3609    /// generated by the server. Format:
3610    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment_id}`
3611    pub name: std::string::String,
3612
3613    /// Required. The comment body.
3614    pub body: std::string::String,
3615
3616    /// Output only. Creation timestamp.
3617    pub create_time: std::option::Option<wkt::Timestamp>,
3618
3619    /// Output only. Last updated timestamp.
3620    pub update_time: std::option::Option<wkt::Timestamp>,
3621
3622    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3623}
3624
3625impl IssueComment {
3626    /// Creates a new default instance.
3627    pub fn new() -> Self {
3628        std::default::Default::default()
3629    }
3630
3631    /// Sets the value of [name][crate::model::IssueComment::name].
3632    ///
3633    /// # Example
3634    /// ```ignore,no_run
3635    /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3636    /// # let project_id = "project_id";
3637    /// # let location_id = "location_id";
3638    /// # let repository_id = "repository_id";
3639    /// # let issue_id = "issue_id";
3640    /// # let comment_id = "comment_id";
3641    /// let x = IssueComment::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}"));
3642    /// ```
3643    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3644        self.name = v.into();
3645        self
3646    }
3647
3648    /// Sets the value of [body][crate::model::IssueComment::body].
3649    ///
3650    /// # Example
3651    /// ```ignore,no_run
3652    /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3653    /// let x = IssueComment::new().set_body("example");
3654    /// ```
3655    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3656        self.body = v.into();
3657        self
3658    }
3659
3660    /// Sets the value of [create_time][crate::model::IssueComment::create_time].
3661    ///
3662    /// # Example
3663    /// ```ignore,no_run
3664    /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3665    /// use wkt::Timestamp;
3666    /// let x = IssueComment::new().set_create_time(Timestamp::default()/* use setters */);
3667    /// ```
3668    pub fn set_create_time<T>(mut self, v: T) -> Self
3669    where
3670        T: std::convert::Into<wkt::Timestamp>,
3671    {
3672        self.create_time = std::option::Option::Some(v.into());
3673        self
3674    }
3675
3676    /// Sets or clears the value of [create_time][crate::model::IssueComment::create_time].
3677    ///
3678    /// # Example
3679    /// ```ignore,no_run
3680    /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3681    /// use wkt::Timestamp;
3682    /// let x = IssueComment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3683    /// let x = IssueComment::new().set_or_clear_create_time(None::<Timestamp>);
3684    /// ```
3685    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3686    where
3687        T: std::convert::Into<wkt::Timestamp>,
3688    {
3689        self.create_time = v.map(|x| x.into());
3690        self
3691    }
3692
3693    /// Sets the value of [update_time][crate::model::IssueComment::update_time].
3694    ///
3695    /// # Example
3696    /// ```ignore,no_run
3697    /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3698    /// use wkt::Timestamp;
3699    /// let x = IssueComment::new().set_update_time(Timestamp::default()/* use setters */);
3700    /// ```
3701    pub fn set_update_time<T>(mut self, v: T) -> Self
3702    where
3703        T: std::convert::Into<wkt::Timestamp>,
3704    {
3705        self.update_time = std::option::Option::Some(v.into());
3706        self
3707    }
3708
3709    /// Sets or clears the value of [update_time][crate::model::IssueComment::update_time].
3710    ///
3711    /// # Example
3712    /// ```ignore,no_run
3713    /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3714    /// use wkt::Timestamp;
3715    /// let x = IssueComment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3716    /// let x = IssueComment::new().set_or_clear_update_time(None::<Timestamp>);
3717    /// ```
3718    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3719    where
3720        T: std::convert::Into<wkt::Timestamp>,
3721    {
3722        self.update_time = v.map(|x| x.into());
3723        self
3724    }
3725}
3726
3727impl wkt::message::Message for IssueComment {
3728    fn typename() -> &'static str {
3729        "type.googleapis.com/google.cloud.securesourcemanager.v1.IssueComment"
3730    }
3731}
3732
3733/// PullRequestComment represents a comment on a pull request.
3734#[derive(Clone, Default, PartialEq)]
3735#[non_exhaustive]
3736pub struct PullRequestComment {
3737    /// Identifier. Unique identifier for the pull request comment. The comment id
3738    /// is generated by the server. Format:
3739    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}`
3740    pub name: std::string::String,
3741
3742    /// Output only. Creation timestamp.
3743    pub create_time: std::option::Option<wkt::Timestamp>,
3744
3745    /// Output only. Last updated timestamp.
3746    pub update_time: std::option::Option<wkt::Timestamp>,
3747
3748    /// The comment detail. A comment can be a review, a general comment, or a
3749    /// code comment.
3750    pub comment_detail: std::option::Option<crate::model::pull_request_comment::CommentDetail>,
3751
3752    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3753}
3754
3755impl PullRequestComment {
3756    /// Creates a new default instance.
3757    pub fn new() -> Self {
3758        std::default::Default::default()
3759    }
3760
3761    /// Sets the value of [name][crate::model::PullRequestComment::name].
3762    ///
3763    /// # Example
3764    /// ```ignore,no_run
3765    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3766    /// # let project_id = "project_id";
3767    /// # let location_id = "location_id";
3768    /// # let repository_id = "repository_id";
3769    /// # let pull_request_id = "pull_request_id";
3770    /// # let comment_id = "comment_id";
3771    /// let x = PullRequestComment::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}"));
3772    /// ```
3773    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3774        self.name = v.into();
3775        self
3776    }
3777
3778    /// Sets the value of [create_time][crate::model::PullRequestComment::create_time].
3779    ///
3780    /// # Example
3781    /// ```ignore,no_run
3782    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3783    /// use wkt::Timestamp;
3784    /// let x = PullRequestComment::new().set_create_time(Timestamp::default()/* use setters */);
3785    /// ```
3786    pub fn set_create_time<T>(mut self, v: T) -> Self
3787    where
3788        T: std::convert::Into<wkt::Timestamp>,
3789    {
3790        self.create_time = std::option::Option::Some(v.into());
3791        self
3792    }
3793
3794    /// Sets or clears the value of [create_time][crate::model::PullRequestComment::create_time].
3795    ///
3796    /// # Example
3797    /// ```ignore,no_run
3798    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3799    /// use wkt::Timestamp;
3800    /// let x = PullRequestComment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3801    /// let x = PullRequestComment::new().set_or_clear_create_time(None::<Timestamp>);
3802    /// ```
3803    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3804    where
3805        T: std::convert::Into<wkt::Timestamp>,
3806    {
3807        self.create_time = v.map(|x| x.into());
3808        self
3809    }
3810
3811    /// Sets the value of [update_time][crate::model::PullRequestComment::update_time].
3812    ///
3813    /// # Example
3814    /// ```ignore,no_run
3815    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3816    /// use wkt::Timestamp;
3817    /// let x = PullRequestComment::new().set_update_time(Timestamp::default()/* use setters */);
3818    /// ```
3819    pub fn set_update_time<T>(mut self, v: T) -> Self
3820    where
3821        T: std::convert::Into<wkt::Timestamp>,
3822    {
3823        self.update_time = std::option::Option::Some(v.into());
3824        self
3825    }
3826
3827    /// Sets or clears the value of [update_time][crate::model::PullRequestComment::update_time].
3828    ///
3829    /// # Example
3830    /// ```ignore,no_run
3831    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3832    /// use wkt::Timestamp;
3833    /// let x = PullRequestComment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3834    /// let x = PullRequestComment::new().set_or_clear_update_time(None::<Timestamp>);
3835    /// ```
3836    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3837    where
3838        T: std::convert::Into<wkt::Timestamp>,
3839    {
3840        self.update_time = v.map(|x| x.into());
3841        self
3842    }
3843
3844    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail].
3845    ///
3846    /// Note that all the setters affecting `comment_detail` are mutually
3847    /// exclusive.
3848    ///
3849    /// # Example
3850    /// ```ignore,no_run
3851    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3852    /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
3853    /// let x = PullRequestComment::new().set_comment_detail(Some(
3854    ///     google_cloud_securesourcemanager_v1::model::pull_request_comment::CommentDetail::Review(Review::default().into())));
3855    /// ```
3856    pub fn set_comment_detail<
3857        T: std::convert::Into<std::option::Option<crate::model::pull_request_comment::CommentDetail>>,
3858    >(
3859        mut self,
3860        v: T,
3861    ) -> Self {
3862        self.comment_detail = v.into();
3863        self
3864    }
3865
3866    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3867    /// if it holds a `Review`, `None` if the field is not set or
3868    /// holds a different branch.
3869    pub fn review(
3870        &self,
3871    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Review>> {
3872        #[allow(unreachable_patterns)]
3873        self.comment_detail.as_ref().and_then(|v| match v {
3874            crate::model::pull_request_comment::CommentDetail::Review(v) => {
3875                std::option::Option::Some(v)
3876            }
3877            _ => std::option::Option::None,
3878        })
3879    }
3880
3881    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3882    /// to hold a `Review`.
3883    ///
3884    /// Note that all the setters affecting `comment_detail` are
3885    /// mutually exclusive.
3886    ///
3887    /// # Example
3888    /// ```ignore,no_run
3889    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3890    /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
3891    /// let x = PullRequestComment::new().set_review(Review::default()/* use setters */);
3892    /// assert!(x.review().is_some());
3893    /// assert!(x.comment().is_none());
3894    /// assert!(x.code().is_none());
3895    /// ```
3896    pub fn set_review<
3897        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Review>>,
3898    >(
3899        mut self,
3900        v: T,
3901    ) -> Self {
3902        self.comment_detail = std::option::Option::Some(
3903            crate::model::pull_request_comment::CommentDetail::Review(v.into()),
3904        );
3905        self
3906    }
3907
3908    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3909    /// if it holds a `Comment`, `None` if the field is not set or
3910    /// holds a different branch.
3911    pub fn comment(
3912        &self,
3913    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Comment>> {
3914        #[allow(unreachable_patterns)]
3915        self.comment_detail.as_ref().and_then(|v| match v {
3916            crate::model::pull_request_comment::CommentDetail::Comment(v) => {
3917                std::option::Option::Some(v)
3918            }
3919            _ => std::option::Option::None,
3920        })
3921    }
3922
3923    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3924    /// to hold a `Comment`.
3925    ///
3926    /// Note that all the setters affecting `comment_detail` are
3927    /// mutually exclusive.
3928    ///
3929    /// # Example
3930    /// ```ignore,no_run
3931    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3932    /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Comment;
3933    /// let x = PullRequestComment::new().set_comment(Comment::default()/* use setters */);
3934    /// assert!(x.comment().is_some());
3935    /// assert!(x.review().is_none());
3936    /// assert!(x.code().is_none());
3937    /// ```
3938    pub fn set_comment<
3939        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Comment>>,
3940    >(
3941        mut self,
3942        v: T,
3943    ) -> Self {
3944        self.comment_detail = std::option::Option::Some(
3945            crate::model::pull_request_comment::CommentDetail::Comment(v.into()),
3946        );
3947        self
3948    }
3949
3950    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3951    /// if it holds a `Code`, `None` if the field is not set or
3952    /// holds a different branch.
3953    pub fn code(
3954        &self,
3955    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Code>> {
3956        #[allow(unreachable_patterns)]
3957        self.comment_detail.as_ref().and_then(|v| match v {
3958            crate::model::pull_request_comment::CommentDetail::Code(v) => {
3959                std::option::Option::Some(v)
3960            }
3961            _ => std::option::Option::None,
3962        })
3963    }
3964
3965    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3966    /// to hold a `Code`.
3967    ///
3968    /// Note that all the setters affecting `comment_detail` are
3969    /// mutually exclusive.
3970    ///
3971    /// # Example
3972    /// ```ignore,no_run
3973    /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3974    /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
3975    /// let x = PullRequestComment::new().set_code(Code::default()/* use setters */);
3976    /// assert!(x.code().is_some());
3977    /// assert!(x.review().is_none());
3978    /// assert!(x.comment().is_none());
3979    /// ```
3980    pub fn set_code<
3981        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Code>>,
3982    >(
3983        mut self,
3984        v: T,
3985    ) -> Self {
3986        self.comment_detail = std::option::Option::Some(
3987            crate::model::pull_request_comment::CommentDetail::Code(v.into()),
3988        );
3989        self
3990    }
3991}
3992
3993impl wkt::message::Message for PullRequestComment {
3994    fn typename() -> &'static str {
3995        "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment"
3996    }
3997}
3998
3999/// Defines additional types related to [PullRequestComment].
4000pub mod pull_request_comment {
4001    #[allow(unused_imports)]
4002    use super::*;
4003
4004    /// The review summary comment.
4005    #[derive(Clone, Default, PartialEq)]
4006    #[non_exhaustive]
4007    pub struct Review {
4008        /// Required. The review action type.
4009        pub action_type: crate::model::pull_request_comment::review::ActionType,
4010
4011        /// Optional. The comment body.
4012        pub body: std::string::String,
4013
4014        /// Output only. The effective commit sha this review is pointing to.
4015        pub effective_commit_sha: std::string::String,
4016
4017        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4018    }
4019
4020    impl Review {
4021        /// Creates a new default instance.
4022        pub fn new() -> Self {
4023            std::default::Default::default()
4024        }
4025
4026        /// Sets the value of [action_type][crate::model::pull_request_comment::Review::action_type].
4027        ///
4028        /// # Example
4029        /// ```ignore,no_run
4030        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
4031        /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::review::ActionType;
4032        /// let x0 = Review::new().set_action_type(ActionType::Comment);
4033        /// let x1 = Review::new().set_action_type(ActionType::ChangeRequested);
4034        /// let x2 = Review::new().set_action_type(ActionType::Approved);
4035        /// ```
4036        pub fn set_action_type<
4037            T: std::convert::Into<crate::model::pull_request_comment::review::ActionType>,
4038        >(
4039            mut self,
4040            v: T,
4041        ) -> Self {
4042            self.action_type = v.into();
4043            self
4044        }
4045
4046        /// Sets the value of [body][crate::model::pull_request_comment::Review::body].
4047        ///
4048        /// # Example
4049        /// ```ignore,no_run
4050        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
4051        /// let x = Review::new().set_body("example");
4052        /// ```
4053        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4054            self.body = v.into();
4055            self
4056        }
4057
4058        /// Sets the value of [effective_commit_sha][crate::model::pull_request_comment::Review::effective_commit_sha].
4059        ///
4060        /// # Example
4061        /// ```ignore,no_run
4062        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
4063        /// let x = Review::new().set_effective_commit_sha("example");
4064        /// ```
4065        pub fn set_effective_commit_sha<T: std::convert::Into<std::string::String>>(
4066            mut self,
4067            v: T,
4068        ) -> Self {
4069            self.effective_commit_sha = v.into();
4070            self
4071        }
4072    }
4073
4074    impl wkt::message::Message for Review {
4075        fn typename() -> &'static str {
4076            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Review"
4077        }
4078    }
4079
4080    /// Defines additional types related to [Review].
4081    pub mod review {
4082        #[allow(unused_imports)]
4083        use super::*;
4084
4085        /// The review action type.
4086        ///
4087        /// # Working with unknown values
4088        ///
4089        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4090        /// additional enum variants at any time. Adding new variants is not considered
4091        /// a breaking change. Applications should write their code in anticipation of:
4092        ///
4093        /// - New values appearing in future releases of the client library, **and**
4094        /// - New values received dynamically, without application changes.
4095        ///
4096        /// Please consult the [Working with enums] section in the user guide for some
4097        /// guidelines.
4098        ///
4099        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4100        #[derive(Clone, Debug, PartialEq)]
4101        #[non_exhaustive]
4102        pub enum ActionType {
4103            /// Unspecified.
4104            Unspecified,
4105            /// A general review comment.
4106            Comment,
4107            /// Change required from this review.
4108            ChangeRequested,
4109            /// Change approved from this review.
4110            Approved,
4111            /// If set, the enum was initialized with an unknown value.
4112            ///
4113            /// Applications can examine the value using [ActionType::value] or
4114            /// [ActionType::name].
4115            UnknownValue(action_type::UnknownValue),
4116        }
4117
4118        #[doc(hidden)]
4119        pub mod action_type {
4120            #[allow(unused_imports)]
4121            use super::*;
4122            #[derive(Clone, Debug, PartialEq)]
4123            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4124        }
4125
4126        impl ActionType {
4127            /// Gets the enum value.
4128            ///
4129            /// Returns `None` if the enum contains an unknown value deserialized from
4130            /// the string representation of enums.
4131            pub fn value(&self) -> std::option::Option<i32> {
4132                match self {
4133                    Self::Unspecified => std::option::Option::Some(0),
4134                    Self::Comment => std::option::Option::Some(1),
4135                    Self::ChangeRequested => std::option::Option::Some(2),
4136                    Self::Approved => std::option::Option::Some(3),
4137                    Self::UnknownValue(u) => u.0.value(),
4138                }
4139            }
4140
4141            /// Gets the enum value as a string.
4142            ///
4143            /// Returns `None` if the enum contains an unknown value deserialized from
4144            /// the integer representation of enums.
4145            pub fn name(&self) -> std::option::Option<&str> {
4146                match self {
4147                    Self::Unspecified => std::option::Option::Some("ACTION_TYPE_UNSPECIFIED"),
4148                    Self::Comment => std::option::Option::Some("COMMENT"),
4149                    Self::ChangeRequested => std::option::Option::Some("CHANGE_REQUESTED"),
4150                    Self::Approved => std::option::Option::Some("APPROVED"),
4151                    Self::UnknownValue(u) => u.0.name(),
4152                }
4153            }
4154        }
4155
4156        impl std::default::Default for ActionType {
4157            fn default() -> Self {
4158                use std::convert::From;
4159                Self::from(0)
4160            }
4161        }
4162
4163        impl std::fmt::Display for ActionType {
4164            fn fmt(
4165                &self,
4166                f: &mut std::fmt::Formatter<'_>,
4167            ) -> std::result::Result<(), std::fmt::Error> {
4168                wkt::internal::display_enum(f, self.name(), self.value())
4169            }
4170        }
4171
4172        impl std::convert::From<i32> for ActionType {
4173            fn from(value: i32) -> Self {
4174                match value {
4175                    0 => Self::Unspecified,
4176                    1 => Self::Comment,
4177                    2 => Self::ChangeRequested,
4178                    3 => Self::Approved,
4179                    _ => Self::UnknownValue(action_type::UnknownValue(
4180                        wkt::internal::UnknownEnumValue::Integer(value),
4181                    )),
4182                }
4183            }
4184        }
4185
4186        impl std::convert::From<&str> for ActionType {
4187            fn from(value: &str) -> Self {
4188                use std::string::ToString;
4189                match value {
4190                    "ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
4191                    "COMMENT" => Self::Comment,
4192                    "CHANGE_REQUESTED" => Self::ChangeRequested,
4193                    "APPROVED" => Self::Approved,
4194                    _ => Self::UnknownValue(action_type::UnknownValue(
4195                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4196                    )),
4197                }
4198            }
4199        }
4200
4201        impl serde::ser::Serialize for ActionType {
4202            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4203            where
4204                S: serde::Serializer,
4205            {
4206                match self {
4207                    Self::Unspecified => serializer.serialize_i32(0),
4208                    Self::Comment => serializer.serialize_i32(1),
4209                    Self::ChangeRequested => serializer.serialize_i32(2),
4210                    Self::Approved => serializer.serialize_i32(3),
4211                    Self::UnknownValue(u) => u.0.serialize(serializer),
4212                }
4213            }
4214        }
4215
4216        impl<'de> serde::de::Deserialize<'de> for ActionType {
4217            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4218            where
4219                D: serde::Deserializer<'de>,
4220            {
4221                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActionType>::new(
4222                    ".google.cloud.securesourcemanager.v1.PullRequestComment.Review.ActionType",
4223                ))
4224            }
4225        }
4226    }
4227
4228    /// The general pull request comment.
4229    #[derive(Clone, Default, PartialEq)]
4230    #[non_exhaustive]
4231    pub struct Comment {
4232        /// Required. The comment body.
4233        pub body: std::string::String,
4234
4235        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4236    }
4237
4238    impl Comment {
4239        /// Creates a new default instance.
4240        pub fn new() -> Self {
4241            std::default::Default::default()
4242        }
4243
4244        /// Sets the value of [body][crate::model::pull_request_comment::Comment::body].
4245        ///
4246        /// # Example
4247        /// ```ignore,no_run
4248        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Comment;
4249        /// let x = Comment::new().set_body("example");
4250        /// ```
4251        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4252            self.body = v.into();
4253            self
4254        }
4255    }
4256
4257    impl wkt::message::Message for Comment {
4258        fn typename() -> &'static str {
4259            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Comment"
4260        }
4261    }
4262
4263    /// The comment on a code line.
4264    #[derive(Clone, Default, PartialEq)]
4265    #[non_exhaustive]
4266    pub struct Code {
4267        /// Required. The comment body.
4268        pub body: std::string::String,
4269
4270        /// Optional. Input only. The PullRequestComment resource name that this
4271        /// comment is replying to.
4272        pub reply: std::string::String,
4273
4274        /// Optional. The position of the comment.
4275        pub position: std::option::Option<crate::model::pull_request_comment::Position>,
4276
4277        /// Output only. The root comment of the conversation, derived from the reply
4278        /// field.
4279        pub effective_root_comment: std::string::String,
4280
4281        /// Output only. Boolean indicator if the comment is resolved.
4282        pub resolved: bool,
4283
4284        /// Output only. The effective commit sha this code comment is pointing to.
4285        pub effective_commit_sha: std::string::String,
4286
4287        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4288    }
4289
4290    impl Code {
4291        /// Creates a new default instance.
4292        pub fn new() -> Self {
4293            std::default::Default::default()
4294        }
4295
4296        /// Sets the value of [body][crate::model::pull_request_comment::Code::body].
4297        ///
4298        /// # Example
4299        /// ```ignore,no_run
4300        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4301        /// let x = Code::new().set_body("example");
4302        /// ```
4303        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4304            self.body = v.into();
4305            self
4306        }
4307
4308        /// Sets the value of [reply][crate::model::pull_request_comment::Code::reply].
4309        ///
4310        /// # Example
4311        /// ```ignore,no_run
4312        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4313        /// let x = Code::new().set_reply("example");
4314        /// ```
4315        pub fn set_reply<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4316            self.reply = v.into();
4317            self
4318        }
4319
4320        /// Sets the value of [position][crate::model::pull_request_comment::Code::position].
4321        ///
4322        /// # Example
4323        /// ```ignore,no_run
4324        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4325        /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Position;
4326        /// let x = Code::new().set_position(Position::default()/* use setters */);
4327        /// ```
4328        pub fn set_position<T>(mut self, v: T) -> Self
4329        where
4330            T: std::convert::Into<crate::model::pull_request_comment::Position>,
4331        {
4332            self.position = std::option::Option::Some(v.into());
4333            self
4334        }
4335
4336        /// Sets or clears the value of [position][crate::model::pull_request_comment::Code::position].
4337        ///
4338        /// # Example
4339        /// ```ignore,no_run
4340        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4341        /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Position;
4342        /// let x = Code::new().set_or_clear_position(Some(Position::default()/* use setters */));
4343        /// let x = Code::new().set_or_clear_position(None::<Position>);
4344        /// ```
4345        pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
4346        where
4347            T: std::convert::Into<crate::model::pull_request_comment::Position>,
4348        {
4349            self.position = v.map(|x| x.into());
4350            self
4351        }
4352
4353        /// Sets the value of [effective_root_comment][crate::model::pull_request_comment::Code::effective_root_comment].
4354        ///
4355        /// # Example
4356        /// ```ignore,no_run
4357        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4358        /// let x = Code::new().set_effective_root_comment("example");
4359        /// ```
4360        pub fn set_effective_root_comment<T: std::convert::Into<std::string::String>>(
4361            mut self,
4362            v: T,
4363        ) -> Self {
4364            self.effective_root_comment = v.into();
4365            self
4366        }
4367
4368        /// Sets the value of [resolved][crate::model::pull_request_comment::Code::resolved].
4369        ///
4370        /// # Example
4371        /// ```ignore,no_run
4372        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4373        /// let x = Code::new().set_resolved(true);
4374        /// ```
4375        pub fn set_resolved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4376            self.resolved = v.into();
4377            self
4378        }
4379
4380        /// Sets the value of [effective_commit_sha][crate::model::pull_request_comment::Code::effective_commit_sha].
4381        ///
4382        /// # Example
4383        /// ```ignore,no_run
4384        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4385        /// let x = Code::new().set_effective_commit_sha("example");
4386        /// ```
4387        pub fn set_effective_commit_sha<T: std::convert::Into<std::string::String>>(
4388            mut self,
4389            v: T,
4390        ) -> Self {
4391            self.effective_commit_sha = v.into();
4392            self
4393        }
4394    }
4395
4396    impl wkt::message::Message for Code {
4397        fn typename() -> &'static str {
4398            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Code"
4399        }
4400    }
4401
4402    /// The position of the code comment.
4403    #[derive(Clone, Default, PartialEq)]
4404    #[non_exhaustive]
4405    pub struct Position {
4406        /// Required. The path of the file.
4407        pub path: std::string::String,
4408
4409        /// Required. The line number of the comment. Positive value means it's on
4410        /// the new side of the diff, negative value means it's on the old side.
4411        pub line: i64,
4412
4413        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4414    }
4415
4416    impl Position {
4417        /// Creates a new default instance.
4418        pub fn new() -> Self {
4419            std::default::Default::default()
4420        }
4421
4422        /// Sets the value of [path][crate::model::pull_request_comment::Position::path].
4423        ///
4424        /// # Example
4425        /// ```ignore,no_run
4426        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Position;
4427        /// let x = Position::new().set_path("example");
4428        /// ```
4429        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4430            self.path = v.into();
4431            self
4432        }
4433
4434        /// Sets the value of [line][crate::model::pull_request_comment::Position::line].
4435        ///
4436        /// # Example
4437        /// ```ignore,no_run
4438        /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Position;
4439        /// let x = Position::new().set_line(42);
4440        /// ```
4441        pub fn set_line<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4442            self.line = v.into();
4443            self
4444        }
4445    }
4446
4447    impl wkt::message::Message for Position {
4448        fn typename() -> &'static str {
4449            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Position"
4450        }
4451    }
4452
4453    /// The comment detail. A comment can be a review, a general comment, or a
4454    /// code comment.
4455    #[derive(Clone, Debug, PartialEq)]
4456    #[non_exhaustive]
4457    pub enum CommentDetail {
4458        /// Optional. The review summary comment.
4459        Review(std::boxed::Box<crate::model::pull_request_comment::Review>),
4460        /// Optional. The general pull request comment.
4461        Comment(std::boxed::Box<crate::model::pull_request_comment::Comment>),
4462        /// Optional. The comment on a code line.
4463        Code(std::boxed::Box<crate::model::pull_request_comment::Code>),
4464    }
4465}
4466
4467/// Ref represents a git reference within a repository.
4468#[derive(Clone, Default, PartialEq)]
4469#[non_exhaustive]
4470pub struct Ref {
4471    /// Identifier. Name of the git reference (e.g., 'refs/heads/foo' or
4472    /// 'refs/tags/v1.0').
4473    pub name: std::string::String,
4474
4475    /// Output only. The target of the reference, which is a commit SHA.
4476    pub target: std::string::String,
4477
4478    /// Output only. The type of the reference.
4479    pub r#type: crate::model::r#ref::RefType,
4480
4481    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4482}
4483
4484impl Ref {
4485    /// Creates a new default instance.
4486    pub fn new() -> Self {
4487        std::default::Default::default()
4488    }
4489
4490    /// Sets the value of [name][crate::model::Ref::name].
4491    ///
4492    /// # Example
4493    /// ```ignore,no_run
4494    /// # use google_cloud_securesourcemanager_v1::model::Ref;
4495    /// let x = Ref::new().set_name("example");
4496    /// ```
4497    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4498        self.name = v.into();
4499        self
4500    }
4501
4502    /// Sets the value of [target][crate::model::Ref::target].
4503    ///
4504    /// # Example
4505    /// ```ignore,no_run
4506    /// # use google_cloud_securesourcemanager_v1::model::Ref;
4507    /// let x = Ref::new().set_target("example");
4508    /// ```
4509    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4510        self.target = v.into();
4511        self
4512    }
4513
4514    /// Sets the value of [r#type][crate::model::Ref::type].
4515    ///
4516    /// # Example
4517    /// ```ignore,no_run
4518    /// # use google_cloud_securesourcemanager_v1::model::Ref;
4519    /// use google_cloud_securesourcemanager_v1::model::r#ref::RefType;
4520    /// let x0 = Ref::new().set_type(RefType::Branch);
4521    /// let x1 = Ref::new().set_type(RefType::Tag);
4522    /// ```
4523    pub fn set_type<T: std::convert::Into<crate::model::r#ref::RefType>>(mut self, v: T) -> Self {
4524        self.r#type = v.into();
4525        self
4526    }
4527}
4528
4529impl wkt::message::Message for Ref {
4530    fn typename() -> &'static str {
4531        "type.googleapis.com/google.cloud.securesourcemanager.v1.Ref"
4532    }
4533}
4534
4535/// Defines additional types related to [Ref].
4536pub mod r#ref {
4537    #[allow(unused_imports)]
4538    use super::*;
4539
4540    /// The derived type of the reference (e.g., branch or tag) from the name.
4541    ///
4542    /// # Working with unknown values
4543    ///
4544    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4545    /// additional enum variants at any time. Adding new variants is not considered
4546    /// a breaking change. Applications should write their code in anticipation of:
4547    ///
4548    /// - New values appearing in future releases of the client library, **and**
4549    /// - New values received dynamically, without application changes.
4550    ///
4551    /// Please consult the [Working with enums] section in the user guide for some
4552    /// guidelines.
4553    ///
4554    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4555    #[derive(Clone, Debug, PartialEq)]
4556    #[non_exhaustive]
4557    pub enum RefType {
4558        /// Unspecified ref type.
4559        Unspecified,
4560        /// Represents a branch.
4561        Branch,
4562        /// Represents a tag.
4563        Tag,
4564        /// If set, the enum was initialized with an unknown value.
4565        ///
4566        /// Applications can examine the value using [RefType::value] or
4567        /// [RefType::name].
4568        UnknownValue(ref_type::UnknownValue),
4569    }
4570
4571    #[doc(hidden)]
4572    pub mod ref_type {
4573        #[allow(unused_imports)]
4574        use super::*;
4575        #[derive(Clone, Debug, PartialEq)]
4576        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4577    }
4578
4579    impl RefType {
4580        /// Gets the enum value.
4581        ///
4582        /// Returns `None` if the enum contains an unknown value deserialized from
4583        /// the string representation of enums.
4584        pub fn value(&self) -> std::option::Option<i32> {
4585            match self {
4586                Self::Unspecified => std::option::Option::Some(0),
4587                Self::Branch => std::option::Option::Some(1),
4588                Self::Tag => std::option::Option::Some(2),
4589                Self::UnknownValue(u) => u.0.value(),
4590            }
4591        }
4592
4593        /// Gets the enum value as a string.
4594        ///
4595        /// Returns `None` if the enum contains an unknown value deserialized from
4596        /// the integer representation of enums.
4597        pub fn name(&self) -> std::option::Option<&str> {
4598            match self {
4599                Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
4600                Self::Branch => std::option::Option::Some("REF_TYPE_BRANCH"),
4601                Self::Tag => std::option::Option::Some("REF_TYPE_TAG"),
4602                Self::UnknownValue(u) => u.0.name(),
4603            }
4604        }
4605    }
4606
4607    impl std::default::Default for RefType {
4608        fn default() -> Self {
4609            use std::convert::From;
4610            Self::from(0)
4611        }
4612    }
4613
4614    impl std::fmt::Display for RefType {
4615        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4616            wkt::internal::display_enum(f, self.name(), self.value())
4617        }
4618    }
4619
4620    impl std::convert::From<i32> for RefType {
4621        fn from(value: i32) -> Self {
4622            match value {
4623                0 => Self::Unspecified,
4624                1 => Self::Branch,
4625                2 => Self::Tag,
4626                _ => Self::UnknownValue(ref_type::UnknownValue(
4627                    wkt::internal::UnknownEnumValue::Integer(value),
4628                )),
4629            }
4630        }
4631    }
4632
4633    impl std::convert::From<&str> for RefType {
4634        fn from(value: &str) -> Self {
4635            use std::string::ToString;
4636            match value {
4637                "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
4638                "REF_TYPE_BRANCH" => Self::Branch,
4639                "REF_TYPE_TAG" => Self::Tag,
4640                _ => Self::UnknownValue(ref_type::UnknownValue(
4641                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4642                )),
4643            }
4644        }
4645    }
4646
4647    impl serde::ser::Serialize for RefType {
4648        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4649        where
4650            S: serde::Serializer,
4651        {
4652            match self {
4653                Self::Unspecified => serializer.serialize_i32(0),
4654                Self::Branch => serializer.serialize_i32(1),
4655                Self::Tag => serializer.serialize_i32(2),
4656                Self::UnknownValue(u) => u.0.serialize(serializer),
4657            }
4658        }
4659    }
4660
4661    impl<'de> serde::de::Deserialize<'de> for RefType {
4662        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4663        where
4664            D: serde::Deserializer<'de>,
4665        {
4666            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
4667                ".google.cloud.securesourcemanager.v1.Ref.RefType",
4668            ))
4669        }
4670    }
4671}
4672
4673/// ListInstancesRequest is the request to list instances.
4674#[derive(Clone, Default, PartialEq)]
4675#[non_exhaustive]
4676pub struct ListInstancesRequest {
4677    /// Required. Parent value for ListInstancesRequest.
4678    pub parent: std::string::String,
4679
4680    /// Optional. Requested page size. Server may return fewer items than
4681    /// requested. If unspecified, server will pick an appropriate default.
4682    pub page_size: i32,
4683
4684    /// Optional. A token identifying a page of results the server should return.
4685    pub page_token: std::string::String,
4686
4687    /// Optional. Filter for filtering results.
4688    pub filter: std::string::String,
4689
4690    /// Optional. Hint for how to order the results.
4691    pub order_by: std::string::String,
4692
4693    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4694}
4695
4696impl ListInstancesRequest {
4697    /// Creates a new default instance.
4698    pub fn new() -> Self {
4699        std::default::Default::default()
4700    }
4701
4702    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
4703    ///
4704    /// # Example
4705    /// ```ignore,no_run
4706    /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4707    /// # let project_id = "project_id";
4708    /// # let location_id = "location_id";
4709    /// let x = ListInstancesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4710    /// ```
4711    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4712        self.parent = v.into();
4713        self
4714    }
4715
4716    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
4717    ///
4718    /// # Example
4719    /// ```ignore,no_run
4720    /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4721    /// let x = ListInstancesRequest::new().set_page_size(42);
4722    /// ```
4723    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4724        self.page_size = v.into();
4725        self
4726    }
4727
4728    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
4729    ///
4730    /// # Example
4731    /// ```ignore,no_run
4732    /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4733    /// let x = ListInstancesRequest::new().set_page_token("example");
4734    /// ```
4735    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4736        self.page_token = v.into();
4737        self
4738    }
4739
4740    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
4741    ///
4742    /// # Example
4743    /// ```ignore,no_run
4744    /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4745    /// let x = ListInstancesRequest::new().set_filter("example");
4746    /// ```
4747    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4748        self.filter = v.into();
4749        self
4750    }
4751
4752    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
4753    ///
4754    /// # Example
4755    /// ```ignore,no_run
4756    /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4757    /// let x = ListInstancesRequest::new().set_order_by("example");
4758    /// ```
4759    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4760        self.order_by = v.into();
4761        self
4762    }
4763}
4764
4765impl wkt::message::Message for ListInstancesRequest {
4766    fn typename() -> &'static str {
4767        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListInstancesRequest"
4768    }
4769}
4770
4771#[allow(missing_docs)]
4772#[derive(Clone, Default, PartialEq)]
4773#[non_exhaustive]
4774pub struct ListInstancesResponse {
4775    /// The list of instances.
4776    pub instances: std::vec::Vec<crate::model::Instance>,
4777
4778    /// A token identifying a page of results the server should return.
4779    pub next_page_token: std::string::String,
4780
4781    /// Locations that could not be reached.
4782    pub unreachable: std::vec::Vec<std::string::String>,
4783
4784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4785}
4786
4787impl ListInstancesResponse {
4788    /// Creates a new default instance.
4789    pub fn new() -> Self {
4790        std::default::Default::default()
4791    }
4792
4793    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
4794    ///
4795    /// # Example
4796    /// ```ignore,no_run
4797    /// # use google_cloud_securesourcemanager_v1::model::ListInstancesResponse;
4798    /// use google_cloud_securesourcemanager_v1::model::Instance;
4799    /// let x = ListInstancesResponse::new()
4800    ///     .set_instances([
4801    ///         Instance::default()/* use setters */,
4802    ///         Instance::default()/* use (different) setters */,
4803    ///     ]);
4804    /// ```
4805    pub fn set_instances<T, V>(mut self, v: T) -> Self
4806    where
4807        T: std::iter::IntoIterator<Item = V>,
4808        V: std::convert::Into<crate::model::Instance>,
4809    {
4810        use std::iter::Iterator;
4811        self.instances = v.into_iter().map(|i| i.into()).collect();
4812        self
4813    }
4814
4815    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
4816    ///
4817    /// # Example
4818    /// ```ignore,no_run
4819    /// # use google_cloud_securesourcemanager_v1::model::ListInstancesResponse;
4820    /// let x = ListInstancesResponse::new().set_next_page_token("example");
4821    /// ```
4822    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4823        self.next_page_token = v.into();
4824        self
4825    }
4826
4827    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
4828    ///
4829    /// # Example
4830    /// ```ignore,no_run
4831    /// # use google_cloud_securesourcemanager_v1::model::ListInstancesResponse;
4832    /// let x = ListInstancesResponse::new().set_unreachable(["a", "b", "c"]);
4833    /// ```
4834    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4835    where
4836        T: std::iter::IntoIterator<Item = V>,
4837        V: std::convert::Into<std::string::String>,
4838    {
4839        use std::iter::Iterator;
4840        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4841        self
4842    }
4843}
4844
4845impl wkt::message::Message for ListInstancesResponse {
4846    fn typename() -> &'static str {
4847        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListInstancesResponse"
4848    }
4849}
4850
4851#[doc(hidden)]
4852impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
4853    type PageItem = crate::model::Instance;
4854
4855    fn items(self) -> std::vec::Vec<Self::PageItem> {
4856        self.instances
4857    }
4858
4859    fn next_page_token(&self) -> std::string::String {
4860        use std::clone::Clone;
4861        self.next_page_token.clone()
4862    }
4863}
4864
4865/// GetInstanceRequest is the request for getting an instance.
4866#[derive(Clone, Default, PartialEq)]
4867#[non_exhaustive]
4868pub struct GetInstanceRequest {
4869    /// Required. Name of the resource.
4870    pub name: std::string::String,
4871
4872    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4873}
4874
4875impl GetInstanceRequest {
4876    /// Creates a new default instance.
4877    pub fn new() -> Self {
4878        std::default::Default::default()
4879    }
4880
4881    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
4882    ///
4883    /// # Example
4884    /// ```ignore,no_run
4885    /// # use google_cloud_securesourcemanager_v1::model::GetInstanceRequest;
4886    /// # let project_id = "project_id";
4887    /// # let location_id = "location_id";
4888    /// # let instance_id = "instance_id";
4889    /// let x = GetInstanceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
4890    /// ```
4891    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4892        self.name = v.into();
4893        self
4894    }
4895}
4896
4897impl wkt::message::Message for GetInstanceRequest {
4898    fn typename() -> &'static str {
4899        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetInstanceRequest"
4900    }
4901}
4902
4903/// CreateInstanceRequest is the request for creating an instance.
4904#[derive(Clone, Default, PartialEq)]
4905#[non_exhaustive]
4906pub struct CreateInstanceRequest {
4907    /// Required. Value for parent.
4908    pub parent: std::string::String,
4909
4910    /// Required. ID of the instance to be created.
4911    pub instance_id: std::string::String,
4912
4913    /// Required. The resource being created.
4914    pub instance: std::option::Option<crate::model::Instance>,
4915
4916    /// Optional. An optional request ID to identify requests. Specify a unique
4917    /// request ID so that if you must retry your request, the server will know to
4918    /// ignore the request if it has already been completed. The server will
4919    /// guarantee that for at least 60 minutes since the first request.
4920    ///
4921    /// For example, consider a situation where you make an initial request and
4922    /// the request times out. If you make the request again with the same request
4923    /// ID, the server can check if original operation with the same request ID
4924    /// was received, and if so, will ignore the second request. This prevents
4925    /// clients from accidentally creating duplicate commitments.
4926    ///
4927    /// The request ID must be a valid UUID with the exception that zero UUID is
4928    /// not supported (00000000-0000-0000-0000-000000000000).
4929    pub request_id: std::string::String,
4930
4931    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4932}
4933
4934impl CreateInstanceRequest {
4935    /// Creates a new default instance.
4936    pub fn new() -> Self {
4937        std::default::Default::default()
4938    }
4939
4940    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
4941    ///
4942    /// # Example
4943    /// ```ignore,no_run
4944    /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4945    /// # let project_id = "project_id";
4946    /// # let location_id = "location_id";
4947    /// let x = CreateInstanceRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4948    /// ```
4949    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4950        self.parent = v.into();
4951        self
4952    }
4953
4954    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
4955    ///
4956    /// # Example
4957    /// ```ignore,no_run
4958    /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4959    /// let x = CreateInstanceRequest::new().set_instance_id("example");
4960    /// ```
4961    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4962        self.instance_id = v.into();
4963        self
4964    }
4965
4966    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
4967    ///
4968    /// # Example
4969    /// ```ignore,no_run
4970    /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4971    /// use google_cloud_securesourcemanager_v1::model::Instance;
4972    /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
4973    /// ```
4974    pub fn set_instance<T>(mut self, v: T) -> Self
4975    where
4976        T: std::convert::Into<crate::model::Instance>,
4977    {
4978        self.instance = std::option::Option::Some(v.into());
4979        self
4980    }
4981
4982    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
4983    ///
4984    /// # Example
4985    /// ```ignore,no_run
4986    /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4987    /// use google_cloud_securesourcemanager_v1::model::Instance;
4988    /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
4989    /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
4990    /// ```
4991    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
4992    where
4993        T: std::convert::Into<crate::model::Instance>,
4994    {
4995        self.instance = v.map(|x| x.into());
4996        self
4997    }
4998
4999    /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
5000    ///
5001    /// # Example
5002    /// ```ignore,no_run
5003    /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
5004    /// let x = CreateInstanceRequest::new().set_request_id("example");
5005    /// ```
5006    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5007        self.request_id = v.into();
5008        self
5009    }
5010}
5011
5012impl wkt::message::Message for CreateInstanceRequest {
5013    fn typename() -> &'static str {
5014        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateInstanceRequest"
5015    }
5016}
5017
5018/// DeleteInstanceRequest is the request for deleting an instance.
5019#[derive(Clone, Default, PartialEq)]
5020#[non_exhaustive]
5021pub struct DeleteInstanceRequest {
5022    /// Required. Name of the resource.
5023    pub name: std::string::String,
5024
5025    /// Optional. An optional request ID to identify requests. Specify a unique
5026    /// request ID so that if you must retry your request, the server will know to
5027    /// ignore the request if it has already been completed. The server will
5028    /// guarantee that for at least 60 minutes after the first request.
5029    ///
5030    /// For example, consider a situation where you make an initial request and
5031    /// the request times out. If you make the request again with the same request
5032    /// ID, the server can check if original operation with the same request ID
5033    /// was received, and if so, will ignore the second request. This prevents
5034    /// clients from accidentally creating duplicate commitments.
5035    ///
5036    /// The request ID must be a valid UUID with the exception that zero UUID is
5037    /// not supported (00000000-0000-0000-0000-000000000000).
5038    pub request_id: std::string::String,
5039
5040    /// Optional. If set to true, will force the deletion of the instance.
5041    pub force: bool,
5042
5043    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5044}
5045
5046impl DeleteInstanceRequest {
5047    /// Creates a new default instance.
5048    pub fn new() -> Self {
5049        std::default::Default::default()
5050    }
5051
5052    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
5053    ///
5054    /// # Example
5055    /// ```ignore,no_run
5056    /// # use google_cloud_securesourcemanager_v1::model::DeleteInstanceRequest;
5057    /// # let project_id = "project_id";
5058    /// # let location_id = "location_id";
5059    /// # let instance_id = "instance_id";
5060    /// let x = DeleteInstanceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
5061    /// ```
5062    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5063        self.name = v.into();
5064        self
5065    }
5066
5067    /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
5068    ///
5069    /// # Example
5070    /// ```ignore,no_run
5071    /// # use google_cloud_securesourcemanager_v1::model::DeleteInstanceRequest;
5072    /// let x = DeleteInstanceRequest::new().set_request_id("example");
5073    /// ```
5074    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5075        self.request_id = v.into();
5076        self
5077    }
5078
5079    /// Sets the value of [force][crate::model::DeleteInstanceRequest::force].
5080    ///
5081    /// # Example
5082    /// ```ignore,no_run
5083    /// # use google_cloud_securesourcemanager_v1::model::DeleteInstanceRequest;
5084    /// let x = DeleteInstanceRequest::new().set_force(true);
5085    /// ```
5086    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5087        self.force = v.into();
5088        self
5089    }
5090}
5091
5092impl wkt::message::Message for DeleteInstanceRequest {
5093    fn typename() -> &'static str {
5094        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteInstanceRequest"
5095    }
5096}
5097
5098/// Represents the metadata of the long-running operation.
5099#[derive(Clone, Default, PartialEq)]
5100#[non_exhaustive]
5101pub struct OperationMetadata {
5102    /// Output only. The time the operation was created.
5103    pub create_time: std::option::Option<wkt::Timestamp>,
5104
5105    /// Output only. The time the operation finished running.
5106    pub end_time: std::option::Option<wkt::Timestamp>,
5107
5108    /// Output only. Server-defined resource path for the target of the operation.
5109    pub target: std::string::String,
5110
5111    /// Output only. Name of the verb executed by the operation.
5112    pub verb: std::string::String,
5113
5114    /// Output only. Human-readable status of the operation, if any.
5115    pub status_message: std::string::String,
5116
5117    /// Output only. Identifies whether the user has requested cancellation
5118    /// of the operation. Operations that have successfully been cancelled
5119    /// have [Operation.error][google.longrunning.Operation.error] value with a
5120    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
5121    /// `Code.CANCELLED`.
5122    ///
5123    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
5124    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
5125    pub requested_cancellation: bool,
5126
5127    /// Output only. API version used to start the operation.
5128    pub api_version: std::string::String,
5129
5130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5131}
5132
5133impl OperationMetadata {
5134    /// Creates a new default instance.
5135    pub fn new() -> Self {
5136        std::default::Default::default()
5137    }
5138
5139    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
5140    ///
5141    /// # Example
5142    /// ```ignore,no_run
5143    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5144    /// use wkt::Timestamp;
5145    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
5146    /// ```
5147    pub fn set_create_time<T>(mut self, v: T) -> Self
5148    where
5149        T: std::convert::Into<wkt::Timestamp>,
5150    {
5151        self.create_time = std::option::Option::Some(v.into());
5152        self
5153    }
5154
5155    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
5156    ///
5157    /// # Example
5158    /// ```ignore,no_run
5159    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5160    /// use wkt::Timestamp;
5161    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5162    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
5163    /// ```
5164    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5165    where
5166        T: std::convert::Into<wkt::Timestamp>,
5167    {
5168        self.create_time = v.map(|x| x.into());
5169        self
5170    }
5171
5172    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
5173    ///
5174    /// # Example
5175    /// ```ignore,no_run
5176    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5177    /// use wkt::Timestamp;
5178    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5179    /// ```
5180    pub fn set_end_time<T>(mut self, v: T) -> Self
5181    where
5182        T: std::convert::Into<wkt::Timestamp>,
5183    {
5184        self.end_time = std::option::Option::Some(v.into());
5185        self
5186    }
5187
5188    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
5189    ///
5190    /// # Example
5191    /// ```ignore,no_run
5192    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5193    /// use wkt::Timestamp;
5194    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5195    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5196    /// ```
5197    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5198    where
5199        T: std::convert::Into<wkt::Timestamp>,
5200    {
5201        self.end_time = v.map(|x| x.into());
5202        self
5203    }
5204
5205    /// Sets the value of [target][crate::model::OperationMetadata::target].
5206    ///
5207    /// # Example
5208    /// ```ignore,no_run
5209    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5210    /// let x = OperationMetadata::new().set_target("example");
5211    /// ```
5212    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5213        self.target = v.into();
5214        self
5215    }
5216
5217    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
5218    ///
5219    /// # Example
5220    /// ```ignore,no_run
5221    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5222    /// let x = OperationMetadata::new().set_verb("example");
5223    /// ```
5224    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5225        self.verb = v.into();
5226        self
5227    }
5228
5229    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
5230    ///
5231    /// # Example
5232    /// ```ignore,no_run
5233    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5234    /// let x = OperationMetadata::new().set_status_message("example");
5235    /// ```
5236    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5237        self.status_message = v.into();
5238        self
5239    }
5240
5241    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
5242    ///
5243    /// # Example
5244    /// ```ignore,no_run
5245    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5246    /// let x = OperationMetadata::new().set_requested_cancellation(true);
5247    /// ```
5248    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5249        self.requested_cancellation = v.into();
5250        self
5251    }
5252
5253    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
5254    ///
5255    /// # Example
5256    /// ```ignore,no_run
5257    /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
5258    /// let x = OperationMetadata::new().set_api_version("example");
5259    /// ```
5260    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5261        self.api_version = v.into();
5262        self
5263    }
5264}
5265
5266impl wkt::message::Message for OperationMetadata {
5267    fn typename() -> &'static str {
5268        "type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata"
5269    }
5270}
5271
5272/// ListRepositoriesRequest is request to list repositories.
5273#[derive(Clone, Default, PartialEq)]
5274#[non_exhaustive]
5275pub struct ListRepositoriesRequest {
5276    /// Required. Parent value for ListRepositoriesRequest.
5277    pub parent: std::string::String,
5278
5279    /// Optional. Requested page size. If unspecified, a default size of 30 will be
5280    /// used. The maximum value is 100; values above 100 will be coerced to 100.
5281    pub page_size: i32,
5282
5283    /// Optional. A token identifying a page of results the server should return.
5284    pub page_token: std::string::String,
5285
5286    /// Optional. Filter results.
5287    pub filter: std::string::String,
5288
5289    /// Optional. The name of the instance in which the repository is hosted,
5290    /// formatted as
5291    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`.
5292    /// When listing repositories via securesourcemanager.googleapis.com, this
5293    /// field is required. When listing repositories via *.sourcemanager.dev, this
5294    /// field is ignored.
5295    pub instance: std::string::String,
5296
5297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5298}
5299
5300impl ListRepositoriesRequest {
5301    /// Creates a new default instance.
5302    pub fn new() -> Self {
5303        std::default::Default::default()
5304    }
5305
5306    /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
5307    ///
5308    /// # Example
5309    /// ```ignore,no_run
5310    /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
5311    /// # let project_id = "project_id";
5312    /// # let location_id = "location_id";
5313    /// let x = ListRepositoriesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5314    /// ```
5315    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5316        self.parent = v.into();
5317        self
5318    }
5319
5320    /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
5321    ///
5322    /// # Example
5323    /// ```ignore,no_run
5324    /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
5325    /// let x = ListRepositoriesRequest::new().set_page_size(42);
5326    /// ```
5327    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5328        self.page_size = v.into();
5329        self
5330    }
5331
5332    /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
5333    ///
5334    /// # Example
5335    /// ```ignore,no_run
5336    /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
5337    /// let x = ListRepositoriesRequest::new().set_page_token("example");
5338    /// ```
5339    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5340        self.page_token = v.into();
5341        self
5342    }
5343
5344    /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
5345    ///
5346    /// # Example
5347    /// ```ignore,no_run
5348    /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
5349    /// let x = ListRepositoriesRequest::new().set_filter("example");
5350    /// ```
5351    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5352        self.filter = v.into();
5353        self
5354    }
5355
5356    /// Sets the value of [instance][crate::model::ListRepositoriesRequest::instance].
5357    ///
5358    /// # Example
5359    /// ```ignore,no_run
5360    /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
5361    /// # let project_id = "project_id";
5362    /// # let location_id = "location_id";
5363    /// # let instance_id = "instance_id";
5364    /// let x = ListRepositoriesRequest::new().set_instance(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"));
5365    /// ```
5366    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5367        self.instance = v.into();
5368        self
5369    }
5370}
5371
5372impl wkt::message::Message for ListRepositoriesRequest {
5373    fn typename() -> &'static str {
5374        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListRepositoriesRequest"
5375    }
5376}
5377
5378#[allow(missing_docs)]
5379#[derive(Clone, Default, PartialEq)]
5380#[non_exhaustive]
5381pub struct ListRepositoriesResponse {
5382    /// The list of repositories.
5383    pub repositories: std::vec::Vec<crate::model::Repository>,
5384
5385    /// A token identifying a page of results the server should return.
5386    pub next_page_token: std::string::String,
5387
5388    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5389}
5390
5391impl ListRepositoriesResponse {
5392    /// Creates a new default instance.
5393    pub fn new() -> Self {
5394        std::default::Default::default()
5395    }
5396
5397    /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
5398    ///
5399    /// # Example
5400    /// ```ignore,no_run
5401    /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesResponse;
5402    /// use google_cloud_securesourcemanager_v1::model::Repository;
5403    /// let x = ListRepositoriesResponse::new()
5404    ///     .set_repositories([
5405    ///         Repository::default()/* use setters */,
5406    ///         Repository::default()/* use (different) setters */,
5407    ///     ]);
5408    /// ```
5409    pub fn set_repositories<T, V>(mut self, v: T) -> Self
5410    where
5411        T: std::iter::IntoIterator<Item = V>,
5412        V: std::convert::Into<crate::model::Repository>,
5413    {
5414        use std::iter::Iterator;
5415        self.repositories = v.into_iter().map(|i| i.into()).collect();
5416        self
5417    }
5418
5419    /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
5420    ///
5421    /// # Example
5422    /// ```ignore,no_run
5423    /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesResponse;
5424    /// let x = ListRepositoriesResponse::new().set_next_page_token("example");
5425    /// ```
5426    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5427        self.next_page_token = v.into();
5428        self
5429    }
5430}
5431
5432impl wkt::message::Message for ListRepositoriesResponse {
5433    fn typename() -> &'static str {
5434        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListRepositoriesResponse"
5435    }
5436}
5437
5438#[doc(hidden)]
5439impl google_cloud_gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
5440    type PageItem = crate::model::Repository;
5441
5442    fn items(self) -> std::vec::Vec<Self::PageItem> {
5443        self.repositories
5444    }
5445
5446    fn next_page_token(&self) -> std::string::String {
5447        use std::clone::Clone;
5448        self.next_page_token.clone()
5449    }
5450}
5451
5452/// GetRepositoryRequest is the request for getting a repository.
5453#[derive(Clone, Default, PartialEq)]
5454#[non_exhaustive]
5455pub struct GetRepositoryRequest {
5456    /// Required. Name of the repository to retrieve.
5457    /// The format is
5458    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
5459    pub name: std::string::String,
5460
5461    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5462}
5463
5464impl GetRepositoryRequest {
5465    /// Creates a new default instance.
5466    pub fn new() -> Self {
5467        std::default::Default::default()
5468    }
5469
5470    /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
5471    ///
5472    /// # Example
5473    /// ```ignore,no_run
5474    /// # use google_cloud_securesourcemanager_v1::model::GetRepositoryRequest;
5475    /// # let project_id = "project_id";
5476    /// # let location_id = "location_id";
5477    /// # let repository_id = "repository_id";
5478    /// let x = GetRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
5479    /// ```
5480    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5481        self.name = v.into();
5482        self
5483    }
5484}
5485
5486impl wkt::message::Message for GetRepositoryRequest {
5487    fn typename() -> &'static str {
5488        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetRepositoryRequest"
5489    }
5490}
5491
5492/// CreateRepositoryRequest is the request for creating a repository.
5493#[derive(Clone, Default, PartialEq)]
5494#[non_exhaustive]
5495pub struct CreateRepositoryRequest {
5496    /// Required. The project in which to create the repository. Values are of the
5497    /// form `projects/{project_number}/locations/{location_id}`
5498    pub parent: std::string::String,
5499
5500    /// Required. The resource being created.
5501    pub repository: std::option::Option<crate::model::Repository>,
5502
5503    /// Required. The ID to use for the repository, which will become the final
5504    /// component of the repository's resource name. This value should be 4-63
5505    /// characters, and valid characters are /[a-z][0-9]-/.
5506    pub repository_id: std::string::String,
5507
5508    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5509}
5510
5511impl CreateRepositoryRequest {
5512    /// Creates a new default instance.
5513    pub fn new() -> Self {
5514        std::default::Default::default()
5515    }
5516
5517    /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
5518    ///
5519    /// # Example
5520    /// ```ignore,no_run
5521    /// # use google_cloud_securesourcemanager_v1::model::CreateRepositoryRequest;
5522    /// # let project_id = "project_id";
5523    /// # let location_id = "location_id";
5524    /// let x = CreateRepositoryRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5525    /// ```
5526    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5527        self.parent = v.into();
5528        self
5529    }
5530
5531    /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
5532    ///
5533    /// # Example
5534    /// ```ignore,no_run
5535    /// # use google_cloud_securesourcemanager_v1::model::CreateRepositoryRequest;
5536    /// use google_cloud_securesourcemanager_v1::model::Repository;
5537    /// let x = CreateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
5538    /// ```
5539    pub fn set_repository<T>(mut self, v: T) -> Self
5540    where
5541        T: std::convert::Into<crate::model::Repository>,
5542    {
5543        self.repository = std::option::Option::Some(v.into());
5544        self
5545    }
5546
5547    /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
5548    ///
5549    /// # Example
5550    /// ```ignore,no_run
5551    /// # use google_cloud_securesourcemanager_v1::model::CreateRepositoryRequest;
5552    /// use google_cloud_securesourcemanager_v1::model::Repository;
5553    /// let x = CreateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
5554    /// let x = CreateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
5555    /// ```
5556    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
5557    where
5558        T: std::convert::Into<crate::model::Repository>,
5559    {
5560        self.repository = v.map(|x| x.into());
5561        self
5562    }
5563
5564    /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
5565    ///
5566    /// # Example
5567    /// ```ignore,no_run
5568    /// # use google_cloud_securesourcemanager_v1::model::CreateRepositoryRequest;
5569    /// let x = CreateRepositoryRequest::new().set_repository_id("example");
5570    /// ```
5571    pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5572        self.repository_id = v.into();
5573        self
5574    }
5575}
5576
5577impl wkt::message::Message for CreateRepositoryRequest {
5578    fn typename() -> &'static str {
5579        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateRepositoryRequest"
5580    }
5581}
5582
5583/// UpdateRepositoryRequest is the request to update a repository.
5584#[derive(Clone, Default, PartialEq)]
5585#[non_exhaustive]
5586pub struct UpdateRepositoryRequest {
5587    /// Optional. Field mask is used to specify the fields to be overwritten in the
5588    /// repository resource by the update.
5589    /// The fields specified in the update_mask are relative to the resource, not
5590    /// the full request. A field will be overwritten if it is in the mask. If the
5591    /// user does not provide a mask then all fields will be overwritten.
5592    pub update_mask: std::option::Option<wkt::FieldMask>,
5593
5594    /// Required. The repository being updated.
5595    pub repository: std::option::Option<crate::model::Repository>,
5596
5597    /// Optional. False by default. If set to true, the request is validated and
5598    /// the user is provided with an expected result, but no actual change is made.
5599    pub validate_only: bool,
5600
5601    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5602}
5603
5604impl UpdateRepositoryRequest {
5605    /// Creates a new default instance.
5606    pub fn new() -> Self {
5607        std::default::Default::default()
5608    }
5609
5610    /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
5611    ///
5612    /// # Example
5613    /// ```ignore,no_run
5614    /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5615    /// use wkt::FieldMask;
5616    /// let x = UpdateRepositoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5617    /// ```
5618    pub fn set_update_mask<T>(mut self, v: T) -> Self
5619    where
5620        T: std::convert::Into<wkt::FieldMask>,
5621    {
5622        self.update_mask = std::option::Option::Some(v.into());
5623        self
5624    }
5625
5626    /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
5627    ///
5628    /// # Example
5629    /// ```ignore,no_run
5630    /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5631    /// use wkt::FieldMask;
5632    /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5633    /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5634    /// ```
5635    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5636    where
5637        T: std::convert::Into<wkt::FieldMask>,
5638    {
5639        self.update_mask = v.map(|x| x.into());
5640        self
5641    }
5642
5643    /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
5644    ///
5645    /// # Example
5646    /// ```ignore,no_run
5647    /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5648    /// use google_cloud_securesourcemanager_v1::model::Repository;
5649    /// let x = UpdateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
5650    /// ```
5651    pub fn set_repository<T>(mut self, v: T) -> Self
5652    where
5653        T: std::convert::Into<crate::model::Repository>,
5654    {
5655        self.repository = std::option::Option::Some(v.into());
5656        self
5657    }
5658
5659    /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
5660    ///
5661    /// # Example
5662    /// ```ignore,no_run
5663    /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5664    /// use google_cloud_securesourcemanager_v1::model::Repository;
5665    /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
5666    /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
5667    /// ```
5668    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
5669    where
5670        T: std::convert::Into<crate::model::Repository>,
5671    {
5672        self.repository = v.map(|x| x.into());
5673        self
5674    }
5675
5676    /// Sets the value of [validate_only][crate::model::UpdateRepositoryRequest::validate_only].
5677    ///
5678    /// # Example
5679    /// ```ignore,no_run
5680    /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5681    /// let x = UpdateRepositoryRequest::new().set_validate_only(true);
5682    /// ```
5683    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5684        self.validate_only = v.into();
5685        self
5686    }
5687}
5688
5689impl wkt::message::Message for UpdateRepositoryRequest {
5690    fn typename() -> &'static str {
5691        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateRepositoryRequest"
5692    }
5693}
5694
5695/// DeleteRepositoryRequest is the request to delete a repository.
5696#[derive(Clone, Default, PartialEq)]
5697#[non_exhaustive]
5698pub struct DeleteRepositoryRequest {
5699    /// Required. Name of the repository to delete.
5700    /// The format is
5701    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
5702    pub name: std::string::String,
5703
5704    /// Optional. If set to true, and the repository is not found, the request will
5705    /// succeed but no action will be taken on the server.
5706    pub allow_missing: bool,
5707
5708    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5709}
5710
5711impl DeleteRepositoryRequest {
5712    /// Creates a new default instance.
5713    pub fn new() -> Self {
5714        std::default::Default::default()
5715    }
5716
5717    /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
5718    ///
5719    /// # Example
5720    /// ```ignore,no_run
5721    /// # use google_cloud_securesourcemanager_v1::model::DeleteRepositoryRequest;
5722    /// # let project_id = "project_id";
5723    /// # let location_id = "location_id";
5724    /// # let repository_id = "repository_id";
5725    /// let x = DeleteRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
5726    /// ```
5727    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5728        self.name = v.into();
5729        self
5730    }
5731
5732    /// Sets the value of [allow_missing][crate::model::DeleteRepositoryRequest::allow_missing].
5733    ///
5734    /// # Example
5735    /// ```ignore,no_run
5736    /// # use google_cloud_securesourcemanager_v1::model::DeleteRepositoryRequest;
5737    /// let x = DeleteRepositoryRequest::new().set_allow_missing(true);
5738    /// ```
5739    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5740        self.allow_missing = v.into();
5741        self
5742    }
5743}
5744
5745impl wkt::message::Message for DeleteRepositoryRequest {
5746    fn typename() -> &'static str {
5747        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteRepositoryRequest"
5748    }
5749}
5750
5751/// ListHooksRequest is request to list hooks.
5752#[derive(Clone, Default, PartialEq)]
5753#[non_exhaustive]
5754pub struct ListHooksRequest {
5755    /// Required. Parent value for ListHooksRequest.
5756    pub parent: std::string::String,
5757
5758    /// Optional. Requested page size. If unspecified, a default size of 30 will be
5759    /// used. The maximum value is 100; values above 100 will be coerced to 100.
5760    pub page_size: i32,
5761
5762    /// Optional. A token identifying a page of results the server should return.
5763    pub page_token: std::string::String,
5764
5765    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5766}
5767
5768impl ListHooksRequest {
5769    /// Creates a new default instance.
5770    pub fn new() -> Self {
5771        std::default::Default::default()
5772    }
5773
5774    /// Sets the value of [parent][crate::model::ListHooksRequest::parent].
5775    ///
5776    /// # Example
5777    /// ```ignore,no_run
5778    /// # use google_cloud_securesourcemanager_v1::model::ListHooksRequest;
5779    /// # let project_id = "project_id";
5780    /// # let location_id = "location_id";
5781    /// # let repository_id = "repository_id";
5782    /// let x = ListHooksRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
5783    /// ```
5784    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5785        self.parent = v.into();
5786        self
5787    }
5788
5789    /// Sets the value of [page_size][crate::model::ListHooksRequest::page_size].
5790    ///
5791    /// # Example
5792    /// ```ignore,no_run
5793    /// # use google_cloud_securesourcemanager_v1::model::ListHooksRequest;
5794    /// let x = ListHooksRequest::new().set_page_size(42);
5795    /// ```
5796    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5797        self.page_size = v.into();
5798        self
5799    }
5800
5801    /// Sets the value of [page_token][crate::model::ListHooksRequest::page_token].
5802    ///
5803    /// # Example
5804    /// ```ignore,no_run
5805    /// # use google_cloud_securesourcemanager_v1::model::ListHooksRequest;
5806    /// let x = ListHooksRequest::new().set_page_token("example");
5807    /// ```
5808    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5809        self.page_token = v.into();
5810        self
5811    }
5812}
5813
5814impl wkt::message::Message for ListHooksRequest {
5815    fn typename() -> &'static str {
5816        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListHooksRequest"
5817    }
5818}
5819
5820/// ListHooksResponse is response to list hooks.
5821#[derive(Clone, Default, PartialEq)]
5822#[non_exhaustive]
5823pub struct ListHooksResponse {
5824    /// The list of hooks.
5825    pub hooks: std::vec::Vec<crate::model::Hook>,
5826
5827    /// A token identifying a page of results the server should return.
5828    pub next_page_token: std::string::String,
5829
5830    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5831}
5832
5833impl ListHooksResponse {
5834    /// Creates a new default instance.
5835    pub fn new() -> Self {
5836        std::default::Default::default()
5837    }
5838
5839    /// Sets the value of [hooks][crate::model::ListHooksResponse::hooks].
5840    ///
5841    /// # Example
5842    /// ```ignore,no_run
5843    /// # use google_cloud_securesourcemanager_v1::model::ListHooksResponse;
5844    /// use google_cloud_securesourcemanager_v1::model::Hook;
5845    /// let x = ListHooksResponse::new()
5846    ///     .set_hooks([
5847    ///         Hook::default()/* use setters */,
5848    ///         Hook::default()/* use (different) setters */,
5849    ///     ]);
5850    /// ```
5851    pub fn set_hooks<T, V>(mut self, v: T) -> Self
5852    where
5853        T: std::iter::IntoIterator<Item = V>,
5854        V: std::convert::Into<crate::model::Hook>,
5855    {
5856        use std::iter::Iterator;
5857        self.hooks = v.into_iter().map(|i| i.into()).collect();
5858        self
5859    }
5860
5861    /// Sets the value of [next_page_token][crate::model::ListHooksResponse::next_page_token].
5862    ///
5863    /// # Example
5864    /// ```ignore,no_run
5865    /// # use google_cloud_securesourcemanager_v1::model::ListHooksResponse;
5866    /// let x = ListHooksResponse::new().set_next_page_token("example");
5867    /// ```
5868    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5869        self.next_page_token = v.into();
5870        self
5871    }
5872}
5873
5874impl wkt::message::Message for ListHooksResponse {
5875    fn typename() -> &'static str {
5876        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListHooksResponse"
5877    }
5878}
5879
5880#[doc(hidden)]
5881impl google_cloud_gax::paginator::internal::PageableResponse for ListHooksResponse {
5882    type PageItem = crate::model::Hook;
5883
5884    fn items(self) -> std::vec::Vec<Self::PageItem> {
5885        self.hooks
5886    }
5887
5888    fn next_page_token(&self) -> std::string::String {
5889        use std::clone::Clone;
5890        self.next_page_token.clone()
5891    }
5892}
5893
5894/// GetHookRequest is the request for getting a hook.
5895#[derive(Clone, Default, PartialEq)]
5896#[non_exhaustive]
5897pub struct GetHookRequest {
5898    /// Required. Name of the hook to retrieve.
5899    /// The format is
5900    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`.
5901    pub name: std::string::String,
5902
5903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5904}
5905
5906impl GetHookRequest {
5907    /// Creates a new default instance.
5908    pub fn new() -> Self {
5909        std::default::Default::default()
5910    }
5911
5912    /// Sets the value of [name][crate::model::GetHookRequest::name].
5913    ///
5914    /// # Example
5915    /// ```ignore,no_run
5916    /// # use google_cloud_securesourcemanager_v1::model::GetHookRequest;
5917    /// # let project_id = "project_id";
5918    /// # let location_id = "location_id";
5919    /// # let repository_id = "repository_id";
5920    /// # let hook_id = "hook_id";
5921    /// let x = GetHookRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}"));
5922    /// ```
5923    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5924        self.name = v.into();
5925        self
5926    }
5927}
5928
5929impl wkt::message::Message for GetHookRequest {
5930    fn typename() -> &'static str {
5931        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetHookRequest"
5932    }
5933}
5934
5935/// CreateHookRequest is the request for creating a hook.
5936#[derive(Clone, Default, PartialEq)]
5937#[non_exhaustive]
5938pub struct CreateHookRequest {
5939    /// Required. The repository in which to create the hook. Values are of the
5940    /// form
5941    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
5942    pub parent: std::string::String,
5943
5944    /// Required. The resource being created.
5945    pub hook: std::option::Option<crate::model::Hook>,
5946
5947    /// Required. The ID to use for the hook, which will become the final component
5948    /// of the hook's resource name. This value restricts to lower-case letters,
5949    /// numbers, and hyphen, with the first character a letter, the last a letter
5950    /// or a number, and a 63 character maximum.
5951    pub hook_id: std::string::String,
5952
5953    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5954}
5955
5956impl CreateHookRequest {
5957    /// Creates a new default instance.
5958    pub fn new() -> Self {
5959        std::default::Default::default()
5960    }
5961
5962    /// Sets the value of [parent][crate::model::CreateHookRequest::parent].
5963    ///
5964    /// # Example
5965    /// ```ignore,no_run
5966    /// # use google_cloud_securesourcemanager_v1::model::CreateHookRequest;
5967    /// # let project_id = "project_id";
5968    /// # let location_id = "location_id";
5969    /// # let repository_id = "repository_id";
5970    /// let x = CreateHookRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
5971    /// ```
5972    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5973        self.parent = v.into();
5974        self
5975    }
5976
5977    /// Sets the value of [hook][crate::model::CreateHookRequest::hook].
5978    ///
5979    /// # Example
5980    /// ```ignore,no_run
5981    /// # use google_cloud_securesourcemanager_v1::model::CreateHookRequest;
5982    /// use google_cloud_securesourcemanager_v1::model::Hook;
5983    /// let x = CreateHookRequest::new().set_hook(Hook::default()/* use setters */);
5984    /// ```
5985    pub fn set_hook<T>(mut self, v: T) -> Self
5986    where
5987        T: std::convert::Into<crate::model::Hook>,
5988    {
5989        self.hook = std::option::Option::Some(v.into());
5990        self
5991    }
5992
5993    /// Sets or clears the value of [hook][crate::model::CreateHookRequest::hook].
5994    ///
5995    /// # Example
5996    /// ```ignore,no_run
5997    /// # use google_cloud_securesourcemanager_v1::model::CreateHookRequest;
5998    /// use google_cloud_securesourcemanager_v1::model::Hook;
5999    /// let x = CreateHookRequest::new().set_or_clear_hook(Some(Hook::default()/* use setters */));
6000    /// let x = CreateHookRequest::new().set_or_clear_hook(None::<Hook>);
6001    /// ```
6002    pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
6003    where
6004        T: std::convert::Into<crate::model::Hook>,
6005    {
6006        self.hook = v.map(|x| x.into());
6007        self
6008    }
6009
6010    /// Sets the value of [hook_id][crate::model::CreateHookRequest::hook_id].
6011    ///
6012    /// # Example
6013    /// ```ignore,no_run
6014    /// # use google_cloud_securesourcemanager_v1::model::CreateHookRequest;
6015    /// let x = CreateHookRequest::new().set_hook_id("example");
6016    /// ```
6017    pub fn set_hook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6018        self.hook_id = v.into();
6019        self
6020    }
6021}
6022
6023impl wkt::message::Message for CreateHookRequest {
6024    fn typename() -> &'static str {
6025        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateHookRequest"
6026    }
6027}
6028
6029/// UpdateHookRequest is the request to update a hook.
6030#[derive(Clone, Default, PartialEq)]
6031#[non_exhaustive]
6032pub struct UpdateHookRequest {
6033    /// Optional. Field mask is used to specify the fields to be overwritten in the
6034    /// hook resource by the update.
6035    /// The fields specified in the update_mask are relative to the resource, not
6036    /// the full request. A field will be overwritten if it is in the mask.
6037    /// The special value "*" means full replacement.
6038    pub update_mask: std::option::Option<wkt::FieldMask>,
6039
6040    /// Required. The hook being updated.
6041    pub hook: std::option::Option<crate::model::Hook>,
6042
6043    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6044}
6045
6046impl UpdateHookRequest {
6047    /// Creates a new default instance.
6048    pub fn new() -> Self {
6049        std::default::Default::default()
6050    }
6051
6052    /// Sets the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
6053    ///
6054    /// # Example
6055    /// ```ignore,no_run
6056    /// # use google_cloud_securesourcemanager_v1::model::UpdateHookRequest;
6057    /// use wkt::FieldMask;
6058    /// let x = UpdateHookRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6059    /// ```
6060    pub fn set_update_mask<T>(mut self, v: T) -> Self
6061    where
6062        T: std::convert::Into<wkt::FieldMask>,
6063    {
6064        self.update_mask = std::option::Option::Some(v.into());
6065        self
6066    }
6067
6068    /// Sets or clears the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
6069    ///
6070    /// # Example
6071    /// ```ignore,no_run
6072    /// # use google_cloud_securesourcemanager_v1::model::UpdateHookRequest;
6073    /// use wkt::FieldMask;
6074    /// let x = UpdateHookRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6075    /// let x = UpdateHookRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6076    /// ```
6077    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6078    where
6079        T: std::convert::Into<wkt::FieldMask>,
6080    {
6081        self.update_mask = v.map(|x| x.into());
6082        self
6083    }
6084
6085    /// Sets the value of [hook][crate::model::UpdateHookRequest::hook].
6086    ///
6087    /// # Example
6088    /// ```ignore,no_run
6089    /// # use google_cloud_securesourcemanager_v1::model::UpdateHookRequest;
6090    /// use google_cloud_securesourcemanager_v1::model::Hook;
6091    /// let x = UpdateHookRequest::new().set_hook(Hook::default()/* use setters */);
6092    /// ```
6093    pub fn set_hook<T>(mut self, v: T) -> Self
6094    where
6095        T: std::convert::Into<crate::model::Hook>,
6096    {
6097        self.hook = std::option::Option::Some(v.into());
6098        self
6099    }
6100
6101    /// Sets or clears the value of [hook][crate::model::UpdateHookRequest::hook].
6102    ///
6103    /// # Example
6104    /// ```ignore,no_run
6105    /// # use google_cloud_securesourcemanager_v1::model::UpdateHookRequest;
6106    /// use google_cloud_securesourcemanager_v1::model::Hook;
6107    /// let x = UpdateHookRequest::new().set_or_clear_hook(Some(Hook::default()/* use setters */));
6108    /// let x = UpdateHookRequest::new().set_or_clear_hook(None::<Hook>);
6109    /// ```
6110    pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
6111    where
6112        T: std::convert::Into<crate::model::Hook>,
6113    {
6114        self.hook = v.map(|x| x.into());
6115        self
6116    }
6117}
6118
6119impl wkt::message::Message for UpdateHookRequest {
6120    fn typename() -> &'static str {
6121        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateHookRequest"
6122    }
6123}
6124
6125/// DeleteHookRequest is the request to delete a hook.
6126#[derive(Clone, Default, PartialEq)]
6127#[non_exhaustive]
6128pub struct DeleteHookRequest {
6129    /// Required. Name of the hook to delete.
6130    /// The format is
6131    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`.
6132    pub name: std::string::String,
6133
6134    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6135}
6136
6137impl DeleteHookRequest {
6138    /// Creates a new default instance.
6139    pub fn new() -> Self {
6140        std::default::Default::default()
6141    }
6142
6143    /// Sets the value of [name][crate::model::DeleteHookRequest::name].
6144    ///
6145    /// # Example
6146    /// ```ignore,no_run
6147    /// # use google_cloud_securesourcemanager_v1::model::DeleteHookRequest;
6148    /// # let project_id = "project_id";
6149    /// # let location_id = "location_id";
6150    /// # let repository_id = "repository_id";
6151    /// # let hook_id = "hook_id";
6152    /// let x = DeleteHookRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}"));
6153    /// ```
6154    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6155        self.name = v.into();
6156        self
6157    }
6158}
6159
6160impl wkt::message::Message for DeleteHookRequest {
6161    fn typename() -> &'static str {
6162        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteHookRequest"
6163    }
6164}
6165
6166/// GetBranchRuleRequest is the request for getting a branch rule.
6167#[derive(Clone, Default, PartialEq)]
6168#[non_exhaustive]
6169pub struct GetBranchRuleRequest {
6170    /// Required. Name of the repository to retrieve.
6171    /// The format is
6172    /// `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`.
6173    pub name: std::string::String,
6174
6175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6176}
6177
6178impl GetBranchRuleRequest {
6179    /// Creates a new default instance.
6180    pub fn new() -> Self {
6181        std::default::Default::default()
6182    }
6183
6184    /// Sets the value of [name][crate::model::GetBranchRuleRequest::name].
6185    ///
6186    /// # Example
6187    /// ```ignore,no_run
6188    /// # use google_cloud_securesourcemanager_v1::model::GetBranchRuleRequest;
6189    /// # let project_id = "project_id";
6190    /// # let location_id = "location_id";
6191    /// # let repository_id = "repository_id";
6192    /// # let branch_rule_id = "branch_rule_id";
6193    /// let x = GetBranchRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/branchRules/{branch_rule_id}"));
6194    /// ```
6195    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6196        self.name = v.into();
6197        self
6198    }
6199}
6200
6201impl wkt::message::Message for GetBranchRuleRequest {
6202    fn typename() -> &'static str {
6203        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetBranchRuleRequest"
6204    }
6205}
6206
6207/// CreateBranchRuleRequest is the request to create a branch rule.
6208#[derive(Clone, Default, PartialEq)]
6209#[non_exhaustive]
6210pub struct CreateBranchRuleRequest {
6211    #[allow(missing_docs)]
6212    pub parent: std::string::String,
6213
6214    #[allow(missing_docs)]
6215    pub branch_rule: std::option::Option<crate::model::BranchRule>,
6216
6217    #[allow(missing_docs)]
6218    pub branch_rule_id: std::string::String,
6219
6220    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6221}
6222
6223impl CreateBranchRuleRequest {
6224    /// Creates a new default instance.
6225    pub fn new() -> Self {
6226        std::default::Default::default()
6227    }
6228
6229    /// Sets the value of [parent][crate::model::CreateBranchRuleRequest::parent].
6230    ///
6231    /// # Example
6232    /// ```ignore,no_run
6233    /// # use google_cloud_securesourcemanager_v1::model::CreateBranchRuleRequest;
6234    /// # let project_id = "project_id";
6235    /// # let location_id = "location_id";
6236    /// # let repository_id = "repository_id";
6237    /// let x = CreateBranchRuleRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
6238    /// ```
6239    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6240        self.parent = v.into();
6241        self
6242    }
6243
6244    /// Sets the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
6245    ///
6246    /// # Example
6247    /// ```ignore,no_run
6248    /// # use google_cloud_securesourcemanager_v1::model::CreateBranchRuleRequest;
6249    /// use google_cloud_securesourcemanager_v1::model::BranchRule;
6250    /// let x = CreateBranchRuleRequest::new().set_branch_rule(BranchRule::default()/* use setters */);
6251    /// ```
6252    pub fn set_branch_rule<T>(mut self, v: T) -> Self
6253    where
6254        T: std::convert::Into<crate::model::BranchRule>,
6255    {
6256        self.branch_rule = std::option::Option::Some(v.into());
6257        self
6258    }
6259
6260    /// Sets or clears the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
6261    ///
6262    /// # Example
6263    /// ```ignore,no_run
6264    /// # use google_cloud_securesourcemanager_v1::model::CreateBranchRuleRequest;
6265    /// use google_cloud_securesourcemanager_v1::model::BranchRule;
6266    /// let x = CreateBranchRuleRequest::new().set_or_clear_branch_rule(Some(BranchRule::default()/* use setters */));
6267    /// let x = CreateBranchRuleRequest::new().set_or_clear_branch_rule(None::<BranchRule>);
6268    /// ```
6269    pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
6270    where
6271        T: std::convert::Into<crate::model::BranchRule>,
6272    {
6273        self.branch_rule = v.map(|x| x.into());
6274        self
6275    }
6276
6277    /// Sets the value of [branch_rule_id][crate::model::CreateBranchRuleRequest::branch_rule_id].
6278    ///
6279    /// # Example
6280    /// ```ignore,no_run
6281    /// # use google_cloud_securesourcemanager_v1::model::CreateBranchRuleRequest;
6282    /// let x = CreateBranchRuleRequest::new().set_branch_rule_id("example");
6283    /// ```
6284    pub fn set_branch_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6285        self.branch_rule_id = v.into();
6286        self
6287    }
6288}
6289
6290impl wkt::message::Message for CreateBranchRuleRequest {
6291    fn typename() -> &'static str {
6292        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateBranchRuleRequest"
6293    }
6294}
6295
6296/// ListBranchRulesRequest is the request to list branch rules.
6297#[derive(Clone, Default, PartialEq)]
6298#[non_exhaustive]
6299pub struct ListBranchRulesRequest {
6300    #[allow(missing_docs)]
6301    pub parent: std::string::String,
6302
6303    /// Optional. Requested page size. If unspecified, a default size of 30 will be
6304    /// used. The maximum value is 100; values above 100 will be coerced to 100.
6305    pub page_size: i32,
6306
6307    /// Optional. A token identifying a page of results the server should return.
6308    pub page_token: std::string::String,
6309
6310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6311}
6312
6313impl ListBranchRulesRequest {
6314    /// Creates a new default instance.
6315    pub fn new() -> Self {
6316        std::default::Default::default()
6317    }
6318
6319    /// Sets the value of [parent][crate::model::ListBranchRulesRequest::parent].
6320    ///
6321    /// # Example
6322    /// ```ignore,no_run
6323    /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesRequest;
6324    /// # let project_id = "project_id";
6325    /// # let location_id = "location_id";
6326    /// # let repository_id = "repository_id";
6327    /// let x = ListBranchRulesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
6328    /// ```
6329    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6330        self.parent = v.into();
6331        self
6332    }
6333
6334    /// Sets the value of [page_size][crate::model::ListBranchRulesRequest::page_size].
6335    ///
6336    /// # Example
6337    /// ```ignore,no_run
6338    /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesRequest;
6339    /// let x = ListBranchRulesRequest::new().set_page_size(42);
6340    /// ```
6341    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6342        self.page_size = v.into();
6343        self
6344    }
6345
6346    /// Sets the value of [page_token][crate::model::ListBranchRulesRequest::page_token].
6347    ///
6348    /// # Example
6349    /// ```ignore,no_run
6350    /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesRequest;
6351    /// let x = ListBranchRulesRequest::new().set_page_token("example");
6352    /// ```
6353    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6354        self.page_token = v.into();
6355        self
6356    }
6357}
6358
6359impl wkt::message::Message for ListBranchRulesRequest {
6360    fn typename() -> &'static str {
6361        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListBranchRulesRequest"
6362    }
6363}
6364
6365/// DeleteBranchRuleRequest is the request to delete a branch rule.
6366#[derive(Clone, Default, PartialEq)]
6367#[non_exhaustive]
6368pub struct DeleteBranchRuleRequest {
6369    #[allow(missing_docs)]
6370    pub name: std::string::String,
6371
6372    /// Optional. If set to true, and the branch rule is not found, the request
6373    /// will succeed but no action will be taken on the server.
6374    pub allow_missing: bool,
6375
6376    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6377}
6378
6379impl DeleteBranchRuleRequest {
6380    /// Creates a new default instance.
6381    pub fn new() -> Self {
6382        std::default::Default::default()
6383    }
6384
6385    /// Sets the value of [name][crate::model::DeleteBranchRuleRequest::name].
6386    ///
6387    /// # Example
6388    /// ```ignore,no_run
6389    /// # use google_cloud_securesourcemanager_v1::model::DeleteBranchRuleRequest;
6390    /// # let project_id = "project_id";
6391    /// # let location_id = "location_id";
6392    /// # let repository_id = "repository_id";
6393    /// # let branch_rule_id = "branch_rule_id";
6394    /// let x = DeleteBranchRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/branchRules/{branch_rule_id}"));
6395    /// ```
6396    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6397        self.name = v.into();
6398        self
6399    }
6400
6401    /// Sets the value of [allow_missing][crate::model::DeleteBranchRuleRequest::allow_missing].
6402    ///
6403    /// # Example
6404    /// ```ignore,no_run
6405    /// # use google_cloud_securesourcemanager_v1::model::DeleteBranchRuleRequest;
6406    /// let x = DeleteBranchRuleRequest::new().set_allow_missing(true);
6407    /// ```
6408    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6409        self.allow_missing = v.into();
6410        self
6411    }
6412}
6413
6414impl wkt::message::Message for DeleteBranchRuleRequest {
6415    fn typename() -> &'static str {
6416        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest"
6417    }
6418}
6419
6420/// UpdateBranchRuleRequest is the request to update a branchRule.
6421#[derive(Clone, Default, PartialEq)]
6422#[non_exhaustive]
6423pub struct UpdateBranchRuleRequest {
6424    #[allow(missing_docs)]
6425    pub branch_rule: std::option::Option<crate::model::BranchRule>,
6426
6427    /// Optional. If set, validate the request and preview the review, but do not
6428    /// actually post it.  (<https://google.aip.dev/163>, for declarative friendly)
6429    pub validate_only: bool,
6430
6431    /// Optional. Field mask is used to specify the fields to be overwritten in the
6432    /// branchRule resource by the update.
6433    /// The fields specified in the update_mask are relative to the resource, not
6434    /// the full request. A field will be overwritten if it is in the mask.
6435    /// The special value "*" means full replacement.
6436    pub update_mask: std::option::Option<wkt::FieldMask>,
6437
6438    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6439}
6440
6441impl UpdateBranchRuleRequest {
6442    /// Creates a new default instance.
6443    pub fn new() -> Self {
6444        std::default::Default::default()
6445    }
6446
6447    /// Sets the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
6448    ///
6449    /// # Example
6450    /// ```ignore,no_run
6451    /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
6452    /// use google_cloud_securesourcemanager_v1::model::BranchRule;
6453    /// let x = UpdateBranchRuleRequest::new().set_branch_rule(BranchRule::default()/* use setters */);
6454    /// ```
6455    pub fn set_branch_rule<T>(mut self, v: T) -> Self
6456    where
6457        T: std::convert::Into<crate::model::BranchRule>,
6458    {
6459        self.branch_rule = std::option::Option::Some(v.into());
6460        self
6461    }
6462
6463    /// Sets or clears the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
6464    ///
6465    /// # Example
6466    /// ```ignore,no_run
6467    /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
6468    /// use google_cloud_securesourcemanager_v1::model::BranchRule;
6469    /// let x = UpdateBranchRuleRequest::new().set_or_clear_branch_rule(Some(BranchRule::default()/* use setters */));
6470    /// let x = UpdateBranchRuleRequest::new().set_or_clear_branch_rule(None::<BranchRule>);
6471    /// ```
6472    pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
6473    where
6474        T: std::convert::Into<crate::model::BranchRule>,
6475    {
6476        self.branch_rule = v.map(|x| x.into());
6477        self
6478    }
6479
6480    /// Sets the value of [validate_only][crate::model::UpdateBranchRuleRequest::validate_only].
6481    ///
6482    /// # Example
6483    /// ```ignore,no_run
6484    /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
6485    /// let x = UpdateBranchRuleRequest::new().set_validate_only(true);
6486    /// ```
6487    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6488        self.validate_only = v.into();
6489        self
6490    }
6491
6492    /// Sets the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
6493    ///
6494    /// # Example
6495    /// ```ignore,no_run
6496    /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
6497    /// use wkt::FieldMask;
6498    /// let x = UpdateBranchRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6499    /// ```
6500    pub fn set_update_mask<T>(mut self, v: T) -> Self
6501    where
6502        T: std::convert::Into<wkt::FieldMask>,
6503    {
6504        self.update_mask = std::option::Option::Some(v.into());
6505        self
6506    }
6507
6508    /// Sets or clears the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
6509    ///
6510    /// # Example
6511    /// ```ignore,no_run
6512    /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
6513    /// use wkt::FieldMask;
6514    /// let x = UpdateBranchRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6515    /// let x = UpdateBranchRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6516    /// ```
6517    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6518    where
6519        T: std::convert::Into<wkt::FieldMask>,
6520    {
6521        self.update_mask = v.map(|x| x.into());
6522        self
6523    }
6524}
6525
6526impl wkt::message::Message for UpdateBranchRuleRequest {
6527    fn typename() -> &'static str {
6528        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest"
6529    }
6530}
6531
6532/// ListBranchRulesResponse is the response to listing branchRules.
6533#[derive(Clone, Default, PartialEq)]
6534#[non_exhaustive]
6535pub struct ListBranchRulesResponse {
6536    /// The list of branch rules.
6537    pub branch_rules: std::vec::Vec<crate::model::BranchRule>,
6538
6539    /// A token identifying a page of results the server should return.
6540    pub next_page_token: std::string::String,
6541
6542    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6543}
6544
6545impl ListBranchRulesResponse {
6546    /// Creates a new default instance.
6547    pub fn new() -> Self {
6548        std::default::Default::default()
6549    }
6550
6551    /// Sets the value of [branch_rules][crate::model::ListBranchRulesResponse::branch_rules].
6552    ///
6553    /// # Example
6554    /// ```ignore,no_run
6555    /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesResponse;
6556    /// use google_cloud_securesourcemanager_v1::model::BranchRule;
6557    /// let x = ListBranchRulesResponse::new()
6558    ///     .set_branch_rules([
6559    ///         BranchRule::default()/* use setters */,
6560    ///         BranchRule::default()/* use (different) setters */,
6561    ///     ]);
6562    /// ```
6563    pub fn set_branch_rules<T, V>(mut self, v: T) -> Self
6564    where
6565        T: std::iter::IntoIterator<Item = V>,
6566        V: std::convert::Into<crate::model::BranchRule>,
6567    {
6568        use std::iter::Iterator;
6569        self.branch_rules = v.into_iter().map(|i| i.into()).collect();
6570        self
6571    }
6572
6573    /// Sets the value of [next_page_token][crate::model::ListBranchRulesResponse::next_page_token].
6574    ///
6575    /// # Example
6576    /// ```ignore,no_run
6577    /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesResponse;
6578    /// let x = ListBranchRulesResponse::new().set_next_page_token("example");
6579    /// ```
6580    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6581        self.next_page_token = v.into();
6582        self
6583    }
6584}
6585
6586impl wkt::message::Message for ListBranchRulesResponse {
6587    fn typename() -> &'static str {
6588        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListBranchRulesResponse"
6589    }
6590}
6591
6592#[doc(hidden)]
6593impl google_cloud_gax::paginator::internal::PageableResponse for ListBranchRulesResponse {
6594    type PageItem = crate::model::BranchRule;
6595
6596    fn items(self) -> std::vec::Vec<Self::PageItem> {
6597        self.branch_rules
6598    }
6599
6600    fn next_page_token(&self) -> std::string::String {
6601        use std::clone::Clone;
6602        self.next_page_token.clone()
6603    }
6604}
6605
6606/// CreatePullRequestRequest is the request to create a pull request.
6607#[derive(Clone, Default, PartialEq)]
6608#[non_exhaustive]
6609pub struct CreatePullRequestRequest {
6610    /// Required. The repository that the pull request is created from. Format:
6611    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
6612    pub parent: std::string::String,
6613
6614    /// Required. The pull request to create.
6615    pub pull_request: std::option::Option<crate::model::PullRequest>,
6616
6617    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6618}
6619
6620impl CreatePullRequestRequest {
6621    /// Creates a new default instance.
6622    pub fn new() -> Self {
6623        std::default::Default::default()
6624    }
6625
6626    /// Sets the value of [parent][crate::model::CreatePullRequestRequest::parent].
6627    ///
6628    /// # Example
6629    /// ```ignore,no_run
6630    /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestRequest;
6631    /// # let project_id = "project_id";
6632    /// # let location_id = "location_id";
6633    /// # let repository_id = "repository_id";
6634    /// let x = CreatePullRequestRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
6635    /// ```
6636    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6637        self.parent = v.into();
6638        self
6639    }
6640
6641    /// Sets the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
6642    ///
6643    /// # Example
6644    /// ```ignore,no_run
6645    /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestRequest;
6646    /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6647    /// let x = CreatePullRequestRequest::new().set_pull_request(PullRequest::default()/* use setters */);
6648    /// ```
6649    pub fn set_pull_request<T>(mut self, v: T) -> Self
6650    where
6651        T: std::convert::Into<crate::model::PullRequest>,
6652    {
6653        self.pull_request = std::option::Option::Some(v.into());
6654        self
6655    }
6656
6657    /// Sets or clears the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
6658    ///
6659    /// # Example
6660    /// ```ignore,no_run
6661    /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestRequest;
6662    /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6663    /// let x = CreatePullRequestRequest::new().set_or_clear_pull_request(Some(PullRequest::default()/* use setters */));
6664    /// let x = CreatePullRequestRequest::new().set_or_clear_pull_request(None::<PullRequest>);
6665    /// ```
6666    pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
6667    where
6668        T: std::convert::Into<crate::model::PullRequest>,
6669    {
6670        self.pull_request = v.map(|x| x.into());
6671        self
6672    }
6673}
6674
6675impl wkt::message::Message for CreatePullRequestRequest {
6676    fn typename() -> &'static str {
6677        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreatePullRequestRequest"
6678    }
6679}
6680
6681/// GetPullRequestRequest is the request to get a pull request.
6682#[derive(Clone, Default, PartialEq)]
6683#[non_exhaustive]
6684pub struct GetPullRequestRequest {
6685    /// Required. Name of the pull request to retrieve.
6686    /// The format is
6687    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`.
6688    pub name: std::string::String,
6689
6690    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6691}
6692
6693impl GetPullRequestRequest {
6694    /// Creates a new default instance.
6695    pub fn new() -> Self {
6696        std::default::Default::default()
6697    }
6698
6699    /// Sets the value of [name][crate::model::GetPullRequestRequest::name].
6700    ///
6701    /// # Example
6702    /// ```ignore,no_run
6703    /// # use google_cloud_securesourcemanager_v1::model::GetPullRequestRequest;
6704    /// # let project_id = "project_id";
6705    /// # let location_id = "location_id";
6706    /// # let repository_id = "repository_id";
6707    /// # let pull_request_id = "pull_request_id";
6708    /// let x = GetPullRequestRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
6709    /// ```
6710    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6711        self.name = v.into();
6712        self
6713    }
6714}
6715
6716impl wkt::message::Message for GetPullRequestRequest {
6717    fn typename() -> &'static str {
6718        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetPullRequestRequest"
6719    }
6720}
6721
6722/// ListPullRequestsRequest is the request to list pull requests.
6723#[derive(Clone, Default, PartialEq)]
6724#[non_exhaustive]
6725pub struct ListPullRequestsRequest {
6726    /// Required. The repository in which to list pull requests. Format:
6727    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
6728    pub parent: std::string::String,
6729
6730    /// Optional. Requested page size. If unspecified, a default size of 30 will be
6731    /// used. The maximum value is 100; values above 100 will be coerced to 100.
6732    pub page_size: i32,
6733
6734    /// Optional. A token identifying a page of results the server should return.
6735    pub page_token: std::string::String,
6736
6737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6738}
6739
6740impl ListPullRequestsRequest {
6741    /// Creates a new default instance.
6742    pub fn new() -> Self {
6743        std::default::Default::default()
6744    }
6745
6746    /// Sets the value of [parent][crate::model::ListPullRequestsRequest::parent].
6747    ///
6748    /// # Example
6749    /// ```ignore,no_run
6750    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsRequest;
6751    /// # let project_id = "project_id";
6752    /// # let location_id = "location_id";
6753    /// # let repository_id = "repository_id";
6754    /// let x = ListPullRequestsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
6755    /// ```
6756    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6757        self.parent = v.into();
6758        self
6759    }
6760
6761    /// Sets the value of [page_size][crate::model::ListPullRequestsRequest::page_size].
6762    ///
6763    /// # Example
6764    /// ```ignore,no_run
6765    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsRequest;
6766    /// let x = ListPullRequestsRequest::new().set_page_size(42);
6767    /// ```
6768    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6769        self.page_size = v.into();
6770        self
6771    }
6772
6773    /// Sets the value of [page_token][crate::model::ListPullRequestsRequest::page_token].
6774    ///
6775    /// # Example
6776    /// ```ignore,no_run
6777    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsRequest;
6778    /// let x = ListPullRequestsRequest::new().set_page_token("example");
6779    /// ```
6780    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6781        self.page_token = v.into();
6782        self
6783    }
6784}
6785
6786impl wkt::message::Message for ListPullRequestsRequest {
6787    fn typename() -> &'static str {
6788        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestsRequest"
6789    }
6790}
6791
6792/// ListPullRequestsResponse is the response to list pull requests.
6793#[derive(Clone, Default, PartialEq)]
6794#[non_exhaustive]
6795pub struct ListPullRequestsResponse {
6796    /// The list of pull requests.
6797    pub pull_requests: std::vec::Vec<crate::model::PullRequest>,
6798
6799    /// A token identifying a page of results the server should return.
6800    pub next_page_token: std::string::String,
6801
6802    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6803}
6804
6805impl ListPullRequestsResponse {
6806    /// Creates a new default instance.
6807    pub fn new() -> Self {
6808        std::default::Default::default()
6809    }
6810
6811    /// Sets the value of [pull_requests][crate::model::ListPullRequestsResponse::pull_requests].
6812    ///
6813    /// # Example
6814    /// ```ignore,no_run
6815    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsResponse;
6816    /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6817    /// let x = ListPullRequestsResponse::new()
6818    ///     .set_pull_requests([
6819    ///         PullRequest::default()/* use setters */,
6820    ///         PullRequest::default()/* use (different) setters */,
6821    ///     ]);
6822    /// ```
6823    pub fn set_pull_requests<T, V>(mut self, v: T) -> Self
6824    where
6825        T: std::iter::IntoIterator<Item = V>,
6826        V: std::convert::Into<crate::model::PullRequest>,
6827    {
6828        use std::iter::Iterator;
6829        self.pull_requests = v.into_iter().map(|i| i.into()).collect();
6830        self
6831    }
6832
6833    /// Sets the value of [next_page_token][crate::model::ListPullRequestsResponse::next_page_token].
6834    ///
6835    /// # Example
6836    /// ```ignore,no_run
6837    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsResponse;
6838    /// let x = ListPullRequestsResponse::new().set_next_page_token("example");
6839    /// ```
6840    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6841        self.next_page_token = v.into();
6842        self
6843    }
6844}
6845
6846impl wkt::message::Message for ListPullRequestsResponse {
6847    fn typename() -> &'static str {
6848        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestsResponse"
6849    }
6850}
6851
6852#[doc(hidden)]
6853impl google_cloud_gax::paginator::internal::PageableResponse for ListPullRequestsResponse {
6854    type PageItem = crate::model::PullRequest;
6855
6856    fn items(self) -> std::vec::Vec<Self::PageItem> {
6857        self.pull_requests
6858    }
6859
6860    fn next_page_token(&self) -> std::string::String {
6861        use std::clone::Clone;
6862        self.next_page_token.clone()
6863    }
6864}
6865
6866/// UpdatePullRequestRequest is the request to update a pull request.
6867#[derive(Clone, Default, PartialEq)]
6868#[non_exhaustive]
6869pub struct UpdatePullRequestRequest {
6870    /// Required. The pull request to update.
6871    pub pull_request: std::option::Option<crate::model::PullRequest>,
6872
6873    /// Optional. Field mask is used to specify the fields to be overwritten in the
6874    /// pull request resource by the update.
6875    /// The fields specified in the update_mask are relative to the resource, not
6876    /// the full request. A field will be overwritten if it is in the mask.
6877    /// The special value "*" means full replacement.
6878    pub update_mask: std::option::Option<wkt::FieldMask>,
6879
6880    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6881}
6882
6883impl UpdatePullRequestRequest {
6884    /// Creates a new default instance.
6885    pub fn new() -> Self {
6886        std::default::Default::default()
6887    }
6888
6889    /// Sets the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
6890    ///
6891    /// # Example
6892    /// ```ignore,no_run
6893    /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestRequest;
6894    /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6895    /// let x = UpdatePullRequestRequest::new().set_pull_request(PullRequest::default()/* use setters */);
6896    /// ```
6897    pub fn set_pull_request<T>(mut self, v: T) -> Self
6898    where
6899        T: std::convert::Into<crate::model::PullRequest>,
6900    {
6901        self.pull_request = std::option::Option::Some(v.into());
6902        self
6903    }
6904
6905    /// Sets or clears the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
6906    ///
6907    /// # Example
6908    /// ```ignore,no_run
6909    /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestRequest;
6910    /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6911    /// let x = UpdatePullRequestRequest::new().set_or_clear_pull_request(Some(PullRequest::default()/* use setters */));
6912    /// let x = UpdatePullRequestRequest::new().set_or_clear_pull_request(None::<PullRequest>);
6913    /// ```
6914    pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
6915    where
6916        T: std::convert::Into<crate::model::PullRequest>,
6917    {
6918        self.pull_request = v.map(|x| x.into());
6919        self
6920    }
6921
6922    /// Sets the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
6923    ///
6924    /// # Example
6925    /// ```ignore,no_run
6926    /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestRequest;
6927    /// use wkt::FieldMask;
6928    /// let x = UpdatePullRequestRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6929    /// ```
6930    pub fn set_update_mask<T>(mut self, v: T) -> Self
6931    where
6932        T: std::convert::Into<wkt::FieldMask>,
6933    {
6934        self.update_mask = std::option::Option::Some(v.into());
6935        self
6936    }
6937
6938    /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
6939    ///
6940    /// # Example
6941    /// ```ignore,no_run
6942    /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestRequest;
6943    /// use wkt::FieldMask;
6944    /// let x = UpdatePullRequestRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6945    /// let x = UpdatePullRequestRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6946    /// ```
6947    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6948    where
6949        T: std::convert::Into<wkt::FieldMask>,
6950    {
6951        self.update_mask = v.map(|x| x.into());
6952        self
6953    }
6954}
6955
6956impl wkt::message::Message for UpdatePullRequestRequest {
6957    fn typename() -> &'static str {
6958        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdatePullRequestRequest"
6959    }
6960}
6961
6962/// MergePullRequestRequest is the request to merge a pull request.
6963#[derive(Clone, Default, PartialEq)]
6964#[non_exhaustive]
6965pub struct MergePullRequestRequest {
6966    /// Required. The pull request to merge.
6967    /// Format:
6968    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
6969    pub name: std::string::String,
6970
6971    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6972}
6973
6974impl MergePullRequestRequest {
6975    /// Creates a new default instance.
6976    pub fn new() -> Self {
6977        std::default::Default::default()
6978    }
6979
6980    /// Sets the value of [name][crate::model::MergePullRequestRequest::name].
6981    ///
6982    /// # Example
6983    /// ```ignore,no_run
6984    /// # use google_cloud_securesourcemanager_v1::model::MergePullRequestRequest;
6985    /// # let project_id = "project_id";
6986    /// # let location_id = "location_id";
6987    /// # let repository_id = "repository_id";
6988    /// # let pull_request_id = "pull_request_id";
6989    /// let x = MergePullRequestRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
6990    /// ```
6991    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6992        self.name = v.into();
6993        self
6994    }
6995}
6996
6997impl wkt::message::Message for MergePullRequestRequest {
6998    fn typename() -> &'static str {
6999        "type.googleapis.com/google.cloud.securesourcemanager.v1.MergePullRequestRequest"
7000    }
7001}
7002
7003/// OpenPullRequestRequest is the request to open a pull request.
7004#[derive(Clone, Default, PartialEq)]
7005#[non_exhaustive]
7006pub struct OpenPullRequestRequest {
7007    /// Required. The pull request to open.
7008    /// Format:
7009    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
7010    pub name: std::string::String,
7011
7012    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7013}
7014
7015impl OpenPullRequestRequest {
7016    /// Creates a new default instance.
7017    pub fn new() -> Self {
7018        std::default::Default::default()
7019    }
7020
7021    /// Sets the value of [name][crate::model::OpenPullRequestRequest::name].
7022    ///
7023    /// # Example
7024    /// ```ignore,no_run
7025    /// # use google_cloud_securesourcemanager_v1::model::OpenPullRequestRequest;
7026    /// # let project_id = "project_id";
7027    /// # let location_id = "location_id";
7028    /// # let repository_id = "repository_id";
7029    /// # let pull_request_id = "pull_request_id";
7030    /// let x = OpenPullRequestRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
7031    /// ```
7032    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7033        self.name = v.into();
7034        self
7035    }
7036}
7037
7038impl wkt::message::Message for OpenPullRequestRequest {
7039    fn typename() -> &'static str {
7040        "type.googleapis.com/google.cloud.securesourcemanager.v1.OpenPullRequestRequest"
7041    }
7042}
7043
7044/// ClosePullRequestRequest is the request to close a pull request.
7045#[derive(Clone, Default, PartialEq)]
7046#[non_exhaustive]
7047pub struct ClosePullRequestRequest {
7048    /// Required. The pull request to close.
7049    /// Format:
7050    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
7051    pub name: std::string::String,
7052
7053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7054}
7055
7056impl ClosePullRequestRequest {
7057    /// Creates a new default instance.
7058    pub fn new() -> Self {
7059        std::default::Default::default()
7060    }
7061
7062    /// Sets the value of [name][crate::model::ClosePullRequestRequest::name].
7063    ///
7064    /// # Example
7065    /// ```ignore,no_run
7066    /// # use google_cloud_securesourcemanager_v1::model::ClosePullRequestRequest;
7067    /// # let project_id = "project_id";
7068    /// # let location_id = "location_id";
7069    /// # let repository_id = "repository_id";
7070    /// # let pull_request_id = "pull_request_id";
7071    /// let x = ClosePullRequestRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
7072    /// ```
7073    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7074        self.name = v.into();
7075        self
7076    }
7077}
7078
7079impl wkt::message::Message for ClosePullRequestRequest {
7080    fn typename() -> &'static str {
7081        "type.googleapis.com/google.cloud.securesourcemanager.v1.ClosePullRequestRequest"
7082    }
7083}
7084
7085/// ListPullRequestFileDiffsRequest is the request to list pull request file
7086/// diffs.
7087#[derive(Clone, Default, PartialEq)]
7088#[non_exhaustive]
7089pub struct ListPullRequestFileDiffsRequest {
7090    /// Required. The pull request to list file diffs for.
7091    /// Format:
7092    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
7093    pub name: std::string::String,
7094
7095    /// Optional. Requested page size. If unspecified, a default size of 30 will be
7096    /// used. The maximum value is 100; values above 100 will be coerced to 100.
7097    pub page_size: i32,
7098
7099    /// Optional. A token identifying a page of results the server should return.
7100    pub page_token: std::string::String,
7101
7102    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7103}
7104
7105impl ListPullRequestFileDiffsRequest {
7106    /// Creates a new default instance.
7107    pub fn new() -> Self {
7108        std::default::Default::default()
7109    }
7110
7111    /// Sets the value of [name][crate::model::ListPullRequestFileDiffsRequest::name].
7112    ///
7113    /// # Example
7114    /// ```ignore,no_run
7115    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsRequest;
7116    /// # let project_id = "project_id";
7117    /// # let location_id = "location_id";
7118    /// # let repository_id = "repository_id";
7119    /// # let pull_request_id = "pull_request_id";
7120    /// let x = ListPullRequestFileDiffsRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
7121    /// ```
7122    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7123        self.name = v.into();
7124        self
7125    }
7126
7127    /// Sets the value of [page_size][crate::model::ListPullRequestFileDiffsRequest::page_size].
7128    ///
7129    /// # Example
7130    /// ```ignore,no_run
7131    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsRequest;
7132    /// let x = ListPullRequestFileDiffsRequest::new().set_page_size(42);
7133    /// ```
7134    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7135        self.page_size = v.into();
7136        self
7137    }
7138
7139    /// Sets the value of [page_token][crate::model::ListPullRequestFileDiffsRequest::page_token].
7140    ///
7141    /// # Example
7142    /// ```ignore,no_run
7143    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsRequest;
7144    /// let x = ListPullRequestFileDiffsRequest::new().set_page_token("example");
7145    /// ```
7146    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7147        self.page_token = v.into();
7148        self
7149    }
7150}
7151
7152impl wkt::message::Message for ListPullRequestFileDiffsRequest {
7153    fn typename() -> &'static str {
7154        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest"
7155    }
7156}
7157
7158/// ListPullRequestFileDiffsResponse is the response containing file diffs
7159/// returned from ListPullRequestFileDiffs.
7160#[derive(Clone, Default, PartialEq)]
7161#[non_exhaustive]
7162pub struct ListPullRequestFileDiffsResponse {
7163    /// The list of pull request file diffs.
7164    pub file_diffs: std::vec::Vec<crate::model::FileDiff>,
7165
7166    /// A token identifying a page of results the server should return.
7167    pub next_page_token: std::string::String,
7168
7169    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7170}
7171
7172impl ListPullRequestFileDiffsResponse {
7173    /// Creates a new default instance.
7174    pub fn new() -> Self {
7175        std::default::Default::default()
7176    }
7177
7178    /// Sets the value of [file_diffs][crate::model::ListPullRequestFileDiffsResponse::file_diffs].
7179    ///
7180    /// # Example
7181    /// ```ignore,no_run
7182    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsResponse;
7183    /// use google_cloud_securesourcemanager_v1::model::FileDiff;
7184    /// let x = ListPullRequestFileDiffsResponse::new()
7185    ///     .set_file_diffs([
7186    ///         FileDiff::default()/* use setters */,
7187    ///         FileDiff::default()/* use (different) setters */,
7188    ///     ]);
7189    /// ```
7190    pub fn set_file_diffs<T, V>(mut self, v: T) -> Self
7191    where
7192        T: std::iter::IntoIterator<Item = V>,
7193        V: std::convert::Into<crate::model::FileDiff>,
7194    {
7195        use std::iter::Iterator;
7196        self.file_diffs = v.into_iter().map(|i| i.into()).collect();
7197        self
7198    }
7199
7200    /// Sets the value of [next_page_token][crate::model::ListPullRequestFileDiffsResponse::next_page_token].
7201    ///
7202    /// # Example
7203    /// ```ignore,no_run
7204    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsResponse;
7205    /// let x = ListPullRequestFileDiffsResponse::new().set_next_page_token("example");
7206    /// ```
7207    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7208        self.next_page_token = v.into();
7209        self
7210    }
7211}
7212
7213impl wkt::message::Message for ListPullRequestFileDiffsResponse {
7214    fn typename() -> &'static str {
7215        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsResponse"
7216    }
7217}
7218
7219#[doc(hidden)]
7220impl google_cloud_gax::paginator::internal::PageableResponse for ListPullRequestFileDiffsResponse {
7221    type PageItem = crate::model::FileDiff;
7222
7223    fn items(self) -> std::vec::Vec<Self::PageItem> {
7224        self.file_diffs
7225    }
7226
7227    fn next_page_token(&self) -> std::string::String {
7228        use std::clone::Clone;
7229        self.next_page_token.clone()
7230    }
7231}
7232
7233/// The request to create an issue.
7234#[derive(Clone, Default, PartialEq)]
7235#[non_exhaustive]
7236pub struct CreateIssueRequest {
7237    /// Required. The repository in which to create the issue. Format:
7238    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
7239    pub parent: std::string::String,
7240
7241    /// Required. The issue to create.
7242    pub issue: std::option::Option<crate::model::Issue>,
7243
7244    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7245}
7246
7247impl CreateIssueRequest {
7248    /// Creates a new default instance.
7249    pub fn new() -> Self {
7250        std::default::Default::default()
7251    }
7252
7253    /// Sets the value of [parent][crate::model::CreateIssueRequest::parent].
7254    ///
7255    /// # Example
7256    /// ```ignore,no_run
7257    /// # use google_cloud_securesourcemanager_v1::model::CreateIssueRequest;
7258    /// # let project_id = "project_id";
7259    /// # let location_id = "location_id";
7260    /// # let repository_id = "repository_id";
7261    /// let x = CreateIssueRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
7262    /// ```
7263    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7264        self.parent = v.into();
7265        self
7266    }
7267
7268    /// Sets the value of [issue][crate::model::CreateIssueRequest::issue].
7269    ///
7270    /// # Example
7271    /// ```ignore,no_run
7272    /// # use google_cloud_securesourcemanager_v1::model::CreateIssueRequest;
7273    /// use google_cloud_securesourcemanager_v1::model::Issue;
7274    /// let x = CreateIssueRequest::new().set_issue(Issue::default()/* use setters */);
7275    /// ```
7276    pub fn set_issue<T>(mut self, v: T) -> Self
7277    where
7278        T: std::convert::Into<crate::model::Issue>,
7279    {
7280        self.issue = std::option::Option::Some(v.into());
7281        self
7282    }
7283
7284    /// Sets or clears the value of [issue][crate::model::CreateIssueRequest::issue].
7285    ///
7286    /// # Example
7287    /// ```ignore,no_run
7288    /// # use google_cloud_securesourcemanager_v1::model::CreateIssueRequest;
7289    /// use google_cloud_securesourcemanager_v1::model::Issue;
7290    /// let x = CreateIssueRequest::new().set_or_clear_issue(Some(Issue::default()/* use setters */));
7291    /// let x = CreateIssueRequest::new().set_or_clear_issue(None::<Issue>);
7292    /// ```
7293    pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
7294    where
7295        T: std::convert::Into<crate::model::Issue>,
7296    {
7297        self.issue = v.map(|x| x.into());
7298        self
7299    }
7300}
7301
7302impl wkt::message::Message for CreateIssueRequest {
7303    fn typename() -> &'static str {
7304        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateIssueRequest"
7305    }
7306}
7307
7308/// The request to get an issue.
7309#[derive(Clone, Default, PartialEq)]
7310#[non_exhaustive]
7311pub struct GetIssueRequest {
7312    /// Required. Name of the issue to retrieve.
7313    /// The format is
7314    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`.
7315    pub name: std::string::String,
7316
7317    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7318}
7319
7320impl GetIssueRequest {
7321    /// Creates a new default instance.
7322    pub fn new() -> Self {
7323        std::default::Default::default()
7324    }
7325
7326    /// Sets the value of [name][crate::model::GetIssueRequest::name].
7327    ///
7328    /// # Example
7329    /// ```ignore,no_run
7330    /// # use google_cloud_securesourcemanager_v1::model::GetIssueRequest;
7331    /// # let project_id = "project_id";
7332    /// # let location_id = "location_id";
7333    /// # let repository_id = "repository_id";
7334    /// # let issue_id = "issue_id";
7335    /// let x = GetIssueRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"));
7336    /// ```
7337    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7338        self.name = v.into();
7339        self
7340    }
7341}
7342
7343impl wkt::message::Message for GetIssueRequest {
7344    fn typename() -> &'static str {
7345        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetIssueRequest"
7346    }
7347}
7348
7349/// The request to list issues.
7350#[derive(Clone, Default, PartialEq)]
7351#[non_exhaustive]
7352pub struct ListIssuesRequest {
7353    /// Required. The repository in which to list issues. Format:
7354    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
7355    pub parent: std::string::String,
7356
7357    /// Optional. Requested page size. If unspecified, a default size of 30 will be
7358    /// used. The maximum value is 100; values above 100 will be coerced to 100.
7359    pub page_size: i32,
7360
7361    /// Optional. A token identifying a page of results the server should return.
7362    pub page_token: std::string::String,
7363
7364    /// Optional. Used to filter the resulting issues list.
7365    pub filter: std::string::String,
7366
7367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7368}
7369
7370impl ListIssuesRequest {
7371    /// Creates a new default instance.
7372    pub fn new() -> Self {
7373        std::default::Default::default()
7374    }
7375
7376    /// Sets the value of [parent][crate::model::ListIssuesRequest::parent].
7377    ///
7378    /// # Example
7379    /// ```ignore,no_run
7380    /// # use google_cloud_securesourcemanager_v1::model::ListIssuesRequest;
7381    /// # let project_id = "project_id";
7382    /// # let location_id = "location_id";
7383    /// # let repository_id = "repository_id";
7384    /// let x = ListIssuesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
7385    /// ```
7386    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7387        self.parent = v.into();
7388        self
7389    }
7390
7391    /// Sets the value of [page_size][crate::model::ListIssuesRequest::page_size].
7392    ///
7393    /// # Example
7394    /// ```ignore,no_run
7395    /// # use google_cloud_securesourcemanager_v1::model::ListIssuesRequest;
7396    /// let x = ListIssuesRequest::new().set_page_size(42);
7397    /// ```
7398    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7399        self.page_size = v.into();
7400        self
7401    }
7402
7403    /// Sets the value of [page_token][crate::model::ListIssuesRequest::page_token].
7404    ///
7405    /// # Example
7406    /// ```ignore,no_run
7407    /// # use google_cloud_securesourcemanager_v1::model::ListIssuesRequest;
7408    /// let x = ListIssuesRequest::new().set_page_token("example");
7409    /// ```
7410    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7411        self.page_token = v.into();
7412        self
7413    }
7414
7415    /// Sets the value of [filter][crate::model::ListIssuesRequest::filter].
7416    ///
7417    /// # Example
7418    /// ```ignore,no_run
7419    /// # use google_cloud_securesourcemanager_v1::model::ListIssuesRequest;
7420    /// let x = ListIssuesRequest::new().set_filter("example");
7421    /// ```
7422    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7423        self.filter = v.into();
7424        self
7425    }
7426}
7427
7428impl wkt::message::Message for ListIssuesRequest {
7429    fn typename() -> &'static str {
7430        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssuesRequest"
7431    }
7432}
7433
7434/// The response to list issues.
7435#[derive(Clone, Default, PartialEq)]
7436#[non_exhaustive]
7437pub struct ListIssuesResponse {
7438    /// The list of issues.
7439    pub issues: std::vec::Vec<crate::model::Issue>,
7440
7441    /// A token identifying a page of results the server should return.
7442    pub next_page_token: std::string::String,
7443
7444    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7445}
7446
7447impl ListIssuesResponse {
7448    /// Creates a new default instance.
7449    pub fn new() -> Self {
7450        std::default::Default::default()
7451    }
7452
7453    /// Sets the value of [issues][crate::model::ListIssuesResponse::issues].
7454    ///
7455    /// # Example
7456    /// ```ignore,no_run
7457    /// # use google_cloud_securesourcemanager_v1::model::ListIssuesResponse;
7458    /// use google_cloud_securesourcemanager_v1::model::Issue;
7459    /// let x = ListIssuesResponse::new()
7460    ///     .set_issues([
7461    ///         Issue::default()/* use setters */,
7462    ///         Issue::default()/* use (different) setters */,
7463    ///     ]);
7464    /// ```
7465    pub fn set_issues<T, V>(mut self, v: T) -> Self
7466    where
7467        T: std::iter::IntoIterator<Item = V>,
7468        V: std::convert::Into<crate::model::Issue>,
7469    {
7470        use std::iter::Iterator;
7471        self.issues = v.into_iter().map(|i| i.into()).collect();
7472        self
7473    }
7474
7475    /// Sets the value of [next_page_token][crate::model::ListIssuesResponse::next_page_token].
7476    ///
7477    /// # Example
7478    /// ```ignore,no_run
7479    /// # use google_cloud_securesourcemanager_v1::model::ListIssuesResponse;
7480    /// let x = ListIssuesResponse::new().set_next_page_token("example");
7481    /// ```
7482    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7483        self.next_page_token = v.into();
7484        self
7485    }
7486}
7487
7488impl wkt::message::Message for ListIssuesResponse {
7489    fn typename() -> &'static str {
7490        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssuesResponse"
7491    }
7492}
7493
7494#[doc(hidden)]
7495impl google_cloud_gax::paginator::internal::PageableResponse for ListIssuesResponse {
7496    type PageItem = crate::model::Issue;
7497
7498    fn items(self) -> std::vec::Vec<Self::PageItem> {
7499        self.issues
7500    }
7501
7502    fn next_page_token(&self) -> std::string::String {
7503        use std::clone::Clone;
7504        self.next_page_token.clone()
7505    }
7506}
7507
7508/// The request to update an issue.
7509#[derive(Clone, Default, PartialEq)]
7510#[non_exhaustive]
7511pub struct UpdateIssueRequest {
7512    /// Required. The issue to update.
7513    pub issue: std::option::Option<crate::model::Issue>,
7514
7515    /// Optional. Field mask is used to specify the fields to be overwritten in the
7516    /// issue resource by the update.
7517    /// The fields specified in the update_mask are relative to the resource, not
7518    /// the full request. A field will be overwritten if it is in the mask.
7519    /// The special value "*" means full replacement.
7520    pub update_mask: std::option::Option<wkt::FieldMask>,
7521
7522    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7523}
7524
7525impl UpdateIssueRequest {
7526    /// Creates a new default instance.
7527    pub fn new() -> Self {
7528        std::default::Default::default()
7529    }
7530
7531    /// Sets the value of [issue][crate::model::UpdateIssueRequest::issue].
7532    ///
7533    /// # Example
7534    /// ```ignore,no_run
7535    /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueRequest;
7536    /// use google_cloud_securesourcemanager_v1::model::Issue;
7537    /// let x = UpdateIssueRequest::new().set_issue(Issue::default()/* use setters */);
7538    /// ```
7539    pub fn set_issue<T>(mut self, v: T) -> Self
7540    where
7541        T: std::convert::Into<crate::model::Issue>,
7542    {
7543        self.issue = std::option::Option::Some(v.into());
7544        self
7545    }
7546
7547    /// Sets or clears the value of [issue][crate::model::UpdateIssueRequest::issue].
7548    ///
7549    /// # Example
7550    /// ```ignore,no_run
7551    /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueRequest;
7552    /// use google_cloud_securesourcemanager_v1::model::Issue;
7553    /// let x = UpdateIssueRequest::new().set_or_clear_issue(Some(Issue::default()/* use setters */));
7554    /// let x = UpdateIssueRequest::new().set_or_clear_issue(None::<Issue>);
7555    /// ```
7556    pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
7557    where
7558        T: std::convert::Into<crate::model::Issue>,
7559    {
7560        self.issue = v.map(|x| x.into());
7561        self
7562    }
7563
7564    /// Sets the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
7565    ///
7566    /// # Example
7567    /// ```ignore,no_run
7568    /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueRequest;
7569    /// use wkt::FieldMask;
7570    /// let x = UpdateIssueRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7571    /// ```
7572    pub fn set_update_mask<T>(mut self, v: T) -> Self
7573    where
7574        T: std::convert::Into<wkt::FieldMask>,
7575    {
7576        self.update_mask = std::option::Option::Some(v.into());
7577        self
7578    }
7579
7580    /// Sets or clears the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
7581    ///
7582    /// # Example
7583    /// ```ignore,no_run
7584    /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueRequest;
7585    /// use wkt::FieldMask;
7586    /// let x = UpdateIssueRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7587    /// let x = UpdateIssueRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7588    /// ```
7589    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7590    where
7591        T: std::convert::Into<wkt::FieldMask>,
7592    {
7593        self.update_mask = v.map(|x| x.into());
7594        self
7595    }
7596}
7597
7598impl wkt::message::Message for UpdateIssueRequest {
7599    fn typename() -> &'static str {
7600        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateIssueRequest"
7601    }
7602}
7603
7604/// The request to delete an issue.
7605#[derive(Clone, Default, PartialEq)]
7606#[non_exhaustive]
7607pub struct DeleteIssueRequest {
7608    /// Required. Name of the issue to delete.
7609    /// The format is
7610    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
7611    pub name: std::string::String,
7612
7613    /// Optional. The current etag of the issue.
7614    /// If the etag is provided and does not match the current etag of the issue,
7615    /// deletion will be blocked and an ABORTED error will be returned.
7616    pub etag: std::string::String,
7617
7618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7619}
7620
7621impl DeleteIssueRequest {
7622    /// Creates a new default instance.
7623    pub fn new() -> Self {
7624        std::default::Default::default()
7625    }
7626
7627    /// Sets the value of [name][crate::model::DeleteIssueRequest::name].
7628    ///
7629    /// # Example
7630    /// ```ignore,no_run
7631    /// # use google_cloud_securesourcemanager_v1::model::DeleteIssueRequest;
7632    /// # let project_id = "project_id";
7633    /// # let location_id = "location_id";
7634    /// # let repository_id = "repository_id";
7635    /// # let issue_id = "issue_id";
7636    /// let x = DeleteIssueRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"));
7637    /// ```
7638    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7639        self.name = v.into();
7640        self
7641    }
7642
7643    /// Sets the value of [etag][crate::model::DeleteIssueRequest::etag].
7644    ///
7645    /// # Example
7646    /// ```ignore,no_run
7647    /// # use google_cloud_securesourcemanager_v1::model::DeleteIssueRequest;
7648    /// let x = DeleteIssueRequest::new().set_etag("example");
7649    /// ```
7650    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7651        self.etag = v.into();
7652        self
7653    }
7654}
7655
7656impl wkt::message::Message for DeleteIssueRequest {
7657    fn typename() -> &'static str {
7658        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteIssueRequest"
7659    }
7660}
7661
7662/// The request to close an issue.
7663#[derive(Clone, Default, PartialEq)]
7664#[non_exhaustive]
7665pub struct CloseIssueRequest {
7666    /// Required. Name of the issue to close.
7667    /// The format is
7668    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
7669    pub name: std::string::String,
7670
7671    /// Optional. The current etag of the issue.
7672    /// If the etag is provided and does not match the current etag of the issue,
7673    /// closing will be blocked and an ABORTED error will be returned.
7674    pub etag: std::string::String,
7675
7676    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7677}
7678
7679impl CloseIssueRequest {
7680    /// Creates a new default instance.
7681    pub fn new() -> Self {
7682        std::default::Default::default()
7683    }
7684
7685    /// Sets the value of [name][crate::model::CloseIssueRequest::name].
7686    ///
7687    /// # Example
7688    /// ```ignore,no_run
7689    /// # use google_cloud_securesourcemanager_v1::model::CloseIssueRequest;
7690    /// # let project_id = "project_id";
7691    /// # let location_id = "location_id";
7692    /// # let repository_id = "repository_id";
7693    /// # let issue_id = "issue_id";
7694    /// let x = CloseIssueRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"));
7695    /// ```
7696    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7697        self.name = v.into();
7698        self
7699    }
7700
7701    /// Sets the value of [etag][crate::model::CloseIssueRequest::etag].
7702    ///
7703    /// # Example
7704    /// ```ignore,no_run
7705    /// # use google_cloud_securesourcemanager_v1::model::CloseIssueRequest;
7706    /// let x = CloseIssueRequest::new().set_etag("example");
7707    /// ```
7708    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7709        self.etag = v.into();
7710        self
7711    }
7712}
7713
7714impl wkt::message::Message for CloseIssueRequest {
7715    fn typename() -> &'static str {
7716        "type.googleapis.com/google.cloud.securesourcemanager.v1.CloseIssueRequest"
7717    }
7718}
7719
7720/// The request to open an issue.
7721#[derive(Clone, Default, PartialEq)]
7722#[non_exhaustive]
7723pub struct OpenIssueRequest {
7724    /// Required. Name of the issue to open.
7725    /// The format is
7726    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
7727    pub name: std::string::String,
7728
7729    /// Optional. The current etag of the issue.
7730    /// If the etag is provided and does not match the current etag of the issue,
7731    /// opening will be blocked and an ABORTED error will be returned.
7732    pub etag: std::string::String,
7733
7734    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7735}
7736
7737impl OpenIssueRequest {
7738    /// Creates a new default instance.
7739    pub fn new() -> Self {
7740        std::default::Default::default()
7741    }
7742
7743    /// Sets the value of [name][crate::model::OpenIssueRequest::name].
7744    ///
7745    /// # Example
7746    /// ```ignore,no_run
7747    /// # use google_cloud_securesourcemanager_v1::model::OpenIssueRequest;
7748    /// # let project_id = "project_id";
7749    /// # let location_id = "location_id";
7750    /// # let repository_id = "repository_id";
7751    /// # let issue_id = "issue_id";
7752    /// let x = OpenIssueRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"));
7753    /// ```
7754    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7755        self.name = v.into();
7756        self
7757    }
7758
7759    /// Sets the value of [etag][crate::model::OpenIssueRequest::etag].
7760    ///
7761    /// # Example
7762    /// ```ignore,no_run
7763    /// # use google_cloud_securesourcemanager_v1::model::OpenIssueRequest;
7764    /// let x = OpenIssueRequest::new().set_etag("example");
7765    /// ```
7766    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7767        self.etag = v.into();
7768        self
7769    }
7770}
7771
7772impl wkt::message::Message for OpenIssueRequest {
7773    fn typename() -> &'static str {
7774        "type.googleapis.com/google.cloud.securesourcemanager.v1.OpenIssueRequest"
7775    }
7776}
7777
7778/// Represents an entry within a tree structure (like a Git tree).
7779#[derive(Clone, Default, PartialEq)]
7780#[non_exhaustive]
7781pub struct TreeEntry {
7782    /// Output only. The type of the object (TREE, BLOB, COMMIT).  Output-only.
7783    pub r#type: crate::model::tree_entry::ObjectType,
7784
7785    /// Output only. The SHA-1 hash of the object (unique identifier). Output-only.
7786    pub sha: std::string::String,
7787
7788    /// Output only. The path of the file or directory within the tree (e.g.,
7789    /// "src/main/java/MyClass.java"). Output-only.
7790    pub path: std::string::String,
7791
7792    /// Output only. The file mode as a string (e.g., "100644"). Indicates file
7793    /// type. Output-only.
7794    pub mode: std::string::String,
7795
7796    /// Output only. The size of the object in bytes (only for blobs). Output-only.
7797    pub size: i64,
7798
7799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7800}
7801
7802impl TreeEntry {
7803    /// Creates a new default instance.
7804    pub fn new() -> Self {
7805        std::default::Default::default()
7806    }
7807
7808    /// Sets the value of [r#type][crate::model::TreeEntry::type].
7809    ///
7810    /// # Example
7811    /// ```ignore,no_run
7812    /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7813    /// use google_cloud_securesourcemanager_v1::model::tree_entry::ObjectType;
7814    /// let x0 = TreeEntry::new().set_type(ObjectType::Tree);
7815    /// let x1 = TreeEntry::new().set_type(ObjectType::Blob);
7816    /// let x2 = TreeEntry::new().set_type(ObjectType::Commit);
7817    /// ```
7818    pub fn set_type<T: std::convert::Into<crate::model::tree_entry::ObjectType>>(
7819        mut self,
7820        v: T,
7821    ) -> Self {
7822        self.r#type = v.into();
7823        self
7824    }
7825
7826    /// Sets the value of [sha][crate::model::TreeEntry::sha].
7827    ///
7828    /// # Example
7829    /// ```ignore,no_run
7830    /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7831    /// let x = TreeEntry::new().set_sha("example");
7832    /// ```
7833    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7834        self.sha = v.into();
7835        self
7836    }
7837
7838    /// Sets the value of [path][crate::model::TreeEntry::path].
7839    ///
7840    /// # Example
7841    /// ```ignore,no_run
7842    /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7843    /// let x = TreeEntry::new().set_path("example");
7844    /// ```
7845    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7846        self.path = v.into();
7847        self
7848    }
7849
7850    /// Sets the value of [mode][crate::model::TreeEntry::mode].
7851    ///
7852    /// # Example
7853    /// ```ignore,no_run
7854    /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7855    /// let x = TreeEntry::new().set_mode("example");
7856    /// ```
7857    pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7858        self.mode = v.into();
7859        self
7860    }
7861
7862    /// Sets the value of [size][crate::model::TreeEntry::size].
7863    ///
7864    /// # Example
7865    /// ```ignore,no_run
7866    /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7867    /// let x = TreeEntry::new().set_size(42);
7868    /// ```
7869    pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7870        self.size = v.into();
7871        self
7872    }
7873}
7874
7875impl wkt::message::Message for TreeEntry {
7876    fn typename() -> &'static str {
7877        "type.googleapis.com/google.cloud.securesourcemanager.v1.TreeEntry"
7878    }
7879}
7880
7881/// Defines additional types related to [TreeEntry].
7882pub mod tree_entry {
7883    #[allow(unused_imports)]
7884    use super::*;
7885
7886    /// Defines the type of object the TreeEntry represents.
7887    ///
7888    /// # Working with unknown values
7889    ///
7890    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7891    /// additional enum variants at any time. Adding new variants is not considered
7892    /// a breaking change. Applications should write their code in anticipation of:
7893    ///
7894    /// - New values appearing in future releases of the client library, **and**
7895    /// - New values received dynamically, without application changes.
7896    ///
7897    /// Please consult the [Working with enums] section in the user guide for some
7898    /// guidelines.
7899    ///
7900    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7901    #[derive(Clone, Debug, PartialEq)]
7902    #[non_exhaustive]
7903    pub enum ObjectType {
7904        /// Default value, indicating the object type is unspecified.
7905        Unspecified,
7906        /// Represents a directory (folder).
7907        Tree,
7908        /// Represents a file (contains file data).
7909        Blob,
7910        /// Represents a pointer to another repository (submodule).
7911        Commit,
7912        /// If set, the enum was initialized with an unknown value.
7913        ///
7914        /// Applications can examine the value using [ObjectType::value] or
7915        /// [ObjectType::name].
7916        UnknownValue(object_type::UnknownValue),
7917    }
7918
7919    #[doc(hidden)]
7920    pub mod object_type {
7921        #[allow(unused_imports)]
7922        use super::*;
7923        #[derive(Clone, Debug, PartialEq)]
7924        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7925    }
7926
7927    impl ObjectType {
7928        /// Gets the enum value.
7929        ///
7930        /// Returns `None` if the enum contains an unknown value deserialized from
7931        /// the string representation of enums.
7932        pub fn value(&self) -> std::option::Option<i32> {
7933            match self {
7934                Self::Unspecified => std::option::Option::Some(0),
7935                Self::Tree => std::option::Option::Some(1),
7936                Self::Blob => std::option::Option::Some(2),
7937                Self::Commit => std::option::Option::Some(3),
7938                Self::UnknownValue(u) => u.0.value(),
7939            }
7940        }
7941
7942        /// Gets the enum value as a string.
7943        ///
7944        /// Returns `None` if the enum contains an unknown value deserialized from
7945        /// the integer representation of enums.
7946        pub fn name(&self) -> std::option::Option<&str> {
7947            match self {
7948                Self::Unspecified => std::option::Option::Some("OBJECT_TYPE_UNSPECIFIED"),
7949                Self::Tree => std::option::Option::Some("TREE"),
7950                Self::Blob => std::option::Option::Some("BLOB"),
7951                Self::Commit => std::option::Option::Some("COMMIT"),
7952                Self::UnknownValue(u) => u.0.name(),
7953            }
7954        }
7955    }
7956
7957    impl std::default::Default for ObjectType {
7958        fn default() -> Self {
7959            use std::convert::From;
7960            Self::from(0)
7961        }
7962    }
7963
7964    impl std::fmt::Display for ObjectType {
7965        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7966            wkt::internal::display_enum(f, self.name(), self.value())
7967        }
7968    }
7969
7970    impl std::convert::From<i32> for ObjectType {
7971        fn from(value: i32) -> Self {
7972            match value {
7973                0 => Self::Unspecified,
7974                1 => Self::Tree,
7975                2 => Self::Blob,
7976                3 => Self::Commit,
7977                _ => Self::UnknownValue(object_type::UnknownValue(
7978                    wkt::internal::UnknownEnumValue::Integer(value),
7979                )),
7980            }
7981        }
7982    }
7983
7984    impl std::convert::From<&str> for ObjectType {
7985        fn from(value: &str) -> Self {
7986            use std::string::ToString;
7987            match value {
7988                "OBJECT_TYPE_UNSPECIFIED" => Self::Unspecified,
7989                "TREE" => Self::Tree,
7990                "BLOB" => Self::Blob,
7991                "COMMIT" => Self::Commit,
7992                _ => Self::UnknownValue(object_type::UnknownValue(
7993                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7994                )),
7995            }
7996        }
7997    }
7998
7999    impl serde::ser::Serialize for ObjectType {
8000        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8001        where
8002            S: serde::Serializer,
8003        {
8004            match self {
8005                Self::Unspecified => serializer.serialize_i32(0),
8006                Self::Tree => serializer.serialize_i32(1),
8007                Self::Blob => serializer.serialize_i32(2),
8008                Self::Commit => serializer.serialize_i32(3),
8009                Self::UnknownValue(u) => u.0.serialize(serializer),
8010            }
8011        }
8012    }
8013
8014    impl<'de> serde::de::Deserialize<'de> for ObjectType {
8015        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8016        where
8017            D: serde::Deserializer<'de>,
8018        {
8019            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ObjectType>::new(
8020                ".google.cloud.securesourcemanager.v1.TreeEntry.ObjectType",
8021            ))
8022        }
8023    }
8024}
8025
8026/// Request message for fetching a tree structure from a repository.
8027#[derive(Clone, Default, PartialEq)]
8028#[non_exhaustive]
8029pub struct FetchTreeRequest {
8030    /// Required. The format is
8031    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
8032    /// Specifies the repository to fetch the tree from.
8033    pub repository: std::string::String,
8034
8035    /// Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies
8036    /// which tree to fetch. If not specified, the default branch will be used.
8037    pub r#ref: std::string::String,
8038
8039    /// Optional. If true, include all subfolders and their files in the response.
8040    /// If false, only the immediate children are returned.
8041    pub recursive: bool,
8042
8043    /// Optional. Requested page size.  Server may return fewer items than
8044    /// requested. If unspecified, at most 10,000 items will be returned.
8045    pub page_size: i32,
8046
8047    /// Optional. A token identifying a page of results the server should return.
8048    pub page_token: std::string::String,
8049
8050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8051}
8052
8053impl FetchTreeRequest {
8054    /// Creates a new default instance.
8055    pub fn new() -> Self {
8056        std::default::Default::default()
8057    }
8058
8059    /// Sets the value of [repository][crate::model::FetchTreeRequest::repository].
8060    ///
8061    /// # Example
8062    /// ```ignore,no_run
8063    /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
8064    /// # let project_id = "project_id";
8065    /// # let location_id = "location_id";
8066    /// # let repository_id = "repository_id";
8067    /// let x = FetchTreeRequest::new().set_repository(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
8068    /// ```
8069    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8070        self.repository = v.into();
8071        self
8072    }
8073
8074    /// Sets the value of [r#ref][crate::model::FetchTreeRequest::ref].
8075    ///
8076    /// # Example
8077    /// ```ignore,no_run
8078    /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
8079    /// let x = FetchTreeRequest::new().set_ref("example");
8080    /// ```
8081    pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8082        self.r#ref = v.into();
8083        self
8084    }
8085
8086    /// Sets the value of [recursive][crate::model::FetchTreeRequest::recursive].
8087    ///
8088    /// # Example
8089    /// ```ignore,no_run
8090    /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
8091    /// let x = FetchTreeRequest::new().set_recursive(true);
8092    /// ```
8093    pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8094        self.recursive = v.into();
8095        self
8096    }
8097
8098    /// Sets the value of [page_size][crate::model::FetchTreeRequest::page_size].
8099    ///
8100    /// # Example
8101    /// ```ignore,no_run
8102    /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
8103    /// let x = FetchTreeRequest::new().set_page_size(42);
8104    /// ```
8105    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8106        self.page_size = v.into();
8107        self
8108    }
8109
8110    /// Sets the value of [page_token][crate::model::FetchTreeRequest::page_token].
8111    ///
8112    /// # Example
8113    /// ```ignore,no_run
8114    /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
8115    /// let x = FetchTreeRequest::new().set_page_token("example");
8116    /// ```
8117    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8118        self.page_token = v.into();
8119        self
8120    }
8121}
8122
8123impl wkt::message::Message for FetchTreeRequest {
8124    fn typename() -> &'static str {
8125        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchTreeRequest"
8126    }
8127}
8128
8129/// Response message containing a list of TreeEntry objects.
8130#[derive(Clone, Default, PartialEq)]
8131#[non_exhaustive]
8132pub struct FetchTreeResponse {
8133    /// The list of TreeEntry objects.
8134    pub tree_entries: std::vec::Vec<crate::model::TreeEntry>,
8135
8136    /// A token identifying a page of results the server should return.
8137    pub next_page_token: std::string::String,
8138
8139    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8140}
8141
8142impl FetchTreeResponse {
8143    /// Creates a new default instance.
8144    pub fn new() -> Self {
8145        std::default::Default::default()
8146    }
8147
8148    /// Sets the value of [tree_entries][crate::model::FetchTreeResponse::tree_entries].
8149    ///
8150    /// # Example
8151    /// ```ignore,no_run
8152    /// # use google_cloud_securesourcemanager_v1::model::FetchTreeResponse;
8153    /// use google_cloud_securesourcemanager_v1::model::TreeEntry;
8154    /// let x = FetchTreeResponse::new()
8155    ///     .set_tree_entries([
8156    ///         TreeEntry::default()/* use setters */,
8157    ///         TreeEntry::default()/* use (different) setters */,
8158    ///     ]);
8159    /// ```
8160    pub fn set_tree_entries<T, V>(mut self, v: T) -> Self
8161    where
8162        T: std::iter::IntoIterator<Item = V>,
8163        V: std::convert::Into<crate::model::TreeEntry>,
8164    {
8165        use std::iter::Iterator;
8166        self.tree_entries = v.into_iter().map(|i| i.into()).collect();
8167        self
8168    }
8169
8170    /// Sets the value of [next_page_token][crate::model::FetchTreeResponse::next_page_token].
8171    ///
8172    /// # Example
8173    /// ```ignore,no_run
8174    /// # use google_cloud_securesourcemanager_v1::model::FetchTreeResponse;
8175    /// let x = FetchTreeResponse::new().set_next_page_token("example");
8176    /// ```
8177    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8178        self.next_page_token = v.into();
8179        self
8180    }
8181}
8182
8183impl wkt::message::Message for FetchTreeResponse {
8184    fn typename() -> &'static str {
8185        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchTreeResponse"
8186    }
8187}
8188
8189#[doc(hidden)]
8190impl google_cloud_gax::paginator::internal::PageableResponse for FetchTreeResponse {
8191    type PageItem = crate::model::TreeEntry;
8192
8193    fn items(self) -> std::vec::Vec<Self::PageItem> {
8194        self.tree_entries
8195    }
8196
8197    fn next_page_token(&self) -> std::string::String {
8198        use std::clone::Clone;
8199        self.next_page_token.clone()
8200    }
8201}
8202
8203/// Request message for fetching a blob (file content) from a repository.
8204#[derive(Clone, Default, PartialEq)]
8205#[non_exhaustive]
8206pub struct FetchBlobRequest {
8207    /// Required. The format is
8208    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
8209    /// Specifies the repository containing the blob.
8210    pub repository: std::string::String,
8211
8212    /// Required. The SHA-1 hash of the blob to retrieve.
8213    pub sha: std::string::String,
8214
8215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8216}
8217
8218impl FetchBlobRequest {
8219    /// Creates a new default instance.
8220    pub fn new() -> Self {
8221        std::default::Default::default()
8222    }
8223
8224    /// Sets the value of [repository][crate::model::FetchBlobRequest::repository].
8225    ///
8226    /// # Example
8227    /// ```ignore,no_run
8228    /// # use google_cloud_securesourcemanager_v1::model::FetchBlobRequest;
8229    /// # let project_id = "project_id";
8230    /// # let location_id = "location_id";
8231    /// # let repository_id = "repository_id";
8232    /// let x = FetchBlobRequest::new().set_repository(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
8233    /// ```
8234    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8235        self.repository = v.into();
8236        self
8237    }
8238
8239    /// Sets the value of [sha][crate::model::FetchBlobRequest::sha].
8240    ///
8241    /// # Example
8242    /// ```ignore,no_run
8243    /// # use google_cloud_securesourcemanager_v1::model::FetchBlobRequest;
8244    /// let x = FetchBlobRequest::new().set_sha("example");
8245    /// ```
8246    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8247        self.sha = v.into();
8248        self
8249    }
8250}
8251
8252impl wkt::message::Message for FetchBlobRequest {
8253    fn typename() -> &'static str {
8254        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchBlobRequest"
8255    }
8256}
8257
8258/// Response message containing the content of a blob.
8259#[derive(Clone, Default, PartialEq)]
8260#[non_exhaustive]
8261pub struct FetchBlobResponse {
8262    /// The SHA-1 hash of the blob.
8263    pub sha: std::string::String,
8264
8265    /// The content of the blob, encoded as base64.
8266    pub content: std::string::String,
8267
8268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8269}
8270
8271impl FetchBlobResponse {
8272    /// Creates a new default instance.
8273    pub fn new() -> Self {
8274        std::default::Default::default()
8275    }
8276
8277    /// Sets the value of [sha][crate::model::FetchBlobResponse::sha].
8278    ///
8279    /// # Example
8280    /// ```ignore,no_run
8281    /// # use google_cloud_securesourcemanager_v1::model::FetchBlobResponse;
8282    /// let x = FetchBlobResponse::new().set_sha("example");
8283    /// ```
8284    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8285        self.sha = v.into();
8286        self
8287    }
8288
8289    /// Sets the value of [content][crate::model::FetchBlobResponse::content].
8290    ///
8291    /// # Example
8292    /// ```ignore,no_run
8293    /// # use google_cloud_securesourcemanager_v1::model::FetchBlobResponse;
8294    /// let x = FetchBlobResponse::new().set_content("example");
8295    /// ```
8296    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8297        self.content = v.into();
8298        self
8299    }
8300}
8301
8302impl wkt::message::Message for FetchBlobResponse {
8303    fn typename() -> &'static str {
8304        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchBlobResponse"
8305    }
8306}
8307
8308/// Request message for fetching git references from a repository.
8309#[derive(Clone, Default, PartialEq)]
8310#[non_exhaustive]
8311pub struct FetchRefsRequest {
8312    /// Required. The format is
8313    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
8314    /// Specifies the repository to fetch the references from.
8315    pub repository: std::string::String,
8316
8317    /// Optional. The type of reference to fetch (eg. branch, tag). By default, all
8318    /// references are returned.
8319    pub r#type: crate::model::r#ref::RefType,
8320
8321    /// Optional. Requested page size. If unspecified, a default size of 30 will be
8322    /// used. The maximum value is 100; values above 100 will be coerced to 100.
8323    pub page_size: i32,
8324
8325    /// Optional. A token identifying a page of results the server should return.
8326    pub page_token: std::string::String,
8327
8328    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8329}
8330
8331impl FetchRefsRequest {
8332    /// Creates a new default instance.
8333    pub fn new() -> Self {
8334        std::default::Default::default()
8335    }
8336
8337    /// Sets the value of [repository][crate::model::FetchRefsRequest::repository].
8338    ///
8339    /// # Example
8340    /// ```ignore,no_run
8341    /// # use google_cloud_securesourcemanager_v1::model::FetchRefsRequest;
8342    /// # let project_id = "project_id";
8343    /// # let location_id = "location_id";
8344    /// # let repository_id = "repository_id";
8345    /// let x = FetchRefsRequest::new().set_repository(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"));
8346    /// ```
8347    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8348        self.repository = v.into();
8349        self
8350    }
8351
8352    /// Sets the value of [r#type][crate::model::FetchRefsRequest::type].
8353    ///
8354    /// # Example
8355    /// ```ignore,no_run
8356    /// # use google_cloud_securesourcemanager_v1::model::FetchRefsRequest;
8357    /// use google_cloud_securesourcemanager_v1::model::r#ref::RefType;
8358    /// let x0 = FetchRefsRequest::new().set_type(RefType::Branch);
8359    /// let x1 = FetchRefsRequest::new().set_type(RefType::Tag);
8360    /// ```
8361    pub fn set_type<T: std::convert::Into<crate::model::r#ref::RefType>>(mut self, v: T) -> Self {
8362        self.r#type = v.into();
8363        self
8364    }
8365
8366    /// Sets the value of [page_size][crate::model::FetchRefsRequest::page_size].
8367    ///
8368    /// # Example
8369    /// ```ignore,no_run
8370    /// # use google_cloud_securesourcemanager_v1::model::FetchRefsRequest;
8371    /// let x = FetchRefsRequest::new().set_page_size(42);
8372    /// ```
8373    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8374        self.page_size = v.into();
8375        self
8376    }
8377
8378    /// Sets the value of [page_token][crate::model::FetchRefsRequest::page_token].
8379    ///
8380    /// # Example
8381    /// ```ignore,no_run
8382    /// # use google_cloud_securesourcemanager_v1::model::FetchRefsRequest;
8383    /// let x = FetchRefsRequest::new().set_page_token("example");
8384    /// ```
8385    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8386        self.page_token = v.into();
8387        self
8388    }
8389}
8390
8391impl wkt::message::Message for FetchRefsRequest {
8392    fn typename() -> &'static str {
8393        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchRefsRequest"
8394    }
8395}
8396
8397/// Response message containing a list of git references.
8398#[derive(Clone, Default, PartialEq)]
8399#[non_exhaustive]
8400pub struct FetchRefsResponse {
8401    /// The list of git references.
8402    pub refs: std::vec::Vec<crate::model::Ref>,
8403
8404    /// A token identifying a page of results the server should return.
8405    pub next_page_token: std::string::String,
8406
8407    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8408}
8409
8410impl FetchRefsResponse {
8411    /// Creates a new default instance.
8412    pub fn new() -> Self {
8413        std::default::Default::default()
8414    }
8415
8416    /// Sets the value of [refs][crate::model::FetchRefsResponse::refs].
8417    ///
8418    /// # Example
8419    /// ```ignore,no_run
8420    /// # use google_cloud_securesourcemanager_v1::model::FetchRefsResponse;
8421    /// use google_cloud_securesourcemanager_v1::model::Ref;
8422    /// let x = FetchRefsResponse::new()
8423    ///     .set_refs([
8424    ///         Ref::default()/* use setters */,
8425    ///         Ref::default()/* use (different) setters */,
8426    ///     ]);
8427    /// ```
8428    pub fn set_refs<T, V>(mut self, v: T) -> Self
8429    where
8430        T: std::iter::IntoIterator<Item = V>,
8431        V: std::convert::Into<crate::model::Ref>,
8432    {
8433        use std::iter::Iterator;
8434        self.refs = v.into_iter().map(|i| i.into()).collect();
8435        self
8436    }
8437
8438    /// Sets the value of [next_page_token][crate::model::FetchRefsResponse::next_page_token].
8439    ///
8440    /// # Example
8441    /// ```ignore,no_run
8442    /// # use google_cloud_securesourcemanager_v1::model::FetchRefsResponse;
8443    /// let x = FetchRefsResponse::new().set_next_page_token("example");
8444    /// ```
8445    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8446        self.next_page_token = v.into();
8447        self
8448    }
8449}
8450
8451impl wkt::message::Message for FetchRefsResponse {
8452    fn typename() -> &'static str {
8453        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchRefsResponse"
8454    }
8455}
8456
8457#[doc(hidden)]
8458impl google_cloud_gax::paginator::internal::PageableResponse for FetchRefsResponse {
8459    type PageItem = crate::model::Ref;
8460
8461    fn items(self) -> std::vec::Vec<Self::PageItem> {
8462        self.refs
8463    }
8464
8465    fn next_page_token(&self) -> std::string::String {
8466        use std::clone::Clone;
8467        self.next_page_token.clone()
8468    }
8469}
8470
8471/// The request to list pull request comments.
8472#[derive(Clone, Default, PartialEq)]
8473#[non_exhaustive]
8474pub struct ListPullRequestCommentsRequest {
8475    /// Required. The pull request in which to list pull request comments. Format:
8476    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
8477    pub parent: std::string::String,
8478
8479    /// Optional. Requested page size. If unspecified, a default size of 30 will be
8480    /// used. The maximum value is 100; values above 100 will be coerced to 100.
8481    pub page_size: i32,
8482
8483    /// Optional. A token identifying a page of results the server should return.
8484    pub page_token: std::string::String,
8485
8486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8487}
8488
8489impl ListPullRequestCommentsRequest {
8490    /// Creates a new default instance.
8491    pub fn new() -> Self {
8492        std::default::Default::default()
8493    }
8494
8495    /// Sets the value of [parent][crate::model::ListPullRequestCommentsRequest::parent].
8496    ///
8497    /// # Example
8498    /// ```ignore,no_run
8499    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsRequest;
8500    /// # let project_id = "project_id";
8501    /// # let location_id = "location_id";
8502    /// # let repository_id = "repository_id";
8503    /// # let pull_request_id = "pull_request_id";
8504    /// let x = ListPullRequestCommentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
8505    /// ```
8506    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8507        self.parent = v.into();
8508        self
8509    }
8510
8511    /// Sets the value of [page_size][crate::model::ListPullRequestCommentsRequest::page_size].
8512    ///
8513    /// # Example
8514    /// ```ignore,no_run
8515    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsRequest;
8516    /// let x = ListPullRequestCommentsRequest::new().set_page_size(42);
8517    /// ```
8518    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8519        self.page_size = v.into();
8520        self
8521    }
8522
8523    /// Sets the value of [page_token][crate::model::ListPullRequestCommentsRequest::page_token].
8524    ///
8525    /// # Example
8526    /// ```ignore,no_run
8527    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsRequest;
8528    /// let x = ListPullRequestCommentsRequest::new().set_page_token("example");
8529    /// ```
8530    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8531        self.page_token = v.into();
8532        self
8533    }
8534}
8535
8536impl wkt::message::Message for ListPullRequestCommentsRequest {
8537    fn typename() -> &'static str {
8538        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest"
8539    }
8540}
8541
8542/// The response to list pull request comments.
8543#[derive(Clone, Default, PartialEq)]
8544#[non_exhaustive]
8545pub struct ListPullRequestCommentsResponse {
8546    /// The list of pull request comments.
8547    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
8548
8549    /// A token to set as page_token to retrieve the next page. If this field is
8550    /// omitted, there are no subsequent pages.
8551    pub next_page_token: std::string::String,
8552
8553    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8554}
8555
8556impl ListPullRequestCommentsResponse {
8557    /// Creates a new default instance.
8558    pub fn new() -> Self {
8559        std::default::Default::default()
8560    }
8561
8562    /// Sets the value of [pull_request_comments][crate::model::ListPullRequestCommentsResponse::pull_request_comments].
8563    ///
8564    /// # Example
8565    /// ```ignore,no_run
8566    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsResponse;
8567    /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8568    /// let x = ListPullRequestCommentsResponse::new()
8569    ///     .set_pull_request_comments([
8570    ///         PullRequestComment::default()/* use setters */,
8571    ///         PullRequestComment::default()/* use (different) setters */,
8572    ///     ]);
8573    /// ```
8574    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
8575    where
8576        T: std::iter::IntoIterator<Item = V>,
8577        V: std::convert::Into<crate::model::PullRequestComment>,
8578    {
8579        use std::iter::Iterator;
8580        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
8581        self
8582    }
8583
8584    /// Sets the value of [next_page_token][crate::model::ListPullRequestCommentsResponse::next_page_token].
8585    ///
8586    /// # Example
8587    /// ```ignore,no_run
8588    /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsResponse;
8589    /// let x = ListPullRequestCommentsResponse::new().set_next_page_token("example");
8590    /// ```
8591    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8592        self.next_page_token = v.into();
8593        self
8594    }
8595}
8596
8597impl wkt::message::Message for ListPullRequestCommentsResponse {
8598    fn typename() -> &'static str {
8599        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestCommentsResponse"
8600    }
8601}
8602
8603#[doc(hidden)]
8604impl google_cloud_gax::paginator::internal::PageableResponse for ListPullRequestCommentsResponse {
8605    type PageItem = crate::model::PullRequestComment;
8606
8607    fn items(self) -> std::vec::Vec<Self::PageItem> {
8608        self.pull_request_comments
8609    }
8610
8611    fn next_page_token(&self) -> std::string::String {
8612        use std::clone::Clone;
8613        self.next_page_token.clone()
8614    }
8615}
8616
8617/// The request to create a pull request comment.
8618#[derive(Clone, Default, PartialEq)]
8619#[non_exhaustive]
8620pub struct CreatePullRequestCommentRequest {
8621    /// Required. The pull request in which to create the pull request comment.
8622    /// Format:
8623    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
8624    pub parent: std::string::String,
8625
8626    /// Required. The pull request comment to create.
8627    pub pull_request_comment: std::option::Option<crate::model::PullRequestComment>,
8628
8629    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8630}
8631
8632impl CreatePullRequestCommentRequest {
8633    /// Creates a new default instance.
8634    pub fn new() -> Self {
8635        std::default::Default::default()
8636    }
8637
8638    /// Sets the value of [parent][crate::model::CreatePullRequestCommentRequest::parent].
8639    ///
8640    /// # Example
8641    /// ```ignore,no_run
8642    /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestCommentRequest;
8643    /// # let project_id = "project_id";
8644    /// # let location_id = "location_id";
8645    /// # let repository_id = "repository_id";
8646    /// # let pull_request_id = "pull_request_id";
8647    /// let x = CreatePullRequestCommentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
8648    /// ```
8649    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8650        self.parent = v.into();
8651        self
8652    }
8653
8654    /// Sets the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
8655    ///
8656    /// # Example
8657    /// ```ignore,no_run
8658    /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestCommentRequest;
8659    /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8660    /// let x = CreatePullRequestCommentRequest::new().set_pull_request_comment(PullRequestComment::default()/* use setters */);
8661    /// ```
8662    pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
8663    where
8664        T: std::convert::Into<crate::model::PullRequestComment>,
8665    {
8666        self.pull_request_comment = std::option::Option::Some(v.into());
8667        self
8668    }
8669
8670    /// Sets or clears the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
8671    ///
8672    /// # Example
8673    /// ```ignore,no_run
8674    /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestCommentRequest;
8675    /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8676    /// let x = CreatePullRequestCommentRequest::new().set_or_clear_pull_request_comment(Some(PullRequestComment::default()/* use setters */));
8677    /// let x = CreatePullRequestCommentRequest::new().set_or_clear_pull_request_comment(None::<PullRequestComment>);
8678    /// ```
8679    pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
8680    where
8681        T: std::convert::Into<crate::model::PullRequestComment>,
8682    {
8683        self.pull_request_comment = v.map(|x| x.into());
8684        self
8685    }
8686}
8687
8688impl wkt::message::Message for CreatePullRequestCommentRequest {
8689    fn typename() -> &'static str {
8690        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest"
8691    }
8692}
8693
8694/// The request to batch create pull request comments.
8695#[derive(Clone, Default, PartialEq)]
8696#[non_exhaustive]
8697pub struct BatchCreatePullRequestCommentsRequest {
8698    /// Required. The pull request in which to create the pull request comments.
8699    /// Format:
8700    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
8701    pub parent: std::string::String,
8702
8703    /// Required. The request message specifying the resources to create. There
8704    /// should be exactly one CreatePullRequestCommentRequest with CommentDetail
8705    /// being REVIEW in the list, and no more than 100
8706    /// CreatePullRequestCommentRequests with CommentDetail being CODE in the list
8707    pub requests: std::vec::Vec<crate::model::CreatePullRequestCommentRequest>,
8708
8709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8710}
8711
8712impl BatchCreatePullRequestCommentsRequest {
8713    /// Creates a new default instance.
8714    pub fn new() -> Self {
8715        std::default::Default::default()
8716    }
8717
8718    /// Sets the value of [parent][crate::model::BatchCreatePullRequestCommentsRequest::parent].
8719    ///
8720    /// # Example
8721    /// ```ignore,no_run
8722    /// # use google_cloud_securesourcemanager_v1::model::BatchCreatePullRequestCommentsRequest;
8723    /// # let project_id = "project_id";
8724    /// # let location_id = "location_id";
8725    /// # let repository_id = "repository_id";
8726    /// # let pull_request_id = "pull_request_id";
8727    /// let x = BatchCreatePullRequestCommentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
8728    /// ```
8729    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8730        self.parent = v.into();
8731        self
8732    }
8733
8734    /// Sets the value of [requests][crate::model::BatchCreatePullRequestCommentsRequest::requests].
8735    ///
8736    /// # Example
8737    /// ```ignore,no_run
8738    /// # use google_cloud_securesourcemanager_v1::model::BatchCreatePullRequestCommentsRequest;
8739    /// use google_cloud_securesourcemanager_v1::model::CreatePullRequestCommentRequest;
8740    /// let x = BatchCreatePullRequestCommentsRequest::new()
8741    ///     .set_requests([
8742    ///         CreatePullRequestCommentRequest::default()/* use setters */,
8743    ///         CreatePullRequestCommentRequest::default()/* use (different) setters */,
8744    ///     ]);
8745    /// ```
8746    pub fn set_requests<T, V>(mut self, v: T) -> Self
8747    where
8748        T: std::iter::IntoIterator<Item = V>,
8749        V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
8750    {
8751        use std::iter::Iterator;
8752        self.requests = v.into_iter().map(|i| i.into()).collect();
8753        self
8754    }
8755}
8756
8757impl wkt::message::Message for BatchCreatePullRequestCommentsRequest {
8758    fn typename() -> &'static str {
8759        "type.googleapis.com/google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest"
8760    }
8761}
8762
8763/// The response to batch create pull request comments.
8764#[derive(Clone, Default, PartialEq)]
8765#[non_exhaustive]
8766pub struct BatchCreatePullRequestCommentsResponse {
8767    /// The list of pull request comments created.
8768    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
8769
8770    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8771}
8772
8773impl BatchCreatePullRequestCommentsResponse {
8774    /// Creates a new default instance.
8775    pub fn new() -> Self {
8776        std::default::Default::default()
8777    }
8778
8779    /// Sets the value of [pull_request_comments][crate::model::BatchCreatePullRequestCommentsResponse::pull_request_comments].
8780    ///
8781    /// # Example
8782    /// ```ignore,no_run
8783    /// # use google_cloud_securesourcemanager_v1::model::BatchCreatePullRequestCommentsResponse;
8784    /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8785    /// let x = BatchCreatePullRequestCommentsResponse::new()
8786    ///     .set_pull_request_comments([
8787    ///         PullRequestComment::default()/* use setters */,
8788    ///         PullRequestComment::default()/* use (different) setters */,
8789    ///     ]);
8790    /// ```
8791    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
8792    where
8793        T: std::iter::IntoIterator<Item = V>,
8794        V: std::convert::Into<crate::model::PullRequestComment>,
8795    {
8796        use std::iter::Iterator;
8797        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
8798        self
8799    }
8800}
8801
8802impl wkt::message::Message for BatchCreatePullRequestCommentsResponse {
8803    fn typename() -> &'static str {
8804        "type.googleapis.com/google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsResponse"
8805    }
8806}
8807
8808/// The request to update a pull request comment.
8809#[derive(Clone, Default, PartialEq)]
8810#[non_exhaustive]
8811pub struct UpdatePullRequestCommentRequest {
8812    /// Required. The pull request comment to update.
8813    pub pull_request_comment: std::option::Option<crate::model::PullRequestComment>,
8814
8815    /// Optional. Field mask is used to specify the fields to be overwritten in the
8816    /// pull request comment resource by the update. Updatable fields are
8817    /// `body`.
8818    pub update_mask: std::option::Option<wkt::FieldMask>,
8819
8820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8821}
8822
8823impl UpdatePullRequestCommentRequest {
8824    /// Creates a new default instance.
8825    pub fn new() -> Self {
8826        std::default::Default::default()
8827    }
8828
8829    /// Sets the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
8830    ///
8831    /// # Example
8832    /// ```ignore,no_run
8833    /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestCommentRequest;
8834    /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8835    /// let x = UpdatePullRequestCommentRequest::new().set_pull_request_comment(PullRequestComment::default()/* use setters */);
8836    /// ```
8837    pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
8838    where
8839        T: std::convert::Into<crate::model::PullRequestComment>,
8840    {
8841        self.pull_request_comment = std::option::Option::Some(v.into());
8842        self
8843    }
8844
8845    /// Sets or clears the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
8846    ///
8847    /// # Example
8848    /// ```ignore,no_run
8849    /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestCommentRequest;
8850    /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8851    /// let x = UpdatePullRequestCommentRequest::new().set_or_clear_pull_request_comment(Some(PullRequestComment::default()/* use setters */));
8852    /// let x = UpdatePullRequestCommentRequest::new().set_or_clear_pull_request_comment(None::<PullRequestComment>);
8853    /// ```
8854    pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
8855    where
8856        T: std::convert::Into<crate::model::PullRequestComment>,
8857    {
8858        self.pull_request_comment = v.map(|x| x.into());
8859        self
8860    }
8861
8862    /// Sets the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
8863    ///
8864    /// # Example
8865    /// ```ignore,no_run
8866    /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestCommentRequest;
8867    /// use wkt::FieldMask;
8868    /// let x = UpdatePullRequestCommentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8869    /// ```
8870    pub fn set_update_mask<T>(mut self, v: T) -> Self
8871    where
8872        T: std::convert::Into<wkt::FieldMask>,
8873    {
8874        self.update_mask = std::option::Option::Some(v.into());
8875        self
8876    }
8877
8878    /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
8879    ///
8880    /// # Example
8881    /// ```ignore,no_run
8882    /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestCommentRequest;
8883    /// use wkt::FieldMask;
8884    /// let x = UpdatePullRequestCommentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8885    /// let x = UpdatePullRequestCommentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8886    /// ```
8887    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8888    where
8889        T: std::convert::Into<wkt::FieldMask>,
8890    {
8891        self.update_mask = v.map(|x| x.into());
8892        self
8893    }
8894}
8895
8896impl wkt::message::Message for UpdatePullRequestCommentRequest {
8897    fn typename() -> &'static str {
8898        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest"
8899    }
8900}
8901
8902/// The request to delete a pull request comment. A Review PullRequestComment
8903/// cannot be deleted.
8904#[derive(Clone, Default, PartialEq)]
8905#[non_exhaustive]
8906pub struct DeletePullRequestCommentRequest {
8907    /// Required. Name of the pull request comment to delete.
8908    /// The format is
8909    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`.
8910    pub name: std::string::String,
8911
8912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8913}
8914
8915impl DeletePullRequestCommentRequest {
8916    /// Creates a new default instance.
8917    pub fn new() -> Self {
8918        std::default::Default::default()
8919    }
8920
8921    /// Sets the value of [name][crate::model::DeletePullRequestCommentRequest::name].
8922    ///
8923    /// # Example
8924    /// ```ignore,no_run
8925    /// # use google_cloud_securesourcemanager_v1::model::DeletePullRequestCommentRequest;
8926    /// # let project_id = "project_id";
8927    /// # let location_id = "location_id";
8928    /// # let repository_id = "repository_id";
8929    /// # let pull_request_id = "pull_request_id";
8930    /// # let comment_id = "comment_id";
8931    /// let x = DeletePullRequestCommentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}"));
8932    /// ```
8933    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8934        self.name = v.into();
8935        self
8936    }
8937}
8938
8939impl wkt::message::Message for DeletePullRequestCommentRequest {
8940    fn typename() -> &'static str {
8941        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest"
8942    }
8943}
8944
8945/// The request to get a pull request comment.
8946#[derive(Clone, Default, PartialEq)]
8947#[non_exhaustive]
8948pub struct GetPullRequestCommentRequest {
8949    /// Required. Name of the pull request comment to retrieve.
8950    /// The format is
8951    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`.
8952    pub name: std::string::String,
8953
8954    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8955}
8956
8957impl GetPullRequestCommentRequest {
8958    /// Creates a new default instance.
8959    pub fn new() -> Self {
8960        std::default::Default::default()
8961    }
8962
8963    /// Sets the value of [name][crate::model::GetPullRequestCommentRequest::name].
8964    ///
8965    /// # Example
8966    /// ```ignore,no_run
8967    /// # use google_cloud_securesourcemanager_v1::model::GetPullRequestCommentRequest;
8968    /// # let project_id = "project_id";
8969    /// # let location_id = "location_id";
8970    /// # let repository_id = "repository_id";
8971    /// # let pull_request_id = "pull_request_id";
8972    /// # let comment_id = "comment_id";
8973    /// let x = GetPullRequestCommentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}"));
8974    /// ```
8975    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8976        self.name = v.into();
8977        self
8978    }
8979}
8980
8981impl wkt::message::Message for GetPullRequestCommentRequest {
8982    fn typename() -> &'static str {
8983        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest"
8984    }
8985}
8986
8987/// The request to resolve multiple pull request comments.
8988#[derive(Clone, Default, PartialEq)]
8989#[non_exhaustive]
8990pub struct ResolvePullRequestCommentsRequest {
8991    /// Required. The pull request in which to resolve the pull request comments.
8992    /// Format:
8993    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
8994    pub parent: std::string::String,
8995
8996    /// Required. The names of the pull request comments to resolve. Format:
8997    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
8998    /// Only comments from the same threads are allowed in the same request.
8999    pub names: std::vec::Vec<std::string::String>,
9000
9001    /// Optional. If set, at least one comment in a thread is required, rest of the
9002    /// comments in the same thread will be automatically updated to resolved. If
9003    /// unset, all comments in the same thread need be present.
9004    pub auto_fill: bool,
9005
9006    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9007}
9008
9009impl ResolvePullRequestCommentsRequest {
9010    /// Creates a new default instance.
9011    pub fn new() -> Self {
9012        std::default::Default::default()
9013    }
9014
9015    /// Sets the value of [parent][crate::model::ResolvePullRequestCommentsRequest::parent].
9016    ///
9017    /// # Example
9018    /// ```ignore,no_run
9019    /// # use google_cloud_securesourcemanager_v1::model::ResolvePullRequestCommentsRequest;
9020    /// # let project_id = "project_id";
9021    /// # let location_id = "location_id";
9022    /// # let repository_id = "repository_id";
9023    /// # let pull_request_id = "pull_request_id";
9024    /// let x = ResolvePullRequestCommentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
9025    /// ```
9026    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9027        self.parent = v.into();
9028        self
9029    }
9030
9031    /// Sets the value of [names][crate::model::ResolvePullRequestCommentsRequest::names].
9032    ///
9033    /// # Example
9034    /// ```ignore,no_run
9035    /// # use google_cloud_securesourcemanager_v1::model::ResolvePullRequestCommentsRequest;
9036    /// let x = ResolvePullRequestCommentsRequest::new().set_names(["a", "b", "c"]);
9037    /// ```
9038    pub fn set_names<T, V>(mut self, v: T) -> Self
9039    where
9040        T: std::iter::IntoIterator<Item = V>,
9041        V: std::convert::Into<std::string::String>,
9042    {
9043        use std::iter::Iterator;
9044        self.names = v.into_iter().map(|i| i.into()).collect();
9045        self
9046    }
9047
9048    /// Sets the value of [auto_fill][crate::model::ResolvePullRequestCommentsRequest::auto_fill].
9049    ///
9050    /// # Example
9051    /// ```ignore,no_run
9052    /// # use google_cloud_securesourcemanager_v1::model::ResolvePullRequestCommentsRequest;
9053    /// let x = ResolvePullRequestCommentsRequest::new().set_auto_fill(true);
9054    /// ```
9055    pub fn set_auto_fill<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9056        self.auto_fill = v.into();
9057        self
9058    }
9059}
9060
9061impl wkt::message::Message for ResolvePullRequestCommentsRequest {
9062    fn typename() -> &'static str {
9063        "type.googleapis.com/google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsRequest"
9064    }
9065}
9066
9067/// The response to resolve multiple pull request comments.
9068#[derive(Clone, Default, PartialEq)]
9069#[non_exhaustive]
9070pub struct ResolvePullRequestCommentsResponse {
9071    /// The list of pull request comments resolved.
9072    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
9073
9074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9075}
9076
9077impl ResolvePullRequestCommentsResponse {
9078    /// Creates a new default instance.
9079    pub fn new() -> Self {
9080        std::default::Default::default()
9081    }
9082
9083    /// Sets the value of [pull_request_comments][crate::model::ResolvePullRequestCommentsResponse::pull_request_comments].
9084    ///
9085    /// # Example
9086    /// ```ignore,no_run
9087    /// # use google_cloud_securesourcemanager_v1::model::ResolvePullRequestCommentsResponse;
9088    /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
9089    /// let x = ResolvePullRequestCommentsResponse::new()
9090    ///     .set_pull_request_comments([
9091    ///         PullRequestComment::default()/* use setters */,
9092    ///         PullRequestComment::default()/* use (different) setters */,
9093    ///     ]);
9094    /// ```
9095    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
9096    where
9097        T: std::iter::IntoIterator<Item = V>,
9098        V: std::convert::Into<crate::model::PullRequestComment>,
9099    {
9100        use std::iter::Iterator;
9101        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
9102        self
9103    }
9104}
9105
9106impl wkt::message::Message for ResolvePullRequestCommentsResponse {
9107    fn typename() -> &'static str {
9108        "type.googleapis.com/google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsResponse"
9109    }
9110}
9111
9112/// The request to unresolve multiple pull request comments.
9113#[derive(Clone, Default, PartialEq)]
9114#[non_exhaustive]
9115pub struct UnresolvePullRequestCommentsRequest {
9116    /// Required. The pull request in which to resolve the pull request comments.
9117    /// Format:
9118    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
9119    pub parent: std::string::String,
9120
9121    /// Required. The names of the pull request comments to unresolve. Format:
9122    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
9123    /// Only comments from the same threads are allowed in the same request.
9124    pub names: std::vec::Vec<std::string::String>,
9125
9126    /// Optional. If set, at least one comment in a thread is required, rest of the
9127    /// comments in the same thread will be automatically updated to unresolved. If
9128    /// unset, all comments in the same thread need be present.
9129    pub auto_fill: bool,
9130
9131    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9132}
9133
9134impl UnresolvePullRequestCommentsRequest {
9135    /// Creates a new default instance.
9136    pub fn new() -> Self {
9137        std::default::Default::default()
9138    }
9139
9140    /// Sets the value of [parent][crate::model::UnresolvePullRequestCommentsRequest::parent].
9141    ///
9142    /// # Example
9143    /// ```ignore,no_run
9144    /// # use google_cloud_securesourcemanager_v1::model::UnresolvePullRequestCommentsRequest;
9145    /// # let project_id = "project_id";
9146    /// # let location_id = "location_id";
9147    /// # let repository_id = "repository_id";
9148    /// # let pull_request_id = "pull_request_id";
9149    /// let x = UnresolvePullRequestCommentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"));
9150    /// ```
9151    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9152        self.parent = v.into();
9153        self
9154    }
9155
9156    /// Sets the value of [names][crate::model::UnresolvePullRequestCommentsRequest::names].
9157    ///
9158    /// # Example
9159    /// ```ignore,no_run
9160    /// # use google_cloud_securesourcemanager_v1::model::UnresolvePullRequestCommentsRequest;
9161    /// let x = UnresolvePullRequestCommentsRequest::new().set_names(["a", "b", "c"]);
9162    /// ```
9163    pub fn set_names<T, V>(mut self, v: T) -> Self
9164    where
9165        T: std::iter::IntoIterator<Item = V>,
9166        V: std::convert::Into<std::string::String>,
9167    {
9168        use std::iter::Iterator;
9169        self.names = v.into_iter().map(|i| i.into()).collect();
9170        self
9171    }
9172
9173    /// Sets the value of [auto_fill][crate::model::UnresolvePullRequestCommentsRequest::auto_fill].
9174    ///
9175    /// # Example
9176    /// ```ignore,no_run
9177    /// # use google_cloud_securesourcemanager_v1::model::UnresolvePullRequestCommentsRequest;
9178    /// let x = UnresolvePullRequestCommentsRequest::new().set_auto_fill(true);
9179    /// ```
9180    pub fn set_auto_fill<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9181        self.auto_fill = v.into();
9182        self
9183    }
9184}
9185
9186impl wkt::message::Message for UnresolvePullRequestCommentsRequest {
9187    fn typename() -> &'static str {
9188        "type.googleapis.com/google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsRequest"
9189    }
9190}
9191
9192/// The response to unresolve multiple pull request comments.
9193#[derive(Clone, Default, PartialEq)]
9194#[non_exhaustive]
9195pub struct UnresolvePullRequestCommentsResponse {
9196    /// The list of pull request comments unresolved.
9197    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
9198
9199    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9200}
9201
9202impl UnresolvePullRequestCommentsResponse {
9203    /// Creates a new default instance.
9204    pub fn new() -> Self {
9205        std::default::Default::default()
9206    }
9207
9208    /// Sets the value of [pull_request_comments][crate::model::UnresolvePullRequestCommentsResponse::pull_request_comments].
9209    ///
9210    /// # Example
9211    /// ```ignore,no_run
9212    /// # use google_cloud_securesourcemanager_v1::model::UnresolvePullRequestCommentsResponse;
9213    /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
9214    /// let x = UnresolvePullRequestCommentsResponse::new()
9215    ///     .set_pull_request_comments([
9216    ///         PullRequestComment::default()/* use setters */,
9217    ///         PullRequestComment::default()/* use (different) setters */,
9218    ///     ]);
9219    /// ```
9220    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
9221    where
9222        T: std::iter::IntoIterator<Item = V>,
9223        V: std::convert::Into<crate::model::PullRequestComment>,
9224    {
9225        use std::iter::Iterator;
9226        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
9227        self
9228    }
9229}
9230
9231impl wkt::message::Message for UnresolvePullRequestCommentsResponse {
9232    fn typename() -> &'static str {
9233        "type.googleapis.com/google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsResponse"
9234    }
9235}
9236
9237/// The request to create an issue comment.
9238#[derive(Clone, Default, PartialEq)]
9239#[non_exhaustive]
9240pub struct CreateIssueCommentRequest {
9241    /// Required. The issue in which to create the issue comment. Format:
9242    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
9243    pub parent: std::string::String,
9244
9245    /// Required. The issue comment to create.
9246    pub issue_comment: std::option::Option<crate::model::IssueComment>,
9247
9248    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9249}
9250
9251impl CreateIssueCommentRequest {
9252    /// Creates a new default instance.
9253    pub fn new() -> Self {
9254        std::default::Default::default()
9255    }
9256
9257    /// Sets the value of [parent][crate::model::CreateIssueCommentRequest::parent].
9258    ///
9259    /// # Example
9260    /// ```ignore,no_run
9261    /// # use google_cloud_securesourcemanager_v1::model::CreateIssueCommentRequest;
9262    /// # let project_id = "project_id";
9263    /// # let location_id = "location_id";
9264    /// # let repository_id = "repository_id";
9265    /// # let issue_id = "issue_id";
9266    /// let x = CreateIssueCommentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"));
9267    /// ```
9268    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9269        self.parent = v.into();
9270        self
9271    }
9272
9273    /// Sets the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
9274    ///
9275    /// # Example
9276    /// ```ignore,no_run
9277    /// # use google_cloud_securesourcemanager_v1::model::CreateIssueCommentRequest;
9278    /// use google_cloud_securesourcemanager_v1::model::IssueComment;
9279    /// let x = CreateIssueCommentRequest::new().set_issue_comment(IssueComment::default()/* use setters */);
9280    /// ```
9281    pub fn set_issue_comment<T>(mut self, v: T) -> Self
9282    where
9283        T: std::convert::Into<crate::model::IssueComment>,
9284    {
9285        self.issue_comment = std::option::Option::Some(v.into());
9286        self
9287    }
9288
9289    /// Sets or clears the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
9290    ///
9291    /// # Example
9292    /// ```ignore,no_run
9293    /// # use google_cloud_securesourcemanager_v1::model::CreateIssueCommentRequest;
9294    /// use google_cloud_securesourcemanager_v1::model::IssueComment;
9295    /// let x = CreateIssueCommentRequest::new().set_or_clear_issue_comment(Some(IssueComment::default()/* use setters */));
9296    /// let x = CreateIssueCommentRequest::new().set_or_clear_issue_comment(None::<IssueComment>);
9297    /// ```
9298    pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
9299    where
9300        T: std::convert::Into<crate::model::IssueComment>,
9301    {
9302        self.issue_comment = v.map(|x| x.into());
9303        self
9304    }
9305}
9306
9307impl wkt::message::Message for CreateIssueCommentRequest {
9308    fn typename() -> &'static str {
9309        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateIssueCommentRequest"
9310    }
9311}
9312
9313/// The request to get an issue comment.
9314#[derive(Clone, Default, PartialEq)]
9315#[non_exhaustive]
9316pub struct GetIssueCommentRequest {
9317    /// Required. Name of the issue comment to retrieve.
9318    /// The format is
9319    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`.
9320    pub name: std::string::String,
9321
9322    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9323}
9324
9325impl GetIssueCommentRequest {
9326    /// Creates a new default instance.
9327    pub fn new() -> Self {
9328        std::default::Default::default()
9329    }
9330
9331    /// Sets the value of [name][crate::model::GetIssueCommentRequest::name].
9332    ///
9333    /// # Example
9334    /// ```ignore,no_run
9335    /// # use google_cloud_securesourcemanager_v1::model::GetIssueCommentRequest;
9336    /// # let project_id = "project_id";
9337    /// # let location_id = "location_id";
9338    /// # let repository_id = "repository_id";
9339    /// # let issue_id = "issue_id";
9340    /// # let comment_id = "comment_id";
9341    /// let x = GetIssueCommentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}"));
9342    /// ```
9343    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9344        self.name = v.into();
9345        self
9346    }
9347}
9348
9349impl wkt::message::Message for GetIssueCommentRequest {
9350    fn typename() -> &'static str {
9351        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetIssueCommentRequest"
9352    }
9353}
9354
9355/// The request to list issue comments.
9356#[derive(Clone, Default, PartialEq)]
9357#[non_exhaustive]
9358pub struct ListIssueCommentsRequest {
9359    /// Required. The issue in which to list the comments. Format:
9360    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
9361    pub parent: std::string::String,
9362
9363    /// Optional. Requested page size. If unspecified, a default size of 30 will be
9364    /// used. The maximum value is 100; values above 100 will be coerced to 100.
9365    pub page_size: i32,
9366
9367    /// Optional. A token identifying a page of results the server should return.
9368    pub page_token: std::string::String,
9369
9370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9371}
9372
9373impl ListIssueCommentsRequest {
9374    /// Creates a new default instance.
9375    pub fn new() -> Self {
9376        std::default::Default::default()
9377    }
9378
9379    /// Sets the value of [parent][crate::model::ListIssueCommentsRequest::parent].
9380    ///
9381    /// # Example
9382    /// ```ignore,no_run
9383    /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsRequest;
9384    /// # let project_id = "project_id";
9385    /// # let location_id = "location_id";
9386    /// # let repository_id = "repository_id";
9387    /// # let issue_id = "issue_id";
9388    /// let x = ListIssueCommentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"));
9389    /// ```
9390    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9391        self.parent = v.into();
9392        self
9393    }
9394
9395    /// Sets the value of [page_size][crate::model::ListIssueCommentsRequest::page_size].
9396    ///
9397    /// # Example
9398    /// ```ignore,no_run
9399    /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsRequest;
9400    /// let x = ListIssueCommentsRequest::new().set_page_size(42);
9401    /// ```
9402    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9403        self.page_size = v.into();
9404        self
9405    }
9406
9407    /// Sets the value of [page_token][crate::model::ListIssueCommentsRequest::page_token].
9408    ///
9409    /// # Example
9410    /// ```ignore,no_run
9411    /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsRequest;
9412    /// let x = ListIssueCommentsRequest::new().set_page_token("example");
9413    /// ```
9414    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9415        self.page_token = v.into();
9416        self
9417    }
9418}
9419
9420impl wkt::message::Message for ListIssueCommentsRequest {
9421    fn typename() -> &'static str {
9422        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssueCommentsRequest"
9423    }
9424}
9425
9426/// The response to list issue comments.
9427#[derive(Clone, Default, PartialEq)]
9428#[non_exhaustive]
9429pub struct ListIssueCommentsResponse {
9430    /// The list of issue comments.
9431    pub issue_comments: std::vec::Vec<crate::model::IssueComment>,
9432
9433    /// A token identifying a page of results the server should return.
9434    pub next_page_token: std::string::String,
9435
9436    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9437}
9438
9439impl ListIssueCommentsResponse {
9440    /// Creates a new default instance.
9441    pub fn new() -> Self {
9442        std::default::Default::default()
9443    }
9444
9445    /// Sets the value of [issue_comments][crate::model::ListIssueCommentsResponse::issue_comments].
9446    ///
9447    /// # Example
9448    /// ```ignore,no_run
9449    /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsResponse;
9450    /// use google_cloud_securesourcemanager_v1::model::IssueComment;
9451    /// let x = ListIssueCommentsResponse::new()
9452    ///     .set_issue_comments([
9453    ///         IssueComment::default()/* use setters */,
9454    ///         IssueComment::default()/* use (different) setters */,
9455    ///     ]);
9456    /// ```
9457    pub fn set_issue_comments<T, V>(mut self, v: T) -> Self
9458    where
9459        T: std::iter::IntoIterator<Item = V>,
9460        V: std::convert::Into<crate::model::IssueComment>,
9461    {
9462        use std::iter::Iterator;
9463        self.issue_comments = v.into_iter().map(|i| i.into()).collect();
9464        self
9465    }
9466
9467    /// Sets the value of [next_page_token][crate::model::ListIssueCommentsResponse::next_page_token].
9468    ///
9469    /// # Example
9470    /// ```ignore,no_run
9471    /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsResponse;
9472    /// let x = ListIssueCommentsResponse::new().set_next_page_token("example");
9473    /// ```
9474    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9475        self.next_page_token = v.into();
9476        self
9477    }
9478}
9479
9480impl wkt::message::Message for ListIssueCommentsResponse {
9481    fn typename() -> &'static str {
9482        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssueCommentsResponse"
9483    }
9484}
9485
9486#[doc(hidden)]
9487impl google_cloud_gax::paginator::internal::PageableResponse for ListIssueCommentsResponse {
9488    type PageItem = crate::model::IssueComment;
9489
9490    fn items(self) -> std::vec::Vec<Self::PageItem> {
9491        self.issue_comments
9492    }
9493
9494    fn next_page_token(&self) -> std::string::String {
9495        use std::clone::Clone;
9496        self.next_page_token.clone()
9497    }
9498}
9499
9500/// The request to update an issue comment.
9501#[derive(Clone, Default, PartialEq)]
9502#[non_exhaustive]
9503pub struct UpdateIssueCommentRequest {
9504    /// Required. The issue comment to update.
9505    pub issue_comment: std::option::Option<crate::model::IssueComment>,
9506
9507    /// Optional. Field mask is used to specify the fields to be overwritten in the
9508    /// issue comment resource by the update.
9509    /// The fields specified in the update_mask are relative to the resource, not
9510    /// the full request. A field will be overwritten if it is in the mask.
9511    /// The special value "*" means full replacement.
9512    pub update_mask: std::option::Option<wkt::FieldMask>,
9513
9514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9515}
9516
9517impl UpdateIssueCommentRequest {
9518    /// Creates a new default instance.
9519    pub fn new() -> Self {
9520        std::default::Default::default()
9521    }
9522
9523    /// Sets the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
9524    ///
9525    /// # Example
9526    /// ```ignore,no_run
9527    /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueCommentRequest;
9528    /// use google_cloud_securesourcemanager_v1::model::IssueComment;
9529    /// let x = UpdateIssueCommentRequest::new().set_issue_comment(IssueComment::default()/* use setters */);
9530    /// ```
9531    pub fn set_issue_comment<T>(mut self, v: T) -> Self
9532    where
9533        T: std::convert::Into<crate::model::IssueComment>,
9534    {
9535        self.issue_comment = std::option::Option::Some(v.into());
9536        self
9537    }
9538
9539    /// Sets or clears the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
9540    ///
9541    /// # Example
9542    /// ```ignore,no_run
9543    /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueCommentRequest;
9544    /// use google_cloud_securesourcemanager_v1::model::IssueComment;
9545    /// let x = UpdateIssueCommentRequest::new().set_or_clear_issue_comment(Some(IssueComment::default()/* use setters */));
9546    /// let x = UpdateIssueCommentRequest::new().set_or_clear_issue_comment(None::<IssueComment>);
9547    /// ```
9548    pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
9549    where
9550        T: std::convert::Into<crate::model::IssueComment>,
9551    {
9552        self.issue_comment = v.map(|x| x.into());
9553        self
9554    }
9555
9556    /// Sets the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
9557    ///
9558    /// # Example
9559    /// ```ignore,no_run
9560    /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueCommentRequest;
9561    /// use wkt::FieldMask;
9562    /// let x = UpdateIssueCommentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9563    /// ```
9564    pub fn set_update_mask<T>(mut self, v: T) -> Self
9565    where
9566        T: std::convert::Into<wkt::FieldMask>,
9567    {
9568        self.update_mask = std::option::Option::Some(v.into());
9569        self
9570    }
9571
9572    /// Sets or clears the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
9573    ///
9574    /// # Example
9575    /// ```ignore,no_run
9576    /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueCommentRequest;
9577    /// use wkt::FieldMask;
9578    /// let x = UpdateIssueCommentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9579    /// let x = UpdateIssueCommentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9580    /// ```
9581    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9582    where
9583        T: std::convert::Into<wkt::FieldMask>,
9584    {
9585        self.update_mask = v.map(|x| x.into());
9586        self
9587    }
9588}
9589
9590impl wkt::message::Message for UpdateIssueCommentRequest {
9591    fn typename() -> &'static str {
9592        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest"
9593    }
9594}
9595
9596/// The request to delete an issue comment.
9597#[derive(Clone, Default, PartialEq)]
9598#[non_exhaustive]
9599pub struct DeleteIssueCommentRequest {
9600    /// Required. Name of the issue comment to delete.
9601    /// The format is
9602    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`.
9603    pub name: std::string::String,
9604
9605    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9606}
9607
9608impl DeleteIssueCommentRequest {
9609    /// Creates a new default instance.
9610    pub fn new() -> Self {
9611        std::default::Default::default()
9612    }
9613
9614    /// Sets the value of [name][crate::model::DeleteIssueCommentRequest::name].
9615    ///
9616    /// # Example
9617    /// ```ignore,no_run
9618    /// # use google_cloud_securesourcemanager_v1::model::DeleteIssueCommentRequest;
9619    /// # let project_id = "project_id";
9620    /// # let location_id = "location_id";
9621    /// # let repository_id = "repository_id";
9622    /// # let issue_id = "issue_id";
9623    /// # let comment_id = "comment_id";
9624    /// let x = DeleteIssueCommentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}"));
9625    /// ```
9626    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9627        self.name = v.into();
9628        self
9629    }
9630}
9631
9632impl wkt::message::Message for DeleteIssueCommentRequest {
9633    fn typename() -> &'static str {
9634        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest"
9635    }
9636}