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    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100        self.name = v.into();
101        self
102    }
103
104    /// Sets the value of [create_time][crate::model::Instance::create_time].
105    pub fn set_create_time<T>(mut self, v: T) -> Self
106    where
107        T: std::convert::Into<wkt::Timestamp>,
108    {
109        self.create_time = std::option::Option::Some(v.into());
110        self
111    }
112
113    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
114    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
115    where
116        T: std::convert::Into<wkt::Timestamp>,
117    {
118        self.create_time = v.map(|x| x.into());
119        self
120    }
121
122    /// Sets the value of [update_time][crate::model::Instance::update_time].
123    pub fn set_update_time<T>(mut self, v: T) -> Self
124    where
125        T: std::convert::Into<wkt::Timestamp>,
126    {
127        self.update_time = std::option::Option::Some(v.into());
128        self
129    }
130
131    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
132    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
133    where
134        T: std::convert::Into<wkt::Timestamp>,
135    {
136        self.update_time = v.map(|x| x.into());
137        self
138    }
139
140    /// Sets the value of [labels][crate::model::Instance::labels].
141    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
142    where
143        T: std::iter::IntoIterator<Item = (K, V)>,
144        K: std::convert::Into<std::string::String>,
145        V: std::convert::Into<std::string::String>,
146    {
147        use std::iter::Iterator;
148        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
149        self
150    }
151
152    /// Sets the value of [private_config][crate::model::Instance::private_config].
153    pub fn set_private_config<T>(mut self, v: T) -> Self
154    where
155        T: std::convert::Into<crate::model::instance::PrivateConfig>,
156    {
157        self.private_config = std::option::Option::Some(v.into());
158        self
159    }
160
161    /// Sets or clears the value of [private_config][crate::model::Instance::private_config].
162    pub fn set_or_clear_private_config<T>(mut self, v: std::option::Option<T>) -> Self
163    where
164        T: std::convert::Into<crate::model::instance::PrivateConfig>,
165    {
166        self.private_config = v.map(|x| x.into());
167        self
168    }
169
170    /// Sets the value of [state][crate::model::Instance::state].
171    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
172        self.state = v.into();
173        self
174    }
175
176    /// Sets the value of [state_note][crate::model::Instance::state_note].
177    pub fn set_state_note<T: std::convert::Into<crate::model::instance::StateNote>>(
178        mut self,
179        v: T,
180    ) -> Self {
181        self.state_note = v.into();
182        self
183    }
184
185    /// Sets the value of [kms_key][crate::model::Instance::kms_key].
186    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
187        self.kms_key = v.into();
188        self
189    }
190
191    /// Sets the value of [host_config][crate::model::Instance::host_config].
192    pub fn set_host_config<T>(mut self, v: T) -> Self
193    where
194        T: std::convert::Into<crate::model::instance::HostConfig>,
195    {
196        self.host_config = std::option::Option::Some(v.into());
197        self
198    }
199
200    /// Sets or clears the value of [host_config][crate::model::Instance::host_config].
201    pub fn set_or_clear_host_config<T>(mut self, v: std::option::Option<T>) -> Self
202    where
203        T: std::convert::Into<crate::model::instance::HostConfig>,
204    {
205        self.host_config = v.map(|x| x.into());
206        self
207    }
208
209    /// Sets the value of [workforce_identity_federation_config][crate::model::Instance::workforce_identity_federation_config].
210    pub fn set_workforce_identity_federation_config<T>(mut self, v: T) -> Self
211    where
212        T: std::convert::Into<crate::model::instance::WorkforceIdentityFederationConfig>,
213    {
214        self.workforce_identity_federation_config = std::option::Option::Some(v.into());
215        self
216    }
217
218    /// Sets or clears the value of [workforce_identity_federation_config][crate::model::Instance::workforce_identity_federation_config].
219    pub fn set_or_clear_workforce_identity_federation_config<T>(
220        mut self,
221        v: std::option::Option<T>,
222    ) -> Self
223    where
224        T: std::convert::Into<crate::model::instance::WorkforceIdentityFederationConfig>,
225    {
226        self.workforce_identity_federation_config = v.map(|x| x.into());
227        self
228    }
229}
230
231impl wkt::message::Message for Instance {
232    fn typename() -> &'static str {
233        "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance"
234    }
235}
236
237/// Defines additional types related to [Instance].
238pub mod instance {
239    #[allow(unused_imports)]
240    use super::*;
241
242    /// HostConfig has different instance endpoints.
243    #[derive(Clone, Default, PartialEq)]
244    #[non_exhaustive]
245    pub struct HostConfig {
246        /// Output only. HTML hostname.
247        pub html: std::string::String,
248
249        /// Output only. API hostname.
250        pub api: std::string::String,
251
252        /// Output only. Git HTTP hostname.
253        pub git_http: std::string::String,
254
255        /// Output only. Git SSH hostname.
256        pub git_ssh: std::string::String,
257
258        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
259    }
260
261    impl HostConfig {
262        pub fn new() -> Self {
263            std::default::Default::default()
264        }
265
266        /// Sets the value of [html][crate::model::instance::HostConfig::html].
267        pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
268            self.html = v.into();
269            self
270        }
271
272        /// Sets the value of [api][crate::model::instance::HostConfig::api].
273        pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
274            self.api = v.into();
275            self
276        }
277
278        /// Sets the value of [git_http][crate::model::instance::HostConfig::git_http].
279        pub fn set_git_http<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
280            self.git_http = v.into();
281            self
282        }
283
284        /// Sets the value of [git_ssh][crate::model::instance::HostConfig::git_ssh].
285        pub fn set_git_ssh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
286            self.git_ssh = v.into();
287            self
288        }
289    }
290
291    impl wkt::message::Message for HostConfig {
292        fn typename() -> &'static str {
293            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.HostConfig"
294        }
295    }
296
297    /// PrivateConfig includes settings for private instance.
298    #[derive(Clone, Default, PartialEq)]
299    #[non_exhaustive]
300    pub struct PrivateConfig {
301        /// Required. Immutable. Indicate if it's private instance.
302        pub is_private: bool,
303
304        /// Optional. Immutable. CA pool resource, resource must in the format of
305        /// `projects/{project}/locations/{location}/caPools/{ca_pool}`.
306        pub ca_pool: std::string::String,
307
308        /// Output only. Service Attachment for HTTP, resource is in the format of
309        /// `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`.
310        pub http_service_attachment: std::string::String,
311
312        /// Output only. Service Attachment for SSH, resource is in the format of
313        /// `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`.
314        pub ssh_service_attachment: std::string::String,
315
316        /// Optional. Additional allowed projects for setting up PSC connections.
317        /// Instance host project is automatically allowed and does not need to be
318        /// included in this list.
319        pub psc_allowed_projects: std::vec::Vec<std::string::String>,
320
321        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
322    }
323
324    impl PrivateConfig {
325        pub fn new() -> Self {
326            std::default::Default::default()
327        }
328
329        /// Sets the value of [is_private][crate::model::instance::PrivateConfig::is_private].
330        pub fn set_is_private<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
331            self.is_private = v.into();
332            self
333        }
334
335        /// Sets the value of [ca_pool][crate::model::instance::PrivateConfig::ca_pool].
336        pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
337            self.ca_pool = v.into();
338            self
339        }
340
341        /// Sets the value of [http_service_attachment][crate::model::instance::PrivateConfig::http_service_attachment].
342        pub fn set_http_service_attachment<T: std::convert::Into<std::string::String>>(
343            mut self,
344            v: T,
345        ) -> Self {
346            self.http_service_attachment = v.into();
347            self
348        }
349
350        /// Sets the value of [ssh_service_attachment][crate::model::instance::PrivateConfig::ssh_service_attachment].
351        pub fn set_ssh_service_attachment<T: std::convert::Into<std::string::String>>(
352            mut self,
353            v: T,
354        ) -> Self {
355            self.ssh_service_attachment = v.into();
356            self
357        }
358
359        /// Sets the value of [psc_allowed_projects][crate::model::instance::PrivateConfig::psc_allowed_projects].
360        pub fn set_psc_allowed_projects<T, V>(mut self, v: T) -> Self
361        where
362            T: std::iter::IntoIterator<Item = V>,
363            V: std::convert::Into<std::string::String>,
364        {
365            use std::iter::Iterator;
366            self.psc_allowed_projects = v.into_iter().map(|i| i.into()).collect();
367            self
368        }
369    }
370
371    impl wkt::message::Message for PrivateConfig {
372        fn typename() -> &'static str {
373            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.PrivateConfig"
374        }
375    }
376
377    /// WorkforceIdentityFederationConfig allows this instance to support users
378    /// from external identity providers.
379    #[derive(Clone, Default, PartialEq)]
380    #[non_exhaustive]
381    pub struct WorkforceIdentityFederationConfig {
382        /// Optional. Immutable. Whether Workforce Identity Federation is enabled.
383        pub enabled: bool,
384
385        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
386    }
387
388    impl WorkforceIdentityFederationConfig {
389        pub fn new() -> Self {
390            std::default::Default::default()
391        }
392
393        /// Sets the value of [enabled][crate::model::instance::WorkforceIdentityFederationConfig::enabled].
394        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
395            self.enabled = v.into();
396            self
397        }
398    }
399
400    impl wkt::message::Message for WorkforceIdentityFederationConfig {
401        fn typename() -> &'static str {
402            "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.WorkforceIdentityFederationConfig"
403        }
404    }
405
406    /// Secure Source Manager instance state.
407    ///
408    /// # Working with unknown values
409    ///
410    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
411    /// additional enum variants at any time. Adding new variants is not considered
412    /// a breaking change. Applications should write their code in anticipation of:
413    ///
414    /// - New values appearing in future releases of the client library, **and**
415    /// - New values received dynamically, without application changes.
416    ///
417    /// Please consult the [Working with enums] section in the user guide for some
418    /// guidelines.
419    ///
420    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
421    #[derive(Clone, Debug, PartialEq)]
422    #[non_exhaustive]
423    pub enum State {
424        /// Not set. This should only be the case for incoming requests.
425        Unspecified,
426        /// Instance is being created.
427        Creating,
428        /// Instance is ready.
429        Active,
430        /// Instance is being deleted.
431        Deleting,
432        /// Instance is paused.
433        Paused,
434        /// Instance is unknown, we are not sure if it's functioning.
435        Unknown,
436        /// If set, the enum was initialized with an unknown value.
437        ///
438        /// Applications can examine the value using [State::value] or
439        /// [State::name].
440        UnknownValue(state::UnknownValue),
441    }
442
443    #[doc(hidden)]
444    pub mod state {
445        #[allow(unused_imports)]
446        use super::*;
447        #[derive(Clone, Debug, PartialEq)]
448        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
449    }
450
451    impl State {
452        /// Gets the enum value.
453        ///
454        /// Returns `None` if the enum contains an unknown value deserialized from
455        /// the string representation of enums.
456        pub fn value(&self) -> std::option::Option<i32> {
457            match self {
458                Self::Unspecified => std::option::Option::Some(0),
459                Self::Creating => std::option::Option::Some(1),
460                Self::Active => std::option::Option::Some(2),
461                Self::Deleting => std::option::Option::Some(3),
462                Self::Paused => std::option::Option::Some(4),
463                Self::Unknown => std::option::Option::Some(6),
464                Self::UnknownValue(u) => u.0.value(),
465            }
466        }
467
468        /// Gets the enum value as a string.
469        ///
470        /// Returns `None` if the enum contains an unknown value deserialized from
471        /// the integer representation of enums.
472        pub fn name(&self) -> std::option::Option<&str> {
473            match self {
474                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
475                Self::Creating => std::option::Option::Some("CREATING"),
476                Self::Active => std::option::Option::Some("ACTIVE"),
477                Self::Deleting => std::option::Option::Some("DELETING"),
478                Self::Paused => std::option::Option::Some("PAUSED"),
479                Self::Unknown => std::option::Option::Some("UNKNOWN"),
480                Self::UnknownValue(u) => u.0.name(),
481            }
482        }
483    }
484
485    impl std::default::Default for State {
486        fn default() -> Self {
487            use std::convert::From;
488            Self::from(0)
489        }
490    }
491
492    impl std::fmt::Display for State {
493        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
494            wkt::internal::display_enum(f, self.name(), self.value())
495        }
496    }
497
498    impl std::convert::From<i32> for State {
499        fn from(value: i32) -> Self {
500            match value {
501                0 => Self::Unspecified,
502                1 => Self::Creating,
503                2 => Self::Active,
504                3 => Self::Deleting,
505                4 => Self::Paused,
506                6 => Self::Unknown,
507                _ => Self::UnknownValue(state::UnknownValue(
508                    wkt::internal::UnknownEnumValue::Integer(value),
509                )),
510            }
511        }
512    }
513
514    impl std::convert::From<&str> for State {
515        fn from(value: &str) -> Self {
516            use std::string::ToString;
517            match value {
518                "STATE_UNSPECIFIED" => Self::Unspecified,
519                "CREATING" => Self::Creating,
520                "ACTIVE" => Self::Active,
521                "DELETING" => Self::Deleting,
522                "PAUSED" => Self::Paused,
523                "UNKNOWN" => Self::Unknown,
524                _ => Self::UnknownValue(state::UnknownValue(
525                    wkt::internal::UnknownEnumValue::String(value.to_string()),
526                )),
527            }
528        }
529    }
530
531    impl serde::ser::Serialize for State {
532        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
533        where
534            S: serde::Serializer,
535        {
536            match self {
537                Self::Unspecified => serializer.serialize_i32(0),
538                Self::Creating => serializer.serialize_i32(1),
539                Self::Active => serializer.serialize_i32(2),
540                Self::Deleting => serializer.serialize_i32(3),
541                Self::Paused => serializer.serialize_i32(4),
542                Self::Unknown => serializer.serialize_i32(6),
543                Self::UnknownValue(u) => u.0.serialize(serializer),
544            }
545        }
546    }
547
548    impl<'de> serde::de::Deserialize<'de> for State {
549        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
550        where
551            D: serde::Deserializer<'de>,
552        {
553            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
554                ".google.cloud.securesourcemanager.v1.Instance.State",
555            ))
556        }
557    }
558
559    /// Provides information about the current instance state.
560    ///
561    /// # Working with unknown values
562    ///
563    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
564    /// additional enum variants at any time. Adding new variants is not considered
565    /// a breaking change. Applications should write their code in anticipation of:
566    ///
567    /// - New values appearing in future releases of the client library, **and**
568    /// - New values received dynamically, without application changes.
569    ///
570    /// Please consult the [Working with enums] section in the user guide for some
571    /// guidelines.
572    ///
573    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
574    #[derive(Clone, Debug, PartialEq)]
575    #[non_exhaustive]
576    pub enum StateNote {
577        /// STATE_NOTE_UNSPECIFIED as the first value of State.
578        Unspecified,
579        /// CMEK access is unavailable.
580        PausedCmekUnavailable,
581        /// INSTANCE_RESUMING indicates that the instance was previously paused
582        /// and is under the process of being brought back.
583        #[deprecated]
584        InstanceResuming,
585        /// If set, the enum was initialized with an unknown value.
586        ///
587        /// Applications can examine the value using [StateNote::value] or
588        /// [StateNote::name].
589        UnknownValue(state_note::UnknownValue),
590    }
591
592    #[doc(hidden)]
593    pub mod state_note {
594        #[allow(unused_imports)]
595        use super::*;
596        #[derive(Clone, Debug, PartialEq)]
597        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
598    }
599
600    impl StateNote {
601        /// Gets the enum value.
602        ///
603        /// Returns `None` if the enum contains an unknown value deserialized from
604        /// the string representation of enums.
605        pub fn value(&self) -> std::option::Option<i32> {
606            match self {
607                Self::Unspecified => std::option::Option::Some(0),
608                Self::PausedCmekUnavailable => std::option::Option::Some(1),
609                Self::InstanceResuming => std::option::Option::Some(2),
610                Self::UnknownValue(u) => u.0.value(),
611            }
612        }
613
614        /// Gets the enum value as a string.
615        ///
616        /// Returns `None` if the enum contains an unknown value deserialized from
617        /// the integer representation of enums.
618        pub fn name(&self) -> std::option::Option<&str> {
619            match self {
620                Self::Unspecified => std::option::Option::Some("STATE_NOTE_UNSPECIFIED"),
621                Self::PausedCmekUnavailable => std::option::Option::Some("PAUSED_CMEK_UNAVAILABLE"),
622                Self::InstanceResuming => std::option::Option::Some("INSTANCE_RESUMING"),
623                Self::UnknownValue(u) => u.0.name(),
624            }
625        }
626    }
627
628    impl std::default::Default for StateNote {
629        fn default() -> Self {
630            use std::convert::From;
631            Self::from(0)
632        }
633    }
634
635    impl std::fmt::Display for StateNote {
636        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
637            wkt::internal::display_enum(f, self.name(), self.value())
638        }
639    }
640
641    impl std::convert::From<i32> for StateNote {
642        fn from(value: i32) -> Self {
643            match value {
644                0 => Self::Unspecified,
645                1 => Self::PausedCmekUnavailable,
646                2 => Self::InstanceResuming,
647                _ => Self::UnknownValue(state_note::UnknownValue(
648                    wkt::internal::UnknownEnumValue::Integer(value),
649                )),
650            }
651        }
652    }
653
654    impl std::convert::From<&str> for StateNote {
655        fn from(value: &str) -> Self {
656            use std::string::ToString;
657            match value {
658                "STATE_NOTE_UNSPECIFIED" => Self::Unspecified,
659                "PAUSED_CMEK_UNAVAILABLE" => Self::PausedCmekUnavailable,
660                "INSTANCE_RESUMING" => Self::InstanceResuming,
661                _ => Self::UnknownValue(state_note::UnknownValue(
662                    wkt::internal::UnknownEnumValue::String(value.to_string()),
663                )),
664            }
665        }
666    }
667
668    impl serde::ser::Serialize for StateNote {
669        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
670        where
671            S: serde::Serializer,
672        {
673            match self {
674                Self::Unspecified => serializer.serialize_i32(0),
675                Self::PausedCmekUnavailable => serializer.serialize_i32(1),
676                Self::InstanceResuming => serializer.serialize_i32(2),
677                Self::UnknownValue(u) => u.0.serialize(serializer),
678            }
679        }
680    }
681
682    impl<'de> serde::de::Deserialize<'de> for StateNote {
683        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
684        where
685            D: serde::Deserializer<'de>,
686        {
687            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StateNote>::new(
688                ".google.cloud.securesourcemanager.v1.Instance.StateNote",
689            ))
690        }
691    }
692}
693
694/// Metadata of a Secure Source Manager repository.
695#[derive(Clone, Default, PartialEq)]
696#[non_exhaustive]
697pub struct Repository {
698    /// Optional. A unique identifier for a repository. The name should be of the
699    /// format:
700    /// `projects/{project}/locations/{location_id}/repositories/{repository_id}`
701    pub name: std::string::String,
702
703    /// Optional. Description of the repository, which cannot exceed 500
704    /// characters.
705    pub description: std::string::String,
706
707    /// Optional. The name of the instance in which the repository is hosted,
708    /// formatted as
709    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`
710    /// When creating repository via securesourcemanager.googleapis.com, this field
711    /// is used as input. When creating repository via *.sourcemanager.dev, this
712    /// field is output only.
713    pub instance: std::string::String,
714
715    /// Output only. Unique identifier of the repository.
716    pub uid: std::string::String,
717
718    /// Output only. Create timestamp.
719    pub create_time: std::option::Option<wkt::Timestamp>,
720
721    /// Output only. Update timestamp.
722    pub update_time: std::option::Option<wkt::Timestamp>,
723
724    /// Optional. This checksum is computed by the server based on the value of
725    /// other fields, and may be sent on update and delete requests to ensure the
726    /// client has an up-to-date value before proceeding.
727    pub etag: std::string::String,
728
729    /// Output only. URIs for the repository.
730    pub uris: std::option::Option<crate::model::repository::URIs>,
731
732    /// Input only. Initial configurations for the repository.
733    pub initial_config: std::option::Option<crate::model::repository::InitialConfig>,
734
735    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
736}
737
738impl Repository {
739    pub fn new() -> Self {
740        std::default::Default::default()
741    }
742
743    /// Sets the value of [name][crate::model::Repository::name].
744    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
745        self.name = v.into();
746        self
747    }
748
749    /// Sets the value of [description][crate::model::Repository::description].
750    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
751        self.description = v.into();
752        self
753    }
754
755    /// Sets the value of [instance][crate::model::Repository::instance].
756    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
757        self.instance = v.into();
758        self
759    }
760
761    /// Sets the value of [uid][crate::model::Repository::uid].
762    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
763        self.uid = v.into();
764        self
765    }
766
767    /// Sets the value of [create_time][crate::model::Repository::create_time].
768    pub fn set_create_time<T>(mut self, v: T) -> Self
769    where
770        T: std::convert::Into<wkt::Timestamp>,
771    {
772        self.create_time = std::option::Option::Some(v.into());
773        self
774    }
775
776    /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
777    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
778    where
779        T: std::convert::Into<wkt::Timestamp>,
780    {
781        self.create_time = v.map(|x| x.into());
782        self
783    }
784
785    /// Sets the value of [update_time][crate::model::Repository::update_time].
786    pub fn set_update_time<T>(mut self, v: T) -> Self
787    where
788        T: std::convert::Into<wkt::Timestamp>,
789    {
790        self.update_time = std::option::Option::Some(v.into());
791        self
792    }
793
794    /// Sets or clears the value of [update_time][crate::model::Repository::update_time].
795    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
796    where
797        T: std::convert::Into<wkt::Timestamp>,
798    {
799        self.update_time = v.map(|x| x.into());
800        self
801    }
802
803    /// Sets the value of [etag][crate::model::Repository::etag].
804    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
805        self.etag = v.into();
806        self
807    }
808
809    /// Sets the value of [uris][crate::model::Repository::uris].
810    pub fn set_uris<T>(mut self, v: T) -> Self
811    where
812        T: std::convert::Into<crate::model::repository::URIs>,
813    {
814        self.uris = std::option::Option::Some(v.into());
815        self
816    }
817
818    /// Sets or clears the value of [uris][crate::model::Repository::uris].
819    pub fn set_or_clear_uris<T>(mut self, v: std::option::Option<T>) -> Self
820    where
821        T: std::convert::Into<crate::model::repository::URIs>,
822    {
823        self.uris = v.map(|x| x.into());
824        self
825    }
826
827    /// Sets the value of [initial_config][crate::model::Repository::initial_config].
828    pub fn set_initial_config<T>(mut self, v: T) -> Self
829    where
830        T: std::convert::Into<crate::model::repository::InitialConfig>,
831    {
832        self.initial_config = std::option::Option::Some(v.into());
833        self
834    }
835
836    /// Sets or clears the value of [initial_config][crate::model::Repository::initial_config].
837    pub fn set_or_clear_initial_config<T>(mut self, v: std::option::Option<T>) -> Self
838    where
839        T: std::convert::Into<crate::model::repository::InitialConfig>,
840    {
841        self.initial_config = v.map(|x| x.into());
842        self
843    }
844}
845
846impl wkt::message::Message for Repository {
847    fn typename() -> &'static str {
848        "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository"
849    }
850}
851
852/// Defines additional types related to [Repository].
853pub mod repository {
854    #[allow(unused_imports)]
855    use super::*;
856
857    /// URIs for the repository.
858    #[derive(Clone, Default, PartialEq)]
859    #[non_exhaustive]
860    pub struct URIs {
861        /// Output only. HTML is the URI for user to view the repository in a
862        /// browser.
863        pub html: std::string::String,
864
865        /// Output only. git_https is the git HTTPS URI for git operations.
866        pub git_https: std::string::String,
867
868        /// Output only. API is the URI for API access.
869        pub api: std::string::String,
870
871        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
872    }
873
874    impl URIs {
875        pub fn new() -> Self {
876            std::default::Default::default()
877        }
878
879        /// Sets the value of [html][crate::model::repository::URIs::html].
880        pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
881            self.html = v.into();
882            self
883        }
884
885        /// Sets the value of [git_https][crate::model::repository::URIs::git_https].
886        pub fn set_git_https<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
887            self.git_https = v.into();
888            self
889        }
890
891        /// Sets the value of [api][crate::model::repository::URIs::api].
892        pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
893            self.api = v.into();
894            self
895        }
896    }
897
898    impl wkt::message::Message for URIs {
899        fn typename() -> &'static str {
900            "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.URIs"
901        }
902    }
903
904    /// Repository initialization configuration.
905    #[derive(Clone, Default, PartialEq)]
906    #[non_exhaustive]
907    pub struct InitialConfig {
908        /// Default branch name of the repository.
909        pub default_branch: std::string::String,
910
911        /// List of gitignore template names user can choose from.
912        /// Valid values: actionscript, ada, agda, android,
913        /// anjuta, ansible, appcelerator-titanium, app-engine, archives,
914        /// arch-linux-packages, atmel-studio, autotools, backup, bazaar, bazel,
915        /// bitrix, bricx-cc, c, cake-php, calabash, cf-wheels, chef-cookbook,
916        /// clojure, cloud9, c-make, code-igniter, code-kit, code-sniffer,
917        /// common-lisp, composer, concrete5, coq, cordova, cpp, craft-cms, cuda,
918        /// cvs, d, dart, dart-editor, delphi, diff, dm, dreamweaver, dropbox,
919        /// drupal, drupal-7, eagle, eclipse, eiffel-studio, elisp, elixir, elm,
920        /// emacs, ensime, epi-server, erlang, esp-idf, espresso, exercism,
921        /// expression-engine, ext-js, fancy, finale, flex-builder, force-dot-com,
922        /// fortran, fuel-php, gcov, git-book, gnome-shell-extension, go, godot, gpg,
923        /// gradle, grails, gwt, haskell, hugo, iar-ewarm, idris, igor-pro, images,
924        /// infor-cms, java, jboss, jboss-4, jboss-6, jdeveloper, jekyll,
925        /// jenkins-home, jenv, jet-brains, jigsaw, joomla, julia, jupyter-notebooks,
926        /// kate, kdevelop4, kentico, ki-cad, kohana, kotlin, lab-view, laravel,
927        /// lazarus, leiningen, lemon-stand, libre-office, lilypond, linux, lithium,
928        /// logtalk, lua, lyx, mac-os, magento, magento-1, magento-2, matlab, maven,
929        /// mercurial, mercury, metals, meta-programming-system, meteor,
930        /// microsoft-office, model-sim, momentics, mono-develop, nanoc, net-beans,
931        /// nikola, nim, ninja, node, notepad-pp, nwjs, objective--c, ocaml, octave,
932        /// opa, open-cart, openssl, oracle-forms, otto, packer, patch, perl, perl6,
933        /// phalcon, phoenix, pimcore, play-framework, plone, prestashop, processing,
934        /// psoc-creator, puppet, pure-script, putty, python, qooxdoo, qt, r, racket,
935        /// rails, raku, red, redcar, redis, rhodes-rhomobile, ros, ruby, rust, sam,
936        /// sass, sbt, scala, scheme, scons, scrivener, sdcc, seam-gen, sketch-up,
937        /// slick-edit, smalltalk, snap, splunk, stata, stella, sublime-text,
938        /// sugar-crm, svn, swift, symfony, symphony-cms, synopsys-vcs, tags,
939        /// terraform, tex, text-mate, textpattern, think-php, tortoise-git,
940        /// turbo-gears-2, typo3, umbraco, unity, unreal-engine, vagrant, vim,
941        /// virtual-env, virtuoso, visual-studio, visual-studio-code, vue, vvvv, waf,
942        /// web-methods, windows, word-press, xcode, xilinx, xilinx-ise, xojo,
943        /// yeoman, yii, zend-framework, zephir.
944        pub gitignores: std::vec::Vec<std::string::String>,
945
946        /// License template name user can choose from.
947        /// Valid values: license-0bsd, license-389-exception, aal, abstyles,
948        /// adobe-2006, adobe-glyph, adsl, afl-1-1, afl-1-2, afl-2-0, afl-2-1,
949        /// afl-3-0, afmparse, agpl-1-0, agpl-1-0-only, agpl-1-0-or-later,
950        /// agpl-3-0-only, agpl-3-0-or-later, aladdin, amdplpa, aml, ampas, antlr-pd,
951        /// antlr-pd-fallback, apache-1-0, apache-1-1, apache-2-0, apafml, apl-1-0,
952        /// apsl-1-0, apsl-1-1, apsl-1-2, apsl-2-0, artistic-1-0, artistic-1-0-cl8,
953        /// artistic-1-0-perl, artistic-2-0, autoconf-exception-2-0,
954        /// autoconf-exception-3-0, bahyph, barr, beerware, bison-exception-2-2,
955        /// bittorrent-1-0, bittorrent-1-1, blessing, blueoak-1-0-0,
956        /// bootloader-exception, borceux, bsd-1-clause, bsd-2-clause,
957        /// bsd-2-clause-freebsd, bsd-2-clause-netbsd, bsd-2-clause-patent,
958        /// bsd-2-clause-views, bsd-3-clause, bsd-3-clause-attribution,
959        /// bsd-3-clause-clear, bsd-3-clause-lbnl, bsd-3-clause-modification,
960        /// bsd-3-clause-no-nuclear-license, bsd-3-clause-no-nuclear-license-2014,
961        /// bsd-3-clause-no-nuclear-warranty, bsd-3-clause-open-mpi, bsd-4-clause,
962        /// bsd-4-clause-shortened, bsd-4-clause-uc, bsd-protection, bsd-source-code,
963        /// bsl-1-0, busl-1-1, cal-1-0, cal-1-0-combined-work-exception, caldera,
964        /// catosl-1-1, cc0-1-0, cc-by-1-0, cc-by-2-0, cc-by-3-0, cc-by-3-0-at,
965        /// cc-by-3-0-us, cc-by-4-0, cc-by-nc-1-0, cc-by-nc-2-0, cc-by-nc-3-0,
966        /// cc-by-nc-4-0, cc-by-nc-nd-1-0, cc-by-nc-nd-2-0, cc-by-nc-nd-3-0,
967        /// 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,
968        /// cc-by-nc-sa-3-0, cc-by-nc-sa-4-0, cc-by-nd-1-0, cc-by-nd-2-0,
969        /// 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,
970        /// cc-by-sa-2-1-jp, cc-by-sa-3-0, cc-by-sa-3-0-at, cc-by-sa-4-0, cc-pddc,
971        /// cddl-1-0, cddl-1-1, cdla-permissive-1-0, cdla-sharing-1-0, cecill-1-0,
972        /// cecill-1-1, cecill-2-0, cecill-2-1, cecill-b, cecill-c, cern-ohl-1-1,
973        /// cern-ohl-1-2, cern-ohl-p-2-0, cern-ohl-s-2-0, cern-ohl-w-2-0, clartistic,
974        /// classpath-exception-2-0, clisp-exception-2-0, cnri-jython, cnri-python,
975        /// cnri-python-gpl-compatible, condor-1-1, copyleft-next-0-3-0,
976        /// copyleft-next-0-3-1, cpal-1-0, cpl-1-0, cpol-1-02, crossword,
977        /// crystal-stacker, cua-opl-1-0, cube, c-uda-1-0, curl, d-fsl-1-0, diffmark,
978        /// digirule-foss-exception, doc, dotseqn, drl-1-0, dsdp, dvipdfm, ecl-1-0,
979        /// ecl-2-0, ecos-exception-2-0, efl-1-0, efl-2-0, egenix, entessa, epics,
980        /// epl-1-0, epl-2-0, erlpl-1-1, etalab-2-0, eu-datagrid, eupl-1-0, eupl-1-1,
981        /// eupl-1-2, eurosym, fair, fawkes-runtime-exception, fltk-exception,
982        /// font-exception-2-0, frameworx-1-0, freebsd-doc, freeimage,
983        /// freertos-exception-2-0, fsfap, fsful, fsfullr, ftl, gcc-exception-2-0,
984        /// gcc-exception-3-1, gd, gfdl-1-1-invariants-only,
985        /// gfdl-1-1-invariants-or-later, gfdl-1-1-no-invariants-only,
986        /// gfdl-1-1-no-invariants-or-later, gfdl-1-1-only, gfdl-1-1-or-later,
987        /// gfdl-1-2-invariants-only, gfdl-1-2-invariants-or-later,
988        /// gfdl-1-2-no-invariants-only, gfdl-1-2-no-invariants-or-later,
989        /// gfdl-1-2-only, gfdl-1-2-or-later, gfdl-1-3-invariants-only,
990        /// gfdl-1-3-invariants-or-later, gfdl-1-3-no-invariants-only,
991        /// gfdl-1-3-no-invariants-or-later, gfdl-1-3-only, gfdl-1-3-or-later,
992        /// giftware, gl2ps, glide, glulxe, glwtpl, gnu-javamail-exception, gnuplot,
993        /// gpl-1-0-only, gpl-1-0-or-later, gpl-2-0-only, gpl-2-0-or-later,
994        /// gpl-3-0-linking-exception, gpl-3-0-linking-source-exception,
995        /// gpl-3-0-only, gpl-3-0-or-later, gpl-cc-1-0, gsoap-1-3b, haskell-report,
996        /// hippocratic-2-1, hpnd, hpnd-sell-variant, htmltidy,
997        /// i2p-gpl-java-exception, ibm-pibs, icu, ijg, image-magick, imatix, imlib2,
998        /// info-zip, intel, intel-acpi, interbase-1-0, ipa, ipl-1-0, isc,
999        /// jasper-2-0, jpnic, json, lal-1-2, lal-1-3, latex2e, leptonica,
1000        /// lgpl-2-0-only, lgpl-2-0-or-later, lgpl-2-1-only, lgpl-2-1-or-later,
1001        /// lgpl-3-0-linking-exception, lgpl-3-0-only, lgpl-3-0-or-later, lgpllr,
1002        /// libpng, libpng-2-0, libselinux-1-0, libtiff, libtool-exception,
1003        /// liliq-p-1-1, liliq-r-1-1, liliq-rplus-1-1, linux-openib,
1004        /// linux-syscall-note, llvm-exception, lpl-1-0, lpl-1-02, lppl-1-0,
1005        /// lppl-1-1, lppl-1-2, lppl-1-3a, lppl-1-3c, lzma-exception, make-index,
1006        /// mif-exception, miros, mit, mit-0, mit-advertising, mit-cmu, mit-enna,
1007        /// mit-feh, mit-modern-variant, mitnfa, mit-open-group, motosoto, mpich2,
1008        /// mpl-1-0, mpl-1-1, mpl-2-0, mpl-2-0-no-copyleft-exception, ms-pl, ms-rl,
1009        /// mtll, mulanpsl-1-0, mulanpsl-2-0, multics, mup, naist-2003, nasa-1-3,
1010        /// naumen, nbpl-1-0, ncgl-uk-2-0, ncsa, netcdf, net-snmp, newsletr, ngpl,
1011        /// nist-pd, nist-pd-fallback, nlod-1-0, nlpl, nokia, nokia-qt-exception-1-1,
1012        /// nosl, noweb, npl-1-0, npl-1-1, nposl-3-0, nrl, ntp, ntp-0,
1013        /// ocaml-lgpl-linking-exception, occt-exception-1-0, occt-pl, oclc-2-0,
1014        /// odbl-1-0, odc-by-1-0, ofl-1-0, ofl-1-0-no-rfn, ofl-1-0-rfn, ofl-1-1,
1015        /// ofl-1-1-no-rfn, ofl-1-1-rfn, ogc-1-0, ogdl-taiwan-1-0, ogl-canada-2-0,
1016        /// ogl-uk-1-0, ogl-uk-2-0, ogl-uk-3-0, ogtsl, oldap-1-1, oldap-1-2,
1017        /// oldap-1-3, oldap-1-4, oldap-2-0, oldap-2-0-1, oldap-2-1, oldap-2-2,
1018        /// oldap-2-2-1, oldap-2-2-2, oldap-2-3, oldap-2-4, oldap-2-7, oml,
1019        /// openjdk-assembly-exception-1-0, openssl, openvpn-openssl-exception,
1020        /// opl-1-0, oset-pl-2-1, osl-1-0, osl-1-1, osl-2-0, osl-2-1, osl-3-0,
1021        /// o-uda-1-0, parity-6-0-0, parity-7-0-0, pddl-1-0, php-3-0, php-3-01,
1022        /// plexus, polyform-noncommercial-1-0-0, polyform-small-business-1-0-0,
1023        /// postgresql, psf-2-0, psfrag, ps-or-pdf-font-exception-20170817, psutils,
1024        /// python-2-0, qhull, qpl-1-0, qt-gpl-exception-1-0, qt-lgpl-exception-1-1,
1025        /// qwt-exception-1-0, rdisc, rhecos-1-1, rpl-1-1, rpsl-1-0, rsa-md, rscpl,
1026        /// ruby, saxpath, sax-pd, scea, sendmail, sendmail-8-23, sgi-b-1-0,
1027        /// sgi-b-1-1, sgi-b-2-0, shl-0-51, shl-2-0, shl-2-1, simpl-2-0, sissl,
1028        /// sissl-1-2, sleepycat, smlnj, smppl, snia, spencer-86, spencer-94,
1029        /// spencer-99, spl-1-0, ssh-openssh, ssh-short, sspl-1-0, sugarcrm-1-1-3,
1030        /// swift-exception, swl, tapr-ohl-1-0, tcl, tcp-wrappers, tmate, torque-1-1,
1031        /// tosl, tu-berlin-1-0, tu-berlin-2-0, u-boot-exception-2-0, ucl-1-0,
1032        /// unicode-dfs-2015, unicode-dfs-2016, unicode-tou,
1033        /// universal-foss-exception-1-0, unlicense, upl-1-0, vim, vostrom, vsl-1-0,
1034        /// w3c, w3c-19980720, w3c-20150513, watcom-1-0, wsuipa, wtfpl,
1035        /// wxwindows-exception-3-1, x11, xerox, xfree86-1-1, xinetd, xnet, xpp,
1036        /// xskat, ypl-1-0, ypl-1-1, zed, zend-2-0, zimbra-1-3, zimbra-1-4, zlib,
1037        /// zlib-acknowledgement, zpl-1-1, zpl-2-0, zpl-2-1.
1038        pub license: std::string::String,
1039
1040        /// README template name.
1041        /// Valid template name(s) are: default.
1042        pub readme: std::string::String,
1043
1044        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1045    }
1046
1047    impl InitialConfig {
1048        pub fn new() -> Self {
1049            std::default::Default::default()
1050        }
1051
1052        /// Sets the value of [default_branch][crate::model::repository::InitialConfig::default_branch].
1053        pub fn set_default_branch<T: std::convert::Into<std::string::String>>(
1054            mut self,
1055            v: T,
1056        ) -> Self {
1057            self.default_branch = v.into();
1058            self
1059        }
1060
1061        /// Sets the value of [gitignores][crate::model::repository::InitialConfig::gitignores].
1062        pub fn set_gitignores<T, V>(mut self, v: T) -> Self
1063        where
1064            T: std::iter::IntoIterator<Item = V>,
1065            V: std::convert::Into<std::string::String>,
1066        {
1067            use std::iter::Iterator;
1068            self.gitignores = v.into_iter().map(|i| i.into()).collect();
1069            self
1070        }
1071
1072        /// Sets the value of [license][crate::model::repository::InitialConfig::license].
1073        pub fn set_license<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1074            self.license = v.into();
1075            self
1076        }
1077
1078        /// Sets the value of [readme][crate::model::repository::InitialConfig::readme].
1079        pub fn set_readme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1080            self.readme = v.into();
1081            self
1082        }
1083    }
1084
1085    impl wkt::message::Message for InitialConfig {
1086        fn typename() -> &'static str {
1087            "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.InitialConfig"
1088        }
1089    }
1090}
1091
1092/// Metadata of a Secure Source Manager Hook.
1093#[derive(Clone, Default, PartialEq)]
1094#[non_exhaustive]
1095pub struct Hook {
1096    /// Identifier. A unique identifier for a Hook. The name should be of the
1097    /// format:
1098    /// `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`
1099    pub name: std::string::String,
1100
1101    /// Required. The target URI to which the payloads will be delivered.
1102    pub target_uri: std::string::String,
1103
1104    /// Optional. Determines if the hook disabled or not.
1105    /// Set to true to stop sending traffic.
1106    pub disabled: bool,
1107
1108    /// Optional. The events that trigger hook on.
1109    pub events: std::vec::Vec<crate::model::hook::HookEventType>,
1110
1111    /// Output only. Create timestamp.
1112    pub create_time: std::option::Option<wkt::Timestamp>,
1113
1114    /// Output only. Update timestamp.
1115    pub update_time: std::option::Option<wkt::Timestamp>,
1116
1117    /// Output only. Unique identifier of the hook.
1118    pub uid: std::string::String,
1119
1120    /// Optional. The trigger option for push events.
1121    pub push_option: std::option::Option<crate::model::hook::PushOption>,
1122
1123    /// Optional. The sensitive query string to be appended to the target URI.
1124    pub sensitive_query_string: std::string::String,
1125
1126    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1127}
1128
1129impl Hook {
1130    pub fn new() -> Self {
1131        std::default::Default::default()
1132    }
1133
1134    /// Sets the value of [name][crate::model::Hook::name].
1135    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1136        self.name = v.into();
1137        self
1138    }
1139
1140    /// Sets the value of [target_uri][crate::model::Hook::target_uri].
1141    pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1142        self.target_uri = v.into();
1143        self
1144    }
1145
1146    /// Sets the value of [disabled][crate::model::Hook::disabled].
1147    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1148        self.disabled = v.into();
1149        self
1150    }
1151
1152    /// Sets the value of [events][crate::model::Hook::events].
1153    pub fn set_events<T, V>(mut self, v: T) -> Self
1154    where
1155        T: std::iter::IntoIterator<Item = V>,
1156        V: std::convert::Into<crate::model::hook::HookEventType>,
1157    {
1158        use std::iter::Iterator;
1159        self.events = v.into_iter().map(|i| i.into()).collect();
1160        self
1161    }
1162
1163    /// Sets the value of [create_time][crate::model::Hook::create_time].
1164    pub fn set_create_time<T>(mut self, v: T) -> Self
1165    where
1166        T: std::convert::Into<wkt::Timestamp>,
1167    {
1168        self.create_time = std::option::Option::Some(v.into());
1169        self
1170    }
1171
1172    /// Sets or clears the value of [create_time][crate::model::Hook::create_time].
1173    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1174    where
1175        T: std::convert::Into<wkt::Timestamp>,
1176    {
1177        self.create_time = v.map(|x| x.into());
1178        self
1179    }
1180
1181    /// Sets the value of [update_time][crate::model::Hook::update_time].
1182    pub fn set_update_time<T>(mut self, v: T) -> Self
1183    where
1184        T: std::convert::Into<wkt::Timestamp>,
1185    {
1186        self.update_time = std::option::Option::Some(v.into());
1187        self
1188    }
1189
1190    /// Sets or clears the value of [update_time][crate::model::Hook::update_time].
1191    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1192    where
1193        T: std::convert::Into<wkt::Timestamp>,
1194    {
1195        self.update_time = v.map(|x| x.into());
1196        self
1197    }
1198
1199    /// Sets the value of [uid][crate::model::Hook::uid].
1200    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1201        self.uid = v.into();
1202        self
1203    }
1204
1205    /// Sets the value of [push_option][crate::model::Hook::push_option].
1206    pub fn set_push_option<T>(mut self, v: T) -> Self
1207    where
1208        T: std::convert::Into<crate::model::hook::PushOption>,
1209    {
1210        self.push_option = std::option::Option::Some(v.into());
1211        self
1212    }
1213
1214    /// Sets or clears the value of [push_option][crate::model::Hook::push_option].
1215    pub fn set_or_clear_push_option<T>(mut self, v: std::option::Option<T>) -> Self
1216    where
1217        T: std::convert::Into<crate::model::hook::PushOption>,
1218    {
1219        self.push_option = v.map(|x| x.into());
1220        self
1221    }
1222
1223    /// Sets the value of [sensitive_query_string][crate::model::Hook::sensitive_query_string].
1224    pub fn set_sensitive_query_string<T: std::convert::Into<std::string::String>>(
1225        mut self,
1226        v: T,
1227    ) -> Self {
1228        self.sensitive_query_string = v.into();
1229        self
1230    }
1231}
1232
1233impl wkt::message::Message for Hook {
1234    fn typename() -> &'static str {
1235        "type.googleapis.com/google.cloud.securesourcemanager.v1.Hook"
1236    }
1237}
1238
1239/// Defines additional types related to [Hook].
1240pub mod hook {
1241    #[allow(unused_imports)]
1242    use super::*;
1243
1244    #[derive(Clone, Default, PartialEq)]
1245    #[non_exhaustive]
1246    pub struct PushOption {
1247        /// Optional. Trigger hook for matching branches only.
1248        /// Specified as glob pattern. If empty or *, events for all branches are
1249        /// reported. Examples: main, {main,release*}.
1250        /// See <https://pkg.go.dev/github.com/gobwas/glob> documentation.
1251        pub branch_filter: std::string::String,
1252
1253        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1254    }
1255
1256    impl PushOption {
1257        pub fn new() -> Self {
1258            std::default::Default::default()
1259        }
1260
1261        /// Sets the value of [branch_filter][crate::model::hook::PushOption::branch_filter].
1262        pub fn set_branch_filter<T: std::convert::Into<std::string::String>>(
1263            mut self,
1264            v: T,
1265        ) -> Self {
1266            self.branch_filter = v.into();
1267            self
1268        }
1269    }
1270
1271    impl wkt::message::Message for PushOption {
1272        fn typename() -> &'static str {
1273            "type.googleapis.com/google.cloud.securesourcemanager.v1.Hook.PushOption"
1274        }
1275    }
1276
1277    ///
1278    /// # Working with unknown values
1279    ///
1280    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1281    /// additional enum variants at any time. Adding new variants is not considered
1282    /// a breaking change. Applications should write their code in anticipation of:
1283    ///
1284    /// - New values appearing in future releases of the client library, **and**
1285    /// - New values received dynamically, without application changes.
1286    ///
1287    /// Please consult the [Working with enums] section in the user guide for some
1288    /// guidelines.
1289    ///
1290    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1291    #[derive(Clone, Debug, PartialEq)]
1292    #[non_exhaustive]
1293    pub enum HookEventType {
1294        /// Unspecified.
1295        Unspecified,
1296        /// Push events are triggered when pushing to the repository.
1297        Push,
1298        /// Pull request events are triggered when a pull request is opened, closed,
1299        /// reopened, or edited.
1300        PullRequest,
1301        /// If set, the enum was initialized with an unknown value.
1302        ///
1303        /// Applications can examine the value using [HookEventType::value] or
1304        /// [HookEventType::name].
1305        UnknownValue(hook_event_type::UnknownValue),
1306    }
1307
1308    #[doc(hidden)]
1309    pub mod hook_event_type {
1310        #[allow(unused_imports)]
1311        use super::*;
1312        #[derive(Clone, Debug, PartialEq)]
1313        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1314    }
1315
1316    impl HookEventType {
1317        /// Gets the enum value.
1318        ///
1319        /// Returns `None` if the enum contains an unknown value deserialized from
1320        /// the string representation of enums.
1321        pub fn value(&self) -> std::option::Option<i32> {
1322            match self {
1323                Self::Unspecified => std::option::Option::Some(0),
1324                Self::Push => std::option::Option::Some(1),
1325                Self::PullRequest => std::option::Option::Some(2),
1326                Self::UnknownValue(u) => u.0.value(),
1327            }
1328        }
1329
1330        /// Gets the enum value as a string.
1331        ///
1332        /// Returns `None` if the enum contains an unknown value deserialized from
1333        /// the integer representation of enums.
1334        pub fn name(&self) -> std::option::Option<&str> {
1335            match self {
1336                Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
1337                Self::Push => std::option::Option::Some("PUSH"),
1338                Self::PullRequest => std::option::Option::Some("PULL_REQUEST"),
1339                Self::UnknownValue(u) => u.0.name(),
1340            }
1341        }
1342    }
1343
1344    impl std::default::Default for HookEventType {
1345        fn default() -> Self {
1346            use std::convert::From;
1347            Self::from(0)
1348        }
1349    }
1350
1351    impl std::fmt::Display for HookEventType {
1352        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1353            wkt::internal::display_enum(f, self.name(), self.value())
1354        }
1355    }
1356
1357    impl std::convert::From<i32> for HookEventType {
1358        fn from(value: i32) -> Self {
1359            match value {
1360                0 => Self::Unspecified,
1361                1 => Self::Push,
1362                2 => Self::PullRequest,
1363                _ => Self::UnknownValue(hook_event_type::UnknownValue(
1364                    wkt::internal::UnknownEnumValue::Integer(value),
1365                )),
1366            }
1367        }
1368    }
1369
1370    impl std::convert::From<&str> for HookEventType {
1371        fn from(value: &str) -> Self {
1372            use std::string::ToString;
1373            match value {
1374                "UNSPECIFIED" => Self::Unspecified,
1375                "PUSH" => Self::Push,
1376                "PULL_REQUEST" => Self::PullRequest,
1377                _ => Self::UnknownValue(hook_event_type::UnknownValue(
1378                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1379                )),
1380            }
1381        }
1382    }
1383
1384    impl serde::ser::Serialize for HookEventType {
1385        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1386        where
1387            S: serde::Serializer,
1388        {
1389            match self {
1390                Self::Unspecified => serializer.serialize_i32(0),
1391                Self::Push => serializer.serialize_i32(1),
1392                Self::PullRequest => serializer.serialize_i32(2),
1393                Self::UnknownValue(u) => u.0.serialize(serializer),
1394            }
1395        }
1396    }
1397
1398    impl<'de> serde::de::Deserialize<'de> for HookEventType {
1399        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1400        where
1401            D: serde::Deserializer<'de>,
1402        {
1403            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HookEventType>::new(
1404                ".google.cloud.securesourcemanager.v1.Hook.HookEventType",
1405            ))
1406        }
1407    }
1408}
1409
1410/// Metadata of a BranchRule. BranchRule is the protection rule to enforce
1411/// pre-defined rules on designated branches within a repository.
1412#[derive(Clone, Default, PartialEq)]
1413#[non_exhaustive]
1414pub struct BranchRule {
1415    /// Optional. A unique identifier for a BranchRule. The name should be of the
1416    /// format:
1417    /// `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`
1418    pub name: std::string::String,
1419
1420    /// Output only. Unique identifier of the repository.
1421    pub uid: std::string::String,
1422
1423    /// Output only. Create timestamp.
1424    pub create_time: std::option::Option<wkt::Timestamp>,
1425
1426    /// Output only. Update timestamp.
1427    pub update_time: std::option::Option<wkt::Timestamp>,
1428
1429    /// Optional. User annotations. These attributes can only be set and used by
1430    /// the user. See <https://google.aip.dev/128#annotations> for more details such
1431    /// as format and size limitations.
1432    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
1433
1434    /// Optional. This checksum is computed by the server based on the value of
1435    /// other fields, and may be sent on update and delete requests to ensure the
1436    /// client has an up-to-date value before proceeding.
1437    pub etag: std::string::String,
1438
1439    /// Optional. The pattern of the branch that can match to this BranchRule.
1440    /// Specified as regex.
1441    /// .* for all branches. Examples: main, (main|release.*).
1442    /// Current MVP phase only support `.*` for wildcard.
1443    pub include_pattern: std::string::String,
1444
1445    /// Optional. Determines if the branch rule is disabled or not.
1446    pub disabled: bool,
1447
1448    /// Optional. Determines if the branch rule requires a pull request or not.
1449    pub require_pull_request: bool,
1450
1451    /// Optional. The minimum number of reviews required for the branch rule to be
1452    /// matched.
1453    pub minimum_reviews_count: i32,
1454
1455    /// Optional. The minimum number of approvals required for the branch rule to
1456    /// be matched.
1457    pub minimum_approvals_count: i32,
1458
1459    /// Optional. Determines if require comments resolved before merging to the
1460    /// branch.
1461    pub require_comments_resolved: bool,
1462
1463    /// Optional. Determines if allow stale reviews or approvals before merging to
1464    /// the branch.
1465    pub allow_stale_reviews: bool,
1466
1467    /// Optional. Determines if require linear history before merging to the
1468    /// branch.
1469    pub require_linear_history: bool,
1470
1471    /// Optional. List of required status checks before merging to the branch.
1472    pub required_status_checks: std::vec::Vec<crate::model::branch_rule::Check>,
1473
1474    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1475}
1476
1477impl BranchRule {
1478    pub fn new() -> Self {
1479        std::default::Default::default()
1480    }
1481
1482    /// Sets the value of [name][crate::model::BranchRule::name].
1483    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1484        self.name = v.into();
1485        self
1486    }
1487
1488    /// Sets the value of [uid][crate::model::BranchRule::uid].
1489    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1490        self.uid = v.into();
1491        self
1492    }
1493
1494    /// Sets the value of [create_time][crate::model::BranchRule::create_time].
1495    pub fn set_create_time<T>(mut self, v: T) -> Self
1496    where
1497        T: std::convert::Into<wkt::Timestamp>,
1498    {
1499        self.create_time = std::option::Option::Some(v.into());
1500        self
1501    }
1502
1503    /// Sets or clears the value of [create_time][crate::model::BranchRule::create_time].
1504    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1505    where
1506        T: std::convert::Into<wkt::Timestamp>,
1507    {
1508        self.create_time = v.map(|x| x.into());
1509        self
1510    }
1511
1512    /// Sets the value of [update_time][crate::model::BranchRule::update_time].
1513    pub fn set_update_time<T>(mut self, v: T) -> Self
1514    where
1515        T: std::convert::Into<wkt::Timestamp>,
1516    {
1517        self.update_time = std::option::Option::Some(v.into());
1518        self
1519    }
1520
1521    /// Sets or clears the value of [update_time][crate::model::BranchRule::update_time].
1522    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1523    where
1524        T: std::convert::Into<wkt::Timestamp>,
1525    {
1526        self.update_time = v.map(|x| x.into());
1527        self
1528    }
1529
1530    /// Sets the value of [annotations][crate::model::BranchRule::annotations].
1531    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1532    where
1533        T: std::iter::IntoIterator<Item = (K, V)>,
1534        K: std::convert::Into<std::string::String>,
1535        V: std::convert::Into<std::string::String>,
1536    {
1537        use std::iter::Iterator;
1538        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1539        self
1540    }
1541
1542    /// Sets the value of [etag][crate::model::BranchRule::etag].
1543    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1544        self.etag = v.into();
1545        self
1546    }
1547
1548    /// Sets the value of [include_pattern][crate::model::BranchRule::include_pattern].
1549    pub fn set_include_pattern<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1550        self.include_pattern = v.into();
1551        self
1552    }
1553
1554    /// Sets the value of [disabled][crate::model::BranchRule::disabled].
1555    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1556        self.disabled = v.into();
1557        self
1558    }
1559
1560    /// Sets the value of [require_pull_request][crate::model::BranchRule::require_pull_request].
1561    pub fn set_require_pull_request<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1562        self.require_pull_request = v.into();
1563        self
1564    }
1565
1566    /// Sets the value of [minimum_reviews_count][crate::model::BranchRule::minimum_reviews_count].
1567    pub fn set_minimum_reviews_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1568        self.minimum_reviews_count = v.into();
1569        self
1570    }
1571
1572    /// Sets the value of [minimum_approvals_count][crate::model::BranchRule::minimum_approvals_count].
1573    pub fn set_minimum_approvals_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1574        self.minimum_approvals_count = v.into();
1575        self
1576    }
1577
1578    /// Sets the value of [require_comments_resolved][crate::model::BranchRule::require_comments_resolved].
1579    pub fn set_require_comments_resolved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1580        self.require_comments_resolved = v.into();
1581        self
1582    }
1583
1584    /// Sets the value of [allow_stale_reviews][crate::model::BranchRule::allow_stale_reviews].
1585    pub fn set_allow_stale_reviews<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1586        self.allow_stale_reviews = v.into();
1587        self
1588    }
1589
1590    /// Sets the value of [require_linear_history][crate::model::BranchRule::require_linear_history].
1591    pub fn set_require_linear_history<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1592        self.require_linear_history = v.into();
1593        self
1594    }
1595
1596    /// Sets the value of [required_status_checks][crate::model::BranchRule::required_status_checks].
1597    pub fn set_required_status_checks<T, V>(mut self, v: T) -> Self
1598    where
1599        T: std::iter::IntoIterator<Item = V>,
1600        V: std::convert::Into<crate::model::branch_rule::Check>,
1601    {
1602        use std::iter::Iterator;
1603        self.required_status_checks = v.into_iter().map(|i| i.into()).collect();
1604        self
1605    }
1606}
1607
1608impl wkt::message::Message for BranchRule {
1609    fn typename() -> &'static str {
1610        "type.googleapis.com/google.cloud.securesourcemanager.v1.BranchRule"
1611    }
1612}
1613
1614/// Defines additional types related to [BranchRule].
1615pub mod branch_rule {
1616    #[allow(unused_imports)]
1617    use super::*;
1618
1619    /// Check is a type for status check.
1620    #[derive(Clone, Default, PartialEq)]
1621    #[non_exhaustive]
1622    pub struct Check {
1623        /// Required. The context of the check.
1624        pub context: std::string::String,
1625
1626        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1627    }
1628
1629    impl Check {
1630        pub fn new() -> Self {
1631            std::default::Default::default()
1632        }
1633
1634        /// Sets the value of [context][crate::model::branch_rule::Check::context].
1635        pub fn set_context<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1636            self.context = v.into();
1637            self
1638        }
1639    }
1640
1641    impl wkt::message::Message for Check {
1642        fn typename() -> &'static str {
1643            "type.googleapis.com/google.cloud.securesourcemanager.v1.BranchRule.Check"
1644        }
1645    }
1646}
1647
1648/// Metadata of a PullRequest. PullRequest is the request
1649/// from a user to merge a branch (head) into another branch (base).
1650#[derive(Clone, Default, PartialEq)]
1651#[non_exhaustive]
1652pub struct PullRequest {
1653    /// Output only. A unique identifier for a PullRequest. The number appended at
1654    /// the end is generated by the server. Format:
1655    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}`
1656    pub name: std::string::String,
1657
1658    /// Required. The pull request title.
1659    pub title: std::string::String,
1660
1661    /// Optional. The pull request body. Provides a detailed description of the
1662    /// changes.
1663    pub body: std::string::String,
1664
1665    /// Required. The branch to merge changes in.
1666    pub base: std::option::Option<crate::model::pull_request::Branch>,
1667
1668    /// Immutable. The branch containing the changes to be merged.
1669    pub head: std::option::Option<crate::model::pull_request::Branch>,
1670
1671    /// Output only. State of the pull request (open, closed or merged).
1672    pub state: crate::model::pull_request::State,
1673
1674    /// Output only. Creation timestamp.
1675    pub create_time: std::option::Option<wkt::Timestamp>,
1676
1677    /// Output only. Last updated timestamp.
1678    pub update_time: std::option::Option<wkt::Timestamp>,
1679
1680    /// Output only. Close timestamp (if closed or merged). Cleared when pull
1681    /// request is re-opened.
1682    pub close_time: std::option::Option<wkt::Timestamp>,
1683
1684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1685}
1686
1687impl PullRequest {
1688    pub fn new() -> Self {
1689        std::default::Default::default()
1690    }
1691
1692    /// Sets the value of [name][crate::model::PullRequest::name].
1693    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1694        self.name = v.into();
1695        self
1696    }
1697
1698    /// Sets the value of [title][crate::model::PullRequest::title].
1699    pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1700        self.title = v.into();
1701        self
1702    }
1703
1704    /// Sets the value of [body][crate::model::PullRequest::body].
1705    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1706        self.body = v.into();
1707        self
1708    }
1709
1710    /// Sets the value of [base][crate::model::PullRequest::base].
1711    pub fn set_base<T>(mut self, v: T) -> Self
1712    where
1713        T: std::convert::Into<crate::model::pull_request::Branch>,
1714    {
1715        self.base = std::option::Option::Some(v.into());
1716        self
1717    }
1718
1719    /// Sets or clears the value of [base][crate::model::PullRequest::base].
1720    pub fn set_or_clear_base<T>(mut self, v: std::option::Option<T>) -> Self
1721    where
1722        T: std::convert::Into<crate::model::pull_request::Branch>,
1723    {
1724        self.base = v.map(|x| x.into());
1725        self
1726    }
1727
1728    /// Sets the value of [head][crate::model::PullRequest::head].
1729    pub fn set_head<T>(mut self, v: T) -> Self
1730    where
1731        T: std::convert::Into<crate::model::pull_request::Branch>,
1732    {
1733        self.head = std::option::Option::Some(v.into());
1734        self
1735    }
1736
1737    /// Sets or clears the value of [head][crate::model::PullRequest::head].
1738    pub fn set_or_clear_head<T>(mut self, v: std::option::Option<T>) -> Self
1739    where
1740        T: std::convert::Into<crate::model::pull_request::Branch>,
1741    {
1742        self.head = v.map(|x| x.into());
1743        self
1744    }
1745
1746    /// Sets the value of [state][crate::model::PullRequest::state].
1747    pub fn set_state<T: std::convert::Into<crate::model::pull_request::State>>(
1748        mut self,
1749        v: T,
1750    ) -> Self {
1751        self.state = v.into();
1752        self
1753    }
1754
1755    /// Sets the value of [create_time][crate::model::PullRequest::create_time].
1756    pub fn set_create_time<T>(mut self, v: T) -> Self
1757    where
1758        T: std::convert::Into<wkt::Timestamp>,
1759    {
1760        self.create_time = std::option::Option::Some(v.into());
1761        self
1762    }
1763
1764    /// Sets or clears the value of [create_time][crate::model::PullRequest::create_time].
1765    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1766    where
1767        T: std::convert::Into<wkt::Timestamp>,
1768    {
1769        self.create_time = v.map(|x| x.into());
1770        self
1771    }
1772
1773    /// Sets the value of [update_time][crate::model::PullRequest::update_time].
1774    pub fn set_update_time<T>(mut self, v: T) -> Self
1775    where
1776        T: std::convert::Into<wkt::Timestamp>,
1777    {
1778        self.update_time = std::option::Option::Some(v.into());
1779        self
1780    }
1781
1782    /// Sets or clears the value of [update_time][crate::model::PullRequest::update_time].
1783    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1784    where
1785        T: std::convert::Into<wkt::Timestamp>,
1786    {
1787        self.update_time = v.map(|x| x.into());
1788        self
1789    }
1790
1791    /// Sets the value of [close_time][crate::model::PullRequest::close_time].
1792    pub fn set_close_time<T>(mut self, v: T) -> Self
1793    where
1794        T: std::convert::Into<wkt::Timestamp>,
1795    {
1796        self.close_time = std::option::Option::Some(v.into());
1797        self
1798    }
1799
1800    /// Sets or clears the value of [close_time][crate::model::PullRequest::close_time].
1801    pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
1802    where
1803        T: std::convert::Into<wkt::Timestamp>,
1804    {
1805        self.close_time = v.map(|x| x.into());
1806        self
1807    }
1808}
1809
1810impl wkt::message::Message for PullRequest {
1811    fn typename() -> &'static str {
1812        "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequest"
1813    }
1814}
1815
1816/// Defines additional types related to [PullRequest].
1817pub mod pull_request {
1818    #[allow(unused_imports)]
1819    use super::*;
1820
1821    /// Branch represents a branch involved in a pull request.
1822    #[derive(Clone, Default, PartialEq)]
1823    #[non_exhaustive]
1824    pub struct Branch {
1825        /// Required. Name of the branch.
1826        pub r#ref: std::string::String,
1827
1828        /// Output only. The commit at the tip of the branch.
1829        pub sha: std::string::String,
1830
1831        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1832    }
1833
1834    impl Branch {
1835        pub fn new() -> Self {
1836            std::default::Default::default()
1837        }
1838
1839        /// Sets the value of [r#ref][crate::model::pull_request::Branch::ref].
1840        pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1841            self.r#ref = v.into();
1842            self
1843        }
1844
1845        /// Sets the value of [sha][crate::model::pull_request::Branch::sha].
1846        pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1847            self.sha = v.into();
1848            self
1849        }
1850    }
1851
1852    impl wkt::message::Message for Branch {
1853        fn typename() -> &'static str {
1854            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequest.Branch"
1855        }
1856    }
1857
1858    /// State of the pull request.
1859    ///
1860    /// # Working with unknown values
1861    ///
1862    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1863    /// additional enum variants at any time. Adding new variants is not considered
1864    /// a breaking change. Applications should write their code in anticipation of:
1865    ///
1866    /// - New values appearing in future releases of the client library, **and**
1867    /// - New values received dynamically, without application changes.
1868    ///
1869    /// Please consult the [Working with enums] section in the user guide for some
1870    /// guidelines.
1871    ///
1872    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1873    #[derive(Clone, Debug, PartialEq)]
1874    #[non_exhaustive]
1875    pub enum State {
1876        /// Unspecified.
1877        Unspecified,
1878        /// An open pull request.
1879        Open,
1880        /// A closed pull request.
1881        Closed,
1882        /// A merged pull request.
1883        Merged,
1884        /// If set, the enum was initialized with an unknown value.
1885        ///
1886        /// Applications can examine the value using [State::value] or
1887        /// [State::name].
1888        UnknownValue(state::UnknownValue),
1889    }
1890
1891    #[doc(hidden)]
1892    pub mod state {
1893        #[allow(unused_imports)]
1894        use super::*;
1895        #[derive(Clone, Debug, PartialEq)]
1896        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1897    }
1898
1899    impl State {
1900        /// Gets the enum value.
1901        ///
1902        /// Returns `None` if the enum contains an unknown value deserialized from
1903        /// the string representation of enums.
1904        pub fn value(&self) -> std::option::Option<i32> {
1905            match self {
1906                Self::Unspecified => std::option::Option::Some(0),
1907                Self::Open => std::option::Option::Some(1),
1908                Self::Closed => std::option::Option::Some(2),
1909                Self::Merged => std::option::Option::Some(3),
1910                Self::UnknownValue(u) => u.0.value(),
1911            }
1912        }
1913
1914        /// Gets the enum value as a string.
1915        ///
1916        /// Returns `None` if the enum contains an unknown value deserialized from
1917        /// the integer representation of enums.
1918        pub fn name(&self) -> std::option::Option<&str> {
1919            match self {
1920                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1921                Self::Open => std::option::Option::Some("OPEN"),
1922                Self::Closed => std::option::Option::Some("CLOSED"),
1923                Self::Merged => std::option::Option::Some("MERGED"),
1924                Self::UnknownValue(u) => u.0.name(),
1925            }
1926        }
1927    }
1928
1929    impl std::default::Default for State {
1930        fn default() -> Self {
1931            use std::convert::From;
1932            Self::from(0)
1933        }
1934    }
1935
1936    impl std::fmt::Display for State {
1937        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1938            wkt::internal::display_enum(f, self.name(), self.value())
1939        }
1940    }
1941
1942    impl std::convert::From<i32> for State {
1943        fn from(value: i32) -> Self {
1944            match value {
1945                0 => Self::Unspecified,
1946                1 => Self::Open,
1947                2 => Self::Closed,
1948                3 => Self::Merged,
1949                _ => Self::UnknownValue(state::UnknownValue(
1950                    wkt::internal::UnknownEnumValue::Integer(value),
1951                )),
1952            }
1953        }
1954    }
1955
1956    impl std::convert::From<&str> for State {
1957        fn from(value: &str) -> Self {
1958            use std::string::ToString;
1959            match value {
1960                "STATE_UNSPECIFIED" => Self::Unspecified,
1961                "OPEN" => Self::Open,
1962                "CLOSED" => Self::Closed,
1963                "MERGED" => Self::Merged,
1964                _ => Self::UnknownValue(state::UnknownValue(
1965                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1966                )),
1967            }
1968        }
1969    }
1970
1971    impl serde::ser::Serialize for State {
1972        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1973        where
1974            S: serde::Serializer,
1975        {
1976            match self {
1977                Self::Unspecified => serializer.serialize_i32(0),
1978                Self::Open => serializer.serialize_i32(1),
1979                Self::Closed => serializer.serialize_i32(2),
1980                Self::Merged => serializer.serialize_i32(3),
1981                Self::UnknownValue(u) => u.0.serialize(serializer),
1982            }
1983        }
1984    }
1985
1986    impl<'de> serde::de::Deserialize<'de> for State {
1987        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1988        where
1989            D: serde::Deserializer<'de>,
1990        {
1991            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1992                ".google.cloud.securesourcemanager.v1.PullRequest.State",
1993            ))
1994        }
1995    }
1996}
1997
1998/// Metadata of a FileDiff. FileDiff represents a single file diff in a pull
1999/// request.
2000#[derive(Clone, Default, PartialEq)]
2001#[non_exhaustive]
2002pub struct FileDiff {
2003    /// Output only. The name of the file.
2004    pub name: std::string::String,
2005
2006    /// Output only. The action taken on the file (eg. added, modified, deleted).
2007    pub action: crate::model::file_diff::Action,
2008
2009    /// Output only. The commit pointing to the file changes.
2010    pub sha: std::string::String,
2011
2012    /// Output only. The git patch containing the file changes.
2013    pub patch: std::string::String,
2014
2015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2016}
2017
2018impl FileDiff {
2019    pub fn new() -> Self {
2020        std::default::Default::default()
2021    }
2022
2023    /// Sets the value of [name][crate::model::FileDiff::name].
2024    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2025        self.name = v.into();
2026        self
2027    }
2028
2029    /// Sets the value of [action][crate::model::FileDiff::action].
2030    pub fn set_action<T: std::convert::Into<crate::model::file_diff::Action>>(
2031        mut self,
2032        v: T,
2033    ) -> Self {
2034        self.action = v.into();
2035        self
2036    }
2037
2038    /// Sets the value of [sha][crate::model::FileDiff::sha].
2039    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2040        self.sha = v.into();
2041        self
2042    }
2043
2044    /// Sets the value of [patch][crate::model::FileDiff::patch].
2045    pub fn set_patch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2046        self.patch = v.into();
2047        self
2048    }
2049}
2050
2051impl wkt::message::Message for FileDiff {
2052    fn typename() -> &'static str {
2053        "type.googleapis.com/google.cloud.securesourcemanager.v1.FileDiff"
2054    }
2055}
2056
2057/// Defines additional types related to [FileDiff].
2058pub mod file_diff {
2059    #[allow(unused_imports)]
2060    use super::*;
2061
2062    /// Action taken on the file.
2063    ///
2064    /// # Working with unknown values
2065    ///
2066    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2067    /// additional enum variants at any time. Adding new variants is not considered
2068    /// a breaking change. Applications should write their code in anticipation of:
2069    ///
2070    /// - New values appearing in future releases of the client library, **and**
2071    /// - New values received dynamically, without application changes.
2072    ///
2073    /// Please consult the [Working with enums] section in the user guide for some
2074    /// guidelines.
2075    ///
2076    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2077    #[derive(Clone, Debug, PartialEq)]
2078    #[non_exhaustive]
2079    pub enum Action {
2080        /// Unspecified.
2081        Unspecified,
2082        /// The file was added.
2083        Added,
2084        /// The file was modified.
2085        Modified,
2086        /// The file was deleted.
2087        Deleted,
2088        /// If set, the enum was initialized with an unknown value.
2089        ///
2090        /// Applications can examine the value using [Action::value] or
2091        /// [Action::name].
2092        UnknownValue(action::UnknownValue),
2093    }
2094
2095    #[doc(hidden)]
2096    pub mod action {
2097        #[allow(unused_imports)]
2098        use super::*;
2099        #[derive(Clone, Debug, PartialEq)]
2100        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2101    }
2102
2103    impl Action {
2104        /// Gets the enum value.
2105        ///
2106        /// Returns `None` if the enum contains an unknown value deserialized from
2107        /// the string representation of enums.
2108        pub fn value(&self) -> std::option::Option<i32> {
2109            match self {
2110                Self::Unspecified => std::option::Option::Some(0),
2111                Self::Added => std::option::Option::Some(1),
2112                Self::Modified => std::option::Option::Some(2),
2113                Self::Deleted => std::option::Option::Some(3),
2114                Self::UnknownValue(u) => u.0.value(),
2115            }
2116        }
2117
2118        /// Gets the enum value as a string.
2119        ///
2120        /// Returns `None` if the enum contains an unknown value deserialized from
2121        /// the integer representation of enums.
2122        pub fn name(&self) -> std::option::Option<&str> {
2123            match self {
2124                Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
2125                Self::Added => std::option::Option::Some("ADDED"),
2126                Self::Modified => std::option::Option::Some("MODIFIED"),
2127                Self::Deleted => std::option::Option::Some("DELETED"),
2128                Self::UnknownValue(u) => u.0.name(),
2129            }
2130        }
2131    }
2132
2133    impl std::default::Default for Action {
2134        fn default() -> Self {
2135            use std::convert::From;
2136            Self::from(0)
2137        }
2138    }
2139
2140    impl std::fmt::Display for Action {
2141        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2142            wkt::internal::display_enum(f, self.name(), self.value())
2143        }
2144    }
2145
2146    impl std::convert::From<i32> for Action {
2147        fn from(value: i32) -> Self {
2148            match value {
2149                0 => Self::Unspecified,
2150                1 => Self::Added,
2151                2 => Self::Modified,
2152                3 => Self::Deleted,
2153                _ => Self::UnknownValue(action::UnknownValue(
2154                    wkt::internal::UnknownEnumValue::Integer(value),
2155                )),
2156            }
2157        }
2158    }
2159
2160    impl std::convert::From<&str> for Action {
2161        fn from(value: &str) -> Self {
2162            use std::string::ToString;
2163            match value {
2164                "ACTION_UNSPECIFIED" => Self::Unspecified,
2165                "ADDED" => Self::Added,
2166                "MODIFIED" => Self::Modified,
2167                "DELETED" => Self::Deleted,
2168                _ => Self::UnknownValue(action::UnknownValue(
2169                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2170                )),
2171            }
2172        }
2173    }
2174
2175    impl serde::ser::Serialize for Action {
2176        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2177        where
2178            S: serde::Serializer,
2179        {
2180            match self {
2181                Self::Unspecified => serializer.serialize_i32(0),
2182                Self::Added => serializer.serialize_i32(1),
2183                Self::Modified => serializer.serialize_i32(2),
2184                Self::Deleted => serializer.serialize_i32(3),
2185                Self::UnknownValue(u) => u.0.serialize(serializer),
2186            }
2187        }
2188    }
2189
2190    impl<'de> serde::de::Deserialize<'de> for Action {
2191        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2192        where
2193            D: serde::Deserializer<'de>,
2194        {
2195            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
2196                ".google.cloud.securesourcemanager.v1.FileDiff.Action",
2197            ))
2198        }
2199    }
2200}
2201
2202/// Metadata of an Issue.
2203#[derive(Clone, Default, PartialEq)]
2204#[non_exhaustive]
2205pub struct Issue {
2206    /// Identifier. Unique identifier for an issue. The issue id is generated by
2207    /// the server. Format:
2208    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`
2209    pub name: std::string::String,
2210
2211    /// Required. Issue title.
2212    pub title: std::string::String,
2213
2214    /// Optional. Issue body. Provides a detailed description of the issue.
2215    pub body: std::string::String,
2216
2217    /// Output only. State of the issue.
2218    pub state: crate::model::issue::State,
2219
2220    /// Output only. Creation timestamp.
2221    pub create_time: std::option::Option<wkt::Timestamp>,
2222
2223    /// Output only. Last updated timestamp.
2224    pub update_time: std::option::Option<wkt::Timestamp>,
2225
2226    /// Output only. Close timestamp (if closed). Cleared when is re-opened.
2227    pub close_time: std::option::Option<wkt::Timestamp>,
2228
2229    /// Optional. This checksum is computed by the server based on the value of
2230    /// other fields, and may be sent on update and delete requests to ensure the
2231    /// client has an up-to-date value before proceeding.
2232    pub etag: std::string::String,
2233
2234    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2235}
2236
2237impl Issue {
2238    pub fn new() -> Self {
2239        std::default::Default::default()
2240    }
2241
2242    /// Sets the value of [name][crate::model::Issue::name].
2243    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2244        self.name = v.into();
2245        self
2246    }
2247
2248    /// Sets the value of [title][crate::model::Issue::title].
2249    pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2250        self.title = v.into();
2251        self
2252    }
2253
2254    /// Sets the value of [body][crate::model::Issue::body].
2255    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2256        self.body = v.into();
2257        self
2258    }
2259
2260    /// Sets the value of [state][crate::model::Issue::state].
2261    pub fn set_state<T: std::convert::Into<crate::model::issue::State>>(mut self, v: T) -> Self {
2262        self.state = v.into();
2263        self
2264    }
2265
2266    /// Sets the value of [create_time][crate::model::Issue::create_time].
2267    pub fn set_create_time<T>(mut self, v: T) -> Self
2268    where
2269        T: std::convert::Into<wkt::Timestamp>,
2270    {
2271        self.create_time = std::option::Option::Some(v.into());
2272        self
2273    }
2274
2275    /// Sets or clears the value of [create_time][crate::model::Issue::create_time].
2276    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2277    where
2278        T: std::convert::Into<wkt::Timestamp>,
2279    {
2280        self.create_time = v.map(|x| x.into());
2281        self
2282    }
2283
2284    /// Sets the value of [update_time][crate::model::Issue::update_time].
2285    pub fn set_update_time<T>(mut self, v: T) -> Self
2286    where
2287        T: std::convert::Into<wkt::Timestamp>,
2288    {
2289        self.update_time = std::option::Option::Some(v.into());
2290        self
2291    }
2292
2293    /// Sets or clears the value of [update_time][crate::model::Issue::update_time].
2294    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2295    where
2296        T: std::convert::Into<wkt::Timestamp>,
2297    {
2298        self.update_time = v.map(|x| x.into());
2299        self
2300    }
2301
2302    /// Sets the value of [close_time][crate::model::Issue::close_time].
2303    pub fn set_close_time<T>(mut self, v: T) -> Self
2304    where
2305        T: std::convert::Into<wkt::Timestamp>,
2306    {
2307        self.close_time = std::option::Option::Some(v.into());
2308        self
2309    }
2310
2311    /// Sets or clears the value of [close_time][crate::model::Issue::close_time].
2312    pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
2313    where
2314        T: std::convert::Into<wkt::Timestamp>,
2315    {
2316        self.close_time = v.map(|x| x.into());
2317        self
2318    }
2319
2320    /// Sets the value of [etag][crate::model::Issue::etag].
2321    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2322        self.etag = v.into();
2323        self
2324    }
2325}
2326
2327impl wkt::message::Message for Issue {
2328    fn typename() -> &'static str {
2329        "type.googleapis.com/google.cloud.securesourcemanager.v1.Issue"
2330    }
2331}
2332
2333/// Defines additional types related to [Issue].
2334pub mod issue {
2335    #[allow(unused_imports)]
2336    use super::*;
2337
2338    /// Possible states of an issue.
2339    ///
2340    /// # Working with unknown values
2341    ///
2342    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2343    /// additional enum variants at any time. Adding new variants is not considered
2344    /// a breaking change. Applications should write their code in anticipation of:
2345    ///
2346    /// - New values appearing in future releases of the client library, **and**
2347    /// - New values received dynamically, without application changes.
2348    ///
2349    /// Please consult the [Working with enums] section in the user guide for some
2350    /// guidelines.
2351    ///
2352    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2353    #[derive(Clone, Debug, PartialEq)]
2354    #[non_exhaustive]
2355    pub enum State {
2356        /// Unspecified.
2357        Unspecified,
2358        /// An open issue.
2359        Open,
2360        /// A closed issue.
2361        Closed,
2362        /// If set, the enum was initialized with an unknown value.
2363        ///
2364        /// Applications can examine the value using [State::value] or
2365        /// [State::name].
2366        UnknownValue(state::UnknownValue),
2367    }
2368
2369    #[doc(hidden)]
2370    pub mod state {
2371        #[allow(unused_imports)]
2372        use super::*;
2373        #[derive(Clone, Debug, PartialEq)]
2374        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2375    }
2376
2377    impl State {
2378        /// Gets the enum value.
2379        ///
2380        /// Returns `None` if the enum contains an unknown value deserialized from
2381        /// the string representation of enums.
2382        pub fn value(&self) -> std::option::Option<i32> {
2383            match self {
2384                Self::Unspecified => std::option::Option::Some(0),
2385                Self::Open => std::option::Option::Some(1),
2386                Self::Closed => std::option::Option::Some(2),
2387                Self::UnknownValue(u) => u.0.value(),
2388            }
2389        }
2390
2391        /// Gets the enum value as a string.
2392        ///
2393        /// Returns `None` if the enum contains an unknown value deserialized from
2394        /// the integer representation of enums.
2395        pub fn name(&self) -> std::option::Option<&str> {
2396            match self {
2397                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2398                Self::Open => std::option::Option::Some("OPEN"),
2399                Self::Closed => std::option::Option::Some("CLOSED"),
2400                Self::UnknownValue(u) => u.0.name(),
2401            }
2402        }
2403    }
2404
2405    impl std::default::Default for State {
2406        fn default() -> Self {
2407            use std::convert::From;
2408            Self::from(0)
2409        }
2410    }
2411
2412    impl std::fmt::Display for State {
2413        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2414            wkt::internal::display_enum(f, self.name(), self.value())
2415        }
2416    }
2417
2418    impl std::convert::From<i32> for State {
2419        fn from(value: i32) -> Self {
2420            match value {
2421                0 => Self::Unspecified,
2422                1 => Self::Open,
2423                2 => Self::Closed,
2424                _ => Self::UnknownValue(state::UnknownValue(
2425                    wkt::internal::UnknownEnumValue::Integer(value),
2426                )),
2427            }
2428        }
2429    }
2430
2431    impl std::convert::From<&str> for State {
2432        fn from(value: &str) -> Self {
2433            use std::string::ToString;
2434            match value {
2435                "STATE_UNSPECIFIED" => Self::Unspecified,
2436                "OPEN" => Self::Open,
2437                "CLOSED" => Self::Closed,
2438                _ => Self::UnknownValue(state::UnknownValue(
2439                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2440                )),
2441            }
2442        }
2443    }
2444
2445    impl serde::ser::Serialize for State {
2446        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2447        where
2448            S: serde::Serializer,
2449        {
2450            match self {
2451                Self::Unspecified => serializer.serialize_i32(0),
2452                Self::Open => serializer.serialize_i32(1),
2453                Self::Closed => serializer.serialize_i32(2),
2454                Self::UnknownValue(u) => u.0.serialize(serializer),
2455            }
2456        }
2457    }
2458
2459    impl<'de> serde::de::Deserialize<'de> for State {
2460        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2461        where
2462            D: serde::Deserializer<'de>,
2463        {
2464            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2465                ".google.cloud.securesourcemanager.v1.Issue.State",
2466            ))
2467        }
2468    }
2469}
2470
2471/// IssueComment represents a comment on an issue.
2472#[derive(Clone, Default, PartialEq)]
2473#[non_exhaustive]
2474pub struct IssueComment {
2475    /// Identifier. Unique identifier for an issue comment. The comment id is
2476    /// generated by the server. Format:
2477    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment_id}`
2478    pub name: std::string::String,
2479
2480    /// Required. The comment body.
2481    pub body: std::string::String,
2482
2483    /// Output only. Creation timestamp.
2484    pub create_time: std::option::Option<wkt::Timestamp>,
2485
2486    /// Output only. Last updated timestamp.
2487    pub update_time: std::option::Option<wkt::Timestamp>,
2488
2489    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2490}
2491
2492impl IssueComment {
2493    pub fn new() -> Self {
2494        std::default::Default::default()
2495    }
2496
2497    /// Sets the value of [name][crate::model::IssueComment::name].
2498    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2499        self.name = v.into();
2500        self
2501    }
2502
2503    /// Sets the value of [body][crate::model::IssueComment::body].
2504    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2505        self.body = v.into();
2506        self
2507    }
2508
2509    /// Sets the value of [create_time][crate::model::IssueComment::create_time].
2510    pub fn set_create_time<T>(mut self, v: T) -> Self
2511    where
2512        T: std::convert::Into<wkt::Timestamp>,
2513    {
2514        self.create_time = std::option::Option::Some(v.into());
2515        self
2516    }
2517
2518    /// Sets or clears the value of [create_time][crate::model::IssueComment::create_time].
2519    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2520    where
2521        T: std::convert::Into<wkt::Timestamp>,
2522    {
2523        self.create_time = v.map(|x| x.into());
2524        self
2525    }
2526
2527    /// Sets the value of [update_time][crate::model::IssueComment::update_time].
2528    pub fn set_update_time<T>(mut self, v: T) -> Self
2529    where
2530        T: std::convert::Into<wkt::Timestamp>,
2531    {
2532        self.update_time = std::option::Option::Some(v.into());
2533        self
2534    }
2535
2536    /// Sets or clears the value of [update_time][crate::model::IssueComment::update_time].
2537    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2538    where
2539        T: std::convert::Into<wkt::Timestamp>,
2540    {
2541        self.update_time = v.map(|x| x.into());
2542        self
2543    }
2544}
2545
2546impl wkt::message::Message for IssueComment {
2547    fn typename() -> &'static str {
2548        "type.googleapis.com/google.cloud.securesourcemanager.v1.IssueComment"
2549    }
2550}
2551
2552/// PullRequestComment represents a comment on a pull request.
2553#[derive(Clone, Default, PartialEq)]
2554#[non_exhaustive]
2555pub struct PullRequestComment {
2556    /// Identifier. Unique identifier for the pull request comment. The comment id
2557    /// is generated by the server. Format:
2558    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}`
2559    pub name: std::string::String,
2560
2561    /// Output only. Creation timestamp.
2562    pub create_time: std::option::Option<wkt::Timestamp>,
2563
2564    /// Output only. Last updated timestamp.
2565    pub update_time: std::option::Option<wkt::Timestamp>,
2566
2567    /// The comment detail. A comment can be a review, a general comment, or a
2568    /// code comment.
2569    pub comment_detail: std::option::Option<crate::model::pull_request_comment::CommentDetail>,
2570
2571    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2572}
2573
2574impl PullRequestComment {
2575    pub fn new() -> Self {
2576        std::default::Default::default()
2577    }
2578
2579    /// Sets the value of [name][crate::model::PullRequestComment::name].
2580    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2581        self.name = v.into();
2582        self
2583    }
2584
2585    /// Sets the value of [create_time][crate::model::PullRequestComment::create_time].
2586    pub fn set_create_time<T>(mut self, v: T) -> Self
2587    where
2588        T: std::convert::Into<wkt::Timestamp>,
2589    {
2590        self.create_time = std::option::Option::Some(v.into());
2591        self
2592    }
2593
2594    /// Sets or clears the value of [create_time][crate::model::PullRequestComment::create_time].
2595    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2596    where
2597        T: std::convert::Into<wkt::Timestamp>,
2598    {
2599        self.create_time = v.map(|x| x.into());
2600        self
2601    }
2602
2603    /// Sets the value of [update_time][crate::model::PullRequestComment::update_time].
2604    pub fn set_update_time<T>(mut self, v: T) -> Self
2605    where
2606        T: std::convert::Into<wkt::Timestamp>,
2607    {
2608        self.update_time = std::option::Option::Some(v.into());
2609        self
2610    }
2611
2612    /// Sets or clears the value of [update_time][crate::model::PullRequestComment::update_time].
2613    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2614    where
2615        T: std::convert::Into<wkt::Timestamp>,
2616    {
2617        self.update_time = v.map(|x| x.into());
2618        self
2619    }
2620
2621    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail].
2622    ///
2623    /// Note that all the setters affecting `comment_detail` are mutually
2624    /// exclusive.
2625    pub fn set_comment_detail<
2626        T: std::convert::Into<std::option::Option<crate::model::pull_request_comment::CommentDetail>>,
2627    >(
2628        mut self,
2629        v: T,
2630    ) -> Self {
2631        self.comment_detail = v.into();
2632        self
2633    }
2634
2635    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
2636    /// if it holds a `Review`, `None` if the field is not set or
2637    /// holds a different branch.
2638    pub fn review(
2639        &self,
2640    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Review>> {
2641        #[allow(unreachable_patterns)]
2642        self.comment_detail.as_ref().and_then(|v| match v {
2643            crate::model::pull_request_comment::CommentDetail::Review(v) => {
2644                std::option::Option::Some(v)
2645            }
2646            _ => std::option::Option::None,
2647        })
2648    }
2649
2650    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
2651    /// to hold a `Review`.
2652    ///
2653    /// Note that all the setters affecting `comment_detail` are
2654    /// mutually exclusive.
2655    pub fn set_review<
2656        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Review>>,
2657    >(
2658        mut self,
2659        v: T,
2660    ) -> Self {
2661        self.comment_detail = std::option::Option::Some(
2662            crate::model::pull_request_comment::CommentDetail::Review(v.into()),
2663        );
2664        self
2665    }
2666
2667    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
2668    /// if it holds a `Comment`, `None` if the field is not set or
2669    /// holds a different branch.
2670    pub fn comment(
2671        &self,
2672    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Comment>> {
2673        #[allow(unreachable_patterns)]
2674        self.comment_detail.as_ref().and_then(|v| match v {
2675            crate::model::pull_request_comment::CommentDetail::Comment(v) => {
2676                std::option::Option::Some(v)
2677            }
2678            _ => std::option::Option::None,
2679        })
2680    }
2681
2682    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
2683    /// to hold a `Comment`.
2684    ///
2685    /// Note that all the setters affecting `comment_detail` are
2686    /// mutually exclusive.
2687    pub fn set_comment<
2688        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Comment>>,
2689    >(
2690        mut self,
2691        v: T,
2692    ) -> Self {
2693        self.comment_detail = std::option::Option::Some(
2694            crate::model::pull_request_comment::CommentDetail::Comment(v.into()),
2695        );
2696        self
2697    }
2698
2699    /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
2700    /// if it holds a `Code`, `None` if the field is not set or
2701    /// holds a different branch.
2702    pub fn code(
2703        &self,
2704    ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Code>> {
2705        #[allow(unreachable_patterns)]
2706        self.comment_detail.as_ref().and_then(|v| match v {
2707            crate::model::pull_request_comment::CommentDetail::Code(v) => {
2708                std::option::Option::Some(v)
2709            }
2710            _ => std::option::Option::None,
2711        })
2712    }
2713
2714    /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
2715    /// to hold a `Code`.
2716    ///
2717    /// Note that all the setters affecting `comment_detail` are
2718    /// mutually exclusive.
2719    pub fn set_code<
2720        T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Code>>,
2721    >(
2722        mut self,
2723        v: T,
2724    ) -> Self {
2725        self.comment_detail = std::option::Option::Some(
2726            crate::model::pull_request_comment::CommentDetail::Code(v.into()),
2727        );
2728        self
2729    }
2730}
2731
2732impl wkt::message::Message for PullRequestComment {
2733    fn typename() -> &'static str {
2734        "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment"
2735    }
2736}
2737
2738/// Defines additional types related to [PullRequestComment].
2739pub mod pull_request_comment {
2740    #[allow(unused_imports)]
2741    use super::*;
2742
2743    /// The review summary comment.
2744    #[derive(Clone, Default, PartialEq)]
2745    #[non_exhaustive]
2746    pub struct Review {
2747        /// Required. The review action type.
2748        pub action_type: crate::model::pull_request_comment::review::ActionType,
2749
2750        /// Optional. The comment body.
2751        pub body: std::string::String,
2752
2753        /// Output only. The effective commit sha this review is pointing to.
2754        pub effective_commit_sha: std::string::String,
2755
2756        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2757    }
2758
2759    impl Review {
2760        pub fn new() -> Self {
2761            std::default::Default::default()
2762        }
2763
2764        /// Sets the value of [action_type][crate::model::pull_request_comment::Review::action_type].
2765        pub fn set_action_type<
2766            T: std::convert::Into<crate::model::pull_request_comment::review::ActionType>,
2767        >(
2768            mut self,
2769            v: T,
2770        ) -> Self {
2771            self.action_type = v.into();
2772            self
2773        }
2774
2775        /// Sets the value of [body][crate::model::pull_request_comment::Review::body].
2776        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2777            self.body = v.into();
2778            self
2779        }
2780
2781        /// Sets the value of [effective_commit_sha][crate::model::pull_request_comment::Review::effective_commit_sha].
2782        pub fn set_effective_commit_sha<T: std::convert::Into<std::string::String>>(
2783            mut self,
2784            v: T,
2785        ) -> Self {
2786            self.effective_commit_sha = v.into();
2787            self
2788        }
2789    }
2790
2791    impl wkt::message::Message for Review {
2792        fn typename() -> &'static str {
2793            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Review"
2794        }
2795    }
2796
2797    /// Defines additional types related to [Review].
2798    pub mod review {
2799        #[allow(unused_imports)]
2800        use super::*;
2801
2802        /// The review action type.
2803        ///
2804        /// # Working with unknown values
2805        ///
2806        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2807        /// additional enum variants at any time. Adding new variants is not considered
2808        /// a breaking change. Applications should write their code in anticipation of:
2809        ///
2810        /// - New values appearing in future releases of the client library, **and**
2811        /// - New values received dynamically, without application changes.
2812        ///
2813        /// Please consult the [Working with enums] section in the user guide for some
2814        /// guidelines.
2815        ///
2816        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2817        #[derive(Clone, Debug, PartialEq)]
2818        #[non_exhaustive]
2819        pub enum ActionType {
2820            /// Unspecified.
2821            Unspecified,
2822            /// A general review comment.
2823            Comment,
2824            /// Change required from this review.
2825            ChangeRequested,
2826            /// Change approved from this review.
2827            Approved,
2828            /// If set, the enum was initialized with an unknown value.
2829            ///
2830            /// Applications can examine the value using [ActionType::value] or
2831            /// [ActionType::name].
2832            UnknownValue(action_type::UnknownValue),
2833        }
2834
2835        #[doc(hidden)]
2836        pub mod action_type {
2837            #[allow(unused_imports)]
2838            use super::*;
2839            #[derive(Clone, Debug, PartialEq)]
2840            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2841        }
2842
2843        impl ActionType {
2844            /// Gets the enum value.
2845            ///
2846            /// Returns `None` if the enum contains an unknown value deserialized from
2847            /// the string representation of enums.
2848            pub fn value(&self) -> std::option::Option<i32> {
2849                match self {
2850                    Self::Unspecified => std::option::Option::Some(0),
2851                    Self::Comment => std::option::Option::Some(1),
2852                    Self::ChangeRequested => std::option::Option::Some(2),
2853                    Self::Approved => std::option::Option::Some(3),
2854                    Self::UnknownValue(u) => u.0.value(),
2855                }
2856            }
2857
2858            /// Gets the enum value as a string.
2859            ///
2860            /// Returns `None` if the enum contains an unknown value deserialized from
2861            /// the integer representation of enums.
2862            pub fn name(&self) -> std::option::Option<&str> {
2863                match self {
2864                    Self::Unspecified => std::option::Option::Some("ACTION_TYPE_UNSPECIFIED"),
2865                    Self::Comment => std::option::Option::Some("COMMENT"),
2866                    Self::ChangeRequested => std::option::Option::Some("CHANGE_REQUESTED"),
2867                    Self::Approved => std::option::Option::Some("APPROVED"),
2868                    Self::UnknownValue(u) => u.0.name(),
2869                }
2870            }
2871        }
2872
2873        impl std::default::Default for ActionType {
2874            fn default() -> Self {
2875                use std::convert::From;
2876                Self::from(0)
2877            }
2878        }
2879
2880        impl std::fmt::Display for ActionType {
2881            fn fmt(
2882                &self,
2883                f: &mut std::fmt::Formatter<'_>,
2884            ) -> std::result::Result<(), std::fmt::Error> {
2885                wkt::internal::display_enum(f, self.name(), self.value())
2886            }
2887        }
2888
2889        impl std::convert::From<i32> for ActionType {
2890            fn from(value: i32) -> Self {
2891                match value {
2892                    0 => Self::Unspecified,
2893                    1 => Self::Comment,
2894                    2 => Self::ChangeRequested,
2895                    3 => Self::Approved,
2896                    _ => Self::UnknownValue(action_type::UnknownValue(
2897                        wkt::internal::UnknownEnumValue::Integer(value),
2898                    )),
2899                }
2900            }
2901        }
2902
2903        impl std::convert::From<&str> for ActionType {
2904            fn from(value: &str) -> Self {
2905                use std::string::ToString;
2906                match value {
2907                    "ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
2908                    "COMMENT" => Self::Comment,
2909                    "CHANGE_REQUESTED" => Self::ChangeRequested,
2910                    "APPROVED" => Self::Approved,
2911                    _ => Self::UnknownValue(action_type::UnknownValue(
2912                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2913                    )),
2914                }
2915            }
2916        }
2917
2918        impl serde::ser::Serialize for ActionType {
2919            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2920            where
2921                S: serde::Serializer,
2922            {
2923                match self {
2924                    Self::Unspecified => serializer.serialize_i32(0),
2925                    Self::Comment => serializer.serialize_i32(1),
2926                    Self::ChangeRequested => serializer.serialize_i32(2),
2927                    Self::Approved => serializer.serialize_i32(3),
2928                    Self::UnknownValue(u) => u.0.serialize(serializer),
2929                }
2930            }
2931        }
2932
2933        impl<'de> serde::de::Deserialize<'de> for ActionType {
2934            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2935            where
2936                D: serde::Deserializer<'de>,
2937            {
2938                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActionType>::new(
2939                    ".google.cloud.securesourcemanager.v1.PullRequestComment.Review.ActionType",
2940                ))
2941            }
2942        }
2943    }
2944
2945    /// The general pull request comment.
2946    #[derive(Clone, Default, PartialEq)]
2947    #[non_exhaustive]
2948    pub struct Comment {
2949        /// Required. The comment body.
2950        pub body: std::string::String,
2951
2952        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2953    }
2954
2955    impl Comment {
2956        pub fn new() -> Self {
2957            std::default::Default::default()
2958        }
2959
2960        /// Sets the value of [body][crate::model::pull_request_comment::Comment::body].
2961        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2962            self.body = v.into();
2963            self
2964        }
2965    }
2966
2967    impl wkt::message::Message for Comment {
2968        fn typename() -> &'static str {
2969            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Comment"
2970        }
2971    }
2972
2973    /// The comment on a code line.
2974    #[derive(Clone, Default, PartialEq)]
2975    #[non_exhaustive]
2976    pub struct Code {
2977        /// Required. The comment body.
2978        pub body: std::string::String,
2979
2980        /// Optional. Input only. The PullRequestComment resource name that this
2981        /// comment is replying to.
2982        pub reply: std::string::String,
2983
2984        /// Optional. The position of the comment.
2985        pub position: std::option::Option<crate::model::pull_request_comment::Position>,
2986
2987        /// Output only. The root comment of the conversation, derived from the reply
2988        /// field.
2989        pub effective_root_comment: std::string::String,
2990
2991        /// Output only. Boolean indicator if the comment is resolved.
2992        pub resolved: bool,
2993
2994        /// Output only. The effective commit sha this code comment is pointing to.
2995        pub effective_commit_sha: std::string::String,
2996
2997        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2998    }
2999
3000    impl Code {
3001        pub fn new() -> Self {
3002            std::default::Default::default()
3003        }
3004
3005        /// Sets the value of [body][crate::model::pull_request_comment::Code::body].
3006        pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3007            self.body = v.into();
3008            self
3009        }
3010
3011        /// Sets the value of [reply][crate::model::pull_request_comment::Code::reply].
3012        pub fn set_reply<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3013            self.reply = v.into();
3014            self
3015        }
3016
3017        /// Sets the value of [position][crate::model::pull_request_comment::Code::position].
3018        pub fn set_position<T>(mut self, v: T) -> Self
3019        where
3020            T: std::convert::Into<crate::model::pull_request_comment::Position>,
3021        {
3022            self.position = std::option::Option::Some(v.into());
3023            self
3024        }
3025
3026        /// Sets or clears the value of [position][crate::model::pull_request_comment::Code::position].
3027        pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
3028        where
3029            T: std::convert::Into<crate::model::pull_request_comment::Position>,
3030        {
3031            self.position = v.map(|x| x.into());
3032            self
3033        }
3034
3035        /// Sets the value of [effective_root_comment][crate::model::pull_request_comment::Code::effective_root_comment].
3036        pub fn set_effective_root_comment<T: std::convert::Into<std::string::String>>(
3037            mut self,
3038            v: T,
3039        ) -> Self {
3040            self.effective_root_comment = v.into();
3041            self
3042        }
3043
3044        /// Sets the value of [resolved][crate::model::pull_request_comment::Code::resolved].
3045        pub fn set_resolved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3046            self.resolved = v.into();
3047            self
3048        }
3049
3050        /// Sets the value of [effective_commit_sha][crate::model::pull_request_comment::Code::effective_commit_sha].
3051        pub fn set_effective_commit_sha<T: std::convert::Into<std::string::String>>(
3052            mut self,
3053            v: T,
3054        ) -> Self {
3055            self.effective_commit_sha = v.into();
3056            self
3057        }
3058    }
3059
3060    impl wkt::message::Message for Code {
3061        fn typename() -> &'static str {
3062            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Code"
3063        }
3064    }
3065
3066    /// The position of the code comment.
3067    #[derive(Clone, Default, PartialEq)]
3068    #[non_exhaustive]
3069    pub struct Position {
3070        /// Required. The path of the file.
3071        pub path: std::string::String,
3072
3073        /// Required. The line number of the comment. Positive value means it's on
3074        /// the new side of the diff, negative value means it's on the old side.
3075        pub line: i64,
3076
3077        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3078    }
3079
3080    impl Position {
3081        pub fn new() -> Self {
3082            std::default::Default::default()
3083        }
3084
3085        /// Sets the value of [path][crate::model::pull_request_comment::Position::path].
3086        pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3087            self.path = v.into();
3088            self
3089        }
3090
3091        /// Sets the value of [line][crate::model::pull_request_comment::Position::line].
3092        pub fn set_line<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3093            self.line = v.into();
3094            self
3095        }
3096    }
3097
3098    impl wkt::message::Message for Position {
3099        fn typename() -> &'static str {
3100            "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Position"
3101        }
3102    }
3103
3104    /// The comment detail. A comment can be a review, a general comment, or a
3105    /// code comment.
3106    #[derive(Clone, Debug, PartialEq)]
3107    #[non_exhaustive]
3108    pub enum CommentDetail {
3109        /// Optional. The review summary comment.
3110        Review(std::boxed::Box<crate::model::pull_request_comment::Review>),
3111        /// Optional. The general pull request comment.
3112        Comment(std::boxed::Box<crate::model::pull_request_comment::Comment>),
3113        /// Optional. The comment on a code line.
3114        Code(std::boxed::Box<crate::model::pull_request_comment::Code>),
3115    }
3116}
3117
3118/// ListInstancesRequest is the request to list instances.
3119#[derive(Clone, Default, PartialEq)]
3120#[non_exhaustive]
3121pub struct ListInstancesRequest {
3122    /// Required. Parent value for ListInstancesRequest.
3123    pub parent: std::string::String,
3124
3125    /// Requested page size. Server may return fewer items than requested.
3126    /// If unspecified, server will pick an appropriate default.
3127    pub page_size: i32,
3128
3129    /// A token identifying a page of results the server should return.
3130    pub page_token: std::string::String,
3131
3132    /// Filter for filtering results.
3133    pub filter: std::string::String,
3134
3135    /// Hint for how to order the results.
3136    pub order_by: std::string::String,
3137
3138    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3139}
3140
3141impl ListInstancesRequest {
3142    pub fn new() -> Self {
3143        std::default::Default::default()
3144    }
3145
3146    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
3147    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3148        self.parent = v.into();
3149        self
3150    }
3151
3152    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
3153    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3154        self.page_size = v.into();
3155        self
3156    }
3157
3158    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
3159    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160        self.page_token = v.into();
3161        self
3162    }
3163
3164    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
3165    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3166        self.filter = v.into();
3167        self
3168    }
3169
3170    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
3171    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3172        self.order_by = v.into();
3173        self
3174    }
3175}
3176
3177impl wkt::message::Message for ListInstancesRequest {
3178    fn typename() -> &'static str {
3179        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListInstancesRequest"
3180    }
3181}
3182
3183#[derive(Clone, Default, PartialEq)]
3184#[non_exhaustive]
3185pub struct ListInstancesResponse {
3186    /// The list of instances.
3187    pub instances: std::vec::Vec<crate::model::Instance>,
3188
3189    /// A token identifying a page of results the server should return.
3190    pub next_page_token: std::string::String,
3191
3192    /// Locations that could not be reached.
3193    pub unreachable: std::vec::Vec<std::string::String>,
3194
3195    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3196}
3197
3198impl ListInstancesResponse {
3199    pub fn new() -> Self {
3200        std::default::Default::default()
3201    }
3202
3203    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
3204    pub fn set_instances<T, V>(mut self, v: T) -> Self
3205    where
3206        T: std::iter::IntoIterator<Item = V>,
3207        V: std::convert::Into<crate::model::Instance>,
3208    {
3209        use std::iter::Iterator;
3210        self.instances = v.into_iter().map(|i| i.into()).collect();
3211        self
3212    }
3213
3214    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
3215    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3216        self.next_page_token = v.into();
3217        self
3218    }
3219
3220    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
3221    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3222    where
3223        T: std::iter::IntoIterator<Item = V>,
3224        V: std::convert::Into<std::string::String>,
3225    {
3226        use std::iter::Iterator;
3227        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3228        self
3229    }
3230}
3231
3232impl wkt::message::Message for ListInstancesResponse {
3233    fn typename() -> &'static str {
3234        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListInstancesResponse"
3235    }
3236}
3237
3238#[doc(hidden)]
3239impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
3240    type PageItem = crate::model::Instance;
3241
3242    fn items(self) -> std::vec::Vec<Self::PageItem> {
3243        self.instances
3244    }
3245
3246    fn next_page_token(&self) -> std::string::String {
3247        use std::clone::Clone;
3248        self.next_page_token.clone()
3249    }
3250}
3251
3252/// GetInstanceRequest is the request for getting an instance.
3253#[derive(Clone, Default, PartialEq)]
3254#[non_exhaustive]
3255pub struct GetInstanceRequest {
3256    /// Required. Name of the resource.
3257    pub name: std::string::String,
3258
3259    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3260}
3261
3262impl GetInstanceRequest {
3263    pub fn new() -> Self {
3264        std::default::Default::default()
3265    }
3266
3267    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
3268    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3269        self.name = v.into();
3270        self
3271    }
3272}
3273
3274impl wkt::message::Message for GetInstanceRequest {
3275    fn typename() -> &'static str {
3276        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetInstanceRequest"
3277    }
3278}
3279
3280/// CreateInstanceRequest is the request for creating an instance.
3281#[derive(Clone, Default, PartialEq)]
3282#[non_exhaustive]
3283pub struct CreateInstanceRequest {
3284    /// Required. Value for parent.
3285    pub parent: std::string::String,
3286
3287    /// Required. ID of the instance to be created.
3288    pub instance_id: std::string::String,
3289
3290    /// Required. The resource being created.
3291    pub instance: std::option::Option<crate::model::Instance>,
3292
3293    /// Optional. An optional request ID to identify requests. Specify a unique
3294    /// request ID so that if you must retry your request, the server will know to
3295    /// ignore the request if it has already been completed. The server will
3296    /// guarantee that for at least 60 minutes since the first request.
3297    ///
3298    /// For example, consider a situation where you make an initial request and
3299    /// the request times out. If you make the request again with the same request
3300    /// ID, the server can check if original operation with the same request ID
3301    /// was received, and if so, will ignore the second request. This prevents
3302    /// clients from accidentally creating duplicate commitments.
3303    ///
3304    /// The request ID must be a valid UUID with the exception that zero UUID is
3305    /// not supported (00000000-0000-0000-0000-000000000000).
3306    pub request_id: std::string::String,
3307
3308    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3309}
3310
3311impl CreateInstanceRequest {
3312    pub fn new() -> Self {
3313        std::default::Default::default()
3314    }
3315
3316    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
3317    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3318        self.parent = v.into();
3319        self
3320    }
3321
3322    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
3323    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3324        self.instance_id = v.into();
3325        self
3326    }
3327
3328    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
3329    pub fn set_instance<T>(mut self, v: T) -> Self
3330    where
3331        T: std::convert::Into<crate::model::Instance>,
3332    {
3333        self.instance = std::option::Option::Some(v.into());
3334        self
3335    }
3336
3337    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
3338    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
3339    where
3340        T: std::convert::Into<crate::model::Instance>,
3341    {
3342        self.instance = v.map(|x| x.into());
3343        self
3344    }
3345
3346    /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
3347    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3348        self.request_id = v.into();
3349        self
3350    }
3351}
3352
3353impl wkt::message::Message for CreateInstanceRequest {
3354    fn typename() -> &'static str {
3355        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateInstanceRequest"
3356    }
3357}
3358
3359/// DeleteInstanceRequest is the request for deleting an instance.
3360#[derive(Clone, Default, PartialEq)]
3361#[non_exhaustive]
3362pub struct DeleteInstanceRequest {
3363    /// Required. Name of the resource.
3364    pub name: std::string::String,
3365
3366    /// Optional. An optional request ID to identify requests. Specify a unique
3367    /// request ID so that if you must retry your request, the server will know to
3368    /// ignore the request if it has already been completed. The server will
3369    /// guarantee that for at least 60 minutes after the first request.
3370    ///
3371    /// For example, consider a situation where you make an initial request and
3372    /// the request times out. If you make the request again with the same request
3373    /// ID, the server can check if original operation with the same request ID
3374    /// was received, and if so, will ignore the second request. This prevents
3375    /// clients from accidentally creating duplicate commitments.
3376    ///
3377    /// The request ID must be a valid UUID with the exception that zero UUID is
3378    /// not supported (00000000-0000-0000-0000-000000000000).
3379    pub request_id: std::string::String,
3380
3381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3382}
3383
3384impl DeleteInstanceRequest {
3385    pub fn new() -> Self {
3386        std::default::Default::default()
3387    }
3388
3389    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
3390    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3391        self.name = v.into();
3392        self
3393    }
3394
3395    /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
3396    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3397        self.request_id = v.into();
3398        self
3399    }
3400}
3401
3402impl wkt::message::Message for DeleteInstanceRequest {
3403    fn typename() -> &'static str {
3404        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteInstanceRequest"
3405    }
3406}
3407
3408/// Represents the metadata of the long-running operation.
3409#[derive(Clone, Default, PartialEq)]
3410#[non_exhaustive]
3411pub struct OperationMetadata {
3412    /// Output only. The time the operation was created.
3413    pub create_time: std::option::Option<wkt::Timestamp>,
3414
3415    /// Output only. The time the operation finished running.
3416    pub end_time: std::option::Option<wkt::Timestamp>,
3417
3418    /// Output only. Server-defined resource path for the target of the operation.
3419    pub target: std::string::String,
3420
3421    /// Output only. Name of the verb executed by the operation.
3422    pub verb: std::string::String,
3423
3424    /// Output only. Human-readable status of the operation, if any.
3425    pub status_message: std::string::String,
3426
3427    /// Output only. Identifies whether the user has requested cancellation
3428    /// of the operation. Operations that have successfully been cancelled
3429    /// have [Operation.error][google.longrunning.Operation.error] value with a
3430    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3431    /// `Code.CANCELLED`.
3432    ///
3433    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
3434    /// [google.rpc.Status.code]: rpc::model::Status::code
3435    pub requested_cancellation: bool,
3436
3437    /// Output only. API version used to start the operation.
3438    pub api_version: std::string::String,
3439
3440    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3441}
3442
3443impl OperationMetadata {
3444    pub fn new() -> Self {
3445        std::default::Default::default()
3446    }
3447
3448    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3449    pub fn set_create_time<T>(mut self, v: T) -> Self
3450    where
3451        T: std::convert::Into<wkt::Timestamp>,
3452    {
3453        self.create_time = std::option::Option::Some(v.into());
3454        self
3455    }
3456
3457    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3458    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3459    where
3460        T: std::convert::Into<wkt::Timestamp>,
3461    {
3462        self.create_time = v.map(|x| x.into());
3463        self
3464    }
3465
3466    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3467    pub fn set_end_time<T>(mut self, v: T) -> Self
3468    where
3469        T: std::convert::Into<wkt::Timestamp>,
3470    {
3471        self.end_time = std::option::Option::Some(v.into());
3472        self
3473    }
3474
3475    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3476    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3477    where
3478        T: std::convert::Into<wkt::Timestamp>,
3479    {
3480        self.end_time = v.map(|x| x.into());
3481        self
3482    }
3483
3484    /// Sets the value of [target][crate::model::OperationMetadata::target].
3485    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3486        self.target = v.into();
3487        self
3488    }
3489
3490    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3491    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3492        self.verb = v.into();
3493        self
3494    }
3495
3496    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3497    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3498        self.status_message = v.into();
3499        self
3500    }
3501
3502    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3503    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3504        self.requested_cancellation = v.into();
3505        self
3506    }
3507
3508    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3509    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3510        self.api_version = v.into();
3511        self
3512    }
3513}
3514
3515impl wkt::message::Message for OperationMetadata {
3516    fn typename() -> &'static str {
3517        "type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata"
3518    }
3519}
3520
3521/// ListRepositoriesRequest is request to list repositories.
3522#[derive(Clone, Default, PartialEq)]
3523#[non_exhaustive]
3524pub struct ListRepositoriesRequest {
3525    /// Required. Parent value for ListRepositoriesRequest.
3526    pub parent: std::string::String,
3527
3528    /// Optional. Requested page size. Server may return fewer items than
3529    /// requested. If unspecified, server will pick an appropriate default.
3530    pub page_size: i32,
3531
3532    /// A token identifying a page of results the server should return.
3533    pub page_token: std::string::String,
3534
3535    /// Optional. Filter results.
3536    pub filter: std::string::String,
3537
3538    /// Optional. The name of the instance in which the repository is hosted,
3539    /// formatted as
3540    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`.
3541    /// When listing repositories via securesourcemanager.googleapis.com, this
3542    /// field is required. When listing repositories via *.sourcemanager.dev, this
3543    /// field is ignored.
3544    pub instance: std::string::String,
3545
3546    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3547}
3548
3549impl ListRepositoriesRequest {
3550    pub fn new() -> Self {
3551        std::default::Default::default()
3552    }
3553
3554    /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
3555    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3556        self.parent = v.into();
3557        self
3558    }
3559
3560    /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
3561    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3562        self.page_size = v.into();
3563        self
3564    }
3565
3566    /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
3567    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3568        self.page_token = v.into();
3569        self
3570    }
3571
3572    /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
3573    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3574        self.filter = v.into();
3575        self
3576    }
3577
3578    /// Sets the value of [instance][crate::model::ListRepositoriesRequest::instance].
3579    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3580        self.instance = v.into();
3581        self
3582    }
3583}
3584
3585impl wkt::message::Message for ListRepositoriesRequest {
3586    fn typename() -> &'static str {
3587        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListRepositoriesRequest"
3588    }
3589}
3590
3591#[derive(Clone, Default, PartialEq)]
3592#[non_exhaustive]
3593pub struct ListRepositoriesResponse {
3594    /// The list of repositories.
3595    pub repositories: std::vec::Vec<crate::model::Repository>,
3596
3597    /// A token identifying a page of results the server should return.
3598    pub next_page_token: std::string::String,
3599
3600    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3601}
3602
3603impl ListRepositoriesResponse {
3604    pub fn new() -> Self {
3605        std::default::Default::default()
3606    }
3607
3608    /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
3609    pub fn set_repositories<T, V>(mut self, v: T) -> Self
3610    where
3611        T: std::iter::IntoIterator<Item = V>,
3612        V: std::convert::Into<crate::model::Repository>,
3613    {
3614        use std::iter::Iterator;
3615        self.repositories = v.into_iter().map(|i| i.into()).collect();
3616        self
3617    }
3618
3619    /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
3620    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3621        self.next_page_token = v.into();
3622        self
3623    }
3624}
3625
3626impl wkt::message::Message for ListRepositoriesResponse {
3627    fn typename() -> &'static str {
3628        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListRepositoriesResponse"
3629    }
3630}
3631
3632#[doc(hidden)]
3633impl gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
3634    type PageItem = crate::model::Repository;
3635
3636    fn items(self) -> std::vec::Vec<Self::PageItem> {
3637        self.repositories
3638    }
3639
3640    fn next_page_token(&self) -> std::string::String {
3641        use std::clone::Clone;
3642        self.next_page_token.clone()
3643    }
3644}
3645
3646/// GetRepositoryRequest is the request for getting a repository.
3647#[derive(Clone, Default, PartialEq)]
3648#[non_exhaustive]
3649pub struct GetRepositoryRequest {
3650    /// Required. Name of the repository to retrieve.
3651    /// The format is
3652    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
3653    pub name: std::string::String,
3654
3655    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3656}
3657
3658impl GetRepositoryRequest {
3659    pub fn new() -> Self {
3660        std::default::Default::default()
3661    }
3662
3663    /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
3664    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3665        self.name = v.into();
3666        self
3667    }
3668}
3669
3670impl wkt::message::Message for GetRepositoryRequest {
3671    fn typename() -> &'static str {
3672        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetRepositoryRequest"
3673    }
3674}
3675
3676/// CreateRepositoryRequest is the request for creating a repository.
3677#[derive(Clone, Default, PartialEq)]
3678#[non_exhaustive]
3679pub struct CreateRepositoryRequest {
3680    /// Required. The project in which to create the repository. Values are of the
3681    /// form `projects/{project_number}/locations/{location_id}`
3682    pub parent: std::string::String,
3683
3684    /// Required. The resource being created.
3685    pub repository: std::option::Option<crate::model::Repository>,
3686
3687    /// Required. The ID to use for the repository, which will become the final
3688    /// component of the repository's resource name. This value should be 4-63
3689    /// characters, and valid characters are /[a-z][0-9]-/.
3690    pub repository_id: std::string::String,
3691
3692    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3693}
3694
3695impl CreateRepositoryRequest {
3696    pub fn new() -> Self {
3697        std::default::Default::default()
3698    }
3699
3700    /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
3701    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3702        self.parent = v.into();
3703        self
3704    }
3705
3706    /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
3707    pub fn set_repository<T>(mut self, v: T) -> Self
3708    where
3709        T: std::convert::Into<crate::model::Repository>,
3710    {
3711        self.repository = std::option::Option::Some(v.into());
3712        self
3713    }
3714
3715    /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
3716    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
3717    where
3718        T: std::convert::Into<crate::model::Repository>,
3719    {
3720        self.repository = v.map(|x| x.into());
3721        self
3722    }
3723
3724    /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
3725    pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3726        self.repository_id = v.into();
3727        self
3728    }
3729}
3730
3731impl wkt::message::Message for CreateRepositoryRequest {
3732    fn typename() -> &'static str {
3733        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateRepositoryRequest"
3734    }
3735}
3736
3737/// UpdateRepositoryRequest is the request to update a repository.
3738#[derive(Clone, Default, PartialEq)]
3739#[non_exhaustive]
3740pub struct UpdateRepositoryRequest {
3741    /// Optional. Field mask is used to specify the fields to be overwritten in the
3742    /// repository resource by the update.
3743    /// The fields specified in the update_mask are relative to the resource, not
3744    /// the full request. A field will be overwritten if it is in the mask. If the
3745    /// user does not provide a mask then all fields will be overwritten.
3746    pub update_mask: std::option::Option<wkt::FieldMask>,
3747
3748    /// Required. The repository being updated.
3749    pub repository: std::option::Option<crate::model::Repository>,
3750
3751    /// Optional. False by default. If set to true, the request is validated and
3752    /// the user is provided with an expected result, but no actual change is made.
3753    pub validate_only: bool,
3754
3755    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3756}
3757
3758impl UpdateRepositoryRequest {
3759    pub fn new() -> Self {
3760        std::default::Default::default()
3761    }
3762
3763    /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
3764    pub fn set_update_mask<T>(mut self, v: T) -> Self
3765    where
3766        T: std::convert::Into<wkt::FieldMask>,
3767    {
3768        self.update_mask = std::option::Option::Some(v.into());
3769        self
3770    }
3771
3772    /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
3773    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3774    where
3775        T: std::convert::Into<wkt::FieldMask>,
3776    {
3777        self.update_mask = v.map(|x| x.into());
3778        self
3779    }
3780
3781    /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
3782    pub fn set_repository<T>(mut self, v: T) -> Self
3783    where
3784        T: std::convert::Into<crate::model::Repository>,
3785    {
3786        self.repository = std::option::Option::Some(v.into());
3787        self
3788    }
3789
3790    /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
3791    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
3792    where
3793        T: std::convert::Into<crate::model::Repository>,
3794    {
3795        self.repository = v.map(|x| x.into());
3796        self
3797    }
3798
3799    /// Sets the value of [validate_only][crate::model::UpdateRepositoryRequest::validate_only].
3800    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3801        self.validate_only = v.into();
3802        self
3803    }
3804}
3805
3806impl wkt::message::Message for UpdateRepositoryRequest {
3807    fn typename() -> &'static str {
3808        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateRepositoryRequest"
3809    }
3810}
3811
3812/// DeleteRepositoryRequest is the request to delete a repository.
3813#[derive(Clone, Default, PartialEq)]
3814#[non_exhaustive]
3815pub struct DeleteRepositoryRequest {
3816    /// Required. Name of the repository to delete.
3817    /// The format is
3818    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
3819    pub name: std::string::String,
3820
3821    /// Optional. If set to true, and the repository is not found, the request will
3822    /// succeed but no action will be taken on the server.
3823    pub allow_missing: bool,
3824
3825    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3826}
3827
3828impl DeleteRepositoryRequest {
3829    pub fn new() -> Self {
3830        std::default::Default::default()
3831    }
3832
3833    /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
3834    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3835        self.name = v.into();
3836        self
3837    }
3838
3839    /// Sets the value of [allow_missing][crate::model::DeleteRepositoryRequest::allow_missing].
3840    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3841        self.allow_missing = v.into();
3842        self
3843    }
3844}
3845
3846impl wkt::message::Message for DeleteRepositoryRequest {
3847    fn typename() -> &'static str {
3848        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteRepositoryRequest"
3849    }
3850}
3851
3852/// ListHooksRequest is request to list hooks.
3853#[derive(Clone, Default, PartialEq)]
3854#[non_exhaustive]
3855pub struct ListHooksRequest {
3856    /// Required. Parent value for ListHooksRequest.
3857    pub parent: std::string::String,
3858
3859    /// Optional. Requested page size. Server may return fewer items than
3860    /// requested. If unspecified, server will pick an appropriate default.
3861    pub page_size: i32,
3862
3863    /// Optional. A token identifying a page of results the server should return.
3864    pub page_token: std::string::String,
3865
3866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3867}
3868
3869impl ListHooksRequest {
3870    pub fn new() -> Self {
3871        std::default::Default::default()
3872    }
3873
3874    /// Sets the value of [parent][crate::model::ListHooksRequest::parent].
3875    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3876        self.parent = v.into();
3877        self
3878    }
3879
3880    /// Sets the value of [page_size][crate::model::ListHooksRequest::page_size].
3881    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3882        self.page_size = v.into();
3883        self
3884    }
3885
3886    /// Sets the value of [page_token][crate::model::ListHooksRequest::page_token].
3887    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3888        self.page_token = v.into();
3889        self
3890    }
3891}
3892
3893impl wkt::message::Message for ListHooksRequest {
3894    fn typename() -> &'static str {
3895        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListHooksRequest"
3896    }
3897}
3898
3899/// ListHooksResponse is response to list hooks.
3900#[derive(Clone, Default, PartialEq)]
3901#[non_exhaustive]
3902pub struct ListHooksResponse {
3903    /// The list of hooks.
3904    pub hooks: std::vec::Vec<crate::model::Hook>,
3905
3906    /// A token identifying a page of results the server should return.
3907    pub next_page_token: std::string::String,
3908
3909    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3910}
3911
3912impl ListHooksResponse {
3913    pub fn new() -> Self {
3914        std::default::Default::default()
3915    }
3916
3917    /// Sets the value of [hooks][crate::model::ListHooksResponse::hooks].
3918    pub fn set_hooks<T, V>(mut self, v: T) -> Self
3919    where
3920        T: std::iter::IntoIterator<Item = V>,
3921        V: std::convert::Into<crate::model::Hook>,
3922    {
3923        use std::iter::Iterator;
3924        self.hooks = v.into_iter().map(|i| i.into()).collect();
3925        self
3926    }
3927
3928    /// Sets the value of [next_page_token][crate::model::ListHooksResponse::next_page_token].
3929    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3930        self.next_page_token = v.into();
3931        self
3932    }
3933}
3934
3935impl wkt::message::Message for ListHooksResponse {
3936    fn typename() -> &'static str {
3937        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListHooksResponse"
3938    }
3939}
3940
3941#[doc(hidden)]
3942impl gax::paginator::internal::PageableResponse for ListHooksResponse {
3943    type PageItem = crate::model::Hook;
3944
3945    fn items(self) -> std::vec::Vec<Self::PageItem> {
3946        self.hooks
3947    }
3948
3949    fn next_page_token(&self) -> std::string::String {
3950        use std::clone::Clone;
3951        self.next_page_token.clone()
3952    }
3953}
3954
3955/// GetHookRequest is the request for getting a hook.
3956#[derive(Clone, Default, PartialEq)]
3957#[non_exhaustive]
3958pub struct GetHookRequest {
3959    /// Required. Name of the hook to retrieve.
3960    /// The format is
3961    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`.
3962    pub name: std::string::String,
3963
3964    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3965}
3966
3967impl GetHookRequest {
3968    pub fn new() -> Self {
3969        std::default::Default::default()
3970    }
3971
3972    /// Sets the value of [name][crate::model::GetHookRequest::name].
3973    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3974        self.name = v.into();
3975        self
3976    }
3977}
3978
3979impl wkt::message::Message for GetHookRequest {
3980    fn typename() -> &'static str {
3981        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetHookRequest"
3982    }
3983}
3984
3985/// CreateHookRequest is the request for creating a hook.
3986#[derive(Clone, Default, PartialEq)]
3987#[non_exhaustive]
3988pub struct CreateHookRequest {
3989    /// Required. The repository in which to create the hook. Values are of the
3990    /// form
3991    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
3992    pub parent: std::string::String,
3993
3994    /// Required. The resource being created.
3995    pub hook: std::option::Option<crate::model::Hook>,
3996
3997    /// Required. The ID to use for the hook, which will become the final component
3998    /// of the hook's resource name. This value restricts to lower-case letters,
3999    /// numbers, and hyphen, with the first character a letter, the last a letter
4000    /// or a number, and a 63 character maximum.
4001    pub hook_id: std::string::String,
4002
4003    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4004}
4005
4006impl CreateHookRequest {
4007    pub fn new() -> Self {
4008        std::default::Default::default()
4009    }
4010
4011    /// Sets the value of [parent][crate::model::CreateHookRequest::parent].
4012    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4013        self.parent = v.into();
4014        self
4015    }
4016
4017    /// Sets the value of [hook][crate::model::CreateHookRequest::hook].
4018    pub fn set_hook<T>(mut self, v: T) -> Self
4019    where
4020        T: std::convert::Into<crate::model::Hook>,
4021    {
4022        self.hook = std::option::Option::Some(v.into());
4023        self
4024    }
4025
4026    /// Sets or clears the value of [hook][crate::model::CreateHookRequest::hook].
4027    pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
4028    where
4029        T: std::convert::Into<crate::model::Hook>,
4030    {
4031        self.hook = v.map(|x| x.into());
4032        self
4033    }
4034
4035    /// Sets the value of [hook_id][crate::model::CreateHookRequest::hook_id].
4036    pub fn set_hook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4037        self.hook_id = v.into();
4038        self
4039    }
4040}
4041
4042impl wkt::message::Message for CreateHookRequest {
4043    fn typename() -> &'static str {
4044        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateHookRequest"
4045    }
4046}
4047
4048/// UpdateHookRequest is the request to update a hook.
4049#[derive(Clone, Default, PartialEq)]
4050#[non_exhaustive]
4051pub struct UpdateHookRequest {
4052    /// Required. Field mask is used to specify the fields to be overwritten in the
4053    /// hook resource by the update.
4054    /// The fields specified in the update_mask are relative to the resource, not
4055    /// the full request. A field will be overwritten if it is in the mask.
4056    /// The special value "*" means full replacement.
4057    pub update_mask: std::option::Option<wkt::FieldMask>,
4058
4059    /// Required. The hook being updated.
4060    pub hook: std::option::Option<crate::model::Hook>,
4061
4062    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4063}
4064
4065impl UpdateHookRequest {
4066    pub fn new() -> Self {
4067        std::default::Default::default()
4068    }
4069
4070    /// Sets the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
4071    pub fn set_update_mask<T>(mut self, v: T) -> Self
4072    where
4073        T: std::convert::Into<wkt::FieldMask>,
4074    {
4075        self.update_mask = std::option::Option::Some(v.into());
4076        self
4077    }
4078
4079    /// Sets or clears the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
4080    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4081    where
4082        T: std::convert::Into<wkt::FieldMask>,
4083    {
4084        self.update_mask = v.map(|x| x.into());
4085        self
4086    }
4087
4088    /// Sets the value of [hook][crate::model::UpdateHookRequest::hook].
4089    pub fn set_hook<T>(mut self, v: T) -> Self
4090    where
4091        T: std::convert::Into<crate::model::Hook>,
4092    {
4093        self.hook = std::option::Option::Some(v.into());
4094        self
4095    }
4096
4097    /// Sets or clears the value of [hook][crate::model::UpdateHookRequest::hook].
4098    pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
4099    where
4100        T: std::convert::Into<crate::model::Hook>,
4101    {
4102        self.hook = v.map(|x| x.into());
4103        self
4104    }
4105}
4106
4107impl wkt::message::Message for UpdateHookRequest {
4108    fn typename() -> &'static str {
4109        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateHookRequest"
4110    }
4111}
4112
4113/// DeleteHookRequest is the request to delete a hook.
4114#[derive(Clone, Default, PartialEq)]
4115#[non_exhaustive]
4116pub struct DeleteHookRequest {
4117    /// Required. Name of the hook to delete.
4118    /// The format is
4119    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`.
4120    pub name: std::string::String,
4121
4122    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4123}
4124
4125impl DeleteHookRequest {
4126    pub fn new() -> Self {
4127        std::default::Default::default()
4128    }
4129
4130    /// Sets the value of [name][crate::model::DeleteHookRequest::name].
4131    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4132        self.name = v.into();
4133        self
4134    }
4135}
4136
4137impl wkt::message::Message for DeleteHookRequest {
4138    fn typename() -> &'static str {
4139        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteHookRequest"
4140    }
4141}
4142
4143/// GetBranchRuleRequest is the request for getting a branch rule.
4144#[derive(Clone, Default, PartialEq)]
4145#[non_exhaustive]
4146pub struct GetBranchRuleRequest {
4147    /// Required. Name of the repository to retrieve.
4148    /// The format is
4149    /// `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`.
4150    pub name: std::string::String,
4151
4152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4153}
4154
4155impl GetBranchRuleRequest {
4156    pub fn new() -> Self {
4157        std::default::Default::default()
4158    }
4159
4160    /// Sets the value of [name][crate::model::GetBranchRuleRequest::name].
4161    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4162        self.name = v.into();
4163        self
4164    }
4165}
4166
4167impl wkt::message::Message for GetBranchRuleRequest {
4168    fn typename() -> &'static str {
4169        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetBranchRuleRequest"
4170    }
4171}
4172
4173/// CreateBranchRuleRequest is the request to create a branch rule.
4174#[derive(Clone, Default, PartialEq)]
4175#[non_exhaustive]
4176pub struct CreateBranchRuleRequest {
4177    pub parent: std::string::String,
4178
4179    pub branch_rule: std::option::Option<crate::model::BranchRule>,
4180
4181    pub branch_rule_id: std::string::String,
4182
4183    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4184}
4185
4186impl CreateBranchRuleRequest {
4187    pub fn new() -> Self {
4188        std::default::Default::default()
4189    }
4190
4191    /// Sets the value of [parent][crate::model::CreateBranchRuleRequest::parent].
4192    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4193        self.parent = v.into();
4194        self
4195    }
4196
4197    /// Sets the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
4198    pub fn set_branch_rule<T>(mut self, v: T) -> Self
4199    where
4200        T: std::convert::Into<crate::model::BranchRule>,
4201    {
4202        self.branch_rule = std::option::Option::Some(v.into());
4203        self
4204    }
4205
4206    /// Sets or clears the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
4207    pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
4208    where
4209        T: std::convert::Into<crate::model::BranchRule>,
4210    {
4211        self.branch_rule = v.map(|x| x.into());
4212        self
4213    }
4214
4215    /// Sets the value of [branch_rule_id][crate::model::CreateBranchRuleRequest::branch_rule_id].
4216    pub fn set_branch_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4217        self.branch_rule_id = v.into();
4218        self
4219    }
4220}
4221
4222impl wkt::message::Message for CreateBranchRuleRequest {
4223    fn typename() -> &'static str {
4224        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateBranchRuleRequest"
4225    }
4226}
4227
4228/// ListBranchRulesRequest is the request to list branch rules.
4229#[derive(Clone, Default, PartialEq)]
4230#[non_exhaustive]
4231pub struct ListBranchRulesRequest {
4232    pub parent: std::string::String,
4233
4234    pub page_size: i32,
4235
4236    pub page_token: std::string::String,
4237
4238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4239}
4240
4241impl ListBranchRulesRequest {
4242    pub fn new() -> Self {
4243        std::default::Default::default()
4244    }
4245
4246    /// Sets the value of [parent][crate::model::ListBranchRulesRequest::parent].
4247    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4248        self.parent = v.into();
4249        self
4250    }
4251
4252    /// Sets the value of [page_size][crate::model::ListBranchRulesRequest::page_size].
4253    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4254        self.page_size = v.into();
4255        self
4256    }
4257
4258    /// Sets the value of [page_token][crate::model::ListBranchRulesRequest::page_token].
4259    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4260        self.page_token = v.into();
4261        self
4262    }
4263}
4264
4265impl wkt::message::Message for ListBranchRulesRequest {
4266    fn typename() -> &'static str {
4267        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListBranchRulesRequest"
4268    }
4269}
4270
4271/// DeleteBranchRuleRequest is the request to delete a branch rule.
4272#[derive(Clone, Default, PartialEq)]
4273#[non_exhaustive]
4274pub struct DeleteBranchRuleRequest {
4275    pub name: std::string::String,
4276
4277    /// Optional. If set to true, and the branch rule is not found, the request
4278    /// will succeed but no action will be taken on the server.
4279    pub allow_missing: bool,
4280
4281    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4282}
4283
4284impl DeleteBranchRuleRequest {
4285    pub fn new() -> Self {
4286        std::default::Default::default()
4287    }
4288
4289    /// Sets the value of [name][crate::model::DeleteBranchRuleRequest::name].
4290    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4291        self.name = v.into();
4292        self
4293    }
4294
4295    /// Sets the value of [allow_missing][crate::model::DeleteBranchRuleRequest::allow_missing].
4296    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4297        self.allow_missing = v.into();
4298        self
4299    }
4300}
4301
4302impl wkt::message::Message for DeleteBranchRuleRequest {
4303    fn typename() -> &'static str {
4304        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest"
4305    }
4306}
4307
4308/// UpdateBranchRuleRequest is the request to update a branchRule.
4309#[derive(Clone, Default, PartialEq)]
4310#[non_exhaustive]
4311pub struct UpdateBranchRuleRequest {
4312    pub branch_rule: std::option::Option<crate::model::BranchRule>,
4313
4314    /// Optional. If set, validate the request and preview the review, but do not
4315    /// actually post it.  (<https://google.aip.dev/163>, for declarative friendly)
4316    pub validate_only: bool,
4317
4318    /// Required. Field mask is used to specify the fields to be overwritten in the
4319    /// branchRule resource by the update.
4320    /// The fields specified in the update_mask are relative to the resource, not
4321    /// the full request. A field will be overwritten if it is in the mask.
4322    /// The special value "*" means full replacement.
4323    pub update_mask: std::option::Option<wkt::FieldMask>,
4324
4325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4326}
4327
4328impl UpdateBranchRuleRequest {
4329    pub fn new() -> Self {
4330        std::default::Default::default()
4331    }
4332
4333    /// Sets the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
4334    pub fn set_branch_rule<T>(mut self, v: T) -> Self
4335    where
4336        T: std::convert::Into<crate::model::BranchRule>,
4337    {
4338        self.branch_rule = std::option::Option::Some(v.into());
4339        self
4340    }
4341
4342    /// Sets or clears the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
4343    pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
4344    where
4345        T: std::convert::Into<crate::model::BranchRule>,
4346    {
4347        self.branch_rule = v.map(|x| x.into());
4348        self
4349    }
4350
4351    /// Sets the value of [validate_only][crate::model::UpdateBranchRuleRequest::validate_only].
4352    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4353        self.validate_only = v.into();
4354        self
4355    }
4356
4357    /// Sets the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
4358    pub fn set_update_mask<T>(mut self, v: T) -> Self
4359    where
4360        T: std::convert::Into<wkt::FieldMask>,
4361    {
4362        self.update_mask = std::option::Option::Some(v.into());
4363        self
4364    }
4365
4366    /// Sets or clears the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
4367    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4368    where
4369        T: std::convert::Into<wkt::FieldMask>,
4370    {
4371        self.update_mask = v.map(|x| x.into());
4372        self
4373    }
4374}
4375
4376impl wkt::message::Message for UpdateBranchRuleRequest {
4377    fn typename() -> &'static str {
4378        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest"
4379    }
4380}
4381
4382/// ListBranchRulesResponse is the response to listing branchRules.
4383#[derive(Clone, Default, PartialEq)]
4384#[non_exhaustive]
4385pub struct ListBranchRulesResponse {
4386    /// The list of branch rules.
4387    pub branch_rules: std::vec::Vec<crate::model::BranchRule>,
4388
4389    /// A token identifying a page of results the server should return.
4390    pub next_page_token: std::string::String,
4391
4392    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4393}
4394
4395impl ListBranchRulesResponse {
4396    pub fn new() -> Self {
4397        std::default::Default::default()
4398    }
4399
4400    /// Sets the value of [branch_rules][crate::model::ListBranchRulesResponse::branch_rules].
4401    pub fn set_branch_rules<T, V>(mut self, v: T) -> Self
4402    where
4403        T: std::iter::IntoIterator<Item = V>,
4404        V: std::convert::Into<crate::model::BranchRule>,
4405    {
4406        use std::iter::Iterator;
4407        self.branch_rules = v.into_iter().map(|i| i.into()).collect();
4408        self
4409    }
4410
4411    /// Sets the value of [next_page_token][crate::model::ListBranchRulesResponse::next_page_token].
4412    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4413        self.next_page_token = v.into();
4414        self
4415    }
4416}
4417
4418impl wkt::message::Message for ListBranchRulesResponse {
4419    fn typename() -> &'static str {
4420        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListBranchRulesResponse"
4421    }
4422}
4423
4424#[doc(hidden)]
4425impl gax::paginator::internal::PageableResponse for ListBranchRulesResponse {
4426    type PageItem = crate::model::BranchRule;
4427
4428    fn items(self) -> std::vec::Vec<Self::PageItem> {
4429        self.branch_rules
4430    }
4431
4432    fn next_page_token(&self) -> std::string::String {
4433        use std::clone::Clone;
4434        self.next_page_token.clone()
4435    }
4436}
4437
4438/// CreatePullRequestRequest is the request to create a pull request.
4439#[derive(Clone, Default, PartialEq)]
4440#[non_exhaustive]
4441pub struct CreatePullRequestRequest {
4442    /// Required. The repository that the pull request is created from. Format:
4443    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
4444    pub parent: std::string::String,
4445
4446    /// Required. The pull request to create.
4447    pub pull_request: std::option::Option<crate::model::PullRequest>,
4448
4449    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4450}
4451
4452impl CreatePullRequestRequest {
4453    pub fn new() -> Self {
4454        std::default::Default::default()
4455    }
4456
4457    /// Sets the value of [parent][crate::model::CreatePullRequestRequest::parent].
4458    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4459        self.parent = v.into();
4460        self
4461    }
4462
4463    /// Sets the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
4464    pub fn set_pull_request<T>(mut self, v: T) -> Self
4465    where
4466        T: std::convert::Into<crate::model::PullRequest>,
4467    {
4468        self.pull_request = std::option::Option::Some(v.into());
4469        self
4470    }
4471
4472    /// Sets or clears the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
4473    pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
4474    where
4475        T: std::convert::Into<crate::model::PullRequest>,
4476    {
4477        self.pull_request = v.map(|x| x.into());
4478        self
4479    }
4480}
4481
4482impl wkt::message::Message for CreatePullRequestRequest {
4483    fn typename() -> &'static str {
4484        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreatePullRequestRequest"
4485    }
4486}
4487
4488/// GetPullRequestRequest is the request to get a pull request.
4489#[derive(Clone, Default, PartialEq)]
4490#[non_exhaustive]
4491pub struct GetPullRequestRequest {
4492    /// Required. Name of the pull request to retrieve.
4493    /// The format is
4494    /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`.
4495    pub name: std::string::String,
4496
4497    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4498}
4499
4500impl GetPullRequestRequest {
4501    pub fn new() -> Self {
4502        std::default::Default::default()
4503    }
4504
4505    /// Sets the value of [name][crate::model::GetPullRequestRequest::name].
4506    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4507        self.name = v.into();
4508        self
4509    }
4510}
4511
4512impl wkt::message::Message for GetPullRequestRequest {
4513    fn typename() -> &'static str {
4514        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetPullRequestRequest"
4515    }
4516}
4517
4518/// ListPullRequestsRequest is the request to list pull requests.
4519#[derive(Clone, Default, PartialEq)]
4520#[non_exhaustive]
4521pub struct ListPullRequestsRequest {
4522    /// Required. The repository in which to list pull requests. Format:
4523    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
4524    pub parent: std::string::String,
4525
4526    /// Optional. Requested page size. Server may return fewer items than
4527    /// requested. If unspecified, server will pick an appropriate default.
4528    pub page_size: i32,
4529
4530    /// Optional. A token identifying a page of results the server should return.
4531    pub page_token: std::string::String,
4532
4533    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4534}
4535
4536impl ListPullRequestsRequest {
4537    pub fn new() -> Self {
4538        std::default::Default::default()
4539    }
4540
4541    /// Sets the value of [parent][crate::model::ListPullRequestsRequest::parent].
4542    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4543        self.parent = v.into();
4544        self
4545    }
4546
4547    /// Sets the value of [page_size][crate::model::ListPullRequestsRequest::page_size].
4548    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4549        self.page_size = v.into();
4550        self
4551    }
4552
4553    /// Sets the value of [page_token][crate::model::ListPullRequestsRequest::page_token].
4554    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4555        self.page_token = v.into();
4556        self
4557    }
4558}
4559
4560impl wkt::message::Message for ListPullRequestsRequest {
4561    fn typename() -> &'static str {
4562        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestsRequest"
4563    }
4564}
4565
4566/// ListPullRequestsResponse is the response to list pull requests.
4567#[derive(Clone, Default, PartialEq)]
4568#[non_exhaustive]
4569pub struct ListPullRequestsResponse {
4570    /// The list of pull requests.
4571    pub pull_requests: std::vec::Vec<crate::model::PullRequest>,
4572
4573    /// A token identifying a page of results the server should return.
4574    pub next_page_token: std::string::String,
4575
4576    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4577}
4578
4579impl ListPullRequestsResponse {
4580    pub fn new() -> Self {
4581        std::default::Default::default()
4582    }
4583
4584    /// Sets the value of [pull_requests][crate::model::ListPullRequestsResponse::pull_requests].
4585    pub fn set_pull_requests<T, V>(mut self, v: T) -> Self
4586    where
4587        T: std::iter::IntoIterator<Item = V>,
4588        V: std::convert::Into<crate::model::PullRequest>,
4589    {
4590        use std::iter::Iterator;
4591        self.pull_requests = v.into_iter().map(|i| i.into()).collect();
4592        self
4593    }
4594
4595    /// Sets the value of [next_page_token][crate::model::ListPullRequestsResponse::next_page_token].
4596    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4597        self.next_page_token = v.into();
4598        self
4599    }
4600}
4601
4602impl wkt::message::Message for ListPullRequestsResponse {
4603    fn typename() -> &'static str {
4604        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestsResponse"
4605    }
4606}
4607
4608#[doc(hidden)]
4609impl gax::paginator::internal::PageableResponse for ListPullRequestsResponse {
4610    type PageItem = crate::model::PullRequest;
4611
4612    fn items(self) -> std::vec::Vec<Self::PageItem> {
4613        self.pull_requests
4614    }
4615
4616    fn next_page_token(&self) -> std::string::String {
4617        use std::clone::Clone;
4618        self.next_page_token.clone()
4619    }
4620}
4621
4622/// UpdatePullRequestRequest is the request to update a pull request.
4623#[derive(Clone, Default, PartialEq)]
4624#[non_exhaustive]
4625pub struct UpdatePullRequestRequest {
4626    /// Required. The pull request to update.
4627    pub pull_request: std::option::Option<crate::model::PullRequest>,
4628
4629    /// Optional. Field mask is used to specify the fields to be overwritten in the
4630    /// pull request resource by the update.
4631    /// The fields specified in the update_mask are relative to the resource, not
4632    /// the full request. A field will be overwritten if it is in the mask.
4633    /// The special value "*" means full replacement.
4634    pub update_mask: std::option::Option<wkt::FieldMask>,
4635
4636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4637}
4638
4639impl UpdatePullRequestRequest {
4640    pub fn new() -> Self {
4641        std::default::Default::default()
4642    }
4643
4644    /// Sets the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
4645    pub fn set_pull_request<T>(mut self, v: T) -> Self
4646    where
4647        T: std::convert::Into<crate::model::PullRequest>,
4648    {
4649        self.pull_request = std::option::Option::Some(v.into());
4650        self
4651    }
4652
4653    /// Sets or clears the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
4654    pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
4655    where
4656        T: std::convert::Into<crate::model::PullRequest>,
4657    {
4658        self.pull_request = v.map(|x| x.into());
4659        self
4660    }
4661
4662    /// Sets the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
4663    pub fn set_update_mask<T>(mut self, v: T) -> Self
4664    where
4665        T: std::convert::Into<wkt::FieldMask>,
4666    {
4667        self.update_mask = std::option::Option::Some(v.into());
4668        self
4669    }
4670
4671    /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
4672    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4673    where
4674        T: std::convert::Into<wkt::FieldMask>,
4675    {
4676        self.update_mask = v.map(|x| x.into());
4677        self
4678    }
4679}
4680
4681impl wkt::message::Message for UpdatePullRequestRequest {
4682    fn typename() -> &'static str {
4683        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdatePullRequestRequest"
4684    }
4685}
4686
4687/// MergePullRequestRequest is the request to merge a pull request.
4688#[derive(Clone, Default, PartialEq)]
4689#[non_exhaustive]
4690pub struct MergePullRequestRequest {
4691    /// Required. The pull request to merge.
4692    /// Format:
4693    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
4694    pub name: std::string::String,
4695
4696    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4697}
4698
4699impl MergePullRequestRequest {
4700    pub fn new() -> Self {
4701        std::default::Default::default()
4702    }
4703
4704    /// Sets the value of [name][crate::model::MergePullRequestRequest::name].
4705    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4706        self.name = v.into();
4707        self
4708    }
4709}
4710
4711impl wkt::message::Message for MergePullRequestRequest {
4712    fn typename() -> &'static str {
4713        "type.googleapis.com/google.cloud.securesourcemanager.v1.MergePullRequestRequest"
4714    }
4715}
4716
4717/// OpenPullRequestRequest is the request to open a pull request.
4718#[derive(Clone, Default, PartialEq)]
4719#[non_exhaustive]
4720pub struct OpenPullRequestRequest {
4721    /// Required. The pull request to open.
4722    /// Format:
4723    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
4724    pub name: std::string::String,
4725
4726    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4727}
4728
4729impl OpenPullRequestRequest {
4730    pub fn new() -> Self {
4731        std::default::Default::default()
4732    }
4733
4734    /// Sets the value of [name][crate::model::OpenPullRequestRequest::name].
4735    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4736        self.name = v.into();
4737        self
4738    }
4739}
4740
4741impl wkt::message::Message for OpenPullRequestRequest {
4742    fn typename() -> &'static str {
4743        "type.googleapis.com/google.cloud.securesourcemanager.v1.OpenPullRequestRequest"
4744    }
4745}
4746
4747/// ClosePullRequestRequest is the request to close a pull request.
4748#[derive(Clone, Default, PartialEq)]
4749#[non_exhaustive]
4750pub struct ClosePullRequestRequest {
4751    /// Required. The pull request to close.
4752    /// Format:
4753    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
4754    pub name: std::string::String,
4755
4756    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4757}
4758
4759impl ClosePullRequestRequest {
4760    pub fn new() -> Self {
4761        std::default::Default::default()
4762    }
4763
4764    /// Sets the value of [name][crate::model::ClosePullRequestRequest::name].
4765    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4766        self.name = v.into();
4767        self
4768    }
4769}
4770
4771impl wkt::message::Message for ClosePullRequestRequest {
4772    fn typename() -> &'static str {
4773        "type.googleapis.com/google.cloud.securesourcemanager.v1.ClosePullRequestRequest"
4774    }
4775}
4776
4777/// ListPullRequestFileDiffsRequest is the request to list pull request file
4778/// diffs.
4779#[derive(Clone, Default, PartialEq)]
4780#[non_exhaustive]
4781pub struct ListPullRequestFileDiffsRequest {
4782    /// Required. The pull request to list file diffs for.
4783    /// Format:
4784    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
4785    pub name: std::string::String,
4786
4787    /// Optional. Requested page size. Server may return fewer items than
4788    /// requested. If unspecified, server will pick an appropriate default.
4789    pub page_size: i32,
4790
4791    /// Optional. A token identifying a page of results the server should return.
4792    pub page_token: std::string::String,
4793
4794    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4795}
4796
4797impl ListPullRequestFileDiffsRequest {
4798    pub fn new() -> Self {
4799        std::default::Default::default()
4800    }
4801
4802    /// Sets the value of [name][crate::model::ListPullRequestFileDiffsRequest::name].
4803    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4804        self.name = v.into();
4805        self
4806    }
4807
4808    /// Sets the value of [page_size][crate::model::ListPullRequestFileDiffsRequest::page_size].
4809    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4810        self.page_size = v.into();
4811        self
4812    }
4813
4814    /// Sets the value of [page_token][crate::model::ListPullRequestFileDiffsRequest::page_token].
4815    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4816        self.page_token = v.into();
4817        self
4818    }
4819}
4820
4821impl wkt::message::Message for ListPullRequestFileDiffsRequest {
4822    fn typename() -> &'static str {
4823        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest"
4824    }
4825}
4826
4827/// ListPullRequestFileDiffsResponse is the response containing file diffs
4828/// returned from ListPullRequestFileDiffs.
4829#[derive(Clone, Default, PartialEq)]
4830#[non_exhaustive]
4831pub struct ListPullRequestFileDiffsResponse {
4832    /// The list of pull request file diffs.
4833    pub file_diffs: std::vec::Vec<crate::model::FileDiff>,
4834
4835    /// A token identifying a page of results the server should return.
4836    pub next_page_token: std::string::String,
4837
4838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4839}
4840
4841impl ListPullRequestFileDiffsResponse {
4842    pub fn new() -> Self {
4843        std::default::Default::default()
4844    }
4845
4846    /// Sets the value of [file_diffs][crate::model::ListPullRequestFileDiffsResponse::file_diffs].
4847    pub fn set_file_diffs<T, V>(mut self, v: T) -> Self
4848    where
4849        T: std::iter::IntoIterator<Item = V>,
4850        V: std::convert::Into<crate::model::FileDiff>,
4851    {
4852        use std::iter::Iterator;
4853        self.file_diffs = v.into_iter().map(|i| i.into()).collect();
4854        self
4855    }
4856
4857    /// Sets the value of [next_page_token][crate::model::ListPullRequestFileDiffsResponse::next_page_token].
4858    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4859        self.next_page_token = v.into();
4860        self
4861    }
4862}
4863
4864impl wkt::message::Message for ListPullRequestFileDiffsResponse {
4865    fn typename() -> &'static str {
4866        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsResponse"
4867    }
4868}
4869
4870#[doc(hidden)]
4871impl gax::paginator::internal::PageableResponse for ListPullRequestFileDiffsResponse {
4872    type PageItem = crate::model::FileDiff;
4873
4874    fn items(self) -> std::vec::Vec<Self::PageItem> {
4875        self.file_diffs
4876    }
4877
4878    fn next_page_token(&self) -> std::string::String {
4879        use std::clone::Clone;
4880        self.next_page_token.clone()
4881    }
4882}
4883
4884/// The request to create an issue.
4885#[derive(Clone, Default, PartialEq)]
4886#[non_exhaustive]
4887pub struct CreateIssueRequest {
4888    /// Required. The repository in which to create the issue. Format:
4889    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
4890    pub parent: std::string::String,
4891
4892    /// Required. The issue to create.
4893    pub issue: std::option::Option<crate::model::Issue>,
4894
4895    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4896}
4897
4898impl CreateIssueRequest {
4899    pub fn new() -> Self {
4900        std::default::Default::default()
4901    }
4902
4903    /// Sets the value of [parent][crate::model::CreateIssueRequest::parent].
4904    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4905        self.parent = v.into();
4906        self
4907    }
4908
4909    /// Sets the value of [issue][crate::model::CreateIssueRequest::issue].
4910    pub fn set_issue<T>(mut self, v: T) -> Self
4911    where
4912        T: std::convert::Into<crate::model::Issue>,
4913    {
4914        self.issue = std::option::Option::Some(v.into());
4915        self
4916    }
4917
4918    /// Sets or clears the value of [issue][crate::model::CreateIssueRequest::issue].
4919    pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
4920    where
4921        T: std::convert::Into<crate::model::Issue>,
4922    {
4923        self.issue = v.map(|x| x.into());
4924        self
4925    }
4926}
4927
4928impl wkt::message::Message for CreateIssueRequest {
4929    fn typename() -> &'static str {
4930        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateIssueRequest"
4931    }
4932}
4933
4934/// The request to get an issue.
4935#[derive(Clone, Default, PartialEq)]
4936#[non_exhaustive]
4937pub struct GetIssueRequest {
4938    /// Required. Name of the issue to retrieve.
4939    /// The format is
4940    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`.
4941    pub name: std::string::String,
4942
4943    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4944}
4945
4946impl GetIssueRequest {
4947    pub fn new() -> Self {
4948        std::default::Default::default()
4949    }
4950
4951    /// Sets the value of [name][crate::model::GetIssueRequest::name].
4952    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4953        self.name = v.into();
4954        self
4955    }
4956}
4957
4958impl wkt::message::Message for GetIssueRequest {
4959    fn typename() -> &'static str {
4960        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetIssueRequest"
4961    }
4962}
4963
4964/// The request to list issues.
4965#[derive(Clone, Default, PartialEq)]
4966#[non_exhaustive]
4967pub struct ListIssuesRequest {
4968    /// Required. The repository in which to list issues. Format:
4969    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
4970    pub parent: std::string::String,
4971
4972    /// Optional. Requested page size. Server may return fewer items than
4973    /// requested. If unspecified, server will pick an appropriate default.
4974    pub page_size: i32,
4975
4976    /// Optional. A token identifying a page of results the server should return.
4977    pub page_token: std::string::String,
4978
4979    /// Optional. Used to filter the resulting issues list.
4980    pub filter: std::string::String,
4981
4982    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4983}
4984
4985impl ListIssuesRequest {
4986    pub fn new() -> Self {
4987        std::default::Default::default()
4988    }
4989
4990    /// Sets the value of [parent][crate::model::ListIssuesRequest::parent].
4991    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4992        self.parent = v.into();
4993        self
4994    }
4995
4996    /// Sets the value of [page_size][crate::model::ListIssuesRequest::page_size].
4997    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4998        self.page_size = v.into();
4999        self
5000    }
5001
5002    /// Sets the value of [page_token][crate::model::ListIssuesRequest::page_token].
5003    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5004        self.page_token = v.into();
5005        self
5006    }
5007
5008    /// Sets the value of [filter][crate::model::ListIssuesRequest::filter].
5009    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5010        self.filter = v.into();
5011        self
5012    }
5013}
5014
5015impl wkt::message::Message for ListIssuesRequest {
5016    fn typename() -> &'static str {
5017        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssuesRequest"
5018    }
5019}
5020
5021/// The response to list issues.
5022#[derive(Clone, Default, PartialEq)]
5023#[non_exhaustive]
5024pub struct ListIssuesResponse {
5025    /// The list of issues.
5026    pub issues: std::vec::Vec<crate::model::Issue>,
5027
5028    /// A token identifying a page of results the server should return.
5029    pub next_page_token: std::string::String,
5030
5031    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5032}
5033
5034impl ListIssuesResponse {
5035    pub fn new() -> Self {
5036        std::default::Default::default()
5037    }
5038
5039    /// Sets the value of [issues][crate::model::ListIssuesResponse::issues].
5040    pub fn set_issues<T, V>(mut self, v: T) -> Self
5041    where
5042        T: std::iter::IntoIterator<Item = V>,
5043        V: std::convert::Into<crate::model::Issue>,
5044    {
5045        use std::iter::Iterator;
5046        self.issues = v.into_iter().map(|i| i.into()).collect();
5047        self
5048    }
5049
5050    /// Sets the value of [next_page_token][crate::model::ListIssuesResponse::next_page_token].
5051    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5052        self.next_page_token = v.into();
5053        self
5054    }
5055}
5056
5057impl wkt::message::Message for ListIssuesResponse {
5058    fn typename() -> &'static str {
5059        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssuesResponse"
5060    }
5061}
5062
5063#[doc(hidden)]
5064impl gax::paginator::internal::PageableResponse for ListIssuesResponse {
5065    type PageItem = crate::model::Issue;
5066
5067    fn items(self) -> std::vec::Vec<Self::PageItem> {
5068        self.issues
5069    }
5070
5071    fn next_page_token(&self) -> std::string::String {
5072        use std::clone::Clone;
5073        self.next_page_token.clone()
5074    }
5075}
5076
5077/// The request to update an issue.
5078#[derive(Clone, Default, PartialEq)]
5079#[non_exhaustive]
5080pub struct UpdateIssueRequest {
5081    /// Required. The issue to update.
5082    pub issue: std::option::Option<crate::model::Issue>,
5083
5084    /// Optional. Field mask is used to specify the fields to be overwritten in the
5085    /// issue resource by the update.
5086    /// The fields specified in the update_mask are relative to the resource, not
5087    /// the full request. A field will be overwritten if it is in the mask.
5088    /// The special value "*" means full replacement.
5089    pub update_mask: std::option::Option<wkt::FieldMask>,
5090
5091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5092}
5093
5094impl UpdateIssueRequest {
5095    pub fn new() -> Self {
5096        std::default::Default::default()
5097    }
5098
5099    /// Sets the value of [issue][crate::model::UpdateIssueRequest::issue].
5100    pub fn set_issue<T>(mut self, v: T) -> Self
5101    where
5102        T: std::convert::Into<crate::model::Issue>,
5103    {
5104        self.issue = std::option::Option::Some(v.into());
5105        self
5106    }
5107
5108    /// Sets or clears the value of [issue][crate::model::UpdateIssueRequest::issue].
5109    pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
5110    where
5111        T: std::convert::Into<crate::model::Issue>,
5112    {
5113        self.issue = v.map(|x| x.into());
5114        self
5115    }
5116
5117    /// Sets the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
5118    pub fn set_update_mask<T>(mut self, v: T) -> Self
5119    where
5120        T: std::convert::Into<wkt::FieldMask>,
5121    {
5122        self.update_mask = std::option::Option::Some(v.into());
5123        self
5124    }
5125
5126    /// Sets or clears the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
5127    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5128    where
5129        T: std::convert::Into<wkt::FieldMask>,
5130    {
5131        self.update_mask = v.map(|x| x.into());
5132        self
5133    }
5134}
5135
5136impl wkt::message::Message for UpdateIssueRequest {
5137    fn typename() -> &'static str {
5138        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateIssueRequest"
5139    }
5140}
5141
5142/// The request to delete an issue.
5143#[derive(Clone, Default, PartialEq)]
5144#[non_exhaustive]
5145pub struct DeleteIssueRequest {
5146    /// Required. Name of the issue to delete.
5147    /// The format is
5148    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
5149    pub name: std::string::String,
5150
5151    /// Optional. The current etag of the issue.
5152    /// If the etag is provided and does not match the current etag of the issue,
5153    /// deletion will be blocked and an ABORTED error will be returned.
5154    pub etag: std::string::String,
5155
5156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5157}
5158
5159impl DeleteIssueRequest {
5160    pub fn new() -> Self {
5161        std::default::Default::default()
5162    }
5163
5164    /// Sets the value of [name][crate::model::DeleteIssueRequest::name].
5165    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5166        self.name = v.into();
5167        self
5168    }
5169
5170    /// Sets the value of [etag][crate::model::DeleteIssueRequest::etag].
5171    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5172        self.etag = v.into();
5173        self
5174    }
5175}
5176
5177impl wkt::message::Message for DeleteIssueRequest {
5178    fn typename() -> &'static str {
5179        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteIssueRequest"
5180    }
5181}
5182
5183/// The request to close an issue.
5184#[derive(Clone, Default, PartialEq)]
5185#[non_exhaustive]
5186pub struct CloseIssueRequest {
5187    /// Required. Name of the issue to close.
5188    /// The format is
5189    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
5190    pub name: std::string::String,
5191
5192    /// Optional. The current etag of the issue.
5193    /// If the etag is provided and does not match the current etag of the issue,
5194    /// closing will be blocked and an ABORTED error will be returned.
5195    pub etag: std::string::String,
5196
5197    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5198}
5199
5200impl CloseIssueRequest {
5201    pub fn new() -> Self {
5202        std::default::Default::default()
5203    }
5204
5205    /// Sets the value of [name][crate::model::CloseIssueRequest::name].
5206    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5207        self.name = v.into();
5208        self
5209    }
5210
5211    /// Sets the value of [etag][crate::model::CloseIssueRequest::etag].
5212    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5213        self.etag = v.into();
5214        self
5215    }
5216}
5217
5218impl wkt::message::Message for CloseIssueRequest {
5219    fn typename() -> &'static str {
5220        "type.googleapis.com/google.cloud.securesourcemanager.v1.CloseIssueRequest"
5221    }
5222}
5223
5224/// The request to open an issue.
5225#[derive(Clone, Default, PartialEq)]
5226#[non_exhaustive]
5227pub struct OpenIssueRequest {
5228    /// Required. Name of the issue to open.
5229    /// The format is
5230    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
5231    pub name: std::string::String,
5232
5233    /// Optional. The current etag of the issue.
5234    /// If the etag is provided and does not match the current etag of the issue,
5235    /// opening will be blocked and an ABORTED error will be returned.
5236    pub etag: std::string::String,
5237
5238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5239}
5240
5241impl OpenIssueRequest {
5242    pub fn new() -> Self {
5243        std::default::Default::default()
5244    }
5245
5246    /// Sets the value of [name][crate::model::OpenIssueRequest::name].
5247    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5248        self.name = v.into();
5249        self
5250    }
5251
5252    /// Sets the value of [etag][crate::model::OpenIssueRequest::etag].
5253    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5254        self.etag = v.into();
5255        self
5256    }
5257}
5258
5259impl wkt::message::Message for OpenIssueRequest {
5260    fn typename() -> &'static str {
5261        "type.googleapis.com/google.cloud.securesourcemanager.v1.OpenIssueRequest"
5262    }
5263}
5264
5265/// Represents an entry within a tree structure (like a Git tree).
5266#[derive(Clone, Default, PartialEq)]
5267#[non_exhaustive]
5268pub struct TreeEntry {
5269    /// Output only. The type of the object (TREE, BLOB, COMMIT).  Output-only.
5270    pub r#type: crate::model::tree_entry::ObjectType,
5271
5272    /// Output only. The SHA-1 hash of the object (unique identifier). Output-only.
5273    pub sha: std::string::String,
5274
5275    /// Output only. The path of the file or directory within the tree (e.g.,
5276    /// "src/main/java/MyClass.java"). Output-only.
5277    pub path: std::string::String,
5278
5279    /// Output only. The file mode as a string (e.g., "100644"). Indicates file
5280    /// type. Output-only.
5281    pub mode: std::string::String,
5282
5283    /// Output only. The size of the object in bytes (only for blobs). Output-only.
5284    pub size: i64,
5285
5286    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5287}
5288
5289impl TreeEntry {
5290    pub fn new() -> Self {
5291        std::default::Default::default()
5292    }
5293
5294    /// Sets the value of [r#type][crate::model::TreeEntry::type].
5295    pub fn set_type<T: std::convert::Into<crate::model::tree_entry::ObjectType>>(
5296        mut self,
5297        v: T,
5298    ) -> Self {
5299        self.r#type = v.into();
5300        self
5301    }
5302
5303    /// Sets the value of [sha][crate::model::TreeEntry::sha].
5304    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5305        self.sha = v.into();
5306        self
5307    }
5308
5309    /// Sets the value of [path][crate::model::TreeEntry::path].
5310    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5311        self.path = v.into();
5312        self
5313    }
5314
5315    /// Sets the value of [mode][crate::model::TreeEntry::mode].
5316    pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5317        self.mode = v.into();
5318        self
5319    }
5320
5321    /// Sets the value of [size][crate::model::TreeEntry::size].
5322    pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5323        self.size = v.into();
5324        self
5325    }
5326}
5327
5328impl wkt::message::Message for TreeEntry {
5329    fn typename() -> &'static str {
5330        "type.googleapis.com/google.cloud.securesourcemanager.v1.TreeEntry"
5331    }
5332}
5333
5334/// Defines additional types related to [TreeEntry].
5335pub mod tree_entry {
5336    #[allow(unused_imports)]
5337    use super::*;
5338
5339    /// Defines the type of object the TreeEntry represents.
5340    ///
5341    /// # Working with unknown values
5342    ///
5343    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5344    /// additional enum variants at any time. Adding new variants is not considered
5345    /// a breaking change. Applications should write their code in anticipation of:
5346    ///
5347    /// - New values appearing in future releases of the client library, **and**
5348    /// - New values received dynamically, without application changes.
5349    ///
5350    /// Please consult the [Working with enums] section in the user guide for some
5351    /// guidelines.
5352    ///
5353    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5354    #[derive(Clone, Debug, PartialEq)]
5355    #[non_exhaustive]
5356    pub enum ObjectType {
5357        /// Default value, indicating the object type is unspecified.
5358        Unspecified,
5359        /// Represents a directory (folder).
5360        Tree,
5361        /// Represents a file (contains file data).
5362        Blob,
5363        /// Represents a pointer to another repository (submodule).
5364        Commit,
5365        /// If set, the enum was initialized with an unknown value.
5366        ///
5367        /// Applications can examine the value using [ObjectType::value] or
5368        /// [ObjectType::name].
5369        UnknownValue(object_type::UnknownValue),
5370    }
5371
5372    #[doc(hidden)]
5373    pub mod object_type {
5374        #[allow(unused_imports)]
5375        use super::*;
5376        #[derive(Clone, Debug, PartialEq)]
5377        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5378    }
5379
5380    impl ObjectType {
5381        /// Gets the enum value.
5382        ///
5383        /// Returns `None` if the enum contains an unknown value deserialized from
5384        /// the string representation of enums.
5385        pub fn value(&self) -> std::option::Option<i32> {
5386            match self {
5387                Self::Unspecified => std::option::Option::Some(0),
5388                Self::Tree => std::option::Option::Some(1),
5389                Self::Blob => std::option::Option::Some(2),
5390                Self::Commit => std::option::Option::Some(3),
5391                Self::UnknownValue(u) => u.0.value(),
5392            }
5393        }
5394
5395        /// Gets the enum value as a string.
5396        ///
5397        /// Returns `None` if the enum contains an unknown value deserialized from
5398        /// the integer representation of enums.
5399        pub fn name(&self) -> std::option::Option<&str> {
5400            match self {
5401                Self::Unspecified => std::option::Option::Some("OBJECT_TYPE_UNSPECIFIED"),
5402                Self::Tree => std::option::Option::Some("TREE"),
5403                Self::Blob => std::option::Option::Some("BLOB"),
5404                Self::Commit => std::option::Option::Some("COMMIT"),
5405                Self::UnknownValue(u) => u.0.name(),
5406            }
5407        }
5408    }
5409
5410    impl std::default::Default for ObjectType {
5411        fn default() -> Self {
5412            use std::convert::From;
5413            Self::from(0)
5414        }
5415    }
5416
5417    impl std::fmt::Display for ObjectType {
5418        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5419            wkt::internal::display_enum(f, self.name(), self.value())
5420        }
5421    }
5422
5423    impl std::convert::From<i32> for ObjectType {
5424        fn from(value: i32) -> Self {
5425            match value {
5426                0 => Self::Unspecified,
5427                1 => Self::Tree,
5428                2 => Self::Blob,
5429                3 => Self::Commit,
5430                _ => Self::UnknownValue(object_type::UnknownValue(
5431                    wkt::internal::UnknownEnumValue::Integer(value),
5432                )),
5433            }
5434        }
5435    }
5436
5437    impl std::convert::From<&str> for ObjectType {
5438        fn from(value: &str) -> Self {
5439            use std::string::ToString;
5440            match value {
5441                "OBJECT_TYPE_UNSPECIFIED" => Self::Unspecified,
5442                "TREE" => Self::Tree,
5443                "BLOB" => Self::Blob,
5444                "COMMIT" => Self::Commit,
5445                _ => Self::UnknownValue(object_type::UnknownValue(
5446                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5447                )),
5448            }
5449        }
5450    }
5451
5452    impl serde::ser::Serialize for ObjectType {
5453        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5454        where
5455            S: serde::Serializer,
5456        {
5457            match self {
5458                Self::Unspecified => serializer.serialize_i32(0),
5459                Self::Tree => serializer.serialize_i32(1),
5460                Self::Blob => serializer.serialize_i32(2),
5461                Self::Commit => serializer.serialize_i32(3),
5462                Self::UnknownValue(u) => u.0.serialize(serializer),
5463            }
5464        }
5465    }
5466
5467    impl<'de> serde::de::Deserialize<'de> for ObjectType {
5468        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5469        where
5470            D: serde::Deserializer<'de>,
5471        {
5472            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ObjectType>::new(
5473                ".google.cloud.securesourcemanager.v1.TreeEntry.ObjectType",
5474            ))
5475        }
5476    }
5477}
5478
5479/// Request message for fetching a tree structure from a repository.
5480#[derive(Clone, Default, PartialEq)]
5481#[non_exhaustive]
5482pub struct FetchTreeRequest {
5483    /// Required. The format is
5484    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
5485    /// Specifies the repository to fetch the tree from.
5486    pub repository: std::string::String,
5487
5488    /// Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies
5489    /// which tree to fetch. If not specified, the default branch will be used.
5490    pub r#ref: std::string::String,
5491
5492    /// Optional. If true, include all subfolders and their files in the response.
5493    /// If false, only the immediate children are returned.
5494    pub recursive: bool,
5495
5496    /// Optional. Requested page size.  Server may return fewer items than
5497    /// requested. If unspecified, at most 10,000 items will be returned.
5498    pub page_size: i32,
5499
5500    /// Optional. A token identifying a page of results the server should return.
5501    pub page_token: std::string::String,
5502
5503    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5504}
5505
5506impl FetchTreeRequest {
5507    pub fn new() -> Self {
5508        std::default::Default::default()
5509    }
5510
5511    /// Sets the value of [repository][crate::model::FetchTreeRequest::repository].
5512    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5513        self.repository = v.into();
5514        self
5515    }
5516
5517    /// Sets the value of [r#ref][crate::model::FetchTreeRequest::ref].
5518    pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5519        self.r#ref = v.into();
5520        self
5521    }
5522
5523    /// Sets the value of [recursive][crate::model::FetchTreeRequest::recursive].
5524    pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5525        self.recursive = v.into();
5526        self
5527    }
5528
5529    /// Sets the value of [page_size][crate::model::FetchTreeRequest::page_size].
5530    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5531        self.page_size = v.into();
5532        self
5533    }
5534
5535    /// Sets the value of [page_token][crate::model::FetchTreeRequest::page_token].
5536    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5537        self.page_token = v.into();
5538        self
5539    }
5540}
5541
5542impl wkt::message::Message for FetchTreeRequest {
5543    fn typename() -> &'static str {
5544        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchTreeRequest"
5545    }
5546}
5547
5548/// Response message containing a list of TreeEntry objects.
5549#[derive(Clone, Default, PartialEq)]
5550#[non_exhaustive]
5551pub struct FetchTreeResponse {
5552    /// The list of TreeEntry objects.
5553    pub tree_entries: std::vec::Vec<crate::model::TreeEntry>,
5554
5555    /// A token identifying a page of results the server should return.
5556    pub next_page_token: std::string::String,
5557
5558    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5559}
5560
5561impl FetchTreeResponse {
5562    pub fn new() -> Self {
5563        std::default::Default::default()
5564    }
5565
5566    /// Sets the value of [tree_entries][crate::model::FetchTreeResponse::tree_entries].
5567    pub fn set_tree_entries<T, V>(mut self, v: T) -> Self
5568    where
5569        T: std::iter::IntoIterator<Item = V>,
5570        V: std::convert::Into<crate::model::TreeEntry>,
5571    {
5572        use std::iter::Iterator;
5573        self.tree_entries = v.into_iter().map(|i| i.into()).collect();
5574        self
5575    }
5576
5577    /// Sets the value of [next_page_token][crate::model::FetchTreeResponse::next_page_token].
5578    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5579        self.next_page_token = v.into();
5580        self
5581    }
5582}
5583
5584impl wkt::message::Message for FetchTreeResponse {
5585    fn typename() -> &'static str {
5586        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchTreeResponse"
5587    }
5588}
5589
5590#[doc(hidden)]
5591impl gax::paginator::internal::PageableResponse for FetchTreeResponse {
5592    type PageItem = crate::model::TreeEntry;
5593
5594    fn items(self) -> std::vec::Vec<Self::PageItem> {
5595        self.tree_entries
5596    }
5597
5598    fn next_page_token(&self) -> std::string::String {
5599        use std::clone::Clone;
5600        self.next_page_token.clone()
5601    }
5602}
5603
5604/// Request message for fetching a blob (file content) from a repository.
5605#[derive(Clone, Default, PartialEq)]
5606#[non_exhaustive]
5607pub struct FetchBlobRequest {
5608    /// Required. The format is
5609    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
5610    /// Specifies the repository containing the blob.
5611    pub repository: std::string::String,
5612
5613    /// Required. The SHA-1 hash of the blob to retrieve.
5614    pub sha: std::string::String,
5615
5616    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5617}
5618
5619impl FetchBlobRequest {
5620    pub fn new() -> Self {
5621        std::default::Default::default()
5622    }
5623
5624    /// Sets the value of [repository][crate::model::FetchBlobRequest::repository].
5625    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5626        self.repository = v.into();
5627        self
5628    }
5629
5630    /// Sets the value of [sha][crate::model::FetchBlobRequest::sha].
5631    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5632        self.sha = v.into();
5633        self
5634    }
5635}
5636
5637impl wkt::message::Message for FetchBlobRequest {
5638    fn typename() -> &'static str {
5639        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchBlobRequest"
5640    }
5641}
5642
5643/// Response message containing the content of a blob.
5644#[derive(Clone, Default, PartialEq)]
5645#[non_exhaustive]
5646pub struct FetchBlobResponse {
5647    /// The SHA-1 hash of the blob.
5648    pub sha: std::string::String,
5649
5650    /// The content of the blob, encoded as base64.
5651    pub content: std::string::String,
5652
5653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5654}
5655
5656impl FetchBlobResponse {
5657    pub fn new() -> Self {
5658        std::default::Default::default()
5659    }
5660
5661    /// Sets the value of [sha][crate::model::FetchBlobResponse::sha].
5662    pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5663        self.sha = v.into();
5664        self
5665    }
5666
5667    /// Sets the value of [content][crate::model::FetchBlobResponse::content].
5668    pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5669        self.content = v.into();
5670        self
5671    }
5672}
5673
5674impl wkt::message::Message for FetchBlobResponse {
5675    fn typename() -> &'static str {
5676        "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchBlobResponse"
5677    }
5678}
5679
5680/// The request to list pull request comments.
5681#[derive(Clone, Default, PartialEq)]
5682#[non_exhaustive]
5683pub struct ListPullRequestCommentsRequest {
5684    /// Required. The pull request in which to list pull request comments. Format:
5685    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
5686    pub parent: std::string::String,
5687
5688    /// Optional. Requested page size. If unspecified, at most 100 pull request
5689    /// comments will be returned. The maximum value is 100; values above 100 will
5690    /// be coerced to 100.
5691    pub page_size: i32,
5692
5693    /// Optional. A token identifying a page of results the server should return.
5694    pub page_token: std::string::String,
5695
5696    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5697}
5698
5699impl ListPullRequestCommentsRequest {
5700    pub fn new() -> Self {
5701        std::default::Default::default()
5702    }
5703
5704    /// Sets the value of [parent][crate::model::ListPullRequestCommentsRequest::parent].
5705    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5706        self.parent = v.into();
5707        self
5708    }
5709
5710    /// Sets the value of [page_size][crate::model::ListPullRequestCommentsRequest::page_size].
5711    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5712        self.page_size = v.into();
5713        self
5714    }
5715
5716    /// Sets the value of [page_token][crate::model::ListPullRequestCommentsRequest::page_token].
5717    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5718        self.page_token = v.into();
5719        self
5720    }
5721}
5722
5723impl wkt::message::Message for ListPullRequestCommentsRequest {
5724    fn typename() -> &'static str {
5725        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest"
5726    }
5727}
5728
5729/// The response to list pull request comments.
5730#[derive(Clone, Default, PartialEq)]
5731#[non_exhaustive]
5732pub struct ListPullRequestCommentsResponse {
5733    /// The list of pull request comments.
5734    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
5735
5736    /// A token to set as page_token to retrieve the next page. If this field is
5737    /// omitted, there are no subsequent pages.
5738    pub next_page_token: std::string::String,
5739
5740    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5741}
5742
5743impl ListPullRequestCommentsResponse {
5744    pub fn new() -> Self {
5745        std::default::Default::default()
5746    }
5747
5748    /// Sets the value of [pull_request_comments][crate::model::ListPullRequestCommentsResponse::pull_request_comments].
5749    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
5750    where
5751        T: std::iter::IntoIterator<Item = V>,
5752        V: std::convert::Into<crate::model::PullRequestComment>,
5753    {
5754        use std::iter::Iterator;
5755        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
5756        self
5757    }
5758
5759    /// Sets the value of [next_page_token][crate::model::ListPullRequestCommentsResponse::next_page_token].
5760    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5761        self.next_page_token = v.into();
5762        self
5763    }
5764}
5765
5766impl wkt::message::Message for ListPullRequestCommentsResponse {
5767    fn typename() -> &'static str {
5768        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestCommentsResponse"
5769    }
5770}
5771
5772#[doc(hidden)]
5773impl gax::paginator::internal::PageableResponse for ListPullRequestCommentsResponse {
5774    type PageItem = crate::model::PullRequestComment;
5775
5776    fn items(self) -> std::vec::Vec<Self::PageItem> {
5777        self.pull_request_comments
5778    }
5779
5780    fn next_page_token(&self) -> std::string::String {
5781        use std::clone::Clone;
5782        self.next_page_token.clone()
5783    }
5784}
5785
5786/// The request to create a pull request comment.
5787#[derive(Clone, Default, PartialEq)]
5788#[non_exhaustive]
5789pub struct CreatePullRequestCommentRequest {
5790    /// Required. The pull request in which to create the pull request comment.
5791    /// Format:
5792    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
5793    pub parent: std::string::String,
5794
5795    /// Required. The pull request comment to create.
5796    pub pull_request_comment: std::option::Option<crate::model::PullRequestComment>,
5797
5798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5799}
5800
5801impl CreatePullRequestCommentRequest {
5802    pub fn new() -> Self {
5803        std::default::Default::default()
5804    }
5805
5806    /// Sets the value of [parent][crate::model::CreatePullRequestCommentRequest::parent].
5807    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5808        self.parent = v.into();
5809        self
5810    }
5811
5812    /// Sets the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
5813    pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
5814    where
5815        T: std::convert::Into<crate::model::PullRequestComment>,
5816    {
5817        self.pull_request_comment = std::option::Option::Some(v.into());
5818        self
5819    }
5820
5821    /// Sets or clears the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
5822    pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
5823    where
5824        T: std::convert::Into<crate::model::PullRequestComment>,
5825    {
5826        self.pull_request_comment = v.map(|x| x.into());
5827        self
5828    }
5829}
5830
5831impl wkt::message::Message for CreatePullRequestCommentRequest {
5832    fn typename() -> &'static str {
5833        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest"
5834    }
5835}
5836
5837/// The request to batch create pull request comments.
5838#[derive(Clone, Default, PartialEq)]
5839#[non_exhaustive]
5840pub struct BatchCreatePullRequestCommentsRequest {
5841    /// Required. The pull request in which to create the pull request comments.
5842    /// Format:
5843    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
5844    pub parent: std::string::String,
5845
5846    /// Required. The request message specifying the resources to create. There
5847    /// should be exactly one CreatePullRequestCommentRequest with CommentDetail
5848    /// being REVIEW in the list, and no more than 100
5849    /// CreatePullRequestCommentRequests with CommentDetail being CODE in the list
5850    pub requests: std::vec::Vec<crate::model::CreatePullRequestCommentRequest>,
5851
5852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5853}
5854
5855impl BatchCreatePullRequestCommentsRequest {
5856    pub fn new() -> Self {
5857        std::default::Default::default()
5858    }
5859
5860    /// Sets the value of [parent][crate::model::BatchCreatePullRequestCommentsRequest::parent].
5861    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5862        self.parent = v.into();
5863        self
5864    }
5865
5866    /// Sets the value of [requests][crate::model::BatchCreatePullRequestCommentsRequest::requests].
5867    pub fn set_requests<T, V>(mut self, v: T) -> Self
5868    where
5869        T: std::iter::IntoIterator<Item = V>,
5870        V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
5871    {
5872        use std::iter::Iterator;
5873        self.requests = v.into_iter().map(|i| i.into()).collect();
5874        self
5875    }
5876}
5877
5878impl wkt::message::Message for BatchCreatePullRequestCommentsRequest {
5879    fn typename() -> &'static str {
5880        "type.googleapis.com/google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest"
5881    }
5882}
5883
5884/// The response to batch create pull request comments.
5885#[derive(Clone, Default, PartialEq)]
5886#[non_exhaustive]
5887pub struct BatchCreatePullRequestCommentsResponse {
5888    /// The list of pull request comments created.
5889    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
5890
5891    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5892}
5893
5894impl BatchCreatePullRequestCommentsResponse {
5895    pub fn new() -> Self {
5896        std::default::Default::default()
5897    }
5898
5899    /// Sets the value of [pull_request_comments][crate::model::BatchCreatePullRequestCommentsResponse::pull_request_comments].
5900    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
5901    where
5902        T: std::iter::IntoIterator<Item = V>,
5903        V: std::convert::Into<crate::model::PullRequestComment>,
5904    {
5905        use std::iter::Iterator;
5906        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
5907        self
5908    }
5909}
5910
5911impl wkt::message::Message for BatchCreatePullRequestCommentsResponse {
5912    fn typename() -> &'static str {
5913        "type.googleapis.com/google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsResponse"
5914    }
5915}
5916
5917/// The request to update a pull request comment.
5918#[derive(Clone, Default, PartialEq)]
5919#[non_exhaustive]
5920pub struct UpdatePullRequestCommentRequest {
5921    /// Required. The pull request comment to update.
5922    pub pull_request_comment: std::option::Option<crate::model::PullRequestComment>,
5923
5924    /// Optional. Field mask is used to specify the fields to be overwritten in the
5925    /// pull request comment resource by the update. Updatable fields are
5926    /// `body`.
5927    pub update_mask: std::option::Option<wkt::FieldMask>,
5928
5929    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5930}
5931
5932impl UpdatePullRequestCommentRequest {
5933    pub fn new() -> Self {
5934        std::default::Default::default()
5935    }
5936
5937    /// Sets the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
5938    pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
5939    where
5940        T: std::convert::Into<crate::model::PullRequestComment>,
5941    {
5942        self.pull_request_comment = std::option::Option::Some(v.into());
5943        self
5944    }
5945
5946    /// Sets or clears the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
5947    pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
5948    where
5949        T: std::convert::Into<crate::model::PullRequestComment>,
5950    {
5951        self.pull_request_comment = v.map(|x| x.into());
5952        self
5953    }
5954
5955    /// Sets the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
5956    pub fn set_update_mask<T>(mut self, v: T) -> Self
5957    where
5958        T: std::convert::Into<wkt::FieldMask>,
5959    {
5960        self.update_mask = std::option::Option::Some(v.into());
5961        self
5962    }
5963
5964    /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
5965    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5966    where
5967        T: std::convert::Into<wkt::FieldMask>,
5968    {
5969        self.update_mask = v.map(|x| x.into());
5970        self
5971    }
5972}
5973
5974impl wkt::message::Message for UpdatePullRequestCommentRequest {
5975    fn typename() -> &'static str {
5976        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest"
5977    }
5978}
5979
5980/// The request to delete a pull request comment. A Review PullRequestComment
5981/// cannot be deleted.
5982#[derive(Clone, Default, PartialEq)]
5983#[non_exhaustive]
5984pub struct DeletePullRequestCommentRequest {
5985    /// Required. Name of the pull request comment to delete.
5986    /// The format is
5987    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`.
5988    pub name: std::string::String,
5989
5990    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5991}
5992
5993impl DeletePullRequestCommentRequest {
5994    pub fn new() -> Self {
5995        std::default::Default::default()
5996    }
5997
5998    /// Sets the value of [name][crate::model::DeletePullRequestCommentRequest::name].
5999    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6000        self.name = v.into();
6001        self
6002    }
6003}
6004
6005impl wkt::message::Message for DeletePullRequestCommentRequest {
6006    fn typename() -> &'static str {
6007        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest"
6008    }
6009}
6010
6011/// The request to get a pull request comment.
6012#[derive(Clone, Default, PartialEq)]
6013#[non_exhaustive]
6014pub struct GetPullRequestCommentRequest {
6015    /// Required. Name of the pull request comment to retrieve.
6016    /// The format is
6017    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`.
6018    pub name: std::string::String,
6019
6020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6021}
6022
6023impl GetPullRequestCommentRequest {
6024    pub fn new() -> Self {
6025        std::default::Default::default()
6026    }
6027
6028    /// Sets the value of [name][crate::model::GetPullRequestCommentRequest::name].
6029    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6030        self.name = v.into();
6031        self
6032    }
6033}
6034
6035impl wkt::message::Message for GetPullRequestCommentRequest {
6036    fn typename() -> &'static str {
6037        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest"
6038    }
6039}
6040
6041/// The request to resolve multiple pull request comments.
6042#[derive(Clone, Default, PartialEq)]
6043#[non_exhaustive]
6044pub struct ResolvePullRequestCommentsRequest {
6045    /// Required. The pull request in which to resolve the pull request comments.
6046    /// Format:
6047    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
6048    pub parent: std::string::String,
6049
6050    /// Required. The names of the pull request comments to resolve. Format:
6051    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
6052    /// Only comments from the same threads are allowed in the same request.
6053    pub names: std::vec::Vec<std::string::String>,
6054
6055    /// Optional. If set, at least one comment in a thread is required, rest of the
6056    /// comments in the same thread will be automatically updated to resolved. If
6057    /// unset, all comments in the same thread need be present.
6058    pub auto_fill: bool,
6059
6060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6061}
6062
6063impl ResolvePullRequestCommentsRequest {
6064    pub fn new() -> Self {
6065        std::default::Default::default()
6066    }
6067
6068    /// Sets the value of [parent][crate::model::ResolvePullRequestCommentsRequest::parent].
6069    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6070        self.parent = v.into();
6071        self
6072    }
6073
6074    /// Sets the value of [names][crate::model::ResolvePullRequestCommentsRequest::names].
6075    pub fn set_names<T, V>(mut self, v: T) -> Self
6076    where
6077        T: std::iter::IntoIterator<Item = V>,
6078        V: std::convert::Into<std::string::String>,
6079    {
6080        use std::iter::Iterator;
6081        self.names = v.into_iter().map(|i| i.into()).collect();
6082        self
6083    }
6084
6085    /// Sets the value of [auto_fill][crate::model::ResolvePullRequestCommentsRequest::auto_fill].
6086    pub fn set_auto_fill<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6087        self.auto_fill = v.into();
6088        self
6089    }
6090}
6091
6092impl wkt::message::Message for ResolvePullRequestCommentsRequest {
6093    fn typename() -> &'static str {
6094        "type.googleapis.com/google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsRequest"
6095    }
6096}
6097
6098/// The response to resolve multiple pull request comments.
6099#[derive(Clone, Default, PartialEq)]
6100#[non_exhaustive]
6101pub struct ResolvePullRequestCommentsResponse {
6102    /// The list of pull request comments resolved.
6103    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
6104
6105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6106}
6107
6108impl ResolvePullRequestCommentsResponse {
6109    pub fn new() -> Self {
6110        std::default::Default::default()
6111    }
6112
6113    /// Sets the value of [pull_request_comments][crate::model::ResolvePullRequestCommentsResponse::pull_request_comments].
6114    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
6115    where
6116        T: std::iter::IntoIterator<Item = V>,
6117        V: std::convert::Into<crate::model::PullRequestComment>,
6118    {
6119        use std::iter::Iterator;
6120        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
6121        self
6122    }
6123}
6124
6125impl wkt::message::Message for ResolvePullRequestCommentsResponse {
6126    fn typename() -> &'static str {
6127        "type.googleapis.com/google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsResponse"
6128    }
6129}
6130
6131/// The request to unresolve multiple pull request comments.
6132#[derive(Clone, Default, PartialEq)]
6133#[non_exhaustive]
6134pub struct UnresolvePullRequestCommentsRequest {
6135    /// Required. The pull request in which to resolve the pull request comments.
6136    /// Format:
6137    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
6138    pub parent: std::string::String,
6139
6140    /// Required. The names of the pull request comments to unresolve. Format:
6141    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
6142    /// Only comments from the same threads are allowed in the same request.
6143    pub names: std::vec::Vec<std::string::String>,
6144
6145    /// Optional. If set, at least one comment in a thread is required, rest of the
6146    /// comments in the same thread will be automatically updated to unresolved. If
6147    /// unset, all comments in the same thread need be present.
6148    pub auto_fill: bool,
6149
6150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6151}
6152
6153impl UnresolvePullRequestCommentsRequest {
6154    pub fn new() -> Self {
6155        std::default::Default::default()
6156    }
6157
6158    /// Sets the value of [parent][crate::model::UnresolvePullRequestCommentsRequest::parent].
6159    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6160        self.parent = v.into();
6161        self
6162    }
6163
6164    /// Sets the value of [names][crate::model::UnresolvePullRequestCommentsRequest::names].
6165    pub fn set_names<T, V>(mut self, v: T) -> Self
6166    where
6167        T: std::iter::IntoIterator<Item = V>,
6168        V: std::convert::Into<std::string::String>,
6169    {
6170        use std::iter::Iterator;
6171        self.names = v.into_iter().map(|i| i.into()).collect();
6172        self
6173    }
6174
6175    /// Sets the value of [auto_fill][crate::model::UnresolvePullRequestCommentsRequest::auto_fill].
6176    pub fn set_auto_fill<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6177        self.auto_fill = v.into();
6178        self
6179    }
6180}
6181
6182impl wkt::message::Message for UnresolvePullRequestCommentsRequest {
6183    fn typename() -> &'static str {
6184        "type.googleapis.com/google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsRequest"
6185    }
6186}
6187
6188/// The response to unresolve multiple pull request comments.
6189#[derive(Clone, Default, PartialEq)]
6190#[non_exhaustive]
6191pub struct UnresolvePullRequestCommentsResponse {
6192    /// The list of pull request comments unresolved.
6193    pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
6194
6195    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6196}
6197
6198impl UnresolvePullRequestCommentsResponse {
6199    pub fn new() -> Self {
6200        std::default::Default::default()
6201    }
6202
6203    /// Sets the value of [pull_request_comments][crate::model::UnresolvePullRequestCommentsResponse::pull_request_comments].
6204    pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
6205    where
6206        T: std::iter::IntoIterator<Item = V>,
6207        V: std::convert::Into<crate::model::PullRequestComment>,
6208    {
6209        use std::iter::Iterator;
6210        self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
6211        self
6212    }
6213}
6214
6215impl wkt::message::Message for UnresolvePullRequestCommentsResponse {
6216    fn typename() -> &'static str {
6217        "type.googleapis.com/google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsResponse"
6218    }
6219}
6220
6221/// The request to create an issue comment.
6222#[derive(Clone, Default, PartialEq)]
6223#[non_exhaustive]
6224pub struct CreateIssueCommentRequest {
6225    /// Required. The issue in which to create the issue comment. Format:
6226    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
6227    pub parent: std::string::String,
6228
6229    /// Required. The issue comment to create.
6230    pub issue_comment: std::option::Option<crate::model::IssueComment>,
6231
6232    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6233}
6234
6235impl CreateIssueCommentRequest {
6236    pub fn new() -> Self {
6237        std::default::Default::default()
6238    }
6239
6240    /// Sets the value of [parent][crate::model::CreateIssueCommentRequest::parent].
6241    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6242        self.parent = v.into();
6243        self
6244    }
6245
6246    /// Sets the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
6247    pub fn set_issue_comment<T>(mut self, v: T) -> Self
6248    where
6249        T: std::convert::Into<crate::model::IssueComment>,
6250    {
6251        self.issue_comment = std::option::Option::Some(v.into());
6252        self
6253    }
6254
6255    /// Sets or clears the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
6256    pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
6257    where
6258        T: std::convert::Into<crate::model::IssueComment>,
6259    {
6260        self.issue_comment = v.map(|x| x.into());
6261        self
6262    }
6263}
6264
6265impl wkt::message::Message for CreateIssueCommentRequest {
6266    fn typename() -> &'static str {
6267        "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateIssueCommentRequest"
6268    }
6269}
6270
6271/// The request to get an issue comment.
6272#[derive(Clone, Default, PartialEq)]
6273#[non_exhaustive]
6274pub struct GetIssueCommentRequest {
6275    /// Required. Name of the issue comment to retrieve.
6276    /// The format is
6277    /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`.
6278    pub name: std::string::String,
6279
6280    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6281}
6282
6283impl GetIssueCommentRequest {
6284    pub fn new() -> Self {
6285        std::default::Default::default()
6286    }
6287
6288    /// Sets the value of [name][crate::model::GetIssueCommentRequest::name].
6289    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6290        self.name = v.into();
6291        self
6292    }
6293}
6294
6295impl wkt::message::Message for GetIssueCommentRequest {
6296    fn typename() -> &'static str {
6297        "type.googleapis.com/google.cloud.securesourcemanager.v1.GetIssueCommentRequest"
6298    }
6299}
6300
6301/// The request to list issue comments.
6302#[derive(Clone, Default, PartialEq)]
6303#[non_exhaustive]
6304pub struct ListIssueCommentsRequest {
6305    /// Required. The issue in which to list the comments. Format:
6306    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
6307    pub parent: std::string::String,
6308
6309    /// Optional. Requested page size. Server may return fewer items than
6310    /// requested. If unspecified, server will pick an appropriate default.
6311    pub page_size: i32,
6312
6313    /// Optional. A token identifying a page of results the server should return.
6314    pub page_token: std::string::String,
6315
6316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6317}
6318
6319impl ListIssueCommentsRequest {
6320    pub fn new() -> Self {
6321        std::default::Default::default()
6322    }
6323
6324    /// Sets the value of [parent][crate::model::ListIssueCommentsRequest::parent].
6325    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6326        self.parent = v.into();
6327        self
6328    }
6329
6330    /// Sets the value of [page_size][crate::model::ListIssueCommentsRequest::page_size].
6331    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6332        self.page_size = v.into();
6333        self
6334    }
6335
6336    /// Sets the value of [page_token][crate::model::ListIssueCommentsRequest::page_token].
6337    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6338        self.page_token = v.into();
6339        self
6340    }
6341}
6342
6343impl wkt::message::Message for ListIssueCommentsRequest {
6344    fn typename() -> &'static str {
6345        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssueCommentsRequest"
6346    }
6347}
6348
6349/// The response to list issue comments.
6350#[derive(Clone, Default, PartialEq)]
6351#[non_exhaustive]
6352pub struct ListIssueCommentsResponse {
6353    /// The list of issue comments.
6354    pub issue_comments: std::vec::Vec<crate::model::IssueComment>,
6355
6356    /// A token identifying a page of results the server should return.
6357    pub next_page_token: std::string::String,
6358
6359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6360}
6361
6362impl ListIssueCommentsResponse {
6363    pub fn new() -> Self {
6364        std::default::Default::default()
6365    }
6366
6367    /// Sets the value of [issue_comments][crate::model::ListIssueCommentsResponse::issue_comments].
6368    pub fn set_issue_comments<T, V>(mut self, v: T) -> Self
6369    where
6370        T: std::iter::IntoIterator<Item = V>,
6371        V: std::convert::Into<crate::model::IssueComment>,
6372    {
6373        use std::iter::Iterator;
6374        self.issue_comments = v.into_iter().map(|i| i.into()).collect();
6375        self
6376    }
6377
6378    /// Sets the value of [next_page_token][crate::model::ListIssueCommentsResponse::next_page_token].
6379    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6380        self.next_page_token = v.into();
6381        self
6382    }
6383}
6384
6385impl wkt::message::Message for ListIssueCommentsResponse {
6386    fn typename() -> &'static str {
6387        "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssueCommentsResponse"
6388    }
6389}
6390
6391#[doc(hidden)]
6392impl gax::paginator::internal::PageableResponse for ListIssueCommentsResponse {
6393    type PageItem = crate::model::IssueComment;
6394
6395    fn items(self) -> std::vec::Vec<Self::PageItem> {
6396        self.issue_comments
6397    }
6398
6399    fn next_page_token(&self) -> std::string::String {
6400        use std::clone::Clone;
6401        self.next_page_token.clone()
6402    }
6403}
6404
6405/// The request to update an issue comment.
6406#[derive(Clone, Default, PartialEq)]
6407#[non_exhaustive]
6408pub struct UpdateIssueCommentRequest {
6409    /// Required. The issue comment to update.
6410    pub issue_comment: std::option::Option<crate::model::IssueComment>,
6411
6412    /// Optional. Field mask is used to specify the fields to be overwritten in the
6413    /// issue comment resource by the update.
6414    /// The fields specified in the update_mask are relative to the resource, not
6415    /// the full request. A field will be overwritten if it is in the mask.
6416    /// The special value "*" means full replacement.
6417    pub update_mask: std::option::Option<wkt::FieldMask>,
6418
6419    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6420}
6421
6422impl UpdateIssueCommentRequest {
6423    pub fn new() -> Self {
6424        std::default::Default::default()
6425    }
6426
6427    /// Sets the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
6428    pub fn set_issue_comment<T>(mut self, v: T) -> Self
6429    where
6430        T: std::convert::Into<crate::model::IssueComment>,
6431    {
6432        self.issue_comment = std::option::Option::Some(v.into());
6433        self
6434    }
6435
6436    /// Sets or clears the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
6437    pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
6438    where
6439        T: std::convert::Into<crate::model::IssueComment>,
6440    {
6441        self.issue_comment = v.map(|x| x.into());
6442        self
6443    }
6444
6445    /// Sets the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
6446    pub fn set_update_mask<T>(mut self, v: T) -> Self
6447    where
6448        T: std::convert::Into<wkt::FieldMask>,
6449    {
6450        self.update_mask = std::option::Option::Some(v.into());
6451        self
6452    }
6453
6454    /// Sets or clears the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
6455    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6456    where
6457        T: std::convert::Into<wkt::FieldMask>,
6458    {
6459        self.update_mask = v.map(|x| x.into());
6460        self
6461    }
6462}
6463
6464impl wkt::message::Message for UpdateIssueCommentRequest {
6465    fn typename() -> &'static str {
6466        "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest"
6467    }
6468}
6469
6470/// The request to delete an issue comment.
6471#[derive(Clone, Default, PartialEq)]
6472#[non_exhaustive]
6473pub struct DeleteIssueCommentRequest {
6474    /// Required. Name of the issue comment to delete.
6475    /// The format is
6476    /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`.
6477    pub name: std::string::String,
6478
6479    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6480}
6481
6482impl DeleteIssueCommentRequest {
6483    pub fn new() -> Self {
6484        std::default::Default::default()
6485    }
6486
6487    /// Sets the value of [name][crate::model::DeleteIssueCommentRequest::name].
6488    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6489        self.name = v.into();
6490        self
6491    }
6492}
6493
6494impl wkt::message::Message for DeleteIssueCommentRequest {
6495    fn typename() -> &'static str {
6496        "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest"
6497    }
6498}