Skip to main content

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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Message for requesting a list of Users
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct ListUsersRequest {
43    /// Required. Parent value for ListUsersRequest
44    pub parent: std::string::String,
45
46    /// Optional. Requested page size. Server may return fewer items than
47    /// requested. If unspecified, server will pick an appropriate default.
48    pub page_size: i32,
49
50    /// Optional. A token identifying a page of results the server should return.
51    pub page_token: std::string::String,
52
53    /// Optional. Filtering results
54    pub filter: std::string::String,
55
56    /// Optional. Hint for how to order the results
57    pub order_by: std::string::String,
58
59    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl ListUsersRequest {
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [parent][crate::model::ListUsersRequest::parent].
68    ///
69    /// # Example
70    /// ```ignore,no_run
71    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
72    /// let x = ListUsersRequest::new().set_parent("example");
73    /// ```
74    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75        self.parent = v.into();
76        self
77    }
78
79    /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
80    ///
81    /// # Example
82    /// ```ignore,no_run
83    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
84    /// let x = ListUsersRequest::new().set_page_size(42);
85    /// ```
86    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
87        self.page_size = v.into();
88        self
89    }
90
91    /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
92    ///
93    /// # Example
94    /// ```ignore,no_run
95    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
96    /// let x = ListUsersRequest::new().set_page_token("example");
97    /// ```
98    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99        self.page_token = v.into();
100        self
101    }
102
103    /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
104    ///
105    /// # Example
106    /// ```ignore,no_run
107    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
108    /// let x = ListUsersRequest::new().set_filter("example");
109    /// ```
110    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111        self.filter = v.into();
112        self
113    }
114
115    /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
116    ///
117    /// # Example
118    /// ```ignore,no_run
119    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
120    /// let x = ListUsersRequest::new().set_order_by("example");
121    /// ```
122    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
123        self.order_by = v.into();
124        self
125    }
126}
127
128impl wkt::message::Message for ListUsersRequest {
129    fn typename() -> &'static str {
130        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
131    }
132}
133
134/// Message for response to listing Users
135#[derive(Clone, Default, PartialEq)]
136#[non_exhaustive]
137pub struct ListUsersResponse {
138    /// The list of Users
139    pub users: std::vec::Vec<crate::model::User>,
140
141    /// A token identifying a page of results the server should return.
142    pub next_page_token: std::string::String,
143
144    /// Locations that could not be reached.
145    pub unreachable: std::vec::Vec<std::string::String>,
146
147    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
148}
149
150impl ListUsersResponse {
151    pub fn new() -> Self {
152        std::default::Default::default()
153    }
154
155    /// Sets the value of [users][crate::model::ListUsersResponse::users].
156    ///
157    /// # Example
158    /// ```ignore,no_run
159    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
160    /// use google_cloud_developerconnect_v1::model::User;
161    /// let x = ListUsersResponse::new()
162    ///     .set_users([
163    ///         User::default()/* use setters */,
164    ///         User::default()/* use (different) setters */,
165    ///     ]);
166    /// ```
167    pub fn set_users<T, V>(mut self, v: T) -> Self
168    where
169        T: std::iter::IntoIterator<Item = V>,
170        V: std::convert::Into<crate::model::User>,
171    {
172        use std::iter::Iterator;
173        self.users = v.into_iter().map(|i| i.into()).collect();
174        self
175    }
176
177    /// Sets the value of [next_page_token][crate::model::ListUsersResponse::next_page_token].
178    ///
179    /// # Example
180    /// ```ignore,no_run
181    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
182    /// let x = ListUsersResponse::new().set_next_page_token("example");
183    /// ```
184    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
185        self.next_page_token = v.into();
186        self
187    }
188
189    /// Sets the value of [unreachable][crate::model::ListUsersResponse::unreachable].
190    ///
191    /// # Example
192    /// ```ignore,no_run
193    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
194    /// let x = ListUsersResponse::new().set_unreachable(["a", "b", "c"]);
195    /// ```
196    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
197    where
198        T: std::iter::IntoIterator<Item = V>,
199        V: std::convert::Into<std::string::String>,
200    {
201        use std::iter::Iterator;
202        self.unreachable = v.into_iter().map(|i| i.into()).collect();
203        self
204    }
205}
206
207impl wkt::message::Message for ListUsersResponse {
208    fn typename() -> &'static str {
209        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
210    }
211}
212
213#[doc(hidden)]
214impl google_cloud_gax::paginator::internal::PageableResponse for ListUsersResponse {
215    type PageItem = crate::model::User;
216
217    fn items(self) -> std::vec::Vec<Self::PageItem> {
218        self.users
219    }
220
221    fn next_page_token(&self) -> std::string::String {
222        use std::clone::Clone;
223        self.next_page_token.clone()
224    }
225}
226
227/// Message describing Connection object
228#[derive(Clone, Default, PartialEq)]
229#[non_exhaustive]
230pub struct Connection {
231    /// Identifier. The resource name of the connection, in the format
232    /// `projects/{project}/locations/{location}/connections/{connection_id}`.
233    pub name: std::string::String,
234
235    /// Output only. [Output only] Create timestamp
236    pub create_time: std::option::Option<wkt::Timestamp>,
237
238    /// Output only. [Output only] Update timestamp
239    pub update_time: std::option::Option<wkt::Timestamp>,
240
241    /// Output only. [Output only] Delete timestamp
242    pub delete_time: std::option::Option<wkt::Timestamp>,
243
244    /// Optional. Labels as key value pairs
245    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
246
247    /// Output only. Installation state of the Connection.
248    pub installation_state: std::option::Option<crate::model::InstallationState>,
249
250    /// Optional. If disabled is set to true, functionality is disabled for this
251    /// connection. Repository based API methods and webhooks processing for
252    /// repositories in this connection will be disabled.
253    pub disabled: bool,
254
255    /// Output only. Set to true when the connection is being set up or updated in
256    /// the background.
257    pub reconciling: bool,
258
259    /// Optional. Allows clients to store small amounts of arbitrary data.
260    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
261
262    /// Optional. This checksum is computed by the server based on the value of
263    /// other fields, and may be sent on update and delete requests to ensure the
264    /// client has an up-to-date value before proceeding.
265    pub etag: std::string::String,
266
267    /// Output only. A system-assigned unique identifier for the Connection.
268    pub uid: std::string::String,
269
270    /// Optional. The crypto key configuration. This field is used by the
271    /// Customer-Managed Encryption Keys (CMEK) feature.
272    pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
273
274    /// Optional. Configuration for the git proxy feature. Enabling the git proxy
275    /// allows clients to perform git operations on the repositories linked in the
276    /// connection.
277    pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
278
279    /// Configuration for the connection depending on the type of provider.
280    pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
281
282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
283}
284
285impl Connection {
286    pub fn new() -> Self {
287        std::default::Default::default()
288    }
289
290    /// Sets the value of [name][crate::model::Connection::name].
291    ///
292    /// # Example
293    /// ```ignore,no_run
294    /// # use google_cloud_developerconnect_v1::model::Connection;
295    /// let x = Connection::new().set_name("example");
296    /// ```
297    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
298        self.name = v.into();
299        self
300    }
301
302    /// Sets the value of [create_time][crate::model::Connection::create_time].
303    ///
304    /// # Example
305    /// ```ignore,no_run
306    /// # use google_cloud_developerconnect_v1::model::Connection;
307    /// use wkt::Timestamp;
308    /// let x = Connection::new().set_create_time(Timestamp::default()/* use setters */);
309    /// ```
310    pub fn set_create_time<T>(mut self, v: T) -> Self
311    where
312        T: std::convert::Into<wkt::Timestamp>,
313    {
314        self.create_time = std::option::Option::Some(v.into());
315        self
316    }
317
318    /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
319    ///
320    /// # Example
321    /// ```ignore,no_run
322    /// # use google_cloud_developerconnect_v1::model::Connection;
323    /// use wkt::Timestamp;
324    /// let x = Connection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
325    /// let x = Connection::new().set_or_clear_create_time(None::<Timestamp>);
326    /// ```
327    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
328    where
329        T: std::convert::Into<wkt::Timestamp>,
330    {
331        self.create_time = v.map(|x| x.into());
332        self
333    }
334
335    /// Sets the value of [update_time][crate::model::Connection::update_time].
336    ///
337    /// # Example
338    /// ```ignore,no_run
339    /// # use google_cloud_developerconnect_v1::model::Connection;
340    /// use wkt::Timestamp;
341    /// let x = Connection::new().set_update_time(Timestamp::default()/* use setters */);
342    /// ```
343    pub fn set_update_time<T>(mut self, v: T) -> Self
344    where
345        T: std::convert::Into<wkt::Timestamp>,
346    {
347        self.update_time = std::option::Option::Some(v.into());
348        self
349    }
350
351    /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
352    ///
353    /// # Example
354    /// ```ignore,no_run
355    /// # use google_cloud_developerconnect_v1::model::Connection;
356    /// use wkt::Timestamp;
357    /// let x = Connection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
358    /// let x = Connection::new().set_or_clear_update_time(None::<Timestamp>);
359    /// ```
360    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
361    where
362        T: std::convert::Into<wkt::Timestamp>,
363    {
364        self.update_time = v.map(|x| x.into());
365        self
366    }
367
368    /// Sets the value of [delete_time][crate::model::Connection::delete_time].
369    ///
370    /// # Example
371    /// ```ignore,no_run
372    /// # use google_cloud_developerconnect_v1::model::Connection;
373    /// use wkt::Timestamp;
374    /// let x = Connection::new().set_delete_time(Timestamp::default()/* use setters */);
375    /// ```
376    pub fn set_delete_time<T>(mut self, v: T) -> Self
377    where
378        T: std::convert::Into<wkt::Timestamp>,
379    {
380        self.delete_time = std::option::Option::Some(v.into());
381        self
382    }
383
384    /// Sets or clears the value of [delete_time][crate::model::Connection::delete_time].
385    ///
386    /// # Example
387    /// ```ignore,no_run
388    /// # use google_cloud_developerconnect_v1::model::Connection;
389    /// use wkt::Timestamp;
390    /// let x = Connection::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
391    /// let x = Connection::new().set_or_clear_delete_time(None::<Timestamp>);
392    /// ```
393    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
394    where
395        T: std::convert::Into<wkt::Timestamp>,
396    {
397        self.delete_time = v.map(|x| x.into());
398        self
399    }
400
401    /// Sets the value of [labels][crate::model::Connection::labels].
402    ///
403    /// # Example
404    /// ```ignore,no_run
405    /// # use google_cloud_developerconnect_v1::model::Connection;
406    /// let x = Connection::new().set_labels([
407    ///     ("key0", "abc"),
408    ///     ("key1", "xyz"),
409    /// ]);
410    /// ```
411    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
412    where
413        T: std::iter::IntoIterator<Item = (K, V)>,
414        K: std::convert::Into<std::string::String>,
415        V: std::convert::Into<std::string::String>,
416    {
417        use std::iter::Iterator;
418        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
419        self
420    }
421
422    /// Sets the value of [installation_state][crate::model::Connection::installation_state].
423    ///
424    /// # Example
425    /// ```ignore,no_run
426    /// # use google_cloud_developerconnect_v1::model::Connection;
427    /// use google_cloud_developerconnect_v1::model::InstallationState;
428    /// let x = Connection::new().set_installation_state(InstallationState::default()/* use setters */);
429    /// ```
430    pub fn set_installation_state<T>(mut self, v: T) -> Self
431    where
432        T: std::convert::Into<crate::model::InstallationState>,
433    {
434        self.installation_state = std::option::Option::Some(v.into());
435        self
436    }
437
438    /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
439    ///
440    /// # Example
441    /// ```ignore,no_run
442    /// # use google_cloud_developerconnect_v1::model::Connection;
443    /// use google_cloud_developerconnect_v1::model::InstallationState;
444    /// let x = Connection::new().set_or_clear_installation_state(Some(InstallationState::default()/* use setters */));
445    /// let x = Connection::new().set_or_clear_installation_state(None::<InstallationState>);
446    /// ```
447    pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
448    where
449        T: std::convert::Into<crate::model::InstallationState>,
450    {
451        self.installation_state = v.map(|x| x.into());
452        self
453    }
454
455    /// Sets the value of [disabled][crate::model::Connection::disabled].
456    ///
457    /// # Example
458    /// ```ignore,no_run
459    /// # use google_cloud_developerconnect_v1::model::Connection;
460    /// let x = Connection::new().set_disabled(true);
461    /// ```
462    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
463        self.disabled = v.into();
464        self
465    }
466
467    /// Sets the value of [reconciling][crate::model::Connection::reconciling].
468    ///
469    /// # Example
470    /// ```ignore,no_run
471    /// # use google_cloud_developerconnect_v1::model::Connection;
472    /// let x = Connection::new().set_reconciling(true);
473    /// ```
474    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
475        self.reconciling = v.into();
476        self
477    }
478
479    /// Sets the value of [annotations][crate::model::Connection::annotations].
480    ///
481    /// # Example
482    /// ```ignore,no_run
483    /// # use google_cloud_developerconnect_v1::model::Connection;
484    /// let x = Connection::new().set_annotations([
485    ///     ("key0", "abc"),
486    ///     ("key1", "xyz"),
487    /// ]);
488    /// ```
489    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
490    where
491        T: std::iter::IntoIterator<Item = (K, V)>,
492        K: std::convert::Into<std::string::String>,
493        V: std::convert::Into<std::string::String>,
494    {
495        use std::iter::Iterator;
496        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
497        self
498    }
499
500    /// Sets the value of [etag][crate::model::Connection::etag].
501    ///
502    /// # Example
503    /// ```ignore,no_run
504    /// # use google_cloud_developerconnect_v1::model::Connection;
505    /// let x = Connection::new().set_etag("example");
506    /// ```
507    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
508        self.etag = v.into();
509        self
510    }
511
512    /// Sets the value of [uid][crate::model::Connection::uid].
513    ///
514    /// # Example
515    /// ```ignore,no_run
516    /// # use google_cloud_developerconnect_v1::model::Connection;
517    /// let x = Connection::new().set_uid("example");
518    /// ```
519    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
520        self.uid = v.into();
521        self
522    }
523
524    /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
525    ///
526    /// # Example
527    /// ```ignore,no_run
528    /// # use google_cloud_developerconnect_v1::model::Connection;
529    /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
530    /// let x = Connection::new().set_crypto_key_config(CryptoKeyConfig::default()/* use setters */);
531    /// ```
532    pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
533    where
534        T: std::convert::Into<crate::model::CryptoKeyConfig>,
535    {
536        self.crypto_key_config = std::option::Option::Some(v.into());
537        self
538    }
539
540    /// Sets or clears the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
541    ///
542    /// # Example
543    /// ```ignore,no_run
544    /// # use google_cloud_developerconnect_v1::model::Connection;
545    /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
546    /// let x = Connection::new().set_or_clear_crypto_key_config(Some(CryptoKeyConfig::default()/* use setters */));
547    /// let x = Connection::new().set_or_clear_crypto_key_config(None::<CryptoKeyConfig>);
548    /// ```
549    pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
550    where
551        T: std::convert::Into<crate::model::CryptoKeyConfig>,
552    {
553        self.crypto_key_config = v.map(|x| x.into());
554        self
555    }
556
557    /// Sets the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
558    ///
559    /// # Example
560    /// ```ignore,no_run
561    /// # use google_cloud_developerconnect_v1::model::Connection;
562    /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
563    /// let x = Connection::new().set_git_proxy_config(GitProxyConfig::default()/* use setters */);
564    /// ```
565    pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
566    where
567        T: std::convert::Into<crate::model::GitProxyConfig>,
568    {
569        self.git_proxy_config = std::option::Option::Some(v.into());
570        self
571    }
572
573    /// Sets or clears the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
574    ///
575    /// # Example
576    /// ```ignore,no_run
577    /// # use google_cloud_developerconnect_v1::model::Connection;
578    /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
579    /// let x = Connection::new().set_or_clear_git_proxy_config(Some(GitProxyConfig::default()/* use setters */));
580    /// let x = Connection::new().set_or_clear_git_proxy_config(None::<GitProxyConfig>);
581    /// ```
582    pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
583    where
584        T: std::convert::Into<crate::model::GitProxyConfig>,
585    {
586        self.git_proxy_config = v.map(|x| x.into());
587        self
588    }
589
590    /// Sets the value of [connection_config][crate::model::Connection::connection_config].
591    ///
592    /// Note that all the setters affecting `connection_config` are mutually
593    /// exclusive.
594    ///
595    /// # Example
596    /// ```ignore,no_run
597    /// # use google_cloud_developerconnect_v1::model::Connection;
598    /// use google_cloud_developerconnect_v1::model::GitHubConfig;
599    /// let x = Connection::new().set_connection_config(Some(
600    ///     google_cloud_developerconnect_v1::model::connection::ConnectionConfig::GithubConfig(GitHubConfig::default().into())));
601    /// ```
602    pub fn set_connection_config<
603        T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
604    >(
605        mut self,
606        v: T,
607    ) -> Self {
608        self.connection_config = v.into();
609        self
610    }
611
612    /// The value of [connection_config][crate::model::Connection::connection_config]
613    /// if it holds a `GithubConfig`, `None` if the field is not set or
614    /// holds a different branch.
615    pub fn github_config(
616        &self,
617    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
618        #[allow(unreachable_patterns)]
619        self.connection_config.as_ref().and_then(|v| match v {
620            crate::model::connection::ConnectionConfig::GithubConfig(v) => {
621                std::option::Option::Some(v)
622            }
623            _ => std::option::Option::None,
624        })
625    }
626
627    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
628    /// to hold a `GithubConfig`.
629    ///
630    /// Note that all the setters affecting `connection_config` are
631    /// mutually exclusive.
632    ///
633    /// # Example
634    /// ```ignore,no_run
635    /// # use google_cloud_developerconnect_v1::model::Connection;
636    /// use google_cloud_developerconnect_v1::model::GitHubConfig;
637    /// let x = Connection::new().set_github_config(GitHubConfig::default()/* use setters */);
638    /// assert!(x.github_config().is_some());
639    /// assert!(x.github_enterprise_config().is_none());
640    /// assert!(x.gitlab_config().is_none());
641    /// assert!(x.gitlab_enterprise_config().is_none());
642    /// assert!(x.bitbucket_data_center_config().is_none());
643    /// assert!(x.bitbucket_cloud_config().is_none());
644    /// assert!(x.secure_source_manager_instance_config().is_none());
645    /// assert!(x.http_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    /// assert!(x.secure_source_manager_instance_config().is_none());
690    /// assert!(x.http_config().is_none());
691    /// ```
692    pub fn set_github_enterprise_config<
693        T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
694    >(
695        mut self,
696        v: T,
697    ) -> Self {
698        self.connection_config = std::option::Option::Some(
699            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
700        );
701        self
702    }
703
704    /// The value of [connection_config][crate::model::Connection::connection_config]
705    /// if it holds a `GitlabConfig`, `None` if the field is not set or
706    /// holds a different branch.
707    pub fn gitlab_config(
708        &self,
709    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
710        #[allow(unreachable_patterns)]
711        self.connection_config.as_ref().and_then(|v| match v {
712            crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
713                std::option::Option::Some(v)
714            }
715            _ => std::option::Option::None,
716        })
717    }
718
719    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
720    /// to hold a `GitlabConfig`.
721    ///
722    /// Note that all the setters affecting `connection_config` are
723    /// mutually exclusive.
724    ///
725    /// # Example
726    /// ```ignore,no_run
727    /// # use google_cloud_developerconnect_v1::model::Connection;
728    /// use google_cloud_developerconnect_v1::model::GitLabConfig;
729    /// let x = Connection::new().set_gitlab_config(GitLabConfig::default()/* use setters */);
730    /// assert!(x.gitlab_config().is_some());
731    /// assert!(x.github_config().is_none());
732    /// assert!(x.github_enterprise_config().is_none());
733    /// assert!(x.gitlab_enterprise_config().is_none());
734    /// assert!(x.bitbucket_data_center_config().is_none());
735    /// assert!(x.bitbucket_cloud_config().is_none());
736    /// assert!(x.secure_source_manager_instance_config().is_none());
737    /// assert!(x.http_config().is_none());
738    /// ```
739    pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
740        mut self,
741        v: T,
742    ) -> Self {
743        self.connection_config = std::option::Option::Some(
744            crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
745        );
746        self
747    }
748
749    /// The value of [connection_config][crate::model::Connection::connection_config]
750    /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
751    /// holds a different branch.
752    pub fn gitlab_enterprise_config(
753        &self,
754    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
755        #[allow(unreachable_patterns)]
756        self.connection_config.as_ref().and_then(|v| match v {
757            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
758                std::option::Option::Some(v)
759            }
760            _ => std::option::Option::None,
761        })
762    }
763
764    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
765    /// to hold a `GitlabEnterpriseConfig`.
766    ///
767    /// Note that all the setters affecting `connection_config` are
768    /// mutually exclusive.
769    ///
770    /// # Example
771    /// ```ignore,no_run
772    /// # use google_cloud_developerconnect_v1::model::Connection;
773    /// use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
774    /// let x = Connection::new().set_gitlab_enterprise_config(GitLabEnterpriseConfig::default()/* use setters */);
775    /// assert!(x.gitlab_enterprise_config().is_some());
776    /// assert!(x.github_config().is_none());
777    /// assert!(x.github_enterprise_config().is_none());
778    /// assert!(x.gitlab_config().is_none());
779    /// assert!(x.bitbucket_data_center_config().is_none());
780    /// assert!(x.bitbucket_cloud_config().is_none());
781    /// assert!(x.secure_source_manager_instance_config().is_none());
782    /// assert!(x.http_config().is_none());
783    /// ```
784    pub fn set_gitlab_enterprise_config<
785        T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
786    >(
787        mut self,
788        v: T,
789    ) -> Self {
790        self.connection_config = std::option::Option::Some(
791            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
792        );
793        self
794    }
795
796    /// The value of [connection_config][crate::model::Connection::connection_config]
797    /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
798    /// holds a different branch.
799    pub fn bitbucket_data_center_config(
800        &self,
801    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
802        #[allow(unreachable_patterns)]
803        self.connection_config.as_ref().and_then(|v| match v {
804            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
805                std::option::Option::Some(v)
806            }
807            _ => std::option::Option::None,
808        })
809    }
810
811    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
812    /// to hold a `BitbucketDataCenterConfig`.
813    ///
814    /// Note that all the setters affecting `connection_config` are
815    /// mutually exclusive.
816    ///
817    /// # Example
818    /// ```ignore,no_run
819    /// # use google_cloud_developerconnect_v1::model::Connection;
820    /// use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
821    /// let x = Connection::new().set_bitbucket_data_center_config(BitbucketDataCenterConfig::default()/* use setters */);
822    /// assert!(x.bitbucket_data_center_config().is_some());
823    /// assert!(x.github_config().is_none());
824    /// assert!(x.github_enterprise_config().is_none());
825    /// assert!(x.gitlab_config().is_none());
826    /// assert!(x.gitlab_enterprise_config().is_none());
827    /// assert!(x.bitbucket_cloud_config().is_none());
828    /// assert!(x.secure_source_manager_instance_config().is_none());
829    /// assert!(x.http_config().is_none());
830    /// ```
831    pub fn set_bitbucket_data_center_config<
832        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
833    >(
834        mut self,
835        v: T,
836    ) -> Self {
837        self.connection_config = std::option::Option::Some(
838            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
839        );
840        self
841    }
842
843    /// The value of [connection_config][crate::model::Connection::connection_config]
844    /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
845    /// holds a different branch.
846    pub fn bitbucket_cloud_config(
847        &self,
848    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
849        #[allow(unreachable_patterns)]
850        self.connection_config.as_ref().and_then(|v| match v {
851            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
852                std::option::Option::Some(v)
853            }
854            _ => std::option::Option::None,
855        })
856    }
857
858    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
859    /// to hold a `BitbucketCloudConfig`.
860    ///
861    /// Note that all the setters affecting `connection_config` are
862    /// mutually exclusive.
863    ///
864    /// # Example
865    /// ```ignore,no_run
866    /// # use google_cloud_developerconnect_v1::model::Connection;
867    /// use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
868    /// let x = Connection::new().set_bitbucket_cloud_config(BitbucketCloudConfig::default()/* use setters */);
869    /// assert!(x.bitbucket_cloud_config().is_some());
870    /// assert!(x.github_config().is_none());
871    /// assert!(x.github_enterprise_config().is_none());
872    /// assert!(x.gitlab_config().is_none());
873    /// assert!(x.gitlab_enterprise_config().is_none());
874    /// assert!(x.bitbucket_data_center_config().is_none());
875    /// assert!(x.secure_source_manager_instance_config().is_none());
876    /// assert!(x.http_config().is_none());
877    /// ```
878    pub fn set_bitbucket_cloud_config<
879        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
880    >(
881        mut self,
882        v: T,
883    ) -> Self {
884        self.connection_config = std::option::Option::Some(
885            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
886        );
887        self
888    }
889
890    /// The value of [connection_config][crate::model::Connection::connection_config]
891    /// if it holds a `SecureSourceManagerInstanceConfig`, `None` if the field is not set or
892    /// holds a different branch.
893    pub fn secure_source_manager_instance_config(
894        &self,
895    ) -> std::option::Option<&std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>
896    {
897        #[allow(unreachable_patterns)]
898        self.connection_config.as_ref().and_then(|v| match v {
899            crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v) => {
900                std::option::Option::Some(v)
901            }
902            _ => std::option::Option::None,
903        })
904    }
905
906    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
907    /// to hold a `SecureSourceManagerInstanceConfig`.
908    ///
909    /// Note that all the setters affecting `connection_config` are
910    /// mutually exclusive.
911    ///
912    /// # Example
913    /// ```ignore,no_run
914    /// # use google_cloud_developerconnect_v1::model::Connection;
915    /// use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
916    /// let x = Connection::new().set_secure_source_manager_instance_config(SecureSourceManagerInstanceConfig::default()/* use setters */);
917    /// assert!(x.secure_source_manager_instance_config().is_some());
918    /// assert!(x.github_config().is_none());
919    /// assert!(x.github_enterprise_config().is_none());
920    /// assert!(x.gitlab_config().is_none());
921    /// assert!(x.gitlab_enterprise_config().is_none());
922    /// assert!(x.bitbucket_data_center_config().is_none());
923    /// assert!(x.bitbucket_cloud_config().is_none());
924    /// assert!(x.http_config().is_none());
925    /// ```
926    pub fn set_secure_source_manager_instance_config<
927        T: std::convert::Into<std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>,
928    >(
929        mut self,
930        v: T,
931    ) -> Self {
932        self.connection_config = std::option::Option::Some(
933            crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v.into()),
934        );
935        self
936    }
937
938    /// The value of [connection_config][crate::model::Connection::connection_config]
939    /// if it holds a `HttpConfig`, `None` if the field is not set or
940    /// holds a different branch.
941    pub fn http_config(
942        &self,
943    ) -> std::option::Option<&std::boxed::Box<crate::model::GenericHTTPEndpointConfig>> {
944        #[allow(unreachable_patterns)]
945        self.connection_config.as_ref().and_then(|v| match v {
946            crate::model::connection::ConnectionConfig::HttpConfig(v) => {
947                std::option::Option::Some(v)
948            }
949            _ => std::option::Option::None,
950        })
951    }
952
953    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
954    /// to hold a `HttpConfig`.
955    ///
956    /// Note that all the setters affecting `connection_config` are
957    /// mutually exclusive.
958    ///
959    /// # Example
960    /// ```ignore,no_run
961    /// # use google_cloud_developerconnect_v1::model::Connection;
962    /// use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
963    /// let x = Connection::new().set_http_config(GenericHTTPEndpointConfig::default()/* use setters */);
964    /// assert!(x.http_config().is_some());
965    /// assert!(x.github_config().is_none());
966    /// assert!(x.github_enterprise_config().is_none());
967    /// assert!(x.gitlab_config().is_none());
968    /// assert!(x.gitlab_enterprise_config().is_none());
969    /// assert!(x.bitbucket_data_center_config().is_none());
970    /// assert!(x.bitbucket_cloud_config().is_none());
971    /// assert!(x.secure_source_manager_instance_config().is_none());
972    /// ```
973    pub fn set_http_config<
974        T: std::convert::Into<std::boxed::Box<crate::model::GenericHTTPEndpointConfig>>,
975    >(
976        mut self,
977        v: T,
978    ) -> Self {
979        self.connection_config = std::option::Option::Some(
980            crate::model::connection::ConnectionConfig::HttpConfig(v.into()),
981        );
982        self
983    }
984}
985
986impl wkt::message::Message for Connection {
987    fn typename() -> &'static str {
988        "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
989    }
990}
991
992/// Defines additional types related to [Connection].
993pub mod connection {
994    #[allow(unused_imports)]
995    use super::*;
996
997    /// Configuration for the connection depending on the type of provider.
998    #[derive(Clone, Debug, PartialEq)]
999    #[non_exhaustive]
1000    pub enum ConnectionConfig {
1001        /// Configuration for connections to github.com.
1002        GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
1003        /// Configuration for connections to an instance of GitHub Enterprise.
1004        GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
1005        /// Configuration for connections to gitlab.com.
1006        GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
1007        /// Configuration for connections to an instance of GitLab Enterprise.
1008        GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
1009        /// Configuration for connections to an instance of Bitbucket Data Center.
1010        BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
1011        /// Configuration for connections to an instance of Bitbucket Clouds.
1012        BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
1013        /// Configuration for connections to an instance of Secure Source Manager.
1014        SecureSourceManagerInstanceConfig(
1015            std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>,
1016        ),
1017        /// Optional. Configuration for connections to an HTTP service provider.
1018        HttpConfig(std::boxed::Box<crate::model::GenericHTTPEndpointConfig>),
1019    }
1020}
1021
1022/// The crypto key configuration. This field is used by the Customer-managed
1023/// encryption keys (CMEK) feature.
1024#[derive(Clone, Default, PartialEq)]
1025#[non_exhaustive]
1026pub struct CryptoKeyConfig {
1027    /// Required. The name of the key which is used to encrypt/decrypt customer
1028    /// data. For key in Cloud KMS, the key should be in the format of
1029    /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
1030    pub key_reference: std::string::String,
1031
1032    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1033}
1034
1035impl CryptoKeyConfig {
1036    pub fn new() -> Self {
1037        std::default::Default::default()
1038    }
1039
1040    /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
1041    ///
1042    /// # Example
1043    /// ```ignore,no_run
1044    /// # use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
1045    /// let x = CryptoKeyConfig::new().set_key_reference("example");
1046    /// ```
1047    pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1048        self.key_reference = v.into();
1049        self
1050    }
1051}
1052
1053impl wkt::message::Message for CryptoKeyConfig {
1054    fn typename() -> &'static str {
1055        "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
1056    }
1057}
1058
1059/// The git proxy configuration.
1060#[derive(Clone, Default, PartialEq)]
1061#[non_exhaustive]
1062pub struct GitProxyConfig {
1063    /// Optional. Setting this to true allows the git proxy to be used for
1064    /// performing git operations on the repositories linked in the connection.
1065    pub enabled: bool,
1066
1067    /// Output only. The base URI for the HTTP proxy endpoint. Has
1068    /// the format
1069    /// `https://{generatedID}-c-h-{shortRegion}.developerconnect.dev`
1070    /// Populated only when enabled is set to true.
1071    /// This endpoint is used by other Google services that integrate with
1072    /// Developer Connect.
1073    pub http_proxy_base_uri: std::string::String,
1074
1075    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1076}
1077
1078impl GitProxyConfig {
1079    pub fn new() -> Self {
1080        std::default::Default::default()
1081    }
1082
1083    /// Sets the value of [enabled][crate::model::GitProxyConfig::enabled].
1084    ///
1085    /// # Example
1086    /// ```ignore,no_run
1087    /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1088    /// let x = GitProxyConfig::new().set_enabled(true);
1089    /// ```
1090    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1091        self.enabled = v.into();
1092        self
1093    }
1094
1095    /// Sets the value of [http_proxy_base_uri][crate::model::GitProxyConfig::http_proxy_base_uri].
1096    ///
1097    /// # Example
1098    /// ```ignore,no_run
1099    /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1100    /// let x = GitProxyConfig::new().set_http_proxy_base_uri("example");
1101    /// ```
1102    pub fn set_http_proxy_base_uri<T: std::convert::Into<std::string::String>>(
1103        mut self,
1104        v: T,
1105    ) -> Self {
1106        self.http_proxy_base_uri = v.into();
1107        self
1108    }
1109}
1110
1111impl wkt::message::Message for GitProxyConfig {
1112    fn typename() -> &'static str {
1113        "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
1114    }
1115}
1116
1117/// Describes stage and necessary actions to be taken by the
1118/// user to complete the installation. Used for GitHub and GitHub Enterprise
1119/// based connections.
1120#[derive(Clone, Default, PartialEq)]
1121#[non_exhaustive]
1122pub struct InstallationState {
1123    /// Output only. Current step of the installation process.
1124    pub stage: crate::model::installation_state::Stage,
1125
1126    /// Output only. Message of what the user should do next to continue the
1127    /// installation. Empty string if the installation is already complete.
1128    pub message: std::string::String,
1129
1130    /// Output only. Link to follow for next action. Empty string if the
1131    /// installation is already complete.
1132    pub action_uri: std::string::String,
1133
1134    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1135}
1136
1137impl InstallationState {
1138    pub fn new() -> Self {
1139        std::default::Default::default()
1140    }
1141
1142    /// Sets the value of [stage][crate::model::InstallationState::stage].
1143    ///
1144    /// # Example
1145    /// ```ignore,no_run
1146    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1147    /// use google_cloud_developerconnect_v1::model::installation_state::Stage;
1148    /// let x0 = InstallationState::new().set_stage(Stage::PendingCreateApp);
1149    /// let x1 = InstallationState::new().set_stage(Stage::PendingUserOauth);
1150    /// let x2 = InstallationState::new().set_stage(Stage::PendingInstallApp);
1151    /// ```
1152    pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1153        mut self,
1154        v: T,
1155    ) -> Self {
1156        self.stage = v.into();
1157        self
1158    }
1159
1160    /// Sets the value of [message][crate::model::InstallationState::message].
1161    ///
1162    /// # Example
1163    /// ```ignore,no_run
1164    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1165    /// let x = InstallationState::new().set_message("example");
1166    /// ```
1167    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1168        self.message = v.into();
1169        self
1170    }
1171
1172    /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
1173    ///
1174    /// # Example
1175    /// ```ignore,no_run
1176    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1177    /// let x = InstallationState::new().set_action_uri("example");
1178    /// ```
1179    pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1180        self.action_uri = v.into();
1181        self
1182    }
1183}
1184
1185impl wkt::message::Message for InstallationState {
1186    fn typename() -> &'static str {
1187        "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
1188    }
1189}
1190
1191/// Defines additional types related to [InstallationState].
1192pub mod installation_state {
1193    #[allow(unused_imports)]
1194    use super::*;
1195
1196    /// Stage of the installation process.
1197    ///
1198    /// # Working with unknown values
1199    ///
1200    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1201    /// additional enum variants at any time. Adding new variants is not considered
1202    /// a breaking change. Applications should write their code in anticipation of:
1203    ///
1204    /// - New values appearing in future releases of the client library, **and**
1205    /// - New values received dynamically, without application changes.
1206    ///
1207    /// Please consult the [Working with enums] section in the user guide for some
1208    /// guidelines.
1209    ///
1210    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1211    #[derive(Clone, Debug, PartialEq)]
1212    #[non_exhaustive]
1213    pub enum Stage {
1214        /// No stage specified.
1215        Unspecified,
1216        /// Only for GitHub Enterprise. An App creation has been requested.
1217        /// The user needs to confirm the creation in their GitHub enterprise host.
1218        PendingCreateApp,
1219        /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
1220        PendingUserOauth,
1221        /// User needs to follow the link to install the GitHub (or Enterprise) App.
1222        PendingInstallApp,
1223        /// Installation process has been completed.
1224        Complete,
1225        /// If set, the enum was initialized with an unknown value.
1226        ///
1227        /// Applications can examine the value using [Stage::value] or
1228        /// [Stage::name].
1229        UnknownValue(stage::UnknownValue),
1230    }
1231
1232    #[doc(hidden)]
1233    pub mod stage {
1234        #[allow(unused_imports)]
1235        use super::*;
1236        #[derive(Clone, Debug, PartialEq)]
1237        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1238    }
1239
1240    impl Stage {
1241        /// Gets the enum value.
1242        ///
1243        /// Returns `None` if the enum contains an unknown value deserialized from
1244        /// the string representation of enums.
1245        pub fn value(&self) -> std::option::Option<i32> {
1246            match self {
1247                Self::Unspecified => std::option::Option::Some(0),
1248                Self::PendingCreateApp => std::option::Option::Some(1),
1249                Self::PendingUserOauth => std::option::Option::Some(2),
1250                Self::PendingInstallApp => std::option::Option::Some(3),
1251                Self::Complete => std::option::Option::Some(10),
1252                Self::UnknownValue(u) => u.0.value(),
1253            }
1254        }
1255
1256        /// Gets the enum value as a string.
1257        ///
1258        /// Returns `None` if the enum contains an unknown value deserialized from
1259        /// the integer representation of enums.
1260        pub fn name(&self) -> std::option::Option<&str> {
1261            match self {
1262                Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1263                Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1264                Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1265                Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1266                Self::Complete => std::option::Option::Some("COMPLETE"),
1267                Self::UnknownValue(u) => u.0.name(),
1268            }
1269        }
1270    }
1271
1272    impl std::default::Default for Stage {
1273        fn default() -> Self {
1274            use std::convert::From;
1275            Self::from(0)
1276        }
1277    }
1278
1279    impl std::fmt::Display for Stage {
1280        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1281            wkt::internal::display_enum(f, self.name(), self.value())
1282        }
1283    }
1284
1285    impl std::convert::From<i32> for Stage {
1286        fn from(value: i32) -> Self {
1287            match value {
1288                0 => Self::Unspecified,
1289                1 => Self::PendingCreateApp,
1290                2 => Self::PendingUserOauth,
1291                3 => Self::PendingInstallApp,
1292                10 => Self::Complete,
1293                _ => Self::UnknownValue(stage::UnknownValue(
1294                    wkt::internal::UnknownEnumValue::Integer(value),
1295                )),
1296            }
1297        }
1298    }
1299
1300    impl std::convert::From<&str> for Stage {
1301        fn from(value: &str) -> Self {
1302            use std::string::ToString;
1303            match value {
1304                "STAGE_UNSPECIFIED" => Self::Unspecified,
1305                "PENDING_CREATE_APP" => Self::PendingCreateApp,
1306                "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1307                "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1308                "COMPLETE" => Self::Complete,
1309                _ => Self::UnknownValue(stage::UnknownValue(
1310                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1311                )),
1312            }
1313        }
1314    }
1315
1316    impl serde::ser::Serialize for Stage {
1317        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1318        where
1319            S: serde::Serializer,
1320        {
1321            match self {
1322                Self::Unspecified => serializer.serialize_i32(0),
1323                Self::PendingCreateApp => serializer.serialize_i32(1),
1324                Self::PendingUserOauth => serializer.serialize_i32(2),
1325                Self::PendingInstallApp => serializer.serialize_i32(3),
1326                Self::Complete => serializer.serialize_i32(10),
1327                Self::UnknownValue(u) => u.0.serialize(serializer),
1328            }
1329        }
1330    }
1331
1332    impl<'de> serde::de::Deserialize<'de> for Stage {
1333        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1334        where
1335            D: serde::Deserializer<'de>,
1336        {
1337            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1338                ".google.cloud.developerconnect.v1.InstallationState.Stage",
1339            ))
1340        }
1341    }
1342}
1343
1344/// Defines the configuration for connections to an HTTP service provider.
1345#[derive(Clone, Default, PartialEq)]
1346#[non_exhaustive]
1347pub struct GenericHTTPEndpointConfig {
1348    /// Required. Immutable. The service provider's https endpoint.
1349    pub host_uri: std::string::String,
1350
1351    /// Optional. Configuration for using Service Directory to privately connect to
1352    /// a HTTP service provider. This should only be set if the Http service
1353    /// provider is hosted on-premises and not reachable by public internet. If
1354    /// this field is left empty, calls to the HTTP service provider will be made
1355    /// over the public internet.
1356    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1357
1358    /// Optional. The SSL certificate to use for requests to the HTTP service
1359    /// provider.
1360    pub ssl_ca_certificate: std::string::String,
1361
1362    /// The authentication mechanism to use for requests to the HTTP service
1363    /// provider.
1364    pub authentication:
1365        std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1366
1367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1368}
1369
1370impl GenericHTTPEndpointConfig {
1371    pub fn new() -> Self {
1372        std::default::Default::default()
1373    }
1374
1375    /// Sets the value of [host_uri][crate::model::GenericHTTPEndpointConfig::host_uri].
1376    ///
1377    /// # Example
1378    /// ```ignore,no_run
1379    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1380    /// let x = GenericHTTPEndpointConfig::new().set_host_uri("example");
1381    /// ```
1382    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1383        self.host_uri = v.into();
1384        self
1385    }
1386
1387    /// Sets the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1388    ///
1389    /// # Example
1390    /// ```ignore,no_run
1391    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1392    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1393    /// let x = GenericHTTPEndpointConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1394    /// ```
1395    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1396    where
1397        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1398    {
1399        self.service_directory_config = std::option::Option::Some(v.into());
1400        self
1401    }
1402
1403    /// Sets or clears the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1404    ///
1405    /// # Example
1406    /// ```ignore,no_run
1407    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1408    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1409    /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1410    /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1411    /// ```
1412    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1413    where
1414        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1415    {
1416        self.service_directory_config = v.map(|x| x.into());
1417        self
1418    }
1419
1420    /// Sets the value of [ssl_ca_certificate][crate::model::GenericHTTPEndpointConfig::ssl_ca_certificate].
1421    ///
1422    /// # Example
1423    /// ```ignore,no_run
1424    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1425    /// let x = GenericHTTPEndpointConfig::new().set_ssl_ca_certificate("example");
1426    /// ```
1427    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1428        mut self,
1429        v: T,
1430    ) -> Self {
1431        self.ssl_ca_certificate = v.into();
1432        self
1433    }
1434
1435    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication].
1436    ///
1437    /// Note that all the setters affecting `authentication` are mutually
1438    /// exclusive.
1439    ///
1440    /// # Example
1441    /// ```ignore,no_run
1442    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1443    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1444    /// let x = GenericHTTPEndpointConfig::new().set_authentication(Some(
1445    ///     google_cloud_developerconnect_v1::model::generic_http_endpoint_config::Authentication::BasicAuthentication(BasicAuthentication::default().into())));
1446    /// ```
1447    pub fn set_authentication<
1448        T: std::convert::Into<
1449                std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1450            >,
1451    >(
1452        mut self,
1453        v: T,
1454    ) -> Self {
1455        self.authentication = v.into();
1456        self
1457    }
1458
1459    /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1460    /// if it holds a `BasicAuthentication`, `None` if the field is not set or
1461    /// holds a different branch.
1462    pub fn basic_authentication(
1463        &self,
1464    ) -> std::option::Option<
1465        &std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1466    > {
1467        #[allow(unreachable_patterns)]
1468        self.authentication.as_ref().and_then(|v| match v {
1469            crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(v) => {
1470                std::option::Option::Some(v)
1471            }
1472            _ => std::option::Option::None,
1473        })
1474    }
1475
1476    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1477    /// to hold a `BasicAuthentication`.
1478    ///
1479    /// Note that all the setters affecting `authentication` are
1480    /// mutually exclusive.
1481    ///
1482    /// # Example
1483    /// ```ignore,no_run
1484    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1485    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1486    /// let x = GenericHTTPEndpointConfig::new().set_basic_authentication(BasicAuthentication::default()/* use setters */);
1487    /// assert!(x.basic_authentication().is_some());
1488    /// assert!(x.bearer_token_authentication().is_none());
1489    /// ```
1490    pub fn set_basic_authentication<
1491        T: std::convert::Into<
1492                std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1493            >,
1494    >(
1495        mut self,
1496        v: T,
1497    ) -> Self {
1498        self.authentication = std::option::Option::Some(
1499            crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(
1500                v.into(),
1501            ),
1502        );
1503        self
1504    }
1505
1506    /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1507    /// if it holds a `BearerTokenAuthentication`, `None` if the field is not set or
1508    /// holds a different branch.
1509    pub fn bearer_token_authentication(
1510        &self,
1511    ) -> std::option::Option<
1512        &std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1513    > {
1514        #[allow(unreachable_patterns)]
1515        self.authentication.as_ref().and_then(|v| match v {
1516            crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(v) => std::option::Option::Some(v),
1517            _ => std::option::Option::None,
1518        })
1519    }
1520
1521    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1522    /// to hold a `BearerTokenAuthentication`.
1523    ///
1524    /// Note that all the setters affecting `authentication` are
1525    /// mutually exclusive.
1526    ///
1527    /// # Example
1528    /// ```ignore,no_run
1529    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1530    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1531    /// let x = GenericHTTPEndpointConfig::new().set_bearer_token_authentication(BearerTokenAuthentication::default()/* use setters */);
1532    /// assert!(x.bearer_token_authentication().is_some());
1533    /// assert!(x.basic_authentication().is_none());
1534    /// ```
1535    pub fn set_bearer_token_authentication<
1536        T: std::convert::Into<
1537                std::boxed::Box<
1538                    crate::model::generic_http_endpoint_config::BearerTokenAuthentication,
1539                >,
1540            >,
1541    >(
1542        mut self,
1543        v: T,
1544    ) -> Self {
1545        self.authentication = std::option::Option::Some(
1546            crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(
1547                v.into(),
1548            ),
1549        );
1550        self
1551    }
1552}
1553
1554impl wkt::message::Message for GenericHTTPEndpointConfig {
1555    fn typename() -> &'static str {
1556        "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig"
1557    }
1558}
1559
1560/// Defines additional types related to [GenericHTTPEndpointConfig].
1561pub mod generic_http_endpoint_config {
1562    #[allow(unused_imports)]
1563    use super::*;
1564
1565    /// Basic authentication with username and password.
1566    #[derive(Clone, Default, PartialEq)]
1567    #[non_exhaustive]
1568    pub struct BasicAuthentication {
1569        /// Required. The username to authenticate as.
1570        pub username: std::string::String,
1571
1572        /// The password to authenticate as.
1573        pub password: std::option::Option<
1574            crate::model::generic_http_endpoint_config::basic_authentication::Password,
1575        >,
1576
1577        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1578    }
1579
1580    impl BasicAuthentication {
1581        pub fn new() -> Self {
1582            std::default::Default::default()
1583        }
1584
1585        /// Sets the value of [username][crate::model::generic_http_endpoint_config::BasicAuthentication::username].
1586        ///
1587        /// # Example
1588        /// ```ignore,no_run
1589        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1590        /// let x = BasicAuthentication::new().set_username("example");
1591        /// ```
1592        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1593            self.username = v.into();
1594            self
1595        }
1596
1597        /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password].
1598        ///
1599        /// Note that all the setters affecting `password` are mutually
1600        /// exclusive.
1601        ///
1602        /// # Example
1603        /// ```ignore,no_run
1604        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1605        /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::basic_authentication::Password;
1606        /// let x = BasicAuthentication::new().set_password(Some(Password::PasswordSecretVersion("example".to_string())));
1607        /// ```
1608        pub fn set_password<
1609            T: std::convert::Into<
1610                    std::option::Option<
1611                        crate::model::generic_http_endpoint_config::basic_authentication::Password,
1612                    >,
1613                >,
1614        >(
1615            mut self,
1616            v: T,
1617        ) -> Self {
1618            self.password = v.into();
1619            self
1620        }
1621
1622        /// The value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1623        /// if it holds a `PasswordSecretVersion`, `None` if the field is not set or
1624        /// holds a different branch.
1625        pub fn password_secret_version(&self) -> std::option::Option<&std::string::String> {
1626            #[allow(unreachable_patterns)]
1627            self.password.as_ref().and_then(|v| match v {
1628                crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(v) => std::option::Option::Some(v),
1629                _ => std::option::Option::None,
1630            })
1631        }
1632
1633        /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1634        /// to hold a `PasswordSecretVersion`.
1635        ///
1636        /// Note that all the setters affecting `password` are
1637        /// mutually exclusive.
1638        ///
1639        /// # Example
1640        /// ```ignore,no_run
1641        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1642        /// let x = BasicAuthentication::new().set_password_secret_version("example");
1643        /// assert!(x.password_secret_version().is_some());
1644        /// ```
1645        pub fn set_password_secret_version<T: std::convert::Into<std::string::String>>(
1646            mut self,
1647            v: T,
1648        ) -> Self {
1649            self.password = std::option::Option::Some(
1650                crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(
1651                    v.into()
1652                )
1653            );
1654            self
1655        }
1656    }
1657
1658    impl wkt::message::Message for BasicAuthentication {
1659        fn typename() -> &'static str {
1660            "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BasicAuthentication"
1661        }
1662    }
1663
1664    /// Defines additional types related to [BasicAuthentication].
1665    pub mod basic_authentication {
1666        #[allow(unused_imports)]
1667        use super::*;
1668
1669        /// The password to authenticate as.
1670        #[derive(Clone, Debug, PartialEq)]
1671        #[non_exhaustive]
1672        pub enum Password {
1673            /// The password SecretManager secret version to authenticate as.
1674            PasswordSecretVersion(std::string::String),
1675        }
1676    }
1677
1678    /// Bearer token authentication with a token.
1679    #[derive(Clone, Default, PartialEq)]
1680    #[non_exhaustive]
1681    pub struct BearerTokenAuthentication {
1682        /// The token to authenticate as.
1683        pub token: std::option::Option<
1684            crate::model::generic_http_endpoint_config::bearer_token_authentication::Token,
1685        >,
1686
1687        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1688    }
1689
1690    impl BearerTokenAuthentication {
1691        pub fn new() -> Self {
1692            std::default::Default::default()
1693        }
1694
1695        /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token].
1696        ///
1697        /// Note that all the setters affecting `token` are mutually
1698        /// exclusive.
1699        ///
1700        /// # Example
1701        /// ```ignore,no_run
1702        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1703        /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::bearer_token_authentication::Token;
1704        /// let x = BearerTokenAuthentication::new().set_token(Some(Token::TokenSecretVersion("example".to_string())));
1705        /// ```
1706        pub fn set_token<T: std::convert::Into<std::option::Option<crate::model::generic_http_endpoint_config::bearer_token_authentication::Token>>>(mut self, v: T) -> Self
1707        {
1708            self.token = v.into();
1709            self
1710        }
1711
1712        /// The value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1713        /// if it holds a `TokenSecretVersion`, `None` if the field is not set or
1714        /// holds a different branch.
1715        pub fn token_secret_version(&self) -> std::option::Option<&std::string::String> {
1716            #[allow(unreachable_patterns)]
1717            self.token.as_ref().and_then(|v| match v {
1718                crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(v) => std::option::Option::Some(v),
1719                _ => std::option::Option::None,
1720            })
1721        }
1722
1723        /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1724        /// to hold a `TokenSecretVersion`.
1725        ///
1726        /// Note that all the setters affecting `token` are
1727        /// mutually exclusive.
1728        ///
1729        /// # Example
1730        /// ```ignore,no_run
1731        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1732        /// let x = BearerTokenAuthentication::new().set_token_secret_version("example");
1733        /// assert!(x.token_secret_version().is_some());
1734        /// ```
1735        pub fn set_token_secret_version<T: std::convert::Into<std::string::String>>(
1736            mut self,
1737            v: T,
1738        ) -> Self {
1739            self.token = std::option::Option::Some(
1740                crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(
1741                    v.into()
1742                )
1743            );
1744            self
1745        }
1746    }
1747
1748    impl wkt::message::Message for BearerTokenAuthentication {
1749        fn typename() -> &'static str {
1750            "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BearerTokenAuthentication"
1751        }
1752    }
1753
1754    /// Defines additional types related to [BearerTokenAuthentication].
1755    pub mod bearer_token_authentication {
1756        #[allow(unused_imports)]
1757        use super::*;
1758
1759        /// The token to authenticate as.
1760        #[derive(Clone, Debug, PartialEq)]
1761        #[non_exhaustive]
1762        pub enum Token {
1763            /// Optional. The token SecretManager secret version to authenticate as.
1764            TokenSecretVersion(std::string::String),
1765        }
1766    }
1767
1768    /// The authentication mechanism to use for requests to the HTTP service
1769    /// provider.
1770    #[derive(Clone, Debug, PartialEq)]
1771    #[non_exhaustive]
1772    pub enum Authentication {
1773        /// Optional. Basic authentication with username and password.
1774        BasicAuthentication(
1775            std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1776        ),
1777        /// Optional. Bearer token authentication with a token.
1778        BearerTokenAuthentication(
1779            std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1780        ),
1781    }
1782}
1783
1784/// Configuration for connections to github.com.
1785#[derive(Clone, Default, PartialEq)]
1786#[non_exhaustive]
1787pub struct GitHubConfig {
1788    /// Required. Immutable. The GitHub Application that was installed to the
1789    /// GitHub user or organization.
1790    pub github_app: crate::model::git_hub_config::GitHubApp,
1791
1792    /// Optional. OAuth credential of the account that authorized the GitHub App.
1793    /// It is recommended to use a robot account instead of a human user account.
1794    /// The OAuth token must be tied to the GitHub App of this config.
1795    pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
1796
1797    /// Optional. GitHub App installation id.
1798    pub app_installation_id: i64,
1799
1800    /// Output only. The URI to navigate to in order to manage the installation
1801    /// associated with this GitHubConfig.
1802    pub installation_uri: std::string::String,
1803
1804    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1805}
1806
1807impl GitHubConfig {
1808    pub fn new() -> Self {
1809        std::default::Default::default()
1810    }
1811
1812    /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
1813    ///
1814    /// # Example
1815    /// ```ignore,no_run
1816    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1817    /// use google_cloud_developerconnect_v1::model::git_hub_config::GitHubApp;
1818    /// let x0 = GitHubConfig::new().set_github_app(GitHubApp::DeveloperConnect);
1819    /// let x1 = GitHubConfig::new().set_github_app(GitHubApp::Firebase);
1820    /// let x2 = GitHubConfig::new().set_github_app(GitHubApp::GeminiCodeAssist);
1821    /// ```
1822    pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
1823        mut self,
1824        v: T,
1825    ) -> Self {
1826        self.github_app = v.into();
1827        self
1828    }
1829
1830    /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1831    ///
1832    /// # Example
1833    /// ```ignore,no_run
1834    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1835    /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1836    /// let x = GitHubConfig::new().set_authorizer_credential(OAuthCredential::default()/* use setters */);
1837    /// ```
1838    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1839    where
1840        T: std::convert::Into<crate::model::OAuthCredential>,
1841    {
1842        self.authorizer_credential = std::option::Option::Some(v.into());
1843        self
1844    }
1845
1846    /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1847    ///
1848    /// # Example
1849    /// ```ignore,no_run
1850    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1851    /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1852    /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(Some(OAuthCredential::default()/* use setters */));
1853    /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(None::<OAuthCredential>);
1854    /// ```
1855    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1856    where
1857        T: std::convert::Into<crate::model::OAuthCredential>,
1858    {
1859        self.authorizer_credential = v.map(|x| x.into());
1860        self
1861    }
1862
1863    /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
1864    ///
1865    /// # Example
1866    /// ```ignore,no_run
1867    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1868    /// let x = GitHubConfig::new().set_app_installation_id(42);
1869    /// ```
1870    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1871        self.app_installation_id = v.into();
1872        self
1873    }
1874
1875    /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
1876    ///
1877    /// # Example
1878    /// ```ignore,no_run
1879    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1880    /// let x = GitHubConfig::new().set_installation_uri("example");
1881    /// ```
1882    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
1883        mut self,
1884        v: T,
1885    ) -> Self {
1886        self.installation_uri = v.into();
1887        self
1888    }
1889}
1890
1891impl wkt::message::Message for GitHubConfig {
1892    fn typename() -> &'static str {
1893        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
1894    }
1895}
1896
1897/// Defines additional types related to [GitHubConfig].
1898pub mod git_hub_config {
1899    #[allow(unused_imports)]
1900    use super::*;
1901
1902    /// Represents the various GitHub Applications that can be installed to a
1903    /// GitHub user or organization and used with Developer Connect.
1904    ///
1905    /// # Working with unknown values
1906    ///
1907    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1908    /// additional enum variants at any time. Adding new variants is not considered
1909    /// a breaking change. Applications should write their code in anticipation of:
1910    ///
1911    /// - New values appearing in future releases of the client library, **and**
1912    /// - New values received dynamically, without application changes.
1913    ///
1914    /// Please consult the [Working with enums] section in the user guide for some
1915    /// guidelines.
1916    ///
1917    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1918    #[derive(Clone, Debug, PartialEq)]
1919    #[non_exhaustive]
1920    pub enum GitHubApp {
1921        /// GitHub App not specified.
1922        Unspecified,
1923        /// The Developer Connect GitHub Application.
1924        DeveloperConnect,
1925        /// The Firebase GitHub Application.
1926        Firebase,
1927        /// The Gemini Code Assist Application.
1928        GeminiCodeAssist,
1929        /// If set, the enum was initialized with an unknown value.
1930        ///
1931        /// Applications can examine the value using [GitHubApp::value] or
1932        /// [GitHubApp::name].
1933        UnknownValue(git_hub_app::UnknownValue),
1934    }
1935
1936    #[doc(hidden)]
1937    pub mod git_hub_app {
1938        #[allow(unused_imports)]
1939        use super::*;
1940        #[derive(Clone, Debug, PartialEq)]
1941        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1942    }
1943
1944    impl GitHubApp {
1945        /// Gets the enum value.
1946        ///
1947        /// Returns `None` if the enum contains an unknown value deserialized from
1948        /// the string representation of enums.
1949        pub fn value(&self) -> std::option::Option<i32> {
1950            match self {
1951                Self::Unspecified => std::option::Option::Some(0),
1952                Self::DeveloperConnect => std::option::Option::Some(1),
1953                Self::Firebase => std::option::Option::Some(2),
1954                Self::GeminiCodeAssist => std::option::Option::Some(3),
1955                Self::UnknownValue(u) => u.0.value(),
1956            }
1957        }
1958
1959        /// Gets the enum value as a string.
1960        ///
1961        /// Returns `None` if the enum contains an unknown value deserialized from
1962        /// the integer representation of enums.
1963        pub fn name(&self) -> std::option::Option<&str> {
1964            match self {
1965                Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
1966                Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
1967                Self::Firebase => std::option::Option::Some("FIREBASE"),
1968                Self::GeminiCodeAssist => std::option::Option::Some("GEMINI_CODE_ASSIST"),
1969                Self::UnknownValue(u) => u.0.name(),
1970            }
1971        }
1972    }
1973
1974    impl std::default::Default for GitHubApp {
1975        fn default() -> Self {
1976            use std::convert::From;
1977            Self::from(0)
1978        }
1979    }
1980
1981    impl std::fmt::Display for GitHubApp {
1982        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1983            wkt::internal::display_enum(f, self.name(), self.value())
1984        }
1985    }
1986
1987    impl std::convert::From<i32> for GitHubApp {
1988        fn from(value: i32) -> Self {
1989            match value {
1990                0 => Self::Unspecified,
1991                1 => Self::DeveloperConnect,
1992                2 => Self::Firebase,
1993                3 => Self::GeminiCodeAssist,
1994                _ => Self::UnknownValue(git_hub_app::UnknownValue(
1995                    wkt::internal::UnknownEnumValue::Integer(value),
1996                )),
1997            }
1998        }
1999    }
2000
2001    impl std::convert::From<&str> for GitHubApp {
2002        fn from(value: &str) -> Self {
2003            use std::string::ToString;
2004            match value {
2005                "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
2006                "DEVELOPER_CONNECT" => Self::DeveloperConnect,
2007                "FIREBASE" => Self::Firebase,
2008                "GEMINI_CODE_ASSIST" => Self::GeminiCodeAssist,
2009                _ => Self::UnknownValue(git_hub_app::UnknownValue(
2010                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2011                )),
2012            }
2013        }
2014    }
2015
2016    impl serde::ser::Serialize for GitHubApp {
2017        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2018        where
2019            S: serde::Serializer,
2020        {
2021            match self {
2022                Self::Unspecified => serializer.serialize_i32(0),
2023                Self::DeveloperConnect => serializer.serialize_i32(1),
2024                Self::Firebase => serializer.serialize_i32(2),
2025                Self::GeminiCodeAssist => serializer.serialize_i32(3),
2026                Self::UnknownValue(u) => u.0.serialize(serializer),
2027            }
2028        }
2029    }
2030
2031    impl<'de> serde::de::Deserialize<'de> for GitHubApp {
2032        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2033        where
2034            D: serde::Deserializer<'de>,
2035        {
2036            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
2037                ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
2038            ))
2039        }
2040    }
2041}
2042
2043/// Configuration for connections to an instance of GitHub Enterprise.
2044#[derive(Clone, Default, PartialEq)]
2045#[non_exhaustive]
2046pub struct GitHubEnterpriseConfig {
2047    /// Required. The URI of the GitHub Enterprise host this connection is for.
2048    pub host_uri: std::string::String,
2049
2050    /// Optional. ID of the GitHub App created from the manifest.
2051    pub app_id: i64,
2052
2053    /// Output only. The URL-friendly name of the GitHub App.
2054    pub app_slug: std::string::String,
2055
2056    /// Optional. SecretManager resource containing the private key of the GitHub
2057    /// App, formatted as `projects/*/secrets/*/versions/*` or
2058    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2059    /// supported in that location).
2060    pub private_key_secret_version: std::string::String,
2061
2062    /// Optional. SecretManager resource containing the webhook secret of the
2063    /// GitHub App, formatted as `projects/*/secrets/*/versions/*` or
2064    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2065    /// supported in that location).
2066    pub webhook_secret_secret_version: std::string::String,
2067
2068    /// Optional. ID of the installation of the GitHub App.
2069    pub app_installation_id: i64,
2070
2071    /// Output only. The URI to navigate to in order to manage the installation
2072    /// associated with this GitHubEnterpriseConfig.
2073    pub installation_uri: std::string::String,
2074
2075    /// Optional. Configuration for using Service Directory to privately connect to
2076    /// a GitHub Enterprise server. This should only be set if the GitHub
2077    /// Enterprise server is hosted on-premises and not reachable by public
2078    /// internet. If this field is left empty, calls to the GitHub Enterprise
2079    /// server will be made over the public internet.
2080    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2081
2082    /// Output only. GitHub Enterprise version installed at the host_uri.
2083    pub server_version: std::string::String,
2084
2085    /// Optional. SSL certificate to use for requests to GitHub Enterprise.
2086    pub ssl_ca_certificate: std::string::String,
2087
2088    /// Optional. Immutable. GitHub Enterprise organization in which the GitHub App
2089    /// is created.
2090    pub organization: std::string::String,
2091
2092    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2093}
2094
2095impl GitHubEnterpriseConfig {
2096    pub fn new() -> Self {
2097        std::default::Default::default()
2098    }
2099
2100    /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
2101    ///
2102    /// # Example
2103    /// ```ignore,no_run
2104    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2105    /// let x = GitHubEnterpriseConfig::new().set_host_uri("example");
2106    /// ```
2107    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2108        self.host_uri = v.into();
2109        self
2110    }
2111
2112    /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
2113    ///
2114    /// # Example
2115    /// ```ignore,no_run
2116    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2117    /// let x = GitHubEnterpriseConfig::new().set_app_id(42);
2118    /// ```
2119    pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2120        self.app_id = v.into();
2121        self
2122    }
2123
2124    /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
2125    ///
2126    /// # Example
2127    /// ```ignore,no_run
2128    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2129    /// let x = GitHubEnterpriseConfig::new().set_app_slug("example");
2130    /// ```
2131    pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2132        self.app_slug = v.into();
2133        self
2134    }
2135
2136    /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
2137    ///
2138    /// # Example
2139    /// ```ignore,no_run
2140    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2141    /// let x = GitHubEnterpriseConfig::new().set_private_key_secret_version("example");
2142    /// ```
2143    pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
2144        mut self,
2145        v: T,
2146    ) -> Self {
2147        self.private_key_secret_version = v.into();
2148        self
2149    }
2150
2151    /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
2152    ///
2153    /// # Example
2154    /// ```ignore,no_run
2155    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2156    /// let x = GitHubEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2157    /// ```
2158    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2159        mut self,
2160        v: T,
2161    ) -> Self {
2162        self.webhook_secret_secret_version = v.into();
2163        self
2164    }
2165
2166    /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
2167    ///
2168    /// # Example
2169    /// ```ignore,no_run
2170    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2171    /// let x = GitHubEnterpriseConfig::new().set_app_installation_id(42);
2172    /// ```
2173    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2174        self.app_installation_id = v.into();
2175        self
2176    }
2177
2178    /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
2179    ///
2180    /// # Example
2181    /// ```ignore,no_run
2182    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2183    /// let x = GitHubEnterpriseConfig::new().set_installation_uri("example");
2184    /// ```
2185    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2186        mut self,
2187        v: T,
2188    ) -> Self {
2189        self.installation_uri = v.into();
2190        self
2191    }
2192
2193    /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2194    ///
2195    /// # Example
2196    /// ```ignore,no_run
2197    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2198    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2199    /// let x = GitHubEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2200    /// ```
2201    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2202    where
2203        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2204    {
2205        self.service_directory_config = std::option::Option::Some(v.into());
2206        self
2207    }
2208
2209    /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2210    ///
2211    /// # Example
2212    /// ```ignore,no_run
2213    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2214    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2215    /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2216    /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2217    /// ```
2218    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2219    where
2220        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2221    {
2222        self.service_directory_config = v.map(|x| x.into());
2223        self
2224    }
2225
2226    /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
2227    ///
2228    /// # Example
2229    /// ```ignore,no_run
2230    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2231    /// let x = GitHubEnterpriseConfig::new().set_server_version("example");
2232    /// ```
2233    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2234        self.server_version = v.into();
2235        self
2236    }
2237
2238    /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
2239    ///
2240    /// # Example
2241    /// ```ignore,no_run
2242    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2243    /// let x = GitHubEnterpriseConfig::new().set_ssl_ca_certificate("example");
2244    /// ```
2245    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2246        mut self,
2247        v: T,
2248    ) -> Self {
2249        self.ssl_ca_certificate = v.into();
2250        self
2251    }
2252
2253    /// Sets the value of [organization][crate::model::GitHubEnterpriseConfig::organization].
2254    ///
2255    /// # Example
2256    /// ```ignore,no_run
2257    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2258    /// let x = GitHubEnterpriseConfig::new().set_organization("example");
2259    /// ```
2260    pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2261        self.organization = v.into();
2262        self
2263    }
2264}
2265
2266impl wkt::message::Message for GitHubEnterpriseConfig {
2267    fn typename() -> &'static str {
2268        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
2269    }
2270}
2271
2272/// ServiceDirectoryConfig represents Service Directory configuration for a
2273/// connection.
2274#[derive(Clone, Default, PartialEq)]
2275#[non_exhaustive]
2276pub struct ServiceDirectoryConfig {
2277    /// Required. The Service Directory service name.
2278    /// Format:
2279    /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
2280    pub service: std::string::String,
2281
2282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2283}
2284
2285impl ServiceDirectoryConfig {
2286    pub fn new() -> Self {
2287        std::default::Default::default()
2288    }
2289
2290    /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
2291    ///
2292    /// # Example
2293    /// ```ignore,no_run
2294    /// # use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2295    /// let x = ServiceDirectoryConfig::new().set_service("example");
2296    /// ```
2297    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2298        self.service = v.into();
2299        self
2300    }
2301}
2302
2303impl wkt::message::Message for ServiceDirectoryConfig {
2304    fn typename() -> &'static str {
2305        "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
2306    }
2307}
2308
2309/// Represents an OAuth token of the account that authorized the Connection,
2310/// and associated metadata.
2311#[derive(Clone, Default, PartialEq)]
2312#[non_exhaustive]
2313pub struct OAuthCredential {
2314    /// Required. A SecretManager resource containing the OAuth token that
2315    /// authorizes the connection. Format: `projects/*/secrets/*/versions/*` or
2316    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2317    /// supported in that location).
2318    pub oauth_token_secret_version: std::string::String,
2319
2320    /// Output only. The username associated with this token.
2321    pub username: std::string::String,
2322
2323    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2324}
2325
2326impl OAuthCredential {
2327    pub fn new() -> Self {
2328        std::default::Default::default()
2329    }
2330
2331    /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
2332    ///
2333    /// # Example
2334    /// ```ignore,no_run
2335    /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2336    /// let x = OAuthCredential::new().set_oauth_token_secret_version("example");
2337    /// ```
2338    pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
2339        mut self,
2340        v: T,
2341    ) -> Self {
2342        self.oauth_token_secret_version = v.into();
2343        self
2344    }
2345
2346    /// Sets the value of [username][crate::model::OAuthCredential::username].
2347    ///
2348    /// # Example
2349    /// ```ignore,no_run
2350    /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2351    /// let x = OAuthCredential::new().set_username("example");
2352    /// ```
2353    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2354        self.username = v.into();
2355        self
2356    }
2357}
2358
2359impl wkt::message::Message for OAuthCredential {
2360    fn typename() -> &'static str {
2361        "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
2362    }
2363}
2364
2365/// Configuration for connections to gitlab.com.
2366#[derive(Clone, Default, PartialEq)]
2367#[non_exhaustive]
2368pub struct GitLabConfig {
2369    /// Required. Immutable. SecretManager resource containing the webhook secret
2370    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2371    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2372    /// supported in that location). This is used to validate webhooks.
2373    pub webhook_secret_secret_version: std::string::String,
2374
2375    /// Required. A GitLab personal access token with the minimum `read_api` scope
2376    /// access and a minimum role of `reporter`. The GitLab Projects visible to
2377    /// this Personal Access Token will control which Projects Developer Connect
2378    /// has access to.
2379    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2380
2381    /// Required. A GitLab personal access token with the minimum `api` scope
2382    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2383    /// this Personal Access Token will control which Projects Developer Connect
2384    /// has access to.
2385    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2386
2387    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2388}
2389
2390impl GitLabConfig {
2391    pub fn new() -> Self {
2392        std::default::Default::default()
2393    }
2394
2395    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
2396    ///
2397    /// # Example
2398    /// ```ignore,no_run
2399    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2400    /// let x = GitLabConfig::new().set_webhook_secret_secret_version("example");
2401    /// ```
2402    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2403        mut self,
2404        v: T,
2405    ) -> Self {
2406        self.webhook_secret_secret_version = v.into();
2407        self
2408    }
2409
2410    /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2411    ///
2412    /// # Example
2413    /// ```ignore,no_run
2414    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2415    /// use google_cloud_developerconnect_v1::model::UserCredential;
2416    /// let x = GitLabConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2417    /// ```
2418    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2419    where
2420        T: std::convert::Into<crate::model::UserCredential>,
2421    {
2422        self.read_authorizer_credential = std::option::Option::Some(v.into());
2423        self
2424    }
2425
2426    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2427    ///
2428    /// # Example
2429    /// ```ignore,no_run
2430    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2431    /// use google_cloud_developerconnect_v1::model::UserCredential;
2432    /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2433    /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2434    /// ```
2435    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2436    where
2437        T: std::convert::Into<crate::model::UserCredential>,
2438    {
2439        self.read_authorizer_credential = v.map(|x| x.into());
2440        self
2441    }
2442
2443    /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2444    ///
2445    /// # Example
2446    /// ```ignore,no_run
2447    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2448    /// use google_cloud_developerconnect_v1::model::UserCredential;
2449    /// let x = GitLabConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2450    /// ```
2451    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2452    where
2453        T: std::convert::Into<crate::model::UserCredential>,
2454    {
2455        self.authorizer_credential = std::option::Option::Some(v.into());
2456        self
2457    }
2458
2459    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2460    ///
2461    /// # Example
2462    /// ```ignore,no_run
2463    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2464    /// use google_cloud_developerconnect_v1::model::UserCredential;
2465    /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2466    /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2467    /// ```
2468    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2469    where
2470        T: std::convert::Into<crate::model::UserCredential>,
2471    {
2472        self.authorizer_credential = v.map(|x| x.into());
2473        self
2474    }
2475}
2476
2477impl wkt::message::Message for GitLabConfig {
2478    fn typename() -> &'static str {
2479        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
2480    }
2481}
2482
2483/// Represents a personal access token that authorized the Connection,
2484/// and associated metadata.
2485#[derive(Clone, Default, PartialEq)]
2486#[non_exhaustive]
2487pub struct UserCredential {
2488    /// Required. A SecretManager resource containing the user token that
2489    /// authorizes the Developer Connect connection. Format:
2490    /// `projects/*/secrets/*/versions/*` or
2491    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2492    /// supported in that location).
2493    pub user_token_secret_version: std::string::String,
2494
2495    /// Output only. The username associated with this token.
2496    pub username: std::string::String,
2497
2498    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2499}
2500
2501impl UserCredential {
2502    pub fn new() -> Self {
2503        std::default::Default::default()
2504    }
2505
2506    /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
2507    ///
2508    /// # Example
2509    /// ```ignore,no_run
2510    /// # use google_cloud_developerconnect_v1::model::UserCredential;
2511    /// let x = UserCredential::new().set_user_token_secret_version("example");
2512    /// ```
2513    pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
2514        mut self,
2515        v: T,
2516    ) -> Self {
2517        self.user_token_secret_version = v.into();
2518        self
2519    }
2520
2521    /// Sets the value of [username][crate::model::UserCredential::username].
2522    ///
2523    /// # Example
2524    /// ```ignore,no_run
2525    /// # use google_cloud_developerconnect_v1::model::UserCredential;
2526    /// let x = UserCredential::new().set_username("example");
2527    /// ```
2528    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2529        self.username = v.into();
2530        self
2531    }
2532}
2533
2534impl wkt::message::Message for UserCredential {
2535    fn typename() -> &'static str {
2536        "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
2537    }
2538}
2539
2540/// Configuration for connections to an instance of GitLab Enterprise.
2541#[derive(Clone, Default, PartialEq)]
2542#[non_exhaustive]
2543pub struct GitLabEnterpriseConfig {
2544    /// Required. The URI of the GitLab Enterprise host this connection is for.
2545    pub host_uri: std::string::String,
2546
2547    /// Required. Immutable. SecretManager resource containing the webhook secret
2548    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2549    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2550    /// supported in that location). This is used to validate webhooks.
2551    pub webhook_secret_secret_version: std::string::String,
2552
2553    /// Required. A GitLab personal access token with the minimum `read_api` scope
2554    /// access and a minimum role of `reporter`. The GitLab Projects visible to
2555    /// this Personal Access Token will control which Projects Developer Connect
2556    /// has access to.
2557    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2558
2559    /// Required. A GitLab personal access token with the minimum `api` scope
2560    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2561    /// this Personal Access Token will control which Projects Developer Connect
2562    /// has access to.
2563    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2564
2565    /// Optional. Configuration for using Service Directory to privately connect to
2566    /// a GitLab Enterprise instance. This should only be set if the GitLab
2567    /// Enterprise server is hosted on-premises and not reachable by public
2568    /// internet. If this field is left empty, calls to the GitLab Enterprise
2569    /// server will be made over the public internet.
2570    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2571
2572    /// Optional. SSL Certificate Authority certificate to use for requests to
2573    /// GitLab Enterprise instance.
2574    pub ssl_ca_certificate: std::string::String,
2575
2576    /// Output only. Version of the GitLab Enterprise server running on the
2577    /// `host_uri`.
2578    pub server_version: std::string::String,
2579
2580    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2581}
2582
2583impl GitLabEnterpriseConfig {
2584    pub fn new() -> Self {
2585        std::default::Default::default()
2586    }
2587
2588    /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
2589    ///
2590    /// # Example
2591    /// ```ignore,no_run
2592    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2593    /// let x = GitLabEnterpriseConfig::new().set_host_uri("example");
2594    /// ```
2595    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2596        self.host_uri = v.into();
2597        self
2598    }
2599
2600    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
2601    ///
2602    /// # Example
2603    /// ```ignore,no_run
2604    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2605    /// let x = GitLabEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2606    /// ```
2607    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2608        mut self,
2609        v: T,
2610    ) -> Self {
2611        self.webhook_secret_secret_version = v.into();
2612        self
2613    }
2614
2615    /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2616    ///
2617    /// # Example
2618    /// ```ignore,no_run
2619    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2620    /// use google_cloud_developerconnect_v1::model::UserCredential;
2621    /// let x = GitLabEnterpriseConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2622    /// ```
2623    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2624    where
2625        T: std::convert::Into<crate::model::UserCredential>,
2626    {
2627        self.read_authorizer_credential = std::option::Option::Some(v.into());
2628        self
2629    }
2630
2631    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2632    ///
2633    /// # Example
2634    /// ```ignore,no_run
2635    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2636    /// use google_cloud_developerconnect_v1::model::UserCredential;
2637    /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2638    /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2639    /// ```
2640    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2641    where
2642        T: std::convert::Into<crate::model::UserCredential>,
2643    {
2644        self.read_authorizer_credential = v.map(|x| x.into());
2645        self
2646    }
2647
2648    /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2649    ///
2650    /// # Example
2651    /// ```ignore,no_run
2652    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2653    /// use google_cloud_developerconnect_v1::model::UserCredential;
2654    /// let x = GitLabEnterpriseConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2655    /// ```
2656    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2657    where
2658        T: std::convert::Into<crate::model::UserCredential>,
2659    {
2660        self.authorizer_credential = std::option::Option::Some(v.into());
2661        self
2662    }
2663
2664    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2665    ///
2666    /// # Example
2667    /// ```ignore,no_run
2668    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2669    /// use google_cloud_developerconnect_v1::model::UserCredential;
2670    /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2671    /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2672    /// ```
2673    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2674    where
2675        T: std::convert::Into<crate::model::UserCredential>,
2676    {
2677        self.authorizer_credential = v.map(|x| x.into());
2678        self
2679    }
2680
2681    /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2682    ///
2683    /// # Example
2684    /// ```ignore,no_run
2685    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2686    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2687    /// let x = GitLabEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2688    /// ```
2689    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2690    where
2691        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2692    {
2693        self.service_directory_config = std::option::Option::Some(v.into());
2694        self
2695    }
2696
2697    /// Sets or clears the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2698    ///
2699    /// # Example
2700    /// ```ignore,no_run
2701    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2702    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2703    /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2704    /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2705    /// ```
2706    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2707    where
2708        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2709    {
2710        self.service_directory_config = v.map(|x| x.into());
2711        self
2712    }
2713
2714    /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
2715    ///
2716    /// # Example
2717    /// ```ignore,no_run
2718    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2719    /// let x = GitLabEnterpriseConfig::new().set_ssl_ca_certificate("example");
2720    /// ```
2721    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2722        mut self,
2723        v: T,
2724    ) -> Self {
2725        self.ssl_ca_certificate = v.into();
2726        self
2727    }
2728
2729    /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
2730    ///
2731    /// # Example
2732    /// ```ignore,no_run
2733    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2734    /// let x = GitLabEnterpriseConfig::new().set_server_version("example");
2735    /// ```
2736    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2737        self.server_version = v.into();
2738        self
2739    }
2740}
2741
2742impl wkt::message::Message for GitLabEnterpriseConfig {
2743    fn typename() -> &'static str {
2744        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
2745    }
2746}
2747
2748/// Configuration for connections to an instance of Bitbucket Data Center.
2749#[derive(Clone, Default, PartialEq)]
2750#[non_exhaustive]
2751pub struct BitbucketDataCenterConfig {
2752    /// Required. The URI of the Bitbucket Data Center host this connection is for.
2753    pub host_uri: std::string::String,
2754
2755    /// Required. Immutable. SecretManager resource containing the webhook secret
2756    /// used to verify webhook events, formatted as
2757    /// `projects/*/secrets/*/versions/*` or
2758    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2759    /// supported in that location). This is used to validate webhooks.
2760    pub webhook_secret_secret_version: std::string::String,
2761
2762    /// Required. An http access token with the minimum `Repository read` access.
2763    /// It's recommended to use a system account to generate the credentials.
2764    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2765
2766    /// Required. An http access token with the minimum `Repository admin` scope
2767    /// access. This is needed to create webhooks. It's recommended to use a system
2768    /// account to generate these credentials.
2769    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2770
2771    /// Optional. Configuration for using Service Directory to privately connect to
2772    /// a Bitbucket Data Center instance. This should only be set if the Bitbucket
2773    /// Data Center is hosted on-premises and not reachable by public internet. If
2774    /// this field is left empty, calls to the Bitbucket Data Center will be made
2775    /// over the public internet.
2776    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2777
2778    /// Optional. SSL certificate authority to trust when making requests to
2779    /// Bitbucket Data Center.
2780    pub ssl_ca_certificate: std::string::String,
2781
2782    /// Output only. Version of the Bitbucket Data Center server running on the
2783    /// `host_uri`.
2784    pub server_version: std::string::String,
2785
2786    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2787}
2788
2789impl BitbucketDataCenterConfig {
2790    pub fn new() -> Self {
2791        std::default::Default::default()
2792    }
2793
2794    /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
2795    ///
2796    /// # Example
2797    /// ```ignore,no_run
2798    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2799    /// let x = BitbucketDataCenterConfig::new().set_host_uri("example");
2800    /// ```
2801    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2802        self.host_uri = v.into();
2803        self
2804    }
2805
2806    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
2807    ///
2808    /// # Example
2809    /// ```ignore,no_run
2810    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2811    /// let x = BitbucketDataCenterConfig::new().set_webhook_secret_secret_version("example");
2812    /// ```
2813    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2814        mut self,
2815        v: T,
2816    ) -> Self {
2817        self.webhook_secret_secret_version = v.into();
2818        self
2819    }
2820
2821    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2822    ///
2823    /// # Example
2824    /// ```ignore,no_run
2825    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2826    /// use google_cloud_developerconnect_v1::model::UserCredential;
2827    /// let x = BitbucketDataCenterConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2828    /// ```
2829    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2830    where
2831        T: std::convert::Into<crate::model::UserCredential>,
2832    {
2833        self.read_authorizer_credential = std::option::Option::Some(v.into());
2834        self
2835    }
2836
2837    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2838    ///
2839    /// # Example
2840    /// ```ignore,no_run
2841    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2842    /// use google_cloud_developerconnect_v1::model::UserCredential;
2843    /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2844    /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2845    /// ```
2846    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2847    where
2848        T: std::convert::Into<crate::model::UserCredential>,
2849    {
2850        self.read_authorizer_credential = v.map(|x| x.into());
2851        self
2852    }
2853
2854    /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2855    ///
2856    /// # Example
2857    /// ```ignore,no_run
2858    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2859    /// use google_cloud_developerconnect_v1::model::UserCredential;
2860    /// let x = BitbucketDataCenterConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2861    /// ```
2862    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2863    where
2864        T: std::convert::Into<crate::model::UserCredential>,
2865    {
2866        self.authorizer_credential = std::option::Option::Some(v.into());
2867        self
2868    }
2869
2870    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2871    ///
2872    /// # Example
2873    /// ```ignore,no_run
2874    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2875    /// use google_cloud_developerconnect_v1::model::UserCredential;
2876    /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2877    /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2878    /// ```
2879    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2880    where
2881        T: std::convert::Into<crate::model::UserCredential>,
2882    {
2883        self.authorizer_credential = v.map(|x| x.into());
2884        self
2885    }
2886
2887    /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2888    ///
2889    /// # Example
2890    /// ```ignore,no_run
2891    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2892    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2893    /// let x = BitbucketDataCenterConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2894    /// ```
2895    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2896    where
2897        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2898    {
2899        self.service_directory_config = std::option::Option::Some(v.into());
2900        self
2901    }
2902
2903    /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2904    ///
2905    /// # Example
2906    /// ```ignore,no_run
2907    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2908    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2909    /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2910    /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2911    /// ```
2912    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2913    where
2914        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2915    {
2916        self.service_directory_config = v.map(|x| x.into());
2917        self
2918    }
2919
2920    /// Sets the value of [ssl_ca_certificate][crate::model::BitbucketDataCenterConfig::ssl_ca_certificate].
2921    ///
2922    /// # Example
2923    /// ```ignore,no_run
2924    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2925    /// let x = BitbucketDataCenterConfig::new().set_ssl_ca_certificate("example");
2926    /// ```
2927    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2928        mut self,
2929        v: T,
2930    ) -> Self {
2931        self.ssl_ca_certificate = v.into();
2932        self
2933    }
2934
2935    /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
2936    ///
2937    /// # Example
2938    /// ```ignore,no_run
2939    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2940    /// let x = BitbucketDataCenterConfig::new().set_server_version("example");
2941    /// ```
2942    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2943        self.server_version = v.into();
2944        self
2945    }
2946}
2947
2948impl wkt::message::Message for BitbucketDataCenterConfig {
2949    fn typename() -> &'static str {
2950        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
2951    }
2952}
2953
2954/// Configuration for connections to an instance of Bitbucket Cloud.
2955#[derive(Clone, Default, PartialEq)]
2956#[non_exhaustive]
2957pub struct BitbucketCloudConfig {
2958    /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
2959    /// Platform.
2960    pub workspace: std::string::String,
2961
2962    /// Required. Immutable. SecretManager resource containing the webhook secret
2963    /// used to verify webhook events, formatted as
2964    /// `projects/*/secrets/*/versions/*` or
2965    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2966    /// supported in that location). This is used to validate and create webhooks.
2967    pub webhook_secret_secret_version: std::string::String,
2968
2969    /// Required. An access token with the minimum `repository` access.
2970    /// It can either be a workspace, project or repository access token.
2971    /// It's recommended to use a system account to generate the credentials.
2972    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2973
2974    /// Required. An access token with the minimum `repository`, `pullrequest` and
2975    /// `webhook` scope access. It can either be a workspace, project or repository
2976    /// access token. This is needed to create webhooks. It's recommended to use a
2977    /// system account to generate these credentials.
2978    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2979
2980    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2981}
2982
2983impl BitbucketCloudConfig {
2984    pub fn new() -> Self {
2985        std::default::Default::default()
2986    }
2987
2988    /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
2989    ///
2990    /// # Example
2991    /// ```ignore,no_run
2992    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
2993    /// let x = BitbucketCloudConfig::new().set_workspace("example");
2994    /// ```
2995    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2996        self.workspace = v.into();
2997        self
2998    }
2999
3000    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
3001    ///
3002    /// # Example
3003    /// ```ignore,no_run
3004    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3005    /// let x = BitbucketCloudConfig::new().set_webhook_secret_secret_version("example");
3006    /// ```
3007    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3008        mut self,
3009        v: T,
3010    ) -> Self {
3011        self.webhook_secret_secret_version = v.into();
3012        self
3013    }
3014
3015    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3016    ///
3017    /// # Example
3018    /// ```ignore,no_run
3019    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3020    /// use google_cloud_developerconnect_v1::model::UserCredential;
3021    /// let x = BitbucketCloudConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
3022    /// ```
3023    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3024    where
3025        T: std::convert::Into<crate::model::UserCredential>,
3026    {
3027        self.read_authorizer_credential = std::option::Option::Some(v.into());
3028        self
3029    }
3030
3031    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3032    ///
3033    /// # Example
3034    /// ```ignore,no_run
3035    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3036    /// use google_cloud_developerconnect_v1::model::UserCredential;
3037    /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
3038    /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
3039    /// ```
3040    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3041    where
3042        T: std::convert::Into<crate::model::UserCredential>,
3043    {
3044        self.read_authorizer_credential = v.map(|x| x.into());
3045        self
3046    }
3047
3048    /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3049    ///
3050    /// # Example
3051    /// ```ignore,no_run
3052    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3053    /// use google_cloud_developerconnect_v1::model::UserCredential;
3054    /// let x = BitbucketCloudConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
3055    /// ```
3056    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3057    where
3058        T: std::convert::Into<crate::model::UserCredential>,
3059    {
3060        self.authorizer_credential = std::option::Option::Some(v.into());
3061        self
3062    }
3063
3064    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3065    ///
3066    /// # Example
3067    /// ```ignore,no_run
3068    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3069    /// use google_cloud_developerconnect_v1::model::UserCredential;
3070    /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
3071    /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
3072    /// ```
3073    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3074    where
3075        T: std::convert::Into<crate::model::UserCredential>,
3076    {
3077        self.authorizer_credential = v.map(|x| x.into());
3078        self
3079    }
3080}
3081
3082impl wkt::message::Message for BitbucketCloudConfig {
3083    fn typename() -> &'static str {
3084        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
3085    }
3086}
3087
3088/// Configuration for connections to Secure Source Manager instance
3089#[derive(Clone, Default, PartialEq)]
3090#[non_exhaustive]
3091pub struct SecureSourceManagerInstanceConfig {
3092    /// Required. Immutable. Secure Source Manager instance resource, formatted as
3093    /// `projects/*/locations/*/instances/*`
3094    pub instance: std::string::String,
3095
3096    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3097}
3098
3099impl SecureSourceManagerInstanceConfig {
3100    pub fn new() -> Self {
3101        std::default::Default::default()
3102    }
3103
3104    /// Sets the value of [instance][crate::model::SecureSourceManagerInstanceConfig::instance].
3105    ///
3106    /// # Example
3107    /// ```ignore,no_run
3108    /// # use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
3109    /// let x = SecureSourceManagerInstanceConfig::new().set_instance("example");
3110    /// ```
3111    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3112        self.instance = v.into();
3113        self
3114    }
3115}
3116
3117impl wkt::message::Message for SecureSourceManagerInstanceConfig {
3118    fn typename() -> &'static str {
3119        "type.googleapis.com/google.cloud.developerconnect.v1.SecureSourceManagerInstanceConfig"
3120    }
3121}
3122
3123/// Message for requesting list of Connections
3124#[derive(Clone, Default, PartialEq)]
3125#[non_exhaustive]
3126pub struct ListConnectionsRequest {
3127    /// Required. Parent value for ListConnectionsRequest
3128    pub parent: std::string::String,
3129
3130    /// Optional. Requested page size. Server may return fewer items than
3131    /// requested. If unspecified, server will pick an appropriate default.
3132    pub page_size: i32,
3133
3134    /// Optional. A token identifying a page of results the server should return.
3135    pub page_token: std::string::String,
3136
3137    /// Optional. Filtering results
3138    pub filter: std::string::String,
3139
3140    /// Optional. Hint for how to order the results
3141    pub order_by: std::string::String,
3142
3143    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3144}
3145
3146impl ListConnectionsRequest {
3147    pub fn new() -> Self {
3148        std::default::Default::default()
3149    }
3150
3151    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
3152    ///
3153    /// # Example
3154    /// ```ignore,no_run
3155    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3156    /// let x = ListConnectionsRequest::new().set_parent("example");
3157    /// ```
3158    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3159        self.parent = v.into();
3160        self
3161    }
3162
3163    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
3164    ///
3165    /// # Example
3166    /// ```ignore,no_run
3167    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3168    /// let x = ListConnectionsRequest::new().set_page_size(42);
3169    /// ```
3170    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3171        self.page_size = v.into();
3172        self
3173    }
3174
3175    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
3176    ///
3177    /// # Example
3178    /// ```ignore,no_run
3179    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3180    /// let x = ListConnectionsRequest::new().set_page_token("example");
3181    /// ```
3182    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3183        self.page_token = v.into();
3184        self
3185    }
3186
3187    /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
3188    ///
3189    /// # Example
3190    /// ```ignore,no_run
3191    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3192    /// let x = ListConnectionsRequest::new().set_filter("example");
3193    /// ```
3194    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3195        self.filter = v.into();
3196        self
3197    }
3198
3199    /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
3200    ///
3201    /// # Example
3202    /// ```ignore,no_run
3203    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3204    /// let x = ListConnectionsRequest::new().set_order_by("example");
3205    /// ```
3206    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3207        self.order_by = v.into();
3208        self
3209    }
3210}
3211
3212impl wkt::message::Message for ListConnectionsRequest {
3213    fn typename() -> &'static str {
3214        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
3215    }
3216}
3217
3218/// Message for response to listing Connections
3219#[derive(Clone, Default, PartialEq)]
3220#[non_exhaustive]
3221pub struct ListConnectionsResponse {
3222    /// The list of Connection
3223    pub connections: std::vec::Vec<crate::model::Connection>,
3224
3225    /// A token identifying a page of results the server should return.
3226    pub next_page_token: std::string::String,
3227
3228    /// Locations that could not be reached.
3229    pub unreachable: std::vec::Vec<std::string::String>,
3230
3231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3232}
3233
3234impl ListConnectionsResponse {
3235    pub fn new() -> Self {
3236        std::default::Default::default()
3237    }
3238
3239    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
3240    ///
3241    /// # Example
3242    /// ```ignore,no_run
3243    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3244    /// use google_cloud_developerconnect_v1::model::Connection;
3245    /// let x = ListConnectionsResponse::new()
3246    ///     .set_connections([
3247    ///         Connection::default()/* use setters */,
3248    ///         Connection::default()/* use (different) setters */,
3249    ///     ]);
3250    /// ```
3251    pub fn set_connections<T, V>(mut self, v: T) -> Self
3252    where
3253        T: std::iter::IntoIterator<Item = V>,
3254        V: std::convert::Into<crate::model::Connection>,
3255    {
3256        use std::iter::Iterator;
3257        self.connections = v.into_iter().map(|i| i.into()).collect();
3258        self
3259    }
3260
3261    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
3262    ///
3263    /// # Example
3264    /// ```ignore,no_run
3265    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3266    /// let x = ListConnectionsResponse::new().set_next_page_token("example");
3267    /// ```
3268    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3269        self.next_page_token = v.into();
3270        self
3271    }
3272
3273    /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
3274    ///
3275    /// # Example
3276    /// ```ignore,no_run
3277    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3278    /// let x = ListConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3279    /// ```
3280    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3281    where
3282        T: std::iter::IntoIterator<Item = V>,
3283        V: std::convert::Into<std::string::String>,
3284    {
3285        use std::iter::Iterator;
3286        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3287        self
3288    }
3289}
3290
3291impl wkt::message::Message for ListConnectionsResponse {
3292    fn typename() -> &'static str {
3293        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
3294    }
3295}
3296
3297#[doc(hidden)]
3298impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
3299    type PageItem = crate::model::Connection;
3300
3301    fn items(self) -> std::vec::Vec<Self::PageItem> {
3302        self.connections
3303    }
3304
3305    fn next_page_token(&self) -> std::string::String {
3306        use std::clone::Clone;
3307        self.next_page_token.clone()
3308    }
3309}
3310
3311/// Message for getting a Connection
3312#[derive(Clone, Default, PartialEq)]
3313#[non_exhaustive]
3314pub struct GetConnectionRequest {
3315    /// Required. Name of the resource
3316    pub name: std::string::String,
3317
3318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3319}
3320
3321impl GetConnectionRequest {
3322    pub fn new() -> Self {
3323        std::default::Default::default()
3324    }
3325
3326    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
3327    ///
3328    /// # Example
3329    /// ```ignore,no_run
3330    /// # use google_cloud_developerconnect_v1::model::GetConnectionRequest;
3331    /// let x = GetConnectionRequest::new().set_name("example");
3332    /// ```
3333    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3334        self.name = v.into();
3335        self
3336    }
3337}
3338
3339impl wkt::message::Message for GetConnectionRequest {
3340    fn typename() -> &'static str {
3341        "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
3342    }
3343}
3344
3345/// Message for creating a Connection
3346#[derive(Clone, Default, PartialEq)]
3347#[non_exhaustive]
3348pub struct CreateConnectionRequest {
3349    /// Required. Value for parent.
3350    pub parent: std::string::String,
3351
3352    /// Required. Id of the requesting object
3353    /// If auto-generating Id server-side, remove this field and
3354    /// connection_id from the method_signature of Create RPC
3355    pub connection_id: std::string::String,
3356
3357    /// Required. The resource being created
3358    pub connection: std::option::Option<crate::model::Connection>,
3359
3360    /// Optional. An optional request ID to identify requests. Specify a unique
3361    /// request ID so that if you must retry your request, the server will know to
3362    /// ignore the request if it has already been completed. The server will
3363    /// guarantee that for at least 60 minutes since the first request.
3364    ///
3365    /// For example, consider a situation where you make an initial request and the
3366    /// request times out. If you make the request again with the same request
3367    /// ID, the server can check if original operation with the same request ID
3368    /// was received, and if so, will ignore the second request. This prevents
3369    /// clients from accidentally creating duplicate commitments.
3370    ///
3371    /// The request ID must be a valid UUID with the exception that zero UUID is
3372    /// not supported (00000000-0000-0000-0000-000000000000).
3373    pub request_id: std::string::String,
3374
3375    /// Optional. If set, validate the request, but do not actually post it.
3376    pub validate_only: bool,
3377
3378    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3379}
3380
3381impl CreateConnectionRequest {
3382    pub fn new() -> Self {
3383        std::default::Default::default()
3384    }
3385
3386    /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
3387    ///
3388    /// # Example
3389    /// ```ignore,no_run
3390    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3391    /// let x = CreateConnectionRequest::new().set_parent("example");
3392    /// ```
3393    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3394        self.parent = v.into();
3395        self
3396    }
3397
3398    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
3399    ///
3400    /// # Example
3401    /// ```ignore,no_run
3402    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3403    /// let x = CreateConnectionRequest::new().set_connection_id("example");
3404    /// ```
3405    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3406        self.connection_id = v.into();
3407        self
3408    }
3409
3410    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
3411    ///
3412    /// # Example
3413    /// ```ignore,no_run
3414    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3415    /// use google_cloud_developerconnect_v1::model::Connection;
3416    /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3417    /// ```
3418    pub fn set_connection<T>(mut self, v: T) -> Self
3419    where
3420        T: std::convert::Into<crate::model::Connection>,
3421    {
3422        self.connection = std::option::Option::Some(v.into());
3423        self
3424    }
3425
3426    /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
3427    ///
3428    /// # Example
3429    /// ```ignore,no_run
3430    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3431    /// use google_cloud_developerconnect_v1::model::Connection;
3432    /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3433    /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3434    /// ```
3435    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3436    where
3437        T: std::convert::Into<crate::model::Connection>,
3438    {
3439        self.connection = v.map(|x| x.into());
3440        self
3441    }
3442
3443    /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
3444    ///
3445    /// # Example
3446    /// ```ignore,no_run
3447    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3448    /// let x = CreateConnectionRequest::new().set_request_id("example");
3449    /// ```
3450    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3451        self.request_id = v.into();
3452        self
3453    }
3454
3455    /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
3456    ///
3457    /// # Example
3458    /// ```ignore,no_run
3459    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3460    /// let x = CreateConnectionRequest::new().set_validate_only(true);
3461    /// ```
3462    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3463        self.validate_only = v.into();
3464        self
3465    }
3466}
3467
3468impl wkt::message::Message for CreateConnectionRequest {
3469    fn typename() -> &'static str {
3470        "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
3471    }
3472}
3473
3474/// Message for updating a Connection
3475#[derive(Clone, Default, PartialEq)]
3476#[non_exhaustive]
3477pub struct UpdateConnectionRequest {
3478    /// Required. Field mask is used to specify the fields to be overwritten in the
3479    /// Connection resource by the update.
3480    /// The fields specified in the update_mask are relative to the resource, not
3481    /// the full request. A field will be overwritten if it is in the mask. If the
3482    /// user does not provide a mask then all fields will be overwritten.
3483    pub update_mask: std::option::Option<wkt::FieldMask>,
3484
3485    /// Required. The resource being updated
3486    pub connection: std::option::Option<crate::model::Connection>,
3487
3488    /// Optional. An optional request ID to identify requests. Specify a unique
3489    /// request ID so that if you must retry your request, the server will know to
3490    /// ignore the request if it has already been completed. The server will
3491    /// guarantee that for at least 60 minutes since the first request.
3492    ///
3493    /// For example, consider a situation where you make an initial request and the
3494    /// request times out. If you make the request again with the same request
3495    /// ID, the server can check if original operation with the same request ID
3496    /// was received, and if so, will ignore the second request. This prevents
3497    /// clients from accidentally creating duplicate commitments.
3498    ///
3499    /// The request ID must be a valid UUID with the exception that zero UUID is
3500    /// not supported (00000000-0000-0000-0000-000000000000).
3501    pub request_id: std::string::String,
3502
3503    /// Optional. If set to true, and the connection is not found a new connection
3504    /// will be created. In this situation `update_mask` is ignored.
3505    /// The creation will succeed only if the input connection has all the
3506    /// necessary information (e.g a github_config with both  user_oauth_token and
3507    /// installation_id properties).
3508    pub allow_missing: bool,
3509
3510    /// Optional. If set, validate the request, but do not actually post it.
3511    pub validate_only: bool,
3512
3513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3514}
3515
3516impl UpdateConnectionRequest {
3517    pub fn new() -> Self {
3518        std::default::Default::default()
3519    }
3520
3521    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3522    ///
3523    /// # Example
3524    /// ```ignore,no_run
3525    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3526    /// use wkt::FieldMask;
3527    /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3528    /// ```
3529    pub fn set_update_mask<T>(mut self, v: T) -> Self
3530    where
3531        T: std::convert::Into<wkt::FieldMask>,
3532    {
3533        self.update_mask = std::option::Option::Some(v.into());
3534        self
3535    }
3536
3537    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3538    ///
3539    /// # Example
3540    /// ```ignore,no_run
3541    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3542    /// use wkt::FieldMask;
3543    /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3544    /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3545    /// ```
3546    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3547    where
3548        T: std::convert::Into<wkt::FieldMask>,
3549    {
3550        self.update_mask = v.map(|x| x.into());
3551        self
3552    }
3553
3554    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
3555    ///
3556    /// # Example
3557    /// ```ignore,no_run
3558    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3559    /// use google_cloud_developerconnect_v1::model::Connection;
3560    /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3561    /// ```
3562    pub fn set_connection<T>(mut self, v: T) -> Self
3563    where
3564        T: std::convert::Into<crate::model::Connection>,
3565    {
3566        self.connection = std::option::Option::Some(v.into());
3567        self
3568    }
3569
3570    /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
3571    ///
3572    /// # Example
3573    /// ```ignore,no_run
3574    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3575    /// use google_cloud_developerconnect_v1::model::Connection;
3576    /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3577    /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3578    /// ```
3579    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3580    where
3581        T: std::convert::Into<crate::model::Connection>,
3582    {
3583        self.connection = v.map(|x| x.into());
3584        self
3585    }
3586
3587    /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
3588    ///
3589    /// # Example
3590    /// ```ignore,no_run
3591    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3592    /// let x = UpdateConnectionRequest::new().set_request_id("example");
3593    /// ```
3594    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3595        self.request_id = v.into();
3596        self
3597    }
3598
3599    /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
3600    ///
3601    /// # Example
3602    /// ```ignore,no_run
3603    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3604    /// let x = UpdateConnectionRequest::new().set_allow_missing(true);
3605    /// ```
3606    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3607        self.allow_missing = v.into();
3608        self
3609    }
3610
3611    /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
3612    ///
3613    /// # Example
3614    /// ```ignore,no_run
3615    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3616    /// let x = UpdateConnectionRequest::new().set_validate_only(true);
3617    /// ```
3618    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3619        self.validate_only = v.into();
3620        self
3621    }
3622}
3623
3624impl wkt::message::Message for UpdateConnectionRequest {
3625    fn typename() -> &'static str {
3626        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
3627    }
3628}
3629
3630/// Message for deleting a Connection
3631#[derive(Clone, Default, PartialEq)]
3632#[non_exhaustive]
3633pub struct DeleteConnectionRequest {
3634    /// Required. Name of the resource
3635    pub name: std::string::String,
3636
3637    /// Optional. An optional request ID to identify requests. Specify a unique
3638    /// request ID so that if you must retry your request, the server will know to
3639    /// ignore the request if it has already been completed. The server will
3640    /// guarantee that for at least 60 minutes after the first request.
3641    ///
3642    /// For example, consider a situation where you make an initial request and the
3643    /// request times out. If you make the request again with the same request
3644    /// ID, the server can check if original operation with the same request ID
3645    /// was received, and if so, will ignore the second request. This prevents
3646    /// clients from accidentally creating duplicate commitments.
3647    ///
3648    /// The request ID must be a valid UUID with the exception that zero UUID is
3649    /// not supported (00000000-0000-0000-0000-000000000000).
3650    pub request_id: std::string::String,
3651
3652    /// Optional. If set, validate the request, but do not actually post it.
3653    pub validate_only: bool,
3654
3655    /// Optional. The current etag of the Connection.
3656    /// If an etag is provided and does not match the current etag of the
3657    /// Connection, deletion will be blocked and an ABORTED error will be returned.
3658    pub etag: std::string::String,
3659
3660    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3661}
3662
3663impl DeleteConnectionRequest {
3664    pub fn new() -> Self {
3665        std::default::Default::default()
3666    }
3667
3668    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
3669    ///
3670    /// # Example
3671    /// ```ignore,no_run
3672    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3673    /// let x = DeleteConnectionRequest::new().set_name("example");
3674    /// ```
3675    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3676        self.name = v.into();
3677        self
3678    }
3679
3680    /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
3681    ///
3682    /// # Example
3683    /// ```ignore,no_run
3684    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3685    /// let x = DeleteConnectionRequest::new().set_request_id("example");
3686    /// ```
3687    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3688        self.request_id = v.into();
3689        self
3690    }
3691
3692    /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
3693    ///
3694    /// # Example
3695    /// ```ignore,no_run
3696    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3697    /// let x = DeleteConnectionRequest::new().set_validate_only(true);
3698    /// ```
3699    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3700        self.validate_only = v.into();
3701        self
3702    }
3703
3704    /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
3705    ///
3706    /// # Example
3707    /// ```ignore,no_run
3708    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3709    /// let x = DeleteConnectionRequest::new().set_etag("example");
3710    /// ```
3711    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3712        self.etag = v.into();
3713        self
3714    }
3715}
3716
3717impl wkt::message::Message for DeleteConnectionRequest {
3718    fn typename() -> &'static str {
3719        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
3720    }
3721}
3722
3723/// Message for requesting list of AccountConnectors
3724#[derive(Clone, Default, PartialEq)]
3725#[non_exhaustive]
3726pub struct ListAccountConnectorsRequest {
3727    /// Required. Parent value for ListAccountConnectorsRequest
3728    pub parent: std::string::String,
3729
3730    /// Optional. Requested page size. Server may return fewer items than
3731    /// requested. If unspecified, server will pick an appropriate default.
3732    pub page_size: i32,
3733
3734    /// Optional. A token identifying a page of results the server should return.
3735    pub page_token: std::string::String,
3736
3737    /// Optional. Filtering results
3738    pub filter: std::string::String,
3739
3740    /// Optional. Hint for how to order the results
3741    pub order_by: std::string::String,
3742
3743    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3744}
3745
3746impl ListAccountConnectorsRequest {
3747    pub fn new() -> Self {
3748        std::default::Default::default()
3749    }
3750
3751    /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
3752    ///
3753    /// # Example
3754    /// ```ignore,no_run
3755    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3756    /// let x = ListAccountConnectorsRequest::new().set_parent("example");
3757    /// ```
3758    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3759        self.parent = v.into();
3760        self
3761    }
3762
3763    /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
3764    ///
3765    /// # Example
3766    /// ```ignore,no_run
3767    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3768    /// let x = ListAccountConnectorsRequest::new().set_page_size(42);
3769    /// ```
3770    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3771        self.page_size = v.into();
3772        self
3773    }
3774
3775    /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
3776    ///
3777    /// # Example
3778    /// ```ignore,no_run
3779    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3780    /// let x = ListAccountConnectorsRequest::new().set_page_token("example");
3781    /// ```
3782    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3783        self.page_token = v.into();
3784        self
3785    }
3786
3787    /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
3788    ///
3789    /// # Example
3790    /// ```ignore,no_run
3791    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3792    /// let x = ListAccountConnectorsRequest::new().set_filter("example");
3793    /// ```
3794    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3795        self.filter = v.into();
3796        self
3797    }
3798
3799    /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
3800    ///
3801    /// # Example
3802    /// ```ignore,no_run
3803    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3804    /// let x = ListAccountConnectorsRequest::new().set_order_by("example");
3805    /// ```
3806    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3807        self.order_by = v.into();
3808        self
3809    }
3810}
3811
3812impl wkt::message::Message for ListAccountConnectorsRequest {
3813    fn typename() -> &'static str {
3814        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
3815    }
3816}
3817
3818/// Message for response to listing AccountConnectors
3819#[derive(Clone, Default, PartialEq)]
3820#[non_exhaustive]
3821pub struct ListAccountConnectorsResponse {
3822    /// The list of AccountConnectors
3823    pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
3824
3825    /// A token identifying a page of results the server should return.
3826    pub next_page_token: std::string::String,
3827
3828    /// Locations that could not be reached.
3829    pub unreachable: std::vec::Vec<std::string::String>,
3830
3831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3832}
3833
3834impl ListAccountConnectorsResponse {
3835    pub fn new() -> Self {
3836        std::default::Default::default()
3837    }
3838
3839    /// Sets the value of [account_connectors][crate::model::ListAccountConnectorsResponse::account_connectors].
3840    ///
3841    /// # Example
3842    /// ```ignore,no_run
3843    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3844    /// use google_cloud_developerconnect_v1::model::AccountConnector;
3845    /// let x = ListAccountConnectorsResponse::new()
3846    ///     .set_account_connectors([
3847    ///         AccountConnector::default()/* use setters */,
3848    ///         AccountConnector::default()/* use (different) setters */,
3849    ///     ]);
3850    /// ```
3851    pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
3852    where
3853        T: std::iter::IntoIterator<Item = V>,
3854        V: std::convert::Into<crate::model::AccountConnector>,
3855    {
3856        use std::iter::Iterator;
3857        self.account_connectors = v.into_iter().map(|i| i.into()).collect();
3858        self
3859    }
3860
3861    /// Sets the value of [next_page_token][crate::model::ListAccountConnectorsResponse::next_page_token].
3862    ///
3863    /// # Example
3864    /// ```ignore,no_run
3865    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3866    /// let x = ListAccountConnectorsResponse::new().set_next_page_token("example");
3867    /// ```
3868    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3869        self.next_page_token = v.into();
3870        self
3871    }
3872
3873    /// Sets the value of [unreachable][crate::model::ListAccountConnectorsResponse::unreachable].
3874    ///
3875    /// # Example
3876    /// ```ignore,no_run
3877    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3878    /// let x = ListAccountConnectorsResponse::new().set_unreachable(["a", "b", "c"]);
3879    /// ```
3880    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3881    where
3882        T: std::iter::IntoIterator<Item = V>,
3883        V: std::convert::Into<std::string::String>,
3884    {
3885        use std::iter::Iterator;
3886        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3887        self
3888    }
3889}
3890
3891impl wkt::message::Message for ListAccountConnectorsResponse {
3892    fn typename() -> &'static str {
3893        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
3894    }
3895}
3896
3897#[doc(hidden)]
3898impl google_cloud_gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
3899    type PageItem = crate::model::AccountConnector;
3900
3901    fn items(self) -> std::vec::Vec<Self::PageItem> {
3902        self.account_connectors
3903    }
3904
3905    fn next_page_token(&self) -> std::string::String {
3906        use std::clone::Clone;
3907        self.next_page_token.clone()
3908    }
3909}
3910
3911/// Message for getting a AccountConnector
3912#[derive(Clone, Default, PartialEq)]
3913#[non_exhaustive]
3914pub struct GetAccountConnectorRequest {
3915    /// Required. Name of the resource
3916    pub name: std::string::String,
3917
3918    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3919}
3920
3921impl GetAccountConnectorRequest {
3922    pub fn new() -> Self {
3923        std::default::Default::default()
3924    }
3925
3926    /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
3927    ///
3928    /// # Example
3929    /// ```ignore,no_run
3930    /// # use google_cloud_developerconnect_v1::model::GetAccountConnectorRequest;
3931    /// let x = GetAccountConnectorRequest::new().set_name("example");
3932    /// ```
3933    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3934        self.name = v.into();
3935        self
3936    }
3937}
3938
3939impl wkt::message::Message for GetAccountConnectorRequest {
3940    fn typename() -> &'static str {
3941        "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
3942    }
3943}
3944
3945#[derive(Clone, Default, PartialEq)]
3946#[non_exhaustive]
3947pub struct CreateAccountConnectorRequest {
3948    /// Required. Location resource name as the account_connector’s parent.
3949    pub parent: std::string::String,
3950
3951    /// Required. The ID to use for the AccountConnector, which will become the
3952    /// final component of the AccountConnector's resource name. Its format should
3953    /// adhere to <https://google.aip.dev/122#resource-id-segments> Names must be
3954    /// unique per-project per-location.
3955    pub account_connector_id: std::string::String,
3956
3957    /// Required. The AccountConnector to create.
3958    pub account_connector: std::option::Option<crate::model::AccountConnector>,
3959
3960    /// Optional. An optional request ID to identify requests. Specify a unique
3961    /// request ID so that if you must retry your request, the server will know to
3962    /// ignore the request if it has already been completed. The server will
3963    /// guarantee that for at least 60 minutes since the first request.
3964    ///
3965    /// For example, consider a situation where you make an initial request and the
3966    /// request times out. If you make the request again with the same request
3967    /// ID, the server can check if original operation with the same request ID
3968    /// was received, and if so, will ignore the second request. This prevents
3969    /// clients from accidentally creating duplicate commitments.
3970    ///
3971    /// The request ID must be a valid UUID with the exception that zero UUID is
3972    /// not supported (00000000-0000-0000-0000-000000000000).
3973    pub request_id: std::string::String,
3974
3975    /// Optional. If set, validate the request, but do not actually post it.
3976    pub validate_only: bool,
3977
3978    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3979}
3980
3981impl CreateAccountConnectorRequest {
3982    pub fn new() -> Self {
3983        std::default::Default::default()
3984    }
3985
3986    /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
3987    ///
3988    /// # Example
3989    /// ```ignore,no_run
3990    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
3991    /// let x = CreateAccountConnectorRequest::new().set_parent("example");
3992    /// ```
3993    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3994        self.parent = v.into();
3995        self
3996    }
3997
3998    /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
3999    ///
4000    /// # Example
4001    /// ```ignore,no_run
4002    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4003    /// let x = CreateAccountConnectorRequest::new().set_account_connector_id("example");
4004    /// ```
4005    pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
4006        mut self,
4007        v: T,
4008    ) -> Self {
4009        self.account_connector_id = v.into();
4010        self
4011    }
4012
4013    /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4014    ///
4015    /// # Example
4016    /// ```ignore,no_run
4017    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4018    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4019    /// let x = CreateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4020    /// ```
4021    pub fn set_account_connector<T>(mut self, v: T) -> Self
4022    where
4023        T: std::convert::Into<crate::model::AccountConnector>,
4024    {
4025        self.account_connector = std::option::Option::Some(v.into());
4026        self
4027    }
4028
4029    /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4030    ///
4031    /// # Example
4032    /// ```ignore,no_run
4033    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4034    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4035    /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4036    /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4037    /// ```
4038    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4039    where
4040        T: std::convert::Into<crate::model::AccountConnector>,
4041    {
4042        self.account_connector = v.map(|x| x.into());
4043        self
4044    }
4045
4046    /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
4047    ///
4048    /// # Example
4049    /// ```ignore,no_run
4050    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4051    /// let x = CreateAccountConnectorRequest::new().set_request_id("example");
4052    /// ```
4053    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4054        self.request_id = v.into();
4055        self
4056    }
4057
4058    /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
4059    ///
4060    /// # Example
4061    /// ```ignore,no_run
4062    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4063    /// let x = CreateAccountConnectorRequest::new().set_validate_only(true);
4064    /// ```
4065    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4066        self.validate_only = v.into();
4067        self
4068    }
4069}
4070
4071impl wkt::message::Message for CreateAccountConnectorRequest {
4072    fn typename() -> &'static str {
4073        "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
4074    }
4075}
4076
4077/// Message for updating a AccountConnector
4078#[derive(Clone, Default, PartialEq)]
4079#[non_exhaustive]
4080pub struct UpdateAccountConnectorRequest {
4081    /// Optional. The list of fields to be updated.
4082    pub update_mask: std::option::Option<wkt::FieldMask>,
4083
4084    /// Required. The AccountConnector to update.
4085    pub account_connector: std::option::Option<crate::model::AccountConnector>,
4086
4087    /// Optional. An optional request ID to identify requests. Specify a unique
4088    /// request ID so that if you must retry your request, the server will know to
4089    /// ignore the request if it has already been completed. The server will
4090    /// guarantee that for at least 60 minutes since the first request.
4091    ///
4092    /// For example, consider a situation where you make an initial request and the
4093    /// request times out. If you make the request again with the same request
4094    /// ID, the server can check if original operation with the same request ID
4095    /// was received, and if so, will ignore the second request. This prevents
4096    /// clients from accidentally creating duplicate commitments.
4097    ///
4098    /// The request ID must be a valid UUID with the exception that zero UUID is
4099    /// not supported (00000000-0000-0000-0000-000000000000).
4100    pub request_id: std::string::String,
4101
4102    /// Optional. If set to true, and the accountConnector is not found a new
4103    /// accountConnector will be created. In this situation `update_mask` is
4104    /// ignored. The creation will succeed only if the input accountConnector has
4105    /// all the necessary
4106    pub allow_missing: bool,
4107
4108    /// Optional. If set, validate the request, but do not actually post it.
4109    pub validate_only: bool,
4110
4111    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4112}
4113
4114impl UpdateAccountConnectorRequest {
4115    pub fn new() -> Self {
4116        std::default::Default::default()
4117    }
4118
4119    /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4120    ///
4121    /// # Example
4122    /// ```ignore,no_run
4123    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4124    /// use wkt::FieldMask;
4125    /// let x = UpdateAccountConnectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4126    /// ```
4127    pub fn set_update_mask<T>(mut self, v: T) -> Self
4128    where
4129        T: std::convert::Into<wkt::FieldMask>,
4130    {
4131        self.update_mask = std::option::Option::Some(v.into());
4132        self
4133    }
4134
4135    /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4136    ///
4137    /// # Example
4138    /// ```ignore,no_run
4139    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4140    /// use wkt::FieldMask;
4141    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4142    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4143    /// ```
4144    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4145    where
4146        T: std::convert::Into<wkt::FieldMask>,
4147    {
4148        self.update_mask = v.map(|x| x.into());
4149        self
4150    }
4151
4152    /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4153    ///
4154    /// # Example
4155    /// ```ignore,no_run
4156    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4157    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4158    /// let x = UpdateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4159    /// ```
4160    pub fn set_account_connector<T>(mut self, v: T) -> Self
4161    where
4162        T: std::convert::Into<crate::model::AccountConnector>,
4163    {
4164        self.account_connector = std::option::Option::Some(v.into());
4165        self
4166    }
4167
4168    /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4169    ///
4170    /// # Example
4171    /// ```ignore,no_run
4172    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4173    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4174    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4175    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4176    /// ```
4177    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4178    where
4179        T: std::convert::Into<crate::model::AccountConnector>,
4180    {
4181        self.account_connector = v.map(|x| x.into());
4182        self
4183    }
4184
4185    /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
4186    ///
4187    /// # Example
4188    /// ```ignore,no_run
4189    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4190    /// let x = UpdateAccountConnectorRequest::new().set_request_id("example");
4191    /// ```
4192    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4193        self.request_id = v.into();
4194        self
4195    }
4196
4197    /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
4198    ///
4199    /// # Example
4200    /// ```ignore,no_run
4201    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4202    /// let x = UpdateAccountConnectorRequest::new().set_allow_missing(true);
4203    /// ```
4204    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4205        self.allow_missing = v.into();
4206        self
4207    }
4208
4209    /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
4210    ///
4211    /// # Example
4212    /// ```ignore,no_run
4213    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4214    /// let x = UpdateAccountConnectorRequest::new().set_validate_only(true);
4215    /// ```
4216    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4217        self.validate_only = v.into();
4218        self
4219    }
4220}
4221
4222impl wkt::message::Message for UpdateAccountConnectorRequest {
4223    fn typename() -> &'static str {
4224        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
4225    }
4226}
4227
4228/// Message for deleting a AccountConnector
4229#[derive(Clone, Default, PartialEq)]
4230#[non_exhaustive]
4231pub struct DeleteAccountConnectorRequest {
4232    /// Required. Name of the resource
4233    pub name: std::string::String,
4234
4235    /// Optional. An optional request ID to identify requests. Specify a unique
4236    /// request ID so that if you must retry your request, the server will know to
4237    /// ignore the request if it has already been completed. The server will
4238    /// guarantee that for at least 60 minutes after the first request.
4239    ///
4240    /// For example, consider a situation where you make an initial request and the
4241    /// request times out. If you make the request again with the same request
4242    /// ID, the server can check if original operation with the same request ID
4243    /// was received, and if so, will ignore the second request. This prevents
4244    /// clients from accidentally creating duplicate commitments.
4245    ///
4246    /// The request ID must be a valid UUID with the exception that zero UUID is
4247    /// not supported (00000000-0000-0000-0000-000000000000).
4248    pub request_id: std::string::String,
4249
4250    /// Optional. If set, validate the request, but do not actually post it.
4251    pub validate_only: bool,
4252
4253    /// Optional. The current etag of the AccountConnectorn.
4254    /// If an etag is provided and does not match the current etag of the
4255    /// AccountConnector, deletion will be blocked and an ABORTED error will be
4256    /// returned.
4257    pub etag: std::string::String,
4258
4259    /// Optional. If set to true, any Users from this AccountConnector will also
4260    /// be deleted. (Otherwise, the request will only work if the AccountConnector
4261    /// has no Users.)
4262    pub force: bool,
4263
4264    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4265}
4266
4267impl DeleteAccountConnectorRequest {
4268    pub fn new() -> Self {
4269        std::default::Default::default()
4270    }
4271
4272    /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
4273    ///
4274    /// # Example
4275    /// ```ignore,no_run
4276    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4277    /// let x = DeleteAccountConnectorRequest::new().set_name("example");
4278    /// ```
4279    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4280        self.name = v.into();
4281        self
4282    }
4283
4284    /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
4285    ///
4286    /// # Example
4287    /// ```ignore,no_run
4288    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4289    /// let x = DeleteAccountConnectorRequest::new().set_request_id("example");
4290    /// ```
4291    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4292        self.request_id = v.into();
4293        self
4294    }
4295
4296    /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
4297    ///
4298    /// # Example
4299    /// ```ignore,no_run
4300    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4301    /// let x = DeleteAccountConnectorRequest::new().set_validate_only(true);
4302    /// ```
4303    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4304        self.validate_only = v.into();
4305        self
4306    }
4307
4308    /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
4309    ///
4310    /// # Example
4311    /// ```ignore,no_run
4312    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4313    /// let x = DeleteAccountConnectorRequest::new().set_etag("example");
4314    /// ```
4315    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4316        self.etag = v.into();
4317        self
4318    }
4319
4320    /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
4321    ///
4322    /// # Example
4323    /// ```ignore,no_run
4324    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4325    /// let x = DeleteAccountConnectorRequest::new().set_force(true);
4326    /// ```
4327    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4328        self.force = v.into();
4329        self
4330    }
4331}
4332
4333impl wkt::message::Message for DeleteAccountConnectorRequest {
4334    fn typename() -> &'static str {
4335        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
4336    }
4337}
4338
4339/// Message for deleting a User
4340#[derive(Clone, Default, PartialEq)]
4341#[non_exhaustive]
4342pub struct DeleteUserRequest {
4343    /// Required. Name of the resource
4344    pub name: std::string::String,
4345
4346    /// Optional. An optional request ID to identify requests. Specify a unique
4347    /// request ID so that if you must retry your request, the server will know to
4348    /// ignore the request if it has already been completed. The server will
4349    /// guarantee that for at least 60 minutes after the first request.
4350    ///
4351    /// For example, consider a situation where you make an initial request and the
4352    /// request times out. If you make the request again with the same request
4353    /// ID, the server can check if original operation with the same request ID
4354    /// was received, and if so, will ignore the second request. This prevents
4355    /// clients from accidentally creating duplicate commitments.
4356    ///
4357    /// The request ID must be a valid UUID with the exception that zero UUID is
4358    /// not supported (00000000-0000-0000-0000-000000000000).
4359    pub request_id: std::string::String,
4360
4361    /// Optional. If set, validate the request, but do not actually post it.
4362    pub validate_only: bool,
4363
4364    /// Optional. This checksum is computed by the server based on the value of
4365    /// other fields, and may be sent on update and delete requests to ensure the
4366    /// client has an up-to-date value before proceeding.
4367    pub etag: std::string::String,
4368
4369    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4370}
4371
4372impl DeleteUserRequest {
4373    pub fn new() -> Self {
4374        std::default::Default::default()
4375    }
4376
4377    /// Sets the value of [name][crate::model::DeleteUserRequest::name].
4378    ///
4379    /// # Example
4380    /// ```ignore,no_run
4381    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4382    /// let x = DeleteUserRequest::new().set_name("example");
4383    /// ```
4384    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4385        self.name = v.into();
4386        self
4387    }
4388
4389    /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
4390    ///
4391    /// # Example
4392    /// ```ignore,no_run
4393    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4394    /// let x = DeleteUserRequest::new().set_request_id("example");
4395    /// ```
4396    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4397        self.request_id = v.into();
4398        self
4399    }
4400
4401    /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
4402    ///
4403    /// # Example
4404    /// ```ignore,no_run
4405    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4406    /// let x = DeleteUserRequest::new().set_validate_only(true);
4407    /// ```
4408    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4409        self.validate_only = v.into();
4410        self
4411    }
4412
4413    /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
4414    ///
4415    /// # Example
4416    /// ```ignore,no_run
4417    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4418    /// let x = DeleteUserRequest::new().set_etag("example");
4419    /// ```
4420    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4421        self.etag = v.into();
4422        self
4423    }
4424}
4425
4426impl wkt::message::Message for DeleteUserRequest {
4427    fn typename() -> &'static str {
4428        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
4429    }
4430}
4431
4432/// Represents the metadata of the long-running operation.
4433#[derive(Clone, Default, PartialEq)]
4434#[non_exhaustive]
4435pub struct OperationMetadata {
4436    /// Output only. The time the operation was created.
4437    pub create_time: std::option::Option<wkt::Timestamp>,
4438
4439    /// Output only. The time the operation finished running.
4440    pub end_time: std::option::Option<wkt::Timestamp>,
4441
4442    /// Output only. Server-defined resource path for the target of the operation.
4443    pub target: std::string::String,
4444
4445    /// Output only. Name of the verb executed by the operation.
4446    pub verb: std::string::String,
4447
4448    /// Output only. Human-readable status of the operation, if any.
4449    pub status_message: std::string::String,
4450
4451    /// Output only. Identifies whether the user has requested cancellation
4452    /// of the operation. Operations that have been cancelled successfully
4453    /// have
4454    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
4455    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
4456    /// corresponding to `Code.CANCELLED`.
4457    ///
4458    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
4459    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4460    pub requested_cancellation: bool,
4461
4462    /// Output only. API version used to start the operation.
4463    pub api_version: std::string::String,
4464
4465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4466}
4467
4468impl OperationMetadata {
4469    pub fn new() -> Self {
4470        std::default::Default::default()
4471    }
4472
4473    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4474    ///
4475    /// # Example
4476    /// ```ignore,no_run
4477    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4478    /// use wkt::Timestamp;
4479    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4480    /// ```
4481    pub fn set_create_time<T>(mut self, v: T) -> Self
4482    where
4483        T: std::convert::Into<wkt::Timestamp>,
4484    {
4485        self.create_time = std::option::Option::Some(v.into());
4486        self
4487    }
4488
4489    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4490    ///
4491    /// # Example
4492    /// ```ignore,no_run
4493    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4494    /// use wkt::Timestamp;
4495    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4496    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4497    /// ```
4498    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4499    where
4500        T: std::convert::Into<wkt::Timestamp>,
4501    {
4502        self.create_time = v.map(|x| x.into());
4503        self
4504    }
4505
4506    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4507    ///
4508    /// # Example
4509    /// ```ignore,no_run
4510    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4511    /// use wkt::Timestamp;
4512    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4513    /// ```
4514    pub fn set_end_time<T>(mut self, v: T) -> Self
4515    where
4516        T: std::convert::Into<wkt::Timestamp>,
4517    {
4518        self.end_time = std::option::Option::Some(v.into());
4519        self
4520    }
4521
4522    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4523    ///
4524    /// # Example
4525    /// ```ignore,no_run
4526    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4527    /// use wkt::Timestamp;
4528    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4529    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4530    /// ```
4531    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4532    where
4533        T: std::convert::Into<wkt::Timestamp>,
4534    {
4535        self.end_time = v.map(|x| x.into());
4536        self
4537    }
4538
4539    /// Sets the value of [target][crate::model::OperationMetadata::target].
4540    ///
4541    /// # Example
4542    /// ```ignore,no_run
4543    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4544    /// let x = OperationMetadata::new().set_target("example");
4545    /// ```
4546    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4547        self.target = v.into();
4548        self
4549    }
4550
4551    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4552    ///
4553    /// # Example
4554    /// ```ignore,no_run
4555    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4556    /// let x = OperationMetadata::new().set_verb("example");
4557    /// ```
4558    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4559        self.verb = v.into();
4560        self
4561    }
4562
4563    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4564    ///
4565    /// # Example
4566    /// ```ignore,no_run
4567    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4568    /// let x = OperationMetadata::new().set_status_message("example");
4569    /// ```
4570    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4571        self.status_message = v.into();
4572        self
4573    }
4574
4575    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4576    ///
4577    /// # Example
4578    /// ```ignore,no_run
4579    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4580    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4581    /// ```
4582    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4583        self.requested_cancellation = v.into();
4584        self
4585    }
4586
4587    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4588    ///
4589    /// # Example
4590    /// ```ignore,no_run
4591    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4592    /// let x = OperationMetadata::new().set_api_version("example");
4593    /// ```
4594    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4595        self.api_version = v.into();
4596        self
4597    }
4598}
4599
4600impl wkt::message::Message for OperationMetadata {
4601    fn typename() -> &'static str {
4602        "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
4603    }
4604}
4605
4606/// Message for fetching a User of the user themselves.
4607#[derive(Clone, Default, PartialEq)]
4608#[non_exhaustive]
4609pub struct FetchSelfRequest {
4610    /// Required. Name of the AccountConnector resource
4611    pub name: std::string::String,
4612
4613    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4614}
4615
4616impl FetchSelfRequest {
4617    pub fn new() -> Self {
4618        std::default::Default::default()
4619    }
4620
4621    /// Sets the value of [name][crate::model::FetchSelfRequest::name].
4622    ///
4623    /// # Example
4624    /// ```ignore,no_run
4625    /// # use google_cloud_developerconnect_v1::model::FetchSelfRequest;
4626    /// let x = FetchSelfRequest::new().set_name("example");
4627    /// ```
4628    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4629        self.name = v.into();
4630        self
4631    }
4632}
4633
4634impl wkt::message::Message for FetchSelfRequest {
4635    fn typename() -> &'static str {
4636        "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
4637    }
4638}
4639
4640/// Message for deleting a User of the user themselves.
4641#[derive(Clone, Default, PartialEq)]
4642#[non_exhaustive]
4643pub struct DeleteSelfRequest {
4644    /// Required. Name of the AccountConnector resource
4645    pub name: std::string::String,
4646
4647    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4648}
4649
4650impl DeleteSelfRequest {
4651    pub fn new() -> Self {
4652        std::default::Default::default()
4653    }
4654
4655    /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
4656    ///
4657    /// # Example
4658    /// ```ignore,no_run
4659    /// # use google_cloud_developerconnect_v1::model::DeleteSelfRequest;
4660    /// let x = DeleteSelfRequest::new().set_name("example");
4661    /// ```
4662    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4663        self.name = v.into();
4664        self
4665    }
4666}
4667
4668impl wkt::message::Message for DeleteSelfRequest {
4669    fn typename() -> &'static str {
4670        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
4671    }
4672}
4673
4674/// Message for fetching an OAuth access token.
4675#[derive(Clone, Default, PartialEq)]
4676#[non_exhaustive]
4677pub struct FetchAccessTokenRequest {
4678    /// Required. The resource name of the AccountConnector in the format
4679    /// `projects/*/locations/*/accountConnectors/*`.
4680    pub account_connector: std::string::String,
4681
4682    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4683}
4684
4685impl FetchAccessTokenRequest {
4686    pub fn new() -> Self {
4687        std::default::Default::default()
4688    }
4689
4690    /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
4691    ///
4692    /// # Example
4693    /// ```ignore,no_run
4694    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenRequest;
4695    /// let x = FetchAccessTokenRequest::new().set_account_connector("example");
4696    /// ```
4697    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4698        mut self,
4699        v: T,
4700    ) -> Self {
4701        self.account_connector = v.into();
4702        self
4703    }
4704}
4705
4706impl wkt::message::Message for FetchAccessTokenRequest {
4707    fn typename() -> &'static str {
4708        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
4709    }
4710}
4711
4712/// Message for responding to getting an OAuth access token.
4713#[derive(Clone, Default, PartialEq)]
4714#[non_exhaustive]
4715pub struct FetchAccessTokenResponse {
4716    /// The token content.
4717    pub token: std::string::String,
4718
4719    /// Expiration timestamp. Can be empty if unknown or non-expiring.
4720    pub expiration_time: std::option::Option<wkt::Timestamp>,
4721
4722    /// The scopes of the access token.
4723    pub scopes: std::vec::Vec<std::string::String>,
4724
4725    /// The error resulted from exchanging OAuth tokens from the service provider.
4726    pub exchange_error: std::option::Option<crate::model::ExchangeError>,
4727
4728    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4729}
4730
4731impl FetchAccessTokenResponse {
4732    pub fn new() -> Self {
4733        std::default::Default::default()
4734    }
4735
4736    /// Sets the value of [token][crate::model::FetchAccessTokenResponse::token].
4737    ///
4738    /// # Example
4739    /// ```ignore,no_run
4740    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4741    /// let x = FetchAccessTokenResponse::new().set_token("example");
4742    /// ```
4743    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4744        self.token = v.into();
4745        self
4746    }
4747
4748    /// Sets the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4749    ///
4750    /// # Example
4751    /// ```ignore,no_run
4752    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4753    /// use wkt::Timestamp;
4754    /// let x = FetchAccessTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
4755    /// ```
4756    pub fn set_expiration_time<T>(mut self, v: T) -> Self
4757    where
4758        T: std::convert::Into<wkt::Timestamp>,
4759    {
4760        self.expiration_time = std::option::Option::Some(v.into());
4761        self
4762    }
4763
4764    /// Sets or clears the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4765    ///
4766    /// # Example
4767    /// ```ignore,no_run
4768    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4769    /// use wkt::Timestamp;
4770    /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
4771    /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
4772    /// ```
4773    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
4774    where
4775        T: std::convert::Into<wkt::Timestamp>,
4776    {
4777        self.expiration_time = v.map(|x| x.into());
4778        self
4779    }
4780
4781    /// Sets the value of [scopes][crate::model::FetchAccessTokenResponse::scopes].
4782    ///
4783    /// # Example
4784    /// ```ignore,no_run
4785    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4786    /// let x = FetchAccessTokenResponse::new().set_scopes(["a", "b", "c"]);
4787    /// ```
4788    pub fn set_scopes<T, V>(mut self, v: T) -> Self
4789    where
4790        T: std::iter::IntoIterator<Item = V>,
4791        V: std::convert::Into<std::string::String>,
4792    {
4793        use std::iter::Iterator;
4794        self.scopes = v.into_iter().map(|i| i.into()).collect();
4795        self
4796    }
4797
4798    /// Sets the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4799    ///
4800    /// # Example
4801    /// ```ignore,no_run
4802    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4803    /// use google_cloud_developerconnect_v1::model::ExchangeError;
4804    /// let x = FetchAccessTokenResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
4805    /// ```
4806    pub fn set_exchange_error<T>(mut self, v: T) -> Self
4807    where
4808        T: std::convert::Into<crate::model::ExchangeError>,
4809    {
4810        self.exchange_error = std::option::Option::Some(v.into());
4811        self
4812    }
4813
4814    /// Sets or clears the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4815    ///
4816    /// # Example
4817    /// ```ignore,no_run
4818    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4819    /// use google_cloud_developerconnect_v1::model::ExchangeError;
4820    /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
4821    /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
4822    /// ```
4823    pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
4824    where
4825        T: std::convert::Into<crate::model::ExchangeError>,
4826    {
4827        self.exchange_error = v.map(|x| x.into());
4828        self
4829    }
4830}
4831
4832impl wkt::message::Message for FetchAccessTokenResponse {
4833    fn typename() -> &'static str {
4834        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
4835    }
4836}
4837
4838/// Message for starting an OAuth flow.
4839#[derive(Clone, Default, PartialEq)]
4840#[non_exhaustive]
4841pub struct StartOAuthRequest {
4842    /// Required. The resource name of the AccountConnector in the format
4843    /// `projects/*/locations/*/accountConnectors/*`.
4844    pub account_connector: std::string::String,
4845
4846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4847}
4848
4849impl StartOAuthRequest {
4850    pub fn new() -> Self {
4851        std::default::Default::default()
4852    }
4853
4854    /// Sets the value of [account_connector][crate::model::StartOAuthRequest::account_connector].
4855    ///
4856    /// # Example
4857    /// ```ignore,no_run
4858    /// # use google_cloud_developerconnect_v1::model::StartOAuthRequest;
4859    /// let x = StartOAuthRequest::new().set_account_connector("example");
4860    /// ```
4861    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4862        mut self,
4863        v: T,
4864    ) -> Self {
4865        self.account_connector = v.into();
4866        self
4867    }
4868}
4869
4870impl wkt::message::Message for StartOAuthRequest {
4871    fn typename() -> &'static str {
4872        "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthRequest"
4873    }
4874}
4875
4876/// Message for responding to starting an OAuth flow.
4877#[derive(Clone, Default, PartialEq)]
4878#[non_exhaustive]
4879pub struct StartOAuthResponse {
4880    /// The ticket to be used for post processing the callback from the service
4881    /// provider.
4882    pub ticket: std::string::String,
4883
4884    /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.1>
4885    pub code_challenge: std::string::String,
4886
4887    /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.2>
4888    pub code_challenge_method: std::string::String,
4889
4890    /// The client ID to the OAuth App of the service provider.
4891    pub client_id: std::string::String,
4892
4893    /// The list of scopes requested by the application.
4894    pub scopes: std::vec::Vec<std::string::String>,
4895
4896    /// The authorization server URL to the OAuth flow of the service provider.
4897    pub auth_uri: std::string::String,
4898
4899    /// The ID of the service provider.
4900    pub id: std::option::Option<crate::model::start_o_auth_response::Id>,
4901
4902    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4903}
4904
4905impl StartOAuthResponse {
4906    pub fn new() -> Self {
4907        std::default::Default::default()
4908    }
4909
4910    /// Sets the value of [ticket][crate::model::StartOAuthResponse::ticket].
4911    ///
4912    /// # Example
4913    /// ```ignore,no_run
4914    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4915    /// let x = StartOAuthResponse::new().set_ticket("example");
4916    /// ```
4917    pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4918        self.ticket = v.into();
4919        self
4920    }
4921
4922    /// Sets the value of [code_challenge][crate::model::StartOAuthResponse::code_challenge].
4923    ///
4924    /// # Example
4925    /// ```ignore,no_run
4926    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4927    /// let x = StartOAuthResponse::new().set_code_challenge("example");
4928    /// ```
4929    pub fn set_code_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4930        self.code_challenge = v.into();
4931        self
4932    }
4933
4934    /// Sets the value of [code_challenge_method][crate::model::StartOAuthResponse::code_challenge_method].
4935    ///
4936    /// # Example
4937    /// ```ignore,no_run
4938    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4939    /// let x = StartOAuthResponse::new().set_code_challenge_method("example");
4940    /// ```
4941    pub fn set_code_challenge_method<T: std::convert::Into<std::string::String>>(
4942        mut self,
4943        v: T,
4944    ) -> Self {
4945        self.code_challenge_method = v.into();
4946        self
4947    }
4948
4949    /// Sets the value of [client_id][crate::model::StartOAuthResponse::client_id].
4950    ///
4951    /// # Example
4952    /// ```ignore,no_run
4953    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4954    /// let x = StartOAuthResponse::new().set_client_id("example");
4955    /// ```
4956    pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4957        self.client_id = v.into();
4958        self
4959    }
4960
4961    /// Sets the value of [scopes][crate::model::StartOAuthResponse::scopes].
4962    ///
4963    /// # Example
4964    /// ```ignore,no_run
4965    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4966    /// let x = StartOAuthResponse::new().set_scopes(["a", "b", "c"]);
4967    /// ```
4968    pub fn set_scopes<T, V>(mut self, v: T) -> Self
4969    where
4970        T: std::iter::IntoIterator<Item = V>,
4971        V: std::convert::Into<std::string::String>,
4972    {
4973        use std::iter::Iterator;
4974        self.scopes = v.into_iter().map(|i| i.into()).collect();
4975        self
4976    }
4977
4978    /// Sets the value of [auth_uri][crate::model::StartOAuthResponse::auth_uri].
4979    ///
4980    /// # Example
4981    /// ```ignore,no_run
4982    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4983    /// let x = StartOAuthResponse::new().set_auth_uri("example");
4984    /// ```
4985    pub fn set_auth_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4986        self.auth_uri = v.into();
4987        self
4988    }
4989
4990    /// Sets the value of [id][crate::model::StartOAuthResponse::id].
4991    ///
4992    /// Note that all the setters affecting `id` are mutually
4993    /// exclusive.
4994    ///
4995    /// # Example
4996    /// ```ignore,no_run
4997    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4998    /// use google_cloud_developerconnect_v1::model::SystemProvider;
4999    /// let x0 = StartOAuthResponse::new().set_id(Some(
5000    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Github)));
5001    /// let x1 = StartOAuthResponse::new().set_id(Some(
5002    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Gitlab)));
5003    /// let x2 = StartOAuthResponse::new().set_id(Some(
5004    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Google)));
5005    /// ```
5006    pub fn set_id<
5007        T: std::convert::Into<std::option::Option<crate::model::start_o_auth_response::Id>>,
5008    >(
5009        mut self,
5010        v: T,
5011    ) -> Self {
5012        self.id = v.into();
5013        self
5014    }
5015
5016    /// The value of [id][crate::model::StartOAuthResponse::id]
5017    /// if it holds a `SystemProviderId`, `None` if the field is not set or
5018    /// holds a different branch.
5019    pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
5020        #[allow(unreachable_patterns)]
5021        self.id.as_ref().and_then(|v| match v {
5022            crate::model::start_o_auth_response::Id::SystemProviderId(v) => {
5023                std::option::Option::Some(v)
5024            }
5025            _ => std::option::Option::None,
5026        })
5027    }
5028
5029    /// Sets the value of [id][crate::model::StartOAuthResponse::id]
5030    /// to hold a `SystemProviderId`.
5031    ///
5032    /// Note that all the setters affecting `id` are
5033    /// mutually exclusive.
5034    ///
5035    /// # Example
5036    /// ```ignore,no_run
5037    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5038    /// use google_cloud_developerconnect_v1::model::SystemProvider;
5039    /// let x0 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Github);
5040    /// let x1 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Gitlab);
5041    /// let x2 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Google);
5042    /// assert!(x0.system_provider_id().is_some());
5043    /// assert!(x1.system_provider_id().is_some());
5044    /// assert!(x2.system_provider_id().is_some());
5045    /// ```
5046    pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
5047        mut self,
5048        v: T,
5049    ) -> Self {
5050        self.id = std::option::Option::Some(
5051            crate::model::start_o_auth_response::Id::SystemProviderId(v.into()),
5052        );
5053        self
5054    }
5055}
5056
5057impl wkt::message::Message for StartOAuthResponse {
5058    fn typename() -> &'static str {
5059        "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthResponse"
5060    }
5061}
5062
5063/// Defines additional types related to [StartOAuthResponse].
5064pub mod start_o_auth_response {
5065    #[allow(unused_imports)]
5066    use super::*;
5067
5068    /// The ID of the service provider.
5069    #[derive(Clone, Debug, PartialEq)]
5070    #[non_exhaustive]
5071    pub enum Id {
5072        /// The ID of the system provider.
5073        SystemProviderId(crate::model::SystemProvider),
5074    }
5075}
5076
5077/// Message for finishing an OAuth flow.
5078#[derive(Clone, Default, PartialEq)]
5079#[non_exhaustive]
5080pub struct FinishOAuthRequest {
5081    /// Required. The resource name of the AccountConnector in the format
5082    /// `projects/*/locations/*/accountConnectors/*`.
5083    pub account_connector: std::string::String,
5084
5085    /// The params returned by OAuth flow redirect.
5086    pub params: std::option::Option<crate::model::finish_o_auth_request::Params>,
5087
5088    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5089}
5090
5091impl FinishOAuthRequest {
5092    pub fn new() -> Self {
5093        std::default::Default::default()
5094    }
5095
5096    /// Sets the value of [account_connector][crate::model::FinishOAuthRequest::account_connector].
5097    ///
5098    /// # Example
5099    /// ```ignore,no_run
5100    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5101    /// let x = FinishOAuthRequest::new().set_account_connector("example");
5102    /// ```
5103    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
5104        mut self,
5105        v: T,
5106    ) -> Self {
5107        self.account_connector = v.into();
5108        self
5109    }
5110
5111    /// Sets the value of [params][crate::model::FinishOAuthRequest::params].
5112    ///
5113    /// Note that all the setters affecting `params` are mutually
5114    /// exclusive.
5115    ///
5116    /// # Example
5117    /// ```ignore,no_run
5118    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5119    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5120    /// let x = FinishOAuthRequest::new().set_params(Some(
5121    ///     google_cloud_developerconnect_v1::model::finish_o_auth_request::Params::OauthParams(OAuthParams::default().into())));
5122    /// ```
5123    pub fn set_params<
5124        T: std::convert::Into<std::option::Option<crate::model::finish_o_auth_request::Params>>,
5125    >(
5126        mut self,
5127        v: T,
5128    ) -> Self {
5129        self.params = v.into();
5130        self
5131    }
5132
5133    /// The value of [params][crate::model::FinishOAuthRequest::params]
5134    /// if it holds a `OauthParams`, `None` if the field is not set or
5135    /// holds a different branch.
5136    pub fn oauth_params(
5137        &self,
5138    ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>
5139    {
5140        #[allow(unreachable_patterns)]
5141        self.params.as_ref().and_then(|v| match v {
5142            crate::model::finish_o_auth_request::Params::OauthParams(v) => {
5143                std::option::Option::Some(v)
5144            }
5145            _ => std::option::Option::None,
5146        })
5147    }
5148
5149    /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5150    /// to hold a `OauthParams`.
5151    ///
5152    /// Note that all the setters affecting `params` are
5153    /// mutually exclusive.
5154    ///
5155    /// # Example
5156    /// ```ignore,no_run
5157    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5158    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5159    /// let x = FinishOAuthRequest::new().set_oauth_params(OAuthParams::default()/* use setters */);
5160    /// assert!(x.oauth_params().is_some());
5161    /// assert!(x.google_oauth_params().is_none());
5162    /// ```
5163    pub fn set_oauth_params<
5164        T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>,
5165    >(
5166        mut self,
5167        v: T,
5168    ) -> Self {
5169        self.params = std::option::Option::Some(
5170            crate::model::finish_o_auth_request::Params::OauthParams(v.into()),
5171        );
5172        self
5173    }
5174
5175    /// The value of [params][crate::model::FinishOAuthRequest::params]
5176    /// if it holds a `GoogleOauthParams`, `None` if the field is not set or
5177    /// holds a different branch.
5178    pub fn google_oauth_params(
5179        &self,
5180    ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>
5181    {
5182        #[allow(unreachable_patterns)]
5183        self.params.as_ref().and_then(|v| match v {
5184            crate::model::finish_o_auth_request::Params::GoogleOauthParams(v) => {
5185                std::option::Option::Some(v)
5186            }
5187            _ => std::option::Option::None,
5188        })
5189    }
5190
5191    /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5192    /// to hold a `GoogleOauthParams`.
5193    ///
5194    /// Note that all the setters affecting `params` are
5195    /// mutually exclusive.
5196    ///
5197    /// # Example
5198    /// ```ignore,no_run
5199    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5200    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5201    /// let x = FinishOAuthRequest::new().set_google_oauth_params(GoogleOAuthParams::default()/* use setters */);
5202    /// assert!(x.google_oauth_params().is_some());
5203    /// assert!(x.oauth_params().is_none());
5204    /// ```
5205    pub fn set_google_oauth_params<
5206        T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>,
5207    >(
5208        mut self,
5209        v: T,
5210    ) -> Self {
5211        self.params = std::option::Option::Some(
5212            crate::model::finish_o_auth_request::Params::GoogleOauthParams(v.into()),
5213        );
5214        self
5215    }
5216}
5217
5218impl wkt::message::Message for FinishOAuthRequest {
5219    fn typename() -> &'static str {
5220        "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest"
5221    }
5222}
5223
5224/// Defines additional types related to [FinishOAuthRequest].
5225pub mod finish_o_auth_request {
5226    #[allow(unused_imports)]
5227    use super::*;
5228
5229    /// The params returned by non-Google OAuth 2.0 flow redirect.
5230    #[derive(Clone, Default, PartialEq)]
5231    #[non_exhaustive]
5232    pub struct OAuthParams {
5233        /// Required. The code to be used for getting the token from SCM provider.
5234        pub code: std::string::String,
5235
5236        /// Required. The ticket to be used for post processing the callback from SCM
5237        /// provider.
5238        pub ticket: std::string::String,
5239
5240        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5241    }
5242
5243    impl OAuthParams {
5244        pub fn new() -> Self {
5245            std::default::Default::default()
5246        }
5247
5248        /// Sets the value of [code][crate::model::finish_o_auth_request::OAuthParams::code].
5249        ///
5250        /// # Example
5251        /// ```ignore,no_run
5252        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5253        /// let x = OAuthParams::new().set_code("example");
5254        /// ```
5255        pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5256            self.code = v.into();
5257            self
5258        }
5259
5260        /// Sets the value of [ticket][crate::model::finish_o_auth_request::OAuthParams::ticket].
5261        ///
5262        /// # Example
5263        /// ```ignore,no_run
5264        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5265        /// let x = OAuthParams::new().set_ticket("example");
5266        /// ```
5267        pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5268            self.ticket = v.into();
5269            self
5270        }
5271    }
5272
5273    impl wkt::message::Message for OAuthParams {
5274        fn typename() -> &'static str {
5275            "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.OAuthParams"
5276        }
5277    }
5278
5279    /// The params returned by Google OAuth flow redirects.
5280    #[derive(Clone, Default, PartialEq)]
5281    #[non_exhaustive]
5282    pub struct GoogleOAuthParams {
5283        /// Required. The scopes returned by Google OAuth flow.
5284        pub scopes: std::vec::Vec<std::string::String>,
5285
5286        /// Optional. The version info returned by Google OAuth flow.
5287        pub version_info: std::string::String,
5288
5289        /// Required. The ticket to be used for post processing the callback from
5290        /// Google OAuth flow.
5291        pub ticket: std::string::String,
5292
5293        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5294    }
5295
5296    impl GoogleOAuthParams {
5297        pub fn new() -> Self {
5298            std::default::Default::default()
5299        }
5300
5301        /// Sets the value of [scopes][crate::model::finish_o_auth_request::GoogleOAuthParams::scopes].
5302        ///
5303        /// # Example
5304        /// ```ignore,no_run
5305        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5306        /// let x = GoogleOAuthParams::new().set_scopes(["a", "b", "c"]);
5307        /// ```
5308        pub fn set_scopes<T, V>(mut self, v: T) -> Self
5309        where
5310            T: std::iter::IntoIterator<Item = V>,
5311            V: std::convert::Into<std::string::String>,
5312        {
5313            use std::iter::Iterator;
5314            self.scopes = v.into_iter().map(|i| i.into()).collect();
5315            self
5316        }
5317
5318        /// Sets the value of [version_info][crate::model::finish_o_auth_request::GoogleOAuthParams::version_info].
5319        ///
5320        /// # Example
5321        /// ```ignore,no_run
5322        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5323        /// let x = GoogleOAuthParams::new().set_version_info("example");
5324        /// ```
5325        pub fn set_version_info<T: std::convert::Into<std::string::String>>(
5326            mut self,
5327            v: T,
5328        ) -> Self {
5329            self.version_info = v.into();
5330            self
5331        }
5332
5333        /// Sets the value of [ticket][crate::model::finish_o_auth_request::GoogleOAuthParams::ticket].
5334        ///
5335        /// # Example
5336        /// ```ignore,no_run
5337        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5338        /// let x = GoogleOAuthParams::new().set_ticket("example");
5339        /// ```
5340        pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5341            self.ticket = v.into();
5342            self
5343        }
5344    }
5345
5346    impl wkt::message::Message for GoogleOAuthParams {
5347        fn typename() -> &'static str {
5348            "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.GoogleOAuthParams"
5349        }
5350    }
5351
5352    /// The params returned by OAuth flow redirect.
5353    #[derive(Clone, Debug, PartialEq)]
5354    #[non_exhaustive]
5355    pub enum Params {
5356        /// The params returned by non-Google OAuth 2.0 flow redirect.
5357        OauthParams(std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>),
5358        /// The params returned by Google OAuth flow redirects.
5359        GoogleOauthParams(std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>),
5360    }
5361}
5362
5363/// Message for responding to finishing an OAuth flow.
5364#[derive(Clone, Default, PartialEq)]
5365#[non_exhaustive]
5366pub struct FinishOAuthResponse {
5367    /// The error resulted from exchanging OAuth tokens from the service provider.
5368    pub exchange_error: std::option::Option<crate::model::ExchangeError>,
5369
5370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5371}
5372
5373impl FinishOAuthResponse {
5374    pub fn new() -> Self {
5375        std::default::Default::default()
5376    }
5377
5378    /// Sets the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5379    ///
5380    /// # Example
5381    /// ```ignore,no_run
5382    /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5383    /// use google_cloud_developerconnect_v1::model::ExchangeError;
5384    /// let x = FinishOAuthResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
5385    /// ```
5386    pub fn set_exchange_error<T>(mut self, v: T) -> Self
5387    where
5388        T: std::convert::Into<crate::model::ExchangeError>,
5389    {
5390        self.exchange_error = std::option::Option::Some(v.into());
5391        self
5392    }
5393
5394    /// Sets or clears the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5395    ///
5396    /// # Example
5397    /// ```ignore,no_run
5398    /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5399    /// use google_cloud_developerconnect_v1::model::ExchangeError;
5400    /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
5401    /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
5402    /// ```
5403    pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
5404    where
5405        T: std::convert::Into<crate::model::ExchangeError>,
5406    {
5407        self.exchange_error = v.map(|x| x.into());
5408        self
5409    }
5410}
5411
5412impl wkt::message::Message for FinishOAuthResponse {
5413    fn typename() -> &'static str {
5414        "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthResponse"
5415    }
5416}
5417
5418/// Message for representing an error from exchanging OAuth tokens.
5419#[derive(Clone, Default, PartialEq)]
5420#[non_exhaustive]
5421pub struct ExchangeError {
5422    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> - error
5423    pub code: std::string::String,
5424
5425    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> -
5426    /// error_description
5427    pub description: std::string::String,
5428
5429    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5430}
5431
5432impl ExchangeError {
5433    pub fn new() -> Self {
5434        std::default::Default::default()
5435    }
5436
5437    /// Sets the value of [code][crate::model::ExchangeError::code].
5438    ///
5439    /// # Example
5440    /// ```ignore,no_run
5441    /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5442    /// let x = ExchangeError::new().set_code("example");
5443    /// ```
5444    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5445        self.code = v.into();
5446        self
5447    }
5448
5449    /// Sets the value of [description][crate::model::ExchangeError::description].
5450    ///
5451    /// # Example
5452    /// ```ignore,no_run
5453    /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5454    /// let x = ExchangeError::new().set_description("example");
5455    /// ```
5456    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5457        self.description = v.into();
5458        self
5459    }
5460}
5461
5462impl wkt::message::Message for ExchangeError {
5463    fn typename() -> &'static str {
5464        "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
5465    }
5466}
5467
5468/// Message describing the GitRepositoryLink object
5469#[derive(Clone, Default, PartialEq)]
5470#[non_exhaustive]
5471pub struct GitRepositoryLink {
5472    /// Identifier. Resource name of the repository, in the format
5473    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
5474    pub name: std::string::String,
5475
5476    /// Required. Git Clone URI.
5477    pub clone_uri: std::string::String,
5478
5479    /// Output only. [Output only] Create timestamp
5480    pub create_time: std::option::Option<wkt::Timestamp>,
5481
5482    /// Output only. [Output only] Update timestamp
5483    pub update_time: std::option::Option<wkt::Timestamp>,
5484
5485    /// Output only. [Output only] Delete timestamp
5486    pub delete_time: std::option::Option<wkt::Timestamp>,
5487
5488    /// Optional. Labels as key value pairs
5489    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5490
5491    /// Optional. This checksum is computed by the server based on the value of
5492    /// other fields, and may be sent on update and delete requests to ensure the
5493    /// client has an up-to-date value before proceeding.
5494    pub etag: std::string::String,
5495
5496    /// Output only. Set to true when the connection is being set up or updated in
5497    /// the background.
5498    pub reconciling: bool,
5499
5500    /// Optional. Allows clients to store small amounts of arbitrary data.
5501    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5502
5503    /// Output only. A system-assigned unique identifier for the GitRepositoryLink.
5504    pub uid: std::string::String,
5505
5506    /// Output only. External ID of the webhook created for the repository.
5507    pub webhook_id: std::string::String,
5508
5509    /// Output only. URI to access the linked repository through the Git Proxy.
5510    /// This field is only populated if the git proxy is enabled for the
5511    /// connection.
5512    pub git_proxy_uri: std::string::String,
5513
5514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5515}
5516
5517impl GitRepositoryLink {
5518    pub fn new() -> Self {
5519        std::default::Default::default()
5520    }
5521
5522    /// Sets the value of [name][crate::model::GitRepositoryLink::name].
5523    ///
5524    /// # Example
5525    /// ```ignore,no_run
5526    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5527    /// let x = GitRepositoryLink::new().set_name("example");
5528    /// ```
5529    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5530        self.name = v.into();
5531        self
5532    }
5533
5534    /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
5535    ///
5536    /// # Example
5537    /// ```ignore,no_run
5538    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5539    /// let x = GitRepositoryLink::new().set_clone_uri("example");
5540    /// ```
5541    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5542        self.clone_uri = v.into();
5543        self
5544    }
5545
5546    /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
5547    ///
5548    /// # Example
5549    /// ```ignore,no_run
5550    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5551    /// use wkt::Timestamp;
5552    /// let x = GitRepositoryLink::new().set_create_time(Timestamp::default()/* use setters */);
5553    /// ```
5554    pub fn set_create_time<T>(mut self, v: T) -> Self
5555    where
5556        T: std::convert::Into<wkt::Timestamp>,
5557    {
5558        self.create_time = std::option::Option::Some(v.into());
5559        self
5560    }
5561
5562    /// Sets or clears the value of [create_time][crate::model::GitRepositoryLink::create_time].
5563    ///
5564    /// # Example
5565    /// ```ignore,no_run
5566    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5567    /// use wkt::Timestamp;
5568    /// let x = GitRepositoryLink::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5569    /// let x = GitRepositoryLink::new().set_or_clear_create_time(None::<Timestamp>);
5570    /// ```
5571    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5572    where
5573        T: std::convert::Into<wkt::Timestamp>,
5574    {
5575        self.create_time = v.map(|x| x.into());
5576        self
5577    }
5578
5579    /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
5580    ///
5581    /// # Example
5582    /// ```ignore,no_run
5583    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5584    /// use wkt::Timestamp;
5585    /// let x = GitRepositoryLink::new().set_update_time(Timestamp::default()/* use setters */);
5586    /// ```
5587    pub fn set_update_time<T>(mut self, v: T) -> Self
5588    where
5589        T: std::convert::Into<wkt::Timestamp>,
5590    {
5591        self.update_time = std::option::Option::Some(v.into());
5592        self
5593    }
5594
5595    /// Sets or clears the value of [update_time][crate::model::GitRepositoryLink::update_time].
5596    ///
5597    /// # Example
5598    /// ```ignore,no_run
5599    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5600    /// use wkt::Timestamp;
5601    /// let x = GitRepositoryLink::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5602    /// let x = GitRepositoryLink::new().set_or_clear_update_time(None::<Timestamp>);
5603    /// ```
5604    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5605    where
5606        T: std::convert::Into<wkt::Timestamp>,
5607    {
5608        self.update_time = v.map(|x| x.into());
5609        self
5610    }
5611
5612    /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5613    ///
5614    /// # Example
5615    /// ```ignore,no_run
5616    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5617    /// use wkt::Timestamp;
5618    /// let x = GitRepositoryLink::new().set_delete_time(Timestamp::default()/* use setters */);
5619    /// ```
5620    pub fn set_delete_time<T>(mut self, v: T) -> Self
5621    where
5622        T: std::convert::Into<wkt::Timestamp>,
5623    {
5624        self.delete_time = std::option::Option::Some(v.into());
5625        self
5626    }
5627
5628    /// Sets or clears the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5629    ///
5630    /// # Example
5631    /// ```ignore,no_run
5632    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5633    /// use wkt::Timestamp;
5634    /// let x = GitRepositoryLink::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
5635    /// let x = GitRepositoryLink::new().set_or_clear_delete_time(None::<Timestamp>);
5636    /// ```
5637    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
5638    where
5639        T: std::convert::Into<wkt::Timestamp>,
5640    {
5641        self.delete_time = v.map(|x| x.into());
5642        self
5643    }
5644
5645    /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
5646    ///
5647    /// # Example
5648    /// ```ignore,no_run
5649    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5650    /// let x = GitRepositoryLink::new().set_labels([
5651    ///     ("key0", "abc"),
5652    ///     ("key1", "xyz"),
5653    /// ]);
5654    /// ```
5655    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5656    where
5657        T: std::iter::IntoIterator<Item = (K, V)>,
5658        K: std::convert::Into<std::string::String>,
5659        V: std::convert::Into<std::string::String>,
5660    {
5661        use std::iter::Iterator;
5662        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5663        self
5664    }
5665
5666    /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
5667    ///
5668    /// # Example
5669    /// ```ignore,no_run
5670    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5671    /// let x = GitRepositoryLink::new().set_etag("example");
5672    /// ```
5673    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5674        self.etag = v.into();
5675        self
5676    }
5677
5678    /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
5679    ///
5680    /// # Example
5681    /// ```ignore,no_run
5682    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5683    /// let x = GitRepositoryLink::new().set_reconciling(true);
5684    /// ```
5685    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5686        self.reconciling = v.into();
5687        self
5688    }
5689
5690    /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
5691    ///
5692    /// # Example
5693    /// ```ignore,no_run
5694    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5695    /// let x = GitRepositoryLink::new().set_annotations([
5696    ///     ("key0", "abc"),
5697    ///     ("key1", "xyz"),
5698    /// ]);
5699    /// ```
5700    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5701    where
5702        T: std::iter::IntoIterator<Item = (K, V)>,
5703        K: std::convert::Into<std::string::String>,
5704        V: std::convert::Into<std::string::String>,
5705    {
5706        use std::iter::Iterator;
5707        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5708        self
5709    }
5710
5711    /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
5712    ///
5713    /// # Example
5714    /// ```ignore,no_run
5715    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5716    /// let x = GitRepositoryLink::new().set_uid("example");
5717    /// ```
5718    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5719        self.uid = v.into();
5720        self
5721    }
5722
5723    /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
5724    ///
5725    /// # Example
5726    /// ```ignore,no_run
5727    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5728    /// let x = GitRepositoryLink::new().set_webhook_id("example");
5729    /// ```
5730    pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5731        self.webhook_id = v.into();
5732        self
5733    }
5734
5735    /// Sets the value of [git_proxy_uri][crate::model::GitRepositoryLink::git_proxy_uri].
5736    ///
5737    /// # Example
5738    /// ```ignore,no_run
5739    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5740    /// let x = GitRepositoryLink::new().set_git_proxy_uri("example");
5741    /// ```
5742    pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5743        self.git_proxy_uri = v.into();
5744        self
5745    }
5746}
5747
5748impl wkt::message::Message for GitRepositoryLink {
5749    fn typename() -> &'static str {
5750        "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
5751    }
5752}
5753
5754/// Message for creating a GitRepositoryLink
5755#[derive(Clone, Default, PartialEq)]
5756#[non_exhaustive]
5757pub struct CreateGitRepositoryLinkRequest {
5758    /// Required. Value for parent.
5759    pub parent: std::string::String,
5760
5761    /// Required. The resource being created
5762    pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
5763
5764    /// Required. The ID to use for the repository, which will become the final
5765    /// component of the repository's resource name. This ID should be unique in
5766    /// the connection. Allows alphanumeric characters and any of
5767    /// -._~%!$&'()*+,;=@.
5768    pub git_repository_link_id: std::string::String,
5769
5770    /// Optional. An optional request ID to identify requests. Specify a unique
5771    /// request ID so that if you must retry your request, the server will know to
5772    /// ignore the request if it has already been completed. The server will
5773    /// guarantee that for at least 60 minutes since the first request.
5774    ///
5775    /// For example, consider a situation where you make an initial request and the
5776    /// request times out. If you make the request again with the same request
5777    /// ID, the server can check if original operation with the same request ID
5778    /// was received, and if so, will ignore the second request. This prevents
5779    /// clients from accidentally creating duplicate commitments.
5780    ///
5781    /// The request ID must be a valid UUID with the exception that zero UUID is
5782    /// not supported (00000000-0000-0000-0000-000000000000).
5783    pub request_id: std::string::String,
5784
5785    /// Optional. If set, validate the request, but do not actually post it.
5786    pub validate_only: bool,
5787
5788    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5789}
5790
5791impl CreateGitRepositoryLinkRequest {
5792    pub fn new() -> Self {
5793        std::default::Default::default()
5794    }
5795
5796    /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
5797    ///
5798    /// # Example
5799    /// ```ignore,no_run
5800    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5801    /// let x = CreateGitRepositoryLinkRequest::new().set_parent("example");
5802    /// ```
5803    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5804        self.parent = v.into();
5805        self
5806    }
5807
5808    /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
5809    ///
5810    /// # Example
5811    /// ```ignore,no_run
5812    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5813    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5814    /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link(GitRepositoryLink::default()/* use setters */);
5815    /// ```
5816    pub fn set_git_repository_link<T>(mut self, v: T) -> Self
5817    where
5818        T: std::convert::Into<crate::model::GitRepositoryLink>,
5819    {
5820        self.git_repository_link = std::option::Option::Some(v.into());
5821        self
5822    }
5823
5824    /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
5825    ///
5826    /// # Example
5827    /// ```ignore,no_run
5828    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5829    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5830    /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(Some(GitRepositoryLink::default()/* use setters */));
5831    /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(None::<GitRepositoryLink>);
5832    /// ```
5833    pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
5834    where
5835        T: std::convert::Into<crate::model::GitRepositoryLink>,
5836    {
5837        self.git_repository_link = v.map(|x| x.into());
5838        self
5839    }
5840
5841    /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
5842    ///
5843    /// # Example
5844    /// ```ignore,no_run
5845    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5846    /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link_id("example");
5847    /// ```
5848    pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
5849        mut self,
5850        v: T,
5851    ) -> Self {
5852        self.git_repository_link_id = v.into();
5853        self
5854    }
5855
5856    /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
5857    ///
5858    /// # Example
5859    /// ```ignore,no_run
5860    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5861    /// let x = CreateGitRepositoryLinkRequest::new().set_request_id("example");
5862    /// ```
5863    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5864        self.request_id = v.into();
5865        self
5866    }
5867
5868    /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
5869    ///
5870    /// # Example
5871    /// ```ignore,no_run
5872    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5873    /// let x = CreateGitRepositoryLinkRequest::new().set_validate_only(true);
5874    /// ```
5875    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5876        self.validate_only = v.into();
5877        self
5878    }
5879}
5880
5881impl wkt::message::Message for CreateGitRepositoryLinkRequest {
5882    fn typename() -> &'static str {
5883        "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
5884    }
5885}
5886
5887/// Message for deleting a GitRepositoryLink
5888#[derive(Clone, Default, PartialEq)]
5889#[non_exhaustive]
5890pub struct DeleteGitRepositoryLinkRequest {
5891    /// Required. Name of the resource
5892    pub name: std::string::String,
5893
5894    /// Optional. An optional request ID to identify requests. Specify a unique
5895    /// request ID so that if you must retry your request, the server will know to
5896    /// ignore the request if it has already been completed. The server will
5897    /// guarantee that for at least 60 minutes after the first request.
5898    ///
5899    /// For example, consider a situation where you make an initial request and the
5900    /// request times out. If you make the request again with the same request
5901    /// ID, the server can check if original operation with the same request ID
5902    /// was received, and if so, will ignore the second request. This prevents
5903    /// clients from accidentally creating duplicate commitments.
5904    ///
5905    /// The request ID must be a valid UUID with the exception that zero UUID is
5906    /// not supported (00000000-0000-0000-0000-000000000000).
5907    pub request_id: std::string::String,
5908
5909    /// Optional. If set, validate the request, but do not actually post it.
5910    pub validate_only: bool,
5911
5912    /// Optional. This checksum is computed by the server based on the value of
5913    /// other fields, and may be sent on update and delete requests to ensure the
5914    /// client has an up-to-date value before proceeding.
5915    pub etag: std::string::String,
5916
5917    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5918}
5919
5920impl DeleteGitRepositoryLinkRequest {
5921    pub fn new() -> Self {
5922        std::default::Default::default()
5923    }
5924
5925    /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
5926    ///
5927    /// # Example
5928    /// ```ignore,no_run
5929    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
5930    /// let x = DeleteGitRepositoryLinkRequest::new().set_name("example");
5931    /// ```
5932    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5933        self.name = v.into();
5934        self
5935    }
5936
5937    /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
5938    ///
5939    /// # Example
5940    /// ```ignore,no_run
5941    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
5942    /// let x = DeleteGitRepositoryLinkRequest::new().set_request_id("example");
5943    /// ```
5944    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5945        self.request_id = v.into();
5946        self
5947    }
5948
5949    /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
5950    ///
5951    /// # Example
5952    /// ```ignore,no_run
5953    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
5954    /// let x = DeleteGitRepositoryLinkRequest::new().set_validate_only(true);
5955    /// ```
5956    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5957        self.validate_only = v.into();
5958        self
5959    }
5960
5961    /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
5962    ///
5963    /// # Example
5964    /// ```ignore,no_run
5965    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
5966    /// let x = DeleteGitRepositoryLinkRequest::new().set_etag("example");
5967    /// ```
5968    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5969        self.etag = v.into();
5970        self
5971    }
5972}
5973
5974impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
5975    fn typename() -> &'static str {
5976        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
5977    }
5978}
5979
5980/// Message for requesting a list of GitRepositoryLinks
5981#[derive(Clone, Default, PartialEq)]
5982#[non_exhaustive]
5983pub struct ListGitRepositoryLinksRequest {
5984    /// Required. Parent value for ListGitRepositoryLinksRequest
5985    pub parent: std::string::String,
5986
5987    /// Optional. Requested page size. Server may return fewer items than
5988    /// requested. If unspecified, server will pick an appropriate default.
5989    pub page_size: i32,
5990
5991    /// Optional. A token identifying a page of results the server should return.
5992    pub page_token: std::string::String,
5993
5994    /// Optional. Filtering results
5995    pub filter: std::string::String,
5996
5997    /// Optional. Hint for how to order the results
5998    pub order_by: std::string::String,
5999
6000    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6001}
6002
6003impl ListGitRepositoryLinksRequest {
6004    pub fn new() -> Self {
6005        std::default::Default::default()
6006    }
6007
6008    /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
6009    ///
6010    /// # Example
6011    /// ```ignore,no_run
6012    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6013    /// let x = ListGitRepositoryLinksRequest::new().set_parent("example");
6014    /// ```
6015    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6016        self.parent = v.into();
6017        self
6018    }
6019
6020    /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
6021    ///
6022    /// # Example
6023    /// ```ignore,no_run
6024    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6025    /// let x = ListGitRepositoryLinksRequest::new().set_page_size(42);
6026    /// ```
6027    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6028        self.page_size = v.into();
6029        self
6030    }
6031
6032    /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
6033    ///
6034    /// # Example
6035    /// ```ignore,no_run
6036    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6037    /// let x = ListGitRepositoryLinksRequest::new().set_page_token("example");
6038    /// ```
6039    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6040        self.page_token = v.into();
6041        self
6042    }
6043
6044    /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
6045    ///
6046    /// # Example
6047    /// ```ignore,no_run
6048    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6049    /// let x = ListGitRepositoryLinksRequest::new().set_filter("example");
6050    /// ```
6051    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6052        self.filter = v.into();
6053        self
6054    }
6055
6056    /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
6057    ///
6058    /// # Example
6059    /// ```ignore,no_run
6060    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6061    /// let x = ListGitRepositoryLinksRequest::new().set_order_by("example");
6062    /// ```
6063    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6064        self.order_by = v.into();
6065        self
6066    }
6067}
6068
6069impl wkt::message::Message for ListGitRepositoryLinksRequest {
6070    fn typename() -> &'static str {
6071        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
6072    }
6073}
6074
6075/// Message for response to listing GitRepositoryLinks
6076#[derive(Clone, Default, PartialEq)]
6077#[non_exhaustive]
6078pub struct ListGitRepositoryLinksResponse {
6079    /// The list of GitRepositoryLinks
6080    pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
6081
6082    /// A token identifying a page of results the server should return.
6083    pub next_page_token: std::string::String,
6084
6085    /// Locations that could not be reached.
6086    pub unreachable: std::vec::Vec<std::string::String>,
6087
6088    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6089}
6090
6091impl ListGitRepositoryLinksResponse {
6092    pub fn new() -> Self {
6093        std::default::Default::default()
6094    }
6095
6096    /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
6097    ///
6098    /// # Example
6099    /// ```ignore,no_run
6100    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6101    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6102    /// let x = ListGitRepositoryLinksResponse::new()
6103    ///     .set_git_repository_links([
6104    ///         GitRepositoryLink::default()/* use setters */,
6105    ///         GitRepositoryLink::default()/* use (different) setters */,
6106    ///     ]);
6107    /// ```
6108    pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
6109    where
6110        T: std::iter::IntoIterator<Item = V>,
6111        V: std::convert::Into<crate::model::GitRepositoryLink>,
6112    {
6113        use std::iter::Iterator;
6114        self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
6115        self
6116    }
6117
6118    /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
6119    ///
6120    /// # Example
6121    /// ```ignore,no_run
6122    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6123    /// let x = ListGitRepositoryLinksResponse::new().set_next_page_token("example");
6124    /// ```
6125    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6126        self.next_page_token = v.into();
6127        self
6128    }
6129
6130    /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
6131    ///
6132    /// # Example
6133    /// ```ignore,no_run
6134    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6135    /// let x = ListGitRepositoryLinksResponse::new().set_unreachable(["a", "b", "c"]);
6136    /// ```
6137    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6138    where
6139        T: std::iter::IntoIterator<Item = V>,
6140        V: std::convert::Into<std::string::String>,
6141    {
6142        use std::iter::Iterator;
6143        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6144        self
6145    }
6146}
6147
6148impl wkt::message::Message for ListGitRepositoryLinksResponse {
6149    fn typename() -> &'static str {
6150        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
6151    }
6152}
6153
6154#[doc(hidden)]
6155impl google_cloud_gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
6156    type PageItem = crate::model::GitRepositoryLink;
6157
6158    fn items(self) -> std::vec::Vec<Self::PageItem> {
6159        self.git_repository_links
6160    }
6161
6162    fn next_page_token(&self) -> std::string::String {
6163        use std::clone::Clone;
6164        self.next_page_token.clone()
6165    }
6166}
6167
6168/// Message for getting a GitRepositoryLink
6169#[derive(Clone, Default, PartialEq)]
6170#[non_exhaustive]
6171pub struct GetGitRepositoryLinkRequest {
6172    /// Required. Name of the resource
6173    pub name: std::string::String,
6174
6175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6176}
6177
6178impl GetGitRepositoryLinkRequest {
6179    pub fn new() -> Self {
6180        std::default::Default::default()
6181    }
6182
6183    /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
6184    ///
6185    /// # Example
6186    /// ```ignore,no_run
6187    /// # use google_cloud_developerconnect_v1::model::GetGitRepositoryLinkRequest;
6188    /// let x = GetGitRepositoryLinkRequest::new().set_name("example");
6189    /// ```
6190    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6191        self.name = v.into();
6192        self
6193    }
6194}
6195
6196impl wkt::message::Message for GetGitRepositoryLinkRequest {
6197    fn typename() -> &'static str {
6198        "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
6199    }
6200}
6201
6202/// Message for fetching SCM read/write token.
6203#[derive(Clone, Default, PartialEq)]
6204#[non_exhaustive]
6205pub struct FetchReadWriteTokenRequest {
6206    /// Required. The resource name of the gitRepositoryLink in the format
6207    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6208    pub git_repository_link: std::string::String,
6209
6210    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6211}
6212
6213impl FetchReadWriteTokenRequest {
6214    pub fn new() -> Self {
6215        std::default::Default::default()
6216    }
6217
6218    /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
6219    ///
6220    /// # Example
6221    /// ```ignore,no_run
6222    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenRequest;
6223    /// let x = FetchReadWriteTokenRequest::new().set_git_repository_link("example");
6224    /// ```
6225    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6226        mut self,
6227        v: T,
6228    ) -> Self {
6229        self.git_repository_link = v.into();
6230        self
6231    }
6232}
6233
6234impl wkt::message::Message for FetchReadWriteTokenRequest {
6235    fn typename() -> &'static str {
6236        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
6237    }
6238}
6239
6240/// Message for fetching SCM read token.
6241#[derive(Clone, Default, PartialEq)]
6242#[non_exhaustive]
6243pub struct FetchReadTokenRequest {
6244    /// Required. The resource name of the gitRepositoryLink in the format
6245    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6246    pub git_repository_link: std::string::String,
6247
6248    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6249}
6250
6251impl FetchReadTokenRequest {
6252    pub fn new() -> Self {
6253        std::default::Default::default()
6254    }
6255
6256    /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
6257    ///
6258    /// # Example
6259    /// ```ignore,no_run
6260    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenRequest;
6261    /// let x = FetchReadTokenRequest::new().set_git_repository_link("example");
6262    /// ```
6263    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6264        mut self,
6265        v: T,
6266    ) -> Self {
6267        self.git_repository_link = v.into();
6268        self
6269    }
6270}
6271
6272impl wkt::message::Message for FetchReadTokenRequest {
6273    fn typename() -> &'static str {
6274        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
6275    }
6276}
6277
6278/// Message for responding to get read token.
6279#[derive(Clone, Default, PartialEq)]
6280#[non_exhaustive]
6281pub struct FetchReadTokenResponse {
6282    /// The token content.
6283    pub token: std::string::String,
6284
6285    /// Expiration timestamp. Can be empty if unknown or non-expiring.
6286    pub expiration_time: std::option::Option<wkt::Timestamp>,
6287
6288    /// The git_username to specify when making a git clone with the
6289    /// token. For example, for GitHub GitRepositoryLinks, this would be
6290    /// "x-access-token"
6291    pub git_username: std::string::String,
6292
6293    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6294}
6295
6296impl FetchReadTokenResponse {
6297    pub fn new() -> Self {
6298        std::default::Default::default()
6299    }
6300
6301    /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
6302    ///
6303    /// # Example
6304    /// ```ignore,no_run
6305    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6306    /// let x = FetchReadTokenResponse::new().set_token("example");
6307    /// ```
6308    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6309        self.token = v.into();
6310        self
6311    }
6312
6313    /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6314    ///
6315    /// # Example
6316    /// ```ignore,no_run
6317    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6318    /// use wkt::Timestamp;
6319    /// let x = FetchReadTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6320    /// ```
6321    pub fn set_expiration_time<T>(mut self, v: T) -> Self
6322    where
6323        T: std::convert::Into<wkt::Timestamp>,
6324    {
6325        self.expiration_time = std::option::Option::Some(v.into());
6326        self
6327    }
6328
6329    /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6330    ///
6331    /// # Example
6332    /// ```ignore,no_run
6333    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6334    /// use wkt::Timestamp;
6335    /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6336    /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6337    /// ```
6338    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6339    where
6340        T: std::convert::Into<wkt::Timestamp>,
6341    {
6342        self.expiration_time = v.map(|x| x.into());
6343        self
6344    }
6345
6346    /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
6347    ///
6348    /// # Example
6349    /// ```ignore,no_run
6350    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6351    /// let x = FetchReadTokenResponse::new().set_git_username("example");
6352    /// ```
6353    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6354        self.git_username = v.into();
6355        self
6356    }
6357}
6358
6359impl wkt::message::Message for FetchReadTokenResponse {
6360    fn typename() -> &'static str {
6361        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
6362    }
6363}
6364
6365/// Message for responding to get read/write token.
6366#[derive(Clone, Default, PartialEq)]
6367#[non_exhaustive]
6368pub struct FetchReadWriteTokenResponse {
6369    /// The token content.
6370    pub token: std::string::String,
6371
6372    /// Expiration timestamp. Can be empty if unknown or non-expiring.
6373    pub expiration_time: std::option::Option<wkt::Timestamp>,
6374
6375    /// The git_username to specify when making a git clone with the
6376    /// token. For example, for GitHub GitRepositoryLinks, this would be
6377    /// "x-access-token"
6378    pub git_username: std::string::String,
6379
6380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6381}
6382
6383impl FetchReadWriteTokenResponse {
6384    pub fn new() -> Self {
6385        std::default::Default::default()
6386    }
6387
6388    /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
6389    ///
6390    /// # Example
6391    /// ```ignore,no_run
6392    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6393    /// let x = FetchReadWriteTokenResponse::new().set_token("example");
6394    /// ```
6395    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6396        self.token = v.into();
6397        self
6398    }
6399
6400    /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6401    ///
6402    /// # Example
6403    /// ```ignore,no_run
6404    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6405    /// use wkt::Timestamp;
6406    /// let x = FetchReadWriteTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6407    /// ```
6408    pub fn set_expiration_time<T>(mut self, v: T) -> Self
6409    where
6410        T: std::convert::Into<wkt::Timestamp>,
6411    {
6412        self.expiration_time = std::option::Option::Some(v.into());
6413        self
6414    }
6415
6416    /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6417    ///
6418    /// # Example
6419    /// ```ignore,no_run
6420    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6421    /// use wkt::Timestamp;
6422    /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6423    /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6424    /// ```
6425    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6426    where
6427        T: std::convert::Into<wkt::Timestamp>,
6428    {
6429        self.expiration_time = v.map(|x| x.into());
6430        self
6431    }
6432
6433    /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
6434    ///
6435    /// # Example
6436    /// ```ignore,no_run
6437    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6438    /// let x = FetchReadWriteTokenResponse::new().set_git_username("example");
6439    /// ```
6440    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6441        self.git_username = v.into();
6442        self
6443    }
6444}
6445
6446impl wkt::message::Message for FetchReadWriteTokenResponse {
6447    fn typename() -> &'static str {
6448        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
6449    }
6450}
6451
6452/// Request message for FetchLinkableGitRepositoriesRequest.
6453#[derive(Clone, Default, PartialEq)]
6454#[non_exhaustive]
6455pub struct FetchLinkableGitRepositoriesRequest {
6456    /// Required. The name of the Connection.
6457    /// Format: `projects/*/locations/*/connections/*`.
6458    pub connection: std::string::String,
6459
6460    /// Optional. Number of results to return in the list. Defaults to 20.
6461    pub page_size: i32,
6462
6463    /// Optional. Page start.
6464    pub page_token: std::string::String,
6465
6466    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6467}
6468
6469impl FetchLinkableGitRepositoriesRequest {
6470    pub fn new() -> Self {
6471        std::default::Default::default()
6472    }
6473
6474    /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
6475    ///
6476    /// # Example
6477    /// ```ignore,no_run
6478    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6479    /// let x = FetchLinkableGitRepositoriesRequest::new().set_connection("example");
6480    /// ```
6481    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6482        self.connection = v.into();
6483        self
6484    }
6485
6486    /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
6487    ///
6488    /// # Example
6489    /// ```ignore,no_run
6490    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6491    /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_size(42);
6492    /// ```
6493    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6494        self.page_size = v.into();
6495        self
6496    }
6497
6498    /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
6499    ///
6500    /// # Example
6501    /// ```ignore,no_run
6502    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6503    /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_token("example");
6504    /// ```
6505    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6506        self.page_token = v.into();
6507        self
6508    }
6509}
6510
6511impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
6512    fn typename() -> &'static str {
6513        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
6514    }
6515}
6516
6517/// Response message for FetchLinkableGitRepositories.
6518#[derive(Clone, Default, PartialEq)]
6519#[non_exhaustive]
6520pub struct FetchLinkableGitRepositoriesResponse {
6521    /// The git repositories that can be linked to the connection.
6522    pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
6523
6524    /// A token identifying a page of results the server should return.
6525    pub next_page_token: std::string::String,
6526
6527    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6528}
6529
6530impl FetchLinkableGitRepositoriesResponse {
6531    pub fn new() -> Self {
6532        std::default::Default::default()
6533    }
6534
6535    /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
6536    ///
6537    /// # Example
6538    /// ```ignore,no_run
6539    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6540    /// use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6541    /// let x = FetchLinkableGitRepositoriesResponse::new()
6542    ///     .set_linkable_git_repositories([
6543    ///         LinkableGitRepository::default()/* use setters */,
6544    ///         LinkableGitRepository::default()/* use (different) setters */,
6545    ///     ]);
6546    /// ```
6547    pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
6548    where
6549        T: std::iter::IntoIterator<Item = V>,
6550        V: std::convert::Into<crate::model::LinkableGitRepository>,
6551    {
6552        use std::iter::Iterator;
6553        self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
6554        self
6555    }
6556
6557    /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
6558    ///
6559    /// # Example
6560    /// ```ignore,no_run
6561    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6562    /// let x = FetchLinkableGitRepositoriesResponse::new().set_next_page_token("example");
6563    /// ```
6564    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6565        self.next_page_token = v.into();
6566        self
6567    }
6568}
6569
6570impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
6571    fn typename() -> &'static str {
6572        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
6573    }
6574}
6575
6576#[doc(hidden)]
6577impl google_cloud_gax::paginator::internal::PageableResponse
6578    for FetchLinkableGitRepositoriesResponse
6579{
6580    type PageItem = crate::model::LinkableGitRepository;
6581
6582    fn items(self) -> std::vec::Vec<Self::PageItem> {
6583        self.linkable_git_repositories
6584    }
6585
6586    fn next_page_token(&self) -> std::string::String {
6587        use std::clone::Clone;
6588        self.next_page_token.clone()
6589    }
6590}
6591
6592/// LinkableGitRepository represents a git repository that can be linked to a
6593/// connection.
6594#[derive(Clone, Default, PartialEq)]
6595#[non_exhaustive]
6596pub struct LinkableGitRepository {
6597    /// The clone uri of the repository.
6598    pub clone_uri: std::string::String,
6599
6600    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6601}
6602
6603impl LinkableGitRepository {
6604    pub fn new() -> Self {
6605        std::default::Default::default()
6606    }
6607
6608    /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
6609    ///
6610    /// # Example
6611    /// ```ignore,no_run
6612    /// # use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6613    /// let x = LinkableGitRepository::new().set_clone_uri("example");
6614    /// ```
6615    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6616        self.clone_uri = v.into();
6617        self
6618    }
6619}
6620
6621impl wkt::message::Message for LinkableGitRepository {
6622    fn typename() -> &'static str {
6623        "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
6624    }
6625}
6626
6627/// Request for fetching github installations.
6628#[derive(Clone, Default, PartialEq)]
6629#[non_exhaustive]
6630pub struct FetchGitHubInstallationsRequest {
6631    /// Required. The resource name of the connection in the format
6632    /// `projects/*/locations/*/connections/*`.
6633    pub connection: std::string::String,
6634
6635    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6636}
6637
6638impl FetchGitHubInstallationsRequest {
6639    pub fn new() -> Self {
6640        std::default::Default::default()
6641    }
6642
6643    /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
6644    ///
6645    /// # Example
6646    /// ```ignore,no_run
6647    /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsRequest;
6648    /// let x = FetchGitHubInstallationsRequest::new().set_connection("example");
6649    /// ```
6650    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6651        self.connection = v.into();
6652        self
6653    }
6654}
6655
6656impl wkt::message::Message for FetchGitHubInstallationsRequest {
6657    fn typename() -> &'static str {
6658        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
6659    }
6660}
6661
6662/// Response of fetching github installations.
6663#[derive(Clone, Default, PartialEq)]
6664#[non_exhaustive]
6665pub struct FetchGitHubInstallationsResponse {
6666    /// List of installations available to the OAuth user (for github.com)
6667    /// or all the installations (for GitHub enterprise).
6668    pub installations:
6669        std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
6670
6671    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6672}
6673
6674impl FetchGitHubInstallationsResponse {
6675    pub fn new() -> Self {
6676        std::default::Default::default()
6677    }
6678
6679    /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
6680    ///
6681    /// # Example
6682    /// ```ignore,no_run
6683    /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsResponse;
6684    /// use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6685    /// let x = FetchGitHubInstallationsResponse::new()
6686    ///     .set_installations([
6687    ///         Installation::default()/* use setters */,
6688    ///         Installation::default()/* use (different) setters */,
6689    ///     ]);
6690    /// ```
6691    pub fn set_installations<T, V>(mut self, v: T) -> Self
6692    where
6693        T: std::iter::IntoIterator<Item = V>,
6694        V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
6695    {
6696        use std::iter::Iterator;
6697        self.installations = v.into_iter().map(|i| i.into()).collect();
6698        self
6699    }
6700}
6701
6702impl wkt::message::Message for FetchGitHubInstallationsResponse {
6703    fn typename() -> &'static str {
6704        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
6705    }
6706}
6707
6708/// Defines additional types related to [FetchGitHubInstallationsResponse].
6709pub mod fetch_git_hub_installations_response {
6710    #[allow(unused_imports)]
6711    use super::*;
6712
6713    /// Represents an installation of the GitHub App.
6714    #[derive(Clone, Default, PartialEq)]
6715    #[non_exhaustive]
6716    pub struct Installation {
6717        /// ID of the installation in GitHub.
6718        pub id: i64,
6719
6720        /// Name of the GitHub user or organization that owns this installation.
6721        pub name: std::string::String,
6722
6723        /// Either "user" or "organization".
6724        pub r#type: std::string::String,
6725
6726        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6727    }
6728
6729    impl Installation {
6730        pub fn new() -> Self {
6731            std::default::Default::default()
6732        }
6733
6734        /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
6735        ///
6736        /// # Example
6737        /// ```ignore,no_run
6738        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6739        /// let x = Installation::new().set_id(42);
6740        /// ```
6741        pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6742            self.id = v.into();
6743            self
6744        }
6745
6746        /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
6747        ///
6748        /// # Example
6749        /// ```ignore,no_run
6750        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6751        /// let x = Installation::new().set_name("example");
6752        /// ```
6753        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6754            self.name = v.into();
6755            self
6756        }
6757
6758        /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
6759        ///
6760        /// # Example
6761        /// ```ignore,no_run
6762        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6763        /// let x = Installation::new().set_type("example");
6764        /// ```
6765        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6766            self.r#type = v.into();
6767            self
6768        }
6769    }
6770
6771    impl wkt::message::Message for Installation {
6772        fn typename() -> &'static str {
6773            "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
6774        }
6775    }
6776}
6777
6778/// Request for fetching git refs.
6779#[derive(Clone, Default, PartialEq)]
6780#[non_exhaustive]
6781pub struct FetchGitRefsRequest {
6782    /// Required. The resource name of GitRepositoryLink in the format
6783    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6784    pub git_repository_link: std::string::String,
6785
6786    /// Required. Type of refs to fetch.
6787    pub ref_type: crate::model::fetch_git_refs_request::RefType,
6788
6789    /// Optional. Number of results to return in the list. Default to 20.
6790    pub page_size: i32,
6791
6792    /// Optional. Page start.
6793    pub page_token: std::string::String,
6794
6795    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6796}
6797
6798impl FetchGitRefsRequest {
6799    pub fn new() -> Self {
6800        std::default::Default::default()
6801    }
6802
6803    /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
6804    ///
6805    /// # Example
6806    /// ```ignore,no_run
6807    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6808    /// let x = FetchGitRefsRequest::new().set_git_repository_link("example");
6809    /// ```
6810    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6811        mut self,
6812        v: T,
6813    ) -> Self {
6814        self.git_repository_link = v.into();
6815        self
6816    }
6817
6818    /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
6819    ///
6820    /// # Example
6821    /// ```ignore,no_run
6822    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6823    /// use google_cloud_developerconnect_v1::model::fetch_git_refs_request::RefType;
6824    /// let x0 = FetchGitRefsRequest::new().set_ref_type(RefType::Tag);
6825    /// let x1 = FetchGitRefsRequest::new().set_ref_type(RefType::Branch);
6826    /// ```
6827    pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
6828        mut self,
6829        v: T,
6830    ) -> Self {
6831        self.ref_type = v.into();
6832        self
6833    }
6834
6835    /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
6836    ///
6837    /// # Example
6838    /// ```ignore,no_run
6839    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6840    /// let x = FetchGitRefsRequest::new().set_page_size(42);
6841    /// ```
6842    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6843        self.page_size = v.into();
6844        self
6845    }
6846
6847    /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
6848    ///
6849    /// # Example
6850    /// ```ignore,no_run
6851    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6852    /// let x = FetchGitRefsRequest::new().set_page_token("example");
6853    /// ```
6854    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6855        self.page_token = v.into();
6856        self
6857    }
6858}
6859
6860impl wkt::message::Message for FetchGitRefsRequest {
6861    fn typename() -> &'static str {
6862        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
6863    }
6864}
6865
6866/// Defines additional types related to [FetchGitRefsRequest].
6867pub mod fetch_git_refs_request {
6868    #[allow(unused_imports)]
6869    use super::*;
6870
6871    /// Type of refs.
6872    ///
6873    /// # Working with unknown values
6874    ///
6875    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6876    /// additional enum variants at any time. Adding new variants is not considered
6877    /// a breaking change. Applications should write their code in anticipation of:
6878    ///
6879    /// - New values appearing in future releases of the client library, **and**
6880    /// - New values received dynamically, without application changes.
6881    ///
6882    /// Please consult the [Working with enums] section in the user guide for some
6883    /// guidelines.
6884    ///
6885    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6886    #[derive(Clone, Debug, PartialEq)]
6887    #[non_exhaustive]
6888    pub enum RefType {
6889        /// No type specified.
6890        Unspecified,
6891        /// To fetch tags.
6892        Tag,
6893        /// To fetch branches.
6894        Branch,
6895        /// If set, the enum was initialized with an unknown value.
6896        ///
6897        /// Applications can examine the value using [RefType::value] or
6898        /// [RefType::name].
6899        UnknownValue(ref_type::UnknownValue),
6900    }
6901
6902    #[doc(hidden)]
6903    pub mod ref_type {
6904        #[allow(unused_imports)]
6905        use super::*;
6906        #[derive(Clone, Debug, PartialEq)]
6907        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6908    }
6909
6910    impl RefType {
6911        /// Gets the enum value.
6912        ///
6913        /// Returns `None` if the enum contains an unknown value deserialized from
6914        /// the string representation of enums.
6915        pub fn value(&self) -> std::option::Option<i32> {
6916            match self {
6917                Self::Unspecified => std::option::Option::Some(0),
6918                Self::Tag => std::option::Option::Some(1),
6919                Self::Branch => std::option::Option::Some(2),
6920                Self::UnknownValue(u) => u.0.value(),
6921            }
6922        }
6923
6924        /// Gets the enum value as a string.
6925        ///
6926        /// Returns `None` if the enum contains an unknown value deserialized from
6927        /// the integer representation of enums.
6928        pub fn name(&self) -> std::option::Option<&str> {
6929            match self {
6930                Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
6931                Self::Tag => std::option::Option::Some("TAG"),
6932                Self::Branch => std::option::Option::Some("BRANCH"),
6933                Self::UnknownValue(u) => u.0.name(),
6934            }
6935        }
6936    }
6937
6938    impl std::default::Default for RefType {
6939        fn default() -> Self {
6940            use std::convert::From;
6941            Self::from(0)
6942        }
6943    }
6944
6945    impl std::fmt::Display for RefType {
6946        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6947            wkt::internal::display_enum(f, self.name(), self.value())
6948        }
6949    }
6950
6951    impl std::convert::From<i32> for RefType {
6952        fn from(value: i32) -> Self {
6953            match value {
6954                0 => Self::Unspecified,
6955                1 => Self::Tag,
6956                2 => Self::Branch,
6957                _ => Self::UnknownValue(ref_type::UnknownValue(
6958                    wkt::internal::UnknownEnumValue::Integer(value),
6959                )),
6960            }
6961        }
6962    }
6963
6964    impl std::convert::From<&str> for RefType {
6965        fn from(value: &str) -> Self {
6966            use std::string::ToString;
6967            match value {
6968                "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
6969                "TAG" => Self::Tag,
6970                "BRANCH" => Self::Branch,
6971                _ => Self::UnknownValue(ref_type::UnknownValue(
6972                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6973                )),
6974            }
6975        }
6976    }
6977
6978    impl serde::ser::Serialize for RefType {
6979        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6980        where
6981            S: serde::Serializer,
6982        {
6983            match self {
6984                Self::Unspecified => serializer.serialize_i32(0),
6985                Self::Tag => serializer.serialize_i32(1),
6986                Self::Branch => serializer.serialize_i32(2),
6987                Self::UnknownValue(u) => u.0.serialize(serializer),
6988            }
6989        }
6990    }
6991
6992    impl<'de> serde::de::Deserialize<'de> for RefType {
6993        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6994        where
6995            D: serde::Deserializer<'de>,
6996        {
6997            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
6998                ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
6999            ))
7000        }
7001    }
7002}
7003
7004/// Response for fetching git refs.
7005#[derive(Clone, Default, PartialEq)]
7006#[non_exhaustive]
7007pub struct FetchGitRefsResponse {
7008    /// Name of the refs fetched.
7009    pub ref_names: std::vec::Vec<std::string::String>,
7010
7011    /// A token identifying a page of results the server should return.
7012    pub next_page_token: std::string::String,
7013
7014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7015}
7016
7017impl FetchGitRefsResponse {
7018    pub fn new() -> Self {
7019        std::default::Default::default()
7020    }
7021
7022    /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
7023    ///
7024    /// # Example
7025    /// ```ignore,no_run
7026    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7027    /// let x = FetchGitRefsResponse::new().set_ref_names(["a", "b", "c"]);
7028    /// ```
7029    pub fn set_ref_names<T, V>(mut self, v: T) -> Self
7030    where
7031        T: std::iter::IntoIterator<Item = V>,
7032        V: std::convert::Into<std::string::String>,
7033    {
7034        use std::iter::Iterator;
7035        self.ref_names = v.into_iter().map(|i| i.into()).collect();
7036        self
7037    }
7038
7039    /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
7040    ///
7041    /// # Example
7042    /// ```ignore,no_run
7043    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7044    /// let x = FetchGitRefsResponse::new().set_next_page_token("example");
7045    /// ```
7046    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7047        self.next_page_token = v.into();
7048        self
7049    }
7050}
7051
7052impl wkt::message::Message for FetchGitRefsResponse {
7053    fn typename() -> &'static str {
7054        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
7055    }
7056}
7057
7058/// AccountConnector encapsulates what a platform administrator needs to
7059/// configure for users to connect to the service providers, which includes,
7060/// among other fields, the OAuth client ID, client secret, and authorization and
7061/// token endpoints.
7062#[derive(Clone, Default, PartialEq)]
7063#[non_exhaustive]
7064pub struct AccountConnector {
7065    /// Identifier. The resource name of the accountConnector, in the format
7066    /// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
7067    pub name: std::string::String,
7068
7069    /// Output only. The timestamp when the accountConnector was created.
7070    pub create_time: std::option::Option<wkt::Timestamp>,
7071
7072    /// Output only. The timestamp when the accountConnector was updated.
7073    pub update_time: std::option::Option<wkt::Timestamp>,
7074
7075    /// Optional. Allows users to store small amounts of arbitrary data.
7076    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7077
7078    /// Optional. This checksum is computed by the server based on the value of
7079    /// other fields, and may be sent on update and delete requests to ensure the
7080    /// client has an up-to-date value before proceeding.
7081    pub etag: std::string::String,
7082
7083    /// Optional. Labels as key value pairs
7084    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7085
7086    /// Output only. Start OAuth flow by clicking on this URL.
7087    pub oauth_start_uri: std::string::String,
7088
7089    /// The AccountConnector config.
7090    pub account_connector_config:
7091        std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
7092
7093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7094}
7095
7096impl AccountConnector {
7097    pub fn new() -> Self {
7098        std::default::Default::default()
7099    }
7100
7101    /// Sets the value of [name][crate::model::AccountConnector::name].
7102    ///
7103    /// # Example
7104    /// ```ignore,no_run
7105    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7106    /// let x = AccountConnector::new().set_name("example");
7107    /// ```
7108    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7109        self.name = v.into();
7110        self
7111    }
7112
7113    /// Sets the value of [create_time][crate::model::AccountConnector::create_time].
7114    ///
7115    /// # Example
7116    /// ```ignore,no_run
7117    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7118    /// use wkt::Timestamp;
7119    /// let x = AccountConnector::new().set_create_time(Timestamp::default()/* use setters */);
7120    /// ```
7121    pub fn set_create_time<T>(mut self, v: T) -> Self
7122    where
7123        T: std::convert::Into<wkt::Timestamp>,
7124    {
7125        self.create_time = std::option::Option::Some(v.into());
7126        self
7127    }
7128
7129    /// Sets or clears the value of [create_time][crate::model::AccountConnector::create_time].
7130    ///
7131    /// # Example
7132    /// ```ignore,no_run
7133    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7134    /// use wkt::Timestamp;
7135    /// let x = AccountConnector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7136    /// let x = AccountConnector::new().set_or_clear_create_time(None::<Timestamp>);
7137    /// ```
7138    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7139    where
7140        T: std::convert::Into<wkt::Timestamp>,
7141    {
7142        self.create_time = v.map(|x| x.into());
7143        self
7144    }
7145
7146    /// Sets the value of [update_time][crate::model::AccountConnector::update_time].
7147    ///
7148    /// # Example
7149    /// ```ignore,no_run
7150    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7151    /// use wkt::Timestamp;
7152    /// let x = AccountConnector::new().set_update_time(Timestamp::default()/* use setters */);
7153    /// ```
7154    pub fn set_update_time<T>(mut self, v: T) -> Self
7155    where
7156        T: std::convert::Into<wkt::Timestamp>,
7157    {
7158        self.update_time = std::option::Option::Some(v.into());
7159        self
7160    }
7161
7162    /// Sets or clears the value of [update_time][crate::model::AccountConnector::update_time].
7163    ///
7164    /// # Example
7165    /// ```ignore,no_run
7166    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7167    /// use wkt::Timestamp;
7168    /// let x = AccountConnector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7169    /// let x = AccountConnector::new().set_or_clear_update_time(None::<Timestamp>);
7170    /// ```
7171    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7172    where
7173        T: std::convert::Into<wkt::Timestamp>,
7174    {
7175        self.update_time = v.map(|x| x.into());
7176        self
7177    }
7178
7179    /// Sets the value of [annotations][crate::model::AccountConnector::annotations].
7180    ///
7181    /// # Example
7182    /// ```ignore,no_run
7183    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7184    /// let x = AccountConnector::new().set_annotations([
7185    ///     ("key0", "abc"),
7186    ///     ("key1", "xyz"),
7187    /// ]);
7188    /// ```
7189    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7190    where
7191        T: std::iter::IntoIterator<Item = (K, V)>,
7192        K: std::convert::Into<std::string::String>,
7193        V: std::convert::Into<std::string::String>,
7194    {
7195        use std::iter::Iterator;
7196        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7197        self
7198    }
7199
7200    /// Sets the value of [etag][crate::model::AccountConnector::etag].
7201    ///
7202    /// # Example
7203    /// ```ignore,no_run
7204    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7205    /// let x = AccountConnector::new().set_etag("example");
7206    /// ```
7207    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7208        self.etag = v.into();
7209        self
7210    }
7211
7212    /// Sets the value of [labels][crate::model::AccountConnector::labels].
7213    ///
7214    /// # Example
7215    /// ```ignore,no_run
7216    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7217    /// let x = AccountConnector::new().set_labels([
7218    ///     ("key0", "abc"),
7219    ///     ("key1", "xyz"),
7220    /// ]);
7221    /// ```
7222    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7223    where
7224        T: std::iter::IntoIterator<Item = (K, V)>,
7225        K: std::convert::Into<std::string::String>,
7226        V: std::convert::Into<std::string::String>,
7227    {
7228        use std::iter::Iterator;
7229        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7230        self
7231    }
7232
7233    /// Sets the value of [oauth_start_uri][crate::model::AccountConnector::oauth_start_uri].
7234    ///
7235    /// # Example
7236    /// ```ignore,no_run
7237    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7238    /// let x = AccountConnector::new().set_oauth_start_uri("example");
7239    /// ```
7240    pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7241        self.oauth_start_uri = v.into();
7242        self
7243    }
7244
7245    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config].
7246    ///
7247    /// Note that all the setters affecting `account_connector_config` are mutually
7248    /// exclusive.
7249    ///
7250    /// # Example
7251    /// ```ignore,no_run
7252    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7253    /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7254    /// let x = AccountConnector::new().set_account_connector_config(Some(
7255    ///     google_cloud_developerconnect_v1::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(ProviderOAuthConfig::default().into())));
7256    /// ```
7257    pub fn set_account_connector_config<
7258        T: std::convert::Into<
7259                std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
7260            >,
7261    >(
7262        mut self,
7263        v: T,
7264    ) -> Self {
7265        self.account_connector_config = v.into();
7266        self
7267    }
7268
7269    /// The value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
7270    /// if it holds a `ProviderOauthConfig`, `None` if the field is not set or
7271    /// holds a different branch.
7272    pub fn provider_oauth_config(
7273        &self,
7274    ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
7275        #[allow(unreachable_patterns)]
7276        self.account_connector_config
7277            .as_ref()
7278            .and_then(|v| match v {
7279                crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
7280                    std::option::Option::Some(v)
7281                }
7282                _ => std::option::Option::None,
7283            })
7284    }
7285
7286    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
7287    /// to hold a `ProviderOauthConfig`.
7288    ///
7289    /// Note that all the setters affecting `account_connector_config` are
7290    /// mutually exclusive.
7291    ///
7292    /// # Example
7293    /// ```ignore,no_run
7294    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7295    /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7296    /// let x = AccountConnector::new().set_provider_oauth_config(ProviderOAuthConfig::default()/* use setters */);
7297    /// assert!(x.provider_oauth_config().is_some());
7298    /// ```
7299    pub fn set_provider_oauth_config<
7300        T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
7301    >(
7302        mut self,
7303        v: T,
7304    ) -> Self {
7305        self.account_connector_config = std::option::Option::Some(
7306            crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
7307        );
7308        self
7309    }
7310}
7311
7312impl wkt::message::Message for AccountConnector {
7313    fn typename() -> &'static str {
7314        "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
7315    }
7316}
7317
7318/// Defines additional types related to [AccountConnector].
7319pub mod account_connector {
7320    #[allow(unused_imports)]
7321    use super::*;
7322
7323    /// The AccountConnector config.
7324    #[derive(Clone, Debug, PartialEq)]
7325    #[non_exhaustive]
7326    pub enum AccountConnectorConfig {
7327        /// Optional. Provider OAuth config.
7328        ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
7329    }
7330}
7331
7332/// User represents a user connected to the service providers through
7333/// a AccountConnector.
7334#[derive(Clone, Default, PartialEq)]
7335#[non_exhaustive]
7336pub struct User {
7337    /// Identifier. Resource name of the user, in the format
7338    /// `projects/*/locations/*/accountConnectors/*/users/*`.
7339    pub name: std::string::String,
7340
7341    /// Output only. Developer Connect automatically converts user identity
7342    /// to some human readable description, e.g., email address.
7343    pub display_name: std::string::String,
7344
7345    /// Output only. The timestamp when the user was created.
7346    pub create_time: std::option::Option<wkt::Timestamp>,
7347
7348    /// Output only. The timestamp when the token was last requested.
7349    pub last_token_request_time: std::option::Option<wkt::Timestamp>,
7350
7351    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7352}
7353
7354impl User {
7355    pub fn new() -> Self {
7356        std::default::Default::default()
7357    }
7358
7359    /// Sets the value of [name][crate::model::User::name].
7360    ///
7361    /// # Example
7362    /// ```ignore,no_run
7363    /// # use google_cloud_developerconnect_v1::model::User;
7364    /// let x = User::new().set_name("example");
7365    /// ```
7366    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7367        self.name = v.into();
7368        self
7369    }
7370
7371    /// Sets the value of [display_name][crate::model::User::display_name].
7372    ///
7373    /// # Example
7374    /// ```ignore,no_run
7375    /// # use google_cloud_developerconnect_v1::model::User;
7376    /// let x = User::new().set_display_name("example");
7377    /// ```
7378    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7379        self.display_name = v.into();
7380        self
7381    }
7382
7383    /// Sets the value of [create_time][crate::model::User::create_time].
7384    ///
7385    /// # Example
7386    /// ```ignore,no_run
7387    /// # use google_cloud_developerconnect_v1::model::User;
7388    /// use wkt::Timestamp;
7389    /// let x = User::new().set_create_time(Timestamp::default()/* use setters */);
7390    /// ```
7391    pub fn set_create_time<T>(mut self, v: T) -> Self
7392    where
7393        T: std::convert::Into<wkt::Timestamp>,
7394    {
7395        self.create_time = std::option::Option::Some(v.into());
7396        self
7397    }
7398
7399    /// Sets or clears the value of [create_time][crate::model::User::create_time].
7400    ///
7401    /// # Example
7402    /// ```ignore,no_run
7403    /// # use google_cloud_developerconnect_v1::model::User;
7404    /// use wkt::Timestamp;
7405    /// let x = User::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7406    /// let x = User::new().set_or_clear_create_time(None::<Timestamp>);
7407    /// ```
7408    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7409    where
7410        T: std::convert::Into<wkt::Timestamp>,
7411    {
7412        self.create_time = v.map(|x| x.into());
7413        self
7414    }
7415
7416    /// Sets the value of [last_token_request_time][crate::model::User::last_token_request_time].
7417    ///
7418    /// # Example
7419    /// ```ignore,no_run
7420    /// # use google_cloud_developerconnect_v1::model::User;
7421    /// use wkt::Timestamp;
7422    /// let x = User::new().set_last_token_request_time(Timestamp::default()/* use setters */);
7423    /// ```
7424    pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
7425    where
7426        T: std::convert::Into<wkt::Timestamp>,
7427    {
7428        self.last_token_request_time = std::option::Option::Some(v.into());
7429        self
7430    }
7431
7432    /// Sets or clears the value of [last_token_request_time][crate::model::User::last_token_request_time].
7433    ///
7434    /// # Example
7435    /// ```ignore,no_run
7436    /// # use google_cloud_developerconnect_v1::model::User;
7437    /// use wkt::Timestamp;
7438    /// let x = User::new().set_or_clear_last_token_request_time(Some(Timestamp::default()/* use setters */));
7439    /// let x = User::new().set_or_clear_last_token_request_time(None::<Timestamp>);
7440    /// ```
7441    pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
7442    where
7443        T: std::convert::Into<wkt::Timestamp>,
7444    {
7445        self.last_token_request_time = v.map(|x| x.into());
7446        self
7447    }
7448}
7449
7450impl wkt::message::Message for User {
7451    fn typename() -> &'static str {
7452        "type.googleapis.com/google.cloud.developerconnect.v1.User"
7453    }
7454}
7455
7456/// ProviderOAuthConfig is the OAuth config for a provider.
7457#[derive(Clone, Default, PartialEq)]
7458#[non_exhaustive]
7459pub struct ProviderOAuthConfig {
7460    /// Required. User selected scopes to apply to the Oauth config
7461    /// In the event of changing scopes, user records under AccountConnector will
7462    /// be deleted and users will re-auth again.
7463    pub scopes: std::vec::Vec<std::string::String>,
7464
7465    /// OAuth Provider ID. It could be Developer Connect owned or providers
7466    /// provided.
7467    pub oauth_provider_id:
7468        std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
7469
7470    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7471}
7472
7473impl ProviderOAuthConfig {
7474    pub fn new() -> Self {
7475        std::default::Default::default()
7476    }
7477
7478    /// Sets the value of [scopes][crate::model::ProviderOAuthConfig::scopes].
7479    ///
7480    /// # Example
7481    /// ```ignore,no_run
7482    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7483    /// let x = ProviderOAuthConfig::new().set_scopes(["a", "b", "c"]);
7484    /// ```
7485    pub fn set_scopes<T, V>(mut self, v: T) -> Self
7486    where
7487        T: std::iter::IntoIterator<Item = V>,
7488        V: std::convert::Into<std::string::String>,
7489    {
7490        use std::iter::Iterator;
7491        self.scopes = v.into_iter().map(|i| i.into()).collect();
7492        self
7493    }
7494
7495    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id].
7496    ///
7497    /// Note that all the setters affecting `oauth_provider_id` are mutually
7498    /// exclusive.
7499    ///
7500    /// # Example
7501    /// ```ignore,no_run
7502    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7503    /// use google_cloud_developerconnect_v1::model::SystemProvider;
7504    /// let x0 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7505    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Github)));
7506    /// let x1 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7507    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Gitlab)));
7508    /// let x2 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7509    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Google)));
7510    /// ```
7511    pub fn set_oauth_provider_id<
7512        T: std::convert::Into<
7513                std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
7514            >,
7515    >(
7516        mut self,
7517        v: T,
7518    ) -> Self {
7519        self.oauth_provider_id = v.into();
7520        self
7521    }
7522
7523    /// The value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
7524    /// if it holds a `SystemProviderId`, `None` if the field is not set or
7525    /// holds a different branch.
7526    pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
7527        #[allow(unreachable_patterns)]
7528        self.oauth_provider_id.as_ref().and_then(|v| match v {
7529            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
7530                std::option::Option::Some(v)
7531            }
7532            _ => std::option::Option::None,
7533        })
7534    }
7535
7536    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
7537    /// to hold a `SystemProviderId`.
7538    ///
7539    /// Note that all the setters affecting `oauth_provider_id` are
7540    /// mutually exclusive.
7541    ///
7542    /// # Example
7543    /// ```ignore,no_run
7544    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7545    /// use google_cloud_developerconnect_v1::model::SystemProvider;
7546    /// let x0 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Github);
7547    /// let x1 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Gitlab);
7548    /// let x2 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Google);
7549    /// assert!(x0.system_provider_id().is_some());
7550    /// assert!(x1.system_provider_id().is_some());
7551    /// assert!(x2.system_provider_id().is_some());
7552    /// ```
7553    pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
7554        mut self,
7555        v: T,
7556    ) -> Self {
7557        self.oauth_provider_id = std::option::Option::Some(
7558            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
7559        );
7560        self
7561    }
7562}
7563
7564impl wkt::message::Message for ProviderOAuthConfig {
7565    fn typename() -> &'static str {
7566        "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
7567    }
7568}
7569
7570/// Defines additional types related to [ProviderOAuthConfig].
7571pub mod provider_o_auth_config {
7572    #[allow(unused_imports)]
7573    use super::*;
7574
7575    /// OAuth Provider ID. It could be Developer Connect owned or providers
7576    /// provided.
7577    #[derive(Clone, Debug, PartialEq)]
7578    #[non_exhaustive]
7579    pub enum OauthProviderId {
7580        /// Optional. Immutable. Developer Connect provided OAuth.
7581        SystemProviderId(crate::model::SystemProvider),
7582    }
7583}
7584
7585/// The InsightsConfig resource is the core configuration object to capture
7586/// events from your Software Development Lifecycle. It acts as the central hub
7587/// for managing how Developer Connect understands your application, its runtime
7588/// environments, and the artifacts deployed within them.
7589#[derive(Clone, Default, PartialEq)]
7590#[non_exhaustive]
7591pub struct InsightsConfig {
7592    /// Identifier. The name of the InsightsConfig.
7593    /// Format:
7594    /// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
7595    pub name: std::string::String,
7596
7597    /// Output only. Create timestamp.
7598    pub create_time: std::option::Option<wkt::Timestamp>,
7599
7600    /// Output only. Update timestamp.
7601    pub update_time: std::option::Option<wkt::Timestamp>,
7602
7603    /// Output only. The runtime configurations where the application is deployed.
7604    pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
7605
7606    /// Optional. The artifact configurations of the artifacts that are deployed.
7607    pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
7608
7609    /// Optional. Output only. The state of the InsightsConfig.
7610    pub state: crate::model::insights_config::State,
7611
7612    /// Optional. User specified annotations. See
7613    /// <https://google.aip.dev/148#annotations> for more details such as format and
7614    /// size limitations.
7615    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7616
7617    /// Optional. Set of labels associated with an InsightsConfig.
7618    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7619
7620    /// Output only. Reconciling (<https://google.aip.dev/128#reconciliation>).
7621    /// Set to true if the current state of InsightsConfig does not match the
7622    /// user's intended state, and the service is actively updating the resource to
7623    /// reconcile them. This can happen due to user-triggered updates or
7624    /// system actions like failover or maintenance.
7625    pub reconciling: bool,
7626
7627    /// Output only. Any errors that occurred while setting up the InsightsConfig.
7628    /// Each error will be in the format: `field_name: error_message`, e.g.
7629    /// GetAppHubApplication: Permission denied while getting App Hub
7630    /// application. Please grant permissions to the P4SA.
7631    pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
7632
7633    /// The context of the InsightsConfig.
7634    pub insights_config_context:
7635        std::option::Option<crate::model::insights_config::InsightsConfigContext>,
7636
7637    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7638}
7639
7640impl InsightsConfig {
7641    pub fn new() -> Self {
7642        std::default::Default::default()
7643    }
7644
7645    /// Sets the value of [name][crate::model::InsightsConfig::name].
7646    ///
7647    /// # Example
7648    /// ```ignore,no_run
7649    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7650    /// let x = InsightsConfig::new().set_name("example");
7651    /// ```
7652    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7653        self.name = v.into();
7654        self
7655    }
7656
7657    /// Sets the value of [create_time][crate::model::InsightsConfig::create_time].
7658    ///
7659    /// # Example
7660    /// ```ignore,no_run
7661    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7662    /// use wkt::Timestamp;
7663    /// let x = InsightsConfig::new().set_create_time(Timestamp::default()/* use setters */);
7664    /// ```
7665    pub fn set_create_time<T>(mut self, v: T) -> Self
7666    where
7667        T: std::convert::Into<wkt::Timestamp>,
7668    {
7669        self.create_time = std::option::Option::Some(v.into());
7670        self
7671    }
7672
7673    /// Sets or clears the value of [create_time][crate::model::InsightsConfig::create_time].
7674    ///
7675    /// # Example
7676    /// ```ignore,no_run
7677    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7678    /// use wkt::Timestamp;
7679    /// let x = InsightsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7680    /// let x = InsightsConfig::new().set_or_clear_create_time(None::<Timestamp>);
7681    /// ```
7682    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7683    where
7684        T: std::convert::Into<wkt::Timestamp>,
7685    {
7686        self.create_time = v.map(|x| x.into());
7687        self
7688    }
7689
7690    /// Sets the value of [update_time][crate::model::InsightsConfig::update_time].
7691    ///
7692    /// # Example
7693    /// ```ignore,no_run
7694    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7695    /// use wkt::Timestamp;
7696    /// let x = InsightsConfig::new().set_update_time(Timestamp::default()/* use setters */);
7697    /// ```
7698    pub fn set_update_time<T>(mut self, v: T) -> Self
7699    where
7700        T: std::convert::Into<wkt::Timestamp>,
7701    {
7702        self.update_time = std::option::Option::Some(v.into());
7703        self
7704    }
7705
7706    /// Sets or clears the value of [update_time][crate::model::InsightsConfig::update_time].
7707    ///
7708    /// # Example
7709    /// ```ignore,no_run
7710    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7711    /// use wkt::Timestamp;
7712    /// let x = InsightsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7713    /// let x = InsightsConfig::new().set_or_clear_update_time(None::<Timestamp>);
7714    /// ```
7715    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7716    where
7717        T: std::convert::Into<wkt::Timestamp>,
7718    {
7719        self.update_time = v.map(|x| x.into());
7720        self
7721    }
7722
7723    /// Sets the value of [runtime_configs][crate::model::InsightsConfig::runtime_configs].
7724    ///
7725    /// # Example
7726    /// ```ignore,no_run
7727    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7728    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
7729    /// let x = InsightsConfig::new()
7730    ///     .set_runtime_configs([
7731    ///         RuntimeConfig::default()/* use setters */,
7732    ///         RuntimeConfig::default()/* use (different) setters */,
7733    ///     ]);
7734    /// ```
7735    pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
7736    where
7737        T: std::iter::IntoIterator<Item = V>,
7738        V: std::convert::Into<crate::model::RuntimeConfig>,
7739    {
7740        use std::iter::Iterator;
7741        self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
7742        self
7743    }
7744
7745    /// Sets the value of [artifact_configs][crate::model::InsightsConfig::artifact_configs].
7746    ///
7747    /// # Example
7748    /// ```ignore,no_run
7749    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7750    /// use google_cloud_developerconnect_v1::model::ArtifactConfig;
7751    /// let x = InsightsConfig::new()
7752    ///     .set_artifact_configs([
7753    ///         ArtifactConfig::default()/* use setters */,
7754    ///         ArtifactConfig::default()/* use (different) setters */,
7755    ///     ]);
7756    /// ```
7757    pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
7758    where
7759        T: std::iter::IntoIterator<Item = V>,
7760        V: std::convert::Into<crate::model::ArtifactConfig>,
7761    {
7762        use std::iter::Iterator;
7763        self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
7764        self
7765    }
7766
7767    /// Sets the value of [state][crate::model::InsightsConfig::state].
7768    ///
7769    /// # Example
7770    /// ```ignore,no_run
7771    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7772    /// use google_cloud_developerconnect_v1::model::insights_config::State;
7773    /// let x0 = InsightsConfig::new().set_state(State::Pending);
7774    /// let x1 = InsightsConfig::new().set_state(State::Complete);
7775    /// let x2 = InsightsConfig::new().set_state(State::Error);
7776    /// ```
7777    pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
7778        mut self,
7779        v: T,
7780    ) -> Self {
7781        self.state = v.into();
7782        self
7783    }
7784
7785    /// Sets the value of [annotations][crate::model::InsightsConfig::annotations].
7786    ///
7787    /// # Example
7788    /// ```ignore,no_run
7789    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7790    /// let x = InsightsConfig::new().set_annotations([
7791    ///     ("key0", "abc"),
7792    ///     ("key1", "xyz"),
7793    /// ]);
7794    /// ```
7795    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7796    where
7797        T: std::iter::IntoIterator<Item = (K, V)>,
7798        K: std::convert::Into<std::string::String>,
7799        V: std::convert::Into<std::string::String>,
7800    {
7801        use std::iter::Iterator;
7802        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7803        self
7804    }
7805
7806    /// Sets the value of [labels][crate::model::InsightsConfig::labels].
7807    ///
7808    /// # Example
7809    /// ```ignore,no_run
7810    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7811    /// let x = InsightsConfig::new().set_labels([
7812    ///     ("key0", "abc"),
7813    ///     ("key1", "xyz"),
7814    /// ]);
7815    /// ```
7816    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7817    where
7818        T: std::iter::IntoIterator<Item = (K, V)>,
7819        K: std::convert::Into<std::string::String>,
7820        V: std::convert::Into<std::string::String>,
7821    {
7822        use std::iter::Iterator;
7823        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7824        self
7825    }
7826
7827    /// Sets the value of [reconciling][crate::model::InsightsConfig::reconciling].
7828    ///
7829    /// # Example
7830    /// ```ignore,no_run
7831    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7832    /// let x = InsightsConfig::new().set_reconciling(true);
7833    /// ```
7834    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7835        self.reconciling = v.into();
7836        self
7837    }
7838
7839    /// Sets the value of [errors][crate::model::InsightsConfig::errors].
7840    ///
7841    /// # Example
7842    /// ```ignore,no_run
7843    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7844    /// use google_cloud_rpc::model::Status;
7845    /// let x = InsightsConfig::new()
7846    ///     .set_errors([
7847    ///         Status::default()/* use setters */,
7848    ///         Status::default()/* use (different) setters */,
7849    ///     ]);
7850    /// ```
7851    pub fn set_errors<T, V>(mut self, v: T) -> Self
7852    where
7853        T: std::iter::IntoIterator<Item = V>,
7854        V: std::convert::Into<google_cloud_rpc::model::Status>,
7855    {
7856        use std::iter::Iterator;
7857        self.errors = v.into_iter().map(|i| i.into()).collect();
7858        self
7859    }
7860
7861    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context].
7862    ///
7863    /// Note that all the setters affecting `insights_config_context` are mutually
7864    /// exclusive.
7865    ///
7866    /// # Example
7867    /// ```ignore,no_run
7868    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7869    /// use google_cloud_developerconnect_v1::model::insights_config::InsightsConfigContext;
7870    /// let x = InsightsConfig::new().set_insights_config_context(Some(InsightsConfigContext::AppHubApplication("example".to_string())));
7871    /// ```
7872    pub fn set_insights_config_context<
7873        T: std::convert::Into<
7874                std::option::Option<crate::model::insights_config::InsightsConfigContext>,
7875            >,
7876    >(
7877        mut self,
7878        v: T,
7879    ) -> Self {
7880        self.insights_config_context = v.into();
7881        self
7882    }
7883
7884    /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
7885    /// if it holds a `AppHubApplication`, `None` if the field is not set or
7886    /// holds a different branch.
7887    pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
7888        #[allow(unreachable_patterns)]
7889        self.insights_config_context.as_ref().and_then(|v| match v {
7890            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
7891                std::option::Option::Some(v)
7892            }
7893            _ => std::option::Option::None,
7894        })
7895    }
7896
7897    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
7898    /// to hold a `AppHubApplication`.
7899    ///
7900    /// Note that all the setters affecting `insights_config_context` are
7901    /// mutually exclusive.
7902    ///
7903    /// # Example
7904    /// ```ignore,no_run
7905    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7906    /// let x = InsightsConfig::new().set_app_hub_application("example");
7907    /// assert!(x.app_hub_application().is_some());
7908    /// assert!(x.projects().is_none());
7909    /// ```
7910    pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
7911        mut self,
7912        v: T,
7913    ) -> Self {
7914        self.insights_config_context = std::option::Option::Some(
7915            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
7916        );
7917        self
7918    }
7919
7920    /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
7921    /// if it holds a `Projects`, `None` if the field is not set or
7922    /// holds a different branch.
7923    pub fn projects(&self) -> std::option::Option<&std::boxed::Box<crate::model::Projects>> {
7924        #[allow(unreachable_patterns)]
7925        self.insights_config_context.as_ref().and_then(|v| match v {
7926            crate::model::insights_config::InsightsConfigContext::Projects(v) => {
7927                std::option::Option::Some(v)
7928            }
7929            _ => std::option::Option::None,
7930        })
7931    }
7932
7933    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
7934    /// to hold a `Projects`.
7935    ///
7936    /// Note that all the setters affecting `insights_config_context` are
7937    /// mutually exclusive.
7938    ///
7939    /// # Example
7940    /// ```ignore,no_run
7941    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7942    /// use google_cloud_developerconnect_v1::model::Projects;
7943    /// let x = InsightsConfig::new().set_projects(Projects::default()/* use setters */);
7944    /// assert!(x.projects().is_some());
7945    /// assert!(x.app_hub_application().is_none());
7946    /// ```
7947    pub fn set_projects<T: std::convert::Into<std::boxed::Box<crate::model::Projects>>>(
7948        mut self,
7949        v: T,
7950    ) -> Self {
7951        self.insights_config_context = std::option::Option::Some(
7952            crate::model::insights_config::InsightsConfigContext::Projects(v.into()),
7953        );
7954        self
7955    }
7956}
7957
7958impl wkt::message::Message for InsightsConfig {
7959    fn typename() -> &'static str {
7960        "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
7961    }
7962}
7963
7964/// Defines additional types related to [InsightsConfig].
7965pub mod insights_config {
7966    #[allow(unused_imports)]
7967    use super::*;
7968
7969    /// The state of the InsightsConfig.
7970    ///
7971    /// # Working with unknown values
7972    ///
7973    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7974    /// additional enum variants at any time. Adding new variants is not considered
7975    /// a breaking change. Applications should write their code in anticipation of:
7976    ///
7977    /// - New values appearing in future releases of the client library, **and**
7978    /// - New values received dynamically, without application changes.
7979    ///
7980    /// Please consult the [Working with enums] section in the user guide for some
7981    /// guidelines.
7982    ///
7983    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7984    #[derive(Clone, Debug, PartialEq)]
7985    #[non_exhaustive]
7986    pub enum State {
7987        /// No state specified.
7988        Unspecified,
7989        /// The InsightsConfig is pending application discovery/runtime discovery.
7990        Pending,
7991        /// The initial discovery process is complete.
7992        Complete,
7993        /// The InsightsConfig is in an error state.
7994        Error,
7995        /// If set, the enum was initialized with an unknown value.
7996        ///
7997        /// Applications can examine the value using [State::value] or
7998        /// [State::name].
7999        UnknownValue(state::UnknownValue),
8000    }
8001
8002    #[doc(hidden)]
8003    pub mod state {
8004        #[allow(unused_imports)]
8005        use super::*;
8006        #[derive(Clone, Debug, PartialEq)]
8007        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8008    }
8009
8010    impl State {
8011        /// Gets the enum value.
8012        ///
8013        /// Returns `None` if the enum contains an unknown value deserialized from
8014        /// the string representation of enums.
8015        pub fn value(&self) -> std::option::Option<i32> {
8016            match self {
8017                Self::Unspecified => std::option::Option::Some(0),
8018                Self::Pending => std::option::Option::Some(5),
8019                Self::Complete => std::option::Option::Some(3),
8020                Self::Error => std::option::Option::Some(4),
8021                Self::UnknownValue(u) => u.0.value(),
8022            }
8023        }
8024
8025        /// Gets the enum value as a string.
8026        ///
8027        /// Returns `None` if the enum contains an unknown value deserialized from
8028        /// the integer representation of enums.
8029        pub fn name(&self) -> std::option::Option<&str> {
8030            match self {
8031                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8032                Self::Pending => std::option::Option::Some("PENDING"),
8033                Self::Complete => std::option::Option::Some("COMPLETE"),
8034                Self::Error => std::option::Option::Some("ERROR"),
8035                Self::UnknownValue(u) => u.0.name(),
8036            }
8037        }
8038    }
8039
8040    impl std::default::Default for State {
8041        fn default() -> Self {
8042            use std::convert::From;
8043            Self::from(0)
8044        }
8045    }
8046
8047    impl std::fmt::Display for State {
8048        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8049            wkt::internal::display_enum(f, self.name(), self.value())
8050        }
8051    }
8052
8053    impl std::convert::From<i32> for State {
8054        fn from(value: i32) -> Self {
8055            match value {
8056                0 => Self::Unspecified,
8057                3 => Self::Complete,
8058                4 => Self::Error,
8059                5 => Self::Pending,
8060                _ => Self::UnknownValue(state::UnknownValue(
8061                    wkt::internal::UnknownEnumValue::Integer(value),
8062                )),
8063            }
8064        }
8065    }
8066
8067    impl std::convert::From<&str> for State {
8068        fn from(value: &str) -> Self {
8069            use std::string::ToString;
8070            match value {
8071                "STATE_UNSPECIFIED" => Self::Unspecified,
8072                "PENDING" => Self::Pending,
8073                "COMPLETE" => Self::Complete,
8074                "ERROR" => Self::Error,
8075                _ => Self::UnknownValue(state::UnknownValue(
8076                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8077                )),
8078            }
8079        }
8080    }
8081
8082    impl serde::ser::Serialize for State {
8083        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8084        where
8085            S: serde::Serializer,
8086        {
8087            match self {
8088                Self::Unspecified => serializer.serialize_i32(0),
8089                Self::Pending => serializer.serialize_i32(5),
8090                Self::Complete => serializer.serialize_i32(3),
8091                Self::Error => serializer.serialize_i32(4),
8092                Self::UnknownValue(u) => u.0.serialize(serializer),
8093            }
8094        }
8095    }
8096
8097    impl<'de> serde::de::Deserialize<'de> for State {
8098        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8099        where
8100            D: serde::Deserializer<'de>,
8101        {
8102            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8103                ".google.cloud.developerconnect.v1.InsightsConfig.State",
8104            ))
8105        }
8106    }
8107
8108    /// The context of the InsightsConfig.
8109    #[derive(Clone, Debug, PartialEq)]
8110    #[non_exhaustive]
8111    pub enum InsightsConfigContext {
8112        /// Optional. The name of the App Hub Application.
8113        /// Format:
8114        /// projects/{project}/locations/{location}/applications/{application}
8115        AppHubApplication(std::string::String),
8116        /// Optional. The projects to track with the InsightsConfig.
8117        Projects(std::boxed::Box<crate::model::Projects>),
8118    }
8119}
8120
8121/// Projects represents the projects to track with the InsightsConfig.
8122#[derive(Clone, Default, PartialEq)]
8123#[non_exhaustive]
8124pub struct Projects {
8125    /// Optional. The project IDs.
8126    /// Format: {project}
8127    pub project_ids: std::vec::Vec<std::string::String>,
8128
8129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8130}
8131
8132impl Projects {
8133    pub fn new() -> Self {
8134        std::default::Default::default()
8135    }
8136
8137    /// Sets the value of [project_ids][crate::model::Projects::project_ids].
8138    ///
8139    /// # Example
8140    /// ```ignore,no_run
8141    /// # use google_cloud_developerconnect_v1::model::Projects;
8142    /// let x = Projects::new().set_project_ids(["a", "b", "c"]);
8143    /// ```
8144    pub fn set_project_ids<T, V>(mut self, v: T) -> Self
8145    where
8146        T: std::iter::IntoIterator<Item = V>,
8147        V: std::convert::Into<std::string::String>,
8148    {
8149        use std::iter::Iterator;
8150        self.project_ids = v.into_iter().map(|i| i.into()).collect();
8151        self
8152    }
8153}
8154
8155impl wkt::message::Message for Projects {
8156    fn typename() -> &'static str {
8157        "type.googleapis.com/google.cloud.developerconnect.v1.Projects"
8158    }
8159}
8160
8161/// RuntimeConfig represents the runtimes where the application is
8162/// deployed.
8163#[derive(Clone, Default, PartialEq)]
8164#[non_exhaustive]
8165pub struct RuntimeConfig {
8166    /// Required. Immutable. The URI of the runtime configuration.
8167    /// For GKE, this is the cluster name.
8168    /// For Cloud Run, this is the service name.
8169    pub uri: std::string::String,
8170
8171    /// Output only. The state of the Runtime.
8172    pub state: crate::model::runtime_config::State,
8173
8174    /// The type of the runtime.
8175    pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
8176
8177    /// Where the runtime is derived from.
8178    pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
8179
8180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8181}
8182
8183impl RuntimeConfig {
8184    pub fn new() -> Self {
8185        std::default::Default::default()
8186    }
8187
8188    /// Sets the value of [uri][crate::model::RuntimeConfig::uri].
8189    ///
8190    /// # Example
8191    /// ```ignore,no_run
8192    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8193    /// let x = RuntimeConfig::new().set_uri("example");
8194    /// ```
8195    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8196        self.uri = v.into();
8197        self
8198    }
8199
8200    /// Sets the value of [state][crate::model::RuntimeConfig::state].
8201    ///
8202    /// # Example
8203    /// ```ignore,no_run
8204    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8205    /// use google_cloud_developerconnect_v1::model::runtime_config::State;
8206    /// let x0 = RuntimeConfig::new().set_state(State::Linked);
8207    /// let x1 = RuntimeConfig::new().set_state(State::Unlinked);
8208    /// ```
8209    pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
8210        mut self,
8211        v: T,
8212    ) -> Self {
8213        self.state = v.into();
8214        self
8215    }
8216
8217    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime].
8218    ///
8219    /// Note that all the setters affecting `runtime` are mutually
8220    /// exclusive.
8221    ///
8222    /// # Example
8223    /// ```ignore,no_run
8224    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8225    /// use google_cloud_developerconnect_v1::model::GKEWorkload;
8226    /// let x = RuntimeConfig::new().set_runtime(Some(
8227    ///     google_cloud_developerconnect_v1::model::runtime_config::Runtime::GkeWorkload(GKEWorkload::default().into())));
8228    /// ```
8229    pub fn set_runtime<
8230        T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
8231    >(
8232        mut self,
8233        v: T,
8234    ) -> Self {
8235        self.runtime = v.into();
8236        self
8237    }
8238
8239    /// The value of [runtime][crate::model::RuntimeConfig::runtime]
8240    /// if it holds a `GkeWorkload`, `None` if the field is not set or
8241    /// holds a different branch.
8242    pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
8243        #[allow(unreachable_patterns)]
8244        self.runtime.as_ref().and_then(|v| match v {
8245            crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
8246            _ => std::option::Option::None,
8247        })
8248    }
8249
8250    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
8251    /// to hold a `GkeWorkload`.
8252    ///
8253    /// Note that all the setters affecting `runtime` are
8254    /// mutually exclusive.
8255    ///
8256    /// # Example
8257    /// ```ignore,no_run
8258    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8259    /// use google_cloud_developerconnect_v1::model::GKEWorkload;
8260    /// let x = RuntimeConfig::new().set_gke_workload(GKEWorkload::default()/* use setters */);
8261    /// assert!(x.gke_workload().is_some());
8262    /// assert!(x.google_cloud_run().is_none());
8263    /// ```
8264    pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
8265        mut self,
8266        v: T,
8267    ) -> Self {
8268        self.runtime =
8269            std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
8270        self
8271    }
8272
8273    /// The value of [runtime][crate::model::RuntimeConfig::runtime]
8274    /// if it holds a `GoogleCloudRun`, `None` if the field is not set or
8275    /// holds a different branch.
8276    pub fn google_cloud_run(
8277        &self,
8278    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleCloudRun>> {
8279        #[allow(unreachable_patterns)]
8280        self.runtime.as_ref().and_then(|v| match v {
8281            crate::model::runtime_config::Runtime::GoogleCloudRun(v) => {
8282                std::option::Option::Some(v)
8283            }
8284            _ => std::option::Option::None,
8285        })
8286    }
8287
8288    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
8289    /// to hold a `GoogleCloudRun`.
8290    ///
8291    /// Note that all the setters affecting `runtime` are
8292    /// mutually exclusive.
8293    ///
8294    /// # Example
8295    /// ```ignore,no_run
8296    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8297    /// use google_cloud_developerconnect_v1::model::GoogleCloudRun;
8298    /// let x = RuntimeConfig::new().set_google_cloud_run(GoogleCloudRun::default()/* use setters */);
8299    /// assert!(x.google_cloud_run().is_some());
8300    /// assert!(x.gke_workload().is_none());
8301    /// ```
8302    pub fn set_google_cloud_run<
8303        T: std::convert::Into<std::boxed::Box<crate::model::GoogleCloudRun>>,
8304    >(
8305        mut self,
8306        v: T,
8307    ) -> Self {
8308        self.runtime = std::option::Option::Some(
8309            crate::model::runtime_config::Runtime::GoogleCloudRun(v.into()),
8310        );
8311        self
8312    }
8313
8314    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from].
8315    ///
8316    /// Note that all the setters affecting `derived_from` are mutually
8317    /// exclusive.
8318    ///
8319    /// # Example
8320    /// ```ignore,no_run
8321    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8322    /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
8323    /// let x = RuntimeConfig::new().set_derived_from(Some(
8324    ///     google_cloud_developerconnect_v1::model::runtime_config::DerivedFrom::AppHubWorkload(AppHubWorkload::default().into())));
8325    /// ```
8326    pub fn set_derived_from<
8327        T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
8328    >(
8329        mut self,
8330        v: T,
8331    ) -> Self {
8332        self.derived_from = v.into();
8333        self
8334    }
8335
8336    /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
8337    /// if it holds a `AppHubWorkload`, `None` if the field is not set or
8338    /// holds a different branch.
8339    pub fn app_hub_workload(
8340        &self,
8341    ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
8342        #[allow(unreachable_patterns)]
8343        self.derived_from.as_ref().and_then(|v| match v {
8344            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
8345                std::option::Option::Some(v)
8346            }
8347            _ => std::option::Option::None,
8348        })
8349    }
8350
8351    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
8352    /// to hold a `AppHubWorkload`.
8353    ///
8354    /// Note that all the setters affecting `derived_from` are
8355    /// mutually exclusive.
8356    ///
8357    /// # Example
8358    /// ```ignore,no_run
8359    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8360    /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
8361    /// let x = RuntimeConfig::new().set_app_hub_workload(AppHubWorkload::default()/* use setters */);
8362    /// assert!(x.app_hub_workload().is_some());
8363    /// assert!(x.app_hub_service().is_none());
8364    /// ```
8365    pub fn set_app_hub_workload<
8366        T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
8367    >(
8368        mut self,
8369        v: T,
8370    ) -> Self {
8371        self.derived_from = std::option::Option::Some(
8372            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
8373        );
8374        self
8375    }
8376
8377    /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
8378    /// if it holds a `AppHubService`, `None` if the field is not set or
8379    /// holds a different branch.
8380    pub fn app_hub_service(
8381        &self,
8382    ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubService>> {
8383        #[allow(unreachable_patterns)]
8384        self.derived_from.as_ref().and_then(|v| match v {
8385            crate::model::runtime_config::DerivedFrom::AppHubService(v) => {
8386                std::option::Option::Some(v)
8387            }
8388            _ => std::option::Option::None,
8389        })
8390    }
8391
8392    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
8393    /// to hold a `AppHubService`.
8394    ///
8395    /// Note that all the setters affecting `derived_from` are
8396    /// mutually exclusive.
8397    ///
8398    /// # Example
8399    /// ```ignore,no_run
8400    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8401    /// use google_cloud_developerconnect_v1::model::AppHubService;
8402    /// let x = RuntimeConfig::new().set_app_hub_service(AppHubService::default()/* use setters */);
8403    /// assert!(x.app_hub_service().is_some());
8404    /// assert!(x.app_hub_workload().is_none());
8405    /// ```
8406    pub fn set_app_hub_service<
8407        T: std::convert::Into<std::boxed::Box<crate::model::AppHubService>>,
8408    >(
8409        mut self,
8410        v: T,
8411    ) -> Self {
8412        self.derived_from = std::option::Option::Some(
8413            crate::model::runtime_config::DerivedFrom::AppHubService(v.into()),
8414        );
8415        self
8416    }
8417}
8418
8419impl wkt::message::Message for RuntimeConfig {
8420    fn typename() -> &'static str {
8421        "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
8422    }
8423}
8424
8425/// Defines additional types related to [RuntimeConfig].
8426pub mod runtime_config {
8427    #[allow(unused_imports)]
8428    use super::*;
8429
8430    /// The state of the runtime in the InsightsConfig.
8431    /// Whether the runtime is linked to the InsightsConfig.
8432    ///
8433    /// # Working with unknown values
8434    ///
8435    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8436    /// additional enum variants at any time. Adding new variants is not considered
8437    /// a breaking change. Applications should write their code in anticipation of:
8438    ///
8439    /// - New values appearing in future releases of the client library, **and**
8440    /// - New values received dynamically, without application changes.
8441    ///
8442    /// Please consult the [Working with enums] section in the user guide for some
8443    /// guidelines.
8444    ///
8445    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8446    #[derive(Clone, Debug, PartialEq)]
8447    #[non_exhaustive]
8448    pub enum State {
8449        /// No state specified.
8450        Unspecified,
8451        /// The runtime configuration has been linked to the InsightsConfig.
8452        Linked,
8453        /// The runtime configuration has been unlinked to the InsightsConfig.
8454        Unlinked,
8455        /// If set, the enum was initialized with an unknown value.
8456        ///
8457        /// Applications can examine the value using [State::value] or
8458        /// [State::name].
8459        UnknownValue(state::UnknownValue),
8460    }
8461
8462    #[doc(hidden)]
8463    pub mod state {
8464        #[allow(unused_imports)]
8465        use super::*;
8466        #[derive(Clone, Debug, PartialEq)]
8467        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8468    }
8469
8470    impl State {
8471        /// Gets the enum value.
8472        ///
8473        /// Returns `None` if the enum contains an unknown value deserialized from
8474        /// the string representation of enums.
8475        pub fn value(&self) -> std::option::Option<i32> {
8476            match self {
8477                Self::Unspecified => std::option::Option::Some(0),
8478                Self::Linked => std::option::Option::Some(1),
8479                Self::Unlinked => std::option::Option::Some(2),
8480                Self::UnknownValue(u) => u.0.value(),
8481            }
8482        }
8483
8484        /// Gets the enum value as a string.
8485        ///
8486        /// Returns `None` if the enum contains an unknown value deserialized from
8487        /// the integer representation of enums.
8488        pub fn name(&self) -> std::option::Option<&str> {
8489            match self {
8490                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8491                Self::Linked => std::option::Option::Some("LINKED"),
8492                Self::Unlinked => std::option::Option::Some("UNLINKED"),
8493                Self::UnknownValue(u) => u.0.name(),
8494            }
8495        }
8496    }
8497
8498    impl std::default::Default for State {
8499        fn default() -> Self {
8500            use std::convert::From;
8501            Self::from(0)
8502        }
8503    }
8504
8505    impl std::fmt::Display for State {
8506        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8507            wkt::internal::display_enum(f, self.name(), self.value())
8508        }
8509    }
8510
8511    impl std::convert::From<i32> for State {
8512        fn from(value: i32) -> Self {
8513            match value {
8514                0 => Self::Unspecified,
8515                1 => Self::Linked,
8516                2 => Self::Unlinked,
8517                _ => Self::UnknownValue(state::UnknownValue(
8518                    wkt::internal::UnknownEnumValue::Integer(value),
8519                )),
8520            }
8521        }
8522    }
8523
8524    impl std::convert::From<&str> for State {
8525        fn from(value: &str) -> Self {
8526            use std::string::ToString;
8527            match value {
8528                "STATE_UNSPECIFIED" => Self::Unspecified,
8529                "LINKED" => Self::Linked,
8530                "UNLINKED" => Self::Unlinked,
8531                _ => Self::UnknownValue(state::UnknownValue(
8532                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8533                )),
8534            }
8535        }
8536    }
8537
8538    impl serde::ser::Serialize for State {
8539        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8540        where
8541            S: serde::Serializer,
8542        {
8543            match self {
8544                Self::Unspecified => serializer.serialize_i32(0),
8545                Self::Linked => serializer.serialize_i32(1),
8546                Self::Unlinked => serializer.serialize_i32(2),
8547                Self::UnknownValue(u) => u.0.serialize(serializer),
8548            }
8549        }
8550    }
8551
8552    impl<'de> serde::de::Deserialize<'de> for State {
8553        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8554        where
8555            D: serde::Deserializer<'de>,
8556        {
8557            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8558                ".google.cloud.developerconnect.v1.RuntimeConfig.State",
8559            ))
8560        }
8561    }
8562
8563    /// The type of the runtime.
8564    #[derive(Clone, Debug, PartialEq)]
8565    #[non_exhaustive]
8566    pub enum Runtime {
8567        /// Output only. Google Kubernetes Engine runtime.
8568        GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
8569        /// Output only. Cloud Run runtime.
8570        GoogleCloudRun(std::boxed::Box<crate::model::GoogleCloudRun>),
8571    }
8572
8573    /// Where the runtime is derived from.
8574    #[derive(Clone, Debug, PartialEq)]
8575    #[non_exhaustive]
8576    pub enum DerivedFrom {
8577        /// Output only. App Hub Workload.
8578        AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
8579        /// Output only. App Hub Service.
8580        AppHubService(std::boxed::Box<crate::model::AppHubService>),
8581    }
8582}
8583
8584/// GKEWorkload represents the Google Kubernetes Engine runtime.
8585#[derive(Clone, Default, PartialEq)]
8586#[non_exhaustive]
8587pub struct GKEWorkload {
8588    /// Required. Immutable. The name of the GKE cluster.
8589    /// Format:
8590    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
8591    pub cluster: std::string::String,
8592
8593    /// Output only. The name of the GKE deployment.
8594    /// Format:
8595    /// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
8596    pub deployment: std::string::String,
8597
8598    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8599}
8600
8601impl GKEWorkload {
8602    pub fn new() -> Self {
8603        std::default::Default::default()
8604    }
8605
8606    /// Sets the value of [cluster][crate::model::GKEWorkload::cluster].
8607    ///
8608    /// # Example
8609    /// ```ignore,no_run
8610    /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
8611    /// let x = GKEWorkload::new().set_cluster("example");
8612    /// ```
8613    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8614        self.cluster = v.into();
8615        self
8616    }
8617
8618    /// Sets the value of [deployment][crate::model::GKEWorkload::deployment].
8619    ///
8620    /// # Example
8621    /// ```ignore,no_run
8622    /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
8623    /// let x = GKEWorkload::new().set_deployment("example");
8624    /// ```
8625    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8626        self.deployment = v.into();
8627        self
8628    }
8629}
8630
8631impl wkt::message::Message for GKEWorkload {
8632    fn typename() -> &'static str {
8633        "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
8634    }
8635}
8636
8637/// GoogleCloudRun represents the Cloud Run runtime.
8638#[derive(Clone, Default, PartialEq)]
8639#[non_exhaustive]
8640pub struct GoogleCloudRun {
8641    /// Required. Immutable. The name of the Cloud Run service.
8642    /// Format:
8643    /// `projects/{project}/locations/{location}/services/{service}`.
8644    pub service_uri: std::string::String,
8645
8646    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8647}
8648
8649impl GoogleCloudRun {
8650    pub fn new() -> Self {
8651        std::default::Default::default()
8652    }
8653
8654    /// Sets the value of [service_uri][crate::model::GoogleCloudRun::service_uri].
8655    ///
8656    /// # Example
8657    /// ```ignore,no_run
8658    /// # use google_cloud_developerconnect_v1::model::GoogleCloudRun;
8659    /// let x = GoogleCloudRun::new().set_service_uri("example");
8660    /// ```
8661    pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8662        self.service_uri = v.into();
8663        self
8664    }
8665}
8666
8667impl wkt::message::Message for GoogleCloudRun {
8668    fn typename() -> &'static str {
8669        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleCloudRun"
8670    }
8671}
8672
8673/// AppHubWorkload represents the App Hub Workload.
8674#[derive(Clone, Default, PartialEq)]
8675#[non_exhaustive]
8676pub struct AppHubWorkload {
8677    /// Required. Output only. Immutable. The name of the App Hub Workload.
8678    /// Format:
8679    /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
8680    pub workload: std::string::String,
8681
8682    /// Output only. The criticality of the App Hub Workload.
8683    pub criticality: std::string::String,
8684
8685    /// Output only. The environment of the App Hub Workload.
8686    pub environment: std::string::String,
8687
8688    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8689}
8690
8691impl AppHubWorkload {
8692    pub fn new() -> Self {
8693        std::default::Default::default()
8694    }
8695
8696    /// Sets the value of [workload][crate::model::AppHubWorkload::workload].
8697    ///
8698    /// # Example
8699    /// ```ignore,no_run
8700    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8701    /// let x = AppHubWorkload::new().set_workload("example");
8702    /// ```
8703    pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8704        self.workload = v.into();
8705        self
8706    }
8707
8708    /// Sets the value of [criticality][crate::model::AppHubWorkload::criticality].
8709    ///
8710    /// # Example
8711    /// ```ignore,no_run
8712    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8713    /// let x = AppHubWorkload::new().set_criticality("example");
8714    /// ```
8715    pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8716        self.criticality = v.into();
8717        self
8718    }
8719
8720    /// Sets the value of [environment][crate::model::AppHubWorkload::environment].
8721    ///
8722    /// # Example
8723    /// ```ignore,no_run
8724    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8725    /// let x = AppHubWorkload::new().set_environment("example");
8726    /// ```
8727    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8728        self.environment = v.into();
8729        self
8730    }
8731}
8732
8733impl wkt::message::Message for AppHubWorkload {
8734    fn typename() -> &'static str {
8735        "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
8736    }
8737}
8738
8739/// AppHubService represents the App Hub Service.
8740#[derive(Clone, Default, PartialEq)]
8741#[non_exhaustive]
8742pub struct AppHubService {
8743    /// Required. Output only. Immutable. The name of the App Hub Service.
8744    /// Format:
8745    /// `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
8746    pub apphub_service: std::string::String,
8747
8748    /// Output only. The criticality of the App Hub Service.
8749    pub criticality: std::string::String,
8750
8751    /// Output only. The environment of the App Hub Service.
8752    pub environment: std::string::String,
8753
8754    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8755}
8756
8757impl AppHubService {
8758    pub fn new() -> Self {
8759        std::default::Default::default()
8760    }
8761
8762    /// Sets the value of [apphub_service][crate::model::AppHubService::apphub_service].
8763    ///
8764    /// # Example
8765    /// ```ignore,no_run
8766    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8767    /// let x = AppHubService::new().set_apphub_service("example");
8768    /// ```
8769    pub fn set_apphub_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8770        self.apphub_service = v.into();
8771        self
8772    }
8773
8774    /// Sets the value of [criticality][crate::model::AppHubService::criticality].
8775    ///
8776    /// # Example
8777    /// ```ignore,no_run
8778    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8779    /// let x = AppHubService::new().set_criticality("example");
8780    /// ```
8781    pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8782        self.criticality = v.into();
8783        self
8784    }
8785
8786    /// Sets the value of [environment][crate::model::AppHubService::environment].
8787    ///
8788    /// # Example
8789    /// ```ignore,no_run
8790    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8791    /// let x = AppHubService::new().set_environment("example");
8792    /// ```
8793    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8794        self.environment = v.into();
8795        self
8796    }
8797}
8798
8799impl wkt::message::Message for AppHubService {
8800    fn typename() -> &'static str {
8801        "type.googleapis.com/google.cloud.developerconnect.v1.AppHubService"
8802    }
8803}
8804
8805/// The artifact config of the artifact that is deployed.
8806#[derive(Clone, Default, PartialEq)]
8807#[non_exhaustive]
8808pub struct ArtifactConfig {
8809    /// Required. Immutable. The URI of the artifact that is deployed.
8810    /// e.g. `us-docker.pkg.dev/my-project/my-repo/image`.
8811    /// The URI does not include the tag / digest because it captures a lineage of
8812    /// artifacts.
8813    pub uri: std::string::String,
8814
8815    /// The storage location of the artifact.
8816    pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
8817
8818    /// The storage location of the artifact metadata.
8819    pub artifact_metadata_storage:
8820        std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
8821
8822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8823}
8824
8825impl ArtifactConfig {
8826    pub fn new() -> Self {
8827        std::default::Default::default()
8828    }
8829
8830    /// Sets the value of [uri][crate::model::ArtifactConfig::uri].
8831    ///
8832    /// # Example
8833    /// ```ignore,no_run
8834    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8835    /// let x = ArtifactConfig::new().set_uri("example");
8836    /// ```
8837    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8838        self.uri = v.into();
8839        self
8840    }
8841
8842    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage].
8843    ///
8844    /// Note that all the setters affecting `artifact_storage` are mutually
8845    /// exclusive.
8846    ///
8847    /// # Example
8848    /// ```ignore,no_run
8849    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8850    /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
8851    /// let x = ArtifactConfig::new().set_artifact_storage(Some(
8852    ///     google_cloud_developerconnect_v1::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(GoogleArtifactRegistry::default().into())));
8853    /// ```
8854    pub fn set_artifact_storage<
8855        T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
8856    >(
8857        mut self,
8858        v: T,
8859    ) -> Self {
8860        self.artifact_storage = v.into();
8861        self
8862    }
8863
8864    /// The value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
8865    /// if it holds a `GoogleArtifactRegistry`, `None` if the field is not set or
8866    /// holds a different branch.
8867    pub fn google_artifact_registry(
8868        &self,
8869    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
8870        #[allow(unreachable_patterns)]
8871        self.artifact_storage.as_ref().and_then(|v| match v {
8872            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
8873                std::option::Option::Some(v)
8874            }
8875            _ => std::option::Option::None,
8876        })
8877    }
8878
8879    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
8880    /// to hold a `GoogleArtifactRegistry`.
8881    ///
8882    /// Note that all the setters affecting `artifact_storage` are
8883    /// mutually exclusive.
8884    ///
8885    /// # Example
8886    /// ```ignore,no_run
8887    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8888    /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
8889    /// let x = ArtifactConfig::new().set_google_artifact_registry(GoogleArtifactRegistry::default()/* use setters */);
8890    /// assert!(x.google_artifact_registry().is_some());
8891    /// ```
8892    pub fn set_google_artifact_registry<
8893        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
8894    >(
8895        mut self,
8896        v: T,
8897    ) -> Self {
8898        self.artifact_storage = std::option::Option::Some(
8899            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
8900        );
8901        self
8902    }
8903
8904    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage].
8905    ///
8906    /// Note that all the setters affecting `artifact_metadata_storage` are mutually
8907    /// exclusive.
8908    ///
8909    /// # Example
8910    /// ```ignore,no_run
8911    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8912    /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
8913    /// let x = ArtifactConfig::new().set_artifact_metadata_storage(Some(
8914    ///     google_cloud_developerconnect_v1::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(GoogleArtifactAnalysis::default().into())));
8915    /// ```
8916    pub fn set_artifact_metadata_storage<
8917        T: std::convert::Into<
8918                std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
8919            >,
8920    >(
8921        mut self,
8922        v: T,
8923    ) -> Self {
8924        self.artifact_metadata_storage = v.into();
8925        self
8926    }
8927
8928    /// The value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
8929    /// if it holds a `GoogleArtifactAnalysis`, `None` if the field is not set or
8930    /// holds a different branch.
8931    pub fn google_artifact_analysis(
8932        &self,
8933    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
8934        #[allow(unreachable_patterns)]
8935        self.artifact_metadata_storage
8936            .as_ref()
8937            .and_then(|v| match v {
8938                crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
8939                    v,
8940                ) => std::option::Option::Some(v),
8941                _ => std::option::Option::None,
8942            })
8943    }
8944
8945    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
8946    /// to hold a `GoogleArtifactAnalysis`.
8947    ///
8948    /// Note that all the setters affecting `artifact_metadata_storage` are
8949    /// mutually exclusive.
8950    ///
8951    /// # Example
8952    /// ```ignore,no_run
8953    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8954    /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
8955    /// let x = ArtifactConfig::new().set_google_artifact_analysis(GoogleArtifactAnalysis::default()/* use setters */);
8956    /// assert!(x.google_artifact_analysis().is_some());
8957    /// ```
8958    pub fn set_google_artifact_analysis<
8959        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
8960    >(
8961        mut self,
8962        v: T,
8963    ) -> Self {
8964        self.artifact_metadata_storage = std::option::Option::Some(
8965            crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
8966                v.into(),
8967            ),
8968        );
8969        self
8970    }
8971}
8972
8973impl wkt::message::Message for ArtifactConfig {
8974    fn typename() -> &'static str {
8975        "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
8976    }
8977}
8978
8979/// Defines additional types related to [ArtifactConfig].
8980pub mod artifact_config {
8981    #[allow(unused_imports)]
8982    use super::*;
8983
8984    /// The storage location of the artifact.
8985    #[derive(Clone, Debug, PartialEq)]
8986    #[non_exhaustive]
8987    pub enum ArtifactStorage {
8988        /// Optional. Set if the artifact is stored in Artifact registry.
8989        GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
8990    }
8991
8992    /// The storage location of the artifact metadata.
8993    #[derive(Clone, Debug, PartialEq)]
8994    #[non_exhaustive]
8995    pub enum ArtifactMetadataStorage {
8996        /// Optional. Set if the artifact metadata is stored in Artifact analysis.
8997        GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
8998    }
8999}
9000
9001/// Google Artifact Analysis configurations.
9002#[derive(Clone, Default, PartialEq)]
9003#[non_exhaustive]
9004pub struct GoogleArtifactAnalysis {
9005    /// Required. The project id of the project where the provenance is stored.
9006    pub project_id: std::string::String,
9007
9008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9009}
9010
9011impl GoogleArtifactAnalysis {
9012    pub fn new() -> Self {
9013        std::default::Default::default()
9014    }
9015
9016    /// Sets the value of [project_id][crate::model::GoogleArtifactAnalysis::project_id].
9017    ///
9018    /// # Example
9019    /// ```ignore,no_run
9020    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
9021    /// let x = GoogleArtifactAnalysis::new().set_project_id("example");
9022    /// ```
9023    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9024        self.project_id = v.into();
9025        self
9026    }
9027}
9028
9029impl wkt::message::Message for GoogleArtifactAnalysis {
9030    fn typename() -> &'static str {
9031        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
9032    }
9033}
9034
9035/// Google Artifact Registry configurations.
9036#[derive(Clone, Default, PartialEq)]
9037#[non_exhaustive]
9038pub struct GoogleArtifactRegistry {
9039    /// Required. The host project of Artifact Registry.
9040    pub project_id: std::string::String,
9041
9042    /// Required. Immutable. The name of the artifact registry package.
9043    pub artifact_registry_package: std::string::String,
9044
9045    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9046}
9047
9048impl GoogleArtifactRegistry {
9049    pub fn new() -> Self {
9050        std::default::Default::default()
9051    }
9052
9053    /// Sets the value of [project_id][crate::model::GoogleArtifactRegistry::project_id].
9054    ///
9055    /// # Example
9056    /// ```ignore,no_run
9057    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9058    /// let x = GoogleArtifactRegistry::new().set_project_id("example");
9059    /// ```
9060    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9061        self.project_id = v.into();
9062        self
9063    }
9064
9065    /// Sets the value of [artifact_registry_package][crate::model::GoogleArtifactRegistry::artifact_registry_package].
9066    ///
9067    /// # Example
9068    /// ```ignore,no_run
9069    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9070    /// let x = GoogleArtifactRegistry::new().set_artifact_registry_package("example");
9071    /// ```
9072    pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
9073        mut self,
9074        v: T,
9075    ) -> Self {
9076        self.artifact_registry_package = v.into();
9077        self
9078    }
9079}
9080
9081impl wkt::message::Message for GoogleArtifactRegistry {
9082    fn typename() -> &'static str {
9083        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
9084    }
9085}
9086
9087/// The DeploymentEvent resource represents the deployment of the artifact within
9088/// the InsightsConfig resource.
9089#[derive(Clone, Default, PartialEq)]
9090#[non_exhaustive]
9091pub struct DeploymentEvent {
9092    /// Identifier. The name of the DeploymentEvent. This name is provided by
9093    /// Developer Connect insights. Format:
9094    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
9095    pub name: std::string::String,
9096
9097    /// Output only. The create time of the DeploymentEvent.
9098    pub create_time: std::option::Option<wkt::Timestamp>,
9099
9100    /// Output only. The update time of the DeploymentEvent.
9101    pub update_time: std::option::Option<wkt::Timestamp>,
9102
9103    /// Output only. The runtime configurations where the DeploymentEvent happened.
9104    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
9105
9106    /// Output only. The runtime assigned URI of the DeploymentEvent.
9107    /// For GKE, this is the fully qualified replica set uri.
9108    /// e.g.
9109    /// container.googleapis.com/projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/apps/replicasets/{replica-set-id}
9110    /// For Cloud Run, this is the revision name.
9111    pub runtime_deployment_uri: std::string::String,
9112
9113    /// Output only. The state of the DeploymentEvent.
9114    pub state: crate::model::deployment_event::State,
9115
9116    /// Output only. The artifact deployments of the DeploymentEvent. Each artifact
9117    /// deployment contains the artifact uri and the runtime configuration uri. For
9118    /// GKE, this would be all the containers images that are deployed in the pod.
9119    pub artifact_deployments: std::vec::Vec<crate::model::ArtifactDeployment>,
9120
9121    /// Output only. The time at which the DeploymentEvent was deployed.
9122    /// This would be the min of all ArtifactDeployment deploy_times.
9123    pub deploy_time: std::option::Option<wkt::Timestamp>,
9124
9125    /// Output only. The time at which the DeploymentEvent was undeployed, all
9126    /// artifacts are considered undeployed once this time is set. This would be
9127    /// the max of all ArtifactDeployment undeploy_times. If any ArtifactDeployment
9128    /// is still active (i.e. does not have an undeploy_time), this field will be
9129    /// empty.
9130    pub undeploy_time: std::option::Option<wkt::Timestamp>,
9131
9132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9133}
9134
9135impl DeploymentEvent {
9136    pub fn new() -> Self {
9137        std::default::Default::default()
9138    }
9139
9140    /// Sets the value of [name][crate::model::DeploymentEvent::name].
9141    ///
9142    /// # Example
9143    /// ```ignore,no_run
9144    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9145    /// let x = DeploymentEvent::new().set_name("example");
9146    /// ```
9147    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9148        self.name = v.into();
9149        self
9150    }
9151
9152    /// Sets the value of [create_time][crate::model::DeploymentEvent::create_time].
9153    ///
9154    /// # Example
9155    /// ```ignore,no_run
9156    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9157    /// use wkt::Timestamp;
9158    /// let x = DeploymentEvent::new().set_create_time(Timestamp::default()/* use setters */);
9159    /// ```
9160    pub fn set_create_time<T>(mut self, v: T) -> Self
9161    where
9162        T: std::convert::Into<wkt::Timestamp>,
9163    {
9164        self.create_time = std::option::Option::Some(v.into());
9165        self
9166    }
9167
9168    /// Sets or clears the value of [create_time][crate::model::DeploymentEvent::create_time].
9169    ///
9170    /// # Example
9171    /// ```ignore,no_run
9172    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9173    /// use wkt::Timestamp;
9174    /// let x = DeploymentEvent::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9175    /// let x = DeploymentEvent::new().set_or_clear_create_time(None::<Timestamp>);
9176    /// ```
9177    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9178    where
9179        T: std::convert::Into<wkt::Timestamp>,
9180    {
9181        self.create_time = v.map(|x| x.into());
9182        self
9183    }
9184
9185    /// Sets the value of [update_time][crate::model::DeploymentEvent::update_time].
9186    ///
9187    /// # Example
9188    /// ```ignore,no_run
9189    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9190    /// use wkt::Timestamp;
9191    /// let x = DeploymentEvent::new().set_update_time(Timestamp::default()/* use setters */);
9192    /// ```
9193    pub fn set_update_time<T>(mut self, v: T) -> Self
9194    where
9195        T: std::convert::Into<wkt::Timestamp>,
9196    {
9197        self.update_time = std::option::Option::Some(v.into());
9198        self
9199    }
9200
9201    /// Sets or clears the value of [update_time][crate::model::DeploymentEvent::update_time].
9202    ///
9203    /// # Example
9204    /// ```ignore,no_run
9205    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9206    /// use wkt::Timestamp;
9207    /// let x = DeploymentEvent::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9208    /// let x = DeploymentEvent::new().set_or_clear_update_time(None::<Timestamp>);
9209    /// ```
9210    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9211    where
9212        T: std::convert::Into<wkt::Timestamp>,
9213    {
9214        self.update_time = v.map(|x| x.into());
9215        self
9216    }
9217
9218    /// Sets the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
9219    ///
9220    /// # Example
9221    /// ```ignore,no_run
9222    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9223    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
9224    /// let x = DeploymentEvent::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
9225    /// ```
9226    pub fn set_runtime_config<T>(mut self, v: T) -> Self
9227    where
9228        T: std::convert::Into<crate::model::RuntimeConfig>,
9229    {
9230        self.runtime_config = std::option::Option::Some(v.into());
9231        self
9232    }
9233
9234    /// Sets or clears the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
9235    ///
9236    /// # Example
9237    /// ```ignore,no_run
9238    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9239    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
9240    /// let x = DeploymentEvent::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
9241    /// let x = DeploymentEvent::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
9242    /// ```
9243    pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
9244    where
9245        T: std::convert::Into<crate::model::RuntimeConfig>,
9246    {
9247        self.runtime_config = v.map(|x| x.into());
9248        self
9249    }
9250
9251    /// Sets the value of [runtime_deployment_uri][crate::model::DeploymentEvent::runtime_deployment_uri].
9252    ///
9253    /// # Example
9254    /// ```ignore,no_run
9255    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9256    /// let x = DeploymentEvent::new().set_runtime_deployment_uri("example");
9257    /// ```
9258    pub fn set_runtime_deployment_uri<T: std::convert::Into<std::string::String>>(
9259        mut self,
9260        v: T,
9261    ) -> Self {
9262        self.runtime_deployment_uri = v.into();
9263        self
9264    }
9265
9266    /// Sets the value of [state][crate::model::DeploymentEvent::state].
9267    ///
9268    /// # Example
9269    /// ```ignore,no_run
9270    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9271    /// use google_cloud_developerconnect_v1::model::deployment_event::State;
9272    /// let x0 = DeploymentEvent::new().set_state(State::Active);
9273    /// let x1 = DeploymentEvent::new().set_state(State::Inactive);
9274    /// ```
9275    pub fn set_state<T: std::convert::Into<crate::model::deployment_event::State>>(
9276        mut self,
9277        v: T,
9278    ) -> Self {
9279        self.state = v.into();
9280        self
9281    }
9282
9283    /// Sets the value of [artifact_deployments][crate::model::DeploymentEvent::artifact_deployments].
9284    ///
9285    /// # Example
9286    /// ```ignore,no_run
9287    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9288    /// use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9289    /// let x = DeploymentEvent::new()
9290    ///     .set_artifact_deployments([
9291    ///         ArtifactDeployment::default()/* use setters */,
9292    ///         ArtifactDeployment::default()/* use (different) setters */,
9293    ///     ]);
9294    /// ```
9295    pub fn set_artifact_deployments<T, V>(mut self, v: T) -> Self
9296    where
9297        T: std::iter::IntoIterator<Item = V>,
9298        V: std::convert::Into<crate::model::ArtifactDeployment>,
9299    {
9300        use std::iter::Iterator;
9301        self.artifact_deployments = v.into_iter().map(|i| i.into()).collect();
9302        self
9303    }
9304
9305    /// Sets the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
9306    ///
9307    /// # Example
9308    /// ```ignore,no_run
9309    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9310    /// use wkt::Timestamp;
9311    /// let x = DeploymentEvent::new().set_deploy_time(Timestamp::default()/* use setters */);
9312    /// ```
9313    pub fn set_deploy_time<T>(mut self, v: T) -> Self
9314    where
9315        T: std::convert::Into<wkt::Timestamp>,
9316    {
9317        self.deploy_time = std::option::Option::Some(v.into());
9318        self
9319    }
9320
9321    /// Sets or clears the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
9322    ///
9323    /// # Example
9324    /// ```ignore,no_run
9325    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9326    /// use wkt::Timestamp;
9327    /// let x = DeploymentEvent::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
9328    /// let x = DeploymentEvent::new().set_or_clear_deploy_time(None::<Timestamp>);
9329    /// ```
9330    pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9331    where
9332        T: std::convert::Into<wkt::Timestamp>,
9333    {
9334        self.deploy_time = v.map(|x| x.into());
9335        self
9336    }
9337
9338    /// Sets the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
9339    ///
9340    /// # Example
9341    /// ```ignore,no_run
9342    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9343    /// use wkt::Timestamp;
9344    /// let x = DeploymentEvent::new().set_undeploy_time(Timestamp::default()/* use setters */);
9345    /// ```
9346    pub fn set_undeploy_time<T>(mut self, v: T) -> Self
9347    where
9348        T: std::convert::Into<wkt::Timestamp>,
9349    {
9350        self.undeploy_time = std::option::Option::Some(v.into());
9351        self
9352    }
9353
9354    /// Sets or clears the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
9355    ///
9356    /// # Example
9357    /// ```ignore,no_run
9358    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9359    /// use wkt::Timestamp;
9360    /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
9361    /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(None::<Timestamp>);
9362    /// ```
9363    pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9364    where
9365        T: std::convert::Into<wkt::Timestamp>,
9366    {
9367        self.undeploy_time = v.map(|x| x.into());
9368        self
9369    }
9370}
9371
9372impl wkt::message::Message for DeploymentEvent {
9373    fn typename() -> &'static str {
9374        "type.googleapis.com/google.cloud.developerconnect.v1.DeploymentEvent"
9375    }
9376}
9377
9378/// Defines additional types related to [DeploymentEvent].
9379pub mod deployment_event {
9380    #[allow(unused_imports)]
9381    use super::*;
9382
9383    /// The state of the DeploymentEvent.
9384    ///
9385    /// # Working with unknown values
9386    ///
9387    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9388    /// additional enum variants at any time. Adding new variants is not considered
9389    /// a breaking change. Applications should write their code in anticipation of:
9390    ///
9391    /// - New values appearing in future releases of the client library, **and**
9392    /// - New values received dynamically, without application changes.
9393    ///
9394    /// Please consult the [Working with enums] section in the user guide for some
9395    /// guidelines.
9396    ///
9397    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9398    #[derive(Clone, Debug, PartialEq)]
9399    #[non_exhaustive]
9400    pub enum State {
9401        /// No state specified.
9402        Unspecified,
9403        /// The deployment is active in the runtime.
9404        Active,
9405        /// The deployment is not in the runtime.
9406        Inactive,
9407        /// If set, the enum was initialized with an unknown value.
9408        ///
9409        /// Applications can examine the value using [State::value] or
9410        /// [State::name].
9411        UnknownValue(state::UnknownValue),
9412    }
9413
9414    #[doc(hidden)]
9415    pub mod state {
9416        #[allow(unused_imports)]
9417        use super::*;
9418        #[derive(Clone, Debug, PartialEq)]
9419        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9420    }
9421
9422    impl State {
9423        /// Gets the enum value.
9424        ///
9425        /// Returns `None` if the enum contains an unknown value deserialized from
9426        /// the string representation of enums.
9427        pub fn value(&self) -> std::option::Option<i32> {
9428            match self {
9429                Self::Unspecified => std::option::Option::Some(0),
9430                Self::Active => std::option::Option::Some(1),
9431                Self::Inactive => std::option::Option::Some(2),
9432                Self::UnknownValue(u) => u.0.value(),
9433            }
9434        }
9435
9436        /// Gets the enum value as a string.
9437        ///
9438        /// Returns `None` if the enum contains an unknown value deserialized from
9439        /// the integer representation of enums.
9440        pub fn name(&self) -> std::option::Option<&str> {
9441            match self {
9442                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9443                Self::Active => std::option::Option::Some("STATE_ACTIVE"),
9444                Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
9445                Self::UnknownValue(u) => u.0.name(),
9446            }
9447        }
9448    }
9449
9450    impl std::default::Default for State {
9451        fn default() -> Self {
9452            use std::convert::From;
9453            Self::from(0)
9454        }
9455    }
9456
9457    impl std::fmt::Display for State {
9458        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9459            wkt::internal::display_enum(f, self.name(), self.value())
9460        }
9461    }
9462
9463    impl std::convert::From<i32> for State {
9464        fn from(value: i32) -> Self {
9465            match value {
9466                0 => Self::Unspecified,
9467                1 => Self::Active,
9468                2 => Self::Inactive,
9469                _ => Self::UnknownValue(state::UnknownValue(
9470                    wkt::internal::UnknownEnumValue::Integer(value),
9471                )),
9472            }
9473        }
9474    }
9475
9476    impl std::convert::From<&str> for State {
9477        fn from(value: &str) -> Self {
9478            use std::string::ToString;
9479            match value {
9480                "STATE_UNSPECIFIED" => Self::Unspecified,
9481                "STATE_ACTIVE" => Self::Active,
9482                "STATE_INACTIVE" => Self::Inactive,
9483                _ => Self::UnknownValue(state::UnknownValue(
9484                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9485                )),
9486            }
9487        }
9488    }
9489
9490    impl serde::ser::Serialize for State {
9491        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9492        where
9493            S: serde::Serializer,
9494        {
9495            match self {
9496                Self::Unspecified => serializer.serialize_i32(0),
9497                Self::Active => serializer.serialize_i32(1),
9498                Self::Inactive => serializer.serialize_i32(2),
9499                Self::UnknownValue(u) => u.0.serialize(serializer),
9500            }
9501        }
9502    }
9503
9504    impl<'de> serde::de::Deserialize<'de> for State {
9505        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9506        where
9507            D: serde::Deserializer<'de>,
9508        {
9509            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9510                ".google.cloud.developerconnect.v1.DeploymentEvent.State",
9511            ))
9512        }
9513    }
9514}
9515
9516/// Request for getting a DeploymentEvent.
9517#[derive(Clone, Default, PartialEq)]
9518#[non_exhaustive]
9519pub struct GetDeploymentEventRequest {
9520    /// Required. The name of the deployment event to retrieve.
9521    /// Format:
9522    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
9523    pub name: std::string::String,
9524
9525    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9526}
9527
9528impl GetDeploymentEventRequest {
9529    pub fn new() -> Self {
9530        std::default::Default::default()
9531    }
9532
9533    /// Sets the value of [name][crate::model::GetDeploymentEventRequest::name].
9534    ///
9535    /// # Example
9536    /// ```ignore,no_run
9537    /// # use google_cloud_developerconnect_v1::model::GetDeploymentEventRequest;
9538    /// let x = GetDeploymentEventRequest::new().set_name("example");
9539    /// ```
9540    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9541        self.name = v.into();
9542        self
9543    }
9544}
9545
9546impl wkt::message::Message for GetDeploymentEventRequest {
9547    fn typename() -> &'static str {
9548        "type.googleapis.com/google.cloud.developerconnect.v1.GetDeploymentEventRequest"
9549    }
9550}
9551
9552/// Request for requesting list of DeploymentEvents.
9553#[derive(Clone, Default, PartialEq)]
9554#[non_exhaustive]
9555pub struct ListDeploymentEventsRequest {
9556    /// Required. The parent insights config that owns this collection of
9557    /// deployment events. Format:
9558    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}
9559    pub parent: std::string::String,
9560
9561    /// Optional. The maximum number of deployment events to return. The service
9562    /// may return fewer than this value. If unspecified, at most 50 deployment
9563    /// events will be returned. The maximum value is 1000; values above 1000 will
9564    /// be coerced to 1000.
9565    pub page_size: i32,
9566
9567    /// Optional. A page token, received from a previous `ListDeploymentEvents`
9568    /// call. Provide this to retrieve the subsequent page.
9569    ///
9570    /// When paginating, all other parameters provided to `ListDeploymentEvents`
9571    /// must match the call that provided the page token.
9572    pub page_token: std::string::String,
9573
9574    /// Optional. Filter expression that matches a subset of the DeploymentEvents.
9575    /// <https://google.aip.dev/160>.
9576    pub filter: std::string::String,
9577
9578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9579}
9580
9581impl ListDeploymentEventsRequest {
9582    pub fn new() -> Self {
9583        std::default::Default::default()
9584    }
9585
9586    /// Sets the value of [parent][crate::model::ListDeploymentEventsRequest::parent].
9587    ///
9588    /// # Example
9589    /// ```ignore,no_run
9590    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9591    /// let x = ListDeploymentEventsRequest::new().set_parent("example");
9592    /// ```
9593    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9594        self.parent = v.into();
9595        self
9596    }
9597
9598    /// Sets the value of [page_size][crate::model::ListDeploymentEventsRequest::page_size].
9599    ///
9600    /// # Example
9601    /// ```ignore,no_run
9602    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9603    /// let x = ListDeploymentEventsRequest::new().set_page_size(42);
9604    /// ```
9605    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9606        self.page_size = v.into();
9607        self
9608    }
9609
9610    /// Sets the value of [page_token][crate::model::ListDeploymentEventsRequest::page_token].
9611    ///
9612    /// # Example
9613    /// ```ignore,no_run
9614    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9615    /// let x = ListDeploymentEventsRequest::new().set_page_token("example");
9616    /// ```
9617    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9618        self.page_token = v.into();
9619        self
9620    }
9621
9622    /// Sets the value of [filter][crate::model::ListDeploymentEventsRequest::filter].
9623    ///
9624    /// # Example
9625    /// ```ignore,no_run
9626    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9627    /// let x = ListDeploymentEventsRequest::new().set_filter("example");
9628    /// ```
9629    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9630        self.filter = v.into();
9631        self
9632    }
9633}
9634
9635impl wkt::message::Message for ListDeploymentEventsRequest {
9636    fn typename() -> &'static str {
9637        "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsRequest"
9638    }
9639}
9640
9641/// Response to listing DeploymentEvents.
9642#[derive(Clone, Default, PartialEq)]
9643#[non_exhaustive]
9644pub struct ListDeploymentEventsResponse {
9645    /// The list of DeploymentEvents.
9646    pub deployment_events: std::vec::Vec<crate::model::DeploymentEvent>,
9647
9648    /// A token, which can be sent as `page_token` to retrieve the next page.
9649    /// If this field is omitted, there are no subsequent pages.
9650    pub next_page_token: std::string::String,
9651
9652    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9653}
9654
9655impl ListDeploymentEventsResponse {
9656    pub fn new() -> Self {
9657        std::default::Default::default()
9658    }
9659
9660    /// Sets the value of [deployment_events][crate::model::ListDeploymentEventsResponse::deployment_events].
9661    ///
9662    /// # Example
9663    /// ```ignore,no_run
9664    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
9665    /// use google_cloud_developerconnect_v1::model::DeploymentEvent;
9666    /// let x = ListDeploymentEventsResponse::new()
9667    ///     .set_deployment_events([
9668    ///         DeploymentEvent::default()/* use setters */,
9669    ///         DeploymentEvent::default()/* use (different) setters */,
9670    ///     ]);
9671    /// ```
9672    pub fn set_deployment_events<T, V>(mut self, v: T) -> Self
9673    where
9674        T: std::iter::IntoIterator<Item = V>,
9675        V: std::convert::Into<crate::model::DeploymentEvent>,
9676    {
9677        use std::iter::Iterator;
9678        self.deployment_events = v.into_iter().map(|i| i.into()).collect();
9679        self
9680    }
9681
9682    /// Sets the value of [next_page_token][crate::model::ListDeploymentEventsResponse::next_page_token].
9683    ///
9684    /// # Example
9685    /// ```ignore,no_run
9686    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
9687    /// let x = ListDeploymentEventsResponse::new().set_next_page_token("example");
9688    /// ```
9689    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9690        self.next_page_token = v.into();
9691        self
9692    }
9693}
9694
9695impl wkt::message::Message for ListDeploymentEventsResponse {
9696    fn typename() -> &'static str {
9697        "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsResponse"
9698    }
9699}
9700
9701#[doc(hidden)]
9702impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentEventsResponse {
9703    type PageItem = crate::model::DeploymentEvent;
9704
9705    fn items(self) -> std::vec::Vec<Self::PageItem> {
9706        self.deployment_events
9707    }
9708
9709    fn next_page_token(&self) -> std::string::String {
9710        use std::clone::Clone;
9711        self.next_page_token.clone()
9712    }
9713}
9714
9715/// The ArtifactDeployment resource represents the deployment of the artifact
9716/// within the InsightsConfig resource.
9717#[derive(Clone, Default, PartialEq)]
9718#[non_exhaustive]
9719pub struct ArtifactDeployment {
9720    /// Output only. Unique identifier of `ArtifactDeployment`.
9721    pub id: std::string::String,
9722
9723    /// Output only. The artifact that is deployed.
9724    pub artifact_reference: std::string::String,
9725
9726    /// Output only. The artifact alias in the deployment spec, with Tag/SHA.
9727    /// e.g. us-docker.pkg.dev/my-project/my-repo/image:1.0.0
9728    pub artifact_alias: std::string::String,
9729
9730    /// Output only. The source commits at which this artifact was built. Extracted
9731    /// from provenance.
9732    pub source_commit_uris: std::vec::Vec<std::string::String>,
9733
9734    /// Output only. The time at which the deployment was deployed.
9735    pub deploy_time: std::option::Option<wkt::Timestamp>,
9736
9737    /// Output only. The time at which the deployment was undeployed, all artifacts
9738    /// are considered undeployed once this time is set.
9739    pub undeploy_time: std::option::Option<wkt::Timestamp>,
9740
9741    /// Output only. The summary of container status of the artifact deployment.
9742    /// Format as `ContainerStatusState-Reason : restartCount`
9743    /// e.g. "Waiting-ImagePullBackOff : 3"
9744    pub container_status_summary: std::string::String,
9745
9746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9747}
9748
9749impl ArtifactDeployment {
9750    pub fn new() -> Self {
9751        std::default::Default::default()
9752    }
9753
9754    /// Sets the value of [id][crate::model::ArtifactDeployment::id].
9755    ///
9756    /// # Example
9757    /// ```ignore,no_run
9758    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9759    /// let x = ArtifactDeployment::new().set_id("example");
9760    /// ```
9761    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9762        self.id = v.into();
9763        self
9764    }
9765
9766    /// Sets the value of [artifact_reference][crate::model::ArtifactDeployment::artifact_reference].
9767    ///
9768    /// # Example
9769    /// ```ignore,no_run
9770    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9771    /// let x = ArtifactDeployment::new().set_artifact_reference("example");
9772    /// ```
9773    pub fn set_artifact_reference<T: std::convert::Into<std::string::String>>(
9774        mut self,
9775        v: T,
9776    ) -> Self {
9777        self.artifact_reference = v.into();
9778        self
9779    }
9780
9781    /// Sets the value of [artifact_alias][crate::model::ArtifactDeployment::artifact_alias].
9782    ///
9783    /// # Example
9784    /// ```ignore,no_run
9785    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9786    /// let x = ArtifactDeployment::new().set_artifact_alias("example");
9787    /// ```
9788    pub fn set_artifact_alias<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9789        self.artifact_alias = v.into();
9790        self
9791    }
9792
9793    /// Sets the value of [source_commit_uris][crate::model::ArtifactDeployment::source_commit_uris].
9794    ///
9795    /// # Example
9796    /// ```ignore,no_run
9797    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9798    /// let x = ArtifactDeployment::new().set_source_commit_uris(["a", "b", "c"]);
9799    /// ```
9800    pub fn set_source_commit_uris<T, V>(mut self, v: T) -> Self
9801    where
9802        T: std::iter::IntoIterator<Item = V>,
9803        V: std::convert::Into<std::string::String>,
9804    {
9805        use std::iter::Iterator;
9806        self.source_commit_uris = v.into_iter().map(|i| i.into()).collect();
9807        self
9808    }
9809
9810    /// Sets the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
9811    ///
9812    /// # Example
9813    /// ```ignore,no_run
9814    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9815    /// use wkt::Timestamp;
9816    /// let x = ArtifactDeployment::new().set_deploy_time(Timestamp::default()/* use setters */);
9817    /// ```
9818    pub fn set_deploy_time<T>(mut self, v: T) -> Self
9819    where
9820        T: std::convert::Into<wkt::Timestamp>,
9821    {
9822        self.deploy_time = std::option::Option::Some(v.into());
9823        self
9824    }
9825
9826    /// Sets or clears the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
9827    ///
9828    /// # Example
9829    /// ```ignore,no_run
9830    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9831    /// use wkt::Timestamp;
9832    /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
9833    /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(None::<Timestamp>);
9834    /// ```
9835    pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9836    where
9837        T: std::convert::Into<wkt::Timestamp>,
9838    {
9839        self.deploy_time = v.map(|x| x.into());
9840        self
9841    }
9842
9843    /// Sets the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
9844    ///
9845    /// # Example
9846    /// ```ignore,no_run
9847    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9848    /// use wkt::Timestamp;
9849    /// let x = ArtifactDeployment::new().set_undeploy_time(Timestamp::default()/* use setters */);
9850    /// ```
9851    pub fn set_undeploy_time<T>(mut self, v: T) -> Self
9852    where
9853        T: std::convert::Into<wkt::Timestamp>,
9854    {
9855        self.undeploy_time = std::option::Option::Some(v.into());
9856        self
9857    }
9858
9859    /// Sets or clears the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
9860    ///
9861    /// # Example
9862    /// ```ignore,no_run
9863    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9864    /// use wkt::Timestamp;
9865    /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
9866    /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(None::<Timestamp>);
9867    /// ```
9868    pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9869    where
9870        T: std::convert::Into<wkt::Timestamp>,
9871    {
9872        self.undeploy_time = v.map(|x| x.into());
9873        self
9874    }
9875
9876    /// Sets the value of [container_status_summary][crate::model::ArtifactDeployment::container_status_summary].
9877    ///
9878    /// # Example
9879    /// ```ignore,no_run
9880    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9881    /// let x = ArtifactDeployment::new().set_container_status_summary("example");
9882    /// ```
9883    pub fn set_container_status_summary<T: std::convert::Into<std::string::String>>(
9884        mut self,
9885        v: T,
9886    ) -> Self {
9887        self.container_status_summary = v.into();
9888        self
9889    }
9890}
9891
9892impl wkt::message::Message for ArtifactDeployment {
9893    fn typename() -> &'static str {
9894        "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactDeployment"
9895    }
9896}
9897
9898/// Request for creating an InsightsConfig.
9899#[derive(Clone, Default, PartialEq)]
9900#[non_exhaustive]
9901pub struct CreateInsightsConfigRequest {
9902    /// Required. Value for parent.
9903    pub parent: std::string::String,
9904
9905    /// Required. ID of the requesting InsightsConfig.
9906    pub insights_config_id: std::string::String,
9907
9908    /// Required. The resource being created.
9909    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
9910
9911    /// Optional. If set, validate the request, but do not actually post it.
9912    pub validate_only: bool,
9913
9914    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9915}
9916
9917impl CreateInsightsConfigRequest {
9918    pub fn new() -> Self {
9919        std::default::Default::default()
9920    }
9921
9922    /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
9923    ///
9924    /// # Example
9925    /// ```ignore,no_run
9926    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9927    /// let x = CreateInsightsConfigRequest::new().set_parent("example");
9928    /// ```
9929    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9930        self.parent = v.into();
9931        self
9932    }
9933
9934    /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
9935    ///
9936    /// # Example
9937    /// ```ignore,no_run
9938    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9939    /// let x = CreateInsightsConfigRequest::new().set_insights_config_id("example");
9940    /// ```
9941    pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
9942        mut self,
9943        v: T,
9944    ) -> Self {
9945        self.insights_config_id = v.into();
9946        self
9947    }
9948
9949    /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
9950    ///
9951    /// # Example
9952    /// ```ignore,no_run
9953    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9954    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
9955    /// let x = CreateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
9956    /// ```
9957    pub fn set_insights_config<T>(mut self, v: T) -> Self
9958    where
9959        T: std::convert::Into<crate::model::InsightsConfig>,
9960    {
9961        self.insights_config = std::option::Option::Some(v.into());
9962        self
9963    }
9964
9965    /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
9966    ///
9967    /// # Example
9968    /// ```ignore,no_run
9969    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9970    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
9971    /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
9972    /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
9973    /// ```
9974    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
9975    where
9976        T: std::convert::Into<crate::model::InsightsConfig>,
9977    {
9978        self.insights_config = v.map(|x| x.into());
9979        self
9980    }
9981
9982    /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
9983    ///
9984    /// # Example
9985    /// ```ignore,no_run
9986    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9987    /// let x = CreateInsightsConfigRequest::new().set_validate_only(true);
9988    /// ```
9989    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9990        self.validate_only = v.into();
9991        self
9992    }
9993}
9994
9995impl wkt::message::Message for CreateInsightsConfigRequest {
9996    fn typename() -> &'static str {
9997        "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
9998    }
9999}
10000
10001/// Request for getting an InsightsConfig.
10002#[derive(Clone, Default, PartialEq)]
10003#[non_exhaustive]
10004pub struct GetInsightsConfigRequest {
10005    /// Required. Name of the resource.
10006    pub name: std::string::String,
10007
10008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10009}
10010
10011impl GetInsightsConfigRequest {
10012    pub fn new() -> Self {
10013        std::default::Default::default()
10014    }
10015
10016    /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
10017    ///
10018    /// # Example
10019    /// ```ignore,no_run
10020    /// # use google_cloud_developerconnect_v1::model::GetInsightsConfigRequest;
10021    /// let x = GetInsightsConfigRequest::new().set_name("example");
10022    /// ```
10023    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10024        self.name = v.into();
10025        self
10026    }
10027}
10028
10029impl wkt::message::Message for GetInsightsConfigRequest {
10030    fn typename() -> &'static str {
10031        "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
10032    }
10033}
10034
10035/// Request for requesting list of InsightsConfigs.
10036#[derive(Clone, Default, PartialEq)]
10037#[non_exhaustive]
10038pub struct ListInsightsConfigsRequest {
10039    /// Required. Parent value for ListInsightsConfigsRequest.
10040    pub parent: std::string::String,
10041
10042    /// Optional. Requested page size. Server may return fewer items than
10043    /// requested. If unspecified, server will pick an appropriate default.
10044    pub page_size: i32,
10045
10046    /// Optional. A token identifying a page of results the server should return.
10047    pub page_token: std::string::String,
10048
10049    /// Optional. Filtering results. See <https://google.aip.dev/160> for more
10050    /// details. Filter string, adhering to the rules in
10051    /// <https://google.aip.dev/160>. List only InsightsConfigs matching the filter.
10052    /// If filter is empty, all InsightsConfigs are listed.
10053    pub filter: std::string::String,
10054
10055    /// Optional. Hint for how to order the results.
10056    pub order_by: std::string::String,
10057
10058    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10059}
10060
10061impl ListInsightsConfigsRequest {
10062    pub fn new() -> Self {
10063        std::default::Default::default()
10064    }
10065
10066    /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
10067    ///
10068    /// # Example
10069    /// ```ignore,no_run
10070    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10071    /// let x = ListInsightsConfigsRequest::new().set_parent("example");
10072    /// ```
10073    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10074        self.parent = v.into();
10075        self
10076    }
10077
10078    /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
10079    ///
10080    /// # Example
10081    /// ```ignore,no_run
10082    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10083    /// let x = ListInsightsConfigsRequest::new().set_page_size(42);
10084    /// ```
10085    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10086        self.page_size = v.into();
10087        self
10088    }
10089
10090    /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
10091    ///
10092    /// # Example
10093    /// ```ignore,no_run
10094    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10095    /// let x = ListInsightsConfigsRequest::new().set_page_token("example");
10096    /// ```
10097    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10098        self.page_token = v.into();
10099        self
10100    }
10101
10102    /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
10103    ///
10104    /// # Example
10105    /// ```ignore,no_run
10106    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10107    /// let x = ListInsightsConfigsRequest::new().set_filter("example");
10108    /// ```
10109    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10110        self.filter = v.into();
10111        self
10112    }
10113
10114    /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
10115    ///
10116    /// # Example
10117    /// ```ignore,no_run
10118    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10119    /// let x = ListInsightsConfigsRequest::new().set_order_by("example");
10120    /// ```
10121    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10122        self.order_by = v.into();
10123        self
10124    }
10125}
10126
10127impl wkt::message::Message for ListInsightsConfigsRequest {
10128    fn typename() -> &'static str {
10129        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
10130    }
10131}
10132
10133/// Request for response to listing InsightsConfigs.
10134#[derive(Clone, Default, PartialEq)]
10135#[non_exhaustive]
10136pub struct ListInsightsConfigsResponse {
10137    /// The list of InsightsConfigs.
10138    pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
10139
10140    /// A token identifying a page of results the server should return.
10141    pub next_page_token: std::string::String,
10142
10143    /// Locations that could not be reached.
10144    pub unreachable: std::vec::Vec<std::string::String>,
10145
10146    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10147}
10148
10149impl ListInsightsConfigsResponse {
10150    pub fn new() -> Self {
10151        std::default::Default::default()
10152    }
10153
10154    /// Sets the value of [insights_configs][crate::model::ListInsightsConfigsResponse::insights_configs].
10155    ///
10156    /// # Example
10157    /// ```ignore,no_run
10158    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10159    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10160    /// let x = ListInsightsConfigsResponse::new()
10161    ///     .set_insights_configs([
10162    ///         InsightsConfig::default()/* use setters */,
10163    ///         InsightsConfig::default()/* use (different) setters */,
10164    ///     ]);
10165    /// ```
10166    pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
10167    where
10168        T: std::iter::IntoIterator<Item = V>,
10169        V: std::convert::Into<crate::model::InsightsConfig>,
10170    {
10171        use std::iter::Iterator;
10172        self.insights_configs = v.into_iter().map(|i| i.into()).collect();
10173        self
10174    }
10175
10176    /// Sets the value of [next_page_token][crate::model::ListInsightsConfigsResponse::next_page_token].
10177    ///
10178    /// # Example
10179    /// ```ignore,no_run
10180    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10181    /// let x = ListInsightsConfigsResponse::new().set_next_page_token("example");
10182    /// ```
10183    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10184        self.next_page_token = v.into();
10185        self
10186    }
10187
10188    /// Sets the value of [unreachable][crate::model::ListInsightsConfigsResponse::unreachable].
10189    ///
10190    /// # Example
10191    /// ```ignore,no_run
10192    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10193    /// let x = ListInsightsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
10194    /// ```
10195    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10196    where
10197        T: std::iter::IntoIterator<Item = V>,
10198        V: std::convert::Into<std::string::String>,
10199    {
10200        use std::iter::Iterator;
10201        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10202        self
10203    }
10204}
10205
10206impl wkt::message::Message for ListInsightsConfigsResponse {
10207    fn typename() -> &'static str {
10208        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
10209    }
10210}
10211
10212#[doc(hidden)]
10213impl google_cloud_gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
10214    type PageItem = crate::model::InsightsConfig;
10215
10216    fn items(self) -> std::vec::Vec<Self::PageItem> {
10217        self.insights_configs
10218    }
10219
10220    fn next_page_token(&self) -> std::string::String {
10221        use std::clone::Clone;
10222        self.next_page_token.clone()
10223    }
10224}
10225
10226/// Request for deleting an InsightsConfig.
10227#[derive(Clone, Default, PartialEq)]
10228#[non_exhaustive]
10229pub struct DeleteInsightsConfigRequest {
10230    /// Required. Value for parent.
10231    pub name: std::string::String,
10232
10233    /// Optional. An optional request ID to identify requests. Specify a unique
10234    /// request ID so that if you must retry your request, the server will know to
10235    /// ignore the request if it has already been completed. The server will
10236    /// guarantee that for at least 60 minutes after the first request.
10237    ///
10238    /// For example, consider a situation where you make an initial request and the
10239    /// request times out. If you make the request again with the same request
10240    /// ID, the server can check if original operation with the same request ID
10241    /// was received, and if so, will ignore the second request. This prevents
10242    /// clients from accidentally creating duplicate commitments.
10243    ///
10244    /// The request ID must be a valid UUID with the exception that zero UUID is
10245    /// not supported (00000000-0000-0000-0000-000000000000).
10246    pub request_id: std::string::String,
10247
10248    /// Optional. If set, validate the request, but do not actually post it.
10249    pub validate_only: bool,
10250
10251    /// Optional. This checksum is computed by the server based on the value of
10252    /// other fields, and may be sent on update and delete requests to ensure the
10253    /// client has an up-to-date value before proceeding.
10254    pub etag: std::string::String,
10255
10256    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10257}
10258
10259impl DeleteInsightsConfigRequest {
10260    pub fn new() -> Self {
10261        std::default::Default::default()
10262    }
10263
10264    /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
10265    ///
10266    /// # Example
10267    /// ```ignore,no_run
10268    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10269    /// let x = DeleteInsightsConfigRequest::new().set_name("example");
10270    /// ```
10271    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10272        self.name = v.into();
10273        self
10274    }
10275
10276    /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
10277    ///
10278    /// # Example
10279    /// ```ignore,no_run
10280    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10281    /// let x = DeleteInsightsConfigRequest::new().set_request_id("example");
10282    /// ```
10283    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10284        self.request_id = v.into();
10285        self
10286    }
10287
10288    /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
10289    ///
10290    /// # Example
10291    /// ```ignore,no_run
10292    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10293    /// let x = DeleteInsightsConfigRequest::new().set_validate_only(true);
10294    /// ```
10295    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10296        self.validate_only = v.into();
10297        self
10298    }
10299
10300    /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
10301    ///
10302    /// # Example
10303    /// ```ignore,no_run
10304    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10305    /// let x = DeleteInsightsConfigRequest::new().set_etag("example");
10306    /// ```
10307    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10308        self.etag = v.into();
10309        self
10310    }
10311}
10312
10313impl wkt::message::Message for DeleteInsightsConfigRequest {
10314    fn typename() -> &'static str {
10315        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
10316    }
10317}
10318
10319/// Request for updating an InsightsConfig.
10320#[derive(Clone, Default, PartialEq)]
10321#[non_exhaustive]
10322pub struct UpdateInsightsConfigRequest {
10323    /// Required. The resource being updated.
10324    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
10325
10326    /// Optional. An optional request ID to identify requests. Specify a unique
10327    /// request ID so that if you must retry your request, the server will know to
10328    /// ignore the request if it has already been completed. The server will
10329    /// guarantee that for at least 60 minutes after the first request.
10330    ///
10331    /// For example, consider a situation where you make an initial request and the
10332    /// request times out. If you make the request again with the same request
10333    /// ID, the server can check if original operation with the same request ID
10334    /// was received, and if so, will ignore the second request. This prevents
10335    /// clients from accidentally creating duplicate commitments.
10336    ///
10337    /// The request ID must be a valid UUID with the exception that zero UUID is
10338    /// not supported (00000000-0000-0000-0000-000000000000).
10339    pub request_id: std::string::String,
10340
10341    /// Optional. If set to true, and the insightsConfig is not found a new
10342    /// insightsConfig will be created. In this situation `update_mask` is ignored.
10343    /// The creation will succeed only if the input insightsConfig has all the
10344    /// necessary information (e.g a github_config with both  user_oauth_token and
10345    /// installation_id properties).
10346    pub allow_missing: bool,
10347
10348    /// Optional. If set, validate the request, but do not actually post it.
10349    pub validate_only: bool,
10350
10351    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10352}
10353
10354impl UpdateInsightsConfigRequest {
10355    pub fn new() -> Self {
10356        std::default::Default::default()
10357    }
10358
10359    /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
10360    ///
10361    /// # Example
10362    /// ```ignore,no_run
10363    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10364    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10365    /// let x = UpdateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
10366    /// ```
10367    pub fn set_insights_config<T>(mut self, v: T) -> Self
10368    where
10369        T: std::convert::Into<crate::model::InsightsConfig>,
10370    {
10371        self.insights_config = std::option::Option::Some(v.into());
10372        self
10373    }
10374
10375    /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
10376    ///
10377    /// # Example
10378    /// ```ignore,no_run
10379    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10380    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10381    /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
10382    /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
10383    /// ```
10384    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
10385    where
10386        T: std::convert::Into<crate::model::InsightsConfig>,
10387    {
10388        self.insights_config = v.map(|x| x.into());
10389        self
10390    }
10391
10392    /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
10393    ///
10394    /// # Example
10395    /// ```ignore,no_run
10396    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10397    /// let x = UpdateInsightsConfigRequest::new().set_request_id("example");
10398    /// ```
10399    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10400        self.request_id = v.into();
10401        self
10402    }
10403
10404    /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
10405    ///
10406    /// # Example
10407    /// ```ignore,no_run
10408    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10409    /// let x = UpdateInsightsConfigRequest::new().set_allow_missing(true);
10410    /// ```
10411    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10412        self.allow_missing = v.into();
10413        self
10414    }
10415
10416    /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
10417    ///
10418    /// # Example
10419    /// ```ignore,no_run
10420    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10421    /// let x = UpdateInsightsConfigRequest::new().set_validate_only(true);
10422    /// ```
10423    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10424        self.validate_only = v.into();
10425        self
10426    }
10427}
10428
10429impl wkt::message::Message for UpdateInsightsConfigRequest {
10430    fn typename() -> &'static str {
10431        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
10432    }
10433}
10434
10435/// SystemProvider is a list of providers that are owned by Developer Connect.
10436///
10437/// # Working with unknown values
10438///
10439/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10440/// additional enum variants at any time. Adding new variants is not considered
10441/// a breaking change. Applications should write their code in anticipation of:
10442///
10443/// - New values appearing in future releases of the client library, **and**
10444/// - New values received dynamically, without application changes.
10445///
10446/// Please consult the [Working with enums] section in the user guide for some
10447/// guidelines.
10448///
10449/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10450#[derive(Clone, Debug, PartialEq)]
10451#[non_exhaustive]
10452pub enum SystemProvider {
10453    /// No system provider specified.
10454    Unspecified,
10455    /// GitHub provider.
10456    /// Scopes can be found at
10457    /// <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes>
10458    Github,
10459    /// GitLab provider.
10460    /// Scopes can be found at
10461    /// <https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes>
10462    Gitlab,
10463    /// Google provider.
10464    /// Recommended scopes:
10465    /// `https://www.googleapis.com/auth/drive.readonly`,
10466    /// `https://www.googleapis.com/auth/documents.readonly`
10467    Google,
10468    /// Sentry provider.
10469    /// Scopes can be found at
10470    /// <https://docs.sentry.io/api/permissions/>
10471    Sentry,
10472    /// Rovo provider.
10473    /// Must select the "rovo" scope.
10474    Rovo,
10475    /// New Relic provider.
10476    /// No scopes are allowed.
10477    NewRelic,
10478    /// Datastax provider.
10479    /// No scopes are allowed.
10480    Datastax,
10481    /// Dynatrace provider.
10482    Dynatrace,
10483    /// If set, the enum was initialized with an unknown value.
10484    ///
10485    /// Applications can examine the value using [SystemProvider::value] or
10486    /// [SystemProvider::name].
10487    UnknownValue(system_provider::UnknownValue),
10488}
10489
10490#[doc(hidden)]
10491pub mod system_provider {
10492    #[allow(unused_imports)]
10493    use super::*;
10494    #[derive(Clone, Debug, PartialEq)]
10495    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10496}
10497
10498impl SystemProvider {
10499    /// Gets the enum value.
10500    ///
10501    /// Returns `None` if the enum contains an unknown value deserialized from
10502    /// the string representation of enums.
10503    pub fn value(&self) -> std::option::Option<i32> {
10504        match self {
10505            Self::Unspecified => std::option::Option::Some(0),
10506            Self::Github => std::option::Option::Some(1),
10507            Self::Gitlab => std::option::Option::Some(2),
10508            Self::Google => std::option::Option::Some(3),
10509            Self::Sentry => std::option::Option::Some(4),
10510            Self::Rovo => std::option::Option::Some(5),
10511            Self::NewRelic => std::option::Option::Some(6),
10512            Self::Datastax => std::option::Option::Some(7),
10513            Self::Dynatrace => std::option::Option::Some(8),
10514            Self::UnknownValue(u) => u.0.value(),
10515        }
10516    }
10517
10518    /// Gets the enum value as a string.
10519    ///
10520    /// Returns `None` if the enum contains an unknown value deserialized from
10521    /// the integer representation of enums.
10522    pub fn name(&self) -> std::option::Option<&str> {
10523        match self {
10524            Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
10525            Self::Github => std::option::Option::Some("GITHUB"),
10526            Self::Gitlab => std::option::Option::Some("GITLAB"),
10527            Self::Google => std::option::Option::Some("GOOGLE"),
10528            Self::Sentry => std::option::Option::Some("SENTRY"),
10529            Self::Rovo => std::option::Option::Some("ROVO"),
10530            Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
10531            Self::Datastax => std::option::Option::Some("DATASTAX"),
10532            Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
10533            Self::UnknownValue(u) => u.0.name(),
10534        }
10535    }
10536}
10537
10538impl std::default::Default for SystemProvider {
10539    fn default() -> Self {
10540        use std::convert::From;
10541        Self::from(0)
10542    }
10543}
10544
10545impl std::fmt::Display for SystemProvider {
10546    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10547        wkt::internal::display_enum(f, self.name(), self.value())
10548    }
10549}
10550
10551impl std::convert::From<i32> for SystemProvider {
10552    fn from(value: i32) -> Self {
10553        match value {
10554            0 => Self::Unspecified,
10555            1 => Self::Github,
10556            2 => Self::Gitlab,
10557            3 => Self::Google,
10558            4 => Self::Sentry,
10559            5 => Self::Rovo,
10560            6 => Self::NewRelic,
10561            7 => Self::Datastax,
10562            8 => Self::Dynatrace,
10563            _ => Self::UnknownValue(system_provider::UnknownValue(
10564                wkt::internal::UnknownEnumValue::Integer(value),
10565            )),
10566        }
10567    }
10568}
10569
10570impl std::convert::From<&str> for SystemProvider {
10571    fn from(value: &str) -> Self {
10572        use std::string::ToString;
10573        match value {
10574            "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
10575            "GITHUB" => Self::Github,
10576            "GITLAB" => Self::Gitlab,
10577            "GOOGLE" => Self::Google,
10578            "SENTRY" => Self::Sentry,
10579            "ROVO" => Self::Rovo,
10580            "NEW_RELIC" => Self::NewRelic,
10581            "DATASTAX" => Self::Datastax,
10582            "DYNATRACE" => Self::Dynatrace,
10583            _ => Self::UnknownValue(system_provider::UnknownValue(
10584                wkt::internal::UnknownEnumValue::String(value.to_string()),
10585            )),
10586        }
10587    }
10588}
10589
10590impl serde::ser::Serialize for SystemProvider {
10591    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10592    where
10593        S: serde::Serializer,
10594    {
10595        match self {
10596            Self::Unspecified => serializer.serialize_i32(0),
10597            Self::Github => serializer.serialize_i32(1),
10598            Self::Gitlab => serializer.serialize_i32(2),
10599            Self::Google => serializer.serialize_i32(3),
10600            Self::Sentry => serializer.serialize_i32(4),
10601            Self::Rovo => serializer.serialize_i32(5),
10602            Self::NewRelic => serializer.serialize_i32(6),
10603            Self::Datastax => serializer.serialize_i32(7),
10604            Self::Dynatrace => serializer.serialize_i32(8),
10605            Self::UnknownValue(u) => u.0.serialize(serializer),
10606        }
10607    }
10608}
10609
10610impl<'de> serde::de::Deserialize<'de> for SystemProvider {
10611    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10612    where
10613        D: serde::Deserializer<'de>,
10614    {
10615        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
10616            ".google.cloud.developerconnect.v1.SystemProvider",
10617        ))
10618    }
10619}