google_cloud_securesourcemanager_v1/
model.rs

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