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 rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37/// Message for requesting a list of Users
38#[derive(Clone, Debug, Default, PartialEq)]
39#[non_exhaustive]
40pub struct ListUsersRequest {
41    /// Required. Parent value for ListUsersRequest
42    pub parent: std::string::String,
43
44    /// Optional. Requested page size. Server may return fewer items than
45    /// requested. If unspecified, server will pick an appropriate default.
46    pub page_size: i32,
47
48    /// Optional. A token identifying a page of results the server should return.
49    pub page_token: std::string::String,
50
51    /// Optional. Filtering results
52    pub filter: std::string::String,
53
54    /// Optional. Hint for how to order the results
55    pub order_by: std::string::String,
56
57    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
58}
59
60impl ListUsersRequest {
61    pub fn new() -> Self {
62        std::default::Default::default()
63    }
64
65    /// Sets the value of [parent][crate::model::ListUsersRequest::parent].
66    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
67        self.parent = v.into();
68        self
69    }
70
71    /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
72    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
73        self.page_size = v.into();
74        self
75    }
76
77    /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
78    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
79        self.page_token = v.into();
80        self
81    }
82
83    /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
84    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
85        self.filter = v.into();
86        self
87    }
88
89    /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
90    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
91        self.order_by = v.into();
92        self
93    }
94}
95
96impl wkt::message::Message for ListUsersRequest {
97    fn typename() -> &'static str {
98        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
99    }
100}
101
102#[doc(hidden)]
103impl<'de> serde::de::Deserialize<'de> for ListUsersRequest {
104    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
105    where
106        D: serde::Deserializer<'de>,
107    {
108        #[allow(non_camel_case_types)]
109        #[doc(hidden)]
110        #[derive(PartialEq, Eq, Hash)]
111        enum __FieldTag {
112            __parent,
113            __page_size,
114            __page_token,
115            __filter,
116            __order_by,
117            Unknown(std::string::String),
118        }
119        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
120            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
121            where
122                D: serde::Deserializer<'de>,
123            {
124                struct Visitor;
125                impl<'de> serde::de::Visitor<'de> for Visitor {
126                    type Value = __FieldTag;
127                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
128                        formatter.write_str("a field name for ListUsersRequest")
129                    }
130                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
131                    where
132                        E: serde::de::Error,
133                    {
134                        use std::result::Result::Ok;
135                        use std::string::ToString;
136                        match value {
137                            "parent" => Ok(__FieldTag::__parent),
138                            "pageSize" => Ok(__FieldTag::__page_size),
139                            "page_size" => Ok(__FieldTag::__page_size),
140                            "pageToken" => Ok(__FieldTag::__page_token),
141                            "page_token" => Ok(__FieldTag::__page_token),
142                            "filter" => Ok(__FieldTag::__filter),
143                            "orderBy" => Ok(__FieldTag::__order_by),
144                            "order_by" => Ok(__FieldTag::__order_by),
145                            _ => Ok(__FieldTag::Unknown(value.to_string())),
146                        }
147                    }
148                }
149                deserializer.deserialize_identifier(Visitor)
150            }
151        }
152        struct Visitor;
153        impl<'de> serde::de::Visitor<'de> for Visitor {
154            type Value = ListUsersRequest;
155            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
156                formatter.write_str("struct ListUsersRequest")
157            }
158            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
159            where
160                A: serde::de::MapAccess<'de>,
161            {
162                #[allow(unused_imports)]
163                use serde::de::Error;
164                use std::option::Option::Some;
165                let mut fields = std::collections::HashSet::new();
166                let mut result = Self::Value::new();
167                while let Some(tag) = map.next_key::<__FieldTag>()? {
168                    #[allow(clippy::match_single_binding)]
169                    match tag {
170                        __FieldTag::__parent => {
171                            if !fields.insert(__FieldTag::__parent) {
172                                return std::result::Result::Err(A::Error::duplicate_field(
173                                    "multiple values for parent",
174                                ));
175                            }
176                            result.parent = map
177                                .next_value::<std::option::Option<std::string::String>>()?
178                                .unwrap_or_default();
179                        }
180                        __FieldTag::__page_size => {
181                            if !fields.insert(__FieldTag::__page_size) {
182                                return std::result::Result::Err(A::Error::duplicate_field(
183                                    "multiple values for page_size",
184                                ));
185                            }
186                            struct __With(std::option::Option<i32>);
187                            impl<'de> serde::de::Deserialize<'de> for __With {
188                                fn deserialize<D>(
189                                    deserializer: D,
190                                ) -> std::result::Result<Self, D::Error>
191                                where
192                                    D: serde::de::Deserializer<'de>,
193                                {
194                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
195                                }
196                            }
197                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
198                        }
199                        __FieldTag::__page_token => {
200                            if !fields.insert(__FieldTag::__page_token) {
201                                return std::result::Result::Err(A::Error::duplicate_field(
202                                    "multiple values for page_token",
203                                ));
204                            }
205                            result.page_token = map
206                                .next_value::<std::option::Option<std::string::String>>()?
207                                .unwrap_or_default();
208                        }
209                        __FieldTag::__filter => {
210                            if !fields.insert(__FieldTag::__filter) {
211                                return std::result::Result::Err(A::Error::duplicate_field(
212                                    "multiple values for filter",
213                                ));
214                            }
215                            result.filter = map
216                                .next_value::<std::option::Option<std::string::String>>()?
217                                .unwrap_or_default();
218                        }
219                        __FieldTag::__order_by => {
220                            if !fields.insert(__FieldTag::__order_by) {
221                                return std::result::Result::Err(A::Error::duplicate_field(
222                                    "multiple values for order_by",
223                                ));
224                            }
225                            result.order_by = map
226                                .next_value::<std::option::Option<std::string::String>>()?
227                                .unwrap_or_default();
228                        }
229                        __FieldTag::Unknown(key) => {
230                            let value = map.next_value::<serde_json::Value>()?;
231                            result._unknown_fields.insert(key, value);
232                        }
233                    }
234                }
235                std::result::Result::Ok(result)
236            }
237        }
238        deserializer.deserialize_any(Visitor)
239    }
240}
241
242#[doc(hidden)]
243impl serde::ser::Serialize for ListUsersRequest {
244    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
245    where
246        S: serde::ser::Serializer,
247    {
248        use serde::ser::SerializeMap;
249        #[allow(unused_imports)]
250        use std::option::Option::Some;
251        let mut state = serializer.serialize_map(std::option::Option::None)?;
252        if !self.parent.is_empty() {
253            state.serialize_entry("parent", &self.parent)?;
254        }
255        if !wkt::internal::is_default(&self.page_size) {
256            struct __With<'a>(&'a i32);
257            impl<'a> serde::ser::Serialize for __With<'a> {
258                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
259                where
260                    S: serde::ser::Serializer,
261                {
262                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
263                }
264            }
265            state.serialize_entry("pageSize", &__With(&self.page_size))?;
266        }
267        if !self.page_token.is_empty() {
268            state.serialize_entry("pageToken", &self.page_token)?;
269        }
270        if !self.filter.is_empty() {
271            state.serialize_entry("filter", &self.filter)?;
272        }
273        if !self.order_by.is_empty() {
274            state.serialize_entry("orderBy", &self.order_by)?;
275        }
276        if !self._unknown_fields.is_empty() {
277            for (key, value) in self._unknown_fields.iter() {
278                state.serialize_entry(key, &value)?;
279            }
280        }
281        state.end()
282    }
283}
284
285/// Message for response to listing Users
286#[derive(Clone, Debug, Default, PartialEq)]
287#[non_exhaustive]
288pub struct ListUsersResponse {
289    /// The list of Users
290    pub users: std::vec::Vec<crate::model::User>,
291
292    /// A token identifying a page of results the server should return.
293    pub next_page_token: std::string::String,
294
295    /// Locations that could not be reached.
296    pub unreachable: std::vec::Vec<std::string::String>,
297
298    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
299}
300
301impl ListUsersResponse {
302    pub fn new() -> Self {
303        std::default::Default::default()
304    }
305
306    /// Sets the value of [users][crate::model::ListUsersResponse::users].
307    pub fn set_users<T, V>(mut self, v: T) -> Self
308    where
309        T: std::iter::IntoIterator<Item = V>,
310        V: std::convert::Into<crate::model::User>,
311    {
312        use std::iter::Iterator;
313        self.users = v.into_iter().map(|i| i.into()).collect();
314        self
315    }
316
317    /// Sets the value of [next_page_token][crate::model::ListUsersResponse::next_page_token].
318    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
319        self.next_page_token = v.into();
320        self
321    }
322
323    /// Sets the value of [unreachable][crate::model::ListUsersResponse::unreachable].
324    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
325    where
326        T: std::iter::IntoIterator<Item = V>,
327        V: std::convert::Into<std::string::String>,
328    {
329        use std::iter::Iterator;
330        self.unreachable = v.into_iter().map(|i| i.into()).collect();
331        self
332    }
333}
334
335impl wkt::message::Message for ListUsersResponse {
336    fn typename() -> &'static str {
337        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
338    }
339}
340
341#[doc(hidden)]
342impl gax::paginator::internal::PageableResponse for ListUsersResponse {
343    type PageItem = crate::model::User;
344
345    fn items(self) -> std::vec::Vec<Self::PageItem> {
346        self.users
347    }
348
349    fn next_page_token(&self) -> std::string::String {
350        use std::clone::Clone;
351        self.next_page_token.clone()
352    }
353}
354
355#[doc(hidden)]
356impl<'de> serde::de::Deserialize<'de> for ListUsersResponse {
357    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
358    where
359        D: serde::Deserializer<'de>,
360    {
361        #[allow(non_camel_case_types)]
362        #[doc(hidden)]
363        #[derive(PartialEq, Eq, Hash)]
364        enum __FieldTag {
365            __users,
366            __next_page_token,
367            __unreachable,
368            Unknown(std::string::String),
369        }
370        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
371            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
372            where
373                D: serde::Deserializer<'de>,
374            {
375                struct Visitor;
376                impl<'de> serde::de::Visitor<'de> for Visitor {
377                    type Value = __FieldTag;
378                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
379                        formatter.write_str("a field name for ListUsersResponse")
380                    }
381                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
382                    where
383                        E: serde::de::Error,
384                    {
385                        use std::result::Result::Ok;
386                        use std::string::ToString;
387                        match value {
388                            "users" => Ok(__FieldTag::__users),
389                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
390                            "next_page_token" => Ok(__FieldTag::__next_page_token),
391                            "unreachable" => Ok(__FieldTag::__unreachable),
392                            _ => Ok(__FieldTag::Unknown(value.to_string())),
393                        }
394                    }
395                }
396                deserializer.deserialize_identifier(Visitor)
397            }
398        }
399        struct Visitor;
400        impl<'de> serde::de::Visitor<'de> for Visitor {
401            type Value = ListUsersResponse;
402            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
403                formatter.write_str("struct ListUsersResponse")
404            }
405            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
406            where
407                A: serde::de::MapAccess<'de>,
408            {
409                #[allow(unused_imports)]
410                use serde::de::Error;
411                use std::option::Option::Some;
412                let mut fields = std::collections::HashSet::new();
413                let mut result = Self::Value::new();
414                while let Some(tag) = map.next_key::<__FieldTag>()? {
415                    #[allow(clippy::match_single_binding)]
416                    match tag {
417                        __FieldTag::__users => {
418                            if !fields.insert(__FieldTag::__users) {
419                                return std::result::Result::Err(A::Error::duplicate_field(
420                                    "multiple values for users",
421                                ));
422                            }
423                            result.users = map.next_value::<std::option::Option<std::vec::Vec<crate::model::User>>>()?.unwrap_or_default();
424                        }
425                        __FieldTag::__next_page_token => {
426                            if !fields.insert(__FieldTag::__next_page_token) {
427                                return std::result::Result::Err(A::Error::duplicate_field(
428                                    "multiple values for next_page_token",
429                                ));
430                            }
431                            result.next_page_token = map
432                                .next_value::<std::option::Option<std::string::String>>()?
433                                .unwrap_or_default();
434                        }
435                        __FieldTag::__unreachable => {
436                            if !fields.insert(__FieldTag::__unreachable) {
437                                return std::result::Result::Err(A::Error::duplicate_field(
438                                    "multiple values for unreachable",
439                                ));
440                            }
441                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
442                        }
443                        __FieldTag::Unknown(key) => {
444                            let value = map.next_value::<serde_json::Value>()?;
445                            result._unknown_fields.insert(key, value);
446                        }
447                    }
448                }
449                std::result::Result::Ok(result)
450            }
451        }
452        deserializer.deserialize_any(Visitor)
453    }
454}
455
456#[doc(hidden)]
457impl serde::ser::Serialize for ListUsersResponse {
458    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
459    where
460        S: serde::ser::Serializer,
461    {
462        use serde::ser::SerializeMap;
463        #[allow(unused_imports)]
464        use std::option::Option::Some;
465        let mut state = serializer.serialize_map(std::option::Option::None)?;
466        if !self.users.is_empty() {
467            state.serialize_entry("users", &self.users)?;
468        }
469        if !self.next_page_token.is_empty() {
470            state.serialize_entry("nextPageToken", &self.next_page_token)?;
471        }
472        if !self.unreachable.is_empty() {
473            state.serialize_entry("unreachable", &self.unreachable)?;
474        }
475        if !self._unknown_fields.is_empty() {
476            for (key, value) in self._unknown_fields.iter() {
477                state.serialize_entry(key, &value)?;
478            }
479        }
480        state.end()
481    }
482}
483
484/// Message describing Connection object
485#[derive(Clone, Debug, Default, PartialEq)]
486#[non_exhaustive]
487pub struct Connection {
488    /// Identifier. The resource name of the connection, in the format
489    /// `projects/{project}/locations/{location}/connections/{connection_id}`.
490    pub name: std::string::String,
491
492    /// Output only. [Output only] Create timestamp
493    pub create_time: std::option::Option<wkt::Timestamp>,
494
495    /// Output only. [Output only] Update timestamp
496    pub update_time: std::option::Option<wkt::Timestamp>,
497
498    /// Output only. [Output only] Delete timestamp
499    pub delete_time: std::option::Option<wkt::Timestamp>,
500
501    /// Optional. Labels as key value pairs
502    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
503
504    /// Output only. Installation state of the Connection.
505    pub installation_state: std::option::Option<crate::model::InstallationState>,
506
507    /// Optional. If disabled is set to true, functionality is disabled for this
508    /// connection. Repository based API methods and webhooks processing for
509    /// repositories in this connection will be disabled.
510    pub disabled: bool,
511
512    /// Output only. Set to true when the connection is being set up or updated in
513    /// the background.
514    pub reconciling: bool,
515
516    /// Optional. Allows clients to store small amounts of arbitrary data.
517    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
518
519    /// Optional. This checksum is computed by the server based on the value of
520    /// other fields, and may be sent on update and delete requests to ensure the
521    /// client has an up-to-date value before proceeding.
522    pub etag: std::string::String,
523
524    /// Output only. A system-assigned unique identifier for the Connection.
525    pub uid: std::string::String,
526
527    /// Optional. The crypto key configuration. This field is used by the
528    /// Customer-Managed Encryption Keys (CMEK) feature.
529    pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
530
531    /// Optional. Configuration for the git proxy feature. Enabling the git proxy
532    /// allows clients to perform git operations on the repositories linked in the
533    /// connection.
534    pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
535
536    /// Configuration for the connection depending on the type of provider.
537    pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
538
539    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
540}
541
542impl Connection {
543    pub fn new() -> Self {
544        std::default::Default::default()
545    }
546
547    /// Sets the value of [name][crate::model::Connection::name].
548    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
549        self.name = v.into();
550        self
551    }
552
553    /// Sets the value of [create_time][crate::model::Connection::create_time].
554    pub fn set_create_time<T>(mut self, v: T) -> Self
555    where
556        T: std::convert::Into<wkt::Timestamp>,
557    {
558        self.create_time = std::option::Option::Some(v.into());
559        self
560    }
561
562    /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
563    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
564    where
565        T: std::convert::Into<wkt::Timestamp>,
566    {
567        self.create_time = v.map(|x| x.into());
568        self
569    }
570
571    /// Sets the value of [update_time][crate::model::Connection::update_time].
572    pub fn set_update_time<T>(mut self, v: T) -> Self
573    where
574        T: std::convert::Into<wkt::Timestamp>,
575    {
576        self.update_time = std::option::Option::Some(v.into());
577        self
578    }
579
580    /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
581    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
582    where
583        T: std::convert::Into<wkt::Timestamp>,
584    {
585        self.update_time = v.map(|x| x.into());
586        self
587    }
588
589    /// Sets the value of [delete_time][crate::model::Connection::delete_time].
590    pub fn set_delete_time<T>(mut self, v: T) -> Self
591    where
592        T: std::convert::Into<wkt::Timestamp>,
593    {
594        self.delete_time = std::option::Option::Some(v.into());
595        self
596    }
597
598    /// Sets or clears the value of [delete_time][crate::model::Connection::delete_time].
599    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
600    where
601        T: std::convert::Into<wkt::Timestamp>,
602    {
603        self.delete_time = v.map(|x| x.into());
604        self
605    }
606
607    /// Sets the value of [labels][crate::model::Connection::labels].
608    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
609    where
610        T: std::iter::IntoIterator<Item = (K, V)>,
611        K: std::convert::Into<std::string::String>,
612        V: std::convert::Into<std::string::String>,
613    {
614        use std::iter::Iterator;
615        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
616        self
617    }
618
619    /// Sets the value of [installation_state][crate::model::Connection::installation_state].
620    pub fn set_installation_state<T>(mut self, v: T) -> Self
621    where
622        T: std::convert::Into<crate::model::InstallationState>,
623    {
624        self.installation_state = std::option::Option::Some(v.into());
625        self
626    }
627
628    /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
629    pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
630    where
631        T: std::convert::Into<crate::model::InstallationState>,
632    {
633        self.installation_state = v.map(|x| x.into());
634        self
635    }
636
637    /// Sets the value of [disabled][crate::model::Connection::disabled].
638    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
639        self.disabled = v.into();
640        self
641    }
642
643    /// Sets the value of [reconciling][crate::model::Connection::reconciling].
644    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
645        self.reconciling = v.into();
646        self
647    }
648
649    /// Sets the value of [annotations][crate::model::Connection::annotations].
650    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
651    where
652        T: std::iter::IntoIterator<Item = (K, V)>,
653        K: std::convert::Into<std::string::String>,
654        V: std::convert::Into<std::string::String>,
655    {
656        use std::iter::Iterator;
657        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
658        self
659    }
660
661    /// Sets the value of [etag][crate::model::Connection::etag].
662    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
663        self.etag = v.into();
664        self
665    }
666
667    /// Sets the value of [uid][crate::model::Connection::uid].
668    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
669        self.uid = v.into();
670        self
671    }
672
673    /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
674    pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
675    where
676        T: std::convert::Into<crate::model::CryptoKeyConfig>,
677    {
678        self.crypto_key_config = std::option::Option::Some(v.into());
679        self
680    }
681
682    /// Sets or clears the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
683    pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
684    where
685        T: std::convert::Into<crate::model::CryptoKeyConfig>,
686    {
687        self.crypto_key_config = v.map(|x| x.into());
688        self
689    }
690
691    /// Sets the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
692    pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
693    where
694        T: std::convert::Into<crate::model::GitProxyConfig>,
695    {
696        self.git_proxy_config = std::option::Option::Some(v.into());
697        self
698    }
699
700    /// Sets or clears the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
701    pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
702    where
703        T: std::convert::Into<crate::model::GitProxyConfig>,
704    {
705        self.git_proxy_config = v.map(|x| x.into());
706        self
707    }
708
709    /// Sets the value of [connection_config][crate::model::Connection::connection_config].
710    ///
711    /// Note that all the setters affecting `connection_config` are mutually
712    /// exclusive.
713    pub fn set_connection_config<
714        T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
715    >(
716        mut self,
717        v: T,
718    ) -> Self {
719        self.connection_config = v.into();
720        self
721    }
722
723    /// The value of [connection_config][crate::model::Connection::connection_config]
724    /// if it holds a `GithubConfig`, `None` if the field is not set or
725    /// holds a different branch.
726    pub fn github_config(
727        &self,
728    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
729        #[allow(unreachable_patterns)]
730        self.connection_config.as_ref().and_then(|v| match v {
731            crate::model::connection::ConnectionConfig::GithubConfig(v) => {
732                std::option::Option::Some(v)
733            }
734            _ => std::option::Option::None,
735        })
736    }
737
738    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
739    /// to hold a `GithubConfig`.
740    ///
741    /// Note that all the setters affecting `connection_config` are
742    /// mutually exclusive.
743    pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
744        mut self,
745        v: T,
746    ) -> Self {
747        self.connection_config = std::option::Option::Some(
748            crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
749        );
750        self
751    }
752
753    /// The value of [connection_config][crate::model::Connection::connection_config]
754    /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
755    /// holds a different branch.
756    pub fn github_enterprise_config(
757        &self,
758    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
759        #[allow(unreachable_patterns)]
760        self.connection_config.as_ref().and_then(|v| match v {
761            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
762                std::option::Option::Some(v)
763            }
764            _ => std::option::Option::None,
765        })
766    }
767
768    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
769    /// to hold a `GithubEnterpriseConfig`.
770    ///
771    /// Note that all the setters affecting `connection_config` are
772    /// mutually exclusive.
773    pub fn set_github_enterprise_config<
774        T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
775    >(
776        mut self,
777        v: T,
778    ) -> Self {
779        self.connection_config = std::option::Option::Some(
780            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
781        );
782        self
783    }
784
785    /// The value of [connection_config][crate::model::Connection::connection_config]
786    /// if it holds a `GitlabConfig`, `None` if the field is not set or
787    /// holds a different branch.
788    pub fn gitlab_config(
789        &self,
790    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
791        #[allow(unreachable_patterns)]
792        self.connection_config.as_ref().and_then(|v| match v {
793            crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
794                std::option::Option::Some(v)
795            }
796            _ => std::option::Option::None,
797        })
798    }
799
800    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
801    /// to hold a `GitlabConfig`.
802    ///
803    /// Note that all the setters affecting `connection_config` are
804    /// mutually exclusive.
805    pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
806        mut self,
807        v: T,
808    ) -> Self {
809        self.connection_config = std::option::Option::Some(
810            crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
811        );
812        self
813    }
814
815    /// The value of [connection_config][crate::model::Connection::connection_config]
816    /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
817    /// holds a different branch.
818    pub fn gitlab_enterprise_config(
819        &self,
820    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
821        #[allow(unreachable_patterns)]
822        self.connection_config.as_ref().and_then(|v| match v {
823            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
824                std::option::Option::Some(v)
825            }
826            _ => std::option::Option::None,
827        })
828    }
829
830    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
831    /// to hold a `GitlabEnterpriseConfig`.
832    ///
833    /// Note that all the setters affecting `connection_config` are
834    /// mutually exclusive.
835    pub fn set_gitlab_enterprise_config<
836        T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
837    >(
838        mut self,
839        v: T,
840    ) -> Self {
841        self.connection_config = std::option::Option::Some(
842            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
843        );
844        self
845    }
846
847    /// The value of [connection_config][crate::model::Connection::connection_config]
848    /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
849    /// holds a different branch.
850    pub fn bitbucket_data_center_config(
851        &self,
852    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
853        #[allow(unreachable_patterns)]
854        self.connection_config.as_ref().and_then(|v| match v {
855            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
856                std::option::Option::Some(v)
857            }
858            _ => std::option::Option::None,
859        })
860    }
861
862    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
863    /// to hold a `BitbucketDataCenterConfig`.
864    ///
865    /// Note that all the setters affecting `connection_config` are
866    /// mutually exclusive.
867    pub fn set_bitbucket_data_center_config<
868        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
869    >(
870        mut self,
871        v: T,
872    ) -> Self {
873        self.connection_config = std::option::Option::Some(
874            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
875        );
876        self
877    }
878
879    /// The value of [connection_config][crate::model::Connection::connection_config]
880    /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
881    /// holds a different branch.
882    pub fn bitbucket_cloud_config(
883        &self,
884    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
885        #[allow(unreachable_patterns)]
886        self.connection_config.as_ref().and_then(|v| match v {
887            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
888                std::option::Option::Some(v)
889            }
890            _ => std::option::Option::None,
891        })
892    }
893
894    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
895    /// to hold a `BitbucketCloudConfig`.
896    ///
897    /// Note that all the setters affecting `connection_config` are
898    /// mutually exclusive.
899    pub fn set_bitbucket_cloud_config<
900        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
901    >(
902        mut self,
903        v: T,
904    ) -> Self {
905        self.connection_config = std::option::Option::Some(
906            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
907        );
908        self
909    }
910}
911
912impl wkt::message::Message for Connection {
913    fn typename() -> &'static str {
914        "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
915    }
916}
917
918#[doc(hidden)]
919impl<'de> serde::de::Deserialize<'de> for Connection {
920    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
921    where
922        D: serde::Deserializer<'de>,
923    {
924        #[allow(non_camel_case_types)]
925        #[doc(hidden)]
926        #[derive(PartialEq, Eq, Hash)]
927        enum __FieldTag {
928            __github_config,
929            __github_enterprise_config,
930            __gitlab_config,
931            __gitlab_enterprise_config,
932            __bitbucket_data_center_config,
933            __bitbucket_cloud_config,
934            __name,
935            __create_time,
936            __update_time,
937            __delete_time,
938            __labels,
939            __installation_state,
940            __disabled,
941            __reconciling,
942            __annotations,
943            __etag,
944            __uid,
945            __crypto_key_config,
946            __git_proxy_config,
947            Unknown(std::string::String),
948        }
949        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
950            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
951            where
952                D: serde::Deserializer<'de>,
953            {
954                struct Visitor;
955                impl<'de> serde::de::Visitor<'de> for Visitor {
956                    type Value = __FieldTag;
957                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
958                        formatter.write_str("a field name for Connection")
959                    }
960                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
961                    where
962                        E: serde::de::Error,
963                    {
964                        use std::result::Result::Ok;
965                        use std::string::ToString;
966                        match value {
967                            "githubConfig" => Ok(__FieldTag::__github_config),
968                            "github_config" => Ok(__FieldTag::__github_config),
969                            "githubEnterpriseConfig" => Ok(__FieldTag::__github_enterprise_config),
970                            "github_enterprise_config" => {
971                                Ok(__FieldTag::__github_enterprise_config)
972                            }
973                            "gitlabConfig" => Ok(__FieldTag::__gitlab_config),
974                            "gitlab_config" => Ok(__FieldTag::__gitlab_config),
975                            "gitlabEnterpriseConfig" => Ok(__FieldTag::__gitlab_enterprise_config),
976                            "gitlab_enterprise_config" => {
977                                Ok(__FieldTag::__gitlab_enterprise_config)
978                            }
979                            "bitbucketDataCenterConfig" => {
980                                Ok(__FieldTag::__bitbucket_data_center_config)
981                            }
982                            "bitbucket_data_center_config" => {
983                                Ok(__FieldTag::__bitbucket_data_center_config)
984                            }
985                            "bitbucketCloudConfig" => Ok(__FieldTag::__bitbucket_cloud_config),
986                            "bitbucket_cloud_config" => Ok(__FieldTag::__bitbucket_cloud_config),
987                            "name" => Ok(__FieldTag::__name),
988                            "createTime" => Ok(__FieldTag::__create_time),
989                            "create_time" => Ok(__FieldTag::__create_time),
990                            "updateTime" => Ok(__FieldTag::__update_time),
991                            "update_time" => Ok(__FieldTag::__update_time),
992                            "deleteTime" => Ok(__FieldTag::__delete_time),
993                            "delete_time" => Ok(__FieldTag::__delete_time),
994                            "labels" => Ok(__FieldTag::__labels),
995                            "installationState" => Ok(__FieldTag::__installation_state),
996                            "installation_state" => Ok(__FieldTag::__installation_state),
997                            "disabled" => Ok(__FieldTag::__disabled),
998                            "reconciling" => Ok(__FieldTag::__reconciling),
999                            "annotations" => Ok(__FieldTag::__annotations),
1000                            "etag" => Ok(__FieldTag::__etag),
1001                            "uid" => Ok(__FieldTag::__uid),
1002                            "cryptoKeyConfig" => Ok(__FieldTag::__crypto_key_config),
1003                            "crypto_key_config" => Ok(__FieldTag::__crypto_key_config),
1004                            "gitProxyConfig" => Ok(__FieldTag::__git_proxy_config),
1005                            "git_proxy_config" => Ok(__FieldTag::__git_proxy_config),
1006                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1007                        }
1008                    }
1009                }
1010                deserializer.deserialize_identifier(Visitor)
1011            }
1012        }
1013        struct Visitor;
1014        impl<'de> serde::de::Visitor<'de> for Visitor {
1015            type Value = Connection;
1016            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1017                formatter.write_str("struct Connection")
1018            }
1019            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1020            where
1021                A: serde::de::MapAccess<'de>,
1022            {
1023                #[allow(unused_imports)]
1024                use serde::de::Error;
1025                use std::option::Option::Some;
1026                let mut fields = std::collections::HashSet::new();
1027                let mut result = Self::Value::new();
1028                while let Some(tag) = map.next_key::<__FieldTag>()? {
1029                    #[allow(clippy::match_single_binding)]
1030                    match tag {
1031                        __FieldTag::__github_config => {
1032                            if !fields.insert(__FieldTag::__github_config) {
1033                                return std::result::Result::Err(A::Error::duplicate_field(
1034                                    "multiple values for github_config",
1035                                ));
1036                            }
1037                            if result.connection_config.is_some() {
1038                                return std::result::Result::Err(A::Error::duplicate_field(
1039                                    "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.github_config, latest field was githubConfig",
1040                                ));
1041                            }
1042                            result.connection_config = std::option::Option::Some(
1043                                crate::model::connection::ConnectionConfig::GithubConfig(
1044                                    map.next_value::<std::option::Option<
1045                                        std::boxed::Box<crate::model::GitHubConfig>,
1046                                    >>()?
1047                                    .unwrap_or_default(),
1048                                ),
1049                            );
1050                        }
1051                        __FieldTag::__github_enterprise_config => {
1052                            if !fields.insert(__FieldTag::__github_enterprise_config) {
1053                                return std::result::Result::Err(A::Error::duplicate_field(
1054                                    "multiple values for github_enterprise_config",
1055                                ));
1056                            }
1057                            if result.connection_config.is_some() {
1058                                return std::result::Result::Err(A::Error::duplicate_field(
1059                                    "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.github_enterprise_config, latest field was githubEnterpriseConfig",
1060                                ));
1061                            }
1062                            result.connection_config = std::option::Option::Some(
1063                                crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(
1064                                    map.next_value::<std::option::Option<
1065                                        std::boxed::Box<crate::model::GitHubEnterpriseConfig>,
1066                                    >>()?
1067                                    .unwrap_or_default(),
1068                                ),
1069                            );
1070                        }
1071                        __FieldTag::__gitlab_config => {
1072                            if !fields.insert(__FieldTag::__gitlab_config) {
1073                                return std::result::Result::Err(A::Error::duplicate_field(
1074                                    "multiple values for gitlab_config",
1075                                ));
1076                            }
1077                            if result.connection_config.is_some() {
1078                                return std::result::Result::Err(A::Error::duplicate_field(
1079                                    "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.gitlab_config, latest field was gitlabConfig",
1080                                ));
1081                            }
1082                            result.connection_config = std::option::Option::Some(
1083                                crate::model::connection::ConnectionConfig::GitlabConfig(
1084                                    map.next_value::<std::option::Option<
1085                                        std::boxed::Box<crate::model::GitLabConfig>,
1086                                    >>()?
1087                                    .unwrap_or_default(),
1088                                ),
1089                            );
1090                        }
1091                        __FieldTag::__gitlab_enterprise_config => {
1092                            if !fields.insert(__FieldTag::__gitlab_enterprise_config) {
1093                                return std::result::Result::Err(A::Error::duplicate_field(
1094                                    "multiple values for gitlab_enterprise_config",
1095                                ));
1096                            }
1097                            if result.connection_config.is_some() {
1098                                return std::result::Result::Err(A::Error::duplicate_field(
1099                                    "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.gitlab_enterprise_config, latest field was gitlabEnterpriseConfig",
1100                                ));
1101                            }
1102                            result.connection_config = std::option::Option::Some(
1103                                crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(
1104                                    map.next_value::<std::option::Option<
1105                                        std::boxed::Box<crate::model::GitLabEnterpriseConfig>,
1106                                    >>()?
1107                                    .unwrap_or_default(),
1108                                ),
1109                            );
1110                        }
1111                        __FieldTag::__bitbucket_data_center_config => {
1112                            if !fields.insert(__FieldTag::__bitbucket_data_center_config) {
1113                                return std::result::Result::Err(A::Error::duplicate_field(
1114                                    "multiple values for bitbucket_data_center_config",
1115                                ));
1116                            }
1117                            if result.connection_config.is_some() {
1118                                return std::result::Result::Err(A::Error::duplicate_field(
1119                                    "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.bitbucket_data_center_config, latest field was bitbucketDataCenterConfig",
1120                                ));
1121                            }
1122                            result.connection_config = std::option::Option::Some(
1123                                crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(
1124                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>>()?.unwrap_or_default()
1125                                ),
1126                            );
1127                        }
1128                        __FieldTag::__bitbucket_cloud_config => {
1129                            if !fields.insert(__FieldTag::__bitbucket_cloud_config) {
1130                                return std::result::Result::Err(A::Error::duplicate_field(
1131                                    "multiple values for bitbucket_cloud_config",
1132                                ));
1133                            }
1134                            if result.connection_config.is_some() {
1135                                return std::result::Result::Err(A::Error::duplicate_field(
1136                                    "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.bitbucket_cloud_config, latest field was bitbucketCloudConfig",
1137                                ));
1138                            }
1139                            result.connection_config = std::option::Option::Some(
1140                                crate::model::connection::ConnectionConfig::BitbucketCloudConfig(
1141                                    map.next_value::<std::option::Option<
1142                                        std::boxed::Box<crate::model::BitbucketCloudConfig>,
1143                                    >>()?
1144                                    .unwrap_or_default(),
1145                                ),
1146                            );
1147                        }
1148                        __FieldTag::__name => {
1149                            if !fields.insert(__FieldTag::__name) {
1150                                return std::result::Result::Err(A::Error::duplicate_field(
1151                                    "multiple values for name",
1152                                ));
1153                            }
1154                            result.name = map
1155                                .next_value::<std::option::Option<std::string::String>>()?
1156                                .unwrap_or_default();
1157                        }
1158                        __FieldTag::__create_time => {
1159                            if !fields.insert(__FieldTag::__create_time) {
1160                                return std::result::Result::Err(A::Error::duplicate_field(
1161                                    "multiple values for create_time",
1162                                ));
1163                            }
1164                            result.create_time =
1165                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1166                        }
1167                        __FieldTag::__update_time => {
1168                            if !fields.insert(__FieldTag::__update_time) {
1169                                return std::result::Result::Err(A::Error::duplicate_field(
1170                                    "multiple values for update_time",
1171                                ));
1172                            }
1173                            result.update_time =
1174                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1175                        }
1176                        __FieldTag::__delete_time => {
1177                            if !fields.insert(__FieldTag::__delete_time) {
1178                                return std::result::Result::Err(A::Error::duplicate_field(
1179                                    "multiple values for delete_time",
1180                                ));
1181                            }
1182                            result.delete_time =
1183                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1184                        }
1185                        __FieldTag::__labels => {
1186                            if !fields.insert(__FieldTag::__labels) {
1187                                return std::result::Result::Err(A::Error::duplicate_field(
1188                                    "multiple values for labels",
1189                                ));
1190                            }
1191                            result.labels = map
1192                                .next_value::<std::option::Option<
1193                                    std::collections::HashMap<
1194                                        std::string::String,
1195                                        std::string::String,
1196                                    >,
1197                                >>()?
1198                                .unwrap_or_default();
1199                        }
1200                        __FieldTag::__installation_state => {
1201                            if !fields.insert(__FieldTag::__installation_state) {
1202                                return std::result::Result::Err(A::Error::duplicate_field(
1203                                    "multiple values for installation_state",
1204                                ));
1205                            }
1206                            result.installation_state = map
1207                                .next_value::<std::option::Option<crate::model::InstallationState>>(
1208                                )?;
1209                        }
1210                        __FieldTag::__disabled => {
1211                            if !fields.insert(__FieldTag::__disabled) {
1212                                return std::result::Result::Err(A::Error::duplicate_field(
1213                                    "multiple values for disabled",
1214                                ));
1215                            }
1216                            result.disabled = map
1217                                .next_value::<std::option::Option<bool>>()?
1218                                .unwrap_or_default();
1219                        }
1220                        __FieldTag::__reconciling => {
1221                            if !fields.insert(__FieldTag::__reconciling) {
1222                                return std::result::Result::Err(A::Error::duplicate_field(
1223                                    "multiple values for reconciling",
1224                                ));
1225                            }
1226                            result.reconciling = map
1227                                .next_value::<std::option::Option<bool>>()?
1228                                .unwrap_or_default();
1229                        }
1230                        __FieldTag::__annotations => {
1231                            if !fields.insert(__FieldTag::__annotations) {
1232                                return std::result::Result::Err(A::Error::duplicate_field(
1233                                    "multiple values for annotations",
1234                                ));
1235                            }
1236                            result.annotations = map
1237                                .next_value::<std::option::Option<
1238                                    std::collections::HashMap<
1239                                        std::string::String,
1240                                        std::string::String,
1241                                    >,
1242                                >>()?
1243                                .unwrap_or_default();
1244                        }
1245                        __FieldTag::__etag => {
1246                            if !fields.insert(__FieldTag::__etag) {
1247                                return std::result::Result::Err(A::Error::duplicate_field(
1248                                    "multiple values for etag",
1249                                ));
1250                            }
1251                            result.etag = map
1252                                .next_value::<std::option::Option<std::string::String>>()?
1253                                .unwrap_or_default();
1254                        }
1255                        __FieldTag::__uid => {
1256                            if !fields.insert(__FieldTag::__uid) {
1257                                return std::result::Result::Err(A::Error::duplicate_field(
1258                                    "multiple values for uid",
1259                                ));
1260                            }
1261                            result.uid = map
1262                                .next_value::<std::option::Option<std::string::String>>()?
1263                                .unwrap_or_default();
1264                        }
1265                        __FieldTag::__crypto_key_config => {
1266                            if !fields.insert(__FieldTag::__crypto_key_config) {
1267                                return std::result::Result::Err(A::Error::duplicate_field(
1268                                    "multiple values for crypto_key_config",
1269                                ));
1270                            }
1271                            result.crypto_key_config = map
1272                                .next_value::<std::option::Option<crate::model::CryptoKeyConfig>>(
1273                                )?;
1274                        }
1275                        __FieldTag::__git_proxy_config => {
1276                            if !fields.insert(__FieldTag::__git_proxy_config) {
1277                                return std::result::Result::Err(A::Error::duplicate_field(
1278                                    "multiple values for git_proxy_config",
1279                                ));
1280                            }
1281                            result.git_proxy_config = map
1282                                .next_value::<std::option::Option<crate::model::GitProxyConfig>>(
1283                                )?;
1284                        }
1285                        __FieldTag::Unknown(key) => {
1286                            let value = map.next_value::<serde_json::Value>()?;
1287                            result._unknown_fields.insert(key, value);
1288                        }
1289                    }
1290                }
1291                std::result::Result::Ok(result)
1292            }
1293        }
1294        deserializer.deserialize_any(Visitor)
1295    }
1296}
1297
1298#[doc(hidden)]
1299impl serde::ser::Serialize for Connection {
1300    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1301    where
1302        S: serde::ser::Serializer,
1303    {
1304        use serde::ser::SerializeMap;
1305        #[allow(unused_imports)]
1306        use std::option::Option::Some;
1307        let mut state = serializer.serialize_map(std::option::Option::None)?;
1308        if let Some(value) = self.github_config() {
1309            state.serialize_entry("githubConfig", value)?;
1310        }
1311        if let Some(value) = self.github_enterprise_config() {
1312            state.serialize_entry("githubEnterpriseConfig", value)?;
1313        }
1314        if let Some(value) = self.gitlab_config() {
1315            state.serialize_entry("gitlabConfig", value)?;
1316        }
1317        if let Some(value) = self.gitlab_enterprise_config() {
1318            state.serialize_entry("gitlabEnterpriseConfig", value)?;
1319        }
1320        if let Some(value) = self.bitbucket_data_center_config() {
1321            state.serialize_entry("bitbucketDataCenterConfig", value)?;
1322        }
1323        if let Some(value) = self.bitbucket_cloud_config() {
1324            state.serialize_entry("bitbucketCloudConfig", value)?;
1325        }
1326        if !self.name.is_empty() {
1327            state.serialize_entry("name", &self.name)?;
1328        }
1329        if self.create_time.is_some() {
1330            state.serialize_entry("createTime", &self.create_time)?;
1331        }
1332        if self.update_time.is_some() {
1333            state.serialize_entry("updateTime", &self.update_time)?;
1334        }
1335        if self.delete_time.is_some() {
1336            state.serialize_entry("deleteTime", &self.delete_time)?;
1337        }
1338        if !self.labels.is_empty() {
1339            state.serialize_entry("labels", &self.labels)?;
1340        }
1341        if self.installation_state.is_some() {
1342            state.serialize_entry("installationState", &self.installation_state)?;
1343        }
1344        if !wkt::internal::is_default(&self.disabled) {
1345            state.serialize_entry("disabled", &self.disabled)?;
1346        }
1347        if !wkt::internal::is_default(&self.reconciling) {
1348            state.serialize_entry("reconciling", &self.reconciling)?;
1349        }
1350        if !self.annotations.is_empty() {
1351            state.serialize_entry("annotations", &self.annotations)?;
1352        }
1353        if !self.etag.is_empty() {
1354            state.serialize_entry("etag", &self.etag)?;
1355        }
1356        if !self.uid.is_empty() {
1357            state.serialize_entry("uid", &self.uid)?;
1358        }
1359        if self.crypto_key_config.is_some() {
1360            state.serialize_entry("cryptoKeyConfig", &self.crypto_key_config)?;
1361        }
1362        if self.git_proxy_config.is_some() {
1363            state.serialize_entry("gitProxyConfig", &self.git_proxy_config)?;
1364        }
1365        if !self._unknown_fields.is_empty() {
1366            for (key, value) in self._unknown_fields.iter() {
1367                state.serialize_entry(key, &value)?;
1368            }
1369        }
1370        state.end()
1371    }
1372}
1373
1374/// Defines additional types related to [Connection].
1375pub mod connection {
1376    #[allow(unused_imports)]
1377    use super::*;
1378
1379    /// Configuration for the connection depending on the type of provider.
1380    #[derive(Clone, Debug, PartialEq)]
1381    #[non_exhaustive]
1382    pub enum ConnectionConfig {
1383        /// Configuration for connections to github.com.
1384        GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
1385        /// Configuration for connections to an instance of GitHub Enterprise.
1386        GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
1387        /// Configuration for connections to gitlab.com.
1388        GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
1389        /// Configuration for connections to an instance of GitLab Enterprise.
1390        GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
1391        /// Configuration for connections to an instance of Bitbucket Data Center.
1392        BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
1393        /// Configuration for connections to an instance of Bitbucket Clouds.
1394        BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
1395    }
1396}
1397
1398/// The crypto key configuration. This field is used by the Customer-managed
1399/// encryption keys (CMEK) feature.
1400#[derive(Clone, Debug, Default, PartialEq)]
1401#[non_exhaustive]
1402pub struct CryptoKeyConfig {
1403    /// Required. The name of the key which is used to encrypt/decrypt customer
1404    /// data. For key in Cloud KMS, the key should be in the format of
1405    /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
1406    pub key_reference: std::string::String,
1407
1408    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1409}
1410
1411impl CryptoKeyConfig {
1412    pub fn new() -> Self {
1413        std::default::Default::default()
1414    }
1415
1416    /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
1417    pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1418        self.key_reference = v.into();
1419        self
1420    }
1421}
1422
1423impl wkt::message::Message for CryptoKeyConfig {
1424    fn typename() -> &'static str {
1425        "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
1426    }
1427}
1428
1429#[doc(hidden)]
1430impl<'de> serde::de::Deserialize<'de> for CryptoKeyConfig {
1431    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1432    where
1433        D: serde::Deserializer<'de>,
1434    {
1435        #[allow(non_camel_case_types)]
1436        #[doc(hidden)]
1437        #[derive(PartialEq, Eq, Hash)]
1438        enum __FieldTag {
1439            __key_reference,
1440            Unknown(std::string::String),
1441        }
1442        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1443            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1444            where
1445                D: serde::Deserializer<'de>,
1446            {
1447                struct Visitor;
1448                impl<'de> serde::de::Visitor<'de> for Visitor {
1449                    type Value = __FieldTag;
1450                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1451                        formatter.write_str("a field name for CryptoKeyConfig")
1452                    }
1453                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1454                    where
1455                        E: serde::de::Error,
1456                    {
1457                        use std::result::Result::Ok;
1458                        use std::string::ToString;
1459                        match value {
1460                            "keyReference" => Ok(__FieldTag::__key_reference),
1461                            "key_reference" => Ok(__FieldTag::__key_reference),
1462                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1463                        }
1464                    }
1465                }
1466                deserializer.deserialize_identifier(Visitor)
1467            }
1468        }
1469        struct Visitor;
1470        impl<'de> serde::de::Visitor<'de> for Visitor {
1471            type Value = CryptoKeyConfig;
1472            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1473                formatter.write_str("struct CryptoKeyConfig")
1474            }
1475            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1476            where
1477                A: serde::de::MapAccess<'de>,
1478            {
1479                #[allow(unused_imports)]
1480                use serde::de::Error;
1481                use std::option::Option::Some;
1482                let mut fields = std::collections::HashSet::new();
1483                let mut result = Self::Value::new();
1484                while let Some(tag) = map.next_key::<__FieldTag>()? {
1485                    #[allow(clippy::match_single_binding)]
1486                    match tag {
1487                        __FieldTag::__key_reference => {
1488                            if !fields.insert(__FieldTag::__key_reference) {
1489                                return std::result::Result::Err(A::Error::duplicate_field(
1490                                    "multiple values for key_reference",
1491                                ));
1492                            }
1493                            result.key_reference = map
1494                                .next_value::<std::option::Option<std::string::String>>()?
1495                                .unwrap_or_default();
1496                        }
1497                        __FieldTag::Unknown(key) => {
1498                            let value = map.next_value::<serde_json::Value>()?;
1499                            result._unknown_fields.insert(key, value);
1500                        }
1501                    }
1502                }
1503                std::result::Result::Ok(result)
1504            }
1505        }
1506        deserializer.deserialize_any(Visitor)
1507    }
1508}
1509
1510#[doc(hidden)]
1511impl serde::ser::Serialize for CryptoKeyConfig {
1512    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1513    where
1514        S: serde::ser::Serializer,
1515    {
1516        use serde::ser::SerializeMap;
1517        #[allow(unused_imports)]
1518        use std::option::Option::Some;
1519        let mut state = serializer.serialize_map(std::option::Option::None)?;
1520        if !self.key_reference.is_empty() {
1521            state.serialize_entry("keyReference", &self.key_reference)?;
1522        }
1523        if !self._unknown_fields.is_empty() {
1524            for (key, value) in self._unknown_fields.iter() {
1525                state.serialize_entry(key, &value)?;
1526            }
1527        }
1528        state.end()
1529    }
1530}
1531
1532/// The git proxy configuration.
1533#[derive(Clone, Debug, Default, PartialEq)]
1534#[non_exhaustive]
1535pub struct GitProxyConfig {
1536    /// Optional. Setting this to true allows the git proxy to be used for
1537    /// performing git operations on the repositories linked in the connection.
1538    pub enabled: bool,
1539
1540    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1541}
1542
1543impl GitProxyConfig {
1544    pub fn new() -> Self {
1545        std::default::Default::default()
1546    }
1547
1548    /// Sets the value of [enabled][crate::model::GitProxyConfig::enabled].
1549    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1550        self.enabled = v.into();
1551        self
1552    }
1553}
1554
1555impl wkt::message::Message for GitProxyConfig {
1556    fn typename() -> &'static str {
1557        "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
1558    }
1559}
1560
1561#[doc(hidden)]
1562impl<'de> serde::de::Deserialize<'de> for GitProxyConfig {
1563    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1564    where
1565        D: serde::Deserializer<'de>,
1566    {
1567        #[allow(non_camel_case_types)]
1568        #[doc(hidden)]
1569        #[derive(PartialEq, Eq, Hash)]
1570        enum __FieldTag {
1571            __enabled,
1572            Unknown(std::string::String),
1573        }
1574        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1575            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1576            where
1577                D: serde::Deserializer<'de>,
1578            {
1579                struct Visitor;
1580                impl<'de> serde::de::Visitor<'de> for Visitor {
1581                    type Value = __FieldTag;
1582                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1583                        formatter.write_str("a field name for GitProxyConfig")
1584                    }
1585                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1586                    where
1587                        E: serde::de::Error,
1588                    {
1589                        use std::result::Result::Ok;
1590                        use std::string::ToString;
1591                        match value {
1592                            "enabled" => Ok(__FieldTag::__enabled),
1593                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1594                        }
1595                    }
1596                }
1597                deserializer.deserialize_identifier(Visitor)
1598            }
1599        }
1600        struct Visitor;
1601        impl<'de> serde::de::Visitor<'de> for Visitor {
1602            type Value = GitProxyConfig;
1603            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1604                formatter.write_str("struct GitProxyConfig")
1605            }
1606            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1607            where
1608                A: serde::de::MapAccess<'de>,
1609            {
1610                #[allow(unused_imports)]
1611                use serde::de::Error;
1612                use std::option::Option::Some;
1613                let mut fields = std::collections::HashSet::new();
1614                let mut result = Self::Value::new();
1615                while let Some(tag) = map.next_key::<__FieldTag>()? {
1616                    #[allow(clippy::match_single_binding)]
1617                    match tag {
1618                        __FieldTag::__enabled => {
1619                            if !fields.insert(__FieldTag::__enabled) {
1620                                return std::result::Result::Err(A::Error::duplicate_field(
1621                                    "multiple values for enabled",
1622                                ));
1623                            }
1624                            result.enabled = map
1625                                .next_value::<std::option::Option<bool>>()?
1626                                .unwrap_or_default();
1627                        }
1628                        __FieldTag::Unknown(key) => {
1629                            let value = map.next_value::<serde_json::Value>()?;
1630                            result._unknown_fields.insert(key, value);
1631                        }
1632                    }
1633                }
1634                std::result::Result::Ok(result)
1635            }
1636        }
1637        deserializer.deserialize_any(Visitor)
1638    }
1639}
1640
1641#[doc(hidden)]
1642impl serde::ser::Serialize for GitProxyConfig {
1643    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1644    where
1645        S: serde::ser::Serializer,
1646    {
1647        use serde::ser::SerializeMap;
1648        #[allow(unused_imports)]
1649        use std::option::Option::Some;
1650        let mut state = serializer.serialize_map(std::option::Option::None)?;
1651        if !wkt::internal::is_default(&self.enabled) {
1652            state.serialize_entry("enabled", &self.enabled)?;
1653        }
1654        if !self._unknown_fields.is_empty() {
1655            for (key, value) in self._unknown_fields.iter() {
1656                state.serialize_entry(key, &value)?;
1657            }
1658        }
1659        state.end()
1660    }
1661}
1662
1663/// Describes stage and necessary actions to be taken by the
1664/// user to complete the installation. Used for GitHub and GitHub Enterprise
1665/// based connections.
1666#[derive(Clone, Debug, Default, PartialEq)]
1667#[non_exhaustive]
1668pub struct InstallationState {
1669    /// Output only. Current step of the installation process.
1670    pub stage: crate::model::installation_state::Stage,
1671
1672    /// Output only. Message of what the user should do next to continue the
1673    /// installation. Empty string if the installation is already complete.
1674    pub message: std::string::String,
1675
1676    /// Output only. Link to follow for next action. Empty string if the
1677    /// installation is already complete.
1678    pub action_uri: std::string::String,
1679
1680    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1681}
1682
1683impl InstallationState {
1684    pub fn new() -> Self {
1685        std::default::Default::default()
1686    }
1687
1688    /// Sets the value of [stage][crate::model::InstallationState::stage].
1689    pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1690        mut self,
1691        v: T,
1692    ) -> Self {
1693        self.stage = v.into();
1694        self
1695    }
1696
1697    /// Sets the value of [message][crate::model::InstallationState::message].
1698    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1699        self.message = v.into();
1700        self
1701    }
1702
1703    /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
1704    pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1705        self.action_uri = v.into();
1706        self
1707    }
1708}
1709
1710impl wkt::message::Message for InstallationState {
1711    fn typename() -> &'static str {
1712        "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
1713    }
1714}
1715
1716#[doc(hidden)]
1717impl<'de> serde::de::Deserialize<'de> for InstallationState {
1718    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1719    where
1720        D: serde::Deserializer<'de>,
1721    {
1722        #[allow(non_camel_case_types)]
1723        #[doc(hidden)]
1724        #[derive(PartialEq, Eq, Hash)]
1725        enum __FieldTag {
1726            __stage,
1727            __message,
1728            __action_uri,
1729            Unknown(std::string::String),
1730        }
1731        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1732            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1733            where
1734                D: serde::Deserializer<'de>,
1735            {
1736                struct Visitor;
1737                impl<'de> serde::de::Visitor<'de> for Visitor {
1738                    type Value = __FieldTag;
1739                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1740                        formatter.write_str("a field name for InstallationState")
1741                    }
1742                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1743                    where
1744                        E: serde::de::Error,
1745                    {
1746                        use std::result::Result::Ok;
1747                        use std::string::ToString;
1748                        match value {
1749                            "stage" => Ok(__FieldTag::__stage),
1750                            "message" => Ok(__FieldTag::__message),
1751                            "actionUri" => Ok(__FieldTag::__action_uri),
1752                            "action_uri" => Ok(__FieldTag::__action_uri),
1753                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1754                        }
1755                    }
1756                }
1757                deserializer.deserialize_identifier(Visitor)
1758            }
1759        }
1760        struct Visitor;
1761        impl<'de> serde::de::Visitor<'de> for Visitor {
1762            type Value = InstallationState;
1763            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1764                formatter.write_str("struct InstallationState")
1765            }
1766            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1767            where
1768                A: serde::de::MapAccess<'de>,
1769            {
1770                #[allow(unused_imports)]
1771                use serde::de::Error;
1772                use std::option::Option::Some;
1773                let mut fields = std::collections::HashSet::new();
1774                let mut result = Self::Value::new();
1775                while let Some(tag) = map.next_key::<__FieldTag>()? {
1776                    #[allow(clippy::match_single_binding)]
1777                    match tag {
1778                        __FieldTag::__stage => {
1779                            if !fields.insert(__FieldTag::__stage) {
1780                                return std::result::Result::Err(A::Error::duplicate_field(
1781                                    "multiple values for stage",
1782                                ));
1783                            }
1784                            result.stage = map.next_value::<std::option::Option<crate::model::installation_state::Stage>>()?.unwrap_or_default();
1785                        }
1786                        __FieldTag::__message => {
1787                            if !fields.insert(__FieldTag::__message) {
1788                                return std::result::Result::Err(A::Error::duplicate_field(
1789                                    "multiple values for message",
1790                                ));
1791                            }
1792                            result.message = map
1793                                .next_value::<std::option::Option<std::string::String>>()?
1794                                .unwrap_or_default();
1795                        }
1796                        __FieldTag::__action_uri => {
1797                            if !fields.insert(__FieldTag::__action_uri) {
1798                                return std::result::Result::Err(A::Error::duplicate_field(
1799                                    "multiple values for action_uri",
1800                                ));
1801                            }
1802                            result.action_uri = map
1803                                .next_value::<std::option::Option<std::string::String>>()?
1804                                .unwrap_or_default();
1805                        }
1806                        __FieldTag::Unknown(key) => {
1807                            let value = map.next_value::<serde_json::Value>()?;
1808                            result._unknown_fields.insert(key, value);
1809                        }
1810                    }
1811                }
1812                std::result::Result::Ok(result)
1813            }
1814        }
1815        deserializer.deserialize_any(Visitor)
1816    }
1817}
1818
1819#[doc(hidden)]
1820impl serde::ser::Serialize for InstallationState {
1821    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1822    where
1823        S: serde::ser::Serializer,
1824    {
1825        use serde::ser::SerializeMap;
1826        #[allow(unused_imports)]
1827        use std::option::Option::Some;
1828        let mut state = serializer.serialize_map(std::option::Option::None)?;
1829        if !wkt::internal::is_default(&self.stage) {
1830            state.serialize_entry("stage", &self.stage)?;
1831        }
1832        if !self.message.is_empty() {
1833            state.serialize_entry("message", &self.message)?;
1834        }
1835        if !self.action_uri.is_empty() {
1836            state.serialize_entry("actionUri", &self.action_uri)?;
1837        }
1838        if !self._unknown_fields.is_empty() {
1839            for (key, value) in self._unknown_fields.iter() {
1840                state.serialize_entry(key, &value)?;
1841            }
1842        }
1843        state.end()
1844    }
1845}
1846
1847/// Defines additional types related to [InstallationState].
1848pub mod installation_state {
1849    #[allow(unused_imports)]
1850    use super::*;
1851
1852    /// Stage of the installation process.
1853    ///
1854    /// # Working with unknown values
1855    ///
1856    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1857    /// additional enum variants at any time. Adding new variants is not considered
1858    /// a breaking change. Applications should write their code in anticipation of:
1859    ///
1860    /// - New values appearing in future releases of the client library, **and**
1861    /// - New values received dynamically, without application changes.
1862    ///
1863    /// Please consult the [Working with enums] section in the user guide for some
1864    /// guidelines.
1865    ///
1866    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1867    #[derive(Clone, Debug, PartialEq)]
1868    #[non_exhaustive]
1869    pub enum Stage {
1870        /// No stage specified.
1871        Unspecified,
1872        /// Only for GitHub Enterprise. An App creation has been requested.
1873        /// The user needs to confirm the creation in their GitHub enterprise host.
1874        PendingCreateApp,
1875        /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
1876        PendingUserOauth,
1877        /// User needs to follow the link to install the GitHub (or Enterprise) App.
1878        PendingInstallApp,
1879        /// Installation process has been completed.
1880        Complete,
1881        /// If set, the enum was initialized with an unknown value.
1882        ///
1883        /// Applications can examine the value using [Stage::value] or
1884        /// [Stage::name].
1885        UnknownValue(stage::UnknownValue),
1886    }
1887
1888    #[doc(hidden)]
1889    pub mod stage {
1890        #[allow(unused_imports)]
1891        use super::*;
1892        #[derive(Clone, Debug, PartialEq)]
1893        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1894    }
1895
1896    impl Stage {
1897        /// Gets the enum value.
1898        ///
1899        /// Returns `None` if the enum contains an unknown value deserialized from
1900        /// the string representation of enums.
1901        pub fn value(&self) -> std::option::Option<i32> {
1902            match self {
1903                Self::Unspecified => std::option::Option::Some(0),
1904                Self::PendingCreateApp => std::option::Option::Some(1),
1905                Self::PendingUserOauth => std::option::Option::Some(2),
1906                Self::PendingInstallApp => std::option::Option::Some(3),
1907                Self::Complete => std::option::Option::Some(10),
1908                Self::UnknownValue(u) => u.0.value(),
1909            }
1910        }
1911
1912        /// Gets the enum value as a string.
1913        ///
1914        /// Returns `None` if the enum contains an unknown value deserialized from
1915        /// the integer representation of enums.
1916        pub fn name(&self) -> std::option::Option<&str> {
1917            match self {
1918                Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1919                Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1920                Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1921                Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1922                Self::Complete => std::option::Option::Some("COMPLETE"),
1923                Self::UnknownValue(u) => u.0.name(),
1924            }
1925        }
1926    }
1927
1928    impl std::default::Default for Stage {
1929        fn default() -> Self {
1930            use std::convert::From;
1931            Self::from(0)
1932        }
1933    }
1934
1935    impl std::fmt::Display for Stage {
1936        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1937            wkt::internal::display_enum(f, self.name(), self.value())
1938        }
1939    }
1940
1941    impl std::convert::From<i32> for Stage {
1942        fn from(value: i32) -> Self {
1943            match value {
1944                0 => Self::Unspecified,
1945                1 => Self::PendingCreateApp,
1946                2 => Self::PendingUserOauth,
1947                3 => Self::PendingInstallApp,
1948                10 => Self::Complete,
1949                _ => Self::UnknownValue(stage::UnknownValue(
1950                    wkt::internal::UnknownEnumValue::Integer(value),
1951                )),
1952            }
1953        }
1954    }
1955
1956    impl std::convert::From<&str> for Stage {
1957        fn from(value: &str) -> Self {
1958            use std::string::ToString;
1959            match value {
1960                "STAGE_UNSPECIFIED" => Self::Unspecified,
1961                "PENDING_CREATE_APP" => Self::PendingCreateApp,
1962                "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1963                "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1964                "COMPLETE" => Self::Complete,
1965                _ => Self::UnknownValue(stage::UnknownValue(
1966                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1967                )),
1968            }
1969        }
1970    }
1971
1972    impl serde::ser::Serialize for Stage {
1973        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1974        where
1975            S: serde::Serializer,
1976        {
1977            match self {
1978                Self::Unspecified => serializer.serialize_i32(0),
1979                Self::PendingCreateApp => serializer.serialize_i32(1),
1980                Self::PendingUserOauth => serializer.serialize_i32(2),
1981                Self::PendingInstallApp => serializer.serialize_i32(3),
1982                Self::Complete => serializer.serialize_i32(10),
1983                Self::UnknownValue(u) => u.0.serialize(serializer),
1984            }
1985        }
1986    }
1987
1988    impl<'de> serde::de::Deserialize<'de> for Stage {
1989        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1990        where
1991            D: serde::Deserializer<'de>,
1992        {
1993            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1994                ".google.cloud.developerconnect.v1.InstallationState.Stage",
1995            ))
1996        }
1997    }
1998}
1999
2000/// Configuration for connections to github.com.
2001#[derive(Clone, Debug, Default, PartialEq)]
2002#[non_exhaustive]
2003pub struct GitHubConfig {
2004    /// Required. Immutable. The GitHub Application that was installed to the
2005    /// GitHub user or organization.
2006    pub github_app: crate::model::git_hub_config::GitHubApp,
2007
2008    /// Optional. OAuth credential of the account that authorized the GitHub App.
2009    /// It is recommended to use a robot account instead of a human user account.
2010    /// The OAuth token must be tied to the GitHub App of this config.
2011    pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
2012
2013    /// Optional. GitHub App installation id.
2014    pub app_installation_id: i64,
2015
2016    /// Output only. The URI to navigate to in order to manage the installation
2017    /// associated with this GitHubConfig.
2018    pub installation_uri: std::string::String,
2019
2020    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2021}
2022
2023impl GitHubConfig {
2024    pub fn new() -> Self {
2025        std::default::Default::default()
2026    }
2027
2028    /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
2029    pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
2030        mut self,
2031        v: T,
2032    ) -> Self {
2033        self.github_app = v.into();
2034        self
2035    }
2036
2037    /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
2038    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2039    where
2040        T: std::convert::Into<crate::model::OAuthCredential>,
2041    {
2042        self.authorizer_credential = std::option::Option::Some(v.into());
2043        self
2044    }
2045
2046    /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
2047    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2048    where
2049        T: std::convert::Into<crate::model::OAuthCredential>,
2050    {
2051        self.authorizer_credential = v.map(|x| x.into());
2052        self
2053    }
2054
2055    /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
2056    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2057        self.app_installation_id = v.into();
2058        self
2059    }
2060
2061    /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
2062    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2063        mut self,
2064        v: T,
2065    ) -> Self {
2066        self.installation_uri = v.into();
2067        self
2068    }
2069}
2070
2071impl wkt::message::Message for GitHubConfig {
2072    fn typename() -> &'static str {
2073        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
2074    }
2075}
2076
2077#[doc(hidden)]
2078impl<'de> serde::de::Deserialize<'de> for GitHubConfig {
2079    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2080    where
2081        D: serde::Deserializer<'de>,
2082    {
2083        #[allow(non_camel_case_types)]
2084        #[doc(hidden)]
2085        #[derive(PartialEq, Eq, Hash)]
2086        enum __FieldTag {
2087            __github_app,
2088            __authorizer_credential,
2089            __app_installation_id,
2090            __installation_uri,
2091            Unknown(std::string::String),
2092        }
2093        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2094            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2095            where
2096                D: serde::Deserializer<'de>,
2097            {
2098                struct Visitor;
2099                impl<'de> serde::de::Visitor<'de> for Visitor {
2100                    type Value = __FieldTag;
2101                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2102                        formatter.write_str("a field name for GitHubConfig")
2103                    }
2104                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2105                    where
2106                        E: serde::de::Error,
2107                    {
2108                        use std::result::Result::Ok;
2109                        use std::string::ToString;
2110                        match value {
2111                            "githubApp" => Ok(__FieldTag::__github_app),
2112                            "github_app" => Ok(__FieldTag::__github_app),
2113                            "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
2114                            "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
2115                            "appInstallationId" => Ok(__FieldTag::__app_installation_id),
2116                            "app_installation_id" => Ok(__FieldTag::__app_installation_id),
2117                            "installationUri" => Ok(__FieldTag::__installation_uri),
2118                            "installation_uri" => Ok(__FieldTag::__installation_uri),
2119                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2120                        }
2121                    }
2122                }
2123                deserializer.deserialize_identifier(Visitor)
2124            }
2125        }
2126        struct Visitor;
2127        impl<'de> serde::de::Visitor<'de> for Visitor {
2128            type Value = GitHubConfig;
2129            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2130                formatter.write_str("struct GitHubConfig")
2131            }
2132            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2133            where
2134                A: serde::de::MapAccess<'de>,
2135            {
2136                #[allow(unused_imports)]
2137                use serde::de::Error;
2138                use std::option::Option::Some;
2139                let mut fields = std::collections::HashSet::new();
2140                let mut result = Self::Value::new();
2141                while let Some(tag) = map.next_key::<__FieldTag>()? {
2142                    #[allow(clippy::match_single_binding)]
2143                    match tag {
2144                        __FieldTag::__github_app => {
2145                            if !fields.insert(__FieldTag::__github_app) {
2146                                return std::result::Result::Err(A::Error::duplicate_field(
2147                                    "multiple values for github_app",
2148                                ));
2149                            }
2150                            result.github_app = map.next_value::<std::option::Option<crate::model::git_hub_config::GitHubApp>>()?.unwrap_or_default();
2151                        }
2152                        __FieldTag::__authorizer_credential => {
2153                            if !fields.insert(__FieldTag::__authorizer_credential) {
2154                                return std::result::Result::Err(A::Error::duplicate_field(
2155                                    "multiple values for authorizer_credential",
2156                                ));
2157                            }
2158                            result.authorizer_credential = map
2159                                .next_value::<std::option::Option<crate::model::OAuthCredential>>(
2160                                )?;
2161                        }
2162                        __FieldTag::__app_installation_id => {
2163                            if !fields.insert(__FieldTag::__app_installation_id) {
2164                                return std::result::Result::Err(A::Error::duplicate_field(
2165                                    "multiple values for app_installation_id",
2166                                ));
2167                            }
2168                            struct __With(std::option::Option<i64>);
2169                            impl<'de> serde::de::Deserialize<'de> for __With {
2170                                fn deserialize<D>(
2171                                    deserializer: D,
2172                                ) -> std::result::Result<Self, D::Error>
2173                                where
2174                                    D: serde::de::Deserializer<'de>,
2175                                {
2176                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2177                                }
2178                            }
2179                            result.app_installation_id =
2180                                map.next_value::<__With>()?.0.unwrap_or_default();
2181                        }
2182                        __FieldTag::__installation_uri => {
2183                            if !fields.insert(__FieldTag::__installation_uri) {
2184                                return std::result::Result::Err(A::Error::duplicate_field(
2185                                    "multiple values for installation_uri",
2186                                ));
2187                            }
2188                            result.installation_uri = map
2189                                .next_value::<std::option::Option<std::string::String>>()?
2190                                .unwrap_or_default();
2191                        }
2192                        __FieldTag::Unknown(key) => {
2193                            let value = map.next_value::<serde_json::Value>()?;
2194                            result._unknown_fields.insert(key, value);
2195                        }
2196                    }
2197                }
2198                std::result::Result::Ok(result)
2199            }
2200        }
2201        deserializer.deserialize_any(Visitor)
2202    }
2203}
2204
2205#[doc(hidden)]
2206impl serde::ser::Serialize for GitHubConfig {
2207    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2208    where
2209        S: serde::ser::Serializer,
2210    {
2211        use serde::ser::SerializeMap;
2212        #[allow(unused_imports)]
2213        use std::option::Option::Some;
2214        let mut state = serializer.serialize_map(std::option::Option::None)?;
2215        if !wkt::internal::is_default(&self.github_app) {
2216            state.serialize_entry("githubApp", &self.github_app)?;
2217        }
2218        if self.authorizer_credential.is_some() {
2219            state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
2220        }
2221        if !wkt::internal::is_default(&self.app_installation_id) {
2222            struct __With<'a>(&'a i64);
2223            impl<'a> serde::ser::Serialize for __With<'a> {
2224                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2225                where
2226                    S: serde::ser::Serializer,
2227                {
2228                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2229                }
2230            }
2231            state.serialize_entry("appInstallationId", &__With(&self.app_installation_id))?;
2232        }
2233        if !self.installation_uri.is_empty() {
2234            state.serialize_entry("installationUri", &self.installation_uri)?;
2235        }
2236        if !self._unknown_fields.is_empty() {
2237            for (key, value) in self._unknown_fields.iter() {
2238                state.serialize_entry(key, &value)?;
2239            }
2240        }
2241        state.end()
2242    }
2243}
2244
2245/// Defines additional types related to [GitHubConfig].
2246pub mod git_hub_config {
2247    #[allow(unused_imports)]
2248    use super::*;
2249
2250    /// Represents the various GitHub Applications that can be installed to a
2251    /// GitHub user or organization and used with Developer Connect.
2252    ///
2253    /// # Working with unknown values
2254    ///
2255    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2256    /// additional enum variants at any time. Adding new variants is not considered
2257    /// a breaking change. Applications should write their code in anticipation of:
2258    ///
2259    /// - New values appearing in future releases of the client library, **and**
2260    /// - New values received dynamically, without application changes.
2261    ///
2262    /// Please consult the [Working with enums] section in the user guide for some
2263    /// guidelines.
2264    ///
2265    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2266    #[derive(Clone, Debug, PartialEq)]
2267    #[non_exhaustive]
2268    pub enum GitHubApp {
2269        /// GitHub App not specified.
2270        Unspecified,
2271        /// The Developer Connect GitHub Application.
2272        DeveloperConnect,
2273        /// The Firebase GitHub Application.
2274        Firebase,
2275        /// If set, the enum was initialized with an unknown value.
2276        ///
2277        /// Applications can examine the value using [GitHubApp::value] or
2278        /// [GitHubApp::name].
2279        UnknownValue(git_hub_app::UnknownValue),
2280    }
2281
2282    #[doc(hidden)]
2283    pub mod git_hub_app {
2284        #[allow(unused_imports)]
2285        use super::*;
2286        #[derive(Clone, Debug, PartialEq)]
2287        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2288    }
2289
2290    impl GitHubApp {
2291        /// Gets the enum value.
2292        ///
2293        /// Returns `None` if the enum contains an unknown value deserialized from
2294        /// the string representation of enums.
2295        pub fn value(&self) -> std::option::Option<i32> {
2296            match self {
2297                Self::Unspecified => std::option::Option::Some(0),
2298                Self::DeveloperConnect => std::option::Option::Some(1),
2299                Self::Firebase => std::option::Option::Some(2),
2300                Self::UnknownValue(u) => u.0.value(),
2301            }
2302        }
2303
2304        /// Gets the enum value as a string.
2305        ///
2306        /// Returns `None` if the enum contains an unknown value deserialized from
2307        /// the integer representation of enums.
2308        pub fn name(&self) -> std::option::Option<&str> {
2309            match self {
2310                Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
2311                Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
2312                Self::Firebase => std::option::Option::Some("FIREBASE"),
2313                Self::UnknownValue(u) => u.0.name(),
2314            }
2315        }
2316    }
2317
2318    impl std::default::Default for GitHubApp {
2319        fn default() -> Self {
2320            use std::convert::From;
2321            Self::from(0)
2322        }
2323    }
2324
2325    impl std::fmt::Display for GitHubApp {
2326        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2327            wkt::internal::display_enum(f, self.name(), self.value())
2328        }
2329    }
2330
2331    impl std::convert::From<i32> for GitHubApp {
2332        fn from(value: i32) -> Self {
2333            match value {
2334                0 => Self::Unspecified,
2335                1 => Self::DeveloperConnect,
2336                2 => Self::Firebase,
2337                _ => Self::UnknownValue(git_hub_app::UnknownValue(
2338                    wkt::internal::UnknownEnumValue::Integer(value),
2339                )),
2340            }
2341        }
2342    }
2343
2344    impl std::convert::From<&str> for GitHubApp {
2345        fn from(value: &str) -> Self {
2346            use std::string::ToString;
2347            match value {
2348                "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
2349                "DEVELOPER_CONNECT" => Self::DeveloperConnect,
2350                "FIREBASE" => Self::Firebase,
2351                _ => Self::UnknownValue(git_hub_app::UnknownValue(
2352                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2353                )),
2354            }
2355        }
2356    }
2357
2358    impl serde::ser::Serialize for GitHubApp {
2359        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2360        where
2361            S: serde::Serializer,
2362        {
2363            match self {
2364                Self::Unspecified => serializer.serialize_i32(0),
2365                Self::DeveloperConnect => serializer.serialize_i32(1),
2366                Self::Firebase => serializer.serialize_i32(2),
2367                Self::UnknownValue(u) => u.0.serialize(serializer),
2368            }
2369        }
2370    }
2371
2372    impl<'de> serde::de::Deserialize<'de> for GitHubApp {
2373        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2374        where
2375            D: serde::Deserializer<'de>,
2376        {
2377            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
2378                ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
2379            ))
2380        }
2381    }
2382}
2383
2384/// Configuration for connections to an instance of GitHub Enterprise.
2385#[derive(Clone, Debug, Default, PartialEq)]
2386#[non_exhaustive]
2387pub struct GitHubEnterpriseConfig {
2388    /// Required. The URI of the GitHub Enterprise host this connection is for.
2389    pub host_uri: std::string::String,
2390
2391    /// Optional. ID of the GitHub App created from the manifest.
2392    pub app_id: i64,
2393
2394    /// Output only. The URL-friendly name of the GitHub App.
2395    pub app_slug: std::string::String,
2396
2397    /// Optional. SecretManager resource containing the private key of the GitHub
2398    /// App, formatted as `projects/*/secrets/*/versions/*`.
2399    pub private_key_secret_version: std::string::String,
2400
2401    /// Optional. SecretManager resource containing the webhook secret of the
2402    /// GitHub App, formatted as `projects/*/secrets/*/versions/*`.
2403    pub webhook_secret_secret_version: std::string::String,
2404
2405    /// Optional. ID of the installation of the GitHub App.
2406    pub app_installation_id: i64,
2407
2408    /// Output only. The URI to navigate to in order to manage the installation
2409    /// associated with this GitHubEnterpriseConfig.
2410    pub installation_uri: std::string::String,
2411
2412    /// Optional. Configuration for using Service Directory to privately connect to
2413    /// a GitHub Enterprise server. This should only be set if the GitHub
2414    /// Enterprise server is hosted on-premises and not reachable by public
2415    /// internet. If this field is left empty, calls to the GitHub Enterprise
2416    /// server will be made over the public internet.
2417    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2418
2419    /// Output only. GitHub Enterprise version installed at the host_uri.
2420    pub server_version: std::string::String,
2421
2422    /// Optional. SSL certificate to use for requests to GitHub Enterprise.
2423    pub ssl_ca_certificate: std::string::String,
2424
2425    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2426}
2427
2428impl GitHubEnterpriseConfig {
2429    pub fn new() -> Self {
2430        std::default::Default::default()
2431    }
2432
2433    /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
2434    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2435        self.host_uri = v.into();
2436        self
2437    }
2438
2439    /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
2440    pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2441        self.app_id = v.into();
2442        self
2443    }
2444
2445    /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
2446    pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2447        self.app_slug = v.into();
2448        self
2449    }
2450
2451    /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
2452    pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
2453        mut self,
2454        v: T,
2455    ) -> Self {
2456        self.private_key_secret_version = v.into();
2457        self
2458    }
2459
2460    /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
2461    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2462        mut self,
2463        v: T,
2464    ) -> Self {
2465        self.webhook_secret_secret_version = v.into();
2466        self
2467    }
2468
2469    /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
2470    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2471        self.app_installation_id = v.into();
2472        self
2473    }
2474
2475    /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
2476    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2477        mut self,
2478        v: T,
2479    ) -> Self {
2480        self.installation_uri = v.into();
2481        self
2482    }
2483
2484    /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2485    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2486    where
2487        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2488    {
2489        self.service_directory_config = std::option::Option::Some(v.into());
2490        self
2491    }
2492
2493    /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2494    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2495    where
2496        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2497    {
2498        self.service_directory_config = v.map(|x| x.into());
2499        self
2500    }
2501
2502    /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
2503    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2504        self.server_version = v.into();
2505        self
2506    }
2507
2508    /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
2509    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2510        mut self,
2511        v: T,
2512    ) -> Self {
2513        self.ssl_ca_certificate = v.into();
2514        self
2515    }
2516}
2517
2518impl wkt::message::Message for GitHubEnterpriseConfig {
2519    fn typename() -> &'static str {
2520        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
2521    }
2522}
2523
2524#[doc(hidden)]
2525impl<'de> serde::de::Deserialize<'de> for GitHubEnterpriseConfig {
2526    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2527    where
2528        D: serde::Deserializer<'de>,
2529    {
2530        #[allow(non_camel_case_types)]
2531        #[doc(hidden)]
2532        #[derive(PartialEq, Eq, Hash)]
2533        enum __FieldTag {
2534            __host_uri,
2535            __app_id,
2536            __app_slug,
2537            __private_key_secret_version,
2538            __webhook_secret_secret_version,
2539            __app_installation_id,
2540            __installation_uri,
2541            __service_directory_config,
2542            __server_version,
2543            __ssl_ca_certificate,
2544            Unknown(std::string::String),
2545        }
2546        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2547            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2548            where
2549                D: serde::Deserializer<'de>,
2550            {
2551                struct Visitor;
2552                impl<'de> serde::de::Visitor<'de> for Visitor {
2553                    type Value = __FieldTag;
2554                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2555                        formatter.write_str("a field name for GitHubEnterpriseConfig")
2556                    }
2557                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2558                    where
2559                        E: serde::de::Error,
2560                    {
2561                        use std::result::Result::Ok;
2562                        use std::string::ToString;
2563                        match value {
2564                            "hostUri" => Ok(__FieldTag::__host_uri),
2565                            "host_uri" => Ok(__FieldTag::__host_uri),
2566                            "appId" => Ok(__FieldTag::__app_id),
2567                            "app_id" => Ok(__FieldTag::__app_id),
2568                            "appSlug" => Ok(__FieldTag::__app_slug),
2569                            "app_slug" => Ok(__FieldTag::__app_slug),
2570                            "privateKeySecretVersion" => {
2571                                Ok(__FieldTag::__private_key_secret_version)
2572                            }
2573                            "private_key_secret_version" => {
2574                                Ok(__FieldTag::__private_key_secret_version)
2575                            }
2576                            "webhookSecretSecretVersion" => {
2577                                Ok(__FieldTag::__webhook_secret_secret_version)
2578                            }
2579                            "webhook_secret_secret_version" => {
2580                                Ok(__FieldTag::__webhook_secret_secret_version)
2581                            }
2582                            "appInstallationId" => Ok(__FieldTag::__app_installation_id),
2583                            "app_installation_id" => Ok(__FieldTag::__app_installation_id),
2584                            "installationUri" => Ok(__FieldTag::__installation_uri),
2585                            "installation_uri" => Ok(__FieldTag::__installation_uri),
2586                            "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
2587                            "service_directory_config" => {
2588                                Ok(__FieldTag::__service_directory_config)
2589                            }
2590                            "serverVersion" => Ok(__FieldTag::__server_version),
2591                            "server_version" => Ok(__FieldTag::__server_version),
2592                            "sslCaCertificate" => Ok(__FieldTag::__ssl_ca_certificate),
2593                            "ssl_ca_certificate" => Ok(__FieldTag::__ssl_ca_certificate),
2594                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2595                        }
2596                    }
2597                }
2598                deserializer.deserialize_identifier(Visitor)
2599            }
2600        }
2601        struct Visitor;
2602        impl<'de> serde::de::Visitor<'de> for Visitor {
2603            type Value = GitHubEnterpriseConfig;
2604            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2605                formatter.write_str("struct GitHubEnterpriseConfig")
2606            }
2607            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2608            where
2609                A: serde::de::MapAccess<'de>,
2610            {
2611                #[allow(unused_imports)]
2612                use serde::de::Error;
2613                use std::option::Option::Some;
2614                let mut fields = std::collections::HashSet::new();
2615                let mut result = Self::Value::new();
2616                while let Some(tag) = map.next_key::<__FieldTag>()? {
2617                    #[allow(clippy::match_single_binding)]
2618                    match tag {
2619                        __FieldTag::__host_uri => {
2620                            if !fields.insert(__FieldTag::__host_uri) {
2621                                return std::result::Result::Err(A::Error::duplicate_field(
2622                                    "multiple values for host_uri",
2623                                ));
2624                            }
2625                            result.host_uri = map
2626                                .next_value::<std::option::Option<std::string::String>>()?
2627                                .unwrap_or_default();
2628                        }
2629                        __FieldTag::__app_id => {
2630                            if !fields.insert(__FieldTag::__app_id) {
2631                                return std::result::Result::Err(A::Error::duplicate_field(
2632                                    "multiple values for app_id",
2633                                ));
2634                            }
2635                            struct __With(std::option::Option<i64>);
2636                            impl<'de> serde::de::Deserialize<'de> for __With {
2637                                fn deserialize<D>(
2638                                    deserializer: D,
2639                                ) -> std::result::Result<Self, D::Error>
2640                                where
2641                                    D: serde::de::Deserializer<'de>,
2642                                {
2643                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2644                                }
2645                            }
2646                            result.app_id = map.next_value::<__With>()?.0.unwrap_or_default();
2647                        }
2648                        __FieldTag::__app_slug => {
2649                            if !fields.insert(__FieldTag::__app_slug) {
2650                                return std::result::Result::Err(A::Error::duplicate_field(
2651                                    "multiple values for app_slug",
2652                                ));
2653                            }
2654                            result.app_slug = map
2655                                .next_value::<std::option::Option<std::string::String>>()?
2656                                .unwrap_or_default();
2657                        }
2658                        __FieldTag::__private_key_secret_version => {
2659                            if !fields.insert(__FieldTag::__private_key_secret_version) {
2660                                return std::result::Result::Err(A::Error::duplicate_field(
2661                                    "multiple values for private_key_secret_version",
2662                                ));
2663                            }
2664                            result.private_key_secret_version = map
2665                                .next_value::<std::option::Option<std::string::String>>()?
2666                                .unwrap_or_default();
2667                        }
2668                        __FieldTag::__webhook_secret_secret_version => {
2669                            if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
2670                                return std::result::Result::Err(A::Error::duplicate_field(
2671                                    "multiple values for webhook_secret_secret_version",
2672                                ));
2673                            }
2674                            result.webhook_secret_secret_version = map
2675                                .next_value::<std::option::Option<std::string::String>>()?
2676                                .unwrap_or_default();
2677                        }
2678                        __FieldTag::__app_installation_id => {
2679                            if !fields.insert(__FieldTag::__app_installation_id) {
2680                                return std::result::Result::Err(A::Error::duplicate_field(
2681                                    "multiple values for app_installation_id",
2682                                ));
2683                            }
2684                            struct __With(std::option::Option<i64>);
2685                            impl<'de> serde::de::Deserialize<'de> for __With {
2686                                fn deserialize<D>(
2687                                    deserializer: D,
2688                                ) -> std::result::Result<Self, D::Error>
2689                                where
2690                                    D: serde::de::Deserializer<'de>,
2691                                {
2692                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2693                                }
2694                            }
2695                            result.app_installation_id =
2696                                map.next_value::<__With>()?.0.unwrap_or_default();
2697                        }
2698                        __FieldTag::__installation_uri => {
2699                            if !fields.insert(__FieldTag::__installation_uri) {
2700                                return std::result::Result::Err(A::Error::duplicate_field(
2701                                    "multiple values for installation_uri",
2702                                ));
2703                            }
2704                            result.installation_uri = map
2705                                .next_value::<std::option::Option<std::string::String>>()?
2706                                .unwrap_or_default();
2707                        }
2708                        __FieldTag::__service_directory_config => {
2709                            if !fields.insert(__FieldTag::__service_directory_config) {
2710                                return std::result::Result::Err(A::Error::duplicate_field(
2711                                    "multiple values for service_directory_config",
2712                                ));
2713                            }
2714                            result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
2715                                ;
2716                        }
2717                        __FieldTag::__server_version => {
2718                            if !fields.insert(__FieldTag::__server_version) {
2719                                return std::result::Result::Err(A::Error::duplicate_field(
2720                                    "multiple values for server_version",
2721                                ));
2722                            }
2723                            result.server_version = map
2724                                .next_value::<std::option::Option<std::string::String>>()?
2725                                .unwrap_or_default();
2726                        }
2727                        __FieldTag::__ssl_ca_certificate => {
2728                            if !fields.insert(__FieldTag::__ssl_ca_certificate) {
2729                                return std::result::Result::Err(A::Error::duplicate_field(
2730                                    "multiple values for ssl_ca_certificate",
2731                                ));
2732                            }
2733                            result.ssl_ca_certificate = map
2734                                .next_value::<std::option::Option<std::string::String>>()?
2735                                .unwrap_or_default();
2736                        }
2737                        __FieldTag::Unknown(key) => {
2738                            let value = map.next_value::<serde_json::Value>()?;
2739                            result._unknown_fields.insert(key, value);
2740                        }
2741                    }
2742                }
2743                std::result::Result::Ok(result)
2744            }
2745        }
2746        deserializer.deserialize_any(Visitor)
2747    }
2748}
2749
2750#[doc(hidden)]
2751impl serde::ser::Serialize for GitHubEnterpriseConfig {
2752    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2753    where
2754        S: serde::ser::Serializer,
2755    {
2756        use serde::ser::SerializeMap;
2757        #[allow(unused_imports)]
2758        use std::option::Option::Some;
2759        let mut state = serializer.serialize_map(std::option::Option::None)?;
2760        if !self.host_uri.is_empty() {
2761            state.serialize_entry("hostUri", &self.host_uri)?;
2762        }
2763        if !wkt::internal::is_default(&self.app_id) {
2764            struct __With<'a>(&'a i64);
2765            impl<'a> serde::ser::Serialize for __With<'a> {
2766                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2767                where
2768                    S: serde::ser::Serializer,
2769                {
2770                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2771                }
2772            }
2773            state.serialize_entry("appId", &__With(&self.app_id))?;
2774        }
2775        if !self.app_slug.is_empty() {
2776            state.serialize_entry("appSlug", &self.app_slug)?;
2777        }
2778        if !self.private_key_secret_version.is_empty() {
2779            state.serialize_entry("privateKeySecretVersion", &self.private_key_secret_version)?;
2780        }
2781        if !self.webhook_secret_secret_version.is_empty() {
2782            state.serialize_entry(
2783                "webhookSecretSecretVersion",
2784                &self.webhook_secret_secret_version,
2785            )?;
2786        }
2787        if !wkt::internal::is_default(&self.app_installation_id) {
2788            struct __With<'a>(&'a i64);
2789            impl<'a> serde::ser::Serialize for __With<'a> {
2790                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2791                where
2792                    S: serde::ser::Serializer,
2793                {
2794                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2795                }
2796            }
2797            state.serialize_entry("appInstallationId", &__With(&self.app_installation_id))?;
2798        }
2799        if !self.installation_uri.is_empty() {
2800            state.serialize_entry("installationUri", &self.installation_uri)?;
2801        }
2802        if self.service_directory_config.is_some() {
2803            state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
2804        }
2805        if !self.server_version.is_empty() {
2806            state.serialize_entry("serverVersion", &self.server_version)?;
2807        }
2808        if !self.ssl_ca_certificate.is_empty() {
2809            state.serialize_entry("sslCaCertificate", &self.ssl_ca_certificate)?;
2810        }
2811        if !self._unknown_fields.is_empty() {
2812            for (key, value) in self._unknown_fields.iter() {
2813                state.serialize_entry(key, &value)?;
2814            }
2815        }
2816        state.end()
2817    }
2818}
2819
2820/// ServiceDirectoryConfig represents Service Directory configuration for a
2821/// connection.
2822#[derive(Clone, Debug, Default, PartialEq)]
2823#[non_exhaustive]
2824pub struct ServiceDirectoryConfig {
2825    /// Required. The Service Directory service name.
2826    /// Format:
2827    /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
2828    pub service: std::string::String,
2829
2830    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2831}
2832
2833impl ServiceDirectoryConfig {
2834    pub fn new() -> Self {
2835        std::default::Default::default()
2836    }
2837
2838    /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
2839    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2840        self.service = v.into();
2841        self
2842    }
2843}
2844
2845impl wkt::message::Message for ServiceDirectoryConfig {
2846    fn typename() -> &'static str {
2847        "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
2848    }
2849}
2850
2851#[doc(hidden)]
2852impl<'de> serde::de::Deserialize<'de> for ServiceDirectoryConfig {
2853    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2854    where
2855        D: serde::Deserializer<'de>,
2856    {
2857        #[allow(non_camel_case_types)]
2858        #[doc(hidden)]
2859        #[derive(PartialEq, Eq, Hash)]
2860        enum __FieldTag {
2861            __service,
2862            Unknown(std::string::String),
2863        }
2864        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2865            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2866            where
2867                D: serde::Deserializer<'de>,
2868            {
2869                struct Visitor;
2870                impl<'de> serde::de::Visitor<'de> for Visitor {
2871                    type Value = __FieldTag;
2872                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2873                        formatter.write_str("a field name for ServiceDirectoryConfig")
2874                    }
2875                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2876                    where
2877                        E: serde::de::Error,
2878                    {
2879                        use std::result::Result::Ok;
2880                        use std::string::ToString;
2881                        match value {
2882                            "service" => Ok(__FieldTag::__service),
2883                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2884                        }
2885                    }
2886                }
2887                deserializer.deserialize_identifier(Visitor)
2888            }
2889        }
2890        struct Visitor;
2891        impl<'de> serde::de::Visitor<'de> for Visitor {
2892            type Value = ServiceDirectoryConfig;
2893            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2894                formatter.write_str("struct ServiceDirectoryConfig")
2895            }
2896            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2897            where
2898                A: serde::de::MapAccess<'de>,
2899            {
2900                #[allow(unused_imports)]
2901                use serde::de::Error;
2902                use std::option::Option::Some;
2903                let mut fields = std::collections::HashSet::new();
2904                let mut result = Self::Value::new();
2905                while let Some(tag) = map.next_key::<__FieldTag>()? {
2906                    #[allow(clippy::match_single_binding)]
2907                    match tag {
2908                        __FieldTag::__service => {
2909                            if !fields.insert(__FieldTag::__service) {
2910                                return std::result::Result::Err(A::Error::duplicate_field(
2911                                    "multiple values for service",
2912                                ));
2913                            }
2914                            result.service = map
2915                                .next_value::<std::option::Option<std::string::String>>()?
2916                                .unwrap_or_default();
2917                        }
2918                        __FieldTag::Unknown(key) => {
2919                            let value = map.next_value::<serde_json::Value>()?;
2920                            result._unknown_fields.insert(key, value);
2921                        }
2922                    }
2923                }
2924                std::result::Result::Ok(result)
2925            }
2926        }
2927        deserializer.deserialize_any(Visitor)
2928    }
2929}
2930
2931#[doc(hidden)]
2932impl serde::ser::Serialize for ServiceDirectoryConfig {
2933    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2934    where
2935        S: serde::ser::Serializer,
2936    {
2937        use serde::ser::SerializeMap;
2938        #[allow(unused_imports)]
2939        use std::option::Option::Some;
2940        let mut state = serializer.serialize_map(std::option::Option::None)?;
2941        if !self.service.is_empty() {
2942            state.serialize_entry("service", &self.service)?;
2943        }
2944        if !self._unknown_fields.is_empty() {
2945            for (key, value) in self._unknown_fields.iter() {
2946                state.serialize_entry(key, &value)?;
2947            }
2948        }
2949        state.end()
2950    }
2951}
2952
2953/// Represents an OAuth token of the account that authorized the Connection,
2954/// and associated metadata.
2955#[derive(Clone, Debug, Default, PartialEq)]
2956#[non_exhaustive]
2957pub struct OAuthCredential {
2958    /// Required. A SecretManager resource containing the OAuth token that
2959    /// authorizes the connection. Format: `projects/*/secrets/*/versions/*`.
2960    pub oauth_token_secret_version: std::string::String,
2961
2962    /// Output only. The username associated with this token.
2963    pub username: std::string::String,
2964
2965    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2966}
2967
2968impl OAuthCredential {
2969    pub fn new() -> Self {
2970        std::default::Default::default()
2971    }
2972
2973    /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
2974    pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
2975        mut self,
2976        v: T,
2977    ) -> Self {
2978        self.oauth_token_secret_version = v.into();
2979        self
2980    }
2981
2982    /// Sets the value of [username][crate::model::OAuthCredential::username].
2983    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2984        self.username = v.into();
2985        self
2986    }
2987}
2988
2989impl wkt::message::Message for OAuthCredential {
2990    fn typename() -> &'static str {
2991        "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
2992    }
2993}
2994
2995#[doc(hidden)]
2996impl<'de> serde::de::Deserialize<'de> for OAuthCredential {
2997    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2998    where
2999        D: serde::Deserializer<'de>,
3000    {
3001        #[allow(non_camel_case_types)]
3002        #[doc(hidden)]
3003        #[derive(PartialEq, Eq, Hash)]
3004        enum __FieldTag {
3005            __oauth_token_secret_version,
3006            __username,
3007            Unknown(std::string::String),
3008        }
3009        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3010            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3011            where
3012                D: serde::Deserializer<'de>,
3013            {
3014                struct Visitor;
3015                impl<'de> serde::de::Visitor<'de> for Visitor {
3016                    type Value = __FieldTag;
3017                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3018                        formatter.write_str("a field name for OAuthCredential")
3019                    }
3020                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3021                    where
3022                        E: serde::de::Error,
3023                    {
3024                        use std::result::Result::Ok;
3025                        use std::string::ToString;
3026                        match value {
3027                            "oauthTokenSecretVersion" => {
3028                                Ok(__FieldTag::__oauth_token_secret_version)
3029                            }
3030                            "oauth_token_secret_version" => {
3031                                Ok(__FieldTag::__oauth_token_secret_version)
3032                            }
3033                            "username" => Ok(__FieldTag::__username),
3034                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3035                        }
3036                    }
3037                }
3038                deserializer.deserialize_identifier(Visitor)
3039            }
3040        }
3041        struct Visitor;
3042        impl<'de> serde::de::Visitor<'de> for Visitor {
3043            type Value = OAuthCredential;
3044            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3045                formatter.write_str("struct OAuthCredential")
3046            }
3047            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3048            where
3049                A: serde::de::MapAccess<'de>,
3050            {
3051                #[allow(unused_imports)]
3052                use serde::de::Error;
3053                use std::option::Option::Some;
3054                let mut fields = std::collections::HashSet::new();
3055                let mut result = Self::Value::new();
3056                while let Some(tag) = map.next_key::<__FieldTag>()? {
3057                    #[allow(clippy::match_single_binding)]
3058                    match tag {
3059                        __FieldTag::__oauth_token_secret_version => {
3060                            if !fields.insert(__FieldTag::__oauth_token_secret_version) {
3061                                return std::result::Result::Err(A::Error::duplicate_field(
3062                                    "multiple values for oauth_token_secret_version",
3063                                ));
3064                            }
3065                            result.oauth_token_secret_version = map
3066                                .next_value::<std::option::Option<std::string::String>>()?
3067                                .unwrap_or_default();
3068                        }
3069                        __FieldTag::__username => {
3070                            if !fields.insert(__FieldTag::__username) {
3071                                return std::result::Result::Err(A::Error::duplicate_field(
3072                                    "multiple values for username",
3073                                ));
3074                            }
3075                            result.username = map
3076                                .next_value::<std::option::Option<std::string::String>>()?
3077                                .unwrap_or_default();
3078                        }
3079                        __FieldTag::Unknown(key) => {
3080                            let value = map.next_value::<serde_json::Value>()?;
3081                            result._unknown_fields.insert(key, value);
3082                        }
3083                    }
3084                }
3085                std::result::Result::Ok(result)
3086            }
3087        }
3088        deserializer.deserialize_any(Visitor)
3089    }
3090}
3091
3092#[doc(hidden)]
3093impl serde::ser::Serialize for OAuthCredential {
3094    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3095    where
3096        S: serde::ser::Serializer,
3097    {
3098        use serde::ser::SerializeMap;
3099        #[allow(unused_imports)]
3100        use std::option::Option::Some;
3101        let mut state = serializer.serialize_map(std::option::Option::None)?;
3102        if !self.oauth_token_secret_version.is_empty() {
3103            state.serialize_entry("oauthTokenSecretVersion", &self.oauth_token_secret_version)?;
3104        }
3105        if !self.username.is_empty() {
3106            state.serialize_entry("username", &self.username)?;
3107        }
3108        if !self._unknown_fields.is_empty() {
3109            for (key, value) in self._unknown_fields.iter() {
3110                state.serialize_entry(key, &value)?;
3111            }
3112        }
3113        state.end()
3114    }
3115}
3116
3117/// Configuration for connections to gitlab.com.
3118#[derive(Clone, Debug, Default, PartialEq)]
3119#[non_exhaustive]
3120pub struct GitLabConfig {
3121    /// Required. Immutable. SecretManager resource containing the webhook secret
3122    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This
3123    /// is used to validate webhooks.
3124    pub webhook_secret_secret_version: std::string::String,
3125
3126    /// Required. A GitLab personal access token with the minimum `read_api` scope
3127    /// access and a minimum role of `reporter`. The GitLab Projects visible to
3128    /// this Personal Access Token will control which Projects Developer Connect
3129    /// has access to.
3130    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
3131
3132    /// Required. A GitLab personal access token with the minimum `api` scope
3133    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
3134    /// this Personal Access Token will control which Projects Developer Connect
3135    /// has access to.
3136    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3137
3138    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3139}
3140
3141impl GitLabConfig {
3142    pub fn new() -> Self {
3143        std::default::Default::default()
3144    }
3145
3146    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
3147    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3148        mut self,
3149        v: T,
3150    ) -> Self {
3151        self.webhook_secret_secret_version = v.into();
3152        self
3153    }
3154
3155    /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
3156    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3157    where
3158        T: std::convert::Into<crate::model::UserCredential>,
3159    {
3160        self.read_authorizer_credential = std::option::Option::Some(v.into());
3161        self
3162    }
3163
3164    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
3165    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3166    where
3167        T: std::convert::Into<crate::model::UserCredential>,
3168    {
3169        self.read_authorizer_credential = v.map(|x| x.into());
3170        self
3171    }
3172
3173    /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
3174    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3175    where
3176        T: std::convert::Into<crate::model::UserCredential>,
3177    {
3178        self.authorizer_credential = std::option::Option::Some(v.into());
3179        self
3180    }
3181
3182    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
3183    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3184    where
3185        T: std::convert::Into<crate::model::UserCredential>,
3186    {
3187        self.authorizer_credential = v.map(|x| x.into());
3188        self
3189    }
3190}
3191
3192impl wkt::message::Message for GitLabConfig {
3193    fn typename() -> &'static str {
3194        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
3195    }
3196}
3197
3198#[doc(hidden)]
3199impl<'de> serde::de::Deserialize<'de> for GitLabConfig {
3200    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3201    where
3202        D: serde::Deserializer<'de>,
3203    {
3204        #[allow(non_camel_case_types)]
3205        #[doc(hidden)]
3206        #[derive(PartialEq, Eq, Hash)]
3207        enum __FieldTag {
3208            __webhook_secret_secret_version,
3209            __read_authorizer_credential,
3210            __authorizer_credential,
3211            Unknown(std::string::String),
3212        }
3213        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3214            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3215            where
3216                D: serde::Deserializer<'de>,
3217            {
3218                struct Visitor;
3219                impl<'de> serde::de::Visitor<'de> for Visitor {
3220                    type Value = __FieldTag;
3221                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3222                        formatter.write_str("a field name for GitLabConfig")
3223                    }
3224                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3225                    where
3226                        E: serde::de::Error,
3227                    {
3228                        use std::result::Result::Ok;
3229                        use std::string::ToString;
3230                        match value {
3231                            "webhookSecretSecretVersion" => {
3232                                Ok(__FieldTag::__webhook_secret_secret_version)
3233                            }
3234                            "webhook_secret_secret_version" => {
3235                                Ok(__FieldTag::__webhook_secret_secret_version)
3236                            }
3237                            "readAuthorizerCredential" => {
3238                                Ok(__FieldTag::__read_authorizer_credential)
3239                            }
3240                            "read_authorizer_credential" => {
3241                                Ok(__FieldTag::__read_authorizer_credential)
3242                            }
3243                            "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
3244                            "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
3245                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3246                        }
3247                    }
3248                }
3249                deserializer.deserialize_identifier(Visitor)
3250            }
3251        }
3252        struct Visitor;
3253        impl<'de> serde::de::Visitor<'de> for Visitor {
3254            type Value = GitLabConfig;
3255            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3256                formatter.write_str("struct GitLabConfig")
3257            }
3258            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3259            where
3260                A: serde::de::MapAccess<'de>,
3261            {
3262                #[allow(unused_imports)]
3263                use serde::de::Error;
3264                use std::option::Option::Some;
3265                let mut fields = std::collections::HashSet::new();
3266                let mut result = Self::Value::new();
3267                while let Some(tag) = map.next_key::<__FieldTag>()? {
3268                    #[allow(clippy::match_single_binding)]
3269                    match tag {
3270                        __FieldTag::__webhook_secret_secret_version => {
3271                            if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
3272                                return std::result::Result::Err(A::Error::duplicate_field(
3273                                    "multiple values for webhook_secret_secret_version",
3274                                ));
3275                            }
3276                            result.webhook_secret_secret_version = map
3277                                .next_value::<std::option::Option<std::string::String>>()?
3278                                .unwrap_or_default();
3279                        }
3280                        __FieldTag::__read_authorizer_credential => {
3281                            if !fields.insert(__FieldTag::__read_authorizer_credential) {
3282                                return std::result::Result::Err(A::Error::duplicate_field(
3283                                    "multiple values for read_authorizer_credential",
3284                                ));
3285                            }
3286                            result.read_authorizer_credential = map
3287                                .next_value::<std::option::Option<crate::model::UserCredential>>(
3288                                )?;
3289                        }
3290                        __FieldTag::__authorizer_credential => {
3291                            if !fields.insert(__FieldTag::__authorizer_credential) {
3292                                return std::result::Result::Err(A::Error::duplicate_field(
3293                                    "multiple values for authorizer_credential",
3294                                ));
3295                            }
3296                            result.authorizer_credential = map
3297                                .next_value::<std::option::Option<crate::model::UserCredential>>(
3298                                )?;
3299                        }
3300                        __FieldTag::Unknown(key) => {
3301                            let value = map.next_value::<serde_json::Value>()?;
3302                            result._unknown_fields.insert(key, value);
3303                        }
3304                    }
3305                }
3306                std::result::Result::Ok(result)
3307            }
3308        }
3309        deserializer.deserialize_any(Visitor)
3310    }
3311}
3312
3313#[doc(hidden)]
3314impl serde::ser::Serialize for GitLabConfig {
3315    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3316    where
3317        S: serde::ser::Serializer,
3318    {
3319        use serde::ser::SerializeMap;
3320        #[allow(unused_imports)]
3321        use std::option::Option::Some;
3322        let mut state = serializer.serialize_map(std::option::Option::None)?;
3323        if !self.webhook_secret_secret_version.is_empty() {
3324            state.serialize_entry(
3325                "webhookSecretSecretVersion",
3326                &self.webhook_secret_secret_version,
3327            )?;
3328        }
3329        if self.read_authorizer_credential.is_some() {
3330            state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
3331        }
3332        if self.authorizer_credential.is_some() {
3333            state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
3334        }
3335        if !self._unknown_fields.is_empty() {
3336            for (key, value) in self._unknown_fields.iter() {
3337                state.serialize_entry(key, &value)?;
3338            }
3339        }
3340        state.end()
3341    }
3342}
3343
3344/// Represents a personal access token that authorized the Connection,
3345/// and associated metadata.
3346#[derive(Clone, Debug, Default, PartialEq)]
3347#[non_exhaustive]
3348pub struct UserCredential {
3349    /// Required. A SecretManager resource containing the user token that
3350    /// authorizes the Developer Connect connection. Format:
3351    /// `projects/*/secrets/*/versions/*`.
3352    pub user_token_secret_version: std::string::String,
3353
3354    /// Output only. The username associated with this token.
3355    pub username: std::string::String,
3356
3357    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3358}
3359
3360impl UserCredential {
3361    pub fn new() -> Self {
3362        std::default::Default::default()
3363    }
3364
3365    /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
3366    pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
3367        mut self,
3368        v: T,
3369    ) -> Self {
3370        self.user_token_secret_version = v.into();
3371        self
3372    }
3373
3374    /// Sets the value of [username][crate::model::UserCredential::username].
3375    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3376        self.username = v.into();
3377        self
3378    }
3379}
3380
3381impl wkt::message::Message for UserCredential {
3382    fn typename() -> &'static str {
3383        "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
3384    }
3385}
3386
3387#[doc(hidden)]
3388impl<'de> serde::de::Deserialize<'de> for UserCredential {
3389    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3390    where
3391        D: serde::Deserializer<'de>,
3392    {
3393        #[allow(non_camel_case_types)]
3394        #[doc(hidden)]
3395        #[derive(PartialEq, Eq, Hash)]
3396        enum __FieldTag {
3397            __user_token_secret_version,
3398            __username,
3399            Unknown(std::string::String),
3400        }
3401        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3402            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3403            where
3404                D: serde::Deserializer<'de>,
3405            {
3406                struct Visitor;
3407                impl<'de> serde::de::Visitor<'de> for Visitor {
3408                    type Value = __FieldTag;
3409                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3410                        formatter.write_str("a field name for UserCredential")
3411                    }
3412                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3413                    where
3414                        E: serde::de::Error,
3415                    {
3416                        use std::result::Result::Ok;
3417                        use std::string::ToString;
3418                        match value {
3419                            "userTokenSecretVersion" => Ok(__FieldTag::__user_token_secret_version),
3420                            "user_token_secret_version" => {
3421                                Ok(__FieldTag::__user_token_secret_version)
3422                            }
3423                            "username" => Ok(__FieldTag::__username),
3424                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3425                        }
3426                    }
3427                }
3428                deserializer.deserialize_identifier(Visitor)
3429            }
3430        }
3431        struct Visitor;
3432        impl<'de> serde::de::Visitor<'de> for Visitor {
3433            type Value = UserCredential;
3434            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3435                formatter.write_str("struct UserCredential")
3436            }
3437            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3438            where
3439                A: serde::de::MapAccess<'de>,
3440            {
3441                #[allow(unused_imports)]
3442                use serde::de::Error;
3443                use std::option::Option::Some;
3444                let mut fields = std::collections::HashSet::new();
3445                let mut result = Self::Value::new();
3446                while let Some(tag) = map.next_key::<__FieldTag>()? {
3447                    #[allow(clippy::match_single_binding)]
3448                    match tag {
3449                        __FieldTag::__user_token_secret_version => {
3450                            if !fields.insert(__FieldTag::__user_token_secret_version) {
3451                                return std::result::Result::Err(A::Error::duplicate_field(
3452                                    "multiple values for user_token_secret_version",
3453                                ));
3454                            }
3455                            result.user_token_secret_version = map
3456                                .next_value::<std::option::Option<std::string::String>>()?
3457                                .unwrap_or_default();
3458                        }
3459                        __FieldTag::__username => {
3460                            if !fields.insert(__FieldTag::__username) {
3461                                return std::result::Result::Err(A::Error::duplicate_field(
3462                                    "multiple values for username",
3463                                ));
3464                            }
3465                            result.username = map
3466                                .next_value::<std::option::Option<std::string::String>>()?
3467                                .unwrap_or_default();
3468                        }
3469                        __FieldTag::Unknown(key) => {
3470                            let value = map.next_value::<serde_json::Value>()?;
3471                            result._unknown_fields.insert(key, value);
3472                        }
3473                    }
3474                }
3475                std::result::Result::Ok(result)
3476            }
3477        }
3478        deserializer.deserialize_any(Visitor)
3479    }
3480}
3481
3482#[doc(hidden)]
3483impl serde::ser::Serialize for UserCredential {
3484    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3485    where
3486        S: serde::ser::Serializer,
3487    {
3488        use serde::ser::SerializeMap;
3489        #[allow(unused_imports)]
3490        use std::option::Option::Some;
3491        let mut state = serializer.serialize_map(std::option::Option::None)?;
3492        if !self.user_token_secret_version.is_empty() {
3493            state.serialize_entry("userTokenSecretVersion", &self.user_token_secret_version)?;
3494        }
3495        if !self.username.is_empty() {
3496            state.serialize_entry("username", &self.username)?;
3497        }
3498        if !self._unknown_fields.is_empty() {
3499            for (key, value) in self._unknown_fields.iter() {
3500                state.serialize_entry(key, &value)?;
3501            }
3502        }
3503        state.end()
3504    }
3505}
3506
3507/// Configuration for connections to an instance of GitLab Enterprise.
3508#[derive(Clone, Debug, Default, PartialEq)]
3509#[non_exhaustive]
3510pub struct GitLabEnterpriseConfig {
3511    /// Required. The URI of the GitLab Enterprise host this connection is for.
3512    pub host_uri: std::string::String,
3513
3514    /// Required. Immutable. SecretManager resource containing the webhook secret
3515    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This
3516    /// is used to validate webhooks.
3517    pub webhook_secret_secret_version: std::string::String,
3518
3519    /// Required. A GitLab personal access token with the minimum `read_api` scope
3520    /// access and a minimum role of `reporter`. The GitLab Projects visible to
3521    /// this Personal Access Token will control which Projects Developer Connect
3522    /// has access to.
3523    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
3524
3525    /// Required. A GitLab personal access token with the minimum `api` scope
3526    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
3527    /// this Personal Access Token will control which Projects Developer Connect
3528    /// has access to.
3529    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3530
3531    /// Optional. Configuration for using Service Directory to privately connect to
3532    /// a GitLab Enterprise instance. This should only be set if the GitLab
3533    /// Enterprise server is hosted on-premises and not reachable by public
3534    /// internet. If this field is left empty, calls to the GitLab Enterprise
3535    /// server will be made over the public internet.
3536    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
3537
3538    /// Optional. SSL Certificate Authority certificate to use for requests to
3539    /// GitLab Enterprise instance.
3540    pub ssl_ca_certificate: std::string::String,
3541
3542    /// Output only. Version of the GitLab Enterprise server running on the
3543    /// `host_uri`.
3544    pub server_version: std::string::String,
3545
3546    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3547}
3548
3549impl GitLabEnterpriseConfig {
3550    pub fn new() -> Self {
3551        std::default::Default::default()
3552    }
3553
3554    /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
3555    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3556        self.host_uri = v.into();
3557        self
3558    }
3559
3560    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
3561    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3562        mut self,
3563        v: T,
3564    ) -> Self {
3565        self.webhook_secret_secret_version = v.into();
3566        self
3567    }
3568
3569    /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
3570    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3571    where
3572        T: std::convert::Into<crate::model::UserCredential>,
3573    {
3574        self.read_authorizer_credential = std::option::Option::Some(v.into());
3575        self
3576    }
3577
3578    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
3579    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3580    where
3581        T: std::convert::Into<crate::model::UserCredential>,
3582    {
3583        self.read_authorizer_credential = v.map(|x| x.into());
3584        self
3585    }
3586
3587    /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
3588    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3589    where
3590        T: std::convert::Into<crate::model::UserCredential>,
3591    {
3592        self.authorizer_credential = std::option::Option::Some(v.into());
3593        self
3594    }
3595
3596    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
3597    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3598    where
3599        T: std::convert::Into<crate::model::UserCredential>,
3600    {
3601        self.authorizer_credential = v.map(|x| x.into());
3602        self
3603    }
3604
3605    /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
3606    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
3607    where
3608        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
3609    {
3610        self.service_directory_config = std::option::Option::Some(v.into());
3611        self
3612    }
3613
3614    /// Sets or clears the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
3615    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
3616    where
3617        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
3618    {
3619        self.service_directory_config = v.map(|x| x.into());
3620        self
3621    }
3622
3623    /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
3624    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
3625        mut self,
3626        v: T,
3627    ) -> Self {
3628        self.ssl_ca_certificate = v.into();
3629        self
3630    }
3631
3632    /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
3633    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3634        self.server_version = v.into();
3635        self
3636    }
3637}
3638
3639impl wkt::message::Message for GitLabEnterpriseConfig {
3640    fn typename() -> &'static str {
3641        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
3642    }
3643}
3644
3645#[doc(hidden)]
3646impl<'de> serde::de::Deserialize<'de> for GitLabEnterpriseConfig {
3647    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3648    where
3649        D: serde::Deserializer<'de>,
3650    {
3651        #[allow(non_camel_case_types)]
3652        #[doc(hidden)]
3653        #[derive(PartialEq, Eq, Hash)]
3654        enum __FieldTag {
3655            __host_uri,
3656            __webhook_secret_secret_version,
3657            __read_authorizer_credential,
3658            __authorizer_credential,
3659            __service_directory_config,
3660            __ssl_ca_certificate,
3661            __server_version,
3662            Unknown(std::string::String),
3663        }
3664        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3665            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3666            where
3667                D: serde::Deserializer<'de>,
3668            {
3669                struct Visitor;
3670                impl<'de> serde::de::Visitor<'de> for Visitor {
3671                    type Value = __FieldTag;
3672                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3673                        formatter.write_str("a field name for GitLabEnterpriseConfig")
3674                    }
3675                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3676                    where
3677                        E: serde::de::Error,
3678                    {
3679                        use std::result::Result::Ok;
3680                        use std::string::ToString;
3681                        match value {
3682                            "hostUri" => Ok(__FieldTag::__host_uri),
3683                            "host_uri" => Ok(__FieldTag::__host_uri),
3684                            "webhookSecretSecretVersion" => {
3685                                Ok(__FieldTag::__webhook_secret_secret_version)
3686                            }
3687                            "webhook_secret_secret_version" => {
3688                                Ok(__FieldTag::__webhook_secret_secret_version)
3689                            }
3690                            "readAuthorizerCredential" => {
3691                                Ok(__FieldTag::__read_authorizer_credential)
3692                            }
3693                            "read_authorizer_credential" => {
3694                                Ok(__FieldTag::__read_authorizer_credential)
3695                            }
3696                            "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
3697                            "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
3698                            "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
3699                            "service_directory_config" => {
3700                                Ok(__FieldTag::__service_directory_config)
3701                            }
3702                            "sslCaCertificate" => Ok(__FieldTag::__ssl_ca_certificate),
3703                            "ssl_ca_certificate" => Ok(__FieldTag::__ssl_ca_certificate),
3704                            "serverVersion" => Ok(__FieldTag::__server_version),
3705                            "server_version" => Ok(__FieldTag::__server_version),
3706                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3707                        }
3708                    }
3709                }
3710                deserializer.deserialize_identifier(Visitor)
3711            }
3712        }
3713        struct Visitor;
3714        impl<'de> serde::de::Visitor<'de> for Visitor {
3715            type Value = GitLabEnterpriseConfig;
3716            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3717                formatter.write_str("struct GitLabEnterpriseConfig")
3718            }
3719            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3720            where
3721                A: serde::de::MapAccess<'de>,
3722            {
3723                #[allow(unused_imports)]
3724                use serde::de::Error;
3725                use std::option::Option::Some;
3726                let mut fields = std::collections::HashSet::new();
3727                let mut result = Self::Value::new();
3728                while let Some(tag) = map.next_key::<__FieldTag>()? {
3729                    #[allow(clippy::match_single_binding)]
3730                    match tag {
3731                        __FieldTag::__host_uri => {
3732                            if !fields.insert(__FieldTag::__host_uri) {
3733                                return std::result::Result::Err(A::Error::duplicate_field(
3734                                    "multiple values for host_uri",
3735                                ));
3736                            }
3737                            result.host_uri = map
3738                                .next_value::<std::option::Option<std::string::String>>()?
3739                                .unwrap_or_default();
3740                        }
3741                        __FieldTag::__webhook_secret_secret_version => {
3742                            if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
3743                                return std::result::Result::Err(A::Error::duplicate_field(
3744                                    "multiple values for webhook_secret_secret_version",
3745                                ));
3746                            }
3747                            result.webhook_secret_secret_version = map
3748                                .next_value::<std::option::Option<std::string::String>>()?
3749                                .unwrap_or_default();
3750                        }
3751                        __FieldTag::__read_authorizer_credential => {
3752                            if !fields.insert(__FieldTag::__read_authorizer_credential) {
3753                                return std::result::Result::Err(A::Error::duplicate_field(
3754                                    "multiple values for read_authorizer_credential",
3755                                ));
3756                            }
3757                            result.read_authorizer_credential = map
3758                                .next_value::<std::option::Option<crate::model::UserCredential>>(
3759                                )?;
3760                        }
3761                        __FieldTag::__authorizer_credential => {
3762                            if !fields.insert(__FieldTag::__authorizer_credential) {
3763                                return std::result::Result::Err(A::Error::duplicate_field(
3764                                    "multiple values for authorizer_credential",
3765                                ));
3766                            }
3767                            result.authorizer_credential = map
3768                                .next_value::<std::option::Option<crate::model::UserCredential>>(
3769                                )?;
3770                        }
3771                        __FieldTag::__service_directory_config => {
3772                            if !fields.insert(__FieldTag::__service_directory_config) {
3773                                return std::result::Result::Err(A::Error::duplicate_field(
3774                                    "multiple values for service_directory_config",
3775                                ));
3776                            }
3777                            result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
3778                                ;
3779                        }
3780                        __FieldTag::__ssl_ca_certificate => {
3781                            if !fields.insert(__FieldTag::__ssl_ca_certificate) {
3782                                return std::result::Result::Err(A::Error::duplicate_field(
3783                                    "multiple values for ssl_ca_certificate",
3784                                ));
3785                            }
3786                            result.ssl_ca_certificate = map
3787                                .next_value::<std::option::Option<std::string::String>>()?
3788                                .unwrap_or_default();
3789                        }
3790                        __FieldTag::__server_version => {
3791                            if !fields.insert(__FieldTag::__server_version) {
3792                                return std::result::Result::Err(A::Error::duplicate_field(
3793                                    "multiple values for server_version",
3794                                ));
3795                            }
3796                            result.server_version = map
3797                                .next_value::<std::option::Option<std::string::String>>()?
3798                                .unwrap_or_default();
3799                        }
3800                        __FieldTag::Unknown(key) => {
3801                            let value = map.next_value::<serde_json::Value>()?;
3802                            result._unknown_fields.insert(key, value);
3803                        }
3804                    }
3805                }
3806                std::result::Result::Ok(result)
3807            }
3808        }
3809        deserializer.deserialize_any(Visitor)
3810    }
3811}
3812
3813#[doc(hidden)]
3814impl serde::ser::Serialize for GitLabEnterpriseConfig {
3815    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3816    where
3817        S: serde::ser::Serializer,
3818    {
3819        use serde::ser::SerializeMap;
3820        #[allow(unused_imports)]
3821        use std::option::Option::Some;
3822        let mut state = serializer.serialize_map(std::option::Option::None)?;
3823        if !self.host_uri.is_empty() {
3824            state.serialize_entry("hostUri", &self.host_uri)?;
3825        }
3826        if !self.webhook_secret_secret_version.is_empty() {
3827            state.serialize_entry(
3828                "webhookSecretSecretVersion",
3829                &self.webhook_secret_secret_version,
3830            )?;
3831        }
3832        if self.read_authorizer_credential.is_some() {
3833            state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
3834        }
3835        if self.authorizer_credential.is_some() {
3836            state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
3837        }
3838        if self.service_directory_config.is_some() {
3839            state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
3840        }
3841        if !self.ssl_ca_certificate.is_empty() {
3842            state.serialize_entry("sslCaCertificate", &self.ssl_ca_certificate)?;
3843        }
3844        if !self.server_version.is_empty() {
3845            state.serialize_entry("serverVersion", &self.server_version)?;
3846        }
3847        if !self._unknown_fields.is_empty() {
3848            for (key, value) in self._unknown_fields.iter() {
3849                state.serialize_entry(key, &value)?;
3850            }
3851        }
3852        state.end()
3853    }
3854}
3855
3856/// Configuration for connections to an instance of Bitbucket Data Center.
3857#[derive(Clone, Debug, Default, PartialEq)]
3858#[non_exhaustive]
3859pub struct BitbucketDataCenterConfig {
3860    /// Required. The URI of the Bitbucket Data Center host this connection is for.
3861    pub host_uri: std::string::String,
3862
3863    /// Required. Immutable. SecretManager resource containing the webhook secret
3864    /// used to verify webhook events, formatted as
3865    /// `projects/*/secrets/*/versions/*`. This is used to validate webhooks.
3866    pub webhook_secret_secret_version: std::string::String,
3867
3868    /// Required. An http access token with the minimum `Repository read` access.
3869    /// It's recommended to use a system account to generate the credentials.
3870    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
3871
3872    /// Required. An http access token with the minimum `Repository admin` scope
3873    /// access. This is needed to create webhooks. It's recommended to use a system
3874    /// account to generate these credentials.
3875    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3876
3877    /// Optional. Configuration for using Service Directory to privately connect to
3878    /// a Bitbucket Data Center instance. This should only be set if the Bitbucket
3879    /// Data Center is hosted on-premises and not reachable by public internet. If
3880    /// this field is left empty, calls to the Bitbucket Data Center will be made
3881    /// over the public internet.
3882    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
3883
3884    /// Optional. SSL certificate authority to trust when making requests to
3885    /// Bitbucket Data Center.
3886    pub ssl_ca_certificate: std::string::String,
3887
3888    /// Output only. Version of the Bitbucket Data Center server running on the
3889    /// `host_uri`.
3890    pub server_version: std::string::String,
3891
3892    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3893}
3894
3895impl BitbucketDataCenterConfig {
3896    pub fn new() -> Self {
3897        std::default::Default::default()
3898    }
3899
3900    /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
3901    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3902        self.host_uri = v.into();
3903        self
3904    }
3905
3906    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
3907    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3908        mut self,
3909        v: T,
3910    ) -> Self {
3911        self.webhook_secret_secret_version = v.into();
3912        self
3913    }
3914
3915    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
3916    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3917    where
3918        T: std::convert::Into<crate::model::UserCredential>,
3919    {
3920        self.read_authorizer_credential = std::option::Option::Some(v.into());
3921        self
3922    }
3923
3924    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
3925    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3926    where
3927        T: std::convert::Into<crate::model::UserCredential>,
3928    {
3929        self.read_authorizer_credential = v.map(|x| x.into());
3930        self
3931    }
3932
3933    /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
3934    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3935    where
3936        T: std::convert::Into<crate::model::UserCredential>,
3937    {
3938        self.authorizer_credential = std::option::Option::Some(v.into());
3939        self
3940    }
3941
3942    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
3943    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3944    where
3945        T: std::convert::Into<crate::model::UserCredential>,
3946    {
3947        self.authorizer_credential = v.map(|x| x.into());
3948        self
3949    }
3950
3951    /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
3952    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
3953    where
3954        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
3955    {
3956        self.service_directory_config = std::option::Option::Some(v.into());
3957        self
3958    }
3959
3960    /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
3961    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
3962    where
3963        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
3964    {
3965        self.service_directory_config = v.map(|x| x.into());
3966        self
3967    }
3968
3969    /// Sets the value of [ssl_ca_certificate][crate::model::BitbucketDataCenterConfig::ssl_ca_certificate].
3970    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
3971        mut self,
3972        v: T,
3973    ) -> Self {
3974        self.ssl_ca_certificate = v.into();
3975        self
3976    }
3977
3978    /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
3979    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3980        self.server_version = v.into();
3981        self
3982    }
3983}
3984
3985impl wkt::message::Message for BitbucketDataCenterConfig {
3986    fn typename() -> &'static str {
3987        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
3988    }
3989}
3990
3991#[doc(hidden)]
3992impl<'de> serde::de::Deserialize<'de> for BitbucketDataCenterConfig {
3993    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3994    where
3995        D: serde::Deserializer<'de>,
3996    {
3997        #[allow(non_camel_case_types)]
3998        #[doc(hidden)]
3999        #[derive(PartialEq, Eq, Hash)]
4000        enum __FieldTag {
4001            __host_uri,
4002            __webhook_secret_secret_version,
4003            __read_authorizer_credential,
4004            __authorizer_credential,
4005            __service_directory_config,
4006            __ssl_ca_certificate,
4007            __server_version,
4008            Unknown(std::string::String),
4009        }
4010        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4011            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4012            where
4013                D: serde::Deserializer<'de>,
4014            {
4015                struct Visitor;
4016                impl<'de> serde::de::Visitor<'de> for Visitor {
4017                    type Value = __FieldTag;
4018                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4019                        formatter.write_str("a field name for BitbucketDataCenterConfig")
4020                    }
4021                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4022                    where
4023                        E: serde::de::Error,
4024                    {
4025                        use std::result::Result::Ok;
4026                        use std::string::ToString;
4027                        match value {
4028                            "hostUri" => Ok(__FieldTag::__host_uri),
4029                            "host_uri" => Ok(__FieldTag::__host_uri),
4030                            "webhookSecretSecretVersion" => {
4031                                Ok(__FieldTag::__webhook_secret_secret_version)
4032                            }
4033                            "webhook_secret_secret_version" => {
4034                                Ok(__FieldTag::__webhook_secret_secret_version)
4035                            }
4036                            "readAuthorizerCredential" => {
4037                                Ok(__FieldTag::__read_authorizer_credential)
4038                            }
4039                            "read_authorizer_credential" => {
4040                                Ok(__FieldTag::__read_authorizer_credential)
4041                            }
4042                            "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
4043                            "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
4044                            "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
4045                            "service_directory_config" => {
4046                                Ok(__FieldTag::__service_directory_config)
4047                            }
4048                            "sslCaCertificate" => Ok(__FieldTag::__ssl_ca_certificate),
4049                            "ssl_ca_certificate" => Ok(__FieldTag::__ssl_ca_certificate),
4050                            "serverVersion" => Ok(__FieldTag::__server_version),
4051                            "server_version" => Ok(__FieldTag::__server_version),
4052                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4053                        }
4054                    }
4055                }
4056                deserializer.deserialize_identifier(Visitor)
4057            }
4058        }
4059        struct Visitor;
4060        impl<'de> serde::de::Visitor<'de> for Visitor {
4061            type Value = BitbucketDataCenterConfig;
4062            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4063                formatter.write_str("struct BitbucketDataCenterConfig")
4064            }
4065            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4066            where
4067                A: serde::de::MapAccess<'de>,
4068            {
4069                #[allow(unused_imports)]
4070                use serde::de::Error;
4071                use std::option::Option::Some;
4072                let mut fields = std::collections::HashSet::new();
4073                let mut result = Self::Value::new();
4074                while let Some(tag) = map.next_key::<__FieldTag>()? {
4075                    #[allow(clippy::match_single_binding)]
4076                    match tag {
4077                        __FieldTag::__host_uri => {
4078                            if !fields.insert(__FieldTag::__host_uri) {
4079                                return std::result::Result::Err(A::Error::duplicate_field(
4080                                    "multiple values for host_uri",
4081                                ));
4082                            }
4083                            result.host_uri = map
4084                                .next_value::<std::option::Option<std::string::String>>()?
4085                                .unwrap_or_default();
4086                        }
4087                        __FieldTag::__webhook_secret_secret_version => {
4088                            if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
4089                                return std::result::Result::Err(A::Error::duplicate_field(
4090                                    "multiple values for webhook_secret_secret_version",
4091                                ));
4092                            }
4093                            result.webhook_secret_secret_version = map
4094                                .next_value::<std::option::Option<std::string::String>>()?
4095                                .unwrap_or_default();
4096                        }
4097                        __FieldTag::__read_authorizer_credential => {
4098                            if !fields.insert(__FieldTag::__read_authorizer_credential) {
4099                                return std::result::Result::Err(A::Error::duplicate_field(
4100                                    "multiple values for read_authorizer_credential",
4101                                ));
4102                            }
4103                            result.read_authorizer_credential = map
4104                                .next_value::<std::option::Option<crate::model::UserCredential>>(
4105                                )?;
4106                        }
4107                        __FieldTag::__authorizer_credential => {
4108                            if !fields.insert(__FieldTag::__authorizer_credential) {
4109                                return std::result::Result::Err(A::Error::duplicate_field(
4110                                    "multiple values for authorizer_credential",
4111                                ));
4112                            }
4113                            result.authorizer_credential = map
4114                                .next_value::<std::option::Option<crate::model::UserCredential>>(
4115                                )?;
4116                        }
4117                        __FieldTag::__service_directory_config => {
4118                            if !fields.insert(__FieldTag::__service_directory_config) {
4119                                return std::result::Result::Err(A::Error::duplicate_field(
4120                                    "multiple values for service_directory_config",
4121                                ));
4122                            }
4123                            result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
4124                                ;
4125                        }
4126                        __FieldTag::__ssl_ca_certificate => {
4127                            if !fields.insert(__FieldTag::__ssl_ca_certificate) {
4128                                return std::result::Result::Err(A::Error::duplicate_field(
4129                                    "multiple values for ssl_ca_certificate",
4130                                ));
4131                            }
4132                            result.ssl_ca_certificate = map
4133                                .next_value::<std::option::Option<std::string::String>>()?
4134                                .unwrap_or_default();
4135                        }
4136                        __FieldTag::__server_version => {
4137                            if !fields.insert(__FieldTag::__server_version) {
4138                                return std::result::Result::Err(A::Error::duplicate_field(
4139                                    "multiple values for server_version",
4140                                ));
4141                            }
4142                            result.server_version = map
4143                                .next_value::<std::option::Option<std::string::String>>()?
4144                                .unwrap_or_default();
4145                        }
4146                        __FieldTag::Unknown(key) => {
4147                            let value = map.next_value::<serde_json::Value>()?;
4148                            result._unknown_fields.insert(key, value);
4149                        }
4150                    }
4151                }
4152                std::result::Result::Ok(result)
4153            }
4154        }
4155        deserializer.deserialize_any(Visitor)
4156    }
4157}
4158
4159#[doc(hidden)]
4160impl serde::ser::Serialize for BitbucketDataCenterConfig {
4161    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4162    where
4163        S: serde::ser::Serializer,
4164    {
4165        use serde::ser::SerializeMap;
4166        #[allow(unused_imports)]
4167        use std::option::Option::Some;
4168        let mut state = serializer.serialize_map(std::option::Option::None)?;
4169        if !self.host_uri.is_empty() {
4170            state.serialize_entry("hostUri", &self.host_uri)?;
4171        }
4172        if !self.webhook_secret_secret_version.is_empty() {
4173            state.serialize_entry(
4174                "webhookSecretSecretVersion",
4175                &self.webhook_secret_secret_version,
4176            )?;
4177        }
4178        if self.read_authorizer_credential.is_some() {
4179            state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
4180        }
4181        if self.authorizer_credential.is_some() {
4182            state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
4183        }
4184        if self.service_directory_config.is_some() {
4185            state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
4186        }
4187        if !self.ssl_ca_certificate.is_empty() {
4188            state.serialize_entry("sslCaCertificate", &self.ssl_ca_certificate)?;
4189        }
4190        if !self.server_version.is_empty() {
4191            state.serialize_entry("serverVersion", &self.server_version)?;
4192        }
4193        if !self._unknown_fields.is_empty() {
4194            for (key, value) in self._unknown_fields.iter() {
4195                state.serialize_entry(key, &value)?;
4196            }
4197        }
4198        state.end()
4199    }
4200}
4201
4202/// Configuration for connections to an instance of Bitbucket Cloud.
4203#[derive(Clone, Debug, Default, PartialEq)]
4204#[non_exhaustive]
4205pub struct BitbucketCloudConfig {
4206    /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
4207    /// Platform.
4208    pub workspace: std::string::String,
4209
4210    /// Required. Immutable. SecretManager resource containing the webhook secret
4211    /// used to verify webhook events, formatted as
4212    /// `projects/*/secrets/*/versions/*`. This is used to validate and create
4213    /// webhooks.
4214    pub webhook_secret_secret_version: std::string::String,
4215
4216    /// Required. An access token with the minimum `repository` access.
4217    /// It can either be a workspace, project or repository access token.
4218    /// It's recommended to use a system account to generate the credentials.
4219    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
4220
4221    /// Required. An access token with the minimum `repository`, `pullrequest` and
4222    /// `webhook` scope access. It can either be a workspace, project or repository
4223    /// access token. This is needed to create webhooks. It's recommended to use a
4224    /// system account to generate these credentials.
4225    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
4226
4227    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4228}
4229
4230impl BitbucketCloudConfig {
4231    pub fn new() -> Self {
4232        std::default::Default::default()
4233    }
4234
4235    /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
4236    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4237        self.workspace = v.into();
4238        self
4239    }
4240
4241    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
4242    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
4243        mut self,
4244        v: T,
4245    ) -> Self {
4246        self.webhook_secret_secret_version = v.into();
4247        self
4248    }
4249
4250    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
4251    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
4252    where
4253        T: std::convert::Into<crate::model::UserCredential>,
4254    {
4255        self.read_authorizer_credential = std::option::Option::Some(v.into());
4256        self
4257    }
4258
4259    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
4260    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
4261    where
4262        T: std::convert::Into<crate::model::UserCredential>,
4263    {
4264        self.read_authorizer_credential = v.map(|x| x.into());
4265        self
4266    }
4267
4268    /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
4269    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
4270    where
4271        T: std::convert::Into<crate::model::UserCredential>,
4272    {
4273        self.authorizer_credential = std::option::Option::Some(v.into());
4274        self
4275    }
4276
4277    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
4278    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
4279    where
4280        T: std::convert::Into<crate::model::UserCredential>,
4281    {
4282        self.authorizer_credential = v.map(|x| x.into());
4283        self
4284    }
4285}
4286
4287impl wkt::message::Message for BitbucketCloudConfig {
4288    fn typename() -> &'static str {
4289        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
4290    }
4291}
4292
4293#[doc(hidden)]
4294impl<'de> serde::de::Deserialize<'de> for BitbucketCloudConfig {
4295    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4296    where
4297        D: serde::Deserializer<'de>,
4298    {
4299        #[allow(non_camel_case_types)]
4300        #[doc(hidden)]
4301        #[derive(PartialEq, Eq, Hash)]
4302        enum __FieldTag {
4303            __workspace,
4304            __webhook_secret_secret_version,
4305            __read_authorizer_credential,
4306            __authorizer_credential,
4307            Unknown(std::string::String),
4308        }
4309        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4310            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4311            where
4312                D: serde::Deserializer<'de>,
4313            {
4314                struct Visitor;
4315                impl<'de> serde::de::Visitor<'de> for Visitor {
4316                    type Value = __FieldTag;
4317                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4318                        formatter.write_str("a field name for BitbucketCloudConfig")
4319                    }
4320                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4321                    where
4322                        E: serde::de::Error,
4323                    {
4324                        use std::result::Result::Ok;
4325                        use std::string::ToString;
4326                        match value {
4327                            "workspace" => Ok(__FieldTag::__workspace),
4328                            "webhookSecretSecretVersion" => {
4329                                Ok(__FieldTag::__webhook_secret_secret_version)
4330                            }
4331                            "webhook_secret_secret_version" => {
4332                                Ok(__FieldTag::__webhook_secret_secret_version)
4333                            }
4334                            "readAuthorizerCredential" => {
4335                                Ok(__FieldTag::__read_authorizer_credential)
4336                            }
4337                            "read_authorizer_credential" => {
4338                                Ok(__FieldTag::__read_authorizer_credential)
4339                            }
4340                            "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
4341                            "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
4342                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4343                        }
4344                    }
4345                }
4346                deserializer.deserialize_identifier(Visitor)
4347            }
4348        }
4349        struct Visitor;
4350        impl<'de> serde::de::Visitor<'de> for Visitor {
4351            type Value = BitbucketCloudConfig;
4352            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4353                formatter.write_str("struct BitbucketCloudConfig")
4354            }
4355            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4356            where
4357                A: serde::de::MapAccess<'de>,
4358            {
4359                #[allow(unused_imports)]
4360                use serde::de::Error;
4361                use std::option::Option::Some;
4362                let mut fields = std::collections::HashSet::new();
4363                let mut result = Self::Value::new();
4364                while let Some(tag) = map.next_key::<__FieldTag>()? {
4365                    #[allow(clippy::match_single_binding)]
4366                    match tag {
4367                        __FieldTag::__workspace => {
4368                            if !fields.insert(__FieldTag::__workspace) {
4369                                return std::result::Result::Err(A::Error::duplicate_field(
4370                                    "multiple values for workspace",
4371                                ));
4372                            }
4373                            result.workspace = map
4374                                .next_value::<std::option::Option<std::string::String>>()?
4375                                .unwrap_or_default();
4376                        }
4377                        __FieldTag::__webhook_secret_secret_version => {
4378                            if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
4379                                return std::result::Result::Err(A::Error::duplicate_field(
4380                                    "multiple values for webhook_secret_secret_version",
4381                                ));
4382                            }
4383                            result.webhook_secret_secret_version = map
4384                                .next_value::<std::option::Option<std::string::String>>()?
4385                                .unwrap_or_default();
4386                        }
4387                        __FieldTag::__read_authorizer_credential => {
4388                            if !fields.insert(__FieldTag::__read_authorizer_credential) {
4389                                return std::result::Result::Err(A::Error::duplicate_field(
4390                                    "multiple values for read_authorizer_credential",
4391                                ));
4392                            }
4393                            result.read_authorizer_credential = map
4394                                .next_value::<std::option::Option<crate::model::UserCredential>>(
4395                                )?;
4396                        }
4397                        __FieldTag::__authorizer_credential => {
4398                            if !fields.insert(__FieldTag::__authorizer_credential) {
4399                                return std::result::Result::Err(A::Error::duplicate_field(
4400                                    "multiple values for authorizer_credential",
4401                                ));
4402                            }
4403                            result.authorizer_credential = map
4404                                .next_value::<std::option::Option<crate::model::UserCredential>>(
4405                                )?;
4406                        }
4407                        __FieldTag::Unknown(key) => {
4408                            let value = map.next_value::<serde_json::Value>()?;
4409                            result._unknown_fields.insert(key, value);
4410                        }
4411                    }
4412                }
4413                std::result::Result::Ok(result)
4414            }
4415        }
4416        deserializer.deserialize_any(Visitor)
4417    }
4418}
4419
4420#[doc(hidden)]
4421impl serde::ser::Serialize for BitbucketCloudConfig {
4422    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4423    where
4424        S: serde::ser::Serializer,
4425    {
4426        use serde::ser::SerializeMap;
4427        #[allow(unused_imports)]
4428        use std::option::Option::Some;
4429        let mut state = serializer.serialize_map(std::option::Option::None)?;
4430        if !self.workspace.is_empty() {
4431            state.serialize_entry("workspace", &self.workspace)?;
4432        }
4433        if !self.webhook_secret_secret_version.is_empty() {
4434            state.serialize_entry(
4435                "webhookSecretSecretVersion",
4436                &self.webhook_secret_secret_version,
4437            )?;
4438        }
4439        if self.read_authorizer_credential.is_some() {
4440            state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
4441        }
4442        if self.authorizer_credential.is_some() {
4443            state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
4444        }
4445        if !self._unknown_fields.is_empty() {
4446            for (key, value) in self._unknown_fields.iter() {
4447                state.serialize_entry(key, &value)?;
4448            }
4449        }
4450        state.end()
4451    }
4452}
4453
4454/// Message for requesting list of Connections
4455#[derive(Clone, Debug, Default, PartialEq)]
4456#[non_exhaustive]
4457pub struct ListConnectionsRequest {
4458    /// Required. Parent value for ListConnectionsRequest
4459    pub parent: std::string::String,
4460
4461    /// Optional. Requested page size. Server may return fewer items than
4462    /// requested. If unspecified, server will pick an appropriate default.
4463    pub page_size: i32,
4464
4465    /// Optional. A token identifying a page of results the server should return.
4466    pub page_token: std::string::String,
4467
4468    /// Optional. Filtering results
4469    pub filter: std::string::String,
4470
4471    /// Optional. Hint for how to order the results
4472    pub order_by: std::string::String,
4473
4474    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4475}
4476
4477impl ListConnectionsRequest {
4478    pub fn new() -> Self {
4479        std::default::Default::default()
4480    }
4481
4482    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
4483    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4484        self.parent = v.into();
4485        self
4486    }
4487
4488    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
4489    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4490        self.page_size = v.into();
4491        self
4492    }
4493
4494    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
4495    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4496        self.page_token = v.into();
4497        self
4498    }
4499
4500    /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
4501    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4502        self.filter = v.into();
4503        self
4504    }
4505
4506    /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
4507    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4508        self.order_by = v.into();
4509        self
4510    }
4511}
4512
4513impl wkt::message::Message for ListConnectionsRequest {
4514    fn typename() -> &'static str {
4515        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
4516    }
4517}
4518
4519#[doc(hidden)]
4520impl<'de> serde::de::Deserialize<'de> for ListConnectionsRequest {
4521    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4522    where
4523        D: serde::Deserializer<'de>,
4524    {
4525        #[allow(non_camel_case_types)]
4526        #[doc(hidden)]
4527        #[derive(PartialEq, Eq, Hash)]
4528        enum __FieldTag {
4529            __parent,
4530            __page_size,
4531            __page_token,
4532            __filter,
4533            __order_by,
4534            Unknown(std::string::String),
4535        }
4536        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4537            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4538            where
4539                D: serde::Deserializer<'de>,
4540            {
4541                struct Visitor;
4542                impl<'de> serde::de::Visitor<'de> for Visitor {
4543                    type Value = __FieldTag;
4544                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4545                        formatter.write_str("a field name for ListConnectionsRequest")
4546                    }
4547                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4548                    where
4549                        E: serde::de::Error,
4550                    {
4551                        use std::result::Result::Ok;
4552                        use std::string::ToString;
4553                        match value {
4554                            "parent" => Ok(__FieldTag::__parent),
4555                            "pageSize" => Ok(__FieldTag::__page_size),
4556                            "page_size" => Ok(__FieldTag::__page_size),
4557                            "pageToken" => Ok(__FieldTag::__page_token),
4558                            "page_token" => Ok(__FieldTag::__page_token),
4559                            "filter" => Ok(__FieldTag::__filter),
4560                            "orderBy" => Ok(__FieldTag::__order_by),
4561                            "order_by" => Ok(__FieldTag::__order_by),
4562                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4563                        }
4564                    }
4565                }
4566                deserializer.deserialize_identifier(Visitor)
4567            }
4568        }
4569        struct Visitor;
4570        impl<'de> serde::de::Visitor<'de> for Visitor {
4571            type Value = ListConnectionsRequest;
4572            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4573                formatter.write_str("struct ListConnectionsRequest")
4574            }
4575            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4576            where
4577                A: serde::de::MapAccess<'de>,
4578            {
4579                #[allow(unused_imports)]
4580                use serde::de::Error;
4581                use std::option::Option::Some;
4582                let mut fields = std::collections::HashSet::new();
4583                let mut result = Self::Value::new();
4584                while let Some(tag) = map.next_key::<__FieldTag>()? {
4585                    #[allow(clippy::match_single_binding)]
4586                    match tag {
4587                        __FieldTag::__parent => {
4588                            if !fields.insert(__FieldTag::__parent) {
4589                                return std::result::Result::Err(A::Error::duplicate_field(
4590                                    "multiple values for parent",
4591                                ));
4592                            }
4593                            result.parent = map
4594                                .next_value::<std::option::Option<std::string::String>>()?
4595                                .unwrap_or_default();
4596                        }
4597                        __FieldTag::__page_size => {
4598                            if !fields.insert(__FieldTag::__page_size) {
4599                                return std::result::Result::Err(A::Error::duplicate_field(
4600                                    "multiple values for page_size",
4601                                ));
4602                            }
4603                            struct __With(std::option::Option<i32>);
4604                            impl<'de> serde::de::Deserialize<'de> for __With {
4605                                fn deserialize<D>(
4606                                    deserializer: D,
4607                                ) -> std::result::Result<Self, D::Error>
4608                                where
4609                                    D: serde::de::Deserializer<'de>,
4610                                {
4611                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4612                                }
4613                            }
4614                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
4615                        }
4616                        __FieldTag::__page_token => {
4617                            if !fields.insert(__FieldTag::__page_token) {
4618                                return std::result::Result::Err(A::Error::duplicate_field(
4619                                    "multiple values for page_token",
4620                                ));
4621                            }
4622                            result.page_token = map
4623                                .next_value::<std::option::Option<std::string::String>>()?
4624                                .unwrap_or_default();
4625                        }
4626                        __FieldTag::__filter => {
4627                            if !fields.insert(__FieldTag::__filter) {
4628                                return std::result::Result::Err(A::Error::duplicate_field(
4629                                    "multiple values for filter",
4630                                ));
4631                            }
4632                            result.filter = map
4633                                .next_value::<std::option::Option<std::string::String>>()?
4634                                .unwrap_or_default();
4635                        }
4636                        __FieldTag::__order_by => {
4637                            if !fields.insert(__FieldTag::__order_by) {
4638                                return std::result::Result::Err(A::Error::duplicate_field(
4639                                    "multiple values for order_by",
4640                                ));
4641                            }
4642                            result.order_by = map
4643                                .next_value::<std::option::Option<std::string::String>>()?
4644                                .unwrap_or_default();
4645                        }
4646                        __FieldTag::Unknown(key) => {
4647                            let value = map.next_value::<serde_json::Value>()?;
4648                            result._unknown_fields.insert(key, value);
4649                        }
4650                    }
4651                }
4652                std::result::Result::Ok(result)
4653            }
4654        }
4655        deserializer.deserialize_any(Visitor)
4656    }
4657}
4658
4659#[doc(hidden)]
4660impl serde::ser::Serialize for ListConnectionsRequest {
4661    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4662    where
4663        S: serde::ser::Serializer,
4664    {
4665        use serde::ser::SerializeMap;
4666        #[allow(unused_imports)]
4667        use std::option::Option::Some;
4668        let mut state = serializer.serialize_map(std::option::Option::None)?;
4669        if !self.parent.is_empty() {
4670            state.serialize_entry("parent", &self.parent)?;
4671        }
4672        if !wkt::internal::is_default(&self.page_size) {
4673            struct __With<'a>(&'a i32);
4674            impl<'a> serde::ser::Serialize for __With<'a> {
4675                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4676                where
4677                    S: serde::ser::Serializer,
4678                {
4679                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4680                }
4681            }
4682            state.serialize_entry("pageSize", &__With(&self.page_size))?;
4683        }
4684        if !self.page_token.is_empty() {
4685            state.serialize_entry("pageToken", &self.page_token)?;
4686        }
4687        if !self.filter.is_empty() {
4688            state.serialize_entry("filter", &self.filter)?;
4689        }
4690        if !self.order_by.is_empty() {
4691            state.serialize_entry("orderBy", &self.order_by)?;
4692        }
4693        if !self._unknown_fields.is_empty() {
4694            for (key, value) in self._unknown_fields.iter() {
4695                state.serialize_entry(key, &value)?;
4696            }
4697        }
4698        state.end()
4699    }
4700}
4701
4702/// Message for response to listing Connections
4703#[derive(Clone, Debug, Default, PartialEq)]
4704#[non_exhaustive]
4705pub struct ListConnectionsResponse {
4706    /// The list of Connection
4707    pub connections: std::vec::Vec<crate::model::Connection>,
4708
4709    /// A token identifying a page of results the server should return.
4710    pub next_page_token: std::string::String,
4711
4712    /// Locations that could not be reached.
4713    pub unreachable: std::vec::Vec<std::string::String>,
4714
4715    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4716}
4717
4718impl ListConnectionsResponse {
4719    pub fn new() -> Self {
4720        std::default::Default::default()
4721    }
4722
4723    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
4724    pub fn set_connections<T, V>(mut self, v: T) -> Self
4725    where
4726        T: std::iter::IntoIterator<Item = V>,
4727        V: std::convert::Into<crate::model::Connection>,
4728    {
4729        use std::iter::Iterator;
4730        self.connections = v.into_iter().map(|i| i.into()).collect();
4731        self
4732    }
4733
4734    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
4735    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4736        self.next_page_token = v.into();
4737        self
4738    }
4739
4740    /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
4741    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4742    where
4743        T: std::iter::IntoIterator<Item = V>,
4744        V: std::convert::Into<std::string::String>,
4745    {
4746        use std::iter::Iterator;
4747        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4748        self
4749    }
4750}
4751
4752impl wkt::message::Message for ListConnectionsResponse {
4753    fn typename() -> &'static str {
4754        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
4755    }
4756}
4757
4758#[doc(hidden)]
4759impl gax::paginator::internal::PageableResponse for ListConnectionsResponse {
4760    type PageItem = crate::model::Connection;
4761
4762    fn items(self) -> std::vec::Vec<Self::PageItem> {
4763        self.connections
4764    }
4765
4766    fn next_page_token(&self) -> std::string::String {
4767        use std::clone::Clone;
4768        self.next_page_token.clone()
4769    }
4770}
4771
4772#[doc(hidden)]
4773impl<'de> serde::de::Deserialize<'de> for ListConnectionsResponse {
4774    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4775    where
4776        D: serde::Deserializer<'de>,
4777    {
4778        #[allow(non_camel_case_types)]
4779        #[doc(hidden)]
4780        #[derive(PartialEq, Eq, Hash)]
4781        enum __FieldTag {
4782            __connections,
4783            __next_page_token,
4784            __unreachable,
4785            Unknown(std::string::String),
4786        }
4787        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4788            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4789            where
4790                D: serde::Deserializer<'de>,
4791            {
4792                struct Visitor;
4793                impl<'de> serde::de::Visitor<'de> for Visitor {
4794                    type Value = __FieldTag;
4795                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4796                        formatter.write_str("a field name for ListConnectionsResponse")
4797                    }
4798                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4799                    where
4800                        E: serde::de::Error,
4801                    {
4802                        use std::result::Result::Ok;
4803                        use std::string::ToString;
4804                        match value {
4805                            "connections" => Ok(__FieldTag::__connections),
4806                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
4807                            "next_page_token" => Ok(__FieldTag::__next_page_token),
4808                            "unreachable" => Ok(__FieldTag::__unreachable),
4809                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4810                        }
4811                    }
4812                }
4813                deserializer.deserialize_identifier(Visitor)
4814            }
4815        }
4816        struct Visitor;
4817        impl<'de> serde::de::Visitor<'de> for Visitor {
4818            type Value = ListConnectionsResponse;
4819            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4820                formatter.write_str("struct ListConnectionsResponse")
4821            }
4822            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4823            where
4824                A: serde::de::MapAccess<'de>,
4825            {
4826                #[allow(unused_imports)]
4827                use serde::de::Error;
4828                use std::option::Option::Some;
4829                let mut fields = std::collections::HashSet::new();
4830                let mut result = Self::Value::new();
4831                while let Some(tag) = map.next_key::<__FieldTag>()? {
4832                    #[allow(clippy::match_single_binding)]
4833                    match tag {
4834                        __FieldTag::__connections => {
4835                            if !fields.insert(__FieldTag::__connections) {
4836                                return std::result::Result::Err(A::Error::duplicate_field(
4837                                    "multiple values for connections",
4838                                ));
4839                            }
4840                            result.connections = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Connection>>>()?.unwrap_or_default();
4841                        }
4842                        __FieldTag::__next_page_token => {
4843                            if !fields.insert(__FieldTag::__next_page_token) {
4844                                return std::result::Result::Err(A::Error::duplicate_field(
4845                                    "multiple values for next_page_token",
4846                                ));
4847                            }
4848                            result.next_page_token = map
4849                                .next_value::<std::option::Option<std::string::String>>()?
4850                                .unwrap_or_default();
4851                        }
4852                        __FieldTag::__unreachable => {
4853                            if !fields.insert(__FieldTag::__unreachable) {
4854                                return std::result::Result::Err(A::Error::duplicate_field(
4855                                    "multiple values for unreachable",
4856                                ));
4857                            }
4858                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
4859                        }
4860                        __FieldTag::Unknown(key) => {
4861                            let value = map.next_value::<serde_json::Value>()?;
4862                            result._unknown_fields.insert(key, value);
4863                        }
4864                    }
4865                }
4866                std::result::Result::Ok(result)
4867            }
4868        }
4869        deserializer.deserialize_any(Visitor)
4870    }
4871}
4872
4873#[doc(hidden)]
4874impl serde::ser::Serialize for ListConnectionsResponse {
4875    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4876    where
4877        S: serde::ser::Serializer,
4878    {
4879        use serde::ser::SerializeMap;
4880        #[allow(unused_imports)]
4881        use std::option::Option::Some;
4882        let mut state = serializer.serialize_map(std::option::Option::None)?;
4883        if !self.connections.is_empty() {
4884            state.serialize_entry("connections", &self.connections)?;
4885        }
4886        if !self.next_page_token.is_empty() {
4887            state.serialize_entry("nextPageToken", &self.next_page_token)?;
4888        }
4889        if !self.unreachable.is_empty() {
4890            state.serialize_entry("unreachable", &self.unreachable)?;
4891        }
4892        if !self._unknown_fields.is_empty() {
4893            for (key, value) in self._unknown_fields.iter() {
4894                state.serialize_entry(key, &value)?;
4895            }
4896        }
4897        state.end()
4898    }
4899}
4900
4901/// Message for getting a Connection
4902#[derive(Clone, Debug, Default, PartialEq)]
4903#[non_exhaustive]
4904pub struct GetConnectionRequest {
4905    /// Required. Name of the resource
4906    pub name: std::string::String,
4907
4908    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4909}
4910
4911impl GetConnectionRequest {
4912    pub fn new() -> Self {
4913        std::default::Default::default()
4914    }
4915
4916    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
4917    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4918        self.name = v.into();
4919        self
4920    }
4921}
4922
4923impl wkt::message::Message for GetConnectionRequest {
4924    fn typename() -> &'static str {
4925        "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
4926    }
4927}
4928
4929#[doc(hidden)]
4930impl<'de> serde::de::Deserialize<'de> for GetConnectionRequest {
4931    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4932    where
4933        D: serde::Deserializer<'de>,
4934    {
4935        #[allow(non_camel_case_types)]
4936        #[doc(hidden)]
4937        #[derive(PartialEq, Eq, Hash)]
4938        enum __FieldTag {
4939            __name,
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 GetConnectionRequest")
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                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4962                        }
4963                    }
4964                }
4965                deserializer.deserialize_identifier(Visitor)
4966            }
4967        }
4968        struct Visitor;
4969        impl<'de> serde::de::Visitor<'de> for Visitor {
4970            type Value = GetConnectionRequest;
4971            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4972                formatter.write_str("struct GetConnectionRequest")
4973            }
4974            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4975            where
4976                A: serde::de::MapAccess<'de>,
4977            {
4978                #[allow(unused_imports)]
4979                use serde::de::Error;
4980                use std::option::Option::Some;
4981                let mut fields = std::collections::HashSet::new();
4982                let mut result = Self::Value::new();
4983                while let Some(tag) = map.next_key::<__FieldTag>()? {
4984                    #[allow(clippy::match_single_binding)]
4985                    match tag {
4986                        __FieldTag::__name => {
4987                            if !fields.insert(__FieldTag::__name) {
4988                                return std::result::Result::Err(A::Error::duplicate_field(
4989                                    "multiple values for name",
4990                                ));
4991                            }
4992                            result.name = map
4993                                .next_value::<std::option::Option<std::string::String>>()?
4994                                .unwrap_or_default();
4995                        }
4996                        __FieldTag::Unknown(key) => {
4997                            let value = map.next_value::<serde_json::Value>()?;
4998                            result._unknown_fields.insert(key, value);
4999                        }
5000                    }
5001                }
5002                std::result::Result::Ok(result)
5003            }
5004        }
5005        deserializer.deserialize_any(Visitor)
5006    }
5007}
5008
5009#[doc(hidden)]
5010impl serde::ser::Serialize for GetConnectionRequest {
5011    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5012    where
5013        S: serde::ser::Serializer,
5014    {
5015        use serde::ser::SerializeMap;
5016        #[allow(unused_imports)]
5017        use std::option::Option::Some;
5018        let mut state = serializer.serialize_map(std::option::Option::None)?;
5019        if !self.name.is_empty() {
5020            state.serialize_entry("name", &self.name)?;
5021        }
5022        if !self._unknown_fields.is_empty() {
5023            for (key, value) in self._unknown_fields.iter() {
5024                state.serialize_entry(key, &value)?;
5025            }
5026        }
5027        state.end()
5028    }
5029}
5030
5031/// Message for creating a Connection
5032#[derive(Clone, Debug, Default, PartialEq)]
5033#[non_exhaustive]
5034pub struct CreateConnectionRequest {
5035    /// Required. Value for parent.
5036    pub parent: std::string::String,
5037
5038    /// Required. Id of the requesting object
5039    /// If auto-generating Id server-side, remove this field and
5040    /// connection_id from the method_signature of Create RPC
5041    pub connection_id: std::string::String,
5042
5043    /// Required. The resource being created
5044    pub connection: std::option::Option<crate::model::Connection>,
5045
5046    /// Optional. An optional request ID to identify requests. Specify a unique
5047    /// request ID so that if you must retry your request, the server will know to
5048    /// ignore the request if it has already been completed. The server will
5049    /// guarantee that for at least 60 minutes since the first request.
5050    ///
5051    /// For example, consider a situation where you make an initial request and the
5052    /// request times out. If you make the request again with the same request
5053    /// ID, the server can check if original operation with the same request ID
5054    /// was received, and if so, will ignore the second request. This prevents
5055    /// clients from accidentally creating duplicate commitments.
5056    ///
5057    /// The request ID must be a valid UUID with the exception that zero UUID is
5058    /// not supported (00000000-0000-0000-0000-000000000000).
5059    pub request_id: std::string::String,
5060
5061    /// Optional. If set, validate the request, but do not actually post it.
5062    pub validate_only: bool,
5063
5064    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5065}
5066
5067impl CreateConnectionRequest {
5068    pub fn new() -> Self {
5069        std::default::Default::default()
5070    }
5071
5072    /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
5073    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5074        self.parent = v.into();
5075        self
5076    }
5077
5078    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
5079    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5080        self.connection_id = v.into();
5081        self
5082    }
5083
5084    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
5085    pub fn set_connection<T>(mut self, v: T) -> Self
5086    where
5087        T: std::convert::Into<crate::model::Connection>,
5088    {
5089        self.connection = std::option::Option::Some(v.into());
5090        self
5091    }
5092
5093    /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
5094    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
5095    where
5096        T: std::convert::Into<crate::model::Connection>,
5097    {
5098        self.connection = v.map(|x| x.into());
5099        self
5100    }
5101
5102    /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
5103    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5104        self.request_id = v.into();
5105        self
5106    }
5107
5108    /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
5109    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5110        self.validate_only = v.into();
5111        self
5112    }
5113}
5114
5115impl wkt::message::Message for CreateConnectionRequest {
5116    fn typename() -> &'static str {
5117        "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
5118    }
5119}
5120
5121#[doc(hidden)]
5122impl<'de> serde::de::Deserialize<'de> for CreateConnectionRequest {
5123    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5124    where
5125        D: serde::Deserializer<'de>,
5126    {
5127        #[allow(non_camel_case_types)]
5128        #[doc(hidden)]
5129        #[derive(PartialEq, Eq, Hash)]
5130        enum __FieldTag {
5131            __parent,
5132            __connection_id,
5133            __connection,
5134            __request_id,
5135            __validate_only,
5136            Unknown(std::string::String),
5137        }
5138        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5139            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5140            where
5141                D: serde::Deserializer<'de>,
5142            {
5143                struct Visitor;
5144                impl<'de> serde::de::Visitor<'de> for Visitor {
5145                    type Value = __FieldTag;
5146                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5147                        formatter.write_str("a field name for CreateConnectionRequest")
5148                    }
5149                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5150                    where
5151                        E: serde::de::Error,
5152                    {
5153                        use std::result::Result::Ok;
5154                        use std::string::ToString;
5155                        match value {
5156                            "parent" => Ok(__FieldTag::__parent),
5157                            "connectionId" => Ok(__FieldTag::__connection_id),
5158                            "connection_id" => Ok(__FieldTag::__connection_id),
5159                            "connection" => Ok(__FieldTag::__connection),
5160                            "requestId" => Ok(__FieldTag::__request_id),
5161                            "request_id" => Ok(__FieldTag::__request_id),
5162                            "validateOnly" => Ok(__FieldTag::__validate_only),
5163                            "validate_only" => Ok(__FieldTag::__validate_only),
5164                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5165                        }
5166                    }
5167                }
5168                deserializer.deserialize_identifier(Visitor)
5169            }
5170        }
5171        struct Visitor;
5172        impl<'de> serde::de::Visitor<'de> for Visitor {
5173            type Value = CreateConnectionRequest;
5174            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5175                formatter.write_str("struct CreateConnectionRequest")
5176            }
5177            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5178            where
5179                A: serde::de::MapAccess<'de>,
5180            {
5181                #[allow(unused_imports)]
5182                use serde::de::Error;
5183                use std::option::Option::Some;
5184                let mut fields = std::collections::HashSet::new();
5185                let mut result = Self::Value::new();
5186                while let Some(tag) = map.next_key::<__FieldTag>()? {
5187                    #[allow(clippy::match_single_binding)]
5188                    match tag {
5189                        __FieldTag::__parent => {
5190                            if !fields.insert(__FieldTag::__parent) {
5191                                return std::result::Result::Err(A::Error::duplicate_field(
5192                                    "multiple values for parent",
5193                                ));
5194                            }
5195                            result.parent = map
5196                                .next_value::<std::option::Option<std::string::String>>()?
5197                                .unwrap_or_default();
5198                        }
5199                        __FieldTag::__connection_id => {
5200                            if !fields.insert(__FieldTag::__connection_id) {
5201                                return std::result::Result::Err(A::Error::duplicate_field(
5202                                    "multiple values for connection_id",
5203                                ));
5204                            }
5205                            result.connection_id = map
5206                                .next_value::<std::option::Option<std::string::String>>()?
5207                                .unwrap_or_default();
5208                        }
5209                        __FieldTag::__connection => {
5210                            if !fields.insert(__FieldTag::__connection) {
5211                                return std::result::Result::Err(A::Error::duplicate_field(
5212                                    "multiple values for connection",
5213                                ));
5214                            }
5215                            result.connection =
5216                                map.next_value::<std::option::Option<crate::model::Connection>>()?;
5217                        }
5218                        __FieldTag::__request_id => {
5219                            if !fields.insert(__FieldTag::__request_id) {
5220                                return std::result::Result::Err(A::Error::duplicate_field(
5221                                    "multiple values for request_id",
5222                                ));
5223                            }
5224                            result.request_id = map
5225                                .next_value::<std::option::Option<std::string::String>>()?
5226                                .unwrap_or_default();
5227                        }
5228                        __FieldTag::__validate_only => {
5229                            if !fields.insert(__FieldTag::__validate_only) {
5230                                return std::result::Result::Err(A::Error::duplicate_field(
5231                                    "multiple values for validate_only",
5232                                ));
5233                            }
5234                            result.validate_only = map
5235                                .next_value::<std::option::Option<bool>>()?
5236                                .unwrap_or_default();
5237                        }
5238                        __FieldTag::Unknown(key) => {
5239                            let value = map.next_value::<serde_json::Value>()?;
5240                            result._unknown_fields.insert(key, value);
5241                        }
5242                    }
5243                }
5244                std::result::Result::Ok(result)
5245            }
5246        }
5247        deserializer.deserialize_any(Visitor)
5248    }
5249}
5250
5251#[doc(hidden)]
5252impl serde::ser::Serialize for CreateConnectionRequest {
5253    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5254    where
5255        S: serde::ser::Serializer,
5256    {
5257        use serde::ser::SerializeMap;
5258        #[allow(unused_imports)]
5259        use std::option::Option::Some;
5260        let mut state = serializer.serialize_map(std::option::Option::None)?;
5261        if !self.parent.is_empty() {
5262            state.serialize_entry("parent", &self.parent)?;
5263        }
5264        if !self.connection_id.is_empty() {
5265            state.serialize_entry("connectionId", &self.connection_id)?;
5266        }
5267        if self.connection.is_some() {
5268            state.serialize_entry("connection", &self.connection)?;
5269        }
5270        if !self.request_id.is_empty() {
5271            state.serialize_entry("requestId", &self.request_id)?;
5272        }
5273        if !wkt::internal::is_default(&self.validate_only) {
5274            state.serialize_entry("validateOnly", &self.validate_only)?;
5275        }
5276        if !self._unknown_fields.is_empty() {
5277            for (key, value) in self._unknown_fields.iter() {
5278                state.serialize_entry(key, &value)?;
5279            }
5280        }
5281        state.end()
5282    }
5283}
5284
5285/// Message for updating a Connection
5286#[derive(Clone, Debug, Default, PartialEq)]
5287#[non_exhaustive]
5288pub struct UpdateConnectionRequest {
5289    /// Required. Field mask is used to specify the fields to be overwritten in the
5290    /// Connection resource by the update.
5291    /// The fields specified in the update_mask are relative to the resource, not
5292    /// the full request. A field will be overwritten if it is in the mask. If the
5293    /// user does not provide a mask then all fields will be overwritten.
5294    pub update_mask: std::option::Option<wkt::FieldMask>,
5295
5296    /// Required. The resource being updated
5297    pub connection: std::option::Option<crate::model::Connection>,
5298
5299    /// Optional. An optional request ID to identify requests. Specify a unique
5300    /// request ID so that if you must retry your request, the server will know to
5301    /// ignore the request if it has already been completed. The server will
5302    /// guarantee that for at least 60 minutes since the first request.
5303    ///
5304    /// For example, consider a situation where you make an initial request and the
5305    /// request times out. If you make the request again with the same request
5306    /// ID, the server can check if original operation with the same request ID
5307    /// was received, and if so, will ignore the second request. This prevents
5308    /// clients from accidentally creating duplicate commitments.
5309    ///
5310    /// The request ID must be a valid UUID with the exception that zero UUID is
5311    /// not supported (00000000-0000-0000-0000-000000000000).
5312    pub request_id: std::string::String,
5313
5314    /// Optional. If set to true, and the connection is not found a new connection
5315    /// will be created. In this situation `update_mask` is ignored.
5316    /// The creation will succeed only if the input connection has all the
5317    /// necessary information (e.g a github_config with both  user_oauth_token and
5318    /// installation_id properties).
5319    pub allow_missing: bool,
5320
5321    /// Optional. If set, validate the request, but do not actually post it.
5322    pub validate_only: bool,
5323
5324    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5325}
5326
5327impl UpdateConnectionRequest {
5328    pub fn new() -> Self {
5329        std::default::Default::default()
5330    }
5331
5332    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
5333    pub fn set_update_mask<T>(mut self, v: T) -> Self
5334    where
5335        T: std::convert::Into<wkt::FieldMask>,
5336    {
5337        self.update_mask = std::option::Option::Some(v.into());
5338        self
5339    }
5340
5341    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
5342    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5343    where
5344        T: std::convert::Into<wkt::FieldMask>,
5345    {
5346        self.update_mask = v.map(|x| x.into());
5347        self
5348    }
5349
5350    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
5351    pub fn set_connection<T>(mut self, v: T) -> Self
5352    where
5353        T: std::convert::Into<crate::model::Connection>,
5354    {
5355        self.connection = std::option::Option::Some(v.into());
5356        self
5357    }
5358
5359    /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
5360    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
5361    where
5362        T: std::convert::Into<crate::model::Connection>,
5363    {
5364        self.connection = v.map(|x| x.into());
5365        self
5366    }
5367
5368    /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
5369    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5370        self.request_id = v.into();
5371        self
5372    }
5373
5374    /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
5375    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5376        self.allow_missing = v.into();
5377        self
5378    }
5379
5380    /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
5381    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5382        self.validate_only = v.into();
5383        self
5384    }
5385}
5386
5387impl wkt::message::Message for UpdateConnectionRequest {
5388    fn typename() -> &'static str {
5389        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
5390    }
5391}
5392
5393#[doc(hidden)]
5394impl<'de> serde::de::Deserialize<'de> for UpdateConnectionRequest {
5395    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5396    where
5397        D: serde::Deserializer<'de>,
5398    {
5399        #[allow(non_camel_case_types)]
5400        #[doc(hidden)]
5401        #[derive(PartialEq, Eq, Hash)]
5402        enum __FieldTag {
5403            __update_mask,
5404            __connection,
5405            __request_id,
5406            __allow_missing,
5407            __validate_only,
5408            Unknown(std::string::String),
5409        }
5410        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5411            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5412            where
5413                D: serde::Deserializer<'de>,
5414            {
5415                struct Visitor;
5416                impl<'de> serde::de::Visitor<'de> for Visitor {
5417                    type Value = __FieldTag;
5418                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5419                        formatter.write_str("a field name for UpdateConnectionRequest")
5420                    }
5421                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5422                    where
5423                        E: serde::de::Error,
5424                    {
5425                        use std::result::Result::Ok;
5426                        use std::string::ToString;
5427                        match value {
5428                            "updateMask" => Ok(__FieldTag::__update_mask),
5429                            "update_mask" => Ok(__FieldTag::__update_mask),
5430                            "connection" => Ok(__FieldTag::__connection),
5431                            "requestId" => Ok(__FieldTag::__request_id),
5432                            "request_id" => Ok(__FieldTag::__request_id),
5433                            "allowMissing" => Ok(__FieldTag::__allow_missing),
5434                            "allow_missing" => Ok(__FieldTag::__allow_missing),
5435                            "validateOnly" => Ok(__FieldTag::__validate_only),
5436                            "validate_only" => Ok(__FieldTag::__validate_only),
5437                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5438                        }
5439                    }
5440                }
5441                deserializer.deserialize_identifier(Visitor)
5442            }
5443        }
5444        struct Visitor;
5445        impl<'de> serde::de::Visitor<'de> for Visitor {
5446            type Value = UpdateConnectionRequest;
5447            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5448                formatter.write_str("struct UpdateConnectionRequest")
5449            }
5450            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5451            where
5452                A: serde::de::MapAccess<'de>,
5453            {
5454                #[allow(unused_imports)]
5455                use serde::de::Error;
5456                use std::option::Option::Some;
5457                let mut fields = std::collections::HashSet::new();
5458                let mut result = Self::Value::new();
5459                while let Some(tag) = map.next_key::<__FieldTag>()? {
5460                    #[allow(clippy::match_single_binding)]
5461                    match tag {
5462                        __FieldTag::__update_mask => {
5463                            if !fields.insert(__FieldTag::__update_mask) {
5464                                return std::result::Result::Err(A::Error::duplicate_field(
5465                                    "multiple values for update_mask",
5466                                ));
5467                            }
5468                            result.update_mask =
5469                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
5470                        }
5471                        __FieldTag::__connection => {
5472                            if !fields.insert(__FieldTag::__connection) {
5473                                return std::result::Result::Err(A::Error::duplicate_field(
5474                                    "multiple values for connection",
5475                                ));
5476                            }
5477                            result.connection =
5478                                map.next_value::<std::option::Option<crate::model::Connection>>()?;
5479                        }
5480                        __FieldTag::__request_id => {
5481                            if !fields.insert(__FieldTag::__request_id) {
5482                                return std::result::Result::Err(A::Error::duplicate_field(
5483                                    "multiple values for request_id",
5484                                ));
5485                            }
5486                            result.request_id = map
5487                                .next_value::<std::option::Option<std::string::String>>()?
5488                                .unwrap_or_default();
5489                        }
5490                        __FieldTag::__allow_missing => {
5491                            if !fields.insert(__FieldTag::__allow_missing) {
5492                                return std::result::Result::Err(A::Error::duplicate_field(
5493                                    "multiple values for allow_missing",
5494                                ));
5495                            }
5496                            result.allow_missing = map
5497                                .next_value::<std::option::Option<bool>>()?
5498                                .unwrap_or_default();
5499                        }
5500                        __FieldTag::__validate_only => {
5501                            if !fields.insert(__FieldTag::__validate_only) {
5502                                return std::result::Result::Err(A::Error::duplicate_field(
5503                                    "multiple values for validate_only",
5504                                ));
5505                            }
5506                            result.validate_only = map
5507                                .next_value::<std::option::Option<bool>>()?
5508                                .unwrap_or_default();
5509                        }
5510                        __FieldTag::Unknown(key) => {
5511                            let value = map.next_value::<serde_json::Value>()?;
5512                            result._unknown_fields.insert(key, value);
5513                        }
5514                    }
5515                }
5516                std::result::Result::Ok(result)
5517            }
5518        }
5519        deserializer.deserialize_any(Visitor)
5520    }
5521}
5522
5523#[doc(hidden)]
5524impl serde::ser::Serialize for UpdateConnectionRequest {
5525    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5526    where
5527        S: serde::ser::Serializer,
5528    {
5529        use serde::ser::SerializeMap;
5530        #[allow(unused_imports)]
5531        use std::option::Option::Some;
5532        let mut state = serializer.serialize_map(std::option::Option::None)?;
5533        if self.update_mask.is_some() {
5534            state.serialize_entry("updateMask", &self.update_mask)?;
5535        }
5536        if self.connection.is_some() {
5537            state.serialize_entry("connection", &self.connection)?;
5538        }
5539        if !self.request_id.is_empty() {
5540            state.serialize_entry("requestId", &self.request_id)?;
5541        }
5542        if !wkt::internal::is_default(&self.allow_missing) {
5543            state.serialize_entry("allowMissing", &self.allow_missing)?;
5544        }
5545        if !wkt::internal::is_default(&self.validate_only) {
5546            state.serialize_entry("validateOnly", &self.validate_only)?;
5547        }
5548        if !self._unknown_fields.is_empty() {
5549            for (key, value) in self._unknown_fields.iter() {
5550                state.serialize_entry(key, &value)?;
5551            }
5552        }
5553        state.end()
5554    }
5555}
5556
5557/// Message for deleting a Connection
5558#[derive(Clone, Debug, Default, PartialEq)]
5559#[non_exhaustive]
5560pub struct DeleteConnectionRequest {
5561    /// Required. Name of the resource
5562    pub name: std::string::String,
5563
5564    /// Optional. An optional request ID to identify requests. Specify a unique
5565    /// request ID so that if you must retry your request, the server will know to
5566    /// ignore the request if it has already been completed. The server will
5567    /// guarantee that for at least 60 minutes after the first request.
5568    ///
5569    /// For example, consider a situation where you make an initial request and the
5570    /// request times out. If you make the request again with the same request
5571    /// ID, the server can check if original operation with the same request ID
5572    /// was received, and if so, will ignore the second request. This prevents
5573    /// clients from accidentally creating duplicate commitments.
5574    ///
5575    /// The request ID must be a valid UUID with the exception that zero UUID is
5576    /// not supported (00000000-0000-0000-0000-000000000000).
5577    pub request_id: std::string::String,
5578
5579    /// Optional. If set, validate the request, but do not actually post it.
5580    pub validate_only: bool,
5581
5582    /// Optional. The current etag of the Connection.
5583    /// If an etag is provided and does not match the current etag of the
5584    /// Connection, deletion will be blocked and an ABORTED error will be returned.
5585    pub etag: std::string::String,
5586
5587    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5588}
5589
5590impl DeleteConnectionRequest {
5591    pub fn new() -> Self {
5592        std::default::Default::default()
5593    }
5594
5595    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
5596    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5597        self.name = v.into();
5598        self
5599    }
5600
5601    /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
5602    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5603        self.request_id = v.into();
5604        self
5605    }
5606
5607    /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
5608    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5609        self.validate_only = v.into();
5610        self
5611    }
5612
5613    /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
5614    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5615        self.etag = v.into();
5616        self
5617    }
5618}
5619
5620impl wkt::message::Message for DeleteConnectionRequest {
5621    fn typename() -> &'static str {
5622        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
5623    }
5624}
5625
5626#[doc(hidden)]
5627impl<'de> serde::de::Deserialize<'de> for DeleteConnectionRequest {
5628    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5629    where
5630        D: serde::Deserializer<'de>,
5631    {
5632        #[allow(non_camel_case_types)]
5633        #[doc(hidden)]
5634        #[derive(PartialEq, Eq, Hash)]
5635        enum __FieldTag {
5636            __name,
5637            __request_id,
5638            __validate_only,
5639            __etag,
5640            Unknown(std::string::String),
5641        }
5642        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5643            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5644            where
5645                D: serde::Deserializer<'de>,
5646            {
5647                struct Visitor;
5648                impl<'de> serde::de::Visitor<'de> for Visitor {
5649                    type Value = __FieldTag;
5650                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5651                        formatter.write_str("a field name for DeleteConnectionRequest")
5652                    }
5653                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5654                    where
5655                        E: serde::de::Error,
5656                    {
5657                        use std::result::Result::Ok;
5658                        use std::string::ToString;
5659                        match value {
5660                            "name" => Ok(__FieldTag::__name),
5661                            "requestId" => Ok(__FieldTag::__request_id),
5662                            "request_id" => Ok(__FieldTag::__request_id),
5663                            "validateOnly" => Ok(__FieldTag::__validate_only),
5664                            "validate_only" => Ok(__FieldTag::__validate_only),
5665                            "etag" => Ok(__FieldTag::__etag),
5666                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5667                        }
5668                    }
5669                }
5670                deserializer.deserialize_identifier(Visitor)
5671            }
5672        }
5673        struct Visitor;
5674        impl<'de> serde::de::Visitor<'de> for Visitor {
5675            type Value = DeleteConnectionRequest;
5676            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5677                formatter.write_str("struct DeleteConnectionRequest")
5678            }
5679            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5680            where
5681                A: serde::de::MapAccess<'de>,
5682            {
5683                #[allow(unused_imports)]
5684                use serde::de::Error;
5685                use std::option::Option::Some;
5686                let mut fields = std::collections::HashSet::new();
5687                let mut result = Self::Value::new();
5688                while let Some(tag) = map.next_key::<__FieldTag>()? {
5689                    #[allow(clippy::match_single_binding)]
5690                    match tag {
5691                        __FieldTag::__name => {
5692                            if !fields.insert(__FieldTag::__name) {
5693                                return std::result::Result::Err(A::Error::duplicate_field(
5694                                    "multiple values for name",
5695                                ));
5696                            }
5697                            result.name = map
5698                                .next_value::<std::option::Option<std::string::String>>()?
5699                                .unwrap_or_default();
5700                        }
5701                        __FieldTag::__request_id => {
5702                            if !fields.insert(__FieldTag::__request_id) {
5703                                return std::result::Result::Err(A::Error::duplicate_field(
5704                                    "multiple values for request_id",
5705                                ));
5706                            }
5707                            result.request_id = map
5708                                .next_value::<std::option::Option<std::string::String>>()?
5709                                .unwrap_or_default();
5710                        }
5711                        __FieldTag::__validate_only => {
5712                            if !fields.insert(__FieldTag::__validate_only) {
5713                                return std::result::Result::Err(A::Error::duplicate_field(
5714                                    "multiple values for validate_only",
5715                                ));
5716                            }
5717                            result.validate_only = map
5718                                .next_value::<std::option::Option<bool>>()?
5719                                .unwrap_or_default();
5720                        }
5721                        __FieldTag::__etag => {
5722                            if !fields.insert(__FieldTag::__etag) {
5723                                return std::result::Result::Err(A::Error::duplicate_field(
5724                                    "multiple values for etag",
5725                                ));
5726                            }
5727                            result.etag = map
5728                                .next_value::<std::option::Option<std::string::String>>()?
5729                                .unwrap_or_default();
5730                        }
5731                        __FieldTag::Unknown(key) => {
5732                            let value = map.next_value::<serde_json::Value>()?;
5733                            result._unknown_fields.insert(key, value);
5734                        }
5735                    }
5736                }
5737                std::result::Result::Ok(result)
5738            }
5739        }
5740        deserializer.deserialize_any(Visitor)
5741    }
5742}
5743
5744#[doc(hidden)]
5745impl serde::ser::Serialize for DeleteConnectionRequest {
5746    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5747    where
5748        S: serde::ser::Serializer,
5749    {
5750        use serde::ser::SerializeMap;
5751        #[allow(unused_imports)]
5752        use std::option::Option::Some;
5753        let mut state = serializer.serialize_map(std::option::Option::None)?;
5754        if !self.name.is_empty() {
5755            state.serialize_entry("name", &self.name)?;
5756        }
5757        if !self.request_id.is_empty() {
5758            state.serialize_entry("requestId", &self.request_id)?;
5759        }
5760        if !wkt::internal::is_default(&self.validate_only) {
5761            state.serialize_entry("validateOnly", &self.validate_only)?;
5762        }
5763        if !self.etag.is_empty() {
5764            state.serialize_entry("etag", &self.etag)?;
5765        }
5766        if !self._unknown_fields.is_empty() {
5767            for (key, value) in self._unknown_fields.iter() {
5768                state.serialize_entry(key, &value)?;
5769            }
5770        }
5771        state.end()
5772    }
5773}
5774
5775/// Message for requesting list of AccountConnectors
5776#[derive(Clone, Debug, Default, PartialEq)]
5777#[non_exhaustive]
5778pub struct ListAccountConnectorsRequest {
5779    /// Required. Parent value for ListAccountConnectorsRequest
5780    pub parent: std::string::String,
5781
5782    /// Optional. Requested page size. Server may return fewer items than
5783    /// requested. If unspecified, server will pick an appropriate default.
5784    pub page_size: i32,
5785
5786    /// Optional. A token identifying a page of results the server should return.
5787    pub page_token: std::string::String,
5788
5789    /// Optional. Filtering results
5790    pub filter: std::string::String,
5791
5792    /// Optional. Hint for how to order the results
5793    pub order_by: std::string::String,
5794
5795    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5796}
5797
5798impl ListAccountConnectorsRequest {
5799    pub fn new() -> Self {
5800        std::default::Default::default()
5801    }
5802
5803    /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
5804    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5805        self.parent = v.into();
5806        self
5807    }
5808
5809    /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
5810    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5811        self.page_size = v.into();
5812        self
5813    }
5814
5815    /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
5816    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5817        self.page_token = v.into();
5818        self
5819    }
5820
5821    /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
5822    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5823        self.filter = v.into();
5824        self
5825    }
5826
5827    /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
5828    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5829        self.order_by = v.into();
5830        self
5831    }
5832}
5833
5834impl wkt::message::Message for ListAccountConnectorsRequest {
5835    fn typename() -> &'static str {
5836        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
5837    }
5838}
5839
5840#[doc(hidden)]
5841impl<'de> serde::de::Deserialize<'de> for ListAccountConnectorsRequest {
5842    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5843    where
5844        D: serde::Deserializer<'de>,
5845    {
5846        #[allow(non_camel_case_types)]
5847        #[doc(hidden)]
5848        #[derive(PartialEq, Eq, Hash)]
5849        enum __FieldTag {
5850            __parent,
5851            __page_size,
5852            __page_token,
5853            __filter,
5854            __order_by,
5855            Unknown(std::string::String),
5856        }
5857        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5858            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5859            where
5860                D: serde::Deserializer<'de>,
5861            {
5862                struct Visitor;
5863                impl<'de> serde::de::Visitor<'de> for Visitor {
5864                    type Value = __FieldTag;
5865                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5866                        formatter.write_str("a field name for ListAccountConnectorsRequest")
5867                    }
5868                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5869                    where
5870                        E: serde::de::Error,
5871                    {
5872                        use std::result::Result::Ok;
5873                        use std::string::ToString;
5874                        match value {
5875                            "parent" => Ok(__FieldTag::__parent),
5876                            "pageSize" => Ok(__FieldTag::__page_size),
5877                            "page_size" => Ok(__FieldTag::__page_size),
5878                            "pageToken" => Ok(__FieldTag::__page_token),
5879                            "page_token" => Ok(__FieldTag::__page_token),
5880                            "filter" => Ok(__FieldTag::__filter),
5881                            "orderBy" => Ok(__FieldTag::__order_by),
5882                            "order_by" => Ok(__FieldTag::__order_by),
5883                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5884                        }
5885                    }
5886                }
5887                deserializer.deserialize_identifier(Visitor)
5888            }
5889        }
5890        struct Visitor;
5891        impl<'de> serde::de::Visitor<'de> for Visitor {
5892            type Value = ListAccountConnectorsRequest;
5893            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5894                formatter.write_str("struct ListAccountConnectorsRequest")
5895            }
5896            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5897            where
5898                A: serde::de::MapAccess<'de>,
5899            {
5900                #[allow(unused_imports)]
5901                use serde::de::Error;
5902                use std::option::Option::Some;
5903                let mut fields = std::collections::HashSet::new();
5904                let mut result = Self::Value::new();
5905                while let Some(tag) = map.next_key::<__FieldTag>()? {
5906                    #[allow(clippy::match_single_binding)]
5907                    match tag {
5908                        __FieldTag::__parent => {
5909                            if !fields.insert(__FieldTag::__parent) {
5910                                return std::result::Result::Err(A::Error::duplicate_field(
5911                                    "multiple values for parent",
5912                                ));
5913                            }
5914                            result.parent = map
5915                                .next_value::<std::option::Option<std::string::String>>()?
5916                                .unwrap_or_default();
5917                        }
5918                        __FieldTag::__page_size => {
5919                            if !fields.insert(__FieldTag::__page_size) {
5920                                return std::result::Result::Err(A::Error::duplicate_field(
5921                                    "multiple values for page_size",
5922                                ));
5923                            }
5924                            struct __With(std::option::Option<i32>);
5925                            impl<'de> serde::de::Deserialize<'de> for __With {
5926                                fn deserialize<D>(
5927                                    deserializer: D,
5928                                ) -> std::result::Result<Self, D::Error>
5929                                where
5930                                    D: serde::de::Deserializer<'de>,
5931                                {
5932                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5933                                }
5934                            }
5935                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
5936                        }
5937                        __FieldTag::__page_token => {
5938                            if !fields.insert(__FieldTag::__page_token) {
5939                                return std::result::Result::Err(A::Error::duplicate_field(
5940                                    "multiple values for page_token",
5941                                ));
5942                            }
5943                            result.page_token = map
5944                                .next_value::<std::option::Option<std::string::String>>()?
5945                                .unwrap_or_default();
5946                        }
5947                        __FieldTag::__filter => {
5948                            if !fields.insert(__FieldTag::__filter) {
5949                                return std::result::Result::Err(A::Error::duplicate_field(
5950                                    "multiple values for filter",
5951                                ));
5952                            }
5953                            result.filter = map
5954                                .next_value::<std::option::Option<std::string::String>>()?
5955                                .unwrap_or_default();
5956                        }
5957                        __FieldTag::__order_by => {
5958                            if !fields.insert(__FieldTag::__order_by) {
5959                                return std::result::Result::Err(A::Error::duplicate_field(
5960                                    "multiple values for order_by",
5961                                ));
5962                            }
5963                            result.order_by = map
5964                                .next_value::<std::option::Option<std::string::String>>()?
5965                                .unwrap_or_default();
5966                        }
5967                        __FieldTag::Unknown(key) => {
5968                            let value = map.next_value::<serde_json::Value>()?;
5969                            result._unknown_fields.insert(key, value);
5970                        }
5971                    }
5972                }
5973                std::result::Result::Ok(result)
5974            }
5975        }
5976        deserializer.deserialize_any(Visitor)
5977    }
5978}
5979
5980#[doc(hidden)]
5981impl serde::ser::Serialize for ListAccountConnectorsRequest {
5982    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5983    where
5984        S: serde::ser::Serializer,
5985    {
5986        use serde::ser::SerializeMap;
5987        #[allow(unused_imports)]
5988        use std::option::Option::Some;
5989        let mut state = serializer.serialize_map(std::option::Option::None)?;
5990        if !self.parent.is_empty() {
5991            state.serialize_entry("parent", &self.parent)?;
5992        }
5993        if !wkt::internal::is_default(&self.page_size) {
5994            struct __With<'a>(&'a i32);
5995            impl<'a> serde::ser::Serialize for __With<'a> {
5996                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5997                where
5998                    S: serde::ser::Serializer,
5999                {
6000                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
6001                }
6002            }
6003            state.serialize_entry("pageSize", &__With(&self.page_size))?;
6004        }
6005        if !self.page_token.is_empty() {
6006            state.serialize_entry("pageToken", &self.page_token)?;
6007        }
6008        if !self.filter.is_empty() {
6009            state.serialize_entry("filter", &self.filter)?;
6010        }
6011        if !self.order_by.is_empty() {
6012            state.serialize_entry("orderBy", &self.order_by)?;
6013        }
6014        if !self._unknown_fields.is_empty() {
6015            for (key, value) in self._unknown_fields.iter() {
6016                state.serialize_entry(key, &value)?;
6017            }
6018        }
6019        state.end()
6020    }
6021}
6022
6023/// Message for response to listing AccountConnectors
6024#[derive(Clone, Debug, Default, PartialEq)]
6025#[non_exhaustive]
6026pub struct ListAccountConnectorsResponse {
6027    /// The list of AccountConnectors
6028    pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
6029
6030    /// A token identifying a page of results the server should return.
6031    pub next_page_token: std::string::String,
6032
6033    /// Locations that could not be reached.
6034    pub unreachable: std::vec::Vec<std::string::String>,
6035
6036    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6037}
6038
6039impl ListAccountConnectorsResponse {
6040    pub fn new() -> Self {
6041        std::default::Default::default()
6042    }
6043
6044    /// Sets the value of [account_connectors][crate::model::ListAccountConnectorsResponse::account_connectors].
6045    pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
6046    where
6047        T: std::iter::IntoIterator<Item = V>,
6048        V: std::convert::Into<crate::model::AccountConnector>,
6049    {
6050        use std::iter::Iterator;
6051        self.account_connectors = v.into_iter().map(|i| i.into()).collect();
6052        self
6053    }
6054
6055    /// Sets the value of [next_page_token][crate::model::ListAccountConnectorsResponse::next_page_token].
6056    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6057        self.next_page_token = v.into();
6058        self
6059    }
6060
6061    /// Sets the value of [unreachable][crate::model::ListAccountConnectorsResponse::unreachable].
6062    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6063    where
6064        T: std::iter::IntoIterator<Item = V>,
6065        V: std::convert::Into<std::string::String>,
6066    {
6067        use std::iter::Iterator;
6068        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6069        self
6070    }
6071}
6072
6073impl wkt::message::Message for ListAccountConnectorsResponse {
6074    fn typename() -> &'static str {
6075        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
6076    }
6077}
6078
6079#[doc(hidden)]
6080impl gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
6081    type PageItem = crate::model::AccountConnector;
6082
6083    fn items(self) -> std::vec::Vec<Self::PageItem> {
6084        self.account_connectors
6085    }
6086
6087    fn next_page_token(&self) -> std::string::String {
6088        use std::clone::Clone;
6089        self.next_page_token.clone()
6090    }
6091}
6092
6093#[doc(hidden)]
6094impl<'de> serde::de::Deserialize<'de> for ListAccountConnectorsResponse {
6095    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6096    where
6097        D: serde::Deserializer<'de>,
6098    {
6099        #[allow(non_camel_case_types)]
6100        #[doc(hidden)]
6101        #[derive(PartialEq, Eq, Hash)]
6102        enum __FieldTag {
6103            __account_connectors,
6104            __next_page_token,
6105            __unreachable,
6106            Unknown(std::string::String),
6107        }
6108        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6109            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6110            where
6111                D: serde::Deserializer<'de>,
6112            {
6113                struct Visitor;
6114                impl<'de> serde::de::Visitor<'de> for Visitor {
6115                    type Value = __FieldTag;
6116                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6117                        formatter.write_str("a field name for ListAccountConnectorsResponse")
6118                    }
6119                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6120                    where
6121                        E: serde::de::Error,
6122                    {
6123                        use std::result::Result::Ok;
6124                        use std::string::ToString;
6125                        match value {
6126                            "accountConnectors" => Ok(__FieldTag::__account_connectors),
6127                            "account_connectors" => Ok(__FieldTag::__account_connectors),
6128                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
6129                            "next_page_token" => Ok(__FieldTag::__next_page_token),
6130                            "unreachable" => Ok(__FieldTag::__unreachable),
6131                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6132                        }
6133                    }
6134                }
6135                deserializer.deserialize_identifier(Visitor)
6136            }
6137        }
6138        struct Visitor;
6139        impl<'de> serde::de::Visitor<'de> for Visitor {
6140            type Value = ListAccountConnectorsResponse;
6141            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6142                formatter.write_str("struct ListAccountConnectorsResponse")
6143            }
6144            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6145            where
6146                A: serde::de::MapAccess<'de>,
6147            {
6148                #[allow(unused_imports)]
6149                use serde::de::Error;
6150                use std::option::Option::Some;
6151                let mut fields = std::collections::HashSet::new();
6152                let mut result = Self::Value::new();
6153                while let Some(tag) = map.next_key::<__FieldTag>()? {
6154                    #[allow(clippy::match_single_binding)]
6155                    match tag {
6156                        __FieldTag::__account_connectors => {
6157                            if !fields.insert(__FieldTag::__account_connectors) {
6158                                return std::result::Result::Err(A::Error::duplicate_field(
6159                                    "multiple values for account_connectors",
6160                                ));
6161                            }
6162                            result.account_connectors =
6163                                map.next_value::<std::option::Option<
6164                                    std::vec::Vec<crate::model::AccountConnector>,
6165                                >>()?
6166                                .unwrap_or_default();
6167                        }
6168                        __FieldTag::__next_page_token => {
6169                            if !fields.insert(__FieldTag::__next_page_token) {
6170                                return std::result::Result::Err(A::Error::duplicate_field(
6171                                    "multiple values for next_page_token",
6172                                ));
6173                            }
6174                            result.next_page_token = map
6175                                .next_value::<std::option::Option<std::string::String>>()?
6176                                .unwrap_or_default();
6177                        }
6178                        __FieldTag::__unreachable => {
6179                            if !fields.insert(__FieldTag::__unreachable) {
6180                                return std::result::Result::Err(A::Error::duplicate_field(
6181                                    "multiple values for unreachable",
6182                                ));
6183                            }
6184                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
6185                        }
6186                        __FieldTag::Unknown(key) => {
6187                            let value = map.next_value::<serde_json::Value>()?;
6188                            result._unknown_fields.insert(key, value);
6189                        }
6190                    }
6191                }
6192                std::result::Result::Ok(result)
6193            }
6194        }
6195        deserializer.deserialize_any(Visitor)
6196    }
6197}
6198
6199#[doc(hidden)]
6200impl serde::ser::Serialize for ListAccountConnectorsResponse {
6201    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6202    where
6203        S: serde::ser::Serializer,
6204    {
6205        use serde::ser::SerializeMap;
6206        #[allow(unused_imports)]
6207        use std::option::Option::Some;
6208        let mut state = serializer.serialize_map(std::option::Option::None)?;
6209        if !self.account_connectors.is_empty() {
6210            state.serialize_entry("accountConnectors", &self.account_connectors)?;
6211        }
6212        if !self.next_page_token.is_empty() {
6213            state.serialize_entry("nextPageToken", &self.next_page_token)?;
6214        }
6215        if !self.unreachable.is_empty() {
6216            state.serialize_entry("unreachable", &self.unreachable)?;
6217        }
6218        if !self._unknown_fields.is_empty() {
6219            for (key, value) in self._unknown_fields.iter() {
6220                state.serialize_entry(key, &value)?;
6221            }
6222        }
6223        state.end()
6224    }
6225}
6226
6227/// Message for getting a AccountConnector
6228#[derive(Clone, Debug, Default, PartialEq)]
6229#[non_exhaustive]
6230pub struct GetAccountConnectorRequest {
6231    /// Required. Name of the resource
6232    pub name: std::string::String,
6233
6234    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6235}
6236
6237impl GetAccountConnectorRequest {
6238    pub fn new() -> Self {
6239        std::default::Default::default()
6240    }
6241
6242    /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
6243    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6244        self.name = v.into();
6245        self
6246    }
6247}
6248
6249impl wkt::message::Message for GetAccountConnectorRequest {
6250    fn typename() -> &'static str {
6251        "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
6252    }
6253}
6254
6255#[doc(hidden)]
6256impl<'de> serde::de::Deserialize<'de> for GetAccountConnectorRequest {
6257    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6258    where
6259        D: serde::Deserializer<'de>,
6260    {
6261        #[allow(non_camel_case_types)]
6262        #[doc(hidden)]
6263        #[derive(PartialEq, Eq, Hash)]
6264        enum __FieldTag {
6265            __name,
6266            Unknown(std::string::String),
6267        }
6268        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6269            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6270            where
6271                D: serde::Deserializer<'de>,
6272            {
6273                struct Visitor;
6274                impl<'de> serde::de::Visitor<'de> for Visitor {
6275                    type Value = __FieldTag;
6276                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6277                        formatter.write_str("a field name for GetAccountConnectorRequest")
6278                    }
6279                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6280                    where
6281                        E: serde::de::Error,
6282                    {
6283                        use std::result::Result::Ok;
6284                        use std::string::ToString;
6285                        match value {
6286                            "name" => Ok(__FieldTag::__name),
6287                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6288                        }
6289                    }
6290                }
6291                deserializer.deserialize_identifier(Visitor)
6292            }
6293        }
6294        struct Visitor;
6295        impl<'de> serde::de::Visitor<'de> for Visitor {
6296            type Value = GetAccountConnectorRequest;
6297            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6298                formatter.write_str("struct GetAccountConnectorRequest")
6299            }
6300            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6301            where
6302                A: serde::de::MapAccess<'de>,
6303            {
6304                #[allow(unused_imports)]
6305                use serde::de::Error;
6306                use std::option::Option::Some;
6307                let mut fields = std::collections::HashSet::new();
6308                let mut result = Self::Value::new();
6309                while let Some(tag) = map.next_key::<__FieldTag>()? {
6310                    #[allow(clippy::match_single_binding)]
6311                    match tag {
6312                        __FieldTag::__name => {
6313                            if !fields.insert(__FieldTag::__name) {
6314                                return std::result::Result::Err(A::Error::duplicate_field(
6315                                    "multiple values for name",
6316                                ));
6317                            }
6318                            result.name = map
6319                                .next_value::<std::option::Option<std::string::String>>()?
6320                                .unwrap_or_default();
6321                        }
6322                        __FieldTag::Unknown(key) => {
6323                            let value = map.next_value::<serde_json::Value>()?;
6324                            result._unknown_fields.insert(key, value);
6325                        }
6326                    }
6327                }
6328                std::result::Result::Ok(result)
6329            }
6330        }
6331        deserializer.deserialize_any(Visitor)
6332    }
6333}
6334
6335#[doc(hidden)]
6336impl serde::ser::Serialize for GetAccountConnectorRequest {
6337    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6338    where
6339        S: serde::ser::Serializer,
6340    {
6341        use serde::ser::SerializeMap;
6342        #[allow(unused_imports)]
6343        use std::option::Option::Some;
6344        let mut state = serializer.serialize_map(std::option::Option::None)?;
6345        if !self.name.is_empty() {
6346            state.serialize_entry("name", &self.name)?;
6347        }
6348        if !self._unknown_fields.is_empty() {
6349            for (key, value) in self._unknown_fields.iter() {
6350                state.serialize_entry(key, &value)?;
6351            }
6352        }
6353        state.end()
6354    }
6355}
6356
6357#[derive(Clone, Debug, Default, PartialEq)]
6358#[non_exhaustive]
6359pub struct CreateAccountConnectorRequest {
6360    /// Required. Location resource name as the account_connector’s parent.
6361    pub parent: std::string::String,
6362
6363    /// Required. The ID to use for the AccountConnector, which will become the
6364    /// final component of the AccountConnector's resource name. Its format should
6365    /// adhere to <https://google.aip.dev/122#resource-id-segments> Names must be
6366    /// unique per-project per-location.
6367    pub account_connector_id: std::string::String,
6368
6369    /// Required. The AccountConnector to create.
6370    pub account_connector: std::option::Option<crate::model::AccountConnector>,
6371
6372    /// Optional. An optional request ID to identify requests. Specify a unique
6373    /// request ID so that if you must retry your request, the server will know to
6374    /// ignore the request if it has already been completed. The server will
6375    /// guarantee that for at least 60 minutes since the first request.
6376    ///
6377    /// For example, consider a situation where you make an initial request and the
6378    /// request times out. If you make the request again with the same request
6379    /// ID, the server can check if original operation with the same request ID
6380    /// was received, and if so, will ignore the second request. This prevents
6381    /// clients from accidentally creating duplicate commitments.
6382    ///
6383    /// The request ID must be a valid UUID with the exception that zero UUID is
6384    /// not supported (00000000-0000-0000-0000-000000000000).
6385    pub request_id: std::string::String,
6386
6387    /// Optional. If set, validate the request, but do not actually post it.
6388    pub validate_only: bool,
6389
6390    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6391}
6392
6393impl CreateAccountConnectorRequest {
6394    pub fn new() -> Self {
6395        std::default::Default::default()
6396    }
6397
6398    /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
6399    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6400        self.parent = v.into();
6401        self
6402    }
6403
6404    /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
6405    pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
6406        mut self,
6407        v: T,
6408    ) -> Self {
6409        self.account_connector_id = v.into();
6410        self
6411    }
6412
6413    /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
6414    pub fn set_account_connector<T>(mut self, v: T) -> Self
6415    where
6416        T: std::convert::Into<crate::model::AccountConnector>,
6417    {
6418        self.account_connector = std::option::Option::Some(v.into());
6419        self
6420    }
6421
6422    /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
6423    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
6424    where
6425        T: std::convert::Into<crate::model::AccountConnector>,
6426    {
6427        self.account_connector = v.map(|x| x.into());
6428        self
6429    }
6430
6431    /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
6432    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6433        self.request_id = v.into();
6434        self
6435    }
6436
6437    /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
6438    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6439        self.validate_only = v.into();
6440        self
6441    }
6442}
6443
6444impl wkt::message::Message for CreateAccountConnectorRequest {
6445    fn typename() -> &'static str {
6446        "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
6447    }
6448}
6449
6450#[doc(hidden)]
6451impl<'de> serde::de::Deserialize<'de> for CreateAccountConnectorRequest {
6452    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6453    where
6454        D: serde::Deserializer<'de>,
6455    {
6456        #[allow(non_camel_case_types)]
6457        #[doc(hidden)]
6458        #[derive(PartialEq, Eq, Hash)]
6459        enum __FieldTag {
6460            __parent,
6461            __account_connector_id,
6462            __account_connector,
6463            __request_id,
6464            __validate_only,
6465            Unknown(std::string::String),
6466        }
6467        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6468            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6469            where
6470                D: serde::Deserializer<'de>,
6471            {
6472                struct Visitor;
6473                impl<'de> serde::de::Visitor<'de> for Visitor {
6474                    type Value = __FieldTag;
6475                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6476                        formatter.write_str("a field name for CreateAccountConnectorRequest")
6477                    }
6478                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6479                    where
6480                        E: serde::de::Error,
6481                    {
6482                        use std::result::Result::Ok;
6483                        use std::string::ToString;
6484                        match value {
6485                            "parent" => Ok(__FieldTag::__parent),
6486                            "accountConnectorId" => Ok(__FieldTag::__account_connector_id),
6487                            "account_connector_id" => Ok(__FieldTag::__account_connector_id),
6488                            "accountConnector" => Ok(__FieldTag::__account_connector),
6489                            "account_connector" => Ok(__FieldTag::__account_connector),
6490                            "requestId" => Ok(__FieldTag::__request_id),
6491                            "request_id" => Ok(__FieldTag::__request_id),
6492                            "validateOnly" => Ok(__FieldTag::__validate_only),
6493                            "validate_only" => Ok(__FieldTag::__validate_only),
6494                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6495                        }
6496                    }
6497                }
6498                deserializer.deserialize_identifier(Visitor)
6499            }
6500        }
6501        struct Visitor;
6502        impl<'de> serde::de::Visitor<'de> for Visitor {
6503            type Value = CreateAccountConnectorRequest;
6504            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6505                formatter.write_str("struct CreateAccountConnectorRequest")
6506            }
6507            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6508            where
6509                A: serde::de::MapAccess<'de>,
6510            {
6511                #[allow(unused_imports)]
6512                use serde::de::Error;
6513                use std::option::Option::Some;
6514                let mut fields = std::collections::HashSet::new();
6515                let mut result = Self::Value::new();
6516                while let Some(tag) = map.next_key::<__FieldTag>()? {
6517                    #[allow(clippy::match_single_binding)]
6518                    match tag {
6519                        __FieldTag::__parent => {
6520                            if !fields.insert(__FieldTag::__parent) {
6521                                return std::result::Result::Err(A::Error::duplicate_field(
6522                                    "multiple values for parent",
6523                                ));
6524                            }
6525                            result.parent = map
6526                                .next_value::<std::option::Option<std::string::String>>()?
6527                                .unwrap_or_default();
6528                        }
6529                        __FieldTag::__account_connector_id => {
6530                            if !fields.insert(__FieldTag::__account_connector_id) {
6531                                return std::result::Result::Err(A::Error::duplicate_field(
6532                                    "multiple values for account_connector_id",
6533                                ));
6534                            }
6535                            result.account_connector_id = map
6536                                .next_value::<std::option::Option<std::string::String>>()?
6537                                .unwrap_or_default();
6538                        }
6539                        __FieldTag::__account_connector => {
6540                            if !fields.insert(__FieldTag::__account_connector) {
6541                                return std::result::Result::Err(A::Error::duplicate_field(
6542                                    "multiple values for account_connector",
6543                                ));
6544                            }
6545                            result.account_connector = map
6546                                .next_value::<std::option::Option<crate::model::AccountConnector>>(
6547                                )?;
6548                        }
6549                        __FieldTag::__request_id => {
6550                            if !fields.insert(__FieldTag::__request_id) {
6551                                return std::result::Result::Err(A::Error::duplicate_field(
6552                                    "multiple values for request_id",
6553                                ));
6554                            }
6555                            result.request_id = map
6556                                .next_value::<std::option::Option<std::string::String>>()?
6557                                .unwrap_or_default();
6558                        }
6559                        __FieldTag::__validate_only => {
6560                            if !fields.insert(__FieldTag::__validate_only) {
6561                                return std::result::Result::Err(A::Error::duplicate_field(
6562                                    "multiple values for validate_only",
6563                                ));
6564                            }
6565                            result.validate_only = map
6566                                .next_value::<std::option::Option<bool>>()?
6567                                .unwrap_or_default();
6568                        }
6569                        __FieldTag::Unknown(key) => {
6570                            let value = map.next_value::<serde_json::Value>()?;
6571                            result._unknown_fields.insert(key, value);
6572                        }
6573                    }
6574                }
6575                std::result::Result::Ok(result)
6576            }
6577        }
6578        deserializer.deserialize_any(Visitor)
6579    }
6580}
6581
6582#[doc(hidden)]
6583impl serde::ser::Serialize for CreateAccountConnectorRequest {
6584    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6585    where
6586        S: serde::ser::Serializer,
6587    {
6588        use serde::ser::SerializeMap;
6589        #[allow(unused_imports)]
6590        use std::option::Option::Some;
6591        let mut state = serializer.serialize_map(std::option::Option::None)?;
6592        if !self.parent.is_empty() {
6593            state.serialize_entry("parent", &self.parent)?;
6594        }
6595        if !self.account_connector_id.is_empty() {
6596            state.serialize_entry("accountConnectorId", &self.account_connector_id)?;
6597        }
6598        if self.account_connector.is_some() {
6599            state.serialize_entry("accountConnector", &self.account_connector)?;
6600        }
6601        if !self.request_id.is_empty() {
6602            state.serialize_entry("requestId", &self.request_id)?;
6603        }
6604        if !wkt::internal::is_default(&self.validate_only) {
6605            state.serialize_entry("validateOnly", &self.validate_only)?;
6606        }
6607        if !self._unknown_fields.is_empty() {
6608            for (key, value) in self._unknown_fields.iter() {
6609                state.serialize_entry(key, &value)?;
6610            }
6611        }
6612        state.end()
6613    }
6614}
6615
6616/// Message for updating a AccountConnector
6617#[derive(Clone, Debug, Default, PartialEq)]
6618#[non_exhaustive]
6619pub struct UpdateAccountConnectorRequest {
6620    /// Optional. The list of fields to be updated.
6621    pub update_mask: std::option::Option<wkt::FieldMask>,
6622
6623    /// Required. The AccountConnector to update.
6624    pub account_connector: std::option::Option<crate::model::AccountConnector>,
6625
6626    /// Optional. An optional request ID to identify requests. Specify a unique
6627    /// request ID so that if you must retry your request, the server will know to
6628    /// ignore the request if it has already been completed. The server will
6629    /// guarantee that for at least 60 minutes since the first request.
6630    ///
6631    /// For example, consider a situation where you make an initial request and the
6632    /// request times out. If you make the request again with the same request
6633    /// ID, the server can check if original operation with the same request ID
6634    /// was received, and if so, will ignore the second request. This prevents
6635    /// clients from accidentally creating duplicate commitments.
6636    ///
6637    /// The request ID must be a valid UUID with the exception that zero UUID is
6638    /// not supported (00000000-0000-0000-0000-000000000000).
6639    pub request_id: std::string::String,
6640
6641    /// Optional. If set to true, and the accountConnector is not found a new
6642    /// accountConnector will be created. In this situation `update_mask` is
6643    /// ignored. The creation will succeed only if the input accountConnector has
6644    /// all the necessary
6645    pub allow_missing: bool,
6646
6647    /// Optional. If set, validate the request, but do not actually post it.
6648    pub validate_only: bool,
6649
6650    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6651}
6652
6653impl UpdateAccountConnectorRequest {
6654    pub fn new() -> Self {
6655        std::default::Default::default()
6656    }
6657
6658    /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
6659    pub fn set_update_mask<T>(mut self, v: T) -> Self
6660    where
6661        T: std::convert::Into<wkt::FieldMask>,
6662    {
6663        self.update_mask = std::option::Option::Some(v.into());
6664        self
6665    }
6666
6667    /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
6668    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6669    where
6670        T: std::convert::Into<wkt::FieldMask>,
6671    {
6672        self.update_mask = v.map(|x| x.into());
6673        self
6674    }
6675
6676    /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
6677    pub fn set_account_connector<T>(mut self, v: T) -> Self
6678    where
6679        T: std::convert::Into<crate::model::AccountConnector>,
6680    {
6681        self.account_connector = std::option::Option::Some(v.into());
6682        self
6683    }
6684
6685    /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
6686    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
6687    where
6688        T: std::convert::Into<crate::model::AccountConnector>,
6689    {
6690        self.account_connector = v.map(|x| x.into());
6691        self
6692    }
6693
6694    /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
6695    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6696        self.request_id = v.into();
6697        self
6698    }
6699
6700    /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
6701    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6702        self.allow_missing = v.into();
6703        self
6704    }
6705
6706    /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
6707    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6708        self.validate_only = v.into();
6709        self
6710    }
6711}
6712
6713impl wkt::message::Message for UpdateAccountConnectorRequest {
6714    fn typename() -> &'static str {
6715        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
6716    }
6717}
6718
6719#[doc(hidden)]
6720impl<'de> serde::de::Deserialize<'de> for UpdateAccountConnectorRequest {
6721    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6722    where
6723        D: serde::Deserializer<'de>,
6724    {
6725        #[allow(non_camel_case_types)]
6726        #[doc(hidden)]
6727        #[derive(PartialEq, Eq, Hash)]
6728        enum __FieldTag {
6729            __update_mask,
6730            __account_connector,
6731            __request_id,
6732            __allow_missing,
6733            __validate_only,
6734            Unknown(std::string::String),
6735        }
6736        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6737            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6738            where
6739                D: serde::Deserializer<'de>,
6740            {
6741                struct Visitor;
6742                impl<'de> serde::de::Visitor<'de> for Visitor {
6743                    type Value = __FieldTag;
6744                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6745                        formatter.write_str("a field name for UpdateAccountConnectorRequest")
6746                    }
6747                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6748                    where
6749                        E: serde::de::Error,
6750                    {
6751                        use std::result::Result::Ok;
6752                        use std::string::ToString;
6753                        match value {
6754                            "updateMask" => Ok(__FieldTag::__update_mask),
6755                            "update_mask" => Ok(__FieldTag::__update_mask),
6756                            "accountConnector" => Ok(__FieldTag::__account_connector),
6757                            "account_connector" => Ok(__FieldTag::__account_connector),
6758                            "requestId" => Ok(__FieldTag::__request_id),
6759                            "request_id" => Ok(__FieldTag::__request_id),
6760                            "allowMissing" => Ok(__FieldTag::__allow_missing),
6761                            "allow_missing" => Ok(__FieldTag::__allow_missing),
6762                            "validateOnly" => Ok(__FieldTag::__validate_only),
6763                            "validate_only" => Ok(__FieldTag::__validate_only),
6764                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6765                        }
6766                    }
6767                }
6768                deserializer.deserialize_identifier(Visitor)
6769            }
6770        }
6771        struct Visitor;
6772        impl<'de> serde::de::Visitor<'de> for Visitor {
6773            type Value = UpdateAccountConnectorRequest;
6774            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6775                formatter.write_str("struct UpdateAccountConnectorRequest")
6776            }
6777            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6778            where
6779                A: serde::de::MapAccess<'de>,
6780            {
6781                #[allow(unused_imports)]
6782                use serde::de::Error;
6783                use std::option::Option::Some;
6784                let mut fields = std::collections::HashSet::new();
6785                let mut result = Self::Value::new();
6786                while let Some(tag) = map.next_key::<__FieldTag>()? {
6787                    #[allow(clippy::match_single_binding)]
6788                    match tag {
6789                        __FieldTag::__update_mask => {
6790                            if !fields.insert(__FieldTag::__update_mask) {
6791                                return std::result::Result::Err(A::Error::duplicate_field(
6792                                    "multiple values for update_mask",
6793                                ));
6794                            }
6795                            result.update_mask =
6796                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
6797                        }
6798                        __FieldTag::__account_connector => {
6799                            if !fields.insert(__FieldTag::__account_connector) {
6800                                return std::result::Result::Err(A::Error::duplicate_field(
6801                                    "multiple values for account_connector",
6802                                ));
6803                            }
6804                            result.account_connector = map
6805                                .next_value::<std::option::Option<crate::model::AccountConnector>>(
6806                                )?;
6807                        }
6808                        __FieldTag::__request_id => {
6809                            if !fields.insert(__FieldTag::__request_id) {
6810                                return std::result::Result::Err(A::Error::duplicate_field(
6811                                    "multiple values for request_id",
6812                                ));
6813                            }
6814                            result.request_id = map
6815                                .next_value::<std::option::Option<std::string::String>>()?
6816                                .unwrap_or_default();
6817                        }
6818                        __FieldTag::__allow_missing => {
6819                            if !fields.insert(__FieldTag::__allow_missing) {
6820                                return std::result::Result::Err(A::Error::duplicate_field(
6821                                    "multiple values for allow_missing",
6822                                ));
6823                            }
6824                            result.allow_missing = map
6825                                .next_value::<std::option::Option<bool>>()?
6826                                .unwrap_or_default();
6827                        }
6828                        __FieldTag::__validate_only => {
6829                            if !fields.insert(__FieldTag::__validate_only) {
6830                                return std::result::Result::Err(A::Error::duplicate_field(
6831                                    "multiple values for validate_only",
6832                                ));
6833                            }
6834                            result.validate_only = map
6835                                .next_value::<std::option::Option<bool>>()?
6836                                .unwrap_or_default();
6837                        }
6838                        __FieldTag::Unknown(key) => {
6839                            let value = map.next_value::<serde_json::Value>()?;
6840                            result._unknown_fields.insert(key, value);
6841                        }
6842                    }
6843                }
6844                std::result::Result::Ok(result)
6845            }
6846        }
6847        deserializer.deserialize_any(Visitor)
6848    }
6849}
6850
6851#[doc(hidden)]
6852impl serde::ser::Serialize for UpdateAccountConnectorRequest {
6853    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6854    where
6855        S: serde::ser::Serializer,
6856    {
6857        use serde::ser::SerializeMap;
6858        #[allow(unused_imports)]
6859        use std::option::Option::Some;
6860        let mut state = serializer.serialize_map(std::option::Option::None)?;
6861        if self.update_mask.is_some() {
6862            state.serialize_entry("updateMask", &self.update_mask)?;
6863        }
6864        if self.account_connector.is_some() {
6865            state.serialize_entry("accountConnector", &self.account_connector)?;
6866        }
6867        if !self.request_id.is_empty() {
6868            state.serialize_entry("requestId", &self.request_id)?;
6869        }
6870        if !wkt::internal::is_default(&self.allow_missing) {
6871            state.serialize_entry("allowMissing", &self.allow_missing)?;
6872        }
6873        if !wkt::internal::is_default(&self.validate_only) {
6874            state.serialize_entry("validateOnly", &self.validate_only)?;
6875        }
6876        if !self._unknown_fields.is_empty() {
6877            for (key, value) in self._unknown_fields.iter() {
6878                state.serialize_entry(key, &value)?;
6879            }
6880        }
6881        state.end()
6882    }
6883}
6884
6885/// Message for deleting a AccountConnector
6886#[derive(Clone, Debug, Default, PartialEq)]
6887#[non_exhaustive]
6888pub struct DeleteAccountConnectorRequest {
6889    /// Required. Name of the resource
6890    pub name: std::string::String,
6891
6892    /// Optional. An optional request ID to identify requests. Specify a unique
6893    /// request ID so that if you must retry your request, the server will know to
6894    /// ignore the request if it has already been completed. The server will
6895    /// guarantee that for at least 60 minutes after the first request.
6896    ///
6897    /// For example, consider a situation where you make an initial request and the
6898    /// request times out. If you make the request again with the same request
6899    /// ID, the server can check if original operation with the same request ID
6900    /// was received, and if so, will ignore the second request. This prevents
6901    /// clients from accidentally creating duplicate commitments.
6902    ///
6903    /// The request ID must be a valid UUID with the exception that zero UUID is
6904    /// not supported (00000000-0000-0000-0000-000000000000).
6905    pub request_id: std::string::String,
6906
6907    /// Optional. If set, validate the request, but do not actually post it.
6908    pub validate_only: bool,
6909
6910    /// Optional. The current etag of the AccountConnectorn.
6911    /// If an etag is provided and does not match the current etag of the
6912    /// AccountConnector, deletion will be blocked and an ABORTED error will be
6913    /// returned.
6914    pub etag: std::string::String,
6915
6916    /// Optional. If set to true, any Users from this AccountConnector will also
6917    /// be deleted. (Otherwise, the request will only work if the AccountConnector
6918    /// has no Users.)
6919    pub force: bool,
6920
6921    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6922}
6923
6924impl DeleteAccountConnectorRequest {
6925    pub fn new() -> Self {
6926        std::default::Default::default()
6927    }
6928
6929    /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
6930    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6931        self.name = v.into();
6932        self
6933    }
6934
6935    /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
6936    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6937        self.request_id = v.into();
6938        self
6939    }
6940
6941    /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
6942    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6943        self.validate_only = v.into();
6944        self
6945    }
6946
6947    /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
6948    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6949        self.etag = v.into();
6950        self
6951    }
6952
6953    /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
6954    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6955        self.force = v.into();
6956        self
6957    }
6958}
6959
6960impl wkt::message::Message for DeleteAccountConnectorRequest {
6961    fn typename() -> &'static str {
6962        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
6963    }
6964}
6965
6966#[doc(hidden)]
6967impl<'de> serde::de::Deserialize<'de> for DeleteAccountConnectorRequest {
6968    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6969    where
6970        D: serde::Deserializer<'de>,
6971    {
6972        #[allow(non_camel_case_types)]
6973        #[doc(hidden)]
6974        #[derive(PartialEq, Eq, Hash)]
6975        enum __FieldTag {
6976            __name,
6977            __request_id,
6978            __validate_only,
6979            __etag,
6980            __force,
6981            Unknown(std::string::String),
6982        }
6983        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6984            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6985            where
6986                D: serde::Deserializer<'de>,
6987            {
6988                struct Visitor;
6989                impl<'de> serde::de::Visitor<'de> for Visitor {
6990                    type Value = __FieldTag;
6991                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6992                        formatter.write_str("a field name for DeleteAccountConnectorRequest")
6993                    }
6994                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6995                    where
6996                        E: serde::de::Error,
6997                    {
6998                        use std::result::Result::Ok;
6999                        use std::string::ToString;
7000                        match value {
7001                            "name" => Ok(__FieldTag::__name),
7002                            "requestId" => Ok(__FieldTag::__request_id),
7003                            "request_id" => Ok(__FieldTag::__request_id),
7004                            "validateOnly" => Ok(__FieldTag::__validate_only),
7005                            "validate_only" => Ok(__FieldTag::__validate_only),
7006                            "etag" => Ok(__FieldTag::__etag),
7007                            "force" => Ok(__FieldTag::__force),
7008                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7009                        }
7010                    }
7011                }
7012                deserializer.deserialize_identifier(Visitor)
7013            }
7014        }
7015        struct Visitor;
7016        impl<'de> serde::de::Visitor<'de> for Visitor {
7017            type Value = DeleteAccountConnectorRequest;
7018            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7019                formatter.write_str("struct DeleteAccountConnectorRequest")
7020            }
7021            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7022            where
7023                A: serde::de::MapAccess<'de>,
7024            {
7025                #[allow(unused_imports)]
7026                use serde::de::Error;
7027                use std::option::Option::Some;
7028                let mut fields = std::collections::HashSet::new();
7029                let mut result = Self::Value::new();
7030                while let Some(tag) = map.next_key::<__FieldTag>()? {
7031                    #[allow(clippy::match_single_binding)]
7032                    match tag {
7033                        __FieldTag::__name => {
7034                            if !fields.insert(__FieldTag::__name) {
7035                                return std::result::Result::Err(A::Error::duplicate_field(
7036                                    "multiple values for name",
7037                                ));
7038                            }
7039                            result.name = map
7040                                .next_value::<std::option::Option<std::string::String>>()?
7041                                .unwrap_or_default();
7042                        }
7043                        __FieldTag::__request_id => {
7044                            if !fields.insert(__FieldTag::__request_id) {
7045                                return std::result::Result::Err(A::Error::duplicate_field(
7046                                    "multiple values for request_id",
7047                                ));
7048                            }
7049                            result.request_id = map
7050                                .next_value::<std::option::Option<std::string::String>>()?
7051                                .unwrap_or_default();
7052                        }
7053                        __FieldTag::__validate_only => {
7054                            if !fields.insert(__FieldTag::__validate_only) {
7055                                return std::result::Result::Err(A::Error::duplicate_field(
7056                                    "multiple values for validate_only",
7057                                ));
7058                            }
7059                            result.validate_only = map
7060                                .next_value::<std::option::Option<bool>>()?
7061                                .unwrap_or_default();
7062                        }
7063                        __FieldTag::__etag => {
7064                            if !fields.insert(__FieldTag::__etag) {
7065                                return std::result::Result::Err(A::Error::duplicate_field(
7066                                    "multiple values for etag",
7067                                ));
7068                            }
7069                            result.etag = map
7070                                .next_value::<std::option::Option<std::string::String>>()?
7071                                .unwrap_or_default();
7072                        }
7073                        __FieldTag::__force => {
7074                            if !fields.insert(__FieldTag::__force) {
7075                                return std::result::Result::Err(A::Error::duplicate_field(
7076                                    "multiple values for force",
7077                                ));
7078                            }
7079                            result.force = map
7080                                .next_value::<std::option::Option<bool>>()?
7081                                .unwrap_or_default();
7082                        }
7083                        __FieldTag::Unknown(key) => {
7084                            let value = map.next_value::<serde_json::Value>()?;
7085                            result._unknown_fields.insert(key, value);
7086                        }
7087                    }
7088                }
7089                std::result::Result::Ok(result)
7090            }
7091        }
7092        deserializer.deserialize_any(Visitor)
7093    }
7094}
7095
7096#[doc(hidden)]
7097impl serde::ser::Serialize for DeleteAccountConnectorRequest {
7098    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7099    where
7100        S: serde::ser::Serializer,
7101    {
7102        use serde::ser::SerializeMap;
7103        #[allow(unused_imports)]
7104        use std::option::Option::Some;
7105        let mut state = serializer.serialize_map(std::option::Option::None)?;
7106        if !self.name.is_empty() {
7107            state.serialize_entry("name", &self.name)?;
7108        }
7109        if !self.request_id.is_empty() {
7110            state.serialize_entry("requestId", &self.request_id)?;
7111        }
7112        if !wkt::internal::is_default(&self.validate_only) {
7113            state.serialize_entry("validateOnly", &self.validate_only)?;
7114        }
7115        if !self.etag.is_empty() {
7116            state.serialize_entry("etag", &self.etag)?;
7117        }
7118        if !wkt::internal::is_default(&self.force) {
7119            state.serialize_entry("force", &self.force)?;
7120        }
7121        if !self._unknown_fields.is_empty() {
7122            for (key, value) in self._unknown_fields.iter() {
7123                state.serialize_entry(key, &value)?;
7124            }
7125        }
7126        state.end()
7127    }
7128}
7129
7130/// Message for deleting a User
7131#[derive(Clone, Debug, Default, PartialEq)]
7132#[non_exhaustive]
7133pub struct DeleteUserRequest {
7134    /// Required. Name of the resource
7135    pub name: std::string::String,
7136
7137    /// Optional. An optional request ID to identify requests. Specify a unique
7138    /// request ID so that if you must retry your request, the server will know to
7139    /// ignore the request if it has already been completed. The server will
7140    /// guarantee that for at least 60 minutes after the first request.
7141    ///
7142    /// For example, consider a situation where you make an initial request and the
7143    /// request times out. If you make the request again with the same request
7144    /// ID, the server can check if original operation with the same request ID
7145    /// was received, and if so, will ignore the second request. This prevents
7146    /// clients from accidentally creating duplicate commitments.
7147    ///
7148    /// The request ID must be a valid UUID with the exception that zero UUID is
7149    /// not supported (00000000-0000-0000-0000-000000000000).
7150    pub request_id: std::string::String,
7151
7152    /// Optional. If set, validate the request, but do not actually post it.
7153    pub validate_only: bool,
7154
7155    /// Optional. This checksum is computed by the server based on the value of
7156    /// other fields, and may be sent on update and delete requests to ensure the
7157    /// client has an up-to-date value before proceeding.
7158    pub etag: std::string::String,
7159
7160    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7161}
7162
7163impl DeleteUserRequest {
7164    pub fn new() -> Self {
7165        std::default::Default::default()
7166    }
7167
7168    /// Sets the value of [name][crate::model::DeleteUserRequest::name].
7169    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7170        self.name = v.into();
7171        self
7172    }
7173
7174    /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
7175    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7176        self.request_id = v.into();
7177        self
7178    }
7179
7180    /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
7181    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7182        self.validate_only = v.into();
7183        self
7184    }
7185
7186    /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
7187    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7188        self.etag = v.into();
7189        self
7190    }
7191}
7192
7193impl wkt::message::Message for DeleteUserRequest {
7194    fn typename() -> &'static str {
7195        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
7196    }
7197}
7198
7199#[doc(hidden)]
7200impl<'de> serde::de::Deserialize<'de> for DeleteUserRequest {
7201    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7202    where
7203        D: serde::Deserializer<'de>,
7204    {
7205        #[allow(non_camel_case_types)]
7206        #[doc(hidden)]
7207        #[derive(PartialEq, Eq, Hash)]
7208        enum __FieldTag {
7209            __name,
7210            __request_id,
7211            __validate_only,
7212            __etag,
7213            Unknown(std::string::String),
7214        }
7215        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7216            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7217            where
7218                D: serde::Deserializer<'de>,
7219            {
7220                struct Visitor;
7221                impl<'de> serde::de::Visitor<'de> for Visitor {
7222                    type Value = __FieldTag;
7223                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7224                        formatter.write_str("a field name for DeleteUserRequest")
7225                    }
7226                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7227                    where
7228                        E: serde::de::Error,
7229                    {
7230                        use std::result::Result::Ok;
7231                        use std::string::ToString;
7232                        match value {
7233                            "name" => Ok(__FieldTag::__name),
7234                            "requestId" => Ok(__FieldTag::__request_id),
7235                            "request_id" => Ok(__FieldTag::__request_id),
7236                            "validateOnly" => Ok(__FieldTag::__validate_only),
7237                            "validate_only" => Ok(__FieldTag::__validate_only),
7238                            "etag" => Ok(__FieldTag::__etag),
7239                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7240                        }
7241                    }
7242                }
7243                deserializer.deserialize_identifier(Visitor)
7244            }
7245        }
7246        struct Visitor;
7247        impl<'de> serde::de::Visitor<'de> for Visitor {
7248            type Value = DeleteUserRequest;
7249            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7250                formatter.write_str("struct DeleteUserRequest")
7251            }
7252            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7253            where
7254                A: serde::de::MapAccess<'de>,
7255            {
7256                #[allow(unused_imports)]
7257                use serde::de::Error;
7258                use std::option::Option::Some;
7259                let mut fields = std::collections::HashSet::new();
7260                let mut result = Self::Value::new();
7261                while let Some(tag) = map.next_key::<__FieldTag>()? {
7262                    #[allow(clippy::match_single_binding)]
7263                    match tag {
7264                        __FieldTag::__name => {
7265                            if !fields.insert(__FieldTag::__name) {
7266                                return std::result::Result::Err(A::Error::duplicate_field(
7267                                    "multiple values for name",
7268                                ));
7269                            }
7270                            result.name = map
7271                                .next_value::<std::option::Option<std::string::String>>()?
7272                                .unwrap_or_default();
7273                        }
7274                        __FieldTag::__request_id => {
7275                            if !fields.insert(__FieldTag::__request_id) {
7276                                return std::result::Result::Err(A::Error::duplicate_field(
7277                                    "multiple values for request_id",
7278                                ));
7279                            }
7280                            result.request_id = map
7281                                .next_value::<std::option::Option<std::string::String>>()?
7282                                .unwrap_or_default();
7283                        }
7284                        __FieldTag::__validate_only => {
7285                            if !fields.insert(__FieldTag::__validate_only) {
7286                                return std::result::Result::Err(A::Error::duplicate_field(
7287                                    "multiple values for validate_only",
7288                                ));
7289                            }
7290                            result.validate_only = map
7291                                .next_value::<std::option::Option<bool>>()?
7292                                .unwrap_or_default();
7293                        }
7294                        __FieldTag::__etag => {
7295                            if !fields.insert(__FieldTag::__etag) {
7296                                return std::result::Result::Err(A::Error::duplicate_field(
7297                                    "multiple values for etag",
7298                                ));
7299                            }
7300                            result.etag = map
7301                                .next_value::<std::option::Option<std::string::String>>()?
7302                                .unwrap_or_default();
7303                        }
7304                        __FieldTag::Unknown(key) => {
7305                            let value = map.next_value::<serde_json::Value>()?;
7306                            result._unknown_fields.insert(key, value);
7307                        }
7308                    }
7309                }
7310                std::result::Result::Ok(result)
7311            }
7312        }
7313        deserializer.deserialize_any(Visitor)
7314    }
7315}
7316
7317#[doc(hidden)]
7318impl serde::ser::Serialize for DeleteUserRequest {
7319    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7320    where
7321        S: serde::ser::Serializer,
7322    {
7323        use serde::ser::SerializeMap;
7324        #[allow(unused_imports)]
7325        use std::option::Option::Some;
7326        let mut state = serializer.serialize_map(std::option::Option::None)?;
7327        if !self.name.is_empty() {
7328            state.serialize_entry("name", &self.name)?;
7329        }
7330        if !self.request_id.is_empty() {
7331            state.serialize_entry("requestId", &self.request_id)?;
7332        }
7333        if !wkt::internal::is_default(&self.validate_only) {
7334            state.serialize_entry("validateOnly", &self.validate_only)?;
7335        }
7336        if !self.etag.is_empty() {
7337            state.serialize_entry("etag", &self.etag)?;
7338        }
7339        if !self._unknown_fields.is_empty() {
7340            for (key, value) in self._unknown_fields.iter() {
7341                state.serialize_entry(key, &value)?;
7342            }
7343        }
7344        state.end()
7345    }
7346}
7347
7348/// Represents the metadata of the long-running operation.
7349#[derive(Clone, Debug, Default, PartialEq)]
7350#[non_exhaustive]
7351pub struct OperationMetadata {
7352    /// Output only. The time the operation was created.
7353    pub create_time: std::option::Option<wkt::Timestamp>,
7354
7355    /// Output only. The time the operation finished running.
7356    pub end_time: std::option::Option<wkt::Timestamp>,
7357
7358    /// Output only. Server-defined resource path for the target of the operation.
7359    pub target: std::string::String,
7360
7361    /// Output only. Name of the verb executed by the operation.
7362    pub verb: std::string::String,
7363
7364    /// Output only. Human-readable status of the operation, if any.
7365    pub status_message: std::string::String,
7366
7367    /// Output only. Identifies whether the user has requested cancellation
7368    /// of the operation. Operations that have been cancelled successfully
7369    /// have
7370    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
7371    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
7372    /// corresponding to `Code.CANCELLED`.
7373    ///
7374    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
7375    /// [google.rpc.Status.code]: rpc::model::Status::code
7376    pub requested_cancellation: bool,
7377
7378    /// Output only. API version used to start the operation.
7379    pub api_version: std::string::String,
7380
7381    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7382}
7383
7384impl OperationMetadata {
7385    pub fn new() -> Self {
7386        std::default::Default::default()
7387    }
7388
7389    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7390    pub fn set_create_time<T>(mut self, v: T) -> Self
7391    where
7392        T: std::convert::Into<wkt::Timestamp>,
7393    {
7394        self.create_time = std::option::Option::Some(v.into());
7395        self
7396    }
7397
7398    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7399    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7400    where
7401        T: std::convert::Into<wkt::Timestamp>,
7402    {
7403        self.create_time = v.map(|x| x.into());
7404        self
7405    }
7406
7407    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7408    pub fn set_end_time<T>(mut self, v: T) -> Self
7409    where
7410        T: std::convert::Into<wkt::Timestamp>,
7411    {
7412        self.end_time = std::option::Option::Some(v.into());
7413        self
7414    }
7415
7416    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7417    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7418    where
7419        T: std::convert::Into<wkt::Timestamp>,
7420    {
7421        self.end_time = v.map(|x| x.into());
7422        self
7423    }
7424
7425    /// Sets the value of [target][crate::model::OperationMetadata::target].
7426    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7427        self.target = v.into();
7428        self
7429    }
7430
7431    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7432    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7433        self.verb = v.into();
7434        self
7435    }
7436
7437    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7438    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7439        self.status_message = v.into();
7440        self
7441    }
7442
7443    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7444    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7445        self.requested_cancellation = v.into();
7446        self
7447    }
7448
7449    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7450    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7451        self.api_version = v.into();
7452        self
7453    }
7454}
7455
7456impl wkt::message::Message for OperationMetadata {
7457    fn typename() -> &'static str {
7458        "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
7459    }
7460}
7461
7462#[doc(hidden)]
7463impl<'de> serde::de::Deserialize<'de> for OperationMetadata {
7464    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7465    where
7466        D: serde::Deserializer<'de>,
7467    {
7468        #[allow(non_camel_case_types)]
7469        #[doc(hidden)]
7470        #[derive(PartialEq, Eq, Hash)]
7471        enum __FieldTag {
7472            __create_time,
7473            __end_time,
7474            __target,
7475            __verb,
7476            __status_message,
7477            __requested_cancellation,
7478            __api_version,
7479            Unknown(std::string::String),
7480        }
7481        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7482            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7483            where
7484                D: serde::Deserializer<'de>,
7485            {
7486                struct Visitor;
7487                impl<'de> serde::de::Visitor<'de> for Visitor {
7488                    type Value = __FieldTag;
7489                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7490                        formatter.write_str("a field name for OperationMetadata")
7491                    }
7492                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7493                    where
7494                        E: serde::de::Error,
7495                    {
7496                        use std::result::Result::Ok;
7497                        use std::string::ToString;
7498                        match value {
7499                            "createTime" => Ok(__FieldTag::__create_time),
7500                            "create_time" => Ok(__FieldTag::__create_time),
7501                            "endTime" => Ok(__FieldTag::__end_time),
7502                            "end_time" => Ok(__FieldTag::__end_time),
7503                            "target" => Ok(__FieldTag::__target),
7504                            "verb" => Ok(__FieldTag::__verb),
7505                            "statusMessage" => Ok(__FieldTag::__status_message),
7506                            "status_message" => Ok(__FieldTag::__status_message),
7507                            "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
7508                            "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
7509                            "apiVersion" => Ok(__FieldTag::__api_version),
7510                            "api_version" => Ok(__FieldTag::__api_version),
7511                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7512                        }
7513                    }
7514                }
7515                deserializer.deserialize_identifier(Visitor)
7516            }
7517        }
7518        struct Visitor;
7519        impl<'de> serde::de::Visitor<'de> for Visitor {
7520            type Value = OperationMetadata;
7521            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7522                formatter.write_str("struct OperationMetadata")
7523            }
7524            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7525            where
7526                A: serde::de::MapAccess<'de>,
7527            {
7528                #[allow(unused_imports)]
7529                use serde::de::Error;
7530                use std::option::Option::Some;
7531                let mut fields = std::collections::HashSet::new();
7532                let mut result = Self::Value::new();
7533                while let Some(tag) = map.next_key::<__FieldTag>()? {
7534                    #[allow(clippy::match_single_binding)]
7535                    match tag {
7536                        __FieldTag::__create_time => {
7537                            if !fields.insert(__FieldTag::__create_time) {
7538                                return std::result::Result::Err(A::Error::duplicate_field(
7539                                    "multiple values for create_time",
7540                                ));
7541                            }
7542                            result.create_time =
7543                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7544                        }
7545                        __FieldTag::__end_time => {
7546                            if !fields.insert(__FieldTag::__end_time) {
7547                                return std::result::Result::Err(A::Error::duplicate_field(
7548                                    "multiple values for end_time",
7549                                ));
7550                            }
7551                            result.end_time =
7552                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7553                        }
7554                        __FieldTag::__target => {
7555                            if !fields.insert(__FieldTag::__target) {
7556                                return std::result::Result::Err(A::Error::duplicate_field(
7557                                    "multiple values for target",
7558                                ));
7559                            }
7560                            result.target = map
7561                                .next_value::<std::option::Option<std::string::String>>()?
7562                                .unwrap_or_default();
7563                        }
7564                        __FieldTag::__verb => {
7565                            if !fields.insert(__FieldTag::__verb) {
7566                                return std::result::Result::Err(A::Error::duplicate_field(
7567                                    "multiple values for verb",
7568                                ));
7569                            }
7570                            result.verb = map
7571                                .next_value::<std::option::Option<std::string::String>>()?
7572                                .unwrap_or_default();
7573                        }
7574                        __FieldTag::__status_message => {
7575                            if !fields.insert(__FieldTag::__status_message) {
7576                                return std::result::Result::Err(A::Error::duplicate_field(
7577                                    "multiple values for status_message",
7578                                ));
7579                            }
7580                            result.status_message = map
7581                                .next_value::<std::option::Option<std::string::String>>()?
7582                                .unwrap_or_default();
7583                        }
7584                        __FieldTag::__requested_cancellation => {
7585                            if !fields.insert(__FieldTag::__requested_cancellation) {
7586                                return std::result::Result::Err(A::Error::duplicate_field(
7587                                    "multiple values for requested_cancellation",
7588                                ));
7589                            }
7590                            result.requested_cancellation = map
7591                                .next_value::<std::option::Option<bool>>()?
7592                                .unwrap_or_default();
7593                        }
7594                        __FieldTag::__api_version => {
7595                            if !fields.insert(__FieldTag::__api_version) {
7596                                return std::result::Result::Err(A::Error::duplicate_field(
7597                                    "multiple values for api_version",
7598                                ));
7599                            }
7600                            result.api_version = map
7601                                .next_value::<std::option::Option<std::string::String>>()?
7602                                .unwrap_or_default();
7603                        }
7604                        __FieldTag::Unknown(key) => {
7605                            let value = map.next_value::<serde_json::Value>()?;
7606                            result._unknown_fields.insert(key, value);
7607                        }
7608                    }
7609                }
7610                std::result::Result::Ok(result)
7611            }
7612        }
7613        deserializer.deserialize_any(Visitor)
7614    }
7615}
7616
7617#[doc(hidden)]
7618impl serde::ser::Serialize for OperationMetadata {
7619    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7620    where
7621        S: serde::ser::Serializer,
7622    {
7623        use serde::ser::SerializeMap;
7624        #[allow(unused_imports)]
7625        use std::option::Option::Some;
7626        let mut state = serializer.serialize_map(std::option::Option::None)?;
7627        if self.create_time.is_some() {
7628            state.serialize_entry("createTime", &self.create_time)?;
7629        }
7630        if self.end_time.is_some() {
7631            state.serialize_entry("endTime", &self.end_time)?;
7632        }
7633        if !self.target.is_empty() {
7634            state.serialize_entry("target", &self.target)?;
7635        }
7636        if !self.verb.is_empty() {
7637            state.serialize_entry("verb", &self.verb)?;
7638        }
7639        if !self.status_message.is_empty() {
7640            state.serialize_entry("statusMessage", &self.status_message)?;
7641        }
7642        if !wkt::internal::is_default(&self.requested_cancellation) {
7643            state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
7644        }
7645        if !self.api_version.is_empty() {
7646            state.serialize_entry("apiVersion", &self.api_version)?;
7647        }
7648        if !self._unknown_fields.is_empty() {
7649            for (key, value) in self._unknown_fields.iter() {
7650                state.serialize_entry(key, &value)?;
7651            }
7652        }
7653        state.end()
7654    }
7655}
7656
7657/// Message for fetching a User of the user themselves.
7658#[derive(Clone, Debug, Default, PartialEq)]
7659#[non_exhaustive]
7660pub struct FetchSelfRequest {
7661    /// Required. Name of the AccountConnector resource
7662    pub name: std::string::String,
7663
7664    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7665}
7666
7667impl FetchSelfRequest {
7668    pub fn new() -> Self {
7669        std::default::Default::default()
7670    }
7671
7672    /// Sets the value of [name][crate::model::FetchSelfRequest::name].
7673    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7674        self.name = v.into();
7675        self
7676    }
7677}
7678
7679impl wkt::message::Message for FetchSelfRequest {
7680    fn typename() -> &'static str {
7681        "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
7682    }
7683}
7684
7685#[doc(hidden)]
7686impl<'de> serde::de::Deserialize<'de> for FetchSelfRequest {
7687    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7688    where
7689        D: serde::Deserializer<'de>,
7690    {
7691        #[allow(non_camel_case_types)]
7692        #[doc(hidden)]
7693        #[derive(PartialEq, Eq, Hash)]
7694        enum __FieldTag {
7695            __name,
7696            Unknown(std::string::String),
7697        }
7698        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7699            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7700            where
7701                D: serde::Deserializer<'de>,
7702            {
7703                struct Visitor;
7704                impl<'de> serde::de::Visitor<'de> for Visitor {
7705                    type Value = __FieldTag;
7706                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7707                        formatter.write_str("a field name for FetchSelfRequest")
7708                    }
7709                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7710                    where
7711                        E: serde::de::Error,
7712                    {
7713                        use std::result::Result::Ok;
7714                        use std::string::ToString;
7715                        match value {
7716                            "name" => Ok(__FieldTag::__name),
7717                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7718                        }
7719                    }
7720                }
7721                deserializer.deserialize_identifier(Visitor)
7722            }
7723        }
7724        struct Visitor;
7725        impl<'de> serde::de::Visitor<'de> for Visitor {
7726            type Value = FetchSelfRequest;
7727            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7728                formatter.write_str("struct FetchSelfRequest")
7729            }
7730            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7731            where
7732                A: serde::de::MapAccess<'de>,
7733            {
7734                #[allow(unused_imports)]
7735                use serde::de::Error;
7736                use std::option::Option::Some;
7737                let mut fields = std::collections::HashSet::new();
7738                let mut result = Self::Value::new();
7739                while let Some(tag) = map.next_key::<__FieldTag>()? {
7740                    #[allow(clippy::match_single_binding)]
7741                    match tag {
7742                        __FieldTag::__name => {
7743                            if !fields.insert(__FieldTag::__name) {
7744                                return std::result::Result::Err(A::Error::duplicate_field(
7745                                    "multiple values for name",
7746                                ));
7747                            }
7748                            result.name = map
7749                                .next_value::<std::option::Option<std::string::String>>()?
7750                                .unwrap_or_default();
7751                        }
7752                        __FieldTag::Unknown(key) => {
7753                            let value = map.next_value::<serde_json::Value>()?;
7754                            result._unknown_fields.insert(key, value);
7755                        }
7756                    }
7757                }
7758                std::result::Result::Ok(result)
7759            }
7760        }
7761        deserializer.deserialize_any(Visitor)
7762    }
7763}
7764
7765#[doc(hidden)]
7766impl serde::ser::Serialize for FetchSelfRequest {
7767    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7768    where
7769        S: serde::ser::Serializer,
7770    {
7771        use serde::ser::SerializeMap;
7772        #[allow(unused_imports)]
7773        use std::option::Option::Some;
7774        let mut state = serializer.serialize_map(std::option::Option::None)?;
7775        if !self.name.is_empty() {
7776            state.serialize_entry("name", &self.name)?;
7777        }
7778        if !self._unknown_fields.is_empty() {
7779            for (key, value) in self._unknown_fields.iter() {
7780                state.serialize_entry(key, &value)?;
7781            }
7782        }
7783        state.end()
7784    }
7785}
7786
7787/// Message for deleting a User of the user themselves.
7788#[derive(Clone, Debug, Default, PartialEq)]
7789#[non_exhaustive]
7790pub struct DeleteSelfRequest {
7791    /// Required. Name of the AccountConnector resource
7792    pub name: std::string::String,
7793
7794    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7795}
7796
7797impl DeleteSelfRequest {
7798    pub fn new() -> Self {
7799        std::default::Default::default()
7800    }
7801
7802    /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
7803    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7804        self.name = v.into();
7805        self
7806    }
7807}
7808
7809impl wkt::message::Message for DeleteSelfRequest {
7810    fn typename() -> &'static str {
7811        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
7812    }
7813}
7814
7815#[doc(hidden)]
7816impl<'de> serde::de::Deserialize<'de> for DeleteSelfRequest {
7817    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7818    where
7819        D: serde::Deserializer<'de>,
7820    {
7821        #[allow(non_camel_case_types)]
7822        #[doc(hidden)]
7823        #[derive(PartialEq, Eq, Hash)]
7824        enum __FieldTag {
7825            __name,
7826            Unknown(std::string::String),
7827        }
7828        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7829            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7830            where
7831                D: serde::Deserializer<'de>,
7832            {
7833                struct Visitor;
7834                impl<'de> serde::de::Visitor<'de> for Visitor {
7835                    type Value = __FieldTag;
7836                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7837                        formatter.write_str("a field name for DeleteSelfRequest")
7838                    }
7839                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7840                    where
7841                        E: serde::de::Error,
7842                    {
7843                        use std::result::Result::Ok;
7844                        use std::string::ToString;
7845                        match value {
7846                            "name" => Ok(__FieldTag::__name),
7847                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7848                        }
7849                    }
7850                }
7851                deserializer.deserialize_identifier(Visitor)
7852            }
7853        }
7854        struct Visitor;
7855        impl<'de> serde::de::Visitor<'de> for Visitor {
7856            type Value = DeleteSelfRequest;
7857            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7858                formatter.write_str("struct DeleteSelfRequest")
7859            }
7860            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7861            where
7862                A: serde::de::MapAccess<'de>,
7863            {
7864                #[allow(unused_imports)]
7865                use serde::de::Error;
7866                use std::option::Option::Some;
7867                let mut fields = std::collections::HashSet::new();
7868                let mut result = Self::Value::new();
7869                while let Some(tag) = map.next_key::<__FieldTag>()? {
7870                    #[allow(clippy::match_single_binding)]
7871                    match tag {
7872                        __FieldTag::__name => {
7873                            if !fields.insert(__FieldTag::__name) {
7874                                return std::result::Result::Err(A::Error::duplicate_field(
7875                                    "multiple values for name",
7876                                ));
7877                            }
7878                            result.name = map
7879                                .next_value::<std::option::Option<std::string::String>>()?
7880                                .unwrap_or_default();
7881                        }
7882                        __FieldTag::Unknown(key) => {
7883                            let value = map.next_value::<serde_json::Value>()?;
7884                            result._unknown_fields.insert(key, value);
7885                        }
7886                    }
7887                }
7888                std::result::Result::Ok(result)
7889            }
7890        }
7891        deserializer.deserialize_any(Visitor)
7892    }
7893}
7894
7895#[doc(hidden)]
7896impl serde::ser::Serialize for DeleteSelfRequest {
7897    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7898    where
7899        S: serde::ser::Serializer,
7900    {
7901        use serde::ser::SerializeMap;
7902        #[allow(unused_imports)]
7903        use std::option::Option::Some;
7904        let mut state = serializer.serialize_map(std::option::Option::None)?;
7905        if !self.name.is_empty() {
7906            state.serialize_entry("name", &self.name)?;
7907        }
7908        if !self._unknown_fields.is_empty() {
7909            for (key, value) in self._unknown_fields.iter() {
7910                state.serialize_entry(key, &value)?;
7911            }
7912        }
7913        state.end()
7914    }
7915}
7916
7917/// Message for fetching an OAuth access token.
7918#[derive(Clone, Debug, Default, PartialEq)]
7919#[non_exhaustive]
7920pub struct FetchAccessTokenRequest {
7921    /// Required. The resource name of the AccountConnector in the format
7922    /// `projects/*/locations/*/accountConnectors/*`.
7923    pub account_connector: std::string::String,
7924
7925    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7926}
7927
7928impl FetchAccessTokenRequest {
7929    pub fn new() -> Self {
7930        std::default::Default::default()
7931    }
7932
7933    /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
7934    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
7935        mut self,
7936        v: T,
7937    ) -> Self {
7938        self.account_connector = v.into();
7939        self
7940    }
7941}
7942
7943impl wkt::message::Message for FetchAccessTokenRequest {
7944    fn typename() -> &'static str {
7945        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
7946    }
7947}
7948
7949#[doc(hidden)]
7950impl<'de> serde::de::Deserialize<'de> for FetchAccessTokenRequest {
7951    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7952    where
7953        D: serde::Deserializer<'de>,
7954    {
7955        #[allow(non_camel_case_types)]
7956        #[doc(hidden)]
7957        #[derive(PartialEq, Eq, Hash)]
7958        enum __FieldTag {
7959            __account_connector,
7960            Unknown(std::string::String),
7961        }
7962        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7963            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7964            where
7965                D: serde::Deserializer<'de>,
7966            {
7967                struct Visitor;
7968                impl<'de> serde::de::Visitor<'de> for Visitor {
7969                    type Value = __FieldTag;
7970                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7971                        formatter.write_str("a field name for FetchAccessTokenRequest")
7972                    }
7973                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7974                    where
7975                        E: serde::de::Error,
7976                    {
7977                        use std::result::Result::Ok;
7978                        use std::string::ToString;
7979                        match value {
7980                            "accountConnector" => Ok(__FieldTag::__account_connector),
7981                            "account_connector" => Ok(__FieldTag::__account_connector),
7982                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7983                        }
7984                    }
7985                }
7986                deserializer.deserialize_identifier(Visitor)
7987            }
7988        }
7989        struct Visitor;
7990        impl<'de> serde::de::Visitor<'de> for Visitor {
7991            type Value = FetchAccessTokenRequest;
7992            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7993                formatter.write_str("struct FetchAccessTokenRequest")
7994            }
7995            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7996            where
7997                A: serde::de::MapAccess<'de>,
7998            {
7999                #[allow(unused_imports)]
8000                use serde::de::Error;
8001                use std::option::Option::Some;
8002                let mut fields = std::collections::HashSet::new();
8003                let mut result = Self::Value::new();
8004                while let Some(tag) = map.next_key::<__FieldTag>()? {
8005                    #[allow(clippy::match_single_binding)]
8006                    match tag {
8007                        __FieldTag::__account_connector => {
8008                            if !fields.insert(__FieldTag::__account_connector) {
8009                                return std::result::Result::Err(A::Error::duplicate_field(
8010                                    "multiple values for account_connector",
8011                                ));
8012                            }
8013                            result.account_connector = map
8014                                .next_value::<std::option::Option<std::string::String>>()?
8015                                .unwrap_or_default();
8016                        }
8017                        __FieldTag::Unknown(key) => {
8018                            let value = map.next_value::<serde_json::Value>()?;
8019                            result._unknown_fields.insert(key, value);
8020                        }
8021                    }
8022                }
8023                std::result::Result::Ok(result)
8024            }
8025        }
8026        deserializer.deserialize_any(Visitor)
8027    }
8028}
8029
8030#[doc(hidden)]
8031impl serde::ser::Serialize for FetchAccessTokenRequest {
8032    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8033    where
8034        S: serde::ser::Serializer,
8035    {
8036        use serde::ser::SerializeMap;
8037        #[allow(unused_imports)]
8038        use std::option::Option::Some;
8039        let mut state = serializer.serialize_map(std::option::Option::None)?;
8040        if !self.account_connector.is_empty() {
8041            state.serialize_entry("accountConnector", &self.account_connector)?;
8042        }
8043        if !self._unknown_fields.is_empty() {
8044            for (key, value) in self._unknown_fields.iter() {
8045                state.serialize_entry(key, &value)?;
8046            }
8047        }
8048        state.end()
8049    }
8050}
8051
8052/// Message for responding to getting an OAuth access token.
8053#[derive(Clone, Debug, Default, PartialEq)]
8054#[non_exhaustive]
8055pub struct FetchAccessTokenResponse {
8056    /// The token content.
8057    pub token: std::string::String,
8058
8059    /// Expiration timestamp. Can be empty if unknown or non-expiring.
8060    pub expiration_time: std::option::Option<wkt::Timestamp>,
8061
8062    /// The scopes of the access token.
8063    pub scopes: std::vec::Vec<std::string::String>,
8064
8065    /// The error resulted from exchanging OAuth tokens from the service provider.
8066    pub exchange_error: std::option::Option<crate::model::ExchangeError>,
8067
8068    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8069}
8070
8071impl FetchAccessTokenResponse {
8072    pub fn new() -> Self {
8073        std::default::Default::default()
8074    }
8075
8076    /// Sets the value of [token][crate::model::FetchAccessTokenResponse::token].
8077    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8078        self.token = v.into();
8079        self
8080    }
8081
8082    /// Sets the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
8083    pub fn set_expiration_time<T>(mut self, v: T) -> Self
8084    where
8085        T: std::convert::Into<wkt::Timestamp>,
8086    {
8087        self.expiration_time = std::option::Option::Some(v.into());
8088        self
8089    }
8090
8091    /// Sets or clears the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
8092    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
8093    where
8094        T: std::convert::Into<wkt::Timestamp>,
8095    {
8096        self.expiration_time = v.map(|x| x.into());
8097        self
8098    }
8099
8100    /// Sets the value of [scopes][crate::model::FetchAccessTokenResponse::scopes].
8101    pub fn set_scopes<T, V>(mut self, v: T) -> Self
8102    where
8103        T: std::iter::IntoIterator<Item = V>,
8104        V: std::convert::Into<std::string::String>,
8105    {
8106        use std::iter::Iterator;
8107        self.scopes = v.into_iter().map(|i| i.into()).collect();
8108        self
8109    }
8110
8111    /// Sets the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
8112    pub fn set_exchange_error<T>(mut self, v: T) -> Self
8113    where
8114        T: std::convert::Into<crate::model::ExchangeError>,
8115    {
8116        self.exchange_error = std::option::Option::Some(v.into());
8117        self
8118    }
8119
8120    /// Sets or clears the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
8121    pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
8122    where
8123        T: std::convert::Into<crate::model::ExchangeError>,
8124    {
8125        self.exchange_error = v.map(|x| x.into());
8126        self
8127    }
8128}
8129
8130impl wkt::message::Message for FetchAccessTokenResponse {
8131    fn typename() -> &'static str {
8132        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
8133    }
8134}
8135
8136#[doc(hidden)]
8137impl<'de> serde::de::Deserialize<'de> for FetchAccessTokenResponse {
8138    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8139    where
8140        D: serde::Deserializer<'de>,
8141    {
8142        #[allow(non_camel_case_types)]
8143        #[doc(hidden)]
8144        #[derive(PartialEq, Eq, Hash)]
8145        enum __FieldTag {
8146            __token,
8147            __expiration_time,
8148            __scopes,
8149            __exchange_error,
8150            Unknown(std::string::String),
8151        }
8152        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8153            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8154            where
8155                D: serde::Deserializer<'de>,
8156            {
8157                struct Visitor;
8158                impl<'de> serde::de::Visitor<'de> for Visitor {
8159                    type Value = __FieldTag;
8160                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8161                        formatter.write_str("a field name for FetchAccessTokenResponse")
8162                    }
8163                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8164                    where
8165                        E: serde::de::Error,
8166                    {
8167                        use std::result::Result::Ok;
8168                        use std::string::ToString;
8169                        match value {
8170                            "token" => Ok(__FieldTag::__token),
8171                            "expirationTime" => Ok(__FieldTag::__expiration_time),
8172                            "expiration_time" => Ok(__FieldTag::__expiration_time),
8173                            "scopes" => Ok(__FieldTag::__scopes),
8174                            "exchangeError" => Ok(__FieldTag::__exchange_error),
8175                            "exchange_error" => Ok(__FieldTag::__exchange_error),
8176                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8177                        }
8178                    }
8179                }
8180                deserializer.deserialize_identifier(Visitor)
8181            }
8182        }
8183        struct Visitor;
8184        impl<'de> serde::de::Visitor<'de> for Visitor {
8185            type Value = FetchAccessTokenResponse;
8186            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8187                formatter.write_str("struct FetchAccessTokenResponse")
8188            }
8189            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8190            where
8191                A: serde::de::MapAccess<'de>,
8192            {
8193                #[allow(unused_imports)]
8194                use serde::de::Error;
8195                use std::option::Option::Some;
8196                let mut fields = std::collections::HashSet::new();
8197                let mut result = Self::Value::new();
8198                while let Some(tag) = map.next_key::<__FieldTag>()? {
8199                    #[allow(clippy::match_single_binding)]
8200                    match tag {
8201                        __FieldTag::__token => {
8202                            if !fields.insert(__FieldTag::__token) {
8203                                return std::result::Result::Err(A::Error::duplicate_field(
8204                                    "multiple values for token",
8205                                ));
8206                            }
8207                            result.token = map
8208                                .next_value::<std::option::Option<std::string::String>>()?
8209                                .unwrap_or_default();
8210                        }
8211                        __FieldTag::__expiration_time => {
8212                            if !fields.insert(__FieldTag::__expiration_time) {
8213                                return std::result::Result::Err(A::Error::duplicate_field(
8214                                    "multiple values for expiration_time",
8215                                ));
8216                            }
8217                            result.expiration_time =
8218                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8219                        }
8220                        __FieldTag::__scopes => {
8221                            if !fields.insert(__FieldTag::__scopes) {
8222                                return std::result::Result::Err(A::Error::duplicate_field(
8223                                    "multiple values for scopes",
8224                                ));
8225                            }
8226                            result.scopes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8227                        }
8228                        __FieldTag::__exchange_error => {
8229                            if !fields.insert(__FieldTag::__exchange_error) {
8230                                return std::result::Result::Err(A::Error::duplicate_field(
8231                                    "multiple values for exchange_error",
8232                                ));
8233                            }
8234                            result.exchange_error = map
8235                                .next_value::<std::option::Option<crate::model::ExchangeError>>()?;
8236                        }
8237                        __FieldTag::Unknown(key) => {
8238                            let value = map.next_value::<serde_json::Value>()?;
8239                            result._unknown_fields.insert(key, value);
8240                        }
8241                    }
8242                }
8243                std::result::Result::Ok(result)
8244            }
8245        }
8246        deserializer.deserialize_any(Visitor)
8247    }
8248}
8249
8250#[doc(hidden)]
8251impl serde::ser::Serialize for FetchAccessTokenResponse {
8252    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8253    where
8254        S: serde::ser::Serializer,
8255    {
8256        use serde::ser::SerializeMap;
8257        #[allow(unused_imports)]
8258        use std::option::Option::Some;
8259        let mut state = serializer.serialize_map(std::option::Option::None)?;
8260        if !self.token.is_empty() {
8261            state.serialize_entry("token", &self.token)?;
8262        }
8263        if self.expiration_time.is_some() {
8264            state.serialize_entry("expirationTime", &self.expiration_time)?;
8265        }
8266        if !self.scopes.is_empty() {
8267            state.serialize_entry("scopes", &self.scopes)?;
8268        }
8269        if self.exchange_error.is_some() {
8270            state.serialize_entry("exchangeError", &self.exchange_error)?;
8271        }
8272        if !self._unknown_fields.is_empty() {
8273            for (key, value) in self._unknown_fields.iter() {
8274                state.serialize_entry(key, &value)?;
8275            }
8276        }
8277        state.end()
8278    }
8279}
8280
8281/// Message for representing an error from exchanging OAuth tokens.
8282#[derive(Clone, Debug, Default, PartialEq)]
8283#[non_exhaustive]
8284pub struct ExchangeError {
8285    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> - error
8286    pub code: std::string::String,
8287
8288    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> -
8289    /// error_description
8290    pub description: std::string::String,
8291
8292    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8293}
8294
8295impl ExchangeError {
8296    pub fn new() -> Self {
8297        std::default::Default::default()
8298    }
8299
8300    /// Sets the value of [code][crate::model::ExchangeError::code].
8301    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8302        self.code = v.into();
8303        self
8304    }
8305
8306    /// Sets the value of [description][crate::model::ExchangeError::description].
8307    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8308        self.description = v.into();
8309        self
8310    }
8311}
8312
8313impl wkt::message::Message for ExchangeError {
8314    fn typename() -> &'static str {
8315        "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
8316    }
8317}
8318
8319#[doc(hidden)]
8320impl<'de> serde::de::Deserialize<'de> for ExchangeError {
8321    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8322    where
8323        D: serde::Deserializer<'de>,
8324    {
8325        #[allow(non_camel_case_types)]
8326        #[doc(hidden)]
8327        #[derive(PartialEq, Eq, Hash)]
8328        enum __FieldTag {
8329            __code,
8330            __description,
8331            Unknown(std::string::String),
8332        }
8333        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8334            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8335            where
8336                D: serde::Deserializer<'de>,
8337            {
8338                struct Visitor;
8339                impl<'de> serde::de::Visitor<'de> for Visitor {
8340                    type Value = __FieldTag;
8341                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8342                        formatter.write_str("a field name for ExchangeError")
8343                    }
8344                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8345                    where
8346                        E: serde::de::Error,
8347                    {
8348                        use std::result::Result::Ok;
8349                        use std::string::ToString;
8350                        match value {
8351                            "code" => Ok(__FieldTag::__code),
8352                            "description" => Ok(__FieldTag::__description),
8353                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8354                        }
8355                    }
8356                }
8357                deserializer.deserialize_identifier(Visitor)
8358            }
8359        }
8360        struct Visitor;
8361        impl<'de> serde::de::Visitor<'de> for Visitor {
8362            type Value = ExchangeError;
8363            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8364                formatter.write_str("struct ExchangeError")
8365            }
8366            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8367            where
8368                A: serde::de::MapAccess<'de>,
8369            {
8370                #[allow(unused_imports)]
8371                use serde::de::Error;
8372                use std::option::Option::Some;
8373                let mut fields = std::collections::HashSet::new();
8374                let mut result = Self::Value::new();
8375                while let Some(tag) = map.next_key::<__FieldTag>()? {
8376                    #[allow(clippy::match_single_binding)]
8377                    match tag {
8378                        __FieldTag::__code => {
8379                            if !fields.insert(__FieldTag::__code) {
8380                                return std::result::Result::Err(A::Error::duplicate_field(
8381                                    "multiple values for code",
8382                                ));
8383                            }
8384                            result.code = map
8385                                .next_value::<std::option::Option<std::string::String>>()?
8386                                .unwrap_or_default();
8387                        }
8388                        __FieldTag::__description => {
8389                            if !fields.insert(__FieldTag::__description) {
8390                                return std::result::Result::Err(A::Error::duplicate_field(
8391                                    "multiple values for description",
8392                                ));
8393                            }
8394                            result.description = map
8395                                .next_value::<std::option::Option<std::string::String>>()?
8396                                .unwrap_or_default();
8397                        }
8398                        __FieldTag::Unknown(key) => {
8399                            let value = map.next_value::<serde_json::Value>()?;
8400                            result._unknown_fields.insert(key, value);
8401                        }
8402                    }
8403                }
8404                std::result::Result::Ok(result)
8405            }
8406        }
8407        deserializer.deserialize_any(Visitor)
8408    }
8409}
8410
8411#[doc(hidden)]
8412impl serde::ser::Serialize for ExchangeError {
8413    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8414    where
8415        S: serde::ser::Serializer,
8416    {
8417        use serde::ser::SerializeMap;
8418        #[allow(unused_imports)]
8419        use std::option::Option::Some;
8420        let mut state = serializer.serialize_map(std::option::Option::None)?;
8421        if !self.code.is_empty() {
8422            state.serialize_entry("code", &self.code)?;
8423        }
8424        if !self.description.is_empty() {
8425            state.serialize_entry("description", &self.description)?;
8426        }
8427        if !self._unknown_fields.is_empty() {
8428            for (key, value) in self._unknown_fields.iter() {
8429                state.serialize_entry(key, &value)?;
8430            }
8431        }
8432        state.end()
8433    }
8434}
8435
8436/// Message describing the GitRepositoryLink object
8437#[derive(Clone, Debug, Default, PartialEq)]
8438#[non_exhaustive]
8439pub struct GitRepositoryLink {
8440    /// Identifier. Resource name of the repository, in the format
8441    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
8442    pub name: std::string::String,
8443
8444    /// Required. Git Clone URI.
8445    pub clone_uri: std::string::String,
8446
8447    /// Output only. [Output only] Create timestamp
8448    pub create_time: std::option::Option<wkt::Timestamp>,
8449
8450    /// Output only. [Output only] Update timestamp
8451    pub update_time: std::option::Option<wkt::Timestamp>,
8452
8453    /// Output only. [Output only] Delete timestamp
8454    pub delete_time: std::option::Option<wkt::Timestamp>,
8455
8456    /// Optional. Labels as key value pairs
8457    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8458
8459    /// Optional. This checksum is computed by the server based on the value of
8460    /// other fields, and may be sent on update and delete requests to ensure the
8461    /// client has an up-to-date value before proceeding.
8462    pub etag: std::string::String,
8463
8464    /// Output only. Set to true when the connection is being set up or updated in
8465    /// the background.
8466    pub reconciling: bool,
8467
8468    /// Optional. Allows clients to store small amounts of arbitrary data.
8469    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8470
8471    /// Output only. A system-assigned unique identifier for the GitRepositoryLink.
8472    pub uid: std::string::String,
8473
8474    /// Output only. External ID of the webhook created for the repository.
8475    pub webhook_id: std::string::String,
8476
8477    /// Output only. URI to access the linked repository through the Git Proxy.
8478    /// This field is only populated if the git proxy is enabled for the
8479    /// connection.
8480    pub git_proxy_uri: std::string::String,
8481
8482    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8483}
8484
8485impl GitRepositoryLink {
8486    pub fn new() -> Self {
8487        std::default::Default::default()
8488    }
8489
8490    /// Sets the value of [name][crate::model::GitRepositoryLink::name].
8491    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8492        self.name = v.into();
8493        self
8494    }
8495
8496    /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
8497    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8498        self.clone_uri = v.into();
8499        self
8500    }
8501
8502    /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
8503    pub fn set_create_time<T>(mut self, v: T) -> Self
8504    where
8505        T: std::convert::Into<wkt::Timestamp>,
8506    {
8507        self.create_time = std::option::Option::Some(v.into());
8508        self
8509    }
8510
8511    /// Sets or clears the value of [create_time][crate::model::GitRepositoryLink::create_time].
8512    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8513    where
8514        T: std::convert::Into<wkt::Timestamp>,
8515    {
8516        self.create_time = v.map(|x| x.into());
8517        self
8518    }
8519
8520    /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
8521    pub fn set_update_time<T>(mut self, v: T) -> Self
8522    where
8523        T: std::convert::Into<wkt::Timestamp>,
8524    {
8525        self.update_time = std::option::Option::Some(v.into());
8526        self
8527    }
8528
8529    /// Sets or clears the value of [update_time][crate::model::GitRepositoryLink::update_time].
8530    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8531    where
8532        T: std::convert::Into<wkt::Timestamp>,
8533    {
8534        self.update_time = v.map(|x| x.into());
8535        self
8536    }
8537
8538    /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
8539    pub fn set_delete_time<T>(mut self, v: T) -> Self
8540    where
8541        T: std::convert::Into<wkt::Timestamp>,
8542    {
8543        self.delete_time = std::option::Option::Some(v.into());
8544        self
8545    }
8546
8547    /// Sets or clears the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
8548    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
8549    where
8550        T: std::convert::Into<wkt::Timestamp>,
8551    {
8552        self.delete_time = v.map(|x| x.into());
8553        self
8554    }
8555
8556    /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
8557    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8558    where
8559        T: std::iter::IntoIterator<Item = (K, V)>,
8560        K: std::convert::Into<std::string::String>,
8561        V: std::convert::Into<std::string::String>,
8562    {
8563        use std::iter::Iterator;
8564        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8565        self
8566    }
8567
8568    /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
8569    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8570        self.etag = v.into();
8571        self
8572    }
8573
8574    /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
8575    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8576        self.reconciling = v.into();
8577        self
8578    }
8579
8580    /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
8581    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
8582    where
8583        T: std::iter::IntoIterator<Item = (K, V)>,
8584        K: std::convert::Into<std::string::String>,
8585        V: std::convert::Into<std::string::String>,
8586    {
8587        use std::iter::Iterator;
8588        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8589        self
8590    }
8591
8592    /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
8593    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8594        self.uid = v.into();
8595        self
8596    }
8597
8598    /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
8599    pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8600        self.webhook_id = v.into();
8601        self
8602    }
8603
8604    /// Sets the value of [git_proxy_uri][crate::model::GitRepositoryLink::git_proxy_uri].
8605    pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8606        self.git_proxy_uri = v.into();
8607        self
8608    }
8609}
8610
8611impl wkt::message::Message for GitRepositoryLink {
8612    fn typename() -> &'static str {
8613        "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
8614    }
8615}
8616
8617#[doc(hidden)]
8618impl<'de> serde::de::Deserialize<'de> for GitRepositoryLink {
8619    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8620    where
8621        D: serde::Deserializer<'de>,
8622    {
8623        #[allow(non_camel_case_types)]
8624        #[doc(hidden)]
8625        #[derive(PartialEq, Eq, Hash)]
8626        enum __FieldTag {
8627            __name,
8628            __clone_uri,
8629            __create_time,
8630            __update_time,
8631            __delete_time,
8632            __labels,
8633            __etag,
8634            __reconciling,
8635            __annotations,
8636            __uid,
8637            __webhook_id,
8638            __git_proxy_uri,
8639            Unknown(std::string::String),
8640        }
8641        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8642            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8643            where
8644                D: serde::Deserializer<'de>,
8645            {
8646                struct Visitor;
8647                impl<'de> serde::de::Visitor<'de> for Visitor {
8648                    type Value = __FieldTag;
8649                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8650                        formatter.write_str("a field name for GitRepositoryLink")
8651                    }
8652                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8653                    where
8654                        E: serde::de::Error,
8655                    {
8656                        use std::result::Result::Ok;
8657                        use std::string::ToString;
8658                        match value {
8659                            "name" => Ok(__FieldTag::__name),
8660                            "cloneUri" => Ok(__FieldTag::__clone_uri),
8661                            "clone_uri" => Ok(__FieldTag::__clone_uri),
8662                            "createTime" => Ok(__FieldTag::__create_time),
8663                            "create_time" => Ok(__FieldTag::__create_time),
8664                            "updateTime" => Ok(__FieldTag::__update_time),
8665                            "update_time" => Ok(__FieldTag::__update_time),
8666                            "deleteTime" => Ok(__FieldTag::__delete_time),
8667                            "delete_time" => Ok(__FieldTag::__delete_time),
8668                            "labels" => Ok(__FieldTag::__labels),
8669                            "etag" => Ok(__FieldTag::__etag),
8670                            "reconciling" => Ok(__FieldTag::__reconciling),
8671                            "annotations" => Ok(__FieldTag::__annotations),
8672                            "uid" => Ok(__FieldTag::__uid),
8673                            "webhookId" => Ok(__FieldTag::__webhook_id),
8674                            "webhook_id" => Ok(__FieldTag::__webhook_id),
8675                            "gitProxyUri" => Ok(__FieldTag::__git_proxy_uri),
8676                            "git_proxy_uri" => Ok(__FieldTag::__git_proxy_uri),
8677                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8678                        }
8679                    }
8680                }
8681                deserializer.deserialize_identifier(Visitor)
8682            }
8683        }
8684        struct Visitor;
8685        impl<'de> serde::de::Visitor<'de> for Visitor {
8686            type Value = GitRepositoryLink;
8687            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8688                formatter.write_str("struct GitRepositoryLink")
8689            }
8690            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8691            where
8692                A: serde::de::MapAccess<'de>,
8693            {
8694                #[allow(unused_imports)]
8695                use serde::de::Error;
8696                use std::option::Option::Some;
8697                let mut fields = std::collections::HashSet::new();
8698                let mut result = Self::Value::new();
8699                while let Some(tag) = map.next_key::<__FieldTag>()? {
8700                    #[allow(clippy::match_single_binding)]
8701                    match tag {
8702                        __FieldTag::__name => {
8703                            if !fields.insert(__FieldTag::__name) {
8704                                return std::result::Result::Err(A::Error::duplicate_field(
8705                                    "multiple values for name",
8706                                ));
8707                            }
8708                            result.name = map
8709                                .next_value::<std::option::Option<std::string::String>>()?
8710                                .unwrap_or_default();
8711                        }
8712                        __FieldTag::__clone_uri => {
8713                            if !fields.insert(__FieldTag::__clone_uri) {
8714                                return std::result::Result::Err(A::Error::duplicate_field(
8715                                    "multiple values for clone_uri",
8716                                ));
8717                            }
8718                            result.clone_uri = map
8719                                .next_value::<std::option::Option<std::string::String>>()?
8720                                .unwrap_or_default();
8721                        }
8722                        __FieldTag::__create_time => {
8723                            if !fields.insert(__FieldTag::__create_time) {
8724                                return std::result::Result::Err(A::Error::duplicate_field(
8725                                    "multiple values for create_time",
8726                                ));
8727                            }
8728                            result.create_time =
8729                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8730                        }
8731                        __FieldTag::__update_time => {
8732                            if !fields.insert(__FieldTag::__update_time) {
8733                                return std::result::Result::Err(A::Error::duplicate_field(
8734                                    "multiple values for update_time",
8735                                ));
8736                            }
8737                            result.update_time =
8738                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8739                        }
8740                        __FieldTag::__delete_time => {
8741                            if !fields.insert(__FieldTag::__delete_time) {
8742                                return std::result::Result::Err(A::Error::duplicate_field(
8743                                    "multiple values for delete_time",
8744                                ));
8745                            }
8746                            result.delete_time =
8747                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8748                        }
8749                        __FieldTag::__labels => {
8750                            if !fields.insert(__FieldTag::__labels) {
8751                                return std::result::Result::Err(A::Error::duplicate_field(
8752                                    "multiple values for labels",
8753                                ));
8754                            }
8755                            result.labels = map
8756                                .next_value::<std::option::Option<
8757                                    std::collections::HashMap<
8758                                        std::string::String,
8759                                        std::string::String,
8760                                    >,
8761                                >>()?
8762                                .unwrap_or_default();
8763                        }
8764                        __FieldTag::__etag => {
8765                            if !fields.insert(__FieldTag::__etag) {
8766                                return std::result::Result::Err(A::Error::duplicate_field(
8767                                    "multiple values for etag",
8768                                ));
8769                            }
8770                            result.etag = map
8771                                .next_value::<std::option::Option<std::string::String>>()?
8772                                .unwrap_or_default();
8773                        }
8774                        __FieldTag::__reconciling => {
8775                            if !fields.insert(__FieldTag::__reconciling) {
8776                                return std::result::Result::Err(A::Error::duplicate_field(
8777                                    "multiple values for reconciling",
8778                                ));
8779                            }
8780                            result.reconciling = map
8781                                .next_value::<std::option::Option<bool>>()?
8782                                .unwrap_or_default();
8783                        }
8784                        __FieldTag::__annotations => {
8785                            if !fields.insert(__FieldTag::__annotations) {
8786                                return std::result::Result::Err(A::Error::duplicate_field(
8787                                    "multiple values for annotations",
8788                                ));
8789                            }
8790                            result.annotations = map
8791                                .next_value::<std::option::Option<
8792                                    std::collections::HashMap<
8793                                        std::string::String,
8794                                        std::string::String,
8795                                    >,
8796                                >>()?
8797                                .unwrap_or_default();
8798                        }
8799                        __FieldTag::__uid => {
8800                            if !fields.insert(__FieldTag::__uid) {
8801                                return std::result::Result::Err(A::Error::duplicate_field(
8802                                    "multiple values for uid",
8803                                ));
8804                            }
8805                            result.uid = map
8806                                .next_value::<std::option::Option<std::string::String>>()?
8807                                .unwrap_or_default();
8808                        }
8809                        __FieldTag::__webhook_id => {
8810                            if !fields.insert(__FieldTag::__webhook_id) {
8811                                return std::result::Result::Err(A::Error::duplicate_field(
8812                                    "multiple values for webhook_id",
8813                                ));
8814                            }
8815                            result.webhook_id = map
8816                                .next_value::<std::option::Option<std::string::String>>()?
8817                                .unwrap_or_default();
8818                        }
8819                        __FieldTag::__git_proxy_uri => {
8820                            if !fields.insert(__FieldTag::__git_proxy_uri) {
8821                                return std::result::Result::Err(A::Error::duplicate_field(
8822                                    "multiple values for git_proxy_uri",
8823                                ));
8824                            }
8825                            result.git_proxy_uri = map
8826                                .next_value::<std::option::Option<std::string::String>>()?
8827                                .unwrap_or_default();
8828                        }
8829                        __FieldTag::Unknown(key) => {
8830                            let value = map.next_value::<serde_json::Value>()?;
8831                            result._unknown_fields.insert(key, value);
8832                        }
8833                    }
8834                }
8835                std::result::Result::Ok(result)
8836            }
8837        }
8838        deserializer.deserialize_any(Visitor)
8839    }
8840}
8841
8842#[doc(hidden)]
8843impl serde::ser::Serialize for GitRepositoryLink {
8844    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8845    where
8846        S: serde::ser::Serializer,
8847    {
8848        use serde::ser::SerializeMap;
8849        #[allow(unused_imports)]
8850        use std::option::Option::Some;
8851        let mut state = serializer.serialize_map(std::option::Option::None)?;
8852        if !self.name.is_empty() {
8853            state.serialize_entry("name", &self.name)?;
8854        }
8855        if !self.clone_uri.is_empty() {
8856            state.serialize_entry("cloneUri", &self.clone_uri)?;
8857        }
8858        if self.create_time.is_some() {
8859            state.serialize_entry("createTime", &self.create_time)?;
8860        }
8861        if self.update_time.is_some() {
8862            state.serialize_entry("updateTime", &self.update_time)?;
8863        }
8864        if self.delete_time.is_some() {
8865            state.serialize_entry("deleteTime", &self.delete_time)?;
8866        }
8867        if !self.labels.is_empty() {
8868            state.serialize_entry("labels", &self.labels)?;
8869        }
8870        if !self.etag.is_empty() {
8871            state.serialize_entry("etag", &self.etag)?;
8872        }
8873        if !wkt::internal::is_default(&self.reconciling) {
8874            state.serialize_entry("reconciling", &self.reconciling)?;
8875        }
8876        if !self.annotations.is_empty() {
8877            state.serialize_entry("annotations", &self.annotations)?;
8878        }
8879        if !self.uid.is_empty() {
8880            state.serialize_entry("uid", &self.uid)?;
8881        }
8882        if !self.webhook_id.is_empty() {
8883            state.serialize_entry("webhookId", &self.webhook_id)?;
8884        }
8885        if !self.git_proxy_uri.is_empty() {
8886            state.serialize_entry("gitProxyUri", &self.git_proxy_uri)?;
8887        }
8888        if !self._unknown_fields.is_empty() {
8889            for (key, value) in self._unknown_fields.iter() {
8890                state.serialize_entry(key, &value)?;
8891            }
8892        }
8893        state.end()
8894    }
8895}
8896
8897/// Message for creating a GitRepositoryLink
8898#[derive(Clone, Debug, Default, PartialEq)]
8899#[non_exhaustive]
8900pub struct CreateGitRepositoryLinkRequest {
8901    /// Required. Value for parent.
8902    pub parent: std::string::String,
8903
8904    /// Required. The resource being created
8905    pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
8906
8907    /// Required. The ID to use for the repository, which will become the final
8908    /// component of the repository's resource name. This ID should be unique in
8909    /// the connection. Allows alphanumeric characters and any of
8910    /// -._~%!$&'()*+,;=@.
8911    pub git_repository_link_id: std::string::String,
8912
8913    /// Optional. An optional request ID to identify requests. Specify a unique
8914    /// request ID so that if you must retry your request, the server will know to
8915    /// ignore the request if it has already been completed. The server will
8916    /// guarantee that for at least 60 minutes since the first request.
8917    ///
8918    /// For example, consider a situation where you make an initial request and the
8919    /// request times out. If you make the request again with the same request
8920    /// ID, the server can check if original operation with the same request ID
8921    /// was received, and if so, will ignore the second request. This prevents
8922    /// clients from accidentally creating duplicate commitments.
8923    ///
8924    /// The request ID must be a valid UUID with the exception that zero UUID is
8925    /// not supported (00000000-0000-0000-0000-000000000000).
8926    pub request_id: std::string::String,
8927
8928    /// Optional. If set, validate the request, but do not actually post it.
8929    pub validate_only: bool,
8930
8931    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8932}
8933
8934impl CreateGitRepositoryLinkRequest {
8935    pub fn new() -> Self {
8936        std::default::Default::default()
8937    }
8938
8939    /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
8940    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8941        self.parent = v.into();
8942        self
8943    }
8944
8945    /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
8946    pub fn set_git_repository_link<T>(mut self, v: T) -> Self
8947    where
8948        T: std::convert::Into<crate::model::GitRepositoryLink>,
8949    {
8950        self.git_repository_link = std::option::Option::Some(v.into());
8951        self
8952    }
8953
8954    /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
8955    pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
8956    where
8957        T: std::convert::Into<crate::model::GitRepositoryLink>,
8958    {
8959        self.git_repository_link = v.map(|x| x.into());
8960        self
8961    }
8962
8963    /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
8964    pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
8965        mut self,
8966        v: T,
8967    ) -> Self {
8968        self.git_repository_link_id = v.into();
8969        self
8970    }
8971
8972    /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
8973    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8974        self.request_id = v.into();
8975        self
8976    }
8977
8978    /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
8979    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8980        self.validate_only = v.into();
8981        self
8982    }
8983}
8984
8985impl wkt::message::Message for CreateGitRepositoryLinkRequest {
8986    fn typename() -> &'static str {
8987        "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
8988    }
8989}
8990
8991#[doc(hidden)]
8992impl<'de> serde::de::Deserialize<'de> for CreateGitRepositoryLinkRequest {
8993    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8994    where
8995        D: serde::Deserializer<'de>,
8996    {
8997        #[allow(non_camel_case_types)]
8998        #[doc(hidden)]
8999        #[derive(PartialEq, Eq, Hash)]
9000        enum __FieldTag {
9001            __parent,
9002            __git_repository_link,
9003            __git_repository_link_id,
9004            __request_id,
9005            __validate_only,
9006            Unknown(std::string::String),
9007        }
9008        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9009            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9010            where
9011                D: serde::Deserializer<'de>,
9012            {
9013                struct Visitor;
9014                impl<'de> serde::de::Visitor<'de> for Visitor {
9015                    type Value = __FieldTag;
9016                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9017                        formatter.write_str("a field name for CreateGitRepositoryLinkRequest")
9018                    }
9019                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9020                    where
9021                        E: serde::de::Error,
9022                    {
9023                        use std::result::Result::Ok;
9024                        use std::string::ToString;
9025                        match value {
9026                            "parent" => Ok(__FieldTag::__parent),
9027                            "gitRepositoryLink" => Ok(__FieldTag::__git_repository_link),
9028                            "git_repository_link" => Ok(__FieldTag::__git_repository_link),
9029                            "gitRepositoryLinkId" => Ok(__FieldTag::__git_repository_link_id),
9030                            "git_repository_link_id" => Ok(__FieldTag::__git_repository_link_id),
9031                            "requestId" => Ok(__FieldTag::__request_id),
9032                            "request_id" => Ok(__FieldTag::__request_id),
9033                            "validateOnly" => Ok(__FieldTag::__validate_only),
9034                            "validate_only" => Ok(__FieldTag::__validate_only),
9035                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9036                        }
9037                    }
9038                }
9039                deserializer.deserialize_identifier(Visitor)
9040            }
9041        }
9042        struct Visitor;
9043        impl<'de> serde::de::Visitor<'de> for Visitor {
9044            type Value = CreateGitRepositoryLinkRequest;
9045            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9046                formatter.write_str("struct CreateGitRepositoryLinkRequest")
9047            }
9048            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9049            where
9050                A: serde::de::MapAccess<'de>,
9051            {
9052                #[allow(unused_imports)]
9053                use serde::de::Error;
9054                use std::option::Option::Some;
9055                let mut fields = std::collections::HashSet::new();
9056                let mut result = Self::Value::new();
9057                while let Some(tag) = map.next_key::<__FieldTag>()? {
9058                    #[allow(clippy::match_single_binding)]
9059                    match tag {
9060                        __FieldTag::__parent => {
9061                            if !fields.insert(__FieldTag::__parent) {
9062                                return std::result::Result::Err(A::Error::duplicate_field(
9063                                    "multiple values for parent",
9064                                ));
9065                            }
9066                            result.parent = map
9067                                .next_value::<std::option::Option<std::string::String>>()?
9068                                .unwrap_or_default();
9069                        }
9070                        __FieldTag::__git_repository_link => {
9071                            if !fields.insert(__FieldTag::__git_repository_link) {
9072                                return std::result::Result::Err(A::Error::duplicate_field(
9073                                    "multiple values for git_repository_link",
9074                                ));
9075                            }
9076                            result.git_repository_link = map
9077                                .next_value::<std::option::Option<crate::model::GitRepositoryLink>>(
9078                                )?;
9079                        }
9080                        __FieldTag::__git_repository_link_id => {
9081                            if !fields.insert(__FieldTag::__git_repository_link_id) {
9082                                return std::result::Result::Err(A::Error::duplicate_field(
9083                                    "multiple values for git_repository_link_id",
9084                                ));
9085                            }
9086                            result.git_repository_link_id = map
9087                                .next_value::<std::option::Option<std::string::String>>()?
9088                                .unwrap_or_default();
9089                        }
9090                        __FieldTag::__request_id => {
9091                            if !fields.insert(__FieldTag::__request_id) {
9092                                return std::result::Result::Err(A::Error::duplicate_field(
9093                                    "multiple values for request_id",
9094                                ));
9095                            }
9096                            result.request_id = map
9097                                .next_value::<std::option::Option<std::string::String>>()?
9098                                .unwrap_or_default();
9099                        }
9100                        __FieldTag::__validate_only => {
9101                            if !fields.insert(__FieldTag::__validate_only) {
9102                                return std::result::Result::Err(A::Error::duplicate_field(
9103                                    "multiple values for validate_only",
9104                                ));
9105                            }
9106                            result.validate_only = map
9107                                .next_value::<std::option::Option<bool>>()?
9108                                .unwrap_or_default();
9109                        }
9110                        __FieldTag::Unknown(key) => {
9111                            let value = map.next_value::<serde_json::Value>()?;
9112                            result._unknown_fields.insert(key, value);
9113                        }
9114                    }
9115                }
9116                std::result::Result::Ok(result)
9117            }
9118        }
9119        deserializer.deserialize_any(Visitor)
9120    }
9121}
9122
9123#[doc(hidden)]
9124impl serde::ser::Serialize for CreateGitRepositoryLinkRequest {
9125    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9126    where
9127        S: serde::ser::Serializer,
9128    {
9129        use serde::ser::SerializeMap;
9130        #[allow(unused_imports)]
9131        use std::option::Option::Some;
9132        let mut state = serializer.serialize_map(std::option::Option::None)?;
9133        if !self.parent.is_empty() {
9134            state.serialize_entry("parent", &self.parent)?;
9135        }
9136        if self.git_repository_link.is_some() {
9137            state.serialize_entry("gitRepositoryLink", &self.git_repository_link)?;
9138        }
9139        if !self.git_repository_link_id.is_empty() {
9140            state.serialize_entry("gitRepositoryLinkId", &self.git_repository_link_id)?;
9141        }
9142        if !self.request_id.is_empty() {
9143            state.serialize_entry("requestId", &self.request_id)?;
9144        }
9145        if !wkt::internal::is_default(&self.validate_only) {
9146            state.serialize_entry("validateOnly", &self.validate_only)?;
9147        }
9148        if !self._unknown_fields.is_empty() {
9149            for (key, value) in self._unknown_fields.iter() {
9150                state.serialize_entry(key, &value)?;
9151            }
9152        }
9153        state.end()
9154    }
9155}
9156
9157/// Message for deleting a GitRepositoryLink
9158#[derive(Clone, Debug, Default, PartialEq)]
9159#[non_exhaustive]
9160pub struct DeleteGitRepositoryLinkRequest {
9161    /// Required. Name of the resource
9162    pub name: std::string::String,
9163
9164    /// Optional. An optional request ID to identify requests. Specify a unique
9165    /// request ID so that if you must retry your request, the server will know to
9166    /// ignore the request if it has already been completed. The server will
9167    /// guarantee that for at least 60 minutes after the first request.
9168    ///
9169    /// For example, consider a situation where you make an initial request and the
9170    /// request times out. If you make the request again with the same request
9171    /// ID, the server can check if original operation with the same request ID
9172    /// was received, and if so, will ignore the second request. This prevents
9173    /// clients from accidentally creating duplicate commitments.
9174    ///
9175    /// The request ID must be a valid UUID with the exception that zero UUID is
9176    /// not supported (00000000-0000-0000-0000-000000000000).
9177    pub request_id: std::string::String,
9178
9179    /// Optional. If set, validate the request, but do not actually post it.
9180    pub validate_only: bool,
9181
9182    /// Optional. This checksum is computed by the server based on the value of
9183    /// other fields, and may be sent on update and delete requests to ensure the
9184    /// client has an up-to-date value before proceeding.
9185    pub etag: std::string::String,
9186
9187    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9188}
9189
9190impl DeleteGitRepositoryLinkRequest {
9191    pub fn new() -> Self {
9192        std::default::Default::default()
9193    }
9194
9195    /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
9196    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9197        self.name = v.into();
9198        self
9199    }
9200
9201    /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
9202    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9203        self.request_id = v.into();
9204        self
9205    }
9206
9207    /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
9208    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9209        self.validate_only = v.into();
9210        self
9211    }
9212
9213    /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
9214    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9215        self.etag = v.into();
9216        self
9217    }
9218}
9219
9220impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
9221    fn typename() -> &'static str {
9222        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
9223    }
9224}
9225
9226#[doc(hidden)]
9227impl<'de> serde::de::Deserialize<'de> for DeleteGitRepositoryLinkRequest {
9228    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9229    where
9230        D: serde::Deserializer<'de>,
9231    {
9232        #[allow(non_camel_case_types)]
9233        #[doc(hidden)]
9234        #[derive(PartialEq, Eq, Hash)]
9235        enum __FieldTag {
9236            __name,
9237            __request_id,
9238            __validate_only,
9239            __etag,
9240            Unknown(std::string::String),
9241        }
9242        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9243            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9244            where
9245                D: serde::Deserializer<'de>,
9246            {
9247                struct Visitor;
9248                impl<'de> serde::de::Visitor<'de> for Visitor {
9249                    type Value = __FieldTag;
9250                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9251                        formatter.write_str("a field name for DeleteGitRepositoryLinkRequest")
9252                    }
9253                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9254                    where
9255                        E: serde::de::Error,
9256                    {
9257                        use std::result::Result::Ok;
9258                        use std::string::ToString;
9259                        match value {
9260                            "name" => Ok(__FieldTag::__name),
9261                            "requestId" => Ok(__FieldTag::__request_id),
9262                            "request_id" => Ok(__FieldTag::__request_id),
9263                            "validateOnly" => Ok(__FieldTag::__validate_only),
9264                            "validate_only" => Ok(__FieldTag::__validate_only),
9265                            "etag" => Ok(__FieldTag::__etag),
9266                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9267                        }
9268                    }
9269                }
9270                deserializer.deserialize_identifier(Visitor)
9271            }
9272        }
9273        struct Visitor;
9274        impl<'de> serde::de::Visitor<'de> for Visitor {
9275            type Value = DeleteGitRepositoryLinkRequest;
9276            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9277                formatter.write_str("struct DeleteGitRepositoryLinkRequest")
9278            }
9279            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9280            where
9281                A: serde::de::MapAccess<'de>,
9282            {
9283                #[allow(unused_imports)]
9284                use serde::de::Error;
9285                use std::option::Option::Some;
9286                let mut fields = std::collections::HashSet::new();
9287                let mut result = Self::Value::new();
9288                while let Some(tag) = map.next_key::<__FieldTag>()? {
9289                    #[allow(clippy::match_single_binding)]
9290                    match tag {
9291                        __FieldTag::__name => {
9292                            if !fields.insert(__FieldTag::__name) {
9293                                return std::result::Result::Err(A::Error::duplicate_field(
9294                                    "multiple values for name",
9295                                ));
9296                            }
9297                            result.name = map
9298                                .next_value::<std::option::Option<std::string::String>>()?
9299                                .unwrap_or_default();
9300                        }
9301                        __FieldTag::__request_id => {
9302                            if !fields.insert(__FieldTag::__request_id) {
9303                                return std::result::Result::Err(A::Error::duplicate_field(
9304                                    "multiple values for request_id",
9305                                ));
9306                            }
9307                            result.request_id = map
9308                                .next_value::<std::option::Option<std::string::String>>()?
9309                                .unwrap_or_default();
9310                        }
9311                        __FieldTag::__validate_only => {
9312                            if !fields.insert(__FieldTag::__validate_only) {
9313                                return std::result::Result::Err(A::Error::duplicate_field(
9314                                    "multiple values for validate_only",
9315                                ));
9316                            }
9317                            result.validate_only = map
9318                                .next_value::<std::option::Option<bool>>()?
9319                                .unwrap_or_default();
9320                        }
9321                        __FieldTag::__etag => {
9322                            if !fields.insert(__FieldTag::__etag) {
9323                                return std::result::Result::Err(A::Error::duplicate_field(
9324                                    "multiple values for etag",
9325                                ));
9326                            }
9327                            result.etag = map
9328                                .next_value::<std::option::Option<std::string::String>>()?
9329                                .unwrap_or_default();
9330                        }
9331                        __FieldTag::Unknown(key) => {
9332                            let value = map.next_value::<serde_json::Value>()?;
9333                            result._unknown_fields.insert(key, value);
9334                        }
9335                    }
9336                }
9337                std::result::Result::Ok(result)
9338            }
9339        }
9340        deserializer.deserialize_any(Visitor)
9341    }
9342}
9343
9344#[doc(hidden)]
9345impl serde::ser::Serialize for DeleteGitRepositoryLinkRequest {
9346    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9347    where
9348        S: serde::ser::Serializer,
9349    {
9350        use serde::ser::SerializeMap;
9351        #[allow(unused_imports)]
9352        use std::option::Option::Some;
9353        let mut state = serializer.serialize_map(std::option::Option::None)?;
9354        if !self.name.is_empty() {
9355            state.serialize_entry("name", &self.name)?;
9356        }
9357        if !self.request_id.is_empty() {
9358            state.serialize_entry("requestId", &self.request_id)?;
9359        }
9360        if !wkt::internal::is_default(&self.validate_only) {
9361            state.serialize_entry("validateOnly", &self.validate_only)?;
9362        }
9363        if !self.etag.is_empty() {
9364            state.serialize_entry("etag", &self.etag)?;
9365        }
9366        if !self._unknown_fields.is_empty() {
9367            for (key, value) in self._unknown_fields.iter() {
9368                state.serialize_entry(key, &value)?;
9369            }
9370        }
9371        state.end()
9372    }
9373}
9374
9375/// Message for requesting a list of GitRepositoryLinks
9376#[derive(Clone, Debug, Default, PartialEq)]
9377#[non_exhaustive]
9378pub struct ListGitRepositoryLinksRequest {
9379    /// Required. Parent value for ListGitRepositoryLinksRequest
9380    pub parent: std::string::String,
9381
9382    /// Optional. Requested page size. Server may return fewer items than
9383    /// requested. If unspecified, server will pick an appropriate default.
9384    pub page_size: i32,
9385
9386    /// Optional. A token identifying a page of results the server should return.
9387    pub page_token: std::string::String,
9388
9389    /// Optional. Filtering results
9390    pub filter: std::string::String,
9391
9392    /// Optional. Hint for how to order the results
9393    pub order_by: std::string::String,
9394
9395    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9396}
9397
9398impl ListGitRepositoryLinksRequest {
9399    pub fn new() -> Self {
9400        std::default::Default::default()
9401    }
9402
9403    /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
9404    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9405        self.parent = v.into();
9406        self
9407    }
9408
9409    /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
9410    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9411        self.page_size = v.into();
9412        self
9413    }
9414
9415    /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
9416    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9417        self.page_token = v.into();
9418        self
9419    }
9420
9421    /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
9422    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9423        self.filter = v.into();
9424        self
9425    }
9426
9427    /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
9428    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9429        self.order_by = v.into();
9430        self
9431    }
9432}
9433
9434impl wkt::message::Message for ListGitRepositoryLinksRequest {
9435    fn typename() -> &'static str {
9436        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
9437    }
9438}
9439
9440#[doc(hidden)]
9441impl<'de> serde::de::Deserialize<'de> for ListGitRepositoryLinksRequest {
9442    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9443    where
9444        D: serde::Deserializer<'de>,
9445    {
9446        #[allow(non_camel_case_types)]
9447        #[doc(hidden)]
9448        #[derive(PartialEq, Eq, Hash)]
9449        enum __FieldTag {
9450            __parent,
9451            __page_size,
9452            __page_token,
9453            __filter,
9454            __order_by,
9455            Unknown(std::string::String),
9456        }
9457        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9458            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9459            where
9460                D: serde::Deserializer<'de>,
9461            {
9462                struct Visitor;
9463                impl<'de> serde::de::Visitor<'de> for Visitor {
9464                    type Value = __FieldTag;
9465                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9466                        formatter.write_str("a field name for ListGitRepositoryLinksRequest")
9467                    }
9468                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9469                    where
9470                        E: serde::de::Error,
9471                    {
9472                        use std::result::Result::Ok;
9473                        use std::string::ToString;
9474                        match value {
9475                            "parent" => Ok(__FieldTag::__parent),
9476                            "pageSize" => Ok(__FieldTag::__page_size),
9477                            "page_size" => Ok(__FieldTag::__page_size),
9478                            "pageToken" => Ok(__FieldTag::__page_token),
9479                            "page_token" => Ok(__FieldTag::__page_token),
9480                            "filter" => Ok(__FieldTag::__filter),
9481                            "orderBy" => Ok(__FieldTag::__order_by),
9482                            "order_by" => Ok(__FieldTag::__order_by),
9483                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9484                        }
9485                    }
9486                }
9487                deserializer.deserialize_identifier(Visitor)
9488            }
9489        }
9490        struct Visitor;
9491        impl<'de> serde::de::Visitor<'de> for Visitor {
9492            type Value = ListGitRepositoryLinksRequest;
9493            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9494                formatter.write_str("struct ListGitRepositoryLinksRequest")
9495            }
9496            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9497            where
9498                A: serde::de::MapAccess<'de>,
9499            {
9500                #[allow(unused_imports)]
9501                use serde::de::Error;
9502                use std::option::Option::Some;
9503                let mut fields = std::collections::HashSet::new();
9504                let mut result = Self::Value::new();
9505                while let Some(tag) = map.next_key::<__FieldTag>()? {
9506                    #[allow(clippy::match_single_binding)]
9507                    match tag {
9508                        __FieldTag::__parent => {
9509                            if !fields.insert(__FieldTag::__parent) {
9510                                return std::result::Result::Err(A::Error::duplicate_field(
9511                                    "multiple values for parent",
9512                                ));
9513                            }
9514                            result.parent = map
9515                                .next_value::<std::option::Option<std::string::String>>()?
9516                                .unwrap_or_default();
9517                        }
9518                        __FieldTag::__page_size => {
9519                            if !fields.insert(__FieldTag::__page_size) {
9520                                return std::result::Result::Err(A::Error::duplicate_field(
9521                                    "multiple values for page_size",
9522                                ));
9523                            }
9524                            struct __With(std::option::Option<i32>);
9525                            impl<'de> serde::de::Deserialize<'de> for __With {
9526                                fn deserialize<D>(
9527                                    deserializer: D,
9528                                ) -> std::result::Result<Self, D::Error>
9529                                where
9530                                    D: serde::de::Deserializer<'de>,
9531                                {
9532                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
9533                                }
9534                            }
9535                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
9536                        }
9537                        __FieldTag::__page_token => {
9538                            if !fields.insert(__FieldTag::__page_token) {
9539                                return std::result::Result::Err(A::Error::duplicate_field(
9540                                    "multiple values for page_token",
9541                                ));
9542                            }
9543                            result.page_token = map
9544                                .next_value::<std::option::Option<std::string::String>>()?
9545                                .unwrap_or_default();
9546                        }
9547                        __FieldTag::__filter => {
9548                            if !fields.insert(__FieldTag::__filter) {
9549                                return std::result::Result::Err(A::Error::duplicate_field(
9550                                    "multiple values for filter",
9551                                ));
9552                            }
9553                            result.filter = map
9554                                .next_value::<std::option::Option<std::string::String>>()?
9555                                .unwrap_or_default();
9556                        }
9557                        __FieldTag::__order_by => {
9558                            if !fields.insert(__FieldTag::__order_by) {
9559                                return std::result::Result::Err(A::Error::duplicate_field(
9560                                    "multiple values for order_by",
9561                                ));
9562                            }
9563                            result.order_by = map
9564                                .next_value::<std::option::Option<std::string::String>>()?
9565                                .unwrap_or_default();
9566                        }
9567                        __FieldTag::Unknown(key) => {
9568                            let value = map.next_value::<serde_json::Value>()?;
9569                            result._unknown_fields.insert(key, value);
9570                        }
9571                    }
9572                }
9573                std::result::Result::Ok(result)
9574            }
9575        }
9576        deserializer.deserialize_any(Visitor)
9577    }
9578}
9579
9580#[doc(hidden)]
9581impl serde::ser::Serialize for ListGitRepositoryLinksRequest {
9582    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9583    where
9584        S: serde::ser::Serializer,
9585    {
9586        use serde::ser::SerializeMap;
9587        #[allow(unused_imports)]
9588        use std::option::Option::Some;
9589        let mut state = serializer.serialize_map(std::option::Option::None)?;
9590        if !self.parent.is_empty() {
9591            state.serialize_entry("parent", &self.parent)?;
9592        }
9593        if !wkt::internal::is_default(&self.page_size) {
9594            struct __With<'a>(&'a i32);
9595            impl<'a> serde::ser::Serialize for __With<'a> {
9596                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9597                where
9598                    S: serde::ser::Serializer,
9599                {
9600                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
9601                }
9602            }
9603            state.serialize_entry("pageSize", &__With(&self.page_size))?;
9604        }
9605        if !self.page_token.is_empty() {
9606            state.serialize_entry("pageToken", &self.page_token)?;
9607        }
9608        if !self.filter.is_empty() {
9609            state.serialize_entry("filter", &self.filter)?;
9610        }
9611        if !self.order_by.is_empty() {
9612            state.serialize_entry("orderBy", &self.order_by)?;
9613        }
9614        if !self._unknown_fields.is_empty() {
9615            for (key, value) in self._unknown_fields.iter() {
9616                state.serialize_entry(key, &value)?;
9617            }
9618        }
9619        state.end()
9620    }
9621}
9622
9623/// Message for response to listing GitRepositoryLinks
9624#[derive(Clone, Debug, Default, PartialEq)]
9625#[non_exhaustive]
9626pub struct ListGitRepositoryLinksResponse {
9627    /// The list of GitRepositoryLinks
9628    pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
9629
9630    /// A token identifying a page of results the server should return.
9631    pub next_page_token: std::string::String,
9632
9633    /// Locations that could not be reached.
9634    pub unreachable: std::vec::Vec<std::string::String>,
9635
9636    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9637}
9638
9639impl ListGitRepositoryLinksResponse {
9640    pub fn new() -> Self {
9641        std::default::Default::default()
9642    }
9643
9644    /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
9645    pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
9646    where
9647        T: std::iter::IntoIterator<Item = V>,
9648        V: std::convert::Into<crate::model::GitRepositoryLink>,
9649    {
9650        use std::iter::Iterator;
9651        self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
9652        self
9653    }
9654
9655    /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
9656    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9657        self.next_page_token = v.into();
9658        self
9659    }
9660
9661    /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
9662    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9663    where
9664        T: std::iter::IntoIterator<Item = V>,
9665        V: std::convert::Into<std::string::String>,
9666    {
9667        use std::iter::Iterator;
9668        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9669        self
9670    }
9671}
9672
9673impl wkt::message::Message for ListGitRepositoryLinksResponse {
9674    fn typename() -> &'static str {
9675        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
9676    }
9677}
9678
9679#[doc(hidden)]
9680impl gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
9681    type PageItem = crate::model::GitRepositoryLink;
9682
9683    fn items(self) -> std::vec::Vec<Self::PageItem> {
9684        self.git_repository_links
9685    }
9686
9687    fn next_page_token(&self) -> std::string::String {
9688        use std::clone::Clone;
9689        self.next_page_token.clone()
9690    }
9691}
9692
9693#[doc(hidden)]
9694impl<'de> serde::de::Deserialize<'de> for ListGitRepositoryLinksResponse {
9695    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9696    where
9697        D: serde::Deserializer<'de>,
9698    {
9699        #[allow(non_camel_case_types)]
9700        #[doc(hidden)]
9701        #[derive(PartialEq, Eq, Hash)]
9702        enum __FieldTag {
9703            __git_repository_links,
9704            __next_page_token,
9705            __unreachable,
9706            Unknown(std::string::String),
9707        }
9708        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9709            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9710            where
9711                D: serde::Deserializer<'de>,
9712            {
9713                struct Visitor;
9714                impl<'de> serde::de::Visitor<'de> for Visitor {
9715                    type Value = __FieldTag;
9716                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9717                        formatter.write_str("a field name for ListGitRepositoryLinksResponse")
9718                    }
9719                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9720                    where
9721                        E: serde::de::Error,
9722                    {
9723                        use std::result::Result::Ok;
9724                        use std::string::ToString;
9725                        match value {
9726                            "gitRepositoryLinks" => Ok(__FieldTag::__git_repository_links),
9727                            "git_repository_links" => Ok(__FieldTag::__git_repository_links),
9728                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
9729                            "next_page_token" => Ok(__FieldTag::__next_page_token),
9730                            "unreachable" => Ok(__FieldTag::__unreachable),
9731                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9732                        }
9733                    }
9734                }
9735                deserializer.deserialize_identifier(Visitor)
9736            }
9737        }
9738        struct Visitor;
9739        impl<'de> serde::de::Visitor<'de> for Visitor {
9740            type Value = ListGitRepositoryLinksResponse;
9741            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9742                formatter.write_str("struct ListGitRepositoryLinksResponse")
9743            }
9744            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9745            where
9746                A: serde::de::MapAccess<'de>,
9747            {
9748                #[allow(unused_imports)]
9749                use serde::de::Error;
9750                use std::option::Option::Some;
9751                let mut fields = std::collections::HashSet::new();
9752                let mut result = Self::Value::new();
9753                while let Some(tag) = map.next_key::<__FieldTag>()? {
9754                    #[allow(clippy::match_single_binding)]
9755                    match tag {
9756                        __FieldTag::__git_repository_links => {
9757                            if !fields.insert(__FieldTag::__git_repository_links) {
9758                                return std::result::Result::Err(A::Error::duplicate_field(
9759                                    "multiple values for git_repository_links",
9760                                ));
9761                            }
9762                            result.git_repository_links =
9763                                map.next_value::<std::option::Option<
9764                                    std::vec::Vec<crate::model::GitRepositoryLink>,
9765                                >>()?
9766                                .unwrap_or_default();
9767                        }
9768                        __FieldTag::__next_page_token => {
9769                            if !fields.insert(__FieldTag::__next_page_token) {
9770                                return std::result::Result::Err(A::Error::duplicate_field(
9771                                    "multiple values for next_page_token",
9772                                ));
9773                            }
9774                            result.next_page_token = map
9775                                .next_value::<std::option::Option<std::string::String>>()?
9776                                .unwrap_or_default();
9777                        }
9778                        __FieldTag::__unreachable => {
9779                            if !fields.insert(__FieldTag::__unreachable) {
9780                                return std::result::Result::Err(A::Error::duplicate_field(
9781                                    "multiple values for unreachable",
9782                                ));
9783                            }
9784                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
9785                        }
9786                        __FieldTag::Unknown(key) => {
9787                            let value = map.next_value::<serde_json::Value>()?;
9788                            result._unknown_fields.insert(key, value);
9789                        }
9790                    }
9791                }
9792                std::result::Result::Ok(result)
9793            }
9794        }
9795        deserializer.deserialize_any(Visitor)
9796    }
9797}
9798
9799#[doc(hidden)]
9800impl serde::ser::Serialize for ListGitRepositoryLinksResponse {
9801    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9802    where
9803        S: serde::ser::Serializer,
9804    {
9805        use serde::ser::SerializeMap;
9806        #[allow(unused_imports)]
9807        use std::option::Option::Some;
9808        let mut state = serializer.serialize_map(std::option::Option::None)?;
9809        if !self.git_repository_links.is_empty() {
9810            state.serialize_entry("gitRepositoryLinks", &self.git_repository_links)?;
9811        }
9812        if !self.next_page_token.is_empty() {
9813            state.serialize_entry("nextPageToken", &self.next_page_token)?;
9814        }
9815        if !self.unreachable.is_empty() {
9816            state.serialize_entry("unreachable", &self.unreachable)?;
9817        }
9818        if !self._unknown_fields.is_empty() {
9819            for (key, value) in self._unknown_fields.iter() {
9820                state.serialize_entry(key, &value)?;
9821            }
9822        }
9823        state.end()
9824    }
9825}
9826
9827/// Message for getting a GitRepositoryLink
9828#[derive(Clone, Debug, Default, PartialEq)]
9829#[non_exhaustive]
9830pub struct GetGitRepositoryLinkRequest {
9831    /// Required. Name of the resource
9832    pub name: std::string::String,
9833
9834    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9835}
9836
9837impl GetGitRepositoryLinkRequest {
9838    pub fn new() -> Self {
9839        std::default::Default::default()
9840    }
9841
9842    /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
9843    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9844        self.name = v.into();
9845        self
9846    }
9847}
9848
9849impl wkt::message::Message for GetGitRepositoryLinkRequest {
9850    fn typename() -> &'static str {
9851        "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
9852    }
9853}
9854
9855#[doc(hidden)]
9856impl<'de> serde::de::Deserialize<'de> for GetGitRepositoryLinkRequest {
9857    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9858    where
9859        D: serde::Deserializer<'de>,
9860    {
9861        #[allow(non_camel_case_types)]
9862        #[doc(hidden)]
9863        #[derive(PartialEq, Eq, Hash)]
9864        enum __FieldTag {
9865            __name,
9866            Unknown(std::string::String),
9867        }
9868        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9869            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9870            where
9871                D: serde::Deserializer<'de>,
9872            {
9873                struct Visitor;
9874                impl<'de> serde::de::Visitor<'de> for Visitor {
9875                    type Value = __FieldTag;
9876                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9877                        formatter.write_str("a field name for GetGitRepositoryLinkRequest")
9878                    }
9879                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9880                    where
9881                        E: serde::de::Error,
9882                    {
9883                        use std::result::Result::Ok;
9884                        use std::string::ToString;
9885                        match value {
9886                            "name" => Ok(__FieldTag::__name),
9887                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9888                        }
9889                    }
9890                }
9891                deserializer.deserialize_identifier(Visitor)
9892            }
9893        }
9894        struct Visitor;
9895        impl<'de> serde::de::Visitor<'de> for Visitor {
9896            type Value = GetGitRepositoryLinkRequest;
9897            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9898                formatter.write_str("struct GetGitRepositoryLinkRequest")
9899            }
9900            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9901            where
9902                A: serde::de::MapAccess<'de>,
9903            {
9904                #[allow(unused_imports)]
9905                use serde::de::Error;
9906                use std::option::Option::Some;
9907                let mut fields = std::collections::HashSet::new();
9908                let mut result = Self::Value::new();
9909                while let Some(tag) = map.next_key::<__FieldTag>()? {
9910                    #[allow(clippy::match_single_binding)]
9911                    match tag {
9912                        __FieldTag::__name => {
9913                            if !fields.insert(__FieldTag::__name) {
9914                                return std::result::Result::Err(A::Error::duplicate_field(
9915                                    "multiple values for name",
9916                                ));
9917                            }
9918                            result.name = map
9919                                .next_value::<std::option::Option<std::string::String>>()?
9920                                .unwrap_or_default();
9921                        }
9922                        __FieldTag::Unknown(key) => {
9923                            let value = map.next_value::<serde_json::Value>()?;
9924                            result._unknown_fields.insert(key, value);
9925                        }
9926                    }
9927                }
9928                std::result::Result::Ok(result)
9929            }
9930        }
9931        deserializer.deserialize_any(Visitor)
9932    }
9933}
9934
9935#[doc(hidden)]
9936impl serde::ser::Serialize for GetGitRepositoryLinkRequest {
9937    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9938    where
9939        S: serde::ser::Serializer,
9940    {
9941        use serde::ser::SerializeMap;
9942        #[allow(unused_imports)]
9943        use std::option::Option::Some;
9944        let mut state = serializer.serialize_map(std::option::Option::None)?;
9945        if !self.name.is_empty() {
9946            state.serialize_entry("name", &self.name)?;
9947        }
9948        if !self._unknown_fields.is_empty() {
9949            for (key, value) in self._unknown_fields.iter() {
9950                state.serialize_entry(key, &value)?;
9951            }
9952        }
9953        state.end()
9954    }
9955}
9956
9957/// Message for fetching SCM read/write token.
9958#[derive(Clone, Debug, Default, PartialEq)]
9959#[non_exhaustive]
9960pub struct FetchReadWriteTokenRequest {
9961    /// Required. The resource name of the gitRepositoryLink in the format
9962    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
9963    pub git_repository_link: std::string::String,
9964
9965    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9966}
9967
9968impl FetchReadWriteTokenRequest {
9969    pub fn new() -> Self {
9970        std::default::Default::default()
9971    }
9972
9973    /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
9974    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
9975        mut self,
9976        v: T,
9977    ) -> Self {
9978        self.git_repository_link = v.into();
9979        self
9980    }
9981}
9982
9983impl wkt::message::Message for FetchReadWriteTokenRequest {
9984    fn typename() -> &'static str {
9985        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
9986    }
9987}
9988
9989#[doc(hidden)]
9990impl<'de> serde::de::Deserialize<'de> for FetchReadWriteTokenRequest {
9991    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9992    where
9993        D: serde::Deserializer<'de>,
9994    {
9995        #[allow(non_camel_case_types)]
9996        #[doc(hidden)]
9997        #[derive(PartialEq, Eq, Hash)]
9998        enum __FieldTag {
9999            __git_repository_link,
10000            Unknown(std::string::String),
10001        }
10002        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10003            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10004            where
10005                D: serde::Deserializer<'de>,
10006            {
10007                struct Visitor;
10008                impl<'de> serde::de::Visitor<'de> for Visitor {
10009                    type Value = __FieldTag;
10010                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10011                        formatter.write_str("a field name for FetchReadWriteTokenRequest")
10012                    }
10013                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10014                    where
10015                        E: serde::de::Error,
10016                    {
10017                        use std::result::Result::Ok;
10018                        use std::string::ToString;
10019                        match value {
10020                            "gitRepositoryLink" => Ok(__FieldTag::__git_repository_link),
10021                            "git_repository_link" => Ok(__FieldTag::__git_repository_link),
10022                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10023                        }
10024                    }
10025                }
10026                deserializer.deserialize_identifier(Visitor)
10027            }
10028        }
10029        struct Visitor;
10030        impl<'de> serde::de::Visitor<'de> for Visitor {
10031            type Value = FetchReadWriteTokenRequest;
10032            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10033                formatter.write_str("struct FetchReadWriteTokenRequest")
10034            }
10035            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10036            where
10037                A: serde::de::MapAccess<'de>,
10038            {
10039                #[allow(unused_imports)]
10040                use serde::de::Error;
10041                use std::option::Option::Some;
10042                let mut fields = std::collections::HashSet::new();
10043                let mut result = Self::Value::new();
10044                while let Some(tag) = map.next_key::<__FieldTag>()? {
10045                    #[allow(clippy::match_single_binding)]
10046                    match tag {
10047                        __FieldTag::__git_repository_link => {
10048                            if !fields.insert(__FieldTag::__git_repository_link) {
10049                                return std::result::Result::Err(A::Error::duplicate_field(
10050                                    "multiple values for git_repository_link",
10051                                ));
10052                            }
10053                            result.git_repository_link = map
10054                                .next_value::<std::option::Option<std::string::String>>()?
10055                                .unwrap_or_default();
10056                        }
10057                        __FieldTag::Unknown(key) => {
10058                            let value = map.next_value::<serde_json::Value>()?;
10059                            result._unknown_fields.insert(key, value);
10060                        }
10061                    }
10062                }
10063                std::result::Result::Ok(result)
10064            }
10065        }
10066        deserializer.deserialize_any(Visitor)
10067    }
10068}
10069
10070#[doc(hidden)]
10071impl serde::ser::Serialize for FetchReadWriteTokenRequest {
10072    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10073    where
10074        S: serde::ser::Serializer,
10075    {
10076        use serde::ser::SerializeMap;
10077        #[allow(unused_imports)]
10078        use std::option::Option::Some;
10079        let mut state = serializer.serialize_map(std::option::Option::None)?;
10080        if !self.git_repository_link.is_empty() {
10081            state.serialize_entry("gitRepositoryLink", &self.git_repository_link)?;
10082        }
10083        if !self._unknown_fields.is_empty() {
10084            for (key, value) in self._unknown_fields.iter() {
10085                state.serialize_entry(key, &value)?;
10086            }
10087        }
10088        state.end()
10089    }
10090}
10091
10092/// Message for fetching SCM read token.
10093#[derive(Clone, Debug, Default, PartialEq)]
10094#[non_exhaustive]
10095pub struct FetchReadTokenRequest {
10096    /// Required. The resource name of the gitRepositoryLink in the format
10097    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
10098    pub git_repository_link: std::string::String,
10099
10100    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10101}
10102
10103impl FetchReadTokenRequest {
10104    pub fn new() -> Self {
10105        std::default::Default::default()
10106    }
10107
10108    /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
10109    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
10110        mut self,
10111        v: T,
10112    ) -> Self {
10113        self.git_repository_link = v.into();
10114        self
10115    }
10116}
10117
10118impl wkt::message::Message for FetchReadTokenRequest {
10119    fn typename() -> &'static str {
10120        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
10121    }
10122}
10123
10124#[doc(hidden)]
10125impl<'de> serde::de::Deserialize<'de> for FetchReadTokenRequest {
10126    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10127    where
10128        D: serde::Deserializer<'de>,
10129    {
10130        #[allow(non_camel_case_types)]
10131        #[doc(hidden)]
10132        #[derive(PartialEq, Eq, Hash)]
10133        enum __FieldTag {
10134            __git_repository_link,
10135            Unknown(std::string::String),
10136        }
10137        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10138            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10139            where
10140                D: serde::Deserializer<'de>,
10141            {
10142                struct Visitor;
10143                impl<'de> serde::de::Visitor<'de> for Visitor {
10144                    type Value = __FieldTag;
10145                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10146                        formatter.write_str("a field name for FetchReadTokenRequest")
10147                    }
10148                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10149                    where
10150                        E: serde::de::Error,
10151                    {
10152                        use std::result::Result::Ok;
10153                        use std::string::ToString;
10154                        match value {
10155                            "gitRepositoryLink" => Ok(__FieldTag::__git_repository_link),
10156                            "git_repository_link" => Ok(__FieldTag::__git_repository_link),
10157                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10158                        }
10159                    }
10160                }
10161                deserializer.deserialize_identifier(Visitor)
10162            }
10163        }
10164        struct Visitor;
10165        impl<'de> serde::de::Visitor<'de> for Visitor {
10166            type Value = FetchReadTokenRequest;
10167            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10168                formatter.write_str("struct FetchReadTokenRequest")
10169            }
10170            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10171            where
10172                A: serde::de::MapAccess<'de>,
10173            {
10174                #[allow(unused_imports)]
10175                use serde::de::Error;
10176                use std::option::Option::Some;
10177                let mut fields = std::collections::HashSet::new();
10178                let mut result = Self::Value::new();
10179                while let Some(tag) = map.next_key::<__FieldTag>()? {
10180                    #[allow(clippy::match_single_binding)]
10181                    match tag {
10182                        __FieldTag::__git_repository_link => {
10183                            if !fields.insert(__FieldTag::__git_repository_link) {
10184                                return std::result::Result::Err(A::Error::duplicate_field(
10185                                    "multiple values for git_repository_link",
10186                                ));
10187                            }
10188                            result.git_repository_link = map
10189                                .next_value::<std::option::Option<std::string::String>>()?
10190                                .unwrap_or_default();
10191                        }
10192                        __FieldTag::Unknown(key) => {
10193                            let value = map.next_value::<serde_json::Value>()?;
10194                            result._unknown_fields.insert(key, value);
10195                        }
10196                    }
10197                }
10198                std::result::Result::Ok(result)
10199            }
10200        }
10201        deserializer.deserialize_any(Visitor)
10202    }
10203}
10204
10205#[doc(hidden)]
10206impl serde::ser::Serialize for FetchReadTokenRequest {
10207    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10208    where
10209        S: serde::ser::Serializer,
10210    {
10211        use serde::ser::SerializeMap;
10212        #[allow(unused_imports)]
10213        use std::option::Option::Some;
10214        let mut state = serializer.serialize_map(std::option::Option::None)?;
10215        if !self.git_repository_link.is_empty() {
10216            state.serialize_entry("gitRepositoryLink", &self.git_repository_link)?;
10217        }
10218        if !self._unknown_fields.is_empty() {
10219            for (key, value) in self._unknown_fields.iter() {
10220                state.serialize_entry(key, &value)?;
10221            }
10222        }
10223        state.end()
10224    }
10225}
10226
10227/// Message for responding to get read token.
10228#[derive(Clone, Debug, Default, PartialEq)]
10229#[non_exhaustive]
10230pub struct FetchReadTokenResponse {
10231    /// The token content.
10232    pub token: std::string::String,
10233
10234    /// Expiration timestamp. Can be empty if unknown or non-expiring.
10235    pub expiration_time: std::option::Option<wkt::Timestamp>,
10236
10237    /// The git_username to specify when making a git clone with the
10238    /// token. For example, for GitHub GitRepositoryLinks, this would be
10239    /// "x-access-token"
10240    pub git_username: std::string::String,
10241
10242    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10243}
10244
10245impl FetchReadTokenResponse {
10246    pub fn new() -> Self {
10247        std::default::Default::default()
10248    }
10249
10250    /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
10251    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10252        self.token = v.into();
10253        self
10254    }
10255
10256    /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
10257    pub fn set_expiration_time<T>(mut self, v: T) -> Self
10258    where
10259        T: std::convert::Into<wkt::Timestamp>,
10260    {
10261        self.expiration_time = std::option::Option::Some(v.into());
10262        self
10263    }
10264
10265    /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
10266    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
10267    where
10268        T: std::convert::Into<wkt::Timestamp>,
10269    {
10270        self.expiration_time = v.map(|x| x.into());
10271        self
10272    }
10273
10274    /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
10275    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10276        self.git_username = v.into();
10277        self
10278    }
10279}
10280
10281impl wkt::message::Message for FetchReadTokenResponse {
10282    fn typename() -> &'static str {
10283        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
10284    }
10285}
10286
10287#[doc(hidden)]
10288impl<'de> serde::de::Deserialize<'de> for FetchReadTokenResponse {
10289    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10290    where
10291        D: serde::Deserializer<'de>,
10292    {
10293        #[allow(non_camel_case_types)]
10294        #[doc(hidden)]
10295        #[derive(PartialEq, Eq, Hash)]
10296        enum __FieldTag {
10297            __token,
10298            __expiration_time,
10299            __git_username,
10300            Unknown(std::string::String),
10301        }
10302        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10303            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10304            where
10305                D: serde::Deserializer<'de>,
10306            {
10307                struct Visitor;
10308                impl<'de> serde::de::Visitor<'de> for Visitor {
10309                    type Value = __FieldTag;
10310                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10311                        formatter.write_str("a field name for FetchReadTokenResponse")
10312                    }
10313                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10314                    where
10315                        E: serde::de::Error,
10316                    {
10317                        use std::result::Result::Ok;
10318                        use std::string::ToString;
10319                        match value {
10320                            "token" => Ok(__FieldTag::__token),
10321                            "expirationTime" => Ok(__FieldTag::__expiration_time),
10322                            "expiration_time" => Ok(__FieldTag::__expiration_time),
10323                            "gitUsername" => Ok(__FieldTag::__git_username),
10324                            "git_username" => Ok(__FieldTag::__git_username),
10325                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10326                        }
10327                    }
10328                }
10329                deserializer.deserialize_identifier(Visitor)
10330            }
10331        }
10332        struct Visitor;
10333        impl<'de> serde::de::Visitor<'de> for Visitor {
10334            type Value = FetchReadTokenResponse;
10335            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10336                formatter.write_str("struct FetchReadTokenResponse")
10337            }
10338            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10339            where
10340                A: serde::de::MapAccess<'de>,
10341            {
10342                #[allow(unused_imports)]
10343                use serde::de::Error;
10344                use std::option::Option::Some;
10345                let mut fields = std::collections::HashSet::new();
10346                let mut result = Self::Value::new();
10347                while let Some(tag) = map.next_key::<__FieldTag>()? {
10348                    #[allow(clippy::match_single_binding)]
10349                    match tag {
10350                        __FieldTag::__token => {
10351                            if !fields.insert(__FieldTag::__token) {
10352                                return std::result::Result::Err(A::Error::duplicate_field(
10353                                    "multiple values for token",
10354                                ));
10355                            }
10356                            result.token = map
10357                                .next_value::<std::option::Option<std::string::String>>()?
10358                                .unwrap_or_default();
10359                        }
10360                        __FieldTag::__expiration_time => {
10361                            if !fields.insert(__FieldTag::__expiration_time) {
10362                                return std::result::Result::Err(A::Error::duplicate_field(
10363                                    "multiple values for expiration_time",
10364                                ));
10365                            }
10366                            result.expiration_time =
10367                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
10368                        }
10369                        __FieldTag::__git_username => {
10370                            if !fields.insert(__FieldTag::__git_username) {
10371                                return std::result::Result::Err(A::Error::duplicate_field(
10372                                    "multiple values for git_username",
10373                                ));
10374                            }
10375                            result.git_username = map
10376                                .next_value::<std::option::Option<std::string::String>>()?
10377                                .unwrap_or_default();
10378                        }
10379                        __FieldTag::Unknown(key) => {
10380                            let value = map.next_value::<serde_json::Value>()?;
10381                            result._unknown_fields.insert(key, value);
10382                        }
10383                    }
10384                }
10385                std::result::Result::Ok(result)
10386            }
10387        }
10388        deserializer.deserialize_any(Visitor)
10389    }
10390}
10391
10392#[doc(hidden)]
10393impl serde::ser::Serialize for FetchReadTokenResponse {
10394    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10395    where
10396        S: serde::ser::Serializer,
10397    {
10398        use serde::ser::SerializeMap;
10399        #[allow(unused_imports)]
10400        use std::option::Option::Some;
10401        let mut state = serializer.serialize_map(std::option::Option::None)?;
10402        if !self.token.is_empty() {
10403            state.serialize_entry("token", &self.token)?;
10404        }
10405        if self.expiration_time.is_some() {
10406            state.serialize_entry("expirationTime", &self.expiration_time)?;
10407        }
10408        if !self.git_username.is_empty() {
10409            state.serialize_entry("gitUsername", &self.git_username)?;
10410        }
10411        if !self._unknown_fields.is_empty() {
10412            for (key, value) in self._unknown_fields.iter() {
10413                state.serialize_entry(key, &value)?;
10414            }
10415        }
10416        state.end()
10417    }
10418}
10419
10420/// Message for responding to get read/write token.
10421#[derive(Clone, Debug, Default, PartialEq)]
10422#[non_exhaustive]
10423pub struct FetchReadWriteTokenResponse {
10424    /// The token content.
10425    pub token: std::string::String,
10426
10427    /// Expiration timestamp. Can be empty if unknown or non-expiring.
10428    pub expiration_time: std::option::Option<wkt::Timestamp>,
10429
10430    /// The git_username to specify when making a git clone with the
10431    /// token. For example, for GitHub GitRepositoryLinks, this would be
10432    /// "x-access-token"
10433    pub git_username: std::string::String,
10434
10435    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10436}
10437
10438impl FetchReadWriteTokenResponse {
10439    pub fn new() -> Self {
10440        std::default::Default::default()
10441    }
10442
10443    /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
10444    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10445        self.token = v.into();
10446        self
10447    }
10448
10449    /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
10450    pub fn set_expiration_time<T>(mut self, v: T) -> Self
10451    where
10452        T: std::convert::Into<wkt::Timestamp>,
10453    {
10454        self.expiration_time = std::option::Option::Some(v.into());
10455        self
10456    }
10457
10458    /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
10459    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
10460    where
10461        T: std::convert::Into<wkt::Timestamp>,
10462    {
10463        self.expiration_time = v.map(|x| x.into());
10464        self
10465    }
10466
10467    /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
10468    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10469        self.git_username = v.into();
10470        self
10471    }
10472}
10473
10474impl wkt::message::Message for FetchReadWriteTokenResponse {
10475    fn typename() -> &'static str {
10476        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
10477    }
10478}
10479
10480#[doc(hidden)]
10481impl<'de> serde::de::Deserialize<'de> for FetchReadWriteTokenResponse {
10482    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10483    where
10484        D: serde::Deserializer<'de>,
10485    {
10486        #[allow(non_camel_case_types)]
10487        #[doc(hidden)]
10488        #[derive(PartialEq, Eq, Hash)]
10489        enum __FieldTag {
10490            __token,
10491            __expiration_time,
10492            __git_username,
10493            Unknown(std::string::String),
10494        }
10495        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10496            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10497            where
10498                D: serde::Deserializer<'de>,
10499            {
10500                struct Visitor;
10501                impl<'de> serde::de::Visitor<'de> for Visitor {
10502                    type Value = __FieldTag;
10503                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10504                        formatter.write_str("a field name for FetchReadWriteTokenResponse")
10505                    }
10506                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10507                    where
10508                        E: serde::de::Error,
10509                    {
10510                        use std::result::Result::Ok;
10511                        use std::string::ToString;
10512                        match value {
10513                            "token" => Ok(__FieldTag::__token),
10514                            "expirationTime" => Ok(__FieldTag::__expiration_time),
10515                            "expiration_time" => Ok(__FieldTag::__expiration_time),
10516                            "gitUsername" => Ok(__FieldTag::__git_username),
10517                            "git_username" => Ok(__FieldTag::__git_username),
10518                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10519                        }
10520                    }
10521                }
10522                deserializer.deserialize_identifier(Visitor)
10523            }
10524        }
10525        struct Visitor;
10526        impl<'de> serde::de::Visitor<'de> for Visitor {
10527            type Value = FetchReadWriteTokenResponse;
10528            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10529                formatter.write_str("struct FetchReadWriteTokenResponse")
10530            }
10531            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10532            where
10533                A: serde::de::MapAccess<'de>,
10534            {
10535                #[allow(unused_imports)]
10536                use serde::de::Error;
10537                use std::option::Option::Some;
10538                let mut fields = std::collections::HashSet::new();
10539                let mut result = Self::Value::new();
10540                while let Some(tag) = map.next_key::<__FieldTag>()? {
10541                    #[allow(clippy::match_single_binding)]
10542                    match tag {
10543                        __FieldTag::__token => {
10544                            if !fields.insert(__FieldTag::__token) {
10545                                return std::result::Result::Err(A::Error::duplicate_field(
10546                                    "multiple values for token",
10547                                ));
10548                            }
10549                            result.token = map
10550                                .next_value::<std::option::Option<std::string::String>>()?
10551                                .unwrap_or_default();
10552                        }
10553                        __FieldTag::__expiration_time => {
10554                            if !fields.insert(__FieldTag::__expiration_time) {
10555                                return std::result::Result::Err(A::Error::duplicate_field(
10556                                    "multiple values for expiration_time",
10557                                ));
10558                            }
10559                            result.expiration_time =
10560                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
10561                        }
10562                        __FieldTag::__git_username => {
10563                            if !fields.insert(__FieldTag::__git_username) {
10564                                return std::result::Result::Err(A::Error::duplicate_field(
10565                                    "multiple values for git_username",
10566                                ));
10567                            }
10568                            result.git_username = map
10569                                .next_value::<std::option::Option<std::string::String>>()?
10570                                .unwrap_or_default();
10571                        }
10572                        __FieldTag::Unknown(key) => {
10573                            let value = map.next_value::<serde_json::Value>()?;
10574                            result._unknown_fields.insert(key, value);
10575                        }
10576                    }
10577                }
10578                std::result::Result::Ok(result)
10579            }
10580        }
10581        deserializer.deserialize_any(Visitor)
10582    }
10583}
10584
10585#[doc(hidden)]
10586impl serde::ser::Serialize for FetchReadWriteTokenResponse {
10587    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10588    where
10589        S: serde::ser::Serializer,
10590    {
10591        use serde::ser::SerializeMap;
10592        #[allow(unused_imports)]
10593        use std::option::Option::Some;
10594        let mut state = serializer.serialize_map(std::option::Option::None)?;
10595        if !self.token.is_empty() {
10596            state.serialize_entry("token", &self.token)?;
10597        }
10598        if self.expiration_time.is_some() {
10599            state.serialize_entry("expirationTime", &self.expiration_time)?;
10600        }
10601        if !self.git_username.is_empty() {
10602            state.serialize_entry("gitUsername", &self.git_username)?;
10603        }
10604        if !self._unknown_fields.is_empty() {
10605            for (key, value) in self._unknown_fields.iter() {
10606                state.serialize_entry(key, &value)?;
10607            }
10608        }
10609        state.end()
10610    }
10611}
10612
10613/// Request message for FetchLinkableGitRepositoriesRequest.
10614#[derive(Clone, Debug, Default, PartialEq)]
10615#[non_exhaustive]
10616pub struct FetchLinkableGitRepositoriesRequest {
10617    /// Required. The name of the Connection.
10618    /// Format: `projects/*/locations/*/connections/*`.
10619    pub connection: std::string::String,
10620
10621    /// Optional. Number of results to return in the list. Defaults to 20.
10622    pub page_size: i32,
10623
10624    /// Optional. Page start.
10625    pub page_token: std::string::String,
10626
10627    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10628}
10629
10630impl FetchLinkableGitRepositoriesRequest {
10631    pub fn new() -> Self {
10632        std::default::Default::default()
10633    }
10634
10635    /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
10636    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10637        self.connection = v.into();
10638        self
10639    }
10640
10641    /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
10642    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10643        self.page_size = v.into();
10644        self
10645    }
10646
10647    /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
10648    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10649        self.page_token = v.into();
10650        self
10651    }
10652}
10653
10654impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
10655    fn typename() -> &'static str {
10656        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
10657    }
10658}
10659
10660#[doc(hidden)]
10661impl<'de> serde::de::Deserialize<'de> for FetchLinkableGitRepositoriesRequest {
10662    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10663    where
10664        D: serde::Deserializer<'de>,
10665    {
10666        #[allow(non_camel_case_types)]
10667        #[doc(hidden)]
10668        #[derive(PartialEq, Eq, Hash)]
10669        enum __FieldTag {
10670            __connection,
10671            __page_size,
10672            __page_token,
10673            Unknown(std::string::String),
10674        }
10675        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10676            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10677            where
10678                D: serde::Deserializer<'de>,
10679            {
10680                struct Visitor;
10681                impl<'de> serde::de::Visitor<'de> for Visitor {
10682                    type Value = __FieldTag;
10683                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10684                        formatter.write_str("a field name for FetchLinkableGitRepositoriesRequest")
10685                    }
10686                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10687                    where
10688                        E: serde::de::Error,
10689                    {
10690                        use std::result::Result::Ok;
10691                        use std::string::ToString;
10692                        match value {
10693                            "connection" => Ok(__FieldTag::__connection),
10694                            "pageSize" => Ok(__FieldTag::__page_size),
10695                            "page_size" => Ok(__FieldTag::__page_size),
10696                            "pageToken" => Ok(__FieldTag::__page_token),
10697                            "page_token" => Ok(__FieldTag::__page_token),
10698                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10699                        }
10700                    }
10701                }
10702                deserializer.deserialize_identifier(Visitor)
10703            }
10704        }
10705        struct Visitor;
10706        impl<'de> serde::de::Visitor<'de> for Visitor {
10707            type Value = FetchLinkableGitRepositoriesRequest;
10708            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10709                formatter.write_str("struct FetchLinkableGitRepositoriesRequest")
10710            }
10711            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10712            where
10713                A: serde::de::MapAccess<'de>,
10714            {
10715                #[allow(unused_imports)]
10716                use serde::de::Error;
10717                use std::option::Option::Some;
10718                let mut fields = std::collections::HashSet::new();
10719                let mut result = Self::Value::new();
10720                while let Some(tag) = map.next_key::<__FieldTag>()? {
10721                    #[allow(clippy::match_single_binding)]
10722                    match tag {
10723                        __FieldTag::__connection => {
10724                            if !fields.insert(__FieldTag::__connection) {
10725                                return std::result::Result::Err(A::Error::duplicate_field(
10726                                    "multiple values for connection",
10727                                ));
10728                            }
10729                            result.connection = map
10730                                .next_value::<std::option::Option<std::string::String>>()?
10731                                .unwrap_or_default();
10732                        }
10733                        __FieldTag::__page_size => {
10734                            if !fields.insert(__FieldTag::__page_size) {
10735                                return std::result::Result::Err(A::Error::duplicate_field(
10736                                    "multiple values for page_size",
10737                                ));
10738                            }
10739                            struct __With(std::option::Option<i32>);
10740                            impl<'de> serde::de::Deserialize<'de> for __With {
10741                                fn deserialize<D>(
10742                                    deserializer: D,
10743                                ) -> std::result::Result<Self, D::Error>
10744                                where
10745                                    D: serde::de::Deserializer<'de>,
10746                                {
10747                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10748                                }
10749                            }
10750                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
10751                        }
10752                        __FieldTag::__page_token => {
10753                            if !fields.insert(__FieldTag::__page_token) {
10754                                return std::result::Result::Err(A::Error::duplicate_field(
10755                                    "multiple values for page_token",
10756                                ));
10757                            }
10758                            result.page_token = map
10759                                .next_value::<std::option::Option<std::string::String>>()?
10760                                .unwrap_or_default();
10761                        }
10762                        __FieldTag::Unknown(key) => {
10763                            let value = map.next_value::<serde_json::Value>()?;
10764                            result._unknown_fields.insert(key, value);
10765                        }
10766                    }
10767                }
10768                std::result::Result::Ok(result)
10769            }
10770        }
10771        deserializer.deserialize_any(Visitor)
10772    }
10773}
10774
10775#[doc(hidden)]
10776impl serde::ser::Serialize for FetchLinkableGitRepositoriesRequest {
10777    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10778    where
10779        S: serde::ser::Serializer,
10780    {
10781        use serde::ser::SerializeMap;
10782        #[allow(unused_imports)]
10783        use std::option::Option::Some;
10784        let mut state = serializer.serialize_map(std::option::Option::None)?;
10785        if !self.connection.is_empty() {
10786            state.serialize_entry("connection", &self.connection)?;
10787        }
10788        if !wkt::internal::is_default(&self.page_size) {
10789            struct __With<'a>(&'a i32);
10790            impl<'a> serde::ser::Serialize for __With<'a> {
10791                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10792                where
10793                    S: serde::ser::Serializer,
10794                {
10795                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10796                }
10797            }
10798            state.serialize_entry("pageSize", &__With(&self.page_size))?;
10799        }
10800        if !self.page_token.is_empty() {
10801            state.serialize_entry("pageToken", &self.page_token)?;
10802        }
10803        if !self._unknown_fields.is_empty() {
10804            for (key, value) in self._unknown_fields.iter() {
10805                state.serialize_entry(key, &value)?;
10806            }
10807        }
10808        state.end()
10809    }
10810}
10811
10812/// Response message for FetchLinkableGitRepositories.
10813#[derive(Clone, Debug, Default, PartialEq)]
10814#[non_exhaustive]
10815pub struct FetchLinkableGitRepositoriesResponse {
10816    /// The git repositories that can be linked to the connection.
10817    pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
10818
10819    /// A token identifying a page of results the server should return.
10820    pub next_page_token: std::string::String,
10821
10822    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10823}
10824
10825impl FetchLinkableGitRepositoriesResponse {
10826    pub fn new() -> Self {
10827        std::default::Default::default()
10828    }
10829
10830    /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
10831    pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
10832    where
10833        T: std::iter::IntoIterator<Item = V>,
10834        V: std::convert::Into<crate::model::LinkableGitRepository>,
10835    {
10836        use std::iter::Iterator;
10837        self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
10838        self
10839    }
10840
10841    /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
10842    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10843        self.next_page_token = v.into();
10844        self
10845    }
10846}
10847
10848impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
10849    fn typename() -> &'static str {
10850        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
10851    }
10852}
10853
10854#[doc(hidden)]
10855impl gax::paginator::internal::PageableResponse for FetchLinkableGitRepositoriesResponse {
10856    type PageItem = crate::model::LinkableGitRepository;
10857
10858    fn items(self) -> std::vec::Vec<Self::PageItem> {
10859        self.linkable_git_repositories
10860    }
10861
10862    fn next_page_token(&self) -> std::string::String {
10863        use std::clone::Clone;
10864        self.next_page_token.clone()
10865    }
10866}
10867
10868#[doc(hidden)]
10869impl<'de> serde::de::Deserialize<'de> for FetchLinkableGitRepositoriesResponse {
10870    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10871    where
10872        D: serde::Deserializer<'de>,
10873    {
10874        #[allow(non_camel_case_types)]
10875        #[doc(hidden)]
10876        #[derive(PartialEq, Eq, Hash)]
10877        enum __FieldTag {
10878            __linkable_git_repositories,
10879            __next_page_token,
10880            Unknown(std::string::String),
10881        }
10882        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10883            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10884            where
10885                D: serde::Deserializer<'de>,
10886            {
10887                struct Visitor;
10888                impl<'de> serde::de::Visitor<'de> for Visitor {
10889                    type Value = __FieldTag;
10890                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10891                        formatter.write_str("a field name for FetchLinkableGitRepositoriesResponse")
10892                    }
10893                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10894                    where
10895                        E: serde::de::Error,
10896                    {
10897                        use std::result::Result::Ok;
10898                        use std::string::ToString;
10899                        match value {
10900                            "linkableGitRepositories" => {
10901                                Ok(__FieldTag::__linkable_git_repositories)
10902                            }
10903                            "linkable_git_repositories" => {
10904                                Ok(__FieldTag::__linkable_git_repositories)
10905                            }
10906                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
10907                            "next_page_token" => Ok(__FieldTag::__next_page_token),
10908                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10909                        }
10910                    }
10911                }
10912                deserializer.deserialize_identifier(Visitor)
10913            }
10914        }
10915        struct Visitor;
10916        impl<'de> serde::de::Visitor<'de> for Visitor {
10917            type Value = FetchLinkableGitRepositoriesResponse;
10918            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10919                formatter.write_str("struct FetchLinkableGitRepositoriesResponse")
10920            }
10921            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10922            where
10923                A: serde::de::MapAccess<'de>,
10924            {
10925                #[allow(unused_imports)]
10926                use serde::de::Error;
10927                use std::option::Option::Some;
10928                let mut fields = std::collections::HashSet::new();
10929                let mut result = Self::Value::new();
10930                while let Some(tag) = map.next_key::<__FieldTag>()? {
10931                    #[allow(clippy::match_single_binding)]
10932                    match tag {
10933                        __FieldTag::__linkable_git_repositories => {
10934                            if !fields.insert(__FieldTag::__linkable_git_repositories) {
10935                                return std::result::Result::Err(A::Error::duplicate_field(
10936                                    "multiple values for linkable_git_repositories",
10937                                ));
10938                            }
10939                            result.linkable_git_repositories = map
10940                                .next_value::<std::option::Option<
10941                                    std::vec::Vec<crate::model::LinkableGitRepository>,
10942                                >>()?
10943                                .unwrap_or_default();
10944                        }
10945                        __FieldTag::__next_page_token => {
10946                            if !fields.insert(__FieldTag::__next_page_token) {
10947                                return std::result::Result::Err(A::Error::duplicate_field(
10948                                    "multiple values for next_page_token",
10949                                ));
10950                            }
10951                            result.next_page_token = map
10952                                .next_value::<std::option::Option<std::string::String>>()?
10953                                .unwrap_or_default();
10954                        }
10955                        __FieldTag::Unknown(key) => {
10956                            let value = map.next_value::<serde_json::Value>()?;
10957                            result._unknown_fields.insert(key, value);
10958                        }
10959                    }
10960                }
10961                std::result::Result::Ok(result)
10962            }
10963        }
10964        deserializer.deserialize_any(Visitor)
10965    }
10966}
10967
10968#[doc(hidden)]
10969impl serde::ser::Serialize for FetchLinkableGitRepositoriesResponse {
10970    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10971    where
10972        S: serde::ser::Serializer,
10973    {
10974        use serde::ser::SerializeMap;
10975        #[allow(unused_imports)]
10976        use std::option::Option::Some;
10977        let mut state = serializer.serialize_map(std::option::Option::None)?;
10978        if !self.linkable_git_repositories.is_empty() {
10979            state.serialize_entry("linkableGitRepositories", &self.linkable_git_repositories)?;
10980        }
10981        if !self.next_page_token.is_empty() {
10982            state.serialize_entry("nextPageToken", &self.next_page_token)?;
10983        }
10984        if !self._unknown_fields.is_empty() {
10985            for (key, value) in self._unknown_fields.iter() {
10986                state.serialize_entry(key, &value)?;
10987            }
10988        }
10989        state.end()
10990    }
10991}
10992
10993/// LinkableGitRepository represents a git repository that can be linked to a
10994/// connection.
10995#[derive(Clone, Debug, Default, PartialEq)]
10996#[non_exhaustive]
10997pub struct LinkableGitRepository {
10998    /// The clone uri of the repository.
10999    pub clone_uri: std::string::String,
11000
11001    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11002}
11003
11004impl LinkableGitRepository {
11005    pub fn new() -> Self {
11006        std::default::Default::default()
11007    }
11008
11009    /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
11010    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11011        self.clone_uri = v.into();
11012        self
11013    }
11014}
11015
11016impl wkt::message::Message for LinkableGitRepository {
11017    fn typename() -> &'static str {
11018        "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
11019    }
11020}
11021
11022#[doc(hidden)]
11023impl<'de> serde::de::Deserialize<'de> for LinkableGitRepository {
11024    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11025    where
11026        D: serde::Deserializer<'de>,
11027    {
11028        #[allow(non_camel_case_types)]
11029        #[doc(hidden)]
11030        #[derive(PartialEq, Eq, Hash)]
11031        enum __FieldTag {
11032            __clone_uri,
11033            Unknown(std::string::String),
11034        }
11035        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11036            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11037            where
11038                D: serde::Deserializer<'de>,
11039            {
11040                struct Visitor;
11041                impl<'de> serde::de::Visitor<'de> for Visitor {
11042                    type Value = __FieldTag;
11043                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11044                        formatter.write_str("a field name for LinkableGitRepository")
11045                    }
11046                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11047                    where
11048                        E: serde::de::Error,
11049                    {
11050                        use std::result::Result::Ok;
11051                        use std::string::ToString;
11052                        match value {
11053                            "cloneUri" => Ok(__FieldTag::__clone_uri),
11054                            "clone_uri" => Ok(__FieldTag::__clone_uri),
11055                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11056                        }
11057                    }
11058                }
11059                deserializer.deserialize_identifier(Visitor)
11060            }
11061        }
11062        struct Visitor;
11063        impl<'de> serde::de::Visitor<'de> for Visitor {
11064            type Value = LinkableGitRepository;
11065            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11066                formatter.write_str("struct LinkableGitRepository")
11067            }
11068            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11069            where
11070                A: serde::de::MapAccess<'de>,
11071            {
11072                #[allow(unused_imports)]
11073                use serde::de::Error;
11074                use std::option::Option::Some;
11075                let mut fields = std::collections::HashSet::new();
11076                let mut result = Self::Value::new();
11077                while let Some(tag) = map.next_key::<__FieldTag>()? {
11078                    #[allow(clippy::match_single_binding)]
11079                    match tag {
11080                        __FieldTag::__clone_uri => {
11081                            if !fields.insert(__FieldTag::__clone_uri) {
11082                                return std::result::Result::Err(A::Error::duplicate_field(
11083                                    "multiple values for clone_uri",
11084                                ));
11085                            }
11086                            result.clone_uri = map
11087                                .next_value::<std::option::Option<std::string::String>>()?
11088                                .unwrap_or_default();
11089                        }
11090                        __FieldTag::Unknown(key) => {
11091                            let value = map.next_value::<serde_json::Value>()?;
11092                            result._unknown_fields.insert(key, value);
11093                        }
11094                    }
11095                }
11096                std::result::Result::Ok(result)
11097            }
11098        }
11099        deserializer.deserialize_any(Visitor)
11100    }
11101}
11102
11103#[doc(hidden)]
11104impl serde::ser::Serialize for LinkableGitRepository {
11105    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11106    where
11107        S: serde::ser::Serializer,
11108    {
11109        use serde::ser::SerializeMap;
11110        #[allow(unused_imports)]
11111        use std::option::Option::Some;
11112        let mut state = serializer.serialize_map(std::option::Option::None)?;
11113        if !self.clone_uri.is_empty() {
11114            state.serialize_entry("cloneUri", &self.clone_uri)?;
11115        }
11116        if !self._unknown_fields.is_empty() {
11117            for (key, value) in self._unknown_fields.iter() {
11118                state.serialize_entry(key, &value)?;
11119            }
11120        }
11121        state.end()
11122    }
11123}
11124
11125/// Request for fetching github installations.
11126#[derive(Clone, Debug, Default, PartialEq)]
11127#[non_exhaustive]
11128pub struct FetchGitHubInstallationsRequest {
11129    /// Required. The resource name of the connection in the format
11130    /// `projects/*/locations/*/connections/*`.
11131    pub connection: std::string::String,
11132
11133    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11134}
11135
11136impl FetchGitHubInstallationsRequest {
11137    pub fn new() -> Self {
11138        std::default::Default::default()
11139    }
11140
11141    /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
11142    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11143        self.connection = v.into();
11144        self
11145    }
11146}
11147
11148impl wkt::message::Message for FetchGitHubInstallationsRequest {
11149    fn typename() -> &'static str {
11150        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
11151    }
11152}
11153
11154#[doc(hidden)]
11155impl<'de> serde::de::Deserialize<'de> for FetchGitHubInstallationsRequest {
11156    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11157    where
11158        D: serde::Deserializer<'de>,
11159    {
11160        #[allow(non_camel_case_types)]
11161        #[doc(hidden)]
11162        #[derive(PartialEq, Eq, Hash)]
11163        enum __FieldTag {
11164            __connection,
11165            Unknown(std::string::String),
11166        }
11167        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11168            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11169            where
11170                D: serde::Deserializer<'de>,
11171            {
11172                struct Visitor;
11173                impl<'de> serde::de::Visitor<'de> for Visitor {
11174                    type Value = __FieldTag;
11175                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11176                        formatter.write_str("a field name for FetchGitHubInstallationsRequest")
11177                    }
11178                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11179                    where
11180                        E: serde::de::Error,
11181                    {
11182                        use std::result::Result::Ok;
11183                        use std::string::ToString;
11184                        match value {
11185                            "connection" => Ok(__FieldTag::__connection),
11186                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11187                        }
11188                    }
11189                }
11190                deserializer.deserialize_identifier(Visitor)
11191            }
11192        }
11193        struct Visitor;
11194        impl<'de> serde::de::Visitor<'de> for Visitor {
11195            type Value = FetchGitHubInstallationsRequest;
11196            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11197                formatter.write_str("struct FetchGitHubInstallationsRequest")
11198            }
11199            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11200            where
11201                A: serde::de::MapAccess<'de>,
11202            {
11203                #[allow(unused_imports)]
11204                use serde::de::Error;
11205                use std::option::Option::Some;
11206                let mut fields = std::collections::HashSet::new();
11207                let mut result = Self::Value::new();
11208                while let Some(tag) = map.next_key::<__FieldTag>()? {
11209                    #[allow(clippy::match_single_binding)]
11210                    match tag {
11211                        __FieldTag::__connection => {
11212                            if !fields.insert(__FieldTag::__connection) {
11213                                return std::result::Result::Err(A::Error::duplicate_field(
11214                                    "multiple values for connection",
11215                                ));
11216                            }
11217                            result.connection = map
11218                                .next_value::<std::option::Option<std::string::String>>()?
11219                                .unwrap_or_default();
11220                        }
11221                        __FieldTag::Unknown(key) => {
11222                            let value = map.next_value::<serde_json::Value>()?;
11223                            result._unknown_fields.insert(key, value);
11224                        }
11225                    }
11226                }
11227                std::result::Result::Ok(result)
11228            }
11229        }
11230        deserializer.deserialize_any(Visitor)
11231    }
11232}
11233
11234#[doc(hidden)]
11235impl serde::ser::Serialize for FetchGitHubInstallationsRequest {
11236    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11237    where
11238        S: serde::ser::Serializer,
11239    {
11240        use serde::ser::SerializeMap;
11241        #[allow(unused_imports)]
11242        use std::option::Option::Some;
11243        let mut state = serializer.serialize_map(std::option::Option::None)?;
11244        if !self.connection.is_empty() {
11245            state.serialize_entry("connection", &self.connection)?;
11246        }
11247        if !self._unknown_fields.is_empty() {
11248            for (key, value) in self._unknown_fields.iter() {
11249                state.serialize_entry(key, &value)?;
11250            }
11251        }
11252        state.end()
11253    }
11254}
11255
11256/// Response of fetching github installations.
11257#[derive(Clone, Debug, Default, PartialEq)]
11258#[non_exhaustive]
11259pub struct FetchGitHubInstallationsResponse {
11260    /// List of installations available to the OAuth user (for github.com)
11261    /// or all the installations (for GitHub enterprise).
11262    pub installations:
11263        std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
11264
11265    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11266}
11267
11268impl FetchGitHubInstallationsResponse {
11269    pub fn new() -> Self {
11270        std::default::Default::default()
11271    }
11272
11273    /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
11274    pub fn set_installations<T, V>(mut self, v: T) -> Self
11275    where
11276        T: std::iter::IntoIterator<Item = V>,
11277        V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
11278    {
11279        use std::iter::Iterator;
11280        self.installations = v.into_iter().map(|i| i.into()).collect();
11281        self
11282    }
11283}
11284
11285impl wkt::message::Message for FetchGitHubInstallationsResponse {
11286    fn typename() -> &'static str {
11287        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
11288    }
11289}
11290
11291#[doc(hidden)]
11292impl<'de> serde::de::Deserialize<'de> for FetchGitHubInstallationsResponse {
11293    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11294    where
11295        D: serde::Deserializer<'de>,
11296    {
11297        #[allow(non_camel_case_types)]
11298        #[doc(hidden)]
11299        #[derive(PartialEq, Eq, Hash)]
11300        enum __FieldTag {
11301            __installations,
11302            Unknown(std::string::String),
11303        }
11304        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11305            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11306            where
11307                D: serde::Deserializer<'de>,
11308            {
11309                struct Visitor;
11310                impl<'de> serde::de::Visitor<'de> for Visitor {
11311                    type Value = __FieldTag;
11312                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11313                        formatter.write_str("a field name for FetchGitHubInstallationsResponse")
11314                    }
11315                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11316                    where
11317                        E: serde::de::Error,
11318                    {
11319                        use std::result::Result::Ok;
11320                        use std::string::ToString;
11321                        match value {
11322                            "installations" => Ok(__FieldTag::__installations),
11323                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11324                        }
11325                    }
11326                }
11327                deserializer.deserialize_identifier(Visitor)
11328            }
11329        }
11330        struct Visitor;
11331        impl<'de> serde::de::Visitor<'de> for Visitor {
11332            type Value = FetchGitHubInstallationsResponse;
11333            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11334                formatter.write_str("struct FetchGitHubInstallationsResponse")
11335            }
11336            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11337            where
11338                A: serde::de::MapAccess<'de>,
11339            {
11340                #[allow(unused_imports)]
11341                use serde::de::Error;
11342                use std::option::Option::Some;
11343                let mut fields = std::collections::HashSet::new();
11344                let mut result = Self::Value::new();
11345                while let Some(tag) = map.next_key::<__FieldTag>()? {
11346                    #[allow(clippy::match_single_binding)]
11347                    match tag {
11348                        __FieldTag::__installations => {
11349                            if !fields.insert(__FieldTag::__installations) {
11350                                return std::result::Result::Err(A::Error::duplicate_field(
11351                                    "multiple values for installations",
11352                                ));
11353                            }
11354                            result.installations = map.next_value::<std::option::Option<std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>>>()?.unwrap_or_default();
11355                        }
11356                        __FieldTag::Unknown(key) => {
11357                            let value = map.next_value::<serde_json::Value>()?;
11358                            result._unknown_fields.insert(key, value);
11359                        }
11360                    }
11361                }
11362                std::result::Result::Ok(result)
11363            }
11364        }
11365        deserializer.deserialize_any(Visitor)
11366    }
11367}
11368
11369#[doc(hidden)]
11370impl serde::ser::Serialize for FetchGitHubInstallationsResponse {
11371    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11372    where
11373        S: serde::ser::Serializer,
11374    {
11375        use serde::ser::SerializeMap;
11376        #[allow(unused_imports)]
11377        use std::option::Option::Some;
11378        let mut state = serializer.serialize_map(std::option::Option::None)?;
11379        if !self.installations.is_empty() {
11380            state.serialize_entry("installations", &self.installations)?;
11381        }
11382        if !self._unknown_fields.is_empty() {
11383            for (key, value) in self._unknown_fields.iter() {
11384                state.serialize_entry(key, &value)?;
11385            }
11386        }
11387        state.end()
11388    }
11389}
11390
11391/// Defines additional types related to [FetchGitHubInstallationsResponse].
11392pub mod fetch_git_hub_installations_response {
11393    #[allow(unused_imports)]
11394    use super::*;
11395
11396    /// Represents an installation of the GitHub App.
11397    #[derive(Clone, Debug, Default, PartialEq)]
11398    #[non_exhaustive]
11399    pub struct Installation {
11400        /// ID of the installation in GitHub.
11401        pub id: i64,
11402
11403        /// Name of the GitHub user or organization that owns this installation.
11404        pub name: std::string::String,
11405
11406        /// Either "user" or "organization".
11407        pub r#type: std::string::String,
11408
11409        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11410    }
11411
11412    impl Installation {
11413        pub fn new() -> Self {
11414            std::default::Default::default()
11415        }
11416
11417        /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
11418        pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11419            self.id = v.into();
11420            self
11421        }
11422
11423        /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
11424        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11425            self.name = v.into();
11426            self
11427        }
11428
11429        /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
11430        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11431            self.r#type = v.into();
11432            self
11433        }
11434    }
11435
11436    impl wkt::message::Message for Installation {
11437        fn typename() -> &'static str {
11438            "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
11439        }
11440    }
11441
11442    #[doc(hidden)]
11443    impl<'de> serde::de::Deserialize<'de> for Installation {
11444        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11445        where
11446            D: serde::Deserializer<'de>,
11447        {
11448            #[allow(non_camel_case_types)]
11449            #[doc(hidden)]
11450            #[derive(PartialEq, Eq, Hash)]
11451            enum __FieldTag {
11452                __id,
11453                __name,
11454                __type,
11455                Unknown(std::string::String),
11456            }
11457            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11458                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11459                where
11460                    D: serde::Deserializer<'de>,
11461                {
11462                    struct Visitor;
11463                    impl<'de> serde::de::Visitor<'de> for Visitor {
11464                        type Value = __FieldTag;
11465                        fn expecting(
11466                            &self,
11467                            formatter: &mut std::fmt::Formatter,
11468                        ) -> std::fmt::Result {
11469                            formatter.write_str("a field name for Installation")
11470                        }
11471                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11472                        where
11473                            E: serde::de::Error,
11474                        {
11475                            use std::result::Result::Ok;
11476                            use std::string::ToString;
11477                            match value {
11478                                "id" => Ok(__FieldTag::__id),
11479                                "name" => Ok(__FieldTag::__name),
11480                                "type" => Ok(__FieldTag::__type),
11481                                _ => Ok(__FieldTag::Unknown(value.to_string())),
11482                            }
11483                        }
11484                    }
11485                    deserializer.deserialize_identifier(Visitor)
11486                }
11487            }
11488            struct Visitor;
11489            impl<'de> serde::de::Visitor<'de> for Visitor {
11490                type Value = Installation;
11491                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11492                    formatter.write_str("struct Installation")
11493                }
11494                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11495                where
11496                    A: serde::de::MapAccess<'de>,
11497                {
11498                    #[allow(unused_imports)]
11499                    use serde::de::Error;
11500                    use std::option::Option::Some;
11501                    let mut fields = std::collections::HashSet::new();
11502                    let mut result = Self::Value::new();
11503                    while let Some(tag) = map.next_key::<__FieldTag>()? {
11504                        #[allow(clippy::match_single_binding)]
11505                        match tag {
11506                            __FieldTag::__id => {
11507                                if !fields.insert(__FieldTag::__id) {
11508                                    return std::result::Result::Err(A::Error::duplicate_field(
11509                                        "multiple values for id",
11510                                    ));
11511                                }
11512                                struct __With(std::option::Option<i64>);
11513                                impl<'de> serde::de::Deserialize<'de> for __With {
11514                                    fn deserialize<D>(
11515                                        deserializer: D,
11516                                    ) -> std::result::Result<Self, D::Error>
11517                                    where
11518                                        D: serde::de::Deserializer<'de>,
11519                                    {
11520                                        serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
11521                                    }
11522                                }
11523                                result.id = map.next_value::<__With>()?.0.unwrap_or_default();
11524                            }
11525                            __FieldTag::__name => {
11526                                if !fields.insert(__FieldTag::__name) {
11527                                    return std::result::Result::Err(A::Error::duplicate_field(
11528                                        "multiple values for name",
11529                                    ));
11530                                }
11531                                result.name = map
11532                                    .next_value::<std::option::Option<std::string::String>>()?
11533                                    .unwrap_or_default();
11534                            }
11535                            __FieldTag::__type => {
11536                                if !fields.insert(__FieldTag::__type) {
11537                                    return std::result::Result::Err(A::Error::duplicate_field(
11538                                        "multiple values for type",
11539                                    ));
11540                                }
11541                                result.r#type = map
11542                                    .next_value::<std::option::Option<std::string::String>>()?
11543                                    .unwrap_or_default();
11544                            }
11545                            __FieldTag::Unknown(key) => {
11546                                let value = map.next_value::<serde_json::Value>()?;
11547                                result._unknown_fields.insert(key, value);
11548                            }
11549                        }
11550                    }
11551                    std::result::Result::Ok(result)
11552                }
11553            }
11554            deserializer.deserialize_any(Visitor)
11555        }
11556    }
11557
11558    #[doc(hidden)]
11559    impl serde::ser::Serialize for Installation {
11560        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11561        where
11562            S: serde::ser::Serializer,
11563        {
11564            use serde::ser::SerializeMap;
11565            #[allow(unused_imports)]
11566            use std::option::Option::Some;
11567            let mut state = serializer.serialize_map(std::option::Option::None)?;
11568            if !wkt::internal::is_default(&self.id) {
11569                struct __With<'a>(&'a i64);
11570                impl<'a> serde::ser::Serialize for __With<'a> {
11571                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11572                    where
11573                        S: serde::ser::Serializer,
11574                    {
11575                        serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
11576                    }
11577                }
11578                state.serialize_entry("id", &__With(&self.id))?;
11579            }
11580            if !self.name.is_empty() {
11581                state.serialize_entry("name", &self.name)?;
11582            }
11583            if !self.r#type.is_empty() {
11584                state.serialize_entry("type", &self.r#type)?;
11585            }
11586            if !self._unknown_fields.is_empty() {
11587                for (key, value) in self._unknown_fields.iter() {
11588                    state.serialize_entry(key, &value)?;
11589                }
11590            }
11591            state.end()
11592        }
11593    }
11594}
11595
11596/// Request for fetching git refs.
11597#[derive(Clone, Debug, Default, PartialEq)]
11598#[non_exhaustive]
11599pub struct FetchGitRefsRequest {
11600    /// Required. The resource name of GitRepositoryLink in the format
11601    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
11602    pub git_repository_link: std::string::String,
11603
11604    /// Required. Type of refs to fetch.
11605    pub ref_type: crate::model::fetch_git_refs_request::RefType,
11606
11607    /// Optional. Number of results to return in the list. Default to 20.
11608    pub page_size: i32,
11609
11610    /// Optional. Page start.
11611    pub page_token: std::string::String,
11612
11613    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11614}
11615
11616impl FetchGitRefsRequest {
11617    pub fn new() -> Self {
11618        std::default::Default::default()
11619    }
11620
11621    /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
11622    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
11623        mut self,
11624        v: T,
11625    ) -> Self {
11626        self.git_repository_link = v.into();
11627        self
11628    }
11629
11630    /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
11631    pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
11632        mut self,
11633        v: T,
11634    ) -> Self {
11635        self.ref_type = v.into();
11636        self
11637    }
11638
11639    /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
11640    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11641        self.page_size = v.into();
11642        self
11643    }
11644
11645    /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
11646    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11647        self.page_token = v.into();
11648        self
11649    }
11650}
11651
11652impl wkt::message::Message for FetchGitRefsRequest {
11653    fn typename() -> &'static str {
11654        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
11655    }
11656}
11657
11658#[doc(hidden)]
11659impl<'de> serde::de::Deserialize<'de> for FetchGitRefsRequest {
11660    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11661    where
11662        D: serde::Deserializer<'de>,
11663    {
11664        #[allow(non_camel_case_types)]
11665        #[doc(hidden)]
11666        #[derive(PartialEq, Eq, Hash)]
11667        enum __FieldTag {
11668            __git_repository_link,
11669            __ref_type,
11670            __page_size,
11671            __page_token,
11672            Unknown(std::string::String),
11673        }
11674        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11675            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11676            where
11677                D: serde::Deserializer<'de>,
11678            {
11679                struct Visitor;
11680                impl<'de> serde::de::Visitor<'de> for Visitor {
11681                    type Value = __FieldTag;
11682                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11683                        formatter.write_str("a field name for FetchGitRefsRequest")
11684                    }
11685                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11686                    where
11687                        E: serde::de::Error,
11688                    {
11689                        use std::result::Result::Ok;
11690                        use std::string::ToString;
11691                        match value {
11692                            "gitRepositoryLink" => Ok(__FieldTag::__git_repository_link),
11693                            "git_repository_link" => Ok(__FieldTag::__git_repository_link),
11694                            "refType" => Ok(__FieldTag::__ref_type),
11695                            "ref_type" => Ok(__FieldTag::__ref_type),
11696                            "pageSize" => Ok(__FieldTag::__page_size),
11697                            "page_size" => Ok(__FieldTag::__page_size),
11698                            "pageToken" => Ok(__FieldTag::__page_token),
11699                            "page_token" => Ok(__FieldTag::__page_token),
11700                            _ => Ok(__FieldTag::Unknown(value.to_string())),
11701                        }
11702                    }
11703                }
11704                deserializer.deserialize_identifier(Visitor)
11705            }
11706        }
11707        struct Visitor;
11708        impl<'de> serde::de::Visitor<'de> for Visitor {
11709            type Value = FetchGitRefsRequest;
11710            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11711                formatter.write_str("struct FetchGitRefsRequest")
11712            }
11713            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11714            where
11715                A: serde::de::MapAccess<'de>,
11716            {
11717                #[allow(unused_imports)]
11718                use serde::de::Error;
11719                use std::option::Option::Some;
11720                let mut fields = std::collections::HashSet::new();
11721                let mut result = Self::Value::new();
11722                while let Some(tag) = map.next_key::<__FieldTag>()? {
11723                    #[allow(clippy::match_single_binding)]
11724                    match tag {
11725                        __FieldTag::__git_repository_link => {
11726                            if !fields.insert(__FieldTag::__git_repository_link) {
11727                                return std::result::Result::Err(A::Error::duplicate_field(
11728                                    "multiple values for git_repository_link",
11729                                ));
11730                            }
11731                            result.git_repository_link = map
11732                                .next_value::<std::option::Option<std::string::String>>()?
11733                                .unwrap_or_default();
11734                        }
11735                        __FieldTag::__ref_type => {
11736                            if !fields.insert(__FieldTag::__ref_type) {
11737                                return std::result::Result::Err(A::Error::duplicate_field(
11738                                    "multiple values for ref_type",
11739                                ));
11740                            }
11741                            result.ref_type =
11742                                map.next_value::<std::option::Option<
11743                                    crate::model::fetch_git_refs_request::RefType,
11744                                >>()?
11745                                .unwrap_or_default();
11746                        }
11747                        __FieldTag::__page_size => {
11748                            if !fields.insert(__FieldTag::__page_size) {
11749                                return std::result::Result::Err(A::Error::duplicate_field(
11750                                    "multiple values for page_size",
11751                                ));
11752                            }
11753                            struct __With(std::option::Option<i32>);
11754                            impl<'de> serde::de::Deserialize<'de> for __With {
11755                                fn deserialize<D>(
11756                                    deserializer: D,
11757                                ) -> std::result::Result<Self, D::Error>
11758                                where
11759                                    D: serde::de::Deserializer<'de>,
11760                                {
11761                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11762                                }
11763                            }
11764                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
11765                        }
11766                        __FieldTag::__page_token => {
11767                            if !fields.insert(__FieldTag::__page_token) {
11768                                return std::result::Result::Err(A::Error::duplicate_field(
11769                                    "multiple values for page_token",
11770                                ));
11771                            }
11772                            result.page_token = map
11773                                .next_value::<std::option::Option<std::string::String>>()?
11774                                .unwrap_or_default();
11775                        }
11776                        __FieldTag::Unknown(key) => {
11777                            let value = map.next_value::<serde_json::Value>()?;
11778                            result._unknown_fields.insert(key, value);
11779                        }
11780                    }
11781                }
11782                std::result::Result::Ok(result)
11783            }
11784        }
11785        deserializer.deserialize_any(Visitor)
11786    }
11787}
11788
11789#[doc(hidden)]
11790impl serde::ser::Serialize for FetchGitRefsRequest {
11791    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11792    where
11793        S: serde::ser::Serializer,
11794    {
11795        use serde::ser::SerializeMap;
11796        #[allow(unused_imports)]
11797        use std::option::Option::Some;
11798        let mut state = serializer.serialize_map(std::option::Option::None)?;
11799        if !self.git_repository_link.is_empty() {
11800            state.serialize_entry("gitRepositoryLink", &self.git_repository_link)?;
11801        }
11802        if !wkt::internal::is_default(&self.ref_type) {
11803            state.serialize_entry("refType", &self.ref_type)?;
11804        }
11805        if !wkt::internal::is_default(&self.page_size) {
11806            struct __With<'a>(&'a i32);
11807            impl<'a> serde::ser::Serialize for __With<'a> {
11808                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11809                where
11810                    S: serde::ser::Serializer,
11811                {
11812                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11813                }
11814            }
11815            state.serialize_entry("pageSize", &__With(&self.page_size))?;
11816        }
11817        if !self.page_token.is_empty() {
11818            state.serialize_entry("pageToken", &self.page_token)?;
11819        }
11820        if !self._unknown_fields.is_empty() {
11821            for (key, value) in self._unknown_fields.iter() {
11822                state.serialize_entry(key, &value)?;
11823            }
11824        }
11825        state.end()
11826    }
11827}
11828
11829/// Defines additional types related to [FetchGitRefsRequest].
11830pub mod fetch_git_refs_request {
11831    #[allow(unused_imports)]
11832    use super::*;
11833
11834    /// Type of refs.
11835    ///
11836    /// # Working with unknown values
11837    ///
11838    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11839    /// additional enum variants at any time. Adding new variants is not considered
11840    /// a breaking change. Applications should write their code in anticipation of:
11841    ///
11842    /// - New values appearing in future releases of the client library, **and**
11843    /// - New values received dynamically, without application changes.
11844    ///
11845    /// Please consult the [Working with enums] section in the user guide for some
11846    /// guidelines.
11847    ///
11848    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11849    #[derive(Clone, Debug, PartialEq)]
11850    #[non_exhaustive]
11851    pub enum RefType {
11852        /// No type specified.
11853        Unspecified,
11854        /// To fetch tags.
11855        Tag,
11856        /// To fetch branches.
11857        Branch,
11858        /// If set, the enum was initialized with an unknown value.
11859        ///
11860        /// Applications can examine the value using [RefType::value] or
11861        /// [RefType::name].
11862        UnknownValue(ref_type::UnknownValue),
11863    }
11864
11865    #[doc(hidden)]
11866    pub mod ref_type {
11867        #[allow(unused_imports)]
11868        use super::*;
11869        #[derive(Clone, Debug, PartialEq)]
11870        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11871    }
11872
11873    impl RefType {
11874        /// Gets the enum value.
11875        ///
11876        /// Returns `None` if the enum contains an unknown value deserialized from
11877        /// the string representation of enums.
11878        pub fn value(&self) -> std::option::Option<i32> {
11879            match self {
11880                Self::Unspecified => std::option::Option::Some(0),
11881                Self::Tag => std::option::Option::Some(1),
11882                Self::Branch => std::option::Option::Some(2),
11883                Self::UnknownValue(u) => u.0.value(),
11884            }
11885        }
11886
11887        /// Gets the enum value as a string.
11888        ///
11889        /// Returns `None` if the enum contains an unknown value deserialized from
11890        /// the integer representation of enums.
11891        pub fn name(&self) -> std::option::Option<&str> {
11892            match self {
11893                Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
11894                Self::Tag => std::option::Option::Some("TAG"),
11895                Self::Branch => std::option::Option::Some("BRANCH"),
11896                Self::UnknownValue(u) => u.0.name(),
11897            }
11898        }
11899    }
11900
11901    impl std::default::Default for RefType {
11902        fn default() -> Self {
11903            use std::convert::From;
11904            Self::from(0)
11905        }
11906    }
11907
11908    impl std::fmt::Display for RefType {
11909        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11910            wkt::internal::display_enum(f, self.name(), self.value())
11911        }
11912    }
11913
11914    impl std::convert::From<i32> for RefType {
11915        fn from(value: i32) -> Self {
11916            match value {
11917                0 => Self::Unspecified,
11918                1 => Self::Tag,
11919                2 => Self::Branch,
11920                _ => Self::UnknownValue(ref_type::UnknownValue(
11921                    wkt::internal::UnknownEnumValue::Integer(value),
11922                )),
11923            }
11924        }
11925    }
11926
11927    impl std::convert::From<&str> for RefType {
11928        fn from(value: &str) -> Self {
11929            use std::string::ToString;
11930            match value {
11931                "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
11932                "TAG" => Self::Tag,
11933                "BRANCH" => Self::Branch,
11934                _ => Self::UnknownValue(ref_type::UnknownValue(
11935                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11936                )),
11937            }
11938        }
11939    }
11940
11941    impl serde::ser::Serialize for RefType {
11942        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11943        where
11944            S: serde::Serializer,
11945        {
11946            match self {
11947                Self::Unspecified => serializer.serialize_i32(0),
11948                Self::Tag => serializer.serialize_i32(1),
11949                Self::Branch => serializer.serialize_i32(2),
11950                Self::UnknownValue(u) => u.0.serialize(serializer),
11951            }
11952        }
11953    }
11954
11955    impl<'de> serde::de::Deserialize<'de> for RefType {
11956        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11957        where
11958            D: serde::Deserializer<'de>,
11959        {
11960            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
11961                ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
11962            ))
11963        }
11964    }
11965}
11966
11967/// Response for fetching git refs.
11968#[derive(Clone, Debug, Default, PartialEq)]
11969#[non_exhaustive]
11970pub struct FetchGitRefsResponse {
11971    /// Name of the refs fetched.
11972    pub ref_names: std::vec::Vec<std::string::String>,
11973
11974    /// A token identifying a page of results the server should return.
11975    pub next_page_token: std::string::String,
11976
11977    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11978}
11979
11980impl FetchGitRefsResponse {
11981    pub fn new() -> Self {
11982        std::default::Default::default()
11983    }
11984
11985    /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
11986    pub fn set_ref_names<T, V>(mut self, v: T) -> Self
11987    where
11988        T: std::iter::IntoIterator<Item = V>,
11989        V: std::convert::Into<std::string::String>,
11990    {
11991        use std::iter::Iterator;
11992        self.ref_names = v.into_iter().map(|i| i.into()).collect();
11993        self
11994    }
11995
11996    /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
11997    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11998        self.next_page_token = v.into();
11999        self
12000    }
12001}
12002
12003impl wkt::message::Message for FetchGitRefsResponse {
12004    fn typename() -> &'static str {
12005        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
12006    }
12007}
12008
12009#[doc(hidden)]
12010impl<'de> serde::de::Deserialize<'de> for FetchGitRefsResponse {
12011    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12012    where
12013        D: serde::Deserializer<'de>,
12014    {
12015        #[allow(non_camel_case_types)]
12016        #[doc(hidden)]
12017        #[derive(PartialEq, Eq, Hash)]
12018        enum __FieldTag {
12019            __ref_names,
12020            __next_page_token,
12021            Unknown(std::string::String),
12022        }
12023        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12024            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12025            where
12026                D: serde::Deserializer<'de>,
12027            {
12028                struct Visitor;
12029                impl<'de> serde::de::Visitor<'de> for Visitor {
12030                    type Value = __FieldTag;
12031                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12032                        formatter.write_str("a field name for FetchGitRefsResponse")
12033                    }
12034                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12035                    where
12036                        E: serde::de::Error,
12037                    {
12038                        use std::result::Result::Ok;
12039                        use std::string::ToString;
12040                        match value {
12041                            "refNames" => Ok(__FieldTag::__ref_names),
12042                            "ref_names" => Ok(__FieldTag::__ref_names),
12043                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
12044                            "next_page_token" => Ok(__FieldTag::__next_page_token),
12045                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12046                        }
12047                    }
12048                }
12049                deserializer.deserialize_identifier(Visitor)
12050            }
12051        }
12052        struct Visitor;
12053        impl<'de> serde::de::Visitor<'de> for Visitor {
12054            type Value = FetchGitRefsResponse;
12055            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12056                formatter.write_str("struct FetchGitRefsResponse")
12057            }
12058            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12059            where
12060                A: serde::de::MapAccess<'de>,
12061            {
12062                #[allow(unused_imports)]
12063                use serde::de::Error;
12064                use std::option::Option::Some;
12065                let mut fields = std::collections::HashSet::new();
12066                let mut result = Self::Value::new();
12067                while let Some(tag) = map.next_key::<__FieldTag>()? {
12068                    #[allow(clippy::match_single_binding)]
12069                    match tag {
12070                        __FieldTag::__ref_names => {
12071                            if !fields.insert(__FieldTag::__ref_names) {
12072                                return std::result::Result::Err(A::Error::duplicate_field(
12073                                    "multiple values for ref_names",
12074                                ));
12075                            }
12076                            result.ref_names = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
12077                        }
12078                        __FieldTag::__next_page_token => {
12079                            if !fields.insert(__FieldTag::__next_page_token) {
12080                                return std::result::Result::Err(A::Error::duplicate_field(
12081                                    "multiple values for next_page_token",
12082                                ));
12083                            }
12084                            result.next_page_token = map
12085                                .next_value::<std::option::Option<std::string::String>>()?
12086                                .unwrap_or_default();
12087                        }
12088                        __FieldTag::Unknown(key) => {
12089                            let value = map.next_value::<serde_json::Value>()?;
12090                            result._unknown_fields.insert(key, value);
12091                        }
12092                    }
12093                }
12094                std::result::Result::Ok(result)
12095            }
12096        }
12097        deserializer.deserialize_any(Visitor)
12098    }
12099}
12100
12101#[doc(hidden)]
12102impl serde::ser::Serialize for FetchGitRefsResponse {
12103    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12104    where
12105        S: serde::ser::Serializer,
12106    {
12107        use serde::ser::SerializeMap;
12108        #[allow(unused_imports)]
12109        use std::option::Option::Some;
12110        let mut state = serializer.serialize_map(std::option::Option::None)?;
12111        if !self.ref_names.is_empty() {
12112            state.serialize_entry("refNames", &self.ref_names)?;
12113        }
12114        if !self.next_page_token.is_empty() {
12115            state.serialize_entry("nextPageToken", &self.next_page_token)?;
12116        }
12117        if !self._unknown_fields.is_empty() {
12118            for (key, value) in self._unknown_fields.iter() {
12119                state.serialize_entry(key, &value)?;
12120            }
12121        }
12122        state.end()
12123    }
12124}
12125
12126/// AccountConnector encapsulates what a platform administrator needs to
12127/// configure for users to connect to the service providers, which includes,
12128/// among other fields, the OAuth client ID, client secret, and authorization and
12129/// token endpoints.
12130#[derive(Clone, Debug, Default, PartialEq)]
12131#[non_exhaustive]
12132pub struct AccountConnector {
12133    /// Identifier. The resource name of the accountConnector, in the format
12134    /// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
12135    pub name: std::string::String,
12136
12137    /// Output only. The timestamp when the accountConnector was created.
12138    pub create_time: std::option::Option<wkt::Timestamp>,
12139
12140    /// Output only. The timestamp when the accountConnector was updated.
12141    pub update_time: std::option::Option<wkt::Timestamp>,
12142
12143    /// Optional. Allows users to store small amounts of arbitrary data.
12144    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
12145
12146    /// Optional. This checksum is computed by the server based on the value of
12147    /// other fields, and may be sent on update and delete requests to ensure the
12148    /// client has an up-to-date value before proceeding.
12149    pub etag: std::string::String,
12150
12151    /// Optional. Labels as key value pairs
12152    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12153
12154    /// Output only. Start OAuth flow by clicking on this URL.
12155    pub oauth_start_uri: std::string::String,
12156
12157    /// The AccountConnector config.
12158    pub account_connector_config:
12159        std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
12160
12161    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12162}
12163
12164impl AccountConnector {
12165    pub fn new() -> Self {
12166        std::default::Default::default()
12167    }
12168
12169    /// Sets the value of [name][crate::model::AccountConnector::name].
12170    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12171        self.name = v.into();
12172        self
12173    }
12174
12175    /// Sets the value of [create_time][crate::model::AccountConnector::create_time].
12176    pub fn set_create_time<T>(mut self, v: T) -> Self
12177    where
12178        T: std::convert::Into<wkt::Timestamp>,
12179    {
12180        self.create_time = std::option::Option::Some(v.into());
12181        self
12182    }
12183
12184    /// Sets or clears the value of [create_time][crate::model::AccountConnector::create_time].
12185    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12186    where
12187        T: std::convert::Into<wkt::Timestamp>,
12188    {
12189        self.create_time = v.map(|x| x.into());
12190        self
12191    }
12192
12193    /// Sets the value of [update_time][crate::model::AccountConnector::update_time].
12194    pub fn set_update_time<T>(mut self, v: T) -> Self
12195    where
12196        T: std::convert::Into<wkt::Timestamp>,
12197    {
12198        self.update_time = std::option::Option::Some(v.into());
12199        self
12200    }
12201
12202    /// Sets or clears the value of [update_time][crate::model::AccountConnector::update_time].
12203    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12204    where
12205        T: std::convert::Into<wkt::Timestamp>,
12206    {
12207        self.update_time = v.map(|x| x.into());
12208        self
12209    }
12210
12211    /// Sets the value of [annotations][crate::model::AccountConnector::annotations].
12212    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
12213    where
12214        T: std::iter::IntoIterator<Item = (K, V)>,
12215        K: std::convert::Into<std::string::String>,
12216        V: std::convert::Into<std::string::String>,
12217    {
12218        use std::iter::Iterator;
12219        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12220        self
12221    }
12222
12223    /// Sets the value of [etag][crate::model::AccountConnector::etag].
12224    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12225        self.etag = v.into();
12226        self
12227    }
12228
12229    /// Sets the value of [labels][crate::model::AccountConnector::labels].
12230    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12231    where
12232        T: std::iter::IntoIterator<Item = (K, V)>,
12233        K: std::convert::Into<std::string::String>,
12234        V: std::convert::Into<std::string::String>,
12235    {
12236        use std::iter::Iterator;
12237        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12238        self
12239    }
12240
12241    /// Sets the value of [oauth_start_uri][crate::model::AccountConnector::oauth_start_uri].
12242    pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12243        self.oauth_start_uri = v.into();
12244        self
12245    }
12246
12247    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config].
12248    ///
12249    /// Note that all the setters affecting `account_connector_config` are mutually
12250    /// exclusive.
12251    pub fn set_account_connector_config<
12252        T: std::convert::Into<
12253                std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
12254            >,
12255    >(
12256        mut self,
12257        v: T,
12258    ) -> Self {
12259        self.account_connector_config = v.into();
12260        self
12261    }
12262
12263    /// The value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
12264    /// if it holds a `ProviderOauthConfig`, `None` if the field is not set or
12265    /// holds a different branch.
12266    pub fn provider_oauth_config(
12267        &self,
12268    ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
12269        #[allow(unreachable_patterns)]
12270        self.account_connector_config
12271            .as_ref()
12272            .and_then(|v| match v {
12273                crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
12274                    std::option::Option::Some(v)
12275                }
12276                _ => std::option::Option::None,
12277            })
12278    }
12279
12280    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
12281    /// to hold a `ProviderOauthConfig`.
12282    ///
12283    /// Note that all the setters affecting `account_connector_config` are
12284    /// mutually exclusive.
12285    pub fn set_provider_oauth_config<
12286        T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
12287    >(
12288        mut self,
12289        v: T,
12290    ) -> Self {
12291        self.account_connector_config = std::option::Option::Some(
12292            crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
12293        );
12294        self
12295    }
12296}
12297
12298impl wkt::message::Message for AccountConnector {
12299    fn typename() -> &'static str {
12300        "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
12301    }
12302}
12303
12304#[doc(hidden)]
12305impl<'de> serde::de::Deserialize<'de> for AccountConnector {
12306    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12307    where
12308        D: serde::Deserializer<'de>,
12309    {
12310        #[allow(non_camel_case_types)]
12311        #[doc(hidden)]
12312        #[derive(PartialEq, Eq, Hash)]
12313        enum __FieldTag {
12314            __provider_oauth_config,
12315            __name,
12316            __create_time,
12317            __update_time,
12318            __annotations,
12319            __etag,
12320            __labels,
12321            __oauth_start_uri,
12322            Unknown(std::string::String),
12323        }
12324        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12325            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12326            where
12327                D: serde::Deserializer<'de>,
12328            {
12329                struct Visitor;
12330                impl<'de> serde::de::Visitor<'de> for Visitor {
12331                    type Value = __FieldTag;
12332                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12333                        formatter.write_str("a field name for AccountConnector")
12334                    }
12335                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12336                    where
12337                        E: serde::de::Error,
12338                    {
12339                        use std::result::Result::Ok;
12340                        use std::string::ToString;
12341                        match value {
12342                            "providerOauthConfig" => Ok(__FieldTag::__provider_oauth_config),
12343                            "provider_oauth_config" => Ok(__FieldTag::__provider_oauth_config),
12344                            "name" => Ok(__FieldTag::__name),
12345                            "createTime" => Ok(__FieldTag::__create_time),
12346                            "create_time" => Ok(__FieldTag::__create_time),
12347                            "updateTime" => Ok(__FieldTag::__update_time),
12348                            "update_time" => Ok(__FieldTag::__update_time),
12349                            "annotations" => Ok(__FieldTag::__annotations),
12350                            "etag" => Ok(__FieldTag::__etag),
12351                            "labels" => Ok(__FieldTag::__labels),
12352                            "oauthStartUri" => Ok(__FieldTag::__oauth_start_uri),
12353                            "oauth_start_uri" => Ok(__FieldTag::__oauth_start_uri),
12354                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12355                        }
12356                    }
12357                }
12358                deserializer.deserialize_identifier(Visitor)
12359            }
12360        }
12361        struct Visitor;
12362        impl<'de> serde::de::Visitor<'de> for Visitor {
12363            type Value = AccountConnector;
12364            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12365                formatter.write_str("struct AccountConnector")
12366            }
12367            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12368            where
12369                A: serde::de::MapAccess<'de>,
12370            {
12371                #[allow(unused_imports)]
12372                use serde::de::Error;
12373                use std::option::Option::Some;
12374                let mut fields = std::collections::HashSet::new();
12375                let mut result = Self::Value::new();
12376                while let Some(tag) = map.next_key::<__FieldTag>()? {
12377                    #[allow(clippy::match_single_binding)]
12378                    match tag {
12379                        __FieldTag::__provider_oauth_config => {
12380                            if !fields.insert(__FieldTag::__provider_oauth_config) {
12381                                return std::result::Result::Err(A::Error::duplicate_field(
12382                                    "multiple values for provider_oauth_config",
12383                                ));
12384                            }
12385                            if result.account_connector_config.is_some() {
12386                                return std::result::Result::Err(A::Error::duplicate_field(
12387                                    "multiple values for `account_connector_config`, a oneof with full ID .google.cloud.developerconnect.v1.AccountConnector.provider_oauth_config, latest field was providerOauthConfig",
12388                                ));
12389                            }
12390                            result.account_connector_config = std::option::Option::Some(
12391                                crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(
12392                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::ProviderOAuthConfig>>>()?.unwrap_or_default()
12393                                ),
12394                            );
12395                        }
12396                        __FieldTag::__name => {
12397                            if !fields.insert(__FieldTag::__name) {
12398                                return std::result::Result::Err(A::Error::duplicate_field(
12399                                    "multiple values for name",
12400                                ));
12401                            }
12402                            result.name = map
12403                                .next_value::<std::option::Option<std::string::String>>()?
12404                                .unwrap_or_default();
12405                        }
12406                        __FieldTag::__create_time => {
12407                            if !fields.insert(__FieldTag::__create_time) {
12408                                return std::result::Result::Err(A::Error::duplicate_field(
12409                                    "multiple values for create_time",
12410                                ));
12411                            }
12412                            result.create_time =
12413                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
12414                        }
12415                        __FieldTag::__update_time => {
12416                            if !fields.insert(__FieldTag::__update_time) {
12417                                return std::result::Result::Err(A::Error::duplicate_field(
12418                                    "multiple values for update_time",
12419                                ));
12420                            }
12421                            result.update_time =
12422                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
12423                        }
12424                        __FieldTag::__annotations => {
12425                            if !fields.insert(__FieldTag::__annotations) {
12426                                return std::result::Result::Err(A::Error::duplicate_field(
12427                                    "multiple values for annotations",
12428                                ));
12429                            }
12430                            result.annotations = map
12431                                .next_value::<std::option::Option<
12432                                    std::collections::HashMap<
12433                                        std::string::String,
12434                                        std::string::String,
12435                                    >,
12436                                >>()?
12437                                .unwrap_or_default();
12438                        }
12439                        __FieldTag::__etag => {
12440                            if !fields.insert(__FieldTag::__etag) {
12441                                return std::result::Result::Err(A::Error::duplicate_field(
12442                                    "multiple values for etag",
12443                                ));
12444                            }
12445                            result.etag = map
12446                                .next_value::<std::option::Option<std::string::String>>()?
12447                                .unwrap_or_default();
12448                        }
12449                        __FieldTag::__labels => {
12450                            if !fields.insert(__FieldTag::__labels) {
12451                                return std::result::Result::Err(A::Error::duplicate_field(
12452                                    "multiple values for labels",
12453                                ));
12454                            }
12455                            result.labels = map
12456                                .next_value::<std::option::Option<
12457                                    std::collections::HashMap<
12458                                        std::string::String,
12459                                        std::string::String,
12460                                    >,
12461                                >>()?
12462                                .unwrap_or_default();
12463                        }
12464                        __FieldTag::__oauth_start_uri => {
12465                            if !fields.insert(__FieldTag::__oauth_start_uri) {
12466                                return std::result::Result::Err(A::Error::duplicate_field(
12467                                    "multiple values for oauth_start_uri",
12468                                ));
12469                            }
12470                            result.oauth_start_uri = map
12471                                .next_value::<std::option::Option<std::string::String>>()?
12472                                .unwrap_or_default();
12473                        }
12474                        __FieldTag::Unknown(key) => {
12475                            let value = map.next_value::<serde_json::Value>()?;
12476                            result._unknown_fields.insert(key, value);
12477                        }
12478                    }
12479                }
12480                std::result::Result::Ok(result)
12481            }
12482        }
12483        deserializer.deserialize_any(Visitor)
12484    }
12485}
12486
12487#[doc(hidden)]
12488impl serde::ser::Serialize for AccountConnector {
12489    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12490    where
12491        S: serde::ser::Serializer,
12492    {
12493        use serde::ser::SerializeMap;
12494        #[allow(unused_imports)]
12495        use std::option::Option::Some;
12496        let mut state = serializer.serialize_map(std::option::Option::None)?;
12497        if let Some(value) = self.provider_oauth_config() {
12498            state.serialize_entry("providerOauthConfig", value)?;
12499        }
12500        if !self.name.is_empty() {
12501            state.serialize_entry("name", &self.name)?;
12502        }
12503        if self.create_time.is_some() {
12504            state.serialize_entry("createTime", &self.create_time)?;
12505        }
12506        if self.update_time.is_some() {
12507            state.serialize_entry("updateTime", &self.update_time)?;
12508        }
12509        if !self.annotations.is_empty() {
12510            state.serialize_entry("annotations", &self.annotations)?;
12511        }
12512        if !self.etag.is_empty() {
12513            state.serialize_entry("etag", &self.etag)?;
12514        }
12515        if !self.labels.is_empty() {
12516            state.serialize_entry("labels", &self.labels)?;
12517        }
12518        if !self.oauth_start_uri.is_empty() {
12519            state.serialize_entry("oauthStartUri", &self.oauth_start_uri)?;
12520        }
12521        if !self._unknown_fields.is_empty() {
12522            for (key, value) in self._unknown_fields.iter() {
12523                state.serialize_entry(key, &value)?;
12524            }
12525        }
12526        state.end()
12527    }
12528}
12529
12530/// Defines additional types related to [AccountConnector].
12531pub mod account_connector {
12532    #[allow(unused_imports)]
12533    use super::*;
12534
12535    /// The AccountConnector config.
12536    #[derive(Clone, Debug, PartialEq)]
12537    #[non_exhaustive]
12538    pub enum AccountConnectorConfig {
12539        /// Provider OAuth config.
12540        ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
12541    }
12542}
12543
12544/// User represents a user connected to the service providers through
12545/// a AccountConnector.
12546#[derive(Clone, Debug, Default, PartialEq)]
12547#[non_exhaustive]
12548pub struct User {
12549    /// Identifier. Resource name of the user, in the format
12550    /// `projects/*/locations/*/accountConnectors/*/users/*`.
12551    pub name: std::string::String,
12552
12553    /// Output only. Developer Connect automatically converts user identity
12554    /// to some human readable description, e.g., email address.
12555    pub display_name: std::string::String,
12556
12557    /// Output only. The timestamp when the user was created.
12558    pub create_time: std::option::Option<wkt::Timestamp>,
12559
12560    /// Output only. The timestamp when the token was last requested.
12561    pub last_token_request_time: std::option::Option<wkt::Timestamp>,
12562
12563    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12564}
12565
12566impl User {
12567    pub fn new() -> Self {
12568        std::default::Default::default()
12569    }
12570
12571    /// Sets the value of [name][crate::model::User::name].
12572    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12573        self.name = v.into();
12574        self
12575    }
12576
12577    /// Sets the value of [display_name][crate::model::User::display_name].
12578    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12579        self.display_name = v.into();
12580        self
12581    }
12582
12583    /// Sets the value of [create_time][crate::model::User::create_time].
12584    pub fn set_create_time<T>(mut self, v: T) -> Self
12585    where
12586        T: std::convert::Into<wkt::Timestamp>,
12587    {
12588        self.create_time = std::option::Option::Some(v.into());
12589        self
12590    }
12591
12592    /// Sets or clears the value of [create_time][crate::model::User::create_time].
12593    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12594    where
12595        T: std::convert::Into<wkt::Timestamp>,
12596    {
12597        self.create_time = v.map(|x| x.into());
12598        self
12599    }
12600
12601    /// Sets the value of [last_token_request_time][crate::model::User::last_token_request_time].
12602    pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
12603    where
12604        T: std::convert::Into<wkt::Timestamp>,
12605    {
12606        self.last_token_request_time = std::option::Option::Some(v.into());
12607        self
12608    }
12609
12610    /// Sets or clears the value of [last_token_request_time][crate::model::User::last_token_request_time].
12611    pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
12612    where
12613        T: std::convert::Into<wkt::Timestamp>,
12614    {
12615        self.last_token_request_time = v.map(|x| x.into());
12616        self
12617    }
12618}
12619
12620impl wkt::message::Message for User {
12621    fn typename() -> &'static str {
12622        "type.googleapis.com/google.cloud.developerconnect.v1.User"
12623    }
12624}
12625
12626#[doc(hidden)]
12627impl<'de> serde::de::Deserialize<'de> for User {
12628    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12629    where
12630        D: serde::Deserializer<'de>,
12631    {
12632        #[allow(non_camel_case_types)]
12633        #[doc(hidden)]
12634        #[derive(PartialEq, Eq, Hash)]
12635        enum __FieldTag {
12636            __name,
12637            __display_name,
12638            __create_time,
12639            __last_token_request_time,
12640            Unknown(std::string::String),
12641        }
12642        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12643            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12644            where
12645                D: serde::Deserializer<'de>,
12646            {
12647                struct Visitor;
12648                impl<'de> serde::de::Visitor<'de> for Visitor {
12649                    type Value = __FieldTag;
12650                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12651                        formatter.write_str("a field name for User")
12652                    }
12653                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12654                    where
12655                        E: serde::de::Error,
12656                    {
12657                        use std::result::Result::Ok;
12658                        use std::string::ToString;
12659                        match value {
12660                            "name" => Ok(__FieldTag::__name),
12661                            "displayName" => Ok(__FieldTag::__display_name),
12662                            "display_name" => Ok(__FieldTag::__display_name),
12663                            "createTime" => Ok(__FieldTag::__create_time),
12664                            "create_time" => Ok(__FieldTag::__create_time),
12665                            "lastTokenRequestTime" => Ok(__FieldTag::__last_token_request_time),
12666                            "last_token_request_time" => Ok(__FieldTag::__last_token_request_time),
12667                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12668                        }
12669                    }
12670                }
12671                deserializer.deserialize_identifier(Visitor)
12672            }
12673        }
12674        struct Visitor;
12675        impl<'de> serde::de::Visitor<'de> for Visitor {
12676            type Value = User;
12677            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12678                formatter.write_str("struct User")
12679            }
12680            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12681            where
12682                A: serde::de::MapAccess<'de>,
12683            {
12684                #[allow(unused_imports)]
12685                use serde::de::Error;
12686                use std::option::Option::Some;
12687                let mut fields = std::collections::HashSet::new();
12688                let mut result = Self::Value::new();
12689                while let Some(tag) = map.next_key::<__FieldTag>()? {
12690                    #[allow(clippy::match_single_binding)]
12691                    match tag {
12692                        __FieldTag::__name => {
12693                            if !fields.insert(__FieldTag::__name) {
12694                                return std::result::Result::Err(A::Error::duplicate_field(
12695                                    "multiple values for name",
12696                                ));
12697                            }
12698                            result.name = map
12699                                .next_value::<std::option::Option<std::string::String>>()?
12700                                .unwrap_or_default();
12701                        }
12702                        __FieldTag::__display_name => {
12703                            if !fields.insert(__FieldTag::__display_name) {
12704                                return std::result::Result::Err(A::Error::duplicate_field(
12705                                    "multiple values for display_name",
12706                                ));
12707                            }
12708                            result.display_name = map
12709                                .next_value::<std::option::Option<std::string::String>>()?
12710                                .unwrap_or_default();
12711                        }
12712                        __FieldTag::__create_time => {
12713                            if !fields.insert(__FieldTag::__create_time) {
12714                                return std::result::Result::Err(A::Error::duplicate_field(
12715                                    "multiple values for create_time",
12716                                ));
12717                            }
12718                            result.create_time =
12719                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
12720                        }
12721                        __FieldTag::__last_token_request_time => {
12722                            if !fields.insert(__FieldTag::__last_token_request_time) {
12723                                return std::result::Result::Err(A::Error::duplicate_field(
12724                                    "multiple values for last_token_request_time",
12725                                ));
12726                            }
12727                            result.last_token_request_time =
12728                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
12729                        }
12730                        __FieldTag::Unknown(key) => {
12731                            let value = map.next_value::<serde_json::Value>()?;
12732                            result._unknown_fields.insert(key, value);
12733                        }
12734                    }
12735                }
12736                std::result::Result::Ok(result)
12737            }
12738        }
12739        deserializer.deserialize_any(Visitor)
12740    }
12741}
12742
12743#[doc(hidden)]
12744impl serde::ser::Serialize for User {
12745    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12746    where
12747        S: serde::ser::Serializer,
12748    {
12749        use serde::ser::SerializeMap;
12750        #[allow(unused_imports)]
12751        use std::option::Option::Some;
12752        let mut state = serializer.serialize_map(std::option::Option::None)?;
12753        if !self.name.is_empty() {
12754            state.serialize_entry("name", &self.name)?;
12755        }
12756        if !self.display_name.is_empty() {
12757            state.serialize_entry("displayName", &self.display_name)?;
12758        }
12759        if self.create_time.is_some() {
12760            state.serialize_entry("createTime", &self.create_time)?;
12761        }
12762        if self.last_token_request_time.is_some() {
12763            state.serialize_entry("lastTokenRequestTime", &self.last_token_request_time)?;
12764        }
12765        if !self._unknown_fields.is_empty() {
12766            for (key, value) in self._unknown_fields.iter() {
12767                state.serialize_entry(key, &value)?;
12768            }
12769        }
12770        state.end()
12771    }
12772}
12773
12774/// ProviderOAuthConfig is the OAuth config for a provider.
12775#[derive(Clone, Debug, Default, PartialEq)]
12776#[non_exhaustive]
12777pub struct ProviderOAuthConfig {
12778    /// Required. User selected scopes to apply to the Oauth config
12779    /// In the event of changing scopes, user records under AccountConnector will
12780    /// be deleted and users will re-auth again.
12781    pub scopes: std::vec::Vec<std::string::String>,
12782
12783    /// OAuth Provider ID. It could be Developer Connect owned or providers
12784    /// provided.
12785    pub oauth_provider_id:
12786        std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
12787
12788    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12789}
12790
12791impl ProviderOAuthConfig {
12792    pub fn new() -> Self {
12793        std::default::Default::default()
12794    }
12795
12796    /// Sets the value of [scopes][crate::model::ProviderOAuthConfig::scopes].
12797    pub fn set_scopes<T, V>(mut self, v: T) -> Self
12798    where
12799        T: std::iter::IntoIterator<Item = V>,
12800        V: std::convert::Into<std::string::String>,
12801    {
12802        use std::iter::Iterator;
12803        self.scopes = v.into_iter().map(|i| i.into()).collect();
12804        self
12805    }
12806
12807    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id].
12808    ///
12809    /// Note that all the setters affecting `oauth_provider_id` are mutually
12810    /// exclusive.
12811    pub fn set_oauth_provider_id<
12812        T: std::convert::Into<
12813                std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
12814            >,
12815    >(
12816        mut self,
12817        v: T,
12818    ) -> Self {
12819        self.oauth_provider_id = v.into();
12820        self
12821    }
12822
12823    /// The value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
12824    /// if it holds a `SystemProviderId`, `None` if the field is not set or
12825    /// holds a different branch.
12826    pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
12827        #[allow(unreachable_patterns)]
12828        self.oauth_provider_id.as_ref().and_then(|v| match v {
12829            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
12830                std::option::Option::Some(v)
12831            }
12832            _ => std::option::Option::None,
12833        })
12834    }
12835
12836    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
12837    /// to hold a `SystemProviderId`.
12838    ///
12839    /// Note that all the setters affecting `oauth_provider_id` are
12840    /// mutually exclusive.
12841    pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
12842        mut self,
12843        v: T,
12844    ) -> Self {
12845        self.oauth_provider_id = std::option::Option::Some(
12846            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
12847        );
12848        self
12849    }
12850}
12851
12852impl wkt::message::Message for ProviderOAuthConfig {
12853    fn typename() -> &'static str {
12854        "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
12855    }
12856}
12857
12858#[doc(hidden)]
12859impl<'de> serde::de::Deserialize<'de> for ProviderOAuthConfig {
12860    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12861    where
12862        D: serde::Deserializer<'de>,
12863    {
12864        #[allow(non_camel_case_types)]
12865        #[doc(hidden)]
12866        #[derive(PartialEq, Eq, Hash)]
12867        enum __FieldTag {
12868            __system_provider_id,
12869            __scopes,
12870            Unknown(std::string::String),
12871        }
12872        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12873            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12874            where
12875                D: serde::Deserializer<'de>,
12876            {
12877                struct Visitor;
12878                impl<'de> serde::de::Visitor<'de> for Visitor {
12879                    type Value = __FieldTag;
12880                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12881                        formatter.write_str("a field name for ProviderOAuthConfig")
12882                    }
12883                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12884                    where
12885                        E: serde::de::Error,
12886                    {
12887                        use std::result::Result::Ok;
12888                        use std::string::ToString;
12889                        match value {
12890                            "systemProviderId" => Ok(__FieldTag::__system_provider_id),
12891                            "system_provider_id" => Ok(__FieldTag::__system_provider_id),
12892                            "scopes" => Ok(__FieldTag::__scopes),
12893                            _ => Ok(__FieldTag::Unknown(value.to_string())),
12894                        }
12895                    }
12896                }
12897                deserializer.deserialize_identifier(Visitor)
12898            }
12899        }
12900        struct Visitor;
12901        impl<'de> serde::de::Visitor<'de> for Visitor {
12902            type Value = ProviderOAuthConfig;
12903            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12904                formatter.write_str("struct ProviderOAuthConfig")
12905            }
12906            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12907            where
12908                A: serde::de::MapAccess<'de>,
12909            {
12910                #[allow(unused_imports)]
12911                use serde::de::Error;
12912                use std::option::Option::Some;
12913                let mut fields = std::collections::HashSet::new();
12914                let mut result = Self::Value::new();
12915                while let Some(tag) = map.next_key::<__FieldTag>()? {
12916                    #[allow(clippy::match_single_binding)]
12917                    match tag {
12918                        __FieldTag::__system_provider_id => {
12919                            if !fields.insert(__FieldTag::__system_provider_id) {
12920                                return std::result::Result::Err(A::Error::duplicate_field(
12921                                    "multiple values for system_provider_id",
12922                                ));
12923                            }
12924                            if result.oauth_provider_id.is_some() {
12925                                return std::result::Result::Err(A::Error::duplicate_field(
12926                                    "multiple values for `oauth_provider_id`, a oneof with full ID .google.cloud.developerconnect.v1.ProviderOAuthConfig.system_provider_id, latest field was systemProviderId",
12927                                ));
12928                            }
12929                            result.oauth_provider_id = std::option::Option::Some(
12930                                crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(
12931                                    map.next_value::<std::option::Option<crate::model::SystemProvider>>()?.unwrap_or_default()
12932                                ),
12933                            );
12934                        }
12935                        __FieldTag::__scopes => {
12936                            if !fields.insert(__FieldTag::__scopes) {
12937                                return std::result::Result::Err(A::Error::duplicate_field(
12938                                    "multiple values for scopes",
12939                                ));
12940                            }
12941                            result.scopes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
12942                        }
12943                        __FieldTag::Unknown(key) => {
12944                            let value = map.next_value::<serde_json::Value>()?;
12945                            result._unknown_fields.insert(key, value);
12946                        }
12947                    }
12948                }
12949                std::result::Result::Ok(result)
12950            }
12951        }
12952        deserializer.deserialize_any(Visitor)
12953    }
12954}
12955
12956#[doc(hidden)]
12957impl serde::ser::Serialize for ProviderOAuthConfig {
12958    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12959    where
12960        S: serde::ser::Serializer,
12961    {
12962        use serde::ser::SerializeMap;
12963        #[allow(unused_imports)]
12964        use std::option::Option::Some;
12965        let mut state = serializer.serialize_map(std::option::Option::None)?;
12966        if let Some(value) = self.system_provider_id() {
12967            state.serialize_entry("systemProviderId", value)?;
12968        }
12969        if !self.scopes.is_empty() {
12970            state.serialize_entry("scopes", &self.scopes)?;
12971        }
12972        if !self._unknown_fields.is_empty() {
12973            for (key, value) in self._unknown_fields.iter() {
12974                state.serialize_entry(key, &value)?;
12975            }
12976        }
12977        state.end()
12978    }
12979}
12980
12981/// Defines additional types related to [ProviderOAuthConfig].
12982pub mod provider_o_auth_config {
12983    #[allow(unused_imports)]
12984    use super::*;
12985
12986    /// OAuth Provider ID. It could be Developer Connect owned or providers
12987    /// provided.
12988    #[derive(Clone, Debug, PartialEq)]
12989    #[non_exhaustive]
12990    pub enum OauthProviderId {
12991        /// Immutable. Developer Connect provided OAuth.
12992        SystemProviderId(crate::model::SystemProvider),
12993    }
12994}
12995
12996/// The InsightsConfig resource is the core configuration object to capture
12997/// events from your Software Development Lifecycle. It acts as the central hub
12998/// for managing how Developer connect understands your application, its runtime
12999/// environments, and the artifacts deployed within them.
13000#[derive(Clone, Debug, Default, PartialEq)]
13001#[non_exhaustive]
13002pub struct InsightsConfig {
13003    /// Identifier. The name of the InsightsConfig.
13004    /// Format:
13005    /// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
13006    pub name: std::string::String,
13007
13008    /// Output only. [Output only] Create timestamp
13009    pub create_time: std::option::Option<wkt::Timestamp>,
13010
13011    /// Output only. [Output only] Update timestamp
13012    pub update_time: std::option::Option<wkt::Timestamp>,
13013
13014    /// Output only. The runtime configurations where the application is deployed.
13015    pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
13016
13017    /// Optional. The artifact configurations of the artifacts that are deployed.
13018    pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
13019
13020    /// Optional. Output only. The state of the InsightsConfig.
13021    pub state: crate::model::insights_config::State,
13022
13023    /// Optional. User specified annotations. See
13024    /// <https://google.aip.dev/148#annotations> for more details such as format and
13025    /// size limitations.
13026    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
13027
13028    /// Optional. Set of labels associated with an InsightsConfig.
13029    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13030
13031    /// Output only. Reconciling (<https://google.aip.dev/128#reconciliation>).
13032    /// Set to true if the current state of InsightsConfig does not match the
13033    /// user's intended state, and the service is actively updating the resource to
13034    /// reconcile them. This can happen due to user-triggered updates or
13035    /// system actions like failover or maintenance.
13036    pub reconciling: bool,
13037
13038    /// Output only. Any errors that occurred while setting up the InsightsConfig.
13039    /// Each error will be in the format: `field_name: error_message`, e.g.
13040    /// GetAppHubApplication: Permission denied while getting App Hub
13041    /// application. Please grant permissions to the P4SA.
13042    pub errors: std::vec::Vec<rpc::model::Status>,
13043
13044    /// The context of the InsightsConfig.
13045    pub insights_config_context:
13046        std::option::Option<crate::model::insights_config::InsightsConfigContext>,
13047
13048    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13049}
13050
13051impl InsightsConfig {
13052    pub fn new() -> Self {
13053        std::default::Default::default()
13054    }
13055
13056    /// Sets the value of [name][crate::model::InsightsConfig::name].
13057    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13058        self.name = v.into();
13059        self
13060    }
13061
13062    /// Sets the value of [create_time][crate::model::InsightsConfig::create_time].
13063    pub fn set_create_time<T>(mut self, v: T) -> Self
13064    where
13065        T: std::convert::Into<wkt::Timestamp>,
13066    {
13067        self.create_time = std::option::Option::Some(v.into());
13068        self
13069    }
13070
13071    /// Sets or clears the value of [create_time][crate::model::InsightsConfig::create_time].
13072    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13073    where
13074        T: std::convert::Into<wkt::Timestamp>,
13075    {
13076        self.create_time = v.map(|x| x.into());
13077        self
13078    }
13079
13080    /// Sets the value of [update_time][crate::model::InsightsConfig::update_time].
13081    pub fn set_update_time<T>(mut self, v: T) -> Self
13082    where
13083        T: std::convert::Into<wkt::Timestamp>,
13084    {
13085        self.update_time = std::option::Option::Some(v.into());
13086        self
13087    }
13088
13089    /// Sets or clears the value of [update_time][crate::model::InsightsConfig::update_time].
13090    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13091    where
13092        T: std::convert::Into<wkt::Timestamp>,
13093    {
13094        self.update_time = v.map(|x| x.into());
13095        self
13096    }
13097
13098    /// Sets the value of [runtime_configs][crate::model::InsightsConfig::runtime_configs].
13099    pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
13100    where
13101        T: std::iter::IntoIterator<Item = V>,
13102        V: std::convert::Into<crate::model::RuntimeConfig>,
13103    {
13104        use std::iter::Iterator;
13105        self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
13106        self
13107    }
13108
13109    /// Sets the value of [artifact_configs][crate::model::InsightsConfig::artifact_configs].
13110    pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
13111    where
13112        T: std::iter::IntoIterator<Item = V>,
13113        V: std::convert::Into<crate::model::ArtifactConfig>,
13114    {
13115        use std::iter::Iterator;
13116        self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
13117        self
13118    }
13119
13120    /// Sets the value of [state][crate::model::InsightsConfig::state].
13121    pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
13122        mut self,
13123        v: T,
13124    ) -> Self {
13125        self.state = v.into();
13126        self
13127    }
13128
13129    /// Sets the value of [annotations][crate::model::InsightsConfig::annotations].
13130    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
13131    where
13132        T: std::iter::IntoIterator<Item = (K, V)>,
13133        K: std::convert::Into<std::string::String>,
13134        V: std::convert::Into<std::string::String>,
13135    {
13136        use std::iter::Iterator;
13137        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13138        self
13139    }
13140
13141    /// Sets the value of [labels][crate::model::InsightsConfig::labels].
13142    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13143    where
13144        T: std::iter::IntoIterator<Item = (K, V)>,
13145        K: std::convert::Into<std::string::String>,
13146        V: std::convert::Into<std::string::String>,
13147    {
13148        use std::iter::Iterator;
13149        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13150        self
13151    }
13152
13153    /// Sets the value of [reconciling][crate::model::InsightsConfig::reconciling].
13154    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13155        self.reconciling = v.into();
13156        self
13157    }
13158
13159    /// Sets the value of [errors][crate::model::InsightsConfig::errors].
13160    pub fn set_errors<T, V>(mut self, v: T) -> Self
13161    where
13162        T: std::iter::IntoIterator<Item = V>,
13163        V: std::convert::Into<rpc::model::Status>,
13164    {
13165        use std::iter::Iterator;
13166        self.errors = v.into_iter().map(|i| i.into()).collect();
13167        self
13168    }
13169
13170    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context].
13171    ///
13172    /// Note that all the setters affecting `insights_config_context` are mutually
13173    /// exclusive.
13174    pub fn set_insights_config_context<
13175        T: std::convert::Into<
13176                std::option::Option<crate::model::insights_config::InsightsConfigContext>,
13177            >,
13178    >(
13179        mut self,
13180        v: T,
13181    ) -> Self {
13182        self.insights_config_context = v.into();
13183        self
13184    }
13185
13186    /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
13187    /// if it holds a `AppHubApplication`, `None` if the field is not set or
13188    /// holds a different branch.
13189    pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
13190        #[allow(unreachable_patterns)]
13191        self.insights_config_context.as_ref().and_then(|v| match v {
13192            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
13193                std::option::Option::Some(v)
13194            }
13195            _ => std::option::Option::None,
13196        })
13197    }
13198
13199    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
13200    /// to hold a `AppHubApplication`.
13201    ///
13202    /// Note that all the setters affecting `insights_config_context` are
13203    /// mutually exclusive.
13204    pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
13205        mut self,
13206        v: T,
13207    ) -> Self {
13208        self.insights_config_context = std::option::Option::Some(
13209            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
13210        );
13211        self
13212    }
13213}
13214
13215impl wkt::message::Message for InsightsConfig {
13216    fn typename() -> &'static str {
13217        "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
13218    }
13219}
13220
13221#[doc(hidden)]
13222impl<'de> serde::de::Deserialize<'de> for InsightsConfig {
13223    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13224    where
13225        D: serde::Deserializer<'de>,
13226    {
13227        #[allow(non_camel_case_types)]
13228        #[doc(hidden)]
13229        #[derive(PartialEq, Eq, Hash)]
13230        enum __FieldTag {
13231            __app_hub_application,
13232            __name,
13233            __create_time,
13234            __update_time,
13235            __runtime_configs,
13236            __artifact_configs,
13237            __state,
13238            __annotations,
13239            __labels,
13240            __reconciling,
13241            __errors,
13242            Unknown(std::string::String),
13243        }
13244        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13245            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13246            where
13247                D: serde::Deserializer<'de>,
13248            {
13249                struct Visitor;
13250                impl<'de> serde::de::Visitor<'de> for Visitor {
13251                    type Value = __FieldTag;
13252                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13253                        formatter.write_str("a field name for InsightsConfig")
13254                    }
13255                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13256                    where
13257                        E: serde::de::Error,
13258                    {
13259                        use std::result::Result::Ok;
13260                        use std::string::ToString;
13261                        match value {
13262                            "appHubApplication" => Ok(__FieldTag::__app_hub_application),
13263                            "app_hub_application" => Ok(__FieldTag::__app_hub_application),
13264                            "name" => Ok(__FieldTag::__name),
13265                            "createTime" => Ok(__FieldTag::__create_time),
13266                            "create_time" => Ok(__FieldTag::__create_time),
13267                            "updateTime" => Ok(__FieldTag::__update_time),
13268                            "update_time" => Ok(__FieldTag::__update_time),
13269                            "runtimeConfigs" => Ok(__FieldTag::__runtime_configs),
13270                            "runtime_configs" => Ok(__FieldTag::__runtime_configs),
13271                            "artifactConfigs" => Ok(__FieldTag::__artifact_configs),
13272                            "artifact_configs" => Ok(__FieldTag::__artifact_configs),
13273                            "state" => Ok(__FieldTag::__state),
13274                            "annotations" => Ok(__FieldTag::__annotations),
13275                            "labels" => Ok(__FieldTag::__labels),
13276                            "reconciling" => Ok(__FieldTag::__reconciling),
13277                            "errors" => Ok(__FieldTag::__errors),
13278                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13279                        }
13280                    }
13281                }
13282                deserializer.deserialize_identifier(Visitor)
13283            }
13284        }
13285        struct Visitor;
13286        impl<'de> serde::de::Visitor<'de> for Visitor {
13287            type Value = InsightsConfig;
13288            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13289                formatter.write_str("struct InsightsConfig")
13290            }
13291            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13292            where
13293                A: serde::de::MapAccess<'de>,
13294            {
13295                #[allow(unused_imports)]
13296                use serde::de::Error;
13297                use std::option::Option::Some;
13298                let mut fields = std::collections::HashSet::new();
13299                let mut result = Self::Value::new();
13300                while let Some(tag) = map.next_key::<__FieldTag>()? {
13301                    #[allow(clippy::match_single_binding)]
13302                    match tag {
13303                        __FieldTag::__app_hub_application => {
13304                            if !fields.insert(__FieldTag::__app_hub_application) {
13305                                return std::result::Result::Err(A::Error::duplicate_field(
13306                                    "multiple values for app_hub_application",
13307                                ));
13308                            }
13309                            if result.insights_config_context.is_some() {
13310                                return std::result::Result::Err(A::Error::duplicate_field(
13311                                    "multiple values for `insights_config_context`, a oneof with full ID .google.cloud.developerconnect.v1.InsightsConfig.app_hub_application, latest field was appHubApplication",
13312                                ));
13313                            }
13314                            result.insights_config_context = std::option::Option::Some(
13315                                crate::model::insights_config::InsightsConfigContext::AppHubApplication(
13316                                    map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
13317                                ),
13318                            );
13319                        }
13320                        __FieldTag::__name => {
13321                            if !fields.insert(__FieldTag::__name) {
13322                                return std::result::Result::Err(A::Error::duplicate_field(
13323                                    "multiple values for name",
13324                                ));
13325                            }
13326                            result.name = map
13327                                .next_value::<std::option::Option<std::string::String>>()?
13328                                .unwrap_or_default();
13329                        }
13330                        __FieldTag::__create_time => {
13331                            if !fields.insert(__FieldTag::__create_time) {
13332                                return std::result::Result::Err(A::Error::duplicate_field(
13333                                    "multiple values for create_time",
13334                                ));
13335                            }
13336                            result.create_time =
13337                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
13338                        }
13339                        __FieldTag::__update_time => {
13340                            if !fields.insert(__FieldTag::__update_time) {
13341                                return std::result::Result::Err(A::Error::duplicate_field(
13342                                    "multiple values for update_time",
13343                                ));
13344                            }
13345                            result.update_time =
13346                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
13347                        }
13348                        __FieldTag::__runtime_configs => {
13349                            if !fields.insert(__FieldTag::__runtime_configs) {
13350                                return std::result::Result::Err(A::Error::duplicate_field(
13351                                    "multiple values for runtime_configs",
13352                                ));
13353                            }
13354                            result.runtime_configs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::RuntimeConfig>>>()?.unwrap_or_default();
13355                        }
13356                        __FieldTag::__artifact_configs => {
13357                            if !fields.insert(__FieldTag::__artifact_configs) {
13358                                return std::result::Result::Err(A::Error::duplicate_field(
13359                                    "multiple values for artifact_configs",
13360                                ));
13361                            }
13362                            result.artifact_configs =
13363                                map.next_value::<std::option::Option<
13364                                    std::vec::Vec<crate::model::ArtifactConfig>,
13365                                >>()?
13366                                .unwrap_or_default();
13367                        }
13368                        __FieldTag::__state => {
13369                            if !fields.insert(__FieldTag::__state) {
13370                                return std::result::Result::Err(A::Error::duplicate_field(
13371                                    "multiple values for state",
13372                                ));
13373                            }
13374                            result.state = map.next_value::<std::option::Option<crate::model::insights_config::State>>()?.unwrap_or_default();
13375                        }
13376                        __FieldTag::__annotations => {
13377                            if !fields.insert(__FieldTag::__annotations) {
13378                                return std::result::Result::Err(A::Error::duplicate_field(
13379                                    "multiple values for annotations",
13380                                ));
13381                            }
13382                            result.annotations = map
13383                                .next_value::<std::option::Option<
13384                                    std::collections::HashMap<
13385                                        std::string::String,
13386                                        std::string::String,
13387                                    >,
13388                                >>()?
13389                                .unwrap_or_default();
13390                        }
13391                        __FieldTag::__labels => {
13392                            if !fields.insert(__FieldTag::__labels) {
13393                                return std::result::Result::Err(A::Error::duplicate_field(
13394                                    "multiple values for labels",
13395                                ));
13396                            }
13397                            result.labels = map
13398                                .next_value::<std::option::Option<
13399                                    std::collections::HashMap<
13400                                        std::string::String,
13401                                        std::string::String,
13402                                    >,
13403                                >>()?
13404                                .unwrap_or_default();
13405                        }
13406                        __FieldTag::__reconciling => {
13407                            if !fields.insert(__FieldTag::__reconciling) {
13408                                return std::result::Result::Err(A::Error::duplicate_field(
13409                                    "multiple values for reconciling",
13410                                ));
13411                            }
13412                            result.reconciling = map
13413                                .next_value::<std::option::Option<bool>>()?
13414                                .unwrap_or_default();
13415                        }
13416                        __FieldTag::__errors => {
13417                            if !fields.insert(__FieldTag::__errors) {
13418                                return std::result::Result::Err(A::Error::duplicate_field(
13419                                    "multiple values for errors",
13420                                ));
13421                            }
13422                            result.errors = map.next_value::<std::option::Option<std::vec::Vec<rpc::model::Status>>>()?.unwrap_or_default();
13423                        }
13424                        __FieldTag::Unknown(key) => {
13425                            let value = map.next_value::<serde_json::Value>()?;
13426                            result._unknown_fields.insert(key, value);
13427                        }
13428                    }
13429                }
13430                std::result::Result::Ok(result)
13431            }
13432        }
13433        deserializer.deserialize_any(Visitor)
13434    }
13435}
13436
13437#[doc(hidden)]
13438impl serde::ser::Serialize for InsightsConfig {
13439    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13440    where
13441        S: serde::ser::Serializer,
13442    {
13443        use serde::ser::SerializeMap;
13444        #[allow(unused_imports)]
13445        use std::option::Option::Some;
13446        let mut state = serializer.serialize_map(std::option::Option::None)?;
13447        if let Some(value) = self.app_hub_application() {
13448            state.serialize_entry("appHubApplication", value)?;
13449        }
13450        if !self.name.is_empty() {
13451            state.serialize_entry("name", &self.name)?;
13452        }
13453        if self.create_time.is_some() {
13454            state.serialize_entry("createTime", &self.create_time)?;
13455        }
13456        if self.update_time.is_some() {
13457            state.serialize_entry("updateTime", &self.update_time)?;
13458        }
13459        if !self.runtime_configs.is_empty() {
13460            state.serialize_entry("runtimeConfigs", &self.runtime_configs)?;
13461        }
13462        if !self.artifact_configs.is_empty() {
13463            state.serialize_entry("artifactConfigs", &self.artifact_configs)?;
13464        }
13465        if !wkt::internal::is_default(&self.state) {
13466            state.serialize_entry("state", &self.state)?;
13467        }
13468        if !self.annotations.is_empty() {
13469            state.serialize_entry("annotations", &self.annotations)?;
13470        }
13471        if !self.labels.is_empty() {
13472            state.serialize_entry("labels", &self.labels)?;
13473        }
13474        if !wkt::internal::is_default(&self.reconciling) {
13475            state.serialize_entry("reconciling", &self.reconciling)?;
13476        }
13477        if !self.errors.is_empty() {
13478            state.serialize_entry("errors", &self.errors)?;
13479        }
13480        if !self._unknown_fields.is_empty() {
13481            for (key, value) in self._unknown_fields.iter() {
13482                state.serialize_entry(key, &value)?;
13483            }
13484        }
13485        state.end()
13486    }
13487}
13488
13489/// Defines additional types related to [InsightsConfig].
13490pub mod insights_config {
13491    #[allow(unused_imports)]
13492    use super::*;
13493
13494    /// The state of the InsightsConfig.
13495    ///
13496    /// # Working with unknown values
13497    ///
13498    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13499    /// additional enum variants at any time. Adding new variants is not considered
13500    /// a breaking change. Applications should write their code in anticipation of:
13501    ///
13502    /// - New values appearing in future releases of the client library, **and**
13503    /// - New values received dynamically, without application changes.
13504    ///
13505    /// Please consult the [Working with enums] section in the user guide for some
13506    /// guidelines.
13507    ///
13508    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13509    #[derive(Clone, Debug, PartialEq)]
13510    #[non_exhaustive]
13511    pub enum State {
13512        /// No state specified.
13513        Unspecified,
13514        /// The InsightsConfig is pending application discovery/runtime discovery.
13515        Pending,
13516        /// The initial discovery process is complete.
13517        Complete,
13518        /// The InsightsConfig is in an error state.
13519        Error,
13520        /// If set, the enum was initialized with an unknown value.
13521        ///
13522        /// Applications can examine the value using [State::value] or
13523        /// [State::name].
13524        UnknownValue(state::UnknownValue),
13525    }
13526
13527    #[doc(hidden)]
13528    pub mod state {
13529        #[allow(unused_imports)]
13530        use super::*;
13531        #[derive(Clone, Debug, PartialEq)]
13532        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13533    }
13534
13535    impl State {
13536        /// Gets the enum value.
13537        ///
13538        /// Returns `None` if the enum contains an unknown value deserialized from
13539        /// the string representation of enums.
13540        pub fn value(&self) -> std::option::Option<i32> {
13541            match self {
13542                Self::Unspecified => std::option::Option::Some(0),
13543                Self::Pending => std::option::Option::Some(5),
13544                Self::Complete => std::option::Option::Some(3),
13545                Self::Error => std::option::Option::Some(4),
13546                Self::UnknownValue(u) => u.0.value(),
13547            }
13548        }
13549
13550        /// Gets the enum value as a string.
13551        ///
13552        /// Returns `None` if the enum contains an unknown value deserialized from
13553        /// the integer representation of enums.
13554        pub fn name(&self) -> std::option::Option<&str> {
13555            match self {
13556                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13557                Self::Pending => std::option::Option::Some("PENDING"),
13558                Self::Complete => std::option::Option::Some("COMPLETE"),
13559                Self::Error => std::option::Option::Some("ERROR"),
13560                Self::UnknownValue(u) => u.0.name(),
13561            }
13562        }
13563    }
13564
13565    impl std::default::Default for State {
13566        fn default() -> Self {
13567            use std::convert::From;
13568            Self::from(0)
13569        }
13570    }
13571
13572    impl std::fmt::Display for State {
13573        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13574            wkt::internal::display_enum(f, self.name(), self.value())
13575        }
13576    }
13577
13578    impl std::convert::From<i32> for State {
13579        fn from(value: i32) -> Self {
13580            match value {
13581                0 => Self::Unspecified,
13582                3 => Self::Complete,
13583                4 => Self::Error,
13584                5 => Self::Pending,
13585                _ => Self::UnknownValue(state::UnknownValue(
13586                    wkt::internal::UnknownEnumValue::Integer(value),
13587                )),
13588            }
13589        }
13590    }
13591
13592    impl std::convert::From<&str> for State {
13593        fn from(value: &str) -> Self {
13594            use std::string::ToString;
13595            match value {
13596                "STATE_UNSPECIFIED" => Self::Unspecified,
13597                "PENDING" => Self::Pending,
13598                "COMPLETE" => Self::Complete,
13599                "ERROR" => Self::Error,
13600                _ => Self::UnknownValue(state::UnknownValue(
13601                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13602                )),
13603            }
13604        }
13605    }
13606
13607    impl serde::ser::Serialize for State {
13608        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13609        where
13610            S: serde::Serializer,
13611        {
13612            match self {
13613                Self::Unspecified => serializer.serialize_i32(0),
13614                Self::Pending => serializer.serialize_i32(5),
13615                Self::Complete => serializer.serialize_i32(3),
13616                Self::Error => serializer.serialize_i32(4),
13617                Self::UnknownValue(u) => u.0.serialize(serializer),
13618            }
13619        }
13620    }
13621
13622    impl<'de> serde::de::Deserialize<'de> for State {
13623        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13624        where
13625            D: serde::Deserializer<'de>,
13626        {
13627            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13628                ".google.cloud.developerconnect.v1.InsightsConfig.State",
13629            ))
13630        }
13631    }
13632
13633    /// The context of the InsightsConfig.
13634    #[derive(Clone, Debug, PartialEq)]
13635    #[non_exhaustive]
13636    pub enum InsightsConfigContext {
13637        /// Optional. The name of the App Hub Application.
13638        /// Format:
13639        /// projects/{project}/locations/{location}/applications/{application}
13640        AppHubApplication(std::string::String),
13641    }
13642}
13643
13644/// RuntimeConfig represents the runtimes where the application is
13645/// deployed.
13646#[derive(Clone, Debug, Default, PartialEq)]
13647#[non_exhaustive]
13648pub struct RuntimeConfig {
13649    /// Required. Immutable. The URI of the runtime configuration.
13650    /// For GKE, this is the cluster name.
13651    /// For Cloud Run, this is the service name.
13652    pub uri: std::string::String,
13653
13654    /// Output only. The state of the Runtime.
13655    pub state: crate::model::runtime_config::State,
13656
13657    /// The type of the runtime.
13658    pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
13659
13660    /// Where the runtime is derived from.
13661    pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
13662
13663    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13664}
13665
13666impl RuntimeConfig {
13667    pub fn new() -> Self {
13668        std::default::Default::default()
13669    }
13670
13671    /// Sets the value of [uri][crate::model::RuntimeConfig::uri].
13672    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13673        self.uri = v.into();
13674        self
13675    }
13676
13677    /// Sets the value of [state][crate::model::RuntimeConfig::state].
13678    pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
13679        mut self,
13680        v: T,
13681    ) -> Self {
13682        self.state = v.into();
13683        self
13684    }
13685
13686    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime].
13687    ///
13688    /// Note that all the setters affecting `runtime` are mutually
13689    /// exclusive.
13690    pub fn set_runtime<
13691        T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
13692    >(
13693        mut self,
13694        v: T,
13695    ) -> Self {
13696        self.runtime = v.into();
13697        self
13698    }
13699
13700    /// The value of [runtime][crate::model::RuntimeConfig::runtime]
13701    /// if it holds a `GkeWorkload`, `None` if the field is not set or
13702    /// holds a different branch.
13703    pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
13704        #[allow(unreachable_patterns)]
13705        self.runtime.as_ref().and_then(|v| match v {
13706            crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
13707            _ => std::option::Option::None,
13708        })
13709    }
13710
13711    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
13712    /// to hold a `GkeWorkload`.
13713    ///
13714    /// Note that all the setters affecting `runtime` are
13715    /// mutually exclusive.
13716    pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
13717        mut self,
13718        v: T,
13719    ) -> Self {
13720        self.runtime =
13721            std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
13722        self
13723    }
13724
13725    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from].
13726    ///
13727    /// Note that all the setters affecting `derived_from` are mutually
13728    /// exclusive.
13729    pub fn set_derived_from<
13730        T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
13731    >(
13732        mut self,
13733        v: T,
13734    ) -> Self {
13735        self.derived_from = v.into();
13736        self
13737    }
13738
13739    /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
13740    /// if it holds a `AppHubWorkload`, `None` if the field is not set or
13741    /// holds a different branch.
13742    pub fn app_hub_workload(
13743        &self,
13744    ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
13745        #[allow(unreachable_patterns)]
13746        self.derived_from.as_ref().and_then(|v| match v {
13747            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
13748                std::option::Option::Some(v)
13749            }
13750            _ => std::option::Option::None,
13751        })
13752    }
13753
13754    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
13755    /// to hold a `AppHubWorkload`.
13756    ///
13757    /// Note that all the setters affecting `derived_from` are
13758    /// mutually exclusive.
13759    pub fn set_app_hub_workload<
13760        T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
13761    >(
13762        mut self,
13763        v: T,
13764    ) -> Self {
13765        self.derived_from = std::option::Option::Some(
13766            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
13767        );
13768        self
13769    }
13770}
13771
13772impl wkt::message::Message for RuntimeConfig {
13773    fn typename() -> &'static str {
13774        "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
13775    }
13776}
13777
13778#[doc(hidden)]
13779impl<'de> serde::de::Deserialize<'de> for RuntimeConfig {
13780    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13781    where
13782        D: serde::Deserializer<'de>,
13783    {
13784        #[allow(non_camel_case_types)]
13785        #[doc(hidden)]
13786        #[derive(PartialEq, Eq, Hash)]
13787        enum __FieldTag {
13788            __gke_workload,
13789            __app_hub_workload,
13790            __uri,
13791            __state,
13792            Unknown(std::string::String),
13793        }
13794        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13795            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13796            where
13797                D: serde::Deserializer<'de>,
13798            {
13799                struct Visitor;
13800                impl<'de> serde::de::Visitor<'de> for Visitor {
13801                    type Value = __FieldTag;
13802                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13803                        formatter.write_str("a field name for RuntimeConfig")
13804                    }
13805                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13806                    where
13807                        E: serde::de::Error,
13808                    {
13809                        use std::result::Result::Ok;
13810                        use std::string::ToString;
13811                        match value {
13812                            "gkeWorkload" => Ok(__FieldTag::__gke_workload),
13813                            "gke_workload" => Ok(__FieldTag::__gke_workload),
13814                            "appHubWorkload" => Ok(__FieldTag::__app_hub_workload),
13815                            "app_hub_workload" => Ok(__FieldTag::__app_hub_workload),
13816                            "uri" => Ok(__FieldTag::__uri),
13817                            "state" => Ok(__FieldTag::__state),
13818                            _ => Ok(__FieldTag::Unknown(value.to_string())),
13819                        }
13820                    }
13821                }
13822                deserializer.deserialize_identifier(Visitor)
13823            }
13824        }
13825        struct Visitor;
13826        impl<'de> serde::de::Visitor<'de> for Visitor {
13827            type Value = RuntimeConfig;
13828            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13829                formatter.write_str("struct RuntimeConfig")
13830            }
13831            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13832            where
13833                A: serde::de::MapAccess<'de>,
13834            {
13835                #[allow(unused_imports)]
13836                use serde::de::Error;
13837                use std::option::Option::Some;
13838                let mut fields = std::collections::HashSet::new();
13839                let mut result = Self::Value::new();
13840                while let Some(tag) = map.next_key::<__FieldTag>()? {
13841                    #[allow(clippy::match_single_binding)]
13842                    match tag {
13843                        __FieldTag::__gke_workload => {
13844                            if !fields.insert(__FieldTag::__gke_workload) {
13845                                return std::result::Result::Err(A::Error::duplicate_field(
13846                                    "multiple values for gke_workload",
13847                                ));
13848                            }
13849                            if result.runtime.is_some() {
13850                                return std::result::Result::Err(A::Error::duplicate_field(
13851                                    "multiple values for `runtime`, a oneof with full ID .google.cloud.developerconnect.v1.RuntimeConfig.gke_workload, latest field was gkeWorkload",
13852                                ));
13853                            }
13854                            result.runtime = std::option::Option::Some(
13855                                crate::model::runtime_config::Runtime::GkeWorkload(
13856                                    map.next_value::<std::option::Option<
13857                                        std::boxed::Box<crate::model::GKEWorkload>,
13858                                    >>()?
13859                                    .unwrap_or_default(),
13860                                ),
13861                            );
13862                        }
13863                        __FieldTag::__app_hub_workload => {
13864                            if !fields.insert(__FieldTag::__app_hub_workload) {
13865                                return std::result::Result::Err(A::Error::duplicate_field(
13866                                    "multiple values for app_hub_workload",
13867                                ));
13868                            }
13869                            if result.derived_from.is_some() {
13870                                return std::result::Result::Err(A::Error::duplicate_field(
13871                                    "multiple values for `derived_from`, a oneof with full ID .google.cloud.developerconnect.v1.RuntimeConfig.app_hub_workload, latest field was appHubWorkload",
13872                                ));
13873                            }
13874                            result.derived_from = std::option::Option::Some(
13875                                crate::model::runtime_config::DerivedFrom::AppHubWorkload(
13876                                    map.next_value::<std::option::Option<
13877                                        std::boxed::Box<crate::model::AppHubWorkload>,
13878                                    >>()?
13879                                    .unwrap_or_default(),
13880                                ),
13881                            );
13882                        }
13883                        __FieldTag::__uri => {
13884                            if !fields.insert(__FieldTag::__uri) {
13885                                return std::result::Result::Err(A::Error::duplicate_field(
13886                                    "multiple values for uri",
13887                                ));
13888                            }
13889                            result.uri = map
13890                                .next_value::<std::option::Option<std::string::String>>()?
13891                                .unwrap_or_default();
13892                        }
13893                        __FieldTag::__state => {
13894                            if !fields.insert(__FieldTag::__state) {
13895                                return std::result::Result::Err(A::Error::duplicate_field(
13896                                    "multiple values for state",
13897                                ));
13898                            }
13899                            result.state = map.next_value::<std::option::Option<crate::model::runtime_config::State>>()?.unwrap_or_default();
13900                        }
13901                        __FieldTag::Unknown(key) => {
13902                            let value = map.next_value::<serde_json::Value>()?;
13903                            result._unknown_fields.insert(key, value);
13904                        }
13905                    }
13906                }
13907                std::result::Result::Ok(result)
13908            }
13909        }
13910        deserializer.deserialize_any(Visitor)
13911    }
13912}
13913
13914#[doc(hidden)]
13915impl serde::ser::Serialize for RuntimeConfig {
13916    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13917    where
13918        S: serde::ser::Serializer,
13919    {
13920        use serde::ser::SerializeMap;
13921        #[allow(unused_imports)]
13922        use std::option::Option::Some;
13923        let mut state = serializer.serialize_map(std::option::Option::None)?;
13924        if let Some(value) = self.gke_workload() {
13925            state.serialize_entry("gkeWorkload", value)?;
13926        }
13927        if let Some(value) = self.app_hub_workload() {
13928            state.serialize_entry("appHubWorkload", value)?;
13929        }
13930        if !self.uri.is_empty() {
13931            state.serialize_entry("uri", &self.uri)?;
13932        }
13933        if !wkt::internal::is_default(&self.state) {
13934            state.serialize_entry("state", &self.state)?;
13935        }
13936        if !self._unknown_fields.is_empty() {
13937            for (key, value) in self._unknown_fields.iter() {
13938                state.serialize_entry(key, &value)?;
13939            }
13940        }
13941        state.end()
13942    }
13943}
13944
13945/// Defines additional types related to [RuntimeConfig].
13946pub mod runtime_config {
13947    #[allow(unused_imports)]
13948    use super::*;
13949
13950    /// The state of the runtime in the InsightsConfig.
13951    /// Whether the runtime is linked to the InsightsConfig.
13952    ///
13953    /// # Working with unknown values
13954    ///
13955    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13956    /// additional enum variants at any time. Adding new variants is not considered
13957    /// a breaking change. Applications should write their code in anticipation of:
13958    ///
13959    /// - New values appearing in future releases of the client library, **and**
13960    /// - New values received dynamically, without application changes.
13961    ///
13962    /// Please consult the [Working with enums] section in the user guide for some
13963    /// guidelines.
13964    ///
13965    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13966    #[derive(Clone, Debug, PartialEq)]
13967    #[non_exhaustive]
13968    pub enum State {
13969        /// No state specified.
13970        Unspecified,
13971        /// The runtime configuration has been linked to the InsightsConfig.
13972        Linked,
13973        /// The runtime configuration has been unlinked to the InsightsConfig.
13974        Unlinked,
13975        /// If set, the enum was initialized with an unknown value.
13976        ///
13977        /// Applications can examine the value using [State::value] or
13978        /// [State::name].
13979        UnknownValue(state::UnknownValue),
13980    }
13981
13982    #[doc(hidden)]
13983    pub mod state {
13984        #[allow(unused_imports)]
13985        use super::*;
13986        #[derive(Clone, Debug, PartialEq)]
13987        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13988    }
13989
13990    impl State {
13991        /// Gets the enum value.
13992        ///
13993        /// Returns `None` if the enum contains an unknown value deserialized from
13994        /// the string representation of enums.
13995        pub fn value(&self) -> std::option::Option<i32> {
13996            match self {
13997                Self::Unspecified => std::option::Option::Some(0),
13998                Self::Linked => std::option::Option::Some(1),
13999                Self::Unlinked => std::option::Option::Some(2),
14000                Self::UnknownValue(u) => u.0.value(),
14001            }
14002        }
14003
14004        /// Gets the enum value as a string.
14005        ///
14006        /// Returns `None` if the enum contains an unknown value deserialized from
14007        /// the integer representation of enums.
14008        pub fn name(&self) -> std::option::Option<&str> {
14009            match self {
14010                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14011                Self::Linked => std::option::Option::Some("LINKED"),
14012                Self::Unlinked => std::option::Option::Some("UNLINKED"),
14013                Self::UnknownValue(u) => u.0.name(),
14014            }
14015        }
14016    }
14017
14018    impl std::default::Default for State {
14019        fn default() -> Self {
14020            use std::convert::From;
14021            Self::from(0)
14022        }
14023    }
14024
14025    impl std::fmt::Display for State {
14026        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14027            wkt::internal::display_enum(f, self.name(), self.value())
14028        }
14029    }
14030
14031    impl std::convert::From<i32> for State {
14032        fn from(value: i32) -> Self {
14033            match value {
14034                0 => Self::Unspecified,
14035                1 => Self::Linked,
14036                2 => Self::Unlinked,
14037                _ => Self::UnknownValue(state::UnknownValue(
14038                    wkt::internal::UnknownEnumValue::Integer(value),
14039                )),
14040            }
14041        }
14042    }
14043
14044    impl std::convert::From<&str> for State {
14045        fn from(value: &str) -> Self {
14046            use std::string::ToString;
14047            match value {
14048                "STATE_UNSPECIFIED" => Self::Unspecified,
14049                "LINKED" => Self::Linked,
14050                "UNLINKED" => Self::Unlinked,
14051                _ => Self::UnknownValue(state::UnknownValue(
14052                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14053                )),
14054            }
14055        }
14056    }
14057
14058    impl serde::ser::Serialize for State {
14059        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14060        where
14061            S: serde::Serializer,
14062        {
14063            match self {
14064                Self::Unspecified => serializer.serialize_i32(0),
14065                Self::Linked => serializer.serialize_i32(1),
14066                Self::Unlinked => serializer.serialize_i32(2),
14067                Self::UnknownValue(u) => u.0.serialize(serializer),
14068            }
14069        }
14070    }
14071
14072    impl<'de> serde::de::Deserialize<'de> for State {
14073        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14074        where
14075            D: serde::Deserializer<'de>,
14076        {
14077            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14078                ".google.cloud.developerconnect.v1.RuntimeConfig.State",
14079            ))
14080        }
14081    }
14082
14083    /// The type of the runtime.
14084    #[derive(Clone, Debug, PartialEq)]
14085    #[non_exhaustive]
14086    pub enum Runtime {
14087        /// Output only. Google Kubernetes Engine runtime.
14088        GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
14089    }
14090
14091    /// Where the runtime is derived from.
14092    #[derive(Clone, Debug, PartialEq)]
14093    #[non_exhaustive]
14094    pub enum DerivedFrom {
14095        /// Output only. App Hub Workload.
14096        AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
14097    }
14098}
14099
14100/// GKEWorkload represents the Google Kubernetes Engine runtime.
14101#[derive(Clone, Debug, Default, PartialEq)]
14102#[non_exhaustive]
14103pub struct GKEWorkload {
14104    /// Required. Immutable. The name of the GKE cluster.
14105    /// Format:
14106    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
14107    pub cluster: std::string::String,
14108
14109    /// Output only. The name of the GKE deployment.
14110    /// Format:
14111    /// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
14112    pub deployment: std::string::String,
14113
14114    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14115}
14116
14117impl GKEWorkload {
14118    pub fn new() -> Self {
14119        std::default::Default::default()
14120    }
14121
14122    /// Sets the value of [cluster][crate::model::GKEWorkload::cluster].
14123    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14124        self.cluster = v.into();
14125        self
14126    }
14127
14128    /// Sets the value of [deployment][crate::model::GKEWorkload::deployment].
14129    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14130        self.deployment = v.into();
14131        self
14132    }
14133}
14134
14135impl wkt::message::Message for GKEWorkload {
14136    fn typename() -> &'static str {
14137        "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
14138    }
14139}
14140
14141#[doc(hidden)]
14142impl<'de> serde::de::Deserialize<'de> for GKEWorkload {
14143    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14144    where
14145        D: serde::Deserializer<'de>,
14146    {
14147        #[allow(non_camel_case_types)]
14148        #[doc(hidden)]
14149        #[derive(PartialEq, Eq, Hash)]
14150        enum __FieldTag {
14151            __cluster,
14152            __deployment,
14153            Unknown(std::string::String),
14154        }
14155        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14156            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14157            where
14158                D: serde::Deserializer<'de>,
14159            {
14160                struct Visitor;
14161                impl<'de> serde::de::Visitor<'de> for Visitor {
14162                    type Value = __FieldTag;
14163                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14164                        formatter.write_str("a field name for GKEWorkload")
14165                    }
14166                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14167                    where
14168                        E: serde::de::Error,
14169                    {
14170                        use std::result::Result::Ok;
14171                        use std::string::ToString;
14172                        match value {
14173                            "cluster" => Ok(__FieldTag::__cluster),
14174                            "deployment" => Ok(__FieldTag::__deployment),
14175                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14176                        }
14177                    }
14178                }
14179                deserializer.deserialize_identifier(Visitor)
14180            }
14181        }
14182        struct Visitor;
14183        impl<'de> serde::de::Visitor<'de> for Visitor {
14184            type Value = GKEWorkload;
14185            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14186                formatter.write_str("struct GKEWorkload")
14187            }
14188            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14189            where
14190                A: serde::de::MapAccess<'de>,
14191            {
14192                #[allow(unused_imports)]
14193                use serde::de::Error;
14194                use std::option::Option::Some;
14195                let mut fields = std::collections::HashSet::new();
14196                let mut result = Self::Value::new();
14197                while let Some(tag) = map.next_key::<__FieldTag>()? {
14198                    #[allow(clippy::match_single_binding)]
14199                    match tag {
14200                        __FieldTag::__cluster => {
14201                            if !fields.insert(__FieldTag::__cluster) {
14202                                return std::result::Result::Err(A::Error::duplicate_field(
14203                                    "multiple values for cluster",
14204                                ));
14205                            }
14206                            result.cluster = map
14207                                .next_value::<std::option::Option<std::string::String>>()?
14208                                .unwrap_or_default();
14209                        }
14210                        __FieldTag::__deployment => {
14211                            if !fields.insert(__FieldTag::__deployment) {
14212                                return std::result::Result::Err(A::Error::duplicate_field(
14213                                    "multiple values for deployment",
14214                                ));
14215                            }
14216                            result.deployment = map
14217                                .next_value::<std::option::Option<std::string::String>>()?
14218                                .unwrap_or_default();
14219                        }
14220                        __FieldTag::Unknown(key) => {
14221                            let value = map.next_value::<serde_json::Value>()?;
14222                            result._unknown_fields.insert(key, value);
14223                        }
14224                    }
14225                }
14226                std::result::Result::Ok(result)
14227            }
14228        }
14229        deserializer.deserialize_any(Visitor)
14230    }
14231}
14232
14233#[doc(hidden)]
14234impl serde::ser::Serialize for GKEWorkload {
14235    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14236    where
14237        S: serde::ser::Serializer,
14238    {
14239        use serde::ser::SerializeMap;
14240        #[allow(unused_imports)]
14241        use std::option::Option::Some;
14242        let mut state = serializer.serialize_map(std::option::Option::None)?;
14243        if !self.cluster.is_empty() {
14244            state.serialize_entry("cluster", &self.cluster)?;
14245        }
14246        if !self.deployment.is_empty() {
14247            state.serialize_entry("deployment", &self.deployment)?;
14248        }
14249        if !self._unknown_fields.is_empty() {
14250            for (key, value) in self._unknown_fields.iter() {
14251                state.serialize_entry(key, &value)?;
14252            }
14253        }
14254        state.end()
14255    }
14256}
14257
14258/// AppHubWorkload represents the App Hub Workload.
14259#[derive(Clone, Debug, Default, PartialEq)]
14260#[non_exhaustive]
14261pub struct AppHubWorkload {
14262    /// Required. Output only. Immutable. The name of the App Hub Workload.
14263    /// Format:
14264    /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
14265    pub workload: std::string::String,
14266
14267    /// Output only. The criticality of the App Hub Workload.
14268    pub criticality: std::string::String,
14269
14270    /// Output only. The environment of the App Hub Workload.
14271    pub environment: std::string::String,
14272
14273    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14274}
14275
14276impl AppHubWorkload {
14277    pub fn new() -> Self {
14278        std::default::Default::default()
14279    }
14280
14281    /// Sets the value of [workload][crate::model::AppHubWorkload::workload].
14282    pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14283        self.workload = v.into();
14284        self
14285    }
14286
14287    /// Sets the value of [criticality][crate::model::AppHubWorkload::criticality].
14288    pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14289        self.criticality = v.into();
14290        self
14291    }
14292
14293    /// Sets the value of [environment][crate::model::AppHubWorkload::environment].
14294    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14295        self.environment = v.into();
14296        self
14297    }
14298}
14299
14300impl wkt::message::Message for AppHubWorkload {
14301    fn typename() -> &'static str {
14302        "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
14303    }
14304}
14305
14306#[doc(hidden)]
14307impl<'de> serde::de::Deserialize<'de> for AppHubWorkload {
14308    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14309    where
14310        D: serde::Deserializer<'de>,
14311    {
14312        #[allow(non_camel_case_types)]
14313        #[doc(hidden)]
14314        #[derive(PartialEq, Eq, Hash)]
14315        enum __FieldTag {
14316            __workload,
14317            __criticality,
14318            __environment,
14319            Unknown(std::string::String),
14320        }
14321        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14322            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14323            where
14324                D: serde::Deserializer<'de>,
14325            {
14326                struct Visitor;
14327                impl<'de> serde::de::Visitor<'de> for Visitor {
14328                    type Value = __FieldTag;
14329                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14330                        formatter.write_str("a field name for AppHubWorkload")
14331                    }
14332                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14333                    where
14334                        E: serde::de::Error,
14335                    {
14336                        use std::result::Result::Ok;
14337                        use std::string::ToString;
14338                        match value {
14339                            "workload" => Ok(__FieldTag::__workload),
14340                            "criticality" => Ok(__FieldTag::__criticality),
14341                            "environment" => Ok(__FieldTag::__environment),
14342                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14343                        }
14344                    }
14345                }
14346                deserializer.deserialize_identifier(Visitor)
14347            }
14348        }
14349        struct Visitor;
14350        impl<'de> serde::de::Visitor<'de> for Visitor {
14351            type Value = AppHubWorkload;
14352            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14353                formatter.write_str("struct AppHubWorkload")
14354            }
14355            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14356            where
14357                A: serde::de::MapAccess<'de>,
14358            {
14359                #[allow(unused_imports)]
14360                use serde::de::Error;
14361                use std::option::Option::Some;
14362                let mut fields = std::collections::HashSet::new();
14363                let mut result = Self::Value::new();
14364                while let Some(tag) = map.next_key::<__FieldTag>()? {
14365                    #[allow(clippy::match_single_binding)]
14366                    match tag {
14367                        __FieldTag::__workload => {
14368                            if !fields.insert(__FieldTag::__workload) {
14369                                return std::result::Result::Err(A::Error::duplicate_field(
14370                                    "multiple values for workload",
14371                                ));
14372                            }
14373                            result.workload = map
14374                                .next_value::<std::option::Option<std::string::String>>()?
14375                                .unwrap_or_default();
14376                        }
14377                        __FieldTag::__criticality => {
14378                            if !fields.insert(__FieldTag::__criticality) {
14379                                return std::result::Result::Err(A::Error::duplicate_field(
14380                                    "multiple values for criticality",
14381                                ));
14382                            }
14383                            result.criticality = map
14384                                .next_value::<std::option::Option<std::string::String>>()?
14385                                .unwrap_or_default();
14386                        }
14387                        __FieldTag::__environment => {
14388                            if !fields.insert(__FieldTag::__environment) {
14389                                return std::result::Result::Err(A::Error::duplicate_field(
14390                                    "multiple values for environment",
14391                                ));
14392                            }
14393                            result.environment = map
14394                                .next_value::<std::option::Option<std::string::String>>()?
14395                                .unwrap_or_default();
14396                        }
14397                        __FieldTag::Unknown(key) => {
14398                            let value = map.next_value::<serde_json::Value>()?;
14399                            result._unknown_fields.insert(key, value);
14400                        }
14401                    }
14402                }
14403                std::result::Result::Ok(result)
14404            }
14405        }
14406        deserializer.deserialize_any(Visitor)
14407    }
14408}
14409
14410#[doc(hidden)]
14411impl serde::ser::Serialize for AppHubWorkload {
14412    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14413    where
14414        S: serde::ser::Serializer,
14415    {
14416        use serde::ser::SerializeMap;
14417        #[allow(unused_imports)]
14418        use std::option::Option::Some;
14419        let mut state = serializer.serialize_map(std::option::Option::None)?;
14420        if !self.workload.is_empty() {
14421            state.serialize_entry("workload", &self.workload)?;
14422        }
14423        if !self.criticality.is_empty() {
14424            state.serialize_entry("criticality", &self.criticality)?;
14425        }
14426        if !self.environment.is_empty() {
14427            state.serialize_entry("environment", &self.environment)?;
14428        }
14429        if !self._unknown_fields.is_empty() {
14430            for (key, value) in self._unknown_fields.iter() {
14431                state.serialize_entry(key, &value)?;
14432            }
14433        }
14434        state.end()
14435    }
14436}
14437
14438/// The artifact config of the artifact that is deployed.
14439#[derive(Clone, Debug, Default, PartialEq)]
14440#[non_exhaustive]
14441pub struct ArtifactConfig {
14442    /// Required. Immutable. The URI of the artifact that is deployed.
14443    /// e.g. `us-docker.pkg.dev/my-project/my-repo/image`.
14444    /// The URI does not include the tag / digest because it captures a lineage of
14445    /// artifacts.
14446    pub uri: std::string::String,
14447
14448    /// The storage location of the artifact.
14449    pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
14450
14451    /// The storage location of the artifact metadata.
14452    pub artifact_metadata_storage:
14453        std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
14454
14455    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14456}
14457
14458impl ArtifactConfig {
14459    pub fn new() -> Self {
14460        std::default::Default::default()
14461    }
14462
14463    /// Sets the value of [uri][crate::model::ArtifactConfig::uri].
14464    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14465        self.uri = v.into();
14466        self
14467    }
14468
14469    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage].
14470    ///
14471    /// Note that all the setters affecting `artifact_storage` are mutually
14472    /// exclusive.
14473    pub fn set_artifact_storage<
14474        T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
14475    >(
14476        mut self,
14477        v: T,
14478    ) -> Self {
14479        self.artifact_storage = v.into();
14480        self
14481    }
14482
14483    /// The value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
14484    /// if it holds a `GoogleArtifactRegistry`, `None` if the field is not set or
14485    /// holds a different branch.
14486    pub fn google_artifact_registry(
14487        &self,
14488    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
14489        #[allow(unreachable_patterns)]
14490        self.artifact_storage.as_ref().and_then(|v| match v {
14491            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
14492                std::option::Option::Some(v)
14493            }
14494            _ => std::option::Option::None,
14495        })
14496    }
14497
14498    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
14499    /// to hold a `GoogleArtifactRegistry`.
14500    ///
14501    /// Note that all the setters affecting `artifact_storage` are
14502    /// mutually exclusive.
14503    pub fn set_google_artifact_registry<
14504        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
14505    >(
14506        mut self,
14507        v: T,
14508    ) -> Self {
14509        self.artifact_storage = std::option::Option::Some(
14510            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
14511        );
14512        self
14513    }
14514
14515    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage].
14516    ///
14517    /// Note that all the setters affecting `artifact_metadata_storage` are mutually
14518    /// exclusive.
14519    pub fn set_artifact_metadata_storage<
14520        T: std::convert::Into<
14521                std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
14522            >,
14523    >(
14524        mut self,
14525        v: T,
14526    ) -> Self {
14527        self.artifact_metadata_storage = v.into();
14528        self
14529    }
14530
14531    /// The value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
14532    /// if it holds a `GoogleArtifactAnalysis`, `None` if the field is not set or
14533    /// holds a different branch.
14534    pub fn google_artifact_analysis(
14535        &self,
14536    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
14537        #[allow(unreachable_patterns)]
14538        self.artifact_metadata_storage
14539            .as_ref()
14540            .and_then(|v| match v {
14541                crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
14542                    v,
14543                ) => std::option::Option::Some(v),
14544                _ => std::option::Option::None,
14545            })
14546    }
14547
14548    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
14549    /// to hold a `GoogleArtifactAnalysis`.
14550    ///
14551    /// Note that all the setters affecting `artifact_metadata_storage` are
14552    /// mutually exclusive.
14553    pub fn set_google_artifact_analysis<
14554        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
14555    >(
14556        mut self,
14557        v: T,
14558    ) -> Self {
14559        self.artifact_metadata_storage = std::option::Option::Some(
14560            crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
14561                v.into(),
14562            ),
14563        );
14564        self
14565    }
14566}
14567
14568impl wkt::message::Message for ArtifactConfig {
14569    fn typename() -> &'static str {
14570        "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
14571    }
14572}
14573
14574#[doc(hidden)]
14575impl<'de> serde::de::Deserialize<'de> for ArtifactConfig {
14576    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14577    where
14578        D: serde::Deserializer<'de>,
14579    {
14580        #[allow(non_camel_case_types)]
14581        #[doc(hidden)]
14582        #[derive(PartialEq, Eq, Hash)]
14583        enum __FieldTag {
14584            __google_artifact_registry,
14585            __google_artifact_analysis,
14586            __uri,
14587            Unknown(std::string::String),
14588        }
14589        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14590            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14591            where
14592                D: serde::Deserializer<'de>,
14593            {
14594                struct Visitor;
14595                impl<'de> serde::de::Visitor<'de> for Visitor {
14596                    type Value = __FieldTag;
14597                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14598                        formatter.write_str("a field name for ArtifactConfig")
14599                    }
14600                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14601                    where
14602                        E: serde::de::Error,
14603                    {
14604                        use std::result::Result::Ok;
14605                        use std::string::ToString;
14606                        match value {
14607                            "googleArtifactRegistry" => Ok(__FieldTag::__google_artifact_registry),
14608                            "google_artifact_registry" => {
14609                                Ok(__FieldTag::__google_artifact_registry)
14610                            }
14611                            "googleArtifactAnalysis" => Ok(__FieldTag::__google_artifact_analysis),
14612                            "google_artifact_analysis" => {
14613                                Ok(__FieldTag::__google_artifact_analysis)
14614                            }
14615                            "uri" => Ok(__FieldTag::__uri),
14616                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14617                        }
14618                    }
14619                }
14620                deserializer.deserialize_identifier(Visitor)
14621            }
14622        }
14623        struct Visitor;
14624        impl<'de> serde::de::Visitor<'de> for Visitor {
14625            type Value = ArtifactConfig;
14626            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14627                formatter.write_str("struct ArtifactConfig")
14628            }
14629            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14630            where
14631                A: serde::de::MapAccess<'de>,
14632            {
14633                #[allow(unused_imports)]
14634                use serde::de::Error;
14635                use std::option::Option::Some;
14636                let mut fields = std::collections::HashSet::new();
14637                let mut result = Self::Value::new();
14638                while let Some(tag) = map.next_key::<__FieldTag>()? {
14639                    #[allow(clippy::match_single_binding)]
14640                    match tag {
14641                        __FieldTag::__google_artifact_registry => {
14642                            if !fields.insert(__FieldTag::__google_artifact_registry) {
14643                                return std::result::Result::Err(A::Error::duplicate_field(
14644                                    "multiple values for google_artifact_registry",
14645                                ));
14646                            }
14647                            if result.artifact_storage.is_some() {
14648                                return std::result::Result::Err(A::Error::duplicate_field(
14649                                    "multiple values for `artifact_storage`, a oneof with full ID .google.cloud.developerconnect.v1.ArtifactConfig.google_artifact_registry, latest field was googleArtifactRegistry",
14650                                ));
14651                            }
14652                            result.artifact_storage = std::option::Option::Some(
14653                                crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(
14654                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::GoogleArtifactRegistry>>>()?.unwrap_or_default()
14655                                ),
14656                            );
14657                        }
14658                        __FieldTag::__google_artifact_analysis => {
14659                            if !fields.insert(__FieldTag::__google_artifact_analysis) {
14660                                return std::result::Result::Err(A::Error::duplicate_field(
14661                                    "multiple values for google_artifact_analysis",
14662                                ));
14663                            }
14664                            if result.artifact_metadata_storage.is_some() {
14665                                return std::result::Result::Err(A::Error::duplicate_field(
14666                                    "multiple values for `artifact_metadata_storage`, a oneof with full ID .google.cloud.developerconnect.v1.ArtifactConfig.google_artifact_analysis, latest field was googleArtifactAnalysis",
14667                                ));
14668                            }
14669                            result.artifact_metadata_storage = std::option::Option::Some(
14670                                crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
14671                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>>()?.unwrap_or_default()
14672                                ),
14673                            );
14674                        }
14675                        __FieldTag::__uri => {
14676                            if !fields.insert(__FieldTag::__uri) {
14677                                return std::result::Result::Err(A::Error::duplicate_field(
14678                                    "multiple values for uri",
14679                                ));
14680                            }
14681                            result.uri = map
14682                                .next_value::<std::option::Option<std::string::String>>()?
14683                                .unwrap_or_default();
14684                        }
14685                        __FieldTag::Unknown(key) => {
14686                            let value = map.next_value::<serde_json::Value>()?;
14687                            result._unknown_fields.insert(key, value);
14688                        }
14689                    }
14690                }
14691                std::result::Result::Ok(result)
14692            }
14693        }
14694        deserializer.deserialize_any(Visitor)
14695    }
14696}
14697
14698#[doc(hidden)]
14699impl serde::ser::Serialize for ArtifactConfig {
14700    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14701    where
14702        S: serde::ser::Serializer,
14703    {
14704        use serde::ser::SerializeMap;
14705        #[allow(unused_imports)]
14706        use std::option::Option::Some;
14707        let mut state = serializer.serialize_map(std::option::Option::None)?;
14708        if let Some(value) = self.google_artifact_registry() {
14709            state.serialize_entry("googleArtifactRegistry", value)?;
14710        }
14711        if let Some(value) = self.google_artifact_analysis() {
14712            state.serialize_entry("googleArtifactAnalysis", value)?;
14713        }
14714        if !self.uri.is_empty() {
14715            state.serialize_entry("uri", &self.uri)?;
14716        }
14717        if !self._unknown_fields.is_empty() {
14718            for (key, value) in self._unknown_fields.iter() {
14719                state.serialize_entry(key, &value)?;
14720            }
14721        }
14722        state.end()
14723    }
14724}
14725
14726/// Defines additional types related to [ArtifactConfig].
14727pub mod artifact_config {
14728    #[allow(unused_imports)]
14729    use super::*;
14730
14731    /// The storage location of the artifact.
14732    #[derive(Clone, Debug, PartialEq)]
14733    #[non_exhaustive]
14734    pub enum ArtifactStorage {
14735        /// Optional. Set if the artifact is stored in Artifact registry.
14736        GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
14737    }
14738
14739    /// The storage location of the artifact metadata.
14740    #[derive(Clone, Debug, PartialEq)]
14741    #[non_exhaustive]
14742    pub enum ArtifactMetadataStorage {
14743        /// Optional. Set if the artifact metadata is stored in Artifact analysis.
14744        GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
14745    }
14746}
14747
14748/// Google Artifact Analysis configurations.
14749#[derive(Clone, Debug, Default, PartialEq)]
14750#[non_exhaustive]
14751pub struct GoogleArtifactAnalysis {
14752    /// Required. The project id of the project where the provenance is stored.
14753    pub project_id: std::string::String,
14754
14755    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14756}
14757
14758impl GoogleArtifactAnalysis {
14759    pub fn new() -> Self {
14760        std::default::Default::default()
14761    }
14762
14763    /// Sets the value of [project_id][crate::model::GoogleArtifactAnalysis::project_id].
14764    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14765        self.project_id = v.into();
14766        self
14767    }
14768}
14769
14770impl wkt::message::Message for GoogleArtifactAnalysis {
14771    fn typename() -> &'static str {
14772        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
14773    }
14774}
14775
14776#[doc(hidden)]
14777impl<'de> serde::de::Deserialize<'de> for GoogleArtifactAnalysis {
14778    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14779    where
14780        D: serde::Deserializer<'de>,
14781    {
14782        #[allow(non_camel_case_types)]
14783        #[doc(hidden)]
14784        #[derive(PartialEq, Eq, Hash)]
14785        enum __FieldTag {
14786            __project_id,
14787            Unknown(std::string::String),
14788        }
14789        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14790            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14791            where
14792                D: serde::Deserializer<'de>,
14793            {
14794                struct Visitor;
14795                impl<'de> serde::de::Visitor<'de> for Visitor {
14796                    type Value = __FieldTag;
14797                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14798                        formatter.write_str("a field name for GoogleArtifactAnalysis")
14799                    }
14800                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14801                    where
14802                        E: serde::de::Error,
14803                    {
14804                        use std::result::Result::Ok;
14805                        use std::string::ToString;
14806                        match value {
14807                            "projectId" => Ok(__FieldTag::__project_id),
14808                            "project_id" => Ok(__FieldTag::__project_id),
14809                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14810                        }
14811                    }
14812                }
14813                deserializer.deserialize_identifier(Visitor)
14814            }
14815        }
14816        struct Visitor;
14817        impl<'de> serde::de::Visitor<'de> for Visitor {
14818            type Value = GoogleArtifactAnalysis;
14819            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14820                formatter.write_str("struct GoogleArtifactAnalysis")
14821            }
14822            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14823            where
14824                A: serde::de::MapAccess<'de>,
14825            {
14826                #[allow(unused_imports)]
14827                use serde::de::Error;
14828                use std::option::Option::Some;
14829                let mut fields = std::collections::HashSet::new();
14830                let mut result = Self::Value::new();
14831                while let Some(tag) = map.next_key::<__FieldTag>()? {
14832                    #[allow(clippy::match_single_binding)]
14833                    match tag {
14834                        __FieldTag::__project_id => {
14835                            if !fields.insert(__FieldTag::__project_id) {
14836                                return std::result::Result::Err(A::Error::duplicate_field(
14837                                    "multiple values for project_id",
14838                                ));
14839                            }
14840                            result.project_id = map
14841                                .next_value::<std::option::Option<std::string::String>>()?
14842                                .unwrap_or_default();
14843                        }
14844                        __FieldTag::Unknown(key) => {
14845                            let value = map.next_value::<serde_json::Value>()?;
14846                            result._unknown_fields.insert(key, value);
14847                        }
14848                    }
14849                }
14850                std::result::Result::Ok(result)
14851            }
14852        }
14853        deserializer.deserialize_any(Visitor)
14854    }
14855}
14856
14857#[doc(hidden)]
14858impl serde::ser::Serialize for GoogleArtifactAnalysis {
14859    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14860    where
14861        S: serde::ser::Serializer,
14862    {
14863        use serde::ser::SerializeMap;
14864        #[allow(unused_imports)]
14865        use std::option::Option::Some;
14866        let mut state = serializer.serialize_map(std::option::Option::None)?;
14867        if !self.project_id.is_empty() {
14868            state.serialize_entry("projectId", &self.project_id)?;
14869        }
14870        if !self._unknown_fields.is_empty() {
14871            for (key, value) in self._unknown_fields.iter() {
14872                state.serialize_entry(key, &value)?;
14873            }
14874        }
14875        state.end()
14876    }
14877}
14878
14879/// Google Artifact Registry configurations.
14880#[derive(Clone, Debug, Default, PartialEq)]
14881#[non_exhaustive]
14882pub struct GoogleArtifactRegistry {
14883    /// Required. The host project of Artifact Registry.
14884    pub project_id: std::string::String,
14885
14886    /// Required. Immutable. The name of the artifact registry package.
14887    pub artifact_registry_package: std::string::String,
14888
14889    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14890}
14891
14892impl GoogleArtifactRegistry {
14893    pub fn new() -> Self {
14894        std::default::Default::default()
14895    }
14896
14897    /// Sets the value of [project_id][crate::model::GoogleArtifactRegistry::project_id].
14898    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14899        self.project_id = v.into();
14900        self
14901    }
14902
14903    /// Sets the value of [artifact_registry_package][crate::model::GoogleArtifactRegistry::artifact_registry_package].
14904    pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
14905        mut self,
14906        v: T,
14907    ) -> Self {
14908        self.artifact_registry_package = v.into();
14909        self
14910    }
14911}
14912
14913impl wkt::message::Message for GoogleArtifactRegistry {
14914    fn typename() -> &'static str {
14915        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
14916    }
14917}
14918
14919#[doc(hidden)]
14920impl<'de> serde::de::Deserialize<'de> for GoogleArtifactRegistry {
14921    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14922    where
14923        D: serde::Deserializer<'de>,
14924    {
14925        #[allow(non_camel_case_types)]
14926        #[doc(hidden)]
14927        #[derive(PartialEq, Eq, Hash)]
14928        enum __FieldTag {
14929            __project_id,
14930            __artifact_registry_package,
14931            Unknown(std::string::String),
14932        }
14933        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14934            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14935            where
14936                D: serde::Deserializer<'de>,
14937            {
14938                struct Visitor;
14939                impl<'de> serde::de::Visitor<'de> for Visitor {
14940                    type Value = __FieldTag;
14941                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14942                        formatter.write_str("a field name for GoogleArtifactRegistry")
14943                    }
14944                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14945                    where
14946                        E: serde::de::Error,
14947                    {
14948                        use std::result::Result::Ok;
14949                        use std::string::ToString;
14950                        match value {
14951                            "projectId" => Ok(__FieldTag::__project_id),
14952                            "project_id" => Ok(__FieldTag::__project_id),
14953                            "artifactRegistryPackage" => {
14954                                Ok(__FieldTag::__artifact_registry_package)
14955                            }
14956                            "artifact_registry_package" => {
14957                                Ok(__FieldTag::__artifact_registry_package)
14958                            }
14959                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14960                        }
14961                    }
14962                }
14963                deserializer.deserialize_identifier(Visitor)
14964            }
14965        }
14966        struct Visitor;
14967        impl<'de> serde::de::Visitor<'de> for Visitor {
14968            type Value = GoogleArtifactRegistry;
14969            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14970                formatter.write_str("struct GoogleArtifactRegistry")
14971            }
14972            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14973            where
14974                A: serde::de::MapAccess<'de>,
14975            {
14976                #[allow(unused_imports)]
14977                use serde::de::Error;
14978                use std::option::Option::Some;
14979                let mut fields = std::collections::HashSet::new();
14980                let mut result = Self::Value::new();
14981                while let Some(tag) = map.next_key::<__FieldTag>()? {
14982                    #[allow(clippy::match_single_binding)]
14983                    match tag {
14984                        __FieldTag::__project_id => {
14985                            if !fields.insert(__FieldTag::__project_id) {
14986                                return std::result::Result::Err(A::Error::duplicate_field(
14987                                    "multiple values for project_id",
14988                                ));
14989                            }
14990                            result.project_id = map
14991                                .next_value::<std::option::Option<std::string::String>>()?
14992                                .unwrap_or_default();
14993                        }
14994                        __FieldTag::__artifact_registry_package => {
14995                            if !fields.insert(__FieldTag::__artifact_registry_package) {
14996                                return std::result::Result::Err(A::Error::duplicate_field(
14997                                    "multiple values for artifact_registry_package",
14998                                ));
14999                            }
15000                            result.artifact_registry_package = map
15001                                .next_value::<std::option::Option<std::string::String>>()?
15002                                .unwrap_or_default();
15003                        }
15004                        __FieldTag::Unknown(key) => {
15005                            let value = map.next_value::<serde_json::Value>()?;
15006                            result._unknown_fields.insert(key, value);
15007                        }
15008                    }
15009                }
15010                std::result::Result::Ok(result)
15011            }
15012        }
15013        deserializer.deserialize_any(Visitor)
15014    }
15015}
15016
15017#[doc(hidden)]
15018impl serde::ser::Serialize for GoogleArtifactRegistry {
15019    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15020    where
15021        S: serde::ser::Serializer,
15022    {
15023        use serde::ser::SerializeMap;
15024        #[allow(unused_imports)]
15025        use std::option::Option::Some;
15026        let mut state = serializer.serialize_map(std::option::Option::None)?;
15027        if !self.project_id.is_empty() {
15028            state.serialize_entry("projectId", &self.project_id)?;
15029        }
15030        if !self.artifact_registry_package.is_empty() {
15031            state.serialize_entry("artifactRegistryPackage", &self.artifact_registry_package)?;
15032        }
15033        if !self._unknown_fields.is_empty() {
15034            for (key, value) in self._unknown_fields.iter() {
15035                state.serialize_entry(key, &value)?;
15036            }
15037        }
15038        state.end()
15039    }
15040}
15041
15042/// Request for creating an InsightsConfig.
15043#[derive(Clone, Debug, Default, PartialEq)]
15044#[non_exhaustive]
15045pub struct CreateInsightsConfigRequest {
15046    /// Required. Value for parent.
15047    pub parent: std::string::String,
15048
15049    /// Required. ID of the requesting InsightsConfig.
15050    pub insights_config_id: std::string::String,
15051
15052    /// Required. The resource being created.
15053    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
15054
15055    /// Optional. If set, validate the request, but do not actually post it.
15056    pub validate_only: bool,
15057
15058    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15059}
15060
15061impl CreateInsightsConfigRequest {
15062    pub fn new() -> Self {
15063        std::default::Default::default()
15064    }
15065
15066    /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
15067    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15068        self.parent = v.into();
15069        self
15070    }
15071
15072    /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
15073    pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
15074        mut self,
15075        v: T,
15076    ) -> Self {
15077        self.insights_config_id = v.into();
15078        self
15079    }
15080
15081    /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
15082    pub fn set_insights_config<T>(mut self, v: T) -> Self
15083    where
15084        T: std::convert::Into<crate::model::InsightsConfig>,
15085    {
15086        self.insights_config = std::option::Option::Some(v.into());
15087        self
15088    }
15089
15090    /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
15091    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
15092    where
15093        T: std::convert::Into<crate::model::InsightsConfig>,
15094    {
15095        self.insights_config = v.map(|x| x.into());
15096        self
15097    }
15098
15099    /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
15100    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15101        self.validate_only = v.into();
15102        self
15103    }
15104}
15105
15106impl wkt::message::Message for CreateInsightsConfigRequest {
15107    fn typename() -> &'static str {
15108        "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
15109    }
15110}
15111
15112#[doc(hidden)]
15113impl<'de> serde::de::Deserialize<'de> for CreateInsightsConfigRequest {
15114    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15115    where
15116        D: serde::Deserializer<'de>,
15117    {
15118        #[allow(non_camel_case_types)]
15119        #[doc(hidden)]
15120        #[derive(PartialEq, Eq, Hash)]
15121        enum __FieldTag {
15122            __parent,
15123            __insights_config_id,
15124            __insights_config,
15125            __validate_only,
15126            Unknown(std::string::String),
15127        }
15128        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15129            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15130            where
15131                D: serde::Deserializer<'de>,
15132            {
15133                struct Visitor;
15134                impl<'de> serde::de::Visitor<'de> for Visitor {
15135                    type Value = __FieldTag;
15136                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15137                        formatter.write_str("a field name for CreateInsightsConfigRequest")
15138                    }
15139                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15140                    where
15141                        E: serde::de::Error,
15142                    {
15143                        use std::result::Result::Ok;
15144                        use std::string::ToString;
15145                        match value {
15146                            "parent" => Ok(__FieldTag::__parent),
15147                            "insightsConfigId" => Ok(__FieldTag::__insights_config_id),
15148                            "insights_config_id" => Ok(__FieldTag::__insights_config_id),
15149                            "insightsConfig" => Ok(__FieldTag::__insights_config),
15150                            "insights_config" => Ok(__FieldTag::__insights_config),
15151                            "validateOnly" => Ok(__FieldTag::__validate_only),
15152                            "validate_only" => Ok(__FieldTag::__validate_only),
15153                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15154                        }
15155                    }
15156                }
15157                deserializer.deserialize_identifier(Visitor)
15158            }
15159        }
15160        struct Visitor;
15161        impl<'de> serde::de::Visitor<'de> for Visitor {
15162            type Value = CreateInsightsConfigRequest;
15163            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15164                formatter.write_str("struct CreateInsightsConfigRequest")
15165            }
15166            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15167            where
15168                A: serde::de::MapAccess<'de>,
15169            {
15170                #[allow(unused_imports)]
15171                use serde::de::Error;
15172                use std::option::Option::Some;
15173                let mut fields = std::collections::HashSet::new();
15174                let mut result = Self::Value::new();
15175                while let Some(tag) = map.next_key::<__FieldTag>()? {
15176                    #[allow(clippy::match_single_binding)]
15177                    match tag {
15178                        __FieldTag::__parent => {
15179                            if !fields.insert(__FieldTag::__parent) {
15180                                return std::result::Result::Err(A::Error::duplicate_field(
15181                                    "multiple values for parent",
15182                                ));
15183                            }
15184                            result.parent = map
15185                                .next_value::<std::option::Option<std::string::String>>()?
15186                                .unwrap_or_default();
15187                        }
15188                        __FieldTag::__insights_config_id => {
15189                            if !fields.insert(__FieldTag::__insights_config_id) {
15190                                return std::result::Result::Err(A::Error::duplicate_field(
15191                                    "multiple values for insights_config_id",
15192                                ));
15193                            }
15194                            result.insights_config_id = map
15195                                .next_value::<std::option::Option<std::string::String>>()?
15196                                .unwrap_or_default();
15197                        }
15198                        __FieldTag::__insights_config => {
15199                            if !fields.insert(__FieldTag::__insights_config) {
15200                                return std::result::Result::Err(A::Error::duplicate_field(
15201                                    "multiple values for insights_config",
15202                                ));
15203                            }
15204                            result.insights_config = map
15205                                .next_value::<std::option::Option<crate::model::InsightsConfig>>(
15206                                )?;
15207                        }
15208                        __FieldTag::__validate_only => {
15209                            if !fields.insert(__FieldTag::__validate_only) {
15210                                return std::result::Result::Err(A::Error::duplicate_field(
15211                                    "multiple values for validate_only",
15212                                ));
15213                            }
15214                            result.validate_only = map
15215                                .next_value::<std::option::Option<bool>>()?
15216                                .unwrap_or_default();
15217                        }
15218                        __FieldTag::Unknown(key) => {
15219                            let value = map.next_value::<serde_json::Value>()?;
15220                            result._unknown_fields.insert(key, value);
15221                        }
15222                    }
15223                }
15224                std::result::Result::Ok(result)
15225            }
15226        }
15227        deserializer.deserialize_any(Visitor)
15228    }
15229}
15230
15231#[doc(hidden)]
15232impl serde::ser::Serialize for CreateInsightsConfigRequest {
15233    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15234    where
15235        S: serde::ser::Serializer,
15236    {
15237        use serde::ser::SerializeMap;
15238        #[allow(unused_imports)]
15239        use std::option::Option::Some;
15240        let mut state = serializer.serialize_map(std::option::Option::None)?;
15241        if !self.parent.is_empty() {
15242            state.serialize_entry("parent", &self.parent)?;
15243        }
15244        if !self.insights_config_id.is_empty() {
15245            state.serialize_entry("insightsConfigId", &self.insights_config_id)?;
15246        }
15247        if self.insights_config.is_some() {
15248            state.serialize_entry("insightsConfig", &self.insights_config)?;
15249        }
15250        if !wkt::internal::is_default(&self.validate_only) {
15251            state.serialize_entry("validateOnly", &self.validate_only)?;
15252        }
15253        if !self._unknown_fields.is_empty() {
15254            for (key, value) in self._unknown_fields.iter() {
15255                state.serialize_entry(key, &value)?;
15256            }
15257        }
15258        state.end()
15259    }
15260}
15261
15262/// Request for getting an InsightsConfig.
15263#[derive(Clone, Debug, Default, PartialEq)]
15264#[non_exhaustive]
15265pub struct GetInsightsConfigRequest {
15266    /// Required. Name of the resource.
15267    pub name: std::string::String,
15268
15269    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15270}
15271
15272impl GetInsightsConfigRequest {
15273    pub fn new() -> Self {
15274        std::default::Default::default()
15275    }
15276
15277    /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
15278    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15279        self.name = v.into();
15280        self
15281    }
15282}
15283
15284impl wkt::message::Message for GetInsightsConfigRequest {
15285    fn typename() -> &'static str {
15286        "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
15287    }
15288}
15289
15290#[doc(hidden)]
15291impl<'de> serde::de::Deserialize<'de> for GetInsightsConfigRequest {
15292    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15293    where
15294        D: serde::Deserializer<'de>,
15295    {
15296        #[allow(non_camel_case_types)]
15297        #[doc(hidden)]
15298        #[derive(PartialEq, Eq, Hash)]
15299        enum __FieldTag {
15300            __name,
15301            Unknown(std::string::String),
15302        }
15303        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15304            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15305            where
15306                D: serde::Deserializer<'de>,
15307            {
15308                struct Visitor;
15309                impl<'de> serde::de::Visitor<'de> for Visitor {
15310                    type Value = __FieldTag;
15311                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15312                        formatter.write_str("a field name for GetInsightsConfigRequest")
15313                    }
15314                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15315                    where
15316                        E: serde::de::Error,
15317                    {
15318                        use std::result::Result::Ok;
15319                        use std::string::ToString;
15320                        match value {
15321                            "name" => Ok(__FieldTag::__name),
15322                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15323                        }
15324                    }
15325                }
15326                deserializer.deserialize_identifier(Visitor)
15327            }
15328        }
15329        struct Visitor;
15330        impl<'de> serde::de::Visitor<'de> for Visitor {
15331            type Value = GetInsightsConfigRequest;
15332            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15333                formatter.write_str("struct GetInsightsConfigRequest")
15334            }
15335            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15336            where
15337                A: serde::de::MapAccess<'de>,
15338            {
15339                #[allow(unused_imports)]
15340                use serde::de::Error;
15341                use std::option::Option::Some;
15342                let mut fields = std::collections::HashSet::new();
15343                let mut result = Self::Value::new();
15344                while let Some(tag) = map.next_key::<__FieldTag>()? {
15345                    #[allow(clippy::match_single_binding)]
15346                    match tag {
15347                        __FieldTag::__name => {
15348                            if !fields.insert(__FieldTag::__name) {
15349                                return std::result::Result::Err(A::Error::duplicate_field(
15350                                    "multiple values for name",
15351                                ));
15352                            }
15353                            result.name = map
15354                                .next_value::<std::option::Option<std::string::String>>()?
15355                                .unwrap_or_default();
15356                        }
15357                        __FieldTag::Unknown(key) => {
15358                            let value = map.next_value::<serde_json::Value>()?;
15359                            result._unknown_fields.insert(key, value);
15360                        }
15361                    }
15362                }
15363                std::result::Result::Ok(result)
15364            }
15365        }
15366        deserializer.deserialize_any(Visitor)
15367    }
15368}
15369
15370#[doc(hidden)]
15371impl serde::ser::Serialize for GetInsightsConfigRequest {
15372    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15373    where
15374        S: serde::ser::Serializer,
15375    {
15376        use serde::ser::SerializeMap;
15377        #[allow(unused_imports)]
15378        use std::option::Option::Some;
15379        let mut state = serializer.serialize_map(std::option::Option::None)?;
15380        if !self.name.is_empty() {
15381            state.serialize_entry("name", &self.name)?;
15382        }
15383        if !self._unknown_fields.is_empty() {
15384            for (key, value) in self._unknown_fields.iter() {
15385                state.serialize_entry(key, &value)?;
15386            }
15387        }
15388        state.end()
15389    }
15390}
15391
15392/// Request for requesting list of InsightsConfigs.
15393#[derive(Clone, Debug, Default, PartialEq)]
15394#[non_exhaustive]
15395pub struct ListInsightsConfigsRequest {
15396    /// Required. Parent value for ListInsightsConfigsRequest.
15397    pub parent: std::string::String,
15398
15399    /// Optional. Requested page size. Server may return fewer items than
15400    /// requested. If unspecified, server will pick an appropriate default.
15401    pub page_size: i32,
15402
15403    /// Optional. A token identifying a page of results the server should return.
15404    pub page_token: std::string::String,
15405
15406    /// Optional. Filtering results. See <https://google.aip.dev/160> for more
15407    /// details. Filter string, adhering to the rules in
15408    /// <https://google.aip.dev/160>. List only InsightsConfigs matching the filter.
15409    /// If filter is empty, all InsightsConfigs are listed.
15410    pub filter: std::string::String,
15411
15412    /// Optional. Hint for how to order the results.
15413    pub order_by: std::string::String,
15414
15415    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15416}
15417
15418impl ListInsightsConfigsRequest {
15419    pub fn new() -> Self {
15420        std::default::Default::default()
15421    }
15422
15423    /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
15424    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15425        self.parent = v.into();
15426        self
15427    }
15428
15429    /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
15430    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15431        self.page_size = v.into();
15432        self
15433    }
15434
15435    /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
15436    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15437        self.page_token = v.into();
15438        self
15439    }
15440
15441    /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
15442    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15443        self.filter = v.into();
15444        self
15445    }
15446
15447    /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
15448    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15449        self.order_by = v.into();
15450        self
15451    }
15452}
15453
15454impl wkt::message::Message for ListInsightsConfigsRequest {
15455    fn typename() -> &'static str {
15456        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
15457    }
15458}
15459
15460#[doc(hidden)]
15461impl<'de> serde::de::Deserialize<'de> for ListInsightsConfigsRequest {
15462    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15463    where
15464        D: serde::Deserializer<'de>,
15465    {
15466        #[allow(non_camel_case_types)]
15467        #[doc(hidden)]
15468        #[derive(PartialEq, Eq, Hash)]
15469        enum __FieldTag {
15470            __parent,
15471            __page_size,
15472            __page_token,
15473            __filter,
15474            __order_by,
15475            Unknown(std::string::String),
15476        }
15477        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15478            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15479            where
15480                D: serde::Deserializer<'de>,
15481            {
15482                struct Visitor;
15483                impl<'de> serde::de::Visitor<'de> for Visitor {
15484                    type Value = __FieldTag;
15485                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15486                        formatter.write_str("a field name for ListInsightsConfigsRequest")
15487                    }
15488                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15489                    where
15490                        E: serde::de::Error,
15491                    {
15492                        use std::result::Result::Ok;
15493                        use std::string::ToString;
15494                        match value {
15495                            "parent" => Ok(__FieldTag::__parent),
15496                            "pageSize" => Ok(__FieldTag::__page_size),
15497                            "page_size" => Ok(__FieldTag::__page_size),
15498                            "pageToken" => Ok(__FieldTag::__page_token),
15499                            "page_token" => Ok(__FieldTag::__page_token),
15500                            "filter" => Ok(__FieldTag::__filter),
15501                            "orderBy" => Ok(__FieldTag::__order_by),
15502                            "order_by" => Ok(__FieldTag::__order_by),
15503                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15504                        }
15505                    }
15506                }
15507                deserializer.deserialize_identifier(Visitor)
15508            }
15509        }
15510        struct Visitor;
15511        impl<'de> serde::de::Visitor<'de> for Visitor {
15512            type Value = ListInsightsConfigsRequest;
15513            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15514                formatter.write_str("struct ListInsightsConfigsRequest")
15515            }
15516            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15517            where
15518                A: serde::de::MapAccess<'de>,
15519            {
15520                #[allow(unused_imports)]
15521                use serde::de::Error;
15522                use std::option::Option::Some;
15523                let mut fields = std::collections::HashSet::new();
15524                let mut result = Self::Value::new();
15525                while let Some(tag) = map.next_key::<__FieldTag>()? {
15526                    #[allow(clippy::match_single_binding)]
15527                    match tag {
15528                        __FieldTag::__parent => {
15529                            if !fields.insert(__FieldTag::__parent) {
15530                                return std::result::Result::Err(A::Error::duplicate_field(
15531                                    "multiple values for parent",
15532                                ));
15533                            }
15534                            result.parent = map
15535                                .next_value::<std::option::Option<std::string::String>>()?
15536                                .unwrap_or_default();
15537                        }
15538                        __FieldTag::__page_size => {
15539                            if !fields.insert(__FieldTag::__page_size) {
15540                                return std::result::Result::Err(A::Error::duplicate_field(
15541                                    "multiple values for page_size",
15542                                ));
15543                            }
15544                            struct __With(std::option::Option<i32>);
15545                            impl<'de> serde::de::Deserialize<'de> for __With {
15546                                fn deserialize<D>(
15547                                    deserializer: D,
15548                                ) -> std::result::Result<Self, D::Error>
15549                                where
15550                                    D: serde::de::Deserializer<'de>,
15551                                {
15552                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
15553                                }
15554                            }
15555                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
15556                        }
15557                        __FieldTag::__page_token => {
15558                            if !fields.insert(__FieldTag::__page_token) {
15559                                return std::result::Result::Err(A::Error::duplicate_field(
15560                                    "multiple values for page_token",
15561                                ));
15562                            }
15563                            result.page_token = map
15564                                .next_value::<std::option::Option<std::string::String>>()?
15565                                .unwrap_or_default();
15566                        }
15567                        __FieldTag::__filter => {
15568                            if !fields.insert(__FieldTag::__filter) {
15569                                return std::result::Result::Err(A::Error::duplicate_field(
15570                                    "multiple values for filter",
15571                                ));
15572                            }
15573                            result.filter = map
15574                                .next_value::<std::option::Option<std::string::String>>()?
15575                                .unwrap_or_default();
15576                        }
15577                        __FieldTag::__order_by => {
15578                            if !fields.insert(__FieldTag::__order_by) {
15579                                return std::result::Result::Err(A::Error::duplicate_field(
15580                                    "multiple values for order_by",
15581                                ));
15582                            }
15583                            result.order_by = map
15584                                .next_value::<std::option::Option<std::string::String>>()?
15585                                .unwrap_or_default();
15586                        }
15587                        __FieldTag::Unknown(key) => {
15588                            let value = map.next_value::<serde_json::Value>()?;
15589                            result._unknown_fields.insert(key, value);
15590                        }
15591                    }
15592                }
15593                std::result::Result::Ok(result)
15594            }
15595        }
15596        deserializer.deserialize_any(Visitor)
15597    }
15598}
15599
15600#[doc(hidden)]
15601impl serde::ser::Serialize for ListInsightsConfigsRequest {
15602    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15603    where
15604        S: serde::ser::Serializer,
15605    {
15606        use serde::ser::SerializeMap;
15607        #[allow(unused_imports)]
15608        use std::option::Option::Some;
15609        let mut state = serializer.serialize_map(std::option::Option::None)?;
15610        if !self.parent.is_empty() {
15611            state.serialize_entry("parent", &self.parent)?;
15612        }
15613        if !wkt::internal::is_default(&self.page_size) {
15614            struct __With<'a>(&'a i32);
15615            impl<'a> serde::ser::Serialize for __With<'a> {
15616                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15617                where
15618                    S: serde::ser::Serializer,
15619                {
15620                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
15621                }
15622            }
15623            state.serialize_entry("pageSize", &__With(&self.page_size))?;
15624        }
15625        if !self.page_token.is_empty() {
15626            state.serialize_entry("pageToken", &self.page_token)?;
15627        }
15628        if !self.filter.is_empty() {
15629            state.serialize_entry("filter", &self.filter)?;
15630        }
15631        if !self.order_by.is_empty() {
15632            state.serialize_entry("orderBy", &self.order_by)?;
15633        }
15634        if !self._unknown_fields.is_empty() {
15635            for (key, value) in self._unknown_fields.iter() {
15636                state.serialize_entry(key, &value)?;
15637            }
15638        }
15639        state.end()
15640    }
15641}
15642
15643/// Request for response to listing InsightsConfigs.
15644#[derive(Clone, Debug, Default, PartialEq)]
15645#[non_exhaustive]
15646pub struct ListInsightsConfigsResponse {
15647    /// The list of InsightsConfigs.
15648    pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
15649
15650    /// A token identifying a page of results the server should return.
15651    pub next_page_token: std::string::String,
15652
15653    /// Locations that could not be reached.
15654    pub unreachable: std::vec::Vec<std::string::String>,
15655
15656    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15657}
15658
15659impl ListInsightsConfigsResponse {
15660    pub fn new() -> Self {
15661        std::default::Default::default()
15662    }
15663
15664    /// Sets the value of [insights_configs][crate::model::ListInsightsConfigsResponse::insights_configs].
15665    pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
15666    where
15667        T: std::iter::IntoIterator<Item = V>,
15668        V: std::convert::Into<crate::model::InsightsConfig>,
15669    {
15670        use std::iter::Iterator;
15671        self.insights_configs = v.into_iter().map(|i| i.into()).collect();
15672        self
15673    }
15674
15675    /// Sets the value of [next_page_token][crate::model::ListInsightsConfigsResponse::next_page_token].
15676    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15677        self.next_page_token = v.into();
15678        self
15679    }
15680
15681    /// Sets the value of [unreachable][crate::model::ListInsightsConfigsResponse::unreachable].
15682    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15683    where
15684        T: std::iter::IntoIterator<Item = V>,
15685        V: std::convert::Into<std::string::String>,
15686    {
15687        use std::iter::Iterator;
15688        self.unreachable = v.into_iter().map(|i| i.into()).collect();
15689        self
15690    }
15691}
15692
15693impl wkt::message::Message for ListInsightsConfigsResponse {
15694    fn typename() -> &'static str {
15695        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
15696    }
15697}
15698
15699#[doc(hidden)]
15700impl gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
15701    type PageItem = crate::model::InsightsConfig;
15702
15703    fn items(self) -> std::vec::Vec<Self::PageItem> {
15704        self.insights_configs
15705    }
15706
15707    fn next_page_token(&self) -> std::string::String {
15708        use std::clone::Clone;
15709        self.next_page_token.clone()
15710    }
15711}
15712
15713#[doc(hidden)]
15714impl<'de> serde::de::Deserialize<'de> for ListInsightsConfigsResponse {
15715    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15716    where
15717        D: serde::Deserializer<'de>,
15718    {
15719        #[allow(non_camel_case_types)]
15720        #[doc(hidden)]
15721        #[derive(PartialEq, Eq, Hash)]
15722        enum __FieldTag {
15723            __insights_configs,
15724            __next_page_token,
15725            __unreachable,
15726            Unknown(std::string::String),
15727        }
15728        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15729            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15730            where
15731                D: serde::Deserializer<'de>,
15732            {
15733                struct Visitor;
15734                impl<'de> serde::de::Visitor<'de> for Visitor {
15735                    type Value = __FieldTag;
15736                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15737                        formatter.write_str("a field name for ListInsightsConfigsResponse")
15738                    }
15739                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15740                    where
15741                        E: serde::de::Error,
15742                    {
15743                        use std::result::Result::Ok;
15744                        use std::string::ToString;
15745                        match value {
15746                            "insightsConfigs" => Ok(__FieldTag::__insights_configs),
15747                            "insights_configs" => Ok(__FieldTag::__insights_configs),
15748                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
15749                            "next_page_token" => Ok(__FieldTag::__next_page_token),
15750                            "unreachable" => Ok(__FieldTag::__unreachable),
15751                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15752                        }
15753                    }
15754                }
15755                deserializer.deserialize_identifier(Visitor)
15756            }
15757        }
15758        struct Visitor;
15759        impl<'de> serde::de::Visitor<'de> for Visitor {
15760            type Value = ListInsightsConfigsResponse;
15761            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15762                formatter.write_str("struct ListInsightsConfigsResponse")
15763            }
15764            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15765            where
15766                A: serde::de::MapAccess<'de>,
15767            {
15768                #[allow(unused_imports)]
15769                use serde::de::Error;
15770                use std::option::Option::Some;
15771                let mut fields = std::collections::HashSet::new();
15772                let mut result = Self::Value::new();
15773                while let Some(tag) = map.next_key::<__FieldTag>()? {
15774                    #[allow(clippy::match_single_binding)]
15775                    match tag {
15776                        __FieldTag::__insights_configs => {
15777                            if !fields.insert(__FieldTag::__insights_configs) {
15778                                return std::result::Result::Err(A::Error::duplicate_field(
15779                                    "multiple values for insights_configs",
15780                                ));
15781                            }
15782                            result.insights_configs =
15783                                map.next_value::<std::option::Option<
15784                                    std::vec::Vec<crate::model::InsightsConfig>,
15785                                >>()?
15786                                .unwrap_or_default();
15787                        }
15788                        __FieldTag::__next_page_token => {
15789                            if !fields.insert(__FieldTag::__next_page_token) {
15790                                return std::result::Result::Err(A::Error::duplicate_field(
15791                                    "multiple values for next_page_token",
15792                                ));
15793                            }
15794                            result.next_page_token = map
15795                                .next_value::<std::option::Option<std::string::String>>()?
15796                                .unwrap_or_default();
15797                        }
15798                        __FieldTag::__unreachable => {
15799                            if !fields.insert(__FieldTag::__unreachable) {
15800                                return std::result::Result::Err(A::Error::duplicate_field(
15801                                    "multiple values for unreachable",
15802                                ));
15803                            }
15804                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
15805                        }
15806                        __FieldTag::Unknown(key) => {
15807                            let value = map.next_value::<serde_json::Value>()?;
15808                            result._unknown_fields.insert(key, value);
15809                        }
15810                    }
15811                }
15812                std::result::Result::Ok(result)
15813            }
15814        }
15815        deserializer.deserialize_any(Visitor)
15816    }
15817}
15818
15819#[doc(hidden)]
15820impl serde::ser::Serialize for ListInsightsConfigsResponse {
15821    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15822    where
15823        S: serde::ser::Serializer,
15824    {
15825        use serde::ser::SerializeMap;
15826        #[allow(unused_imports)]
15827        use std::option::Option::Some;
15828        let mut state = serializer.serialize_map(std::option::Option::None)?;
15829        if !self.insights_configs.is_empty() {
15830            state.serialize_entry("insightsConfigs", &self.insights_configs)?;
15831        }
15832        if !self.next_page_token.is_empty() {
15833            state.serialize_entry("nextPageToken", &self.next_page_token)?;
15834        }
15835        if !self.unreachable.is_empty() {
15836            state.serialize_entry("unreachable", &self.unreachable)?;
15837        }
15838        if !self._unknown_fields.is_empty() {
15839            for (key, value) in self._unknown_fields.iter() {
15840                state.serialize_entry(key, &value)?;
15841            }
15842        }
15843        state.end()
15844    }
15845}
15846
15847/// Request for deleting an InsightsConfig.
15848#[derive(Clone, Debug, Default, PartialEq)]
15849#[non_exhaustive]
15850pub struct DeleteInsightsConfigRequest {
15851    /// Required. Value for parent.
15852    pub name: std::string::String,
15853
15854    /// Optional. An optional request ID to identify requests. Specify a unique
15855    /// request ID so that if you must retry your request, the server will know to
15856    /// ignore the request if it has already been completed. The server will
15857    /// guarantee that for at least 60 minutes after the first request.
15858    ///
15859    /// For example, consider a situation where you make an initial request and the
15860    /// request times out. If you make the request again with the same request
15861    /// ID, the server can check if original operation with the same request ID
15862    /// was received, and if so, will ignore the second request. This prevents
15863    /// clients from accidentally creating duplicate commitments.
15864    ///
15865    /// The request ID must be a valid UUID with the exception that zero UUID is
15866    /// not supported (00000000-0000-0000-0000-000000000000).
15867    pub request_id: std::string::String,
15868
15869    /// Optional. If set, validate the request, but do not actually post it.
15870    pub validate_only: bool,
15871
15872    /// Optional. This checksum is computed by the server based on the value of
15873    /// other fields, and may be sent on update and delete requests to ensure the
15874    /// client has an up-to-date value before proceeding.
15875    pub etag: std::string::String,
15876
15877    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15878}
15879
15880impl DeleteInsightsConfigRequest {
15881    pub fn new() -> Self {
15882        std::default::Default::default()
15883    }
15884
15885    /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
15886    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15887        self.name = v.into();
15888        self
15889    }
15890
15891    /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
15892    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15893        self.request_id = v.into();
15894        self
15895    }
15896
15897    /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
15898    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15899        self.validate_only = v.into();
15900        self
15901    }
15902
15903    /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
15904    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15905        self.etag = v.into();
15906        self
15907    }
15908}
15909
15910impl wkt::message::Message for DeleteInsightsConfigRequest {
15911    fn typename() -> &'static str {
15912        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
15913    }
15914}
15915
15916#[doc(hidden)]
15917impl<'de> serde::de::Deserialize<'de> for DeleteInsightsConfigRequest {
15918    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15919    where
15920        D: serde::Deserializer<'de>,
15921    {
15922        #[allow(non_camel_case_types)]
15923        #[doc(hidden)]
15924        #[derive(PartialEq, Eq, Hash)]
15925        enum __FieldTag {
15926            __name,
15927            __request_id,
15928            __validate_only,
15929            __etag,
15930            Unknown(std::string::String),
15931        }
15932        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15933            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15934            where
15935                D: serde::Deserializer<'de>,
15936            {
15937                struct Visitor;
15938                impl<'de> serde::de::Visitor<'de> for Visitor {
15939                    type Value = __FieldTag;
15940                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15941                        formatter.write_str("a field name for DeleteInsightsConfigRequest")
15942                    }
15943                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15944                    where
15945                        E: serde::de::Error,
15946                    {
15947                        use std::result::Result::Ok;
15948                        use std::string::ToString;
15949                        match value {
15950                            "name" => Ok(__FieldTag::__name),
15951                            "requestId" => Ok(__FieldTag::__request_id),
15952                            "request_id" => Ok(__FieldTag::__request_id),
15953                            "validateOnly" => Ok(__FieldTag::__validate_only),
15954                            "validate_only" => Ok(__FieldTag::__validate_only),
15955                            "etag" => Ok(__FieldTag::__etag),
15956                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15957                        }
15958                    }
15959                }
15960                deserializer.deserialize_identifier(Visitor)
15961            }
15962        }
15963        struct Visitor;
15964        impl<'de> serde::de::Visitor<'de> for Visitor {
15965            type Value = DeleteInsightsConfigRequest;
15966            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15967                formatter.write_str("struct DeleteInsightsConfigRequest")
15968            }
15969            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15970            where
15971                A: serde::de::MapAccess<'de>,
15972            {
15973                #[allow(unused_imports)]
15974                use serde::de::Error;
15975                use std::option::Option::Some;
15976                let mut fields = std::collections::HashSet::new();
15977                let mut result = Self::Value::new();
15978                while let Some(tag) = map.next_key::<__FieldTag>()? {
15979                    #[allow(clippy::match_single_binding)]
15980                    match tag {
15981                        __FieldTag::__name => {
15982                            if !fields.insert(__FieldTag::__name) {
15983                                return std::result::Result::Err(A::Error::duplicate_field(
15984                                    "multiple values for name",
15985                                ));
15986                            }
15987                            result.name = map
15988                                .next_value::<std::option::Option<std::string::String>>()?
15989                                .unwrap_or_default();
15990                        }
15991                        __FieldTag::__request_id => {
15992                            if !fields.insert(__FieldTag::__request_id) {
15993                                return std::result::Result::Err(A::Error::duplicate_field(
15994                                    "multiple values for request_id",
15995                                ));
15996                            }
15997                            result.request_id = map
15998                                .next_value::<std::option::Option<std::string::String>>()?
15999                                .unwrap_or_default();
16000                        }
16001                        __FieldTag::__validate_only => {
16002                            if !fields.insert(__FieldTag::__validate_only) {
16003                                return std::result::Result::Err(A::Error::duplicate_field(
16004                                    "multiple values for validate_only",
16005                                ));
16006                            }
16007                            result.validate_only = map
16008                                .next_value::<std::option::Option<bool>>()?
16009                                .unwrap_or_default();
16010                        }
16011                        __FieldTag::__etag => {
16012                            if !fields.insert(__FieldTag::__etag) {
16013                                return std::result::Result::Err(A::Error::duplicate_field(
16014                                    "multiple values for etag",
16015                                ));
16016                            }
16017                            result.etag = map
16018                                .next_value::<std::option::Option<std::string::String>>()?
16019                                .unwrap_or_default();
16020                        }
16021                        __FieldTag::Unknown(key) => {
16022                            let value = map.next_value::<serde_json::Value>()?;
16023                            result._unknown_fields.insert(key, value);
16024                        }
16025                    }
16026                }
16027                std::result::Result::Ok(result)
16028            }
16029        }
16030        deserializer.deserialize_any(Visitor)
16031    }
16032}
16033
16034#[doc(hidden)]
16035impl serde::ser::Serialize for DeleteInsightsConfigRequest {
16036    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16037    where
16038        S: serde::ser::Serializer,
16039    {
16040        use serde::ser::SerializeMap;
16041        #[allow(unused_imports)]
16042        use std::option::Option::Some;
16043        let mut state = serializer.serialize_map(std::option::Option::None)?;
16044        if !self.name.is_empty() {
16045            state.serialize_entry("name", &self.name)?;
16046        }
16047        if !self.request_id.is_empty() {
16048            state.serialize_entry("requestId", &self.request_id)?;
16049        }
16050        if !wkt::internal::is_default(&self.validate_only) {
16051            state.serialize_entry("validateOnly", &self.validate_only)?;
16052        }
16053        if !self.etag.is_empty() {
16054            state.serialize_entry("etag", &self.etag)?;
16055        }
16056        if !self._unknown_fields.is_empty() {
16057            for (key, value) in self._unknown_fields.iter() {
16058                state.serialize_entry(key, &value)?;
16059            }
16060        }
16061        state.end()
16062    }
16063}
16064
16065/// Request for updating an InsightsConfig.
16066#[derive(Clone, Debug, Default, PartialEq)]
16067#[non_exhaustive]
16068pub struct UpdateInsightsConfigRequest {
16069    /// Required. The resource being updated.
16070    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
16071
16072    /// Optional. An optional request ID to identify requests. Specify a unique
16073    /// request ID so that if you must retry your request, the server will know to
16074    /// ignore the request if it has already been completed. The server will
16075    /// guarantee that for at least 60 minutes after the first request.
16076    ///
16077    /// For example, consider a situation where you make an initial request and the
16078    /// request times out. If you make the request again with the same request
16079    /// ID, the server can check if original operation with the same request ID
16080    /// was received, and if so, will ignore the second request. This prevents
16081    /// clients from accidentally creating duplicate commitments.
16082    ///
16083    /// The request ID must be a valid UUID with the exception that zero UUID is
16084    /// not supported (00000000-0000-0000-0000-000000000000).
16085    pub request_id: std::string::String,
16086
16087    /// Optional. If set to true, and the insightsConfig is not found a new
16088    /// insightsConfig will be created. In this situation `update_mask` is ignored.
16089    /// The creation will succeed only if the input insightsConfig has all the
16090    /// necessary information (e.g a github_config with both  user_oauth_token and
16091    /// installation_id properties).
16092    pub allow_missing: bool,
16093
16094    /// Optional. If set, validate the request, but do not actually post it.
16095    pub validate_only: bool,
16096
16097    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16098}
16099
16100impl UpdateInsightsConfigRequest {
16101    pub fn new() -> Self {
16102        std::default::Default::default()
16103    }
16104
16105    /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
16106    pub fn set_insights_config<T>(mut self, v: T) -> Self
16107    where
16108        T: std::convert::Into<crate::model::InsightsConfig>,
16109    {
16110        self.insights_config = std::option::Option::Some(v.into());
16111        self
16112    }
16113
16114    /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
16115    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
16116    where
16117        T: std::convert::Into<crate::model::InsightsConfig>,
16118    {
16119        self.insights_config = v.map(|x| x.into());
16120        self
16121    }
16122
16123    /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
16124    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16125        self.request_id = v.into();
16126        self
16127    }
16128
16129    /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
16130    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16131        self.allow_missing = v.into();
16132        self
16133    }
16134
16135    /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
16136    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16137        self.validate_only = v.into();
16138        self
16139    }
16140}
16141
16142impl wkt::message::Message for UpdateInsightsConfigRequest {
16143    fn typename() -> &'static str {
16144        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
16145    }
16146}
16147
16148#[doc(hidden)]
16149impl<'de> serde::de::Deserialize<'de> for UpdateInsightsConfigRequest {
16150    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16151    where
16152        D: serde::Deserializer<'de>,
16153    {
16154        #[allow(non_camel_case_types)]
16155        #[doc(hidden)]
16156        #[derive(PartialEq, Eq, Hash)]
16157        enum __FieldTag {
16158            __insights_config,
16159            __request_id,
16160            __allow_missing,
16161            __validate_only,
16162            Unknown(std::string::String),
16163        }
16164        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16165            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16166            where
16167                D: serde::Deserializer<'de>,
16168            {
16169                struct Visitor;
16170                impl<'de> serde::de::Visitor<'de> for Visitor {
16171                    type Value = __FieldTag;
16172                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16173                        formatter.write_str("a field name for UpdateInsightsConfigRequest")
16174                    }
16175                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16176                    where
16177                        E: serde::de::Error,
16178                    {
16179                        use std::result::Result::Ok;
16180                        use std::string::ToString;
16181                        match value {
16182                            "insightsConfig" => Ok(__FieldTag::__insights_config),
16183                            "insights_config" => Ok(__FieldTag::__insights_config),
16184                            "requestId" => Ok(__FieldTag::__request_id),
16185                            "request_id" => Ok(__FieldTag::__request_id),
16186                            "allowMissing" => Ok(__FieldTag::__allow_missing),
16187                            "allow_missing" => Ok(__FieldTag::__allow_missing),
16188                            "validateOnly" => Ok(__FieldTag::__validate_only),
16189                            "validate_only" => Ok(__FieldTag::__validate_only),
16190                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16191                        }
16192                    }
16193                }
16194                deserializer.deserialize_identifier(Visitor)
16195            }
16196        }
16197        struct Visitor;
16198        impl<'de> serde::de::Visitor<'de> for Visitor {
16199            type Value = UpdateInsightsConfigRequest;
16200            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16201                formatter.write_str("struct UpdateInsightsConfigRequest")
16202            }
16203            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16204            where
16205                A: serde::de::MapAccess<'de>,
16206            {
16207                #[allow(unused_imports)]
16208                use serde::de::Error;
16209                use std::option::Option::Some;
16210                let mut fields = std::collections::HashSet::new();
16211                let mut result = Self::Value::new();
16212                while let Some(tag) = map.next_key::<__FieldTag>()? {
16213                    #[allow(clippy::match_single_binding)]
16214                    match tag {
16215                        __FieldTag::__insights_config => {
16216                            if !fields.insert(__FieldTag::__insights_config) {
16217                                return std::result::Result::Err(A::Error::duplicate_field(
16218                                    "multiple values for insights_config",
16219                                ));
16220                            }
16221                            result.insights_config = map
16222                                .next_value::<std::option::Option<crate::model::InsightsConfig>>(
16223                                )?;
16224                        }
16225                        __FieldTag::__request_id => {
16226                            if !fields.insert(__FieldTag::__request_id) {
16227                                return std::result::Result::Err(A::Error::duplicate_field(
16228                                    "multiple values for request_id",
16229                                ));
16230                            }
16231                            result.request_id = map
16232                                .next_value::<std::option::Option<std::string::String>>()?
16233                                .unwrap_or_default();
16234                        }
16235                        __FieldTag::__allow_missing => {
16236                            if !fields.insert(__FieldTag::__allow_missing) {
16237                                return std::result::Result::Err(A::Error::duplicate_field(
16238                                    "multiple values for allow_missing",
16239                                ));
16240                            }
16241                            result.allow_missing = map
16242                                .next_value::<std::option::Option<bool>>()?
16243                                .unwrap_or_default();
16244                        }
16245                        __FieldTag::__validate_only => {
16246                            if !fields.insert(__FieldTag::__validate_only) {
16247                                return std::result::Result::Err(A::Error::duplicate_field(
16248                                    "multiple values for validate_only",
16249                                ));
16250                            }
16251                            result.validate_only = map
16252                                .next_value::<std::option::Option<bool>>()?
16253                                .unwrap_or_default();
16254                        }
16255                        __FieldTag::Unknown(key) => {
16256                            let value = map.next_value::<serde_json::Value>()?;
16257                            result._unknown_fields.insert(key, value);
16258                        }
16259                    }
16260                }
16261                std::result::Result::Ok(result)
16262            }
16263        }
16264        deserializer.deserialize_any(Visitor)
16265    }
16266}
16267
16268#[doc(hidden)]
16269impl serde::ser::Serialize for UpdateInsightsConfigRequest {
16270    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16271    where
16272        S: serde::ser::Serializer,
16273    {
16274        use serde::ser::SerializeMap;
16275        #[allow(unused_imports)]
16276        use std::option::Option::Some;
16277        let mut state = serializer.serialize_map(std::option::Option::None)?;
16278        if self.insights_config.is_some() {
16279            state.serialize_entry("insightsConfig", &self.insights_config)?;
16280        }
16281        if !self.request_id.is_empty() {
16282            state.serialize_entry("requestId", &self.request_id)?;
16283        }
16284        if !wkt::internal::is_default(&self.allow_missing) {
16285            state.serialize_entry("allowMissing", &self.allow_missing)?;
16286        }
16287        if !wkt::internal::is_default(&self.validate_only) {
16288            state.serialize_entry("validateOnly", &self.validate_only)?;
16289        }
16290        if !self._unknown_fields.is_empty() {
16291            for (key, value) in self._unknown_fields.iter() {
16292                state.serialize_entry(key, &value)?;
16293            }
16294        }
16295        state.end()
16296    }
16297}
16298
16299/// SystemProvider is a list of providers that are owned by Developer Connect.
16300///
16301/// # Working with unknown values
16302///
16303/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16304/// additional enum variants at any time. Adding new variants is not considered
16305/// a breaking change. Applications should write their code in anticipation of:
16306///
16307/// - New values appearing in future releases of the client library, **and**
16308/// - New values received dynamically, without application changes.
16309///
16310/// Please consult the [Working with enums] section in the user guide for some
16311/// guidelines.
16312///
16313/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16314#[derive(Clone, Debug, PartialEq)]
16315#[non_exhaustive]
16316pub enum SystemProvider {
16317    /// No system provider specified.
16318    Unspecified,
16319    /// GitHub provider.
16320    /// Scopes can be found at
16321    /// <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes>
16322    Github,
16323    /// GitLab provider.
16324    /// Scopes can be found at
16325    /// <https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes>
16326    Gitlab,
16327    /// Google provider.
16328    /// Recommended scopes:
16329    /// `https://www.googleapis.com/auth/drive.readonly`,
16330    /// `https://www.googleapis.com/auth/documents.readonly`
16331    Google,
16332    /// Sentry provider.
16333    /// Scopes can be found at
16334    /// <https://docs.sentry.io/api/permissions/>
16335    Sentry,
16336    /// Rovo provider.
16337    /// Must select the "rovo" scope.
16338    Rovo,
16339    /// New Relic provider.
16340    /// No scopes are allowed.
16341    NewRelic,
16342    /// Datastax provider.
16343    /// No scopes are allowed.
16344    Datastax,
16345    /// Dynatrace provider.
16346    Dynatrace,
16347    /// If set, the enum was initialized with an unknown value.
16348    ///
16349    /// Applications can examine the value using [SystemProvider::value] or
16350    /// [SystemProvider::name].
16351    UnknownValue(system_provider::UnknownValue),
16352}
16353
16354#[doc(hidden)]
16355pub mod system_provider {
16356    #[allow(unused_imports)]
16357    use super::*;
16358    #[derive(Clone, Debug, PartialEq)]
16359    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16360}
16361
16362impl SystemProvider {
16363    /// Gets the enum value.
16364    ///
16365    /// Returns `None` if the enum contains an unknown value deserialized from
16366    /// the string representation of enums.
16367    pub fn value(&self) -> std::option::Option<i32> {
16368        match self {
16369            Self::Unspecified => std::option::Option::Some(0),
16370            Self::Github => std::option::Option::Some(1),
16371            Self::Gitlab => std::option::Option::Some(2),
16372            Self::Google => std::option::Option::Some(3),
16373            Self::Sentry => std::option::Option::Some(4),
16374            Self::Rovo => std::option::Option::Some(5),
16375            Self::NewRelic => std::option::Option::Some(6),
16376            Self::Datastax => std::option::Option::Some(7),
16377            Self::Dynatrace => std::option::Option::Some(8),
16378            Self::UnknownValue(u) => u.0.value(),
16379        }
16380    }
16381
16382    /// Gets the enum value as a string.
16383    ///
16384    /// Returns `None` if the enum contains an unknown value deserialized from
16385    /// the integer representation of enums.
16386    pub fn name(&self) -> std::option::Option<&str> {
16387        match self {
16388            Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
16389            Self::Github => std::option::Option::Some("GITHUB"),
16390            Self::Gitlab => std::option::Option::Some("GITLAB"),
16391            Self::Google => std::option::Option::Some("GOOGLE"),
16392            Self::Sentry => std::option::Option::Some("SENTRY"),
16393            Self::Rovo => std::option::Option::Some("ROVO"),
16394            Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
16395            Self::Datastax => std::option::Option::Some("DATASTAX"),
16396            Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
16397            Self::UnknownValue(u) => u.0.name(),
16398        }
16399    }
16400}
16401
16402impl std::default::Default for SystemProvider {
16403    fn default() -> Self {
16404        use std::convert::From;
16405        Self::from(0)
16406    }
16407}
16408
16409impl std::fmt::Display for SystemProvider {
16410    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16411        wkt::internal::display_enum(f, self.name(), self.value())
16412    }
16413}
16414
16415impl std::convert::From<i32> for SystemProvider {
16416    fn from(value: i32) -> Self {
16417        match value {
16418            0 => Self::Unspecified,
16419            1 => Self::Github,
16420            2 => Self::Gitlab,
16421            3 => Self::Google,
16422            4 => Self::Sentry,
16423            5 => Self::Rovo,
16424            6 => Self::NewRelic,
16425            7 => Self::Datastax,
16426            8 => Self::Dynatrace,
16427            _ => Self::UnknownValue(system_provider::UnknownValue(
16428                wkt::internal::UnknownEnumValue::Integer(value),
16429            )),
16430        }
16431    }
16432}
16433
16434impl std::convert::From<&str> for SystemProvider {
16435    fn from(value: &str) -> Self {
16436        use std::string::ToString;
16437        match value {
16438            "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
16439            "GITHUB" => Self::Github,
16440            "GITLAB" => Self::Gitlab,
16441            "GOOGLE" => Self::Google,
16442            "SENTRY" => Self::Sentry,
16443            "ROVO" => Self::Rovo,
16444            "NEW_RELIC" => Self::NewRelic,
16445            "DATASTAX" => Self::Datastax,
16446            "DYNATRACE" => Self::Dynatrace,
16447            _ => Self::UnknownValue(system_provider::UnknownValue(
16448                wkt::internal::UnknownEnumValue::String(value.to_string()),
16449            )),
16450        }
16451    }
16452}
16453
16454impl serde::ser::Serialize for SystemProvider {
16455    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16456    where
16457        S: serde::Serializer,
16458    {
16459        match self {
16460            Self::Unspecified => serializer.serialize_i32(0),
16461            Self::Github => serializer.serialize_i32(1),
16462            Self::Gitlab => serializer.serialize_i32(2),
16463            Self::Google => serializer.serialize_i32(3),
16464            Self::Sentry => serializer.serialize_i32(4),
16465            Self::Rovo => serializer.serialize_i32(5),
16466            Self::NewRelic => serializer.serialize_i32(6),
16467            Self::Datastax => serializer.serialize_i32(7),
16468            Self::Dynatrace => serializer.serialize_i32(8),
16469            Self::UnknownValue(u) => u.0.serialize(serializer),
16470        }
16471    }
16472}
16473
16474impl<'de> serde::de::Deserialize<'de> for SystemProvider {
16475    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16476    where
16477        D: serde::Deserializer<'de>,
16478    {
16479        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
16480            ".google.cloud.developerconnect.v1.SystemProvider",
16481        ))
16482    }
16483}