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