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