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 lazy_static;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Message for requesting a list of Users
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ListUsersRequest {
44    /// Required. Parent value for ListUsersRequest
45    pub parent: std::string::String,
46
47    /// Optional. Requested page size. Server may return fewer items than
48    /// requested. If unspecified, server will pick an appropriate default.
49    pub page_size: i32,
50
51    /// Optional. A token identifying a page of results the server should return.
52    pub page_token: std::string::String,
53
54    /// Optional. Filtering results
55    pub filter: std::string::String,
56
57    /// Optional. Hint for how to order the results
58    pub order_by: std::string::String,
59
60    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl ListUsersRequest {
64    pub fn new() -> Self {
65        std::default::Default::default()
66    }
67
68    /// Sets the value of [parent][crate::model::ListUsersRequest::parent].
69    ///
70    /// # Example
71    /// ```ignore,no_run
72    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
73    /// let x = ListUsersRequest::new().set_parent("example");
74    /// ```
75    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76        self.parent = v.into();
77        self
78    }
79
80    /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
81    ///
82    /// # Example
83    /// ```ignore,no_run
84    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
85    /// let x = ListUsersRequest::new().set_page_size(42);
86    /// ```
87    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
88        self.page_size = v.into();
89        self
90    }
91
92    /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
93    ///
94    /// # Example
95    /// ```ignore,no_run
96    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
97    /// let x = ListUsersRequest::new().set_page_token("example");
98    /// ```
99    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100        self.page_token = v.into();
101        self
102    }
103
104    /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
105    ///
106    /// # Example
107    /// ```ignore,no_run
108    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
109    /// let x = ListUsersRequest::new().set_filter("example");
110    /// ```
111    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
112        self.filter = v.into();
113        self
114    }
115
116    /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
117    ///
118    /// # Example
119    /// ```ignore,no_run
120    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
121    /// let x = ListUsersRequest::new().set_order_by("example");
122    /// ```
123    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
124        self.order_by = v.into();
125        self
126    }
127}
128
129impl wkt::message::Message for ListUsersRequest {
130    fn typename() -> &'static str {
131        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
132    }
133}
134
135/// Message for response to listing Users
136#[derive(Clone, Default, PartialEq)]
137#[non_exhaustive]
138pub struct ListUsersResponse {
139    /// The list of Users
140    pub users: std::vec::Vec<crate::model::User>,
141
142    /// A token identifying a page of results the server should return.
143    pub next_page_token: std::string::String,
144
145    /// Locations that could not be reached.
146    pub unreachable: std::vec::Vec<std::string::String>,
147
148    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
149}
150
151impl ListUsersResponse {
152    pub fn new() -> Self {
153        std::default::Default::default()
154    }
155
156    /// Sets the value of [users][crate::model::ListUsersResponse::users].
157    ///
158    /// # Example
159    /// ```ignore,no_run
160    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
161    /// use google_cloud_developerconnect_v1::model::User;
162    /// let x = ListUsersResponse::new()
163    ///     .set_users([
164    ///         User::default()/* use setters */,
165    ///         User::default()/* use (different) setters */,
166    ///     ]);
167    /// ```
168    pub fn set_users<T, V>(mut self, v: T) -> Self
169    where
170        T: std::iter::IntoIterator<Item = V>,
171        V: std::convert::Into<crate::model::User>,
172    {
173        use std::iter::Iterator;
174        self.users = v.into_iter().map(|i| i.into()).collect();
175        self
176    }
177
178    /// Sets the value of [next_page_token][crate::model::ListUsersResponse::next_page_token].
179    ///
180    /// # Example
181    /// ```ignore,no_run
182    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
183    /// let x = ListUsersResponse::new().set_next_page_token("example");
184    /// ```
185    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
186        self.next_page_token = v.into();
187        self
188    }
189
190    /// Sets the value of [unreachable][crate::model::ListUsersResponse::unreachable].
191    ///
192    /// # Example
193    /// ```ignore,no_run
194    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
195    /// let x = ListUsersResponse::new().set_unreachable(["a", "b", "c"]);
196    /// ```
197    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
198    where
199        T: std::iter::IntoIterator<Item = V>,
200        V: std::convert::Into<std::string::String>,
201    {
202        use std::iter::Iterator;
203        self.unreachable = v.into_iter().map(|i| i.into()).collect();
204        self
205    }
206}
207
208impl wkt::message::Message for ListUsersResponse {
209    fn typename() -> &'static str {
210        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
211    }
212}
213
214#[doc(hidden)]
215impl google_cloud_gax::paginator::internal::PageableResponse for ListUsersResponse {
216    type PageItem = crate::model::User;
217
218    fn items(self) -> std::vec::Vec<Self::PageItem> {
219        self.users
220    }
221
222    fn next_page_token(&self) -> std::string::String {
223        use std::clone::Clone;
224        self.next_page_token.clone()
225    }
226}
227
228/// Message describing Connection object
229#[derive(Clone, Default, PartialEq)]
230#[non_exhaustive]
231pub struct Connection {
232    /// Identifier. The resource name of the connection, in the format
233    /// `projects/{project}/locations/{location}/connections/{connection_id}`.
234    pub name: std::string::String,
235
236    /// Output only. [Output only] Create timestamp
237    pub create_time: std::option::Option<wkt::Timestamp>,
238
239    /// Output only. [Output only] Update timestamp
240    pub update_time: std::option::Option<wkt::Timestamp>,
241
242    /// Output only. [Output only] Delete timestamp
243    pub delete_time: std::option::Option<wkt::Timestamp>,
244
245    /// Optional. Labels as key value pairs
246    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
247
248    /// Output only. Installation state of the Connection.
249    pub installation_state: std::option::Option<crate::model::InstallationState>,
250
251    /// Optional. If disabled is set to true, functionality is disabled for this
252    /// connection. Repository based API methods and webhooks processing for
253    /// repositories in this connection will be disabled.
254    pub disabled: bool,
255
256    /// Output only. Set to true when the connection is being set up or updated in
257    /// the background.
258    pub reconciling: bool,
259
260    /// Optional. Allows clients to store small amounts of arbitrary data.
261    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
262
263    /// Optional. This checksum is computed by the server based on the value of
264    /// other fields, and may be sent on update and delete requests to ensure the
265    /// client has an up-to-date value before proceeding.
266    pub etag: std::string::String,
267
268    /// Output only. A system-assigned unique identifier for the Connection.
269    pub uid: std::string::String,
270
271    /// Optional. The crypto key configuration. This field is used by the
272    /// Customer-Managed Encryption Keys (CMEK) feature.
273    pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
274
275    /// Optional. Configuration for the git proxy feature. Enabling the git proxy
276    /// allows clients to perform git operations on the repositories linked in the
277    /// connection.
278    pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
279
280    /// Configuration for the connection depending on the type of provider.
281    pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
282
283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
284}
285
286impl Connection {
287    pub fn new() -> Self {
288        std::default::Default::default()
289    }
290
291    /// Sets the value of [name][crate::model::Connection::name].
292    ///
293    /// # Example
294    /// ```ignore,no_run
295    /// # use google_cloud_developerconnect_v1::model::Connection;
296    /// let x = Connection::new().set_name("example");
297    /// ```
298    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
299        self.name = v.into();
300        self
301    }
302
303    /// Sets the value of [create_time][crate::model::Connection::create_time].
304    ///
305    /// # Example
306    /// ```ignore,no_run
307    /// # use google_cloud_developerconnect_v1::model::Connection;
308    /// use wkt::Timestamp;
309    /// let x = Connection::new().set_create_time(Timestamp::default()/* use setters */);
310    /// ```
311    pub fn set_create_time<T>(mut self, v: T) -> Self
312    where
313        T: std::convert::Into<wkt::Timestamp>,
314    {
315        self.create_time = std::option::Option::Some(v.into());
316        self
317    }
318
319    /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
320    ///
321    /// # Example
322    /// ```ignore,no_run
323    /// # use google_cloud_developerconnect_v1::model::Connection;
324    /// use wkt::Timestamp;
325    /// let x = Connection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
326    /// let x = Connection::new().set_or_clear_create_time(None::<Timestamp>);
327    /// ```
328    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
329    where
330        T: std::convert::Into<wkt::Timestamp>,
331    {
332        self.create_time = v.map(|x| x.into());
333        self
334    }
335
336    /// Sets the value of [update_time][crate::model::Connection::update_time].
337    ///
338    /// # Example
339    /// ```ignore,no_run
340    /// # use google_cloud_developerconnect_v1::model::Connection;
341    /// use wkt::Timestamp;
342    /// let x = Connection::new().set_update_time(Timestamp::default()/* use setters */);
343    /// ```
344    pub fn set_update_time<T>(mut self, v: T) -> Self
345    where
346        T: std::convert::Into<wkt::Timestamp>,
347    {
348        self.update_time = std::option::Option::Some(v.into());
349        self
350    }
351
352    /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
353    ///
354    /// # Example
355    /// ```ignore,no_run
356    /// # use google_cloud_developerconnect_v1::model::Connection;
357    /// use wkt::Timestamp;
358    /// let x = Connection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
359    /// let x = Connection::new().set_or_clear_update_time(None::<Timestamp>);
360    /// ```
361    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
362    where
363        T: std::convert::Into<wkt::Timestamp>,
364    {
365        self.update_time = v.map(|x| x.into());
366        self
367    }
368
369    /// Sets the value of [delete_time][crate::model::Connection::delete_time].
370    ///
371    /// # Example
372    /// ```ignore,no_run
373    /// # use google_cloud_developerconnect_v1::model::Connection;
374    /// use wkt::Timestamp;
375    /// let x = Connection::new().set_delete_time(Timestamp::default()/* use setters */);
376    /// ```
377    pub fn set_delete_time<T>(mut self, v: T) -> Self
378    where
379        T: std::convert::Into<wkt::Timestamp>,
380    {
381        self.delete_time = std::option::Option::Some(v.into());
382        self
383    }
384
385    /// Sets or clears the value of [delete_time][crate::model::Connection::delete_time].
386    ///
387    /// # Example
388    /// ```ignore,no_run
389    /// # use google_cloud_developerconnect_v1::model::Connection;
390    /// use wkt::Timestamp;
391    /// let x = Connection::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
392    /// let x = Connection::new().set_or_clear_delete_time(None::<Timestamp>);
393    /// ```
394    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
395    where
396        T: std::convert::Into<wkt::Timestamp>,
397    {
398        self.delete_time = v.map(|x| x.into());
399        self
400    }
401
402    /// Sets the value of [labels][crate::model::Connection::labels].
403    ///
404    /// # Example
405    /// ```ignore,no_run
406    /// # use google_cloud_developerconnect_v1::model::Connection;
407    /// let x = Connection::new().set_labels([
408    ///     ("key0", "abc"),
409    ///     ("key1", "xyz"),
410    /// ]);
411    /// ```
412    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
413    where
414        T: std::iter::IntoIterator<Item = (K, V)>,
415        K: std::convert::Into<std::string::String>,
416        V: std::convert::Into<std::string::String>,
417    {
418        use std::iter::Iterator;
419        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
420        self
421    }
422
423    /// Sets the value of [installation_state][crate::model::Connection::installation_state].
424    ///
425    /// # Example
426    /// ```ignore,no_run
427    /// # use google_cloud_developerconnect_v1::model::Connection;
428    /// use google_cloud_developerconnect_v1::model::InstallationState;
429    /// let x = Connection::new().set_installation_state(InstallationState::default()/* use setters */);
430    /// ```
431    pub fn set_installation_state<T>(mut self, v: T) -> Self
432    where
433        T: std::convert::Into<crate::model::InstallationState>,
434    {
435        self.installation_state = std::option::Option::Some(v.into());
436        self
437    }
438
439    /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
440    ///
441    /// # Example
442    /// ```ignore,no_run
443    /// # use google_cloud_developerconnect_v1::model::Connection;
444    /// use google_cloud_developerconnect_v1::model::InstallationState;
445    /// let x = Connection::new().set_or_clear_installation_state(Some(InstallationState::default()/* use setters */));
446    /// let x = Connection::new().set_or_clear_installation_state(None::<InstallationState>);
447    /// ```
448    pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
449    where
450        T: std::convert::Into<crate::model::InstallationState>,
451    {
452        self.installation_state = v.map(|x| x.into());
453        self
454    }
455
456    /// Sets the value of [disabled][crate::model::Connection::disabled].
457    ///
458    /// # Example
459    /// ```ignore,no_run
460    /// # use google_cloud_developerconnect_v1::model::Connection;
461    /// let x = Connection::new().set_disabled(true);
462    /// ```
463    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
464        self.disabled = v.into();
465        self
466    }
467
468    /// Sets the value of [reconciling][crate::model::Connection::reconciling].
469    ///
470    /// # Example
471    /// ```ignore,no_run
472    /// # use google_cloud_developerconnect_v1::model::Connection;
473    /// let x = Connection::new().set_reconciling(true);
474    /// ```
475    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
476        self.reconciling = v.into();
477        self
478    }
479
480    /// Sets the value of [annotations][crate::model::Connection::annotations].
481    ///
482    /// # Example
483    /// ```ignore,no_run
484    /// # use google_cloud_developerconnect_v1::model::Connection;
485    /// let x = Connection::new().set_annotations([
486    ///     ("key0", "abc"),
487    ///     ("key1", "xyz"),
488    /// ]);
489    /// ```
490    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
491    where
492        T: std::iter::IntoIterator<Item = (K, V)>,
493        K: std::convert::Into<std::string::String>,
494        V: std::convert::Into<std::string::String>,
495    {
496        use std::iter::Iterator;
497        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
498        self
499    }
500
501    /// Sets the value of [etag][crate::model::Connection::etag].
502    ///
503    /// # Example
504    /// ```ignore,no_run
505    /// # use google_cloud_developerconnect_v1::model::Connection;
506    /// let x = Connection::new().set_etag("example");
507    /// ```
508    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
509        self.etag = v.into();
510        self
511    }
512
513    /// Sets the value of [uid][crate::model::Connection::uid].
514    ///
515    /// # Example
516    /// ```ignore,no_run
517    /// # use google_cloud_developerconnect_v1::model::Connection;
518    /// let x = Connection::new().set_uid("example");
519    /// ```
520    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
521        self.uid = v.into();
522        self
523    }
524
525    /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
526    ///
527    /// # Example
528    /// ```ignore,no_run
529    /// # use google_cloud_developerconnect_v1::model::Connection;
530    /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
531    /// let x = Connection::new().set_crypto_key_config(CryptoKeyConfig::default()/* use setters */);
532    /// ```
533    pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
534    where
535        T: std::convert::Into<crate::model::CryptoKeyConfig>,
536    {
537        self.crypto_key_config = std::option::Option::Some(v.into());
538        self
539    }
540
541    /// Sets or clears the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
542    ///
543    /// # Example
544    /// ```ignore,no_run
545    /// # use google_cloud_developerconnect_v1::model::Connection;
546    /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
547    /// let x = Connection::new().set_or_clear_crypto_key_config(Some(CryptoKeyConfig::default()/* use setters */));
548    /// let x = Connection::new().set_or_clear_crypto_key_config(None::<CryptoKeyConfig>);
549    /// ```
550    pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
551    where
552        T: std::convert::Into<crate::model::CryptoKeyConfig>,
553    {
554        self.crypto_key_config = v.map(|x| x.into());
555        self
556    }
557
558    /// Sets the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
559    ///
560    /// # Example
561    /// ```ignore,no_run
562    /// # use google_cloud_developerconnect_v1::model::Connection;
563    /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
564    /// let x = Connection::new().set_git_proxy_config(GitProxyConfig::default()/* use setters */);
565    /// ```
566    pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
567    where
568        T: std::convert::Into<crate::model::GitProxyConfig>,
569    {
570        self.git_proxy_config = std::option::Option::Some(v.into());
571        self
572    }
573
574    /// Sets or clears the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
575    ///
576    /// # Example
577    /// ```ignore,no_run
578    /// # use google_cloud_developerconnect_v1::model::Connection;
579    /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
580    /// let x = Connection::new().set_or_clear_git_proxy_config(Some(GitProxyConfig::default()/* use setters */));
581    /// let x = Connection::new().set_or_clear_git_proxy_config(None::<GitProxyConfig>);
582    /// ```
583    pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
584    where
585        T: std::convert::Into<crate::model::GitProxyConfig>,
586    {
587        self.git_proxy_config = v.map(|x| x.into());
588        self
589    }
590
591    /// Sets the value of [connection_config][crate::model::Connection::connection_config].
592    ///
593    /// Note that all the setters affecting `connection_config` are mutually
594    /// exclusive.
595    ///
596    /// # Example
597    /// ```ignore,no_run
598    /// # use google_cloud_developerconnect_v1::model::Connection;
599    /// use google_cloud_developerconnect_v1::model::GitHubConfig;
600    /// let x = Connection::new().set_connection_config(Some(
601    ///     google_cloud_developerconnect_v1::model::connection::ConnectionConfig::GithubConfig(GitHubConfig::default().into())));
602    /// ```
603    pub fn set_connection_config<
604        T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
605    >(
606        mut self,
607        v: T,
608    ) -> Self {
609        self.connection_config = v.into();
610        self
611    }
612
613    /// The value of [connection_config][crate::model::Connection::connection_config]
614    /// if it holds a `GithubConfig`, `None` if the field is not set or
615    /// holds a different branch.
616    pub fn github_config(
617        &self,
618    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
619        #[allow(unreachable_patterns)]
620        self.connection_config.as_ref().and_then(|v| match v {
621            crate::model::connection::ConnectionConfig::GithubConfig(v) => {
622                std::option::Option::Some(v)
623            }
624            _ => std::option::Option::None,
625        })
626    }
627
628    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
629    /// to hold a `GithubConfig`.
630    ///
631    /// Note that all the setters affecting `connection_config` are
632    /// mutually exclusive.
633    ///
634    /// # Example
635    /// ```ignore,no_run
636    /// # use google_cloud_developerconnect_v1::model::Connection;
637    /// use google_cloud_developerconnect_v1::model::GitHubConfig;
638    /// let x = Connection::new().set_github_config(GitHubConfig::default()/* use setters */);
639    /// assert!(x.github_config().is_some());
640    /// assert!(x.github_enterprise_config().is_none());
641    /// assert!(x.gitlab_config().is_none());
642    /// assert!(x.gitlab_enterprise_config().is_none());
643    /// assert!(x.bitbucket_data_center_config().is_none());
644    /// assert!(x.bitbucket_cloud_config().is_none());
645    /// assert!(x.secure_source_manager_instance_config().is_none());
646    /// assert!(x.http_config().is_none());
647    /// ```
648    pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
649        mut self,
650        v: T,
651    ) -> Self {
652        self.connection_config = std::option::Option::Some(
653            crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
654        );
655        self
656    }
657
658    /// The value of [connection_config][crate::model::Connection::connection_config]
659    /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
660    /// holds a different branch.
661    pub fn github_enterprise_config(
662        &self,
663    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
664        #[allow(unreachable_patterns)]
665        self.connection_config.as_ref().and_then(|v| match v {
666            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
667                std::option::Option::Some(v)
668            }
669            _ => std::option::Option::None,
670        })
671    }
672
673    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
674    /// to hold a `GithubEnterpriseConfig`.
675    ///
676    /// Note that all the setters affecting `connection_config` are
677    /// mutually exclusive.
678    ///
679    /// # Example
680    /// ```ignore,no_run
681    /// # use google_cloud_developerconnect_v1::model::Connection;
682    /// use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
683    /// let x = Connection::new().set_github_enterprise_config(GitHubEnterpriseConfig::default()/* use setters */);
684    /// assert!(x.github_enterprise_config().is_some());
685    /// assert!(x.github_config().is_none());
686    /// assert!(x.gitlab_config().is_none());
687    /// assert!(x.gitlab_enterprise_config().is_none());
688    /// assert!(x.bitbucket_data_center_config().is_none());
689    /// assert!(x.bitbucket_cloud_config().is_none());
690    /// assert!(x.secure_source_manager_instance_config().is_none());
691    /// assert!(x.http_config().is_none());
692    /// ```
693    pub fn set_github_enterprise_config<
694        T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
695    >(
696        mut self,
697        v: T,
698    ) -> Self {
699        self.connection_config = std::option::Option::Some(
700            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
701        );
702        self
703    }
704
705    /// The value of [connection_config][crate::model::Connection::connection_config]
706    /// if it holds a `GitlabConfig`, `None` if the field is not set or
707    /// holds a different branch.
708    pub fn gitlab_config(
709        &self,
710    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
711        #[allow(unreachable_patterns)]
712        self.connection_config.as_ref().and_then(|v| match v {
713            crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
714                std::option::Option::Some(v)
715            }
716            _ => std::option::Option::None,
717        })
718    }
719
720    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
721    /// to hold a `GitlabConfig`.
722    ///
723    /// Note that all the setters affecting `connection_config` are
724    /// mutually exclusive.
725    ///
726    /// # Example
727    /// ```ignore,no_run
728    /// # use google_cloud_developerconnect_v1::model::Connection;
729    /// use google_cloud_developerconnect_v1::model::GitLabConfig;
730    /// let x = Connection::new().set_gitlab_config(GitLabConfig::default()/* use setters */);
731    /// assert!(x.gitlab_config().is_some());
732    /// assert!(x.github_config().is_none());
733    /// assert!(x.github_enterprise_config().is_none());
734    /// assert!(x.gitlab_enterprise_config().is_none());
735    /// assert!(x.bitbucket_data_center_config().is_none());
736    /// assert!(x.bitbucket_cloud_config().is_none());
737    /// assert!(x.secure_source_manager_instance_config().is_none());
738    /// assert!(x.http_config().is_none());
739    /// ```
740    pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
741        mut self,
742        v: T,
743    ) -> Self {
744        self.connection_config = std::option::Option::Some(
745            crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
746        );
747        self
748    }
749
750    /// The value of [connection_config][crate::model::Connection::connection_config]
751    /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
752    /// holds a different branch.
753    pub fn gitlab_enterprise_config(
754        &self,
755    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
756        #[allow(unreachable_patterns)]
757        self.connection_config.as_ref().and_then(|v| match v {
758            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
759                std::option::Option::Some(v)
760            }
761            _ => std::option::Option::None,
762        })
763    }
764
765    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
766    /// to hold a `GitlabEnterpriseConfig`.
767    ///
768    /// Note that all the setters affecting `connection_config` are
769    /// mutually exclusive.
770    ///
771    /// # Example
772    /// ```ignore,no_run
773    /// # use google_cloud_developerconnect_v1::model::Connection;
774    /// use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
775    /// let x = Connection::new().set_gitlab_enterprise_config(GitLabEnterpriseConfig::default()/* use setters */);
776    /// assert!(x.gitlab_enterprise_config().is_some());
777    /// assert!(x.github_config().is_none());
778    /// assert!(x.github_enterprise_config().is_none());
779    /// assert!(x.gitlab_config().is_none());
780    /// assert!(x.bitbucket_data_center_config().is_none());
781    /// assert!(x.bitbucket_cloud_config().is_none());
782    /// assert!(x.secure_source_manager_instance_config().is_none());
783    /// assert!(x.http_config().is_none());
784    /// ```
785    pub fn set_gitlab_enterprise_config<
786        T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
787    >(
788        mut self,
789        v: T,
790    ) -> Self {
791        self.connection_config = std::option::Option::Some(
792            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
793        );
794        self
795    }
796
797    /// The value of [connection_config][crate::model::Connection::connection_config]
798    /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
799    /// holds a different branch.
800    pub fn bitbucket_data_center_config(
801        &self,
802    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
803        #[allow(unreachable_patterns)]
804        self.connection_config.as_ref().and_then(|v| match v {
805            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
806                std::option::Option::Some(v)
807            }
808            _ => std::option::Option::None,
809        })
810    }
811
812    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
813    /// to hold a `BitbucketDataCenterConfig`.
814    ///
815    /// Note that all the setters affecting `connection_config` are
816    /// mutually exclusive.
817    ///
818    /// # Example
819    /// ```ignore,no_run
820    /// # use google_cloud_developerconnect_v1::model::Connection;
821    /// use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
822    /// let x = Connection::new().set_bitbucket_data_center_config(BitbucketDataCenterConfig::default()/* use setters */);
823    /// assert!(x.bitbucket_data_center_config().is_some());
824    /// assert!(x.github_config().is_none());
825    /// assert!(x.github_enterprise_config().is_none());
826    /// assert!(x.gitlab_config().is_none());
827    /// assert!(x.gitlab_enterprise_config().is_none());
828    /// assert!(x.bitbucket_cloud_config().is_none());
829    /// assert!(x.secure_source_manager_instance_config().is_none());
830    /// assert!(x.http_config().is_none());
831    /// ```
832    pub fn set_bitbucket_data_center_config<
833        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
834    >(
835        mut self,
836        v: T,
837    ) -> Self {
838        self.connection_config = std::option::Option::Some(
839            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
840        );
841        self
842    }
843
844    /// The value of [connection_config][crate::model::Connection::connection_config]
845    /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
846    /// holds a different branch.
847    pub fn bitbucket_cloud_config(
848        &self,
849    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
850        #[allow(unreachable_patterns)]
851        self.connection_config.as_ref().and_then(|v| match v {
852            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
853                std::option::Option::Some(v)
854            }
855            _ => std::option::Option::None,
856        })
857    }
858
859    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
860    /// to hold a `BitbucketCloudConfig`.
861    ///
862    /// Note that all the setters affecting `connection_config` are
863    /// mutually exclusive.
864    ///
865    /// # Example
866    /// ```ignore,no_run
867    /// # use google_cloud_developerconnect_v1::model::Connection;
868    /// use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
869    /// let x = Connection::new().set_bitbucket_cloud_config(BitbucketCloudConfig::default()/* use setters */);
870    /// assert!(x.bitbucket_cloud_config().is_some());
871    /// assert!(x.github_config().is_none());
872    /// assert!(x.github_enterprise_config().is_none());
873    /// assert!(x.gitlab_config().is_none());
874    /// assert!(x.gitlab_enterprise_config().is_none());
875    /// assert!(x.bitbucket_data_center_config().is_none());
876    /// assert!(x.secure_source_manager_instance_config().is_none());
877    /// assert!(x.http_config().is_none());
878    /// ```
879    pub fn set_bitbucket_cloud_config<
880        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
881    >(
882        mut self,
883        v: T,
884    ) -> Self {
885        self.connection_config = std::option::Option::Some(
886            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
887        );
888        self
889    }
890
891    /// The value of [connection_config][crate::model::Connection::connection_config]
892    /// if it holds a `SecureSourceManagerInstanceConfig`, `None` if the field is not set or
893    /// holds a different branch.
894    pub fn secure_source_manager_instance_config(
895        &self,
896    ) -> std::option::Option<&std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>
897    {
898        #[allow(unreachable_patterns)]
899        self.connection_config.as_ref().and_then(|v| match v {
900            crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v) => {
901                std::option::Option::Some(v)
902            }
903            _ => std::option::Option::None,
904        })
905    }
906
907    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
908    /// to hold a `SecureSourceManagerInstanceConfig`.
909    ///
910    /// Note that all the setters affecting `connection_config` are
911    /// mutually exclusive.
912    ///
913    /// # Example
914    /// ```ignore,no_run
915    /// # use google_cloud_developerconnect_v1::model::Connection;
916    /// use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
917    /// let x = Connection::new().set_secure_source_manager_instance_config(SecureSourceManagerInstanceConfig::default()/* use setters */);
918    /// assert!(x.secure_source_manager_instance_config().is_some());
919    /// assert!(x.github_config().is_none());
920    /// assert!(x.github_enterprise_config().is_none());
921    /// assert!(x.gitlab_config().is_none());
922    /// assert!(x.gitlab_enterprise_config().is_none());
923    /// assert!(x.bitbucket_data_center_config().is_none());
924    /// assert!(x.bitbucket_cloud_config().is_none());
925    /// assert!(x.http_config().is_none());
926    /// ```
927    pub fn set_secure_source_manager_instance_config<
928        T: std::convert::Into<std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>,
929    >(
930        mut self,
931        v: T,
932    ) -> Self {
933        self.connection_config = std::option::Option::Some(
934            crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v.into()),
935        );
936        self
937    }
938
939    /// The value of [connection_config][crate::model::Connection::connection_config]
940    /// if it holds a `HttpConfig`, `None` if the field is not set or
941    /// holds a different branch.
942    pub fn http_config(
943        &self,
944    ) -> std::option::Option<&std::boxed::Box<crate::model::GenericHTTPEndpointConfig>> {
945        #[allow(unreachable_patterns)]
946        self.connection_config.as_ref().and_then(|v| match v {
947            crate::model::connection::ConnectionConfig::HttpConfig(v) => {
948                std::option::Option::Some(v)
949            }
950            _ => std::option::Option::None,
951        })
952    }
953
954    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
955    /// to hold a `HttpConfig`.
956    ///
957    /// Note that all the setters affecting `connection_config` are
958    /// mutually exclusive.
959    ///
960    /// # Example
961    /// ```ignore,no_run
962    /// # use google_cloud_developerconnect_v1::model::Connection;
963    /// use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
964    /// let x = Connection::new().set_http_config(GenericHTTPEndpointConfig::default()/* use setters */);
965    /// assert!(x.http_config().is_some());
966    /// assert!(x.github_config().is_none());
967    /// assert!(x.github_enterprise_config().is_none());
968    /// assert!(x.gitlab_config().is_none());
969    /// assert!(x.gitlab_enterprise_config().is_none());
970    /// assert!(x.bitbucket_data_center_config().is_none());
971    /// assert!(x.bitbucket_cloud_config().is_none());
972    /// assert!(x.secure_source_manager_instance_config().is_none());
973    /// ```
974    pub fn set_http_config<
975        T: std::convert::Into<std::boxed::Box<crate::model::GenericHTTPEndpointConfig>>,
976    >(
977        mut self,
978        v: T,
979    ) -> Self {
980        self.connection_config = std::option::Option::Some(
981            crate::model::connection::ConnectionConfig::HttpConfig(v.into()),
982        );
983        self
984    }
985}
986
987impl wkt::message::Message for Connection {
988    fn typename() -> &'static str {
989        "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
990    }
991}
992
993/// Defines additional types related to [Connection].
994pub mod connection {
995    #[allow(unused_imports)]
996    use super::*;
997
998    /// Configuration for the connection depending on the type of provider.
999    #[derive(Clone, Debug, PartialEq)]
1000    #[non_exhaustive]
1001    pub enum ConnectionConfig {
1002        /// Configuration for connections to github.com.
1003        GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
1004        /// Configuration for connections to an instance of GitHub Enterprise.
1005        GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
1006        /// Configuration for connections to gitlab.com.
1007        GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
1008        /// Configuration for connections to an instance of GitLab Enterprise.
1009        GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
1010        /// Configuration for connections to an instance of Bitbucket Data Center.
1011        BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
1012        /// Configuration for connections to an instance of Bitbucket Clouds.
1013        BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
1014        /// Configuration for connections to an instance of Secure Source Manager.
1015        SecureSourceManagerInstanceConfig(
1016            std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>,
1017        ),
1018        /// Optional. Configuration for connections to an HTTP service provider.
1019        HttpConfig(std::boxed::Box<crate::model::GenericHTTPEndpointConfig>),
1020    }
1021}
1022
1023/// The crypto key configuration. This field is used by the Customer-managed
1024/// encryption keys (CMEK) feature.
1025#[derive(Clone, Default, PartialEq)]
1026#[non_exhaustive]
1027pub struct CryptoKeyConfig {
1028    /// Required. The name of the key which is used to encrypt/decrypt customer
1029    /// data. For key in Cloud KMS, the key should be in the format of
1030    /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
1031    pub key_reference: std::string::String,
1032
1033    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1034}
1035
1036impl CryptoKeyConfig {
1037    pub fn new() -> Self {
1038        std::default::Default::default()
1039    }
1040
1041    /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
1042    ///
1043    /// # Example
1044    /// ```ignore,no_run
1045    /// # use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
1046    /// let x = CryptoKeyConfig::new().set_key_reference("example");
1047    /// ```
1048    pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1049        self.key_reference = v.into();
1050        self
1051    }
1052}
1053
1054impl wkt::message::Message for CryptoKeyConfig {
1055    fn typename() -> &'static str {
1056        "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
1057    }
1058}
1059
1060/// The git proxy configuration.
1061#[derive(Clone, Default, PartialEq)]
1062#[non_exhaustive]
1063pub struct GitProxyConfig {
1064    /// Optional. Setting this to true allows the git proxy to be used for
1065    /// performing git operations on the repositories linked in the connection.
1066    pub enabled: bool,
1067
1068    /// Output only. The base URI for the HTTP proxy endpoint. Has
1069    /// the format
1070    /// `https://{generatedID}-c-h-{shortRegion}.developerconnect.dev`
1071    /// Populated only when enabled is set to true.
1072    /// This endpoint is used by other Google services that integrate with
1073    /// Developer Connect.
1074    pub http_proxy_base_uri: std::string::String,
1075
1076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1077}
1078
1079impl GitProxyConfig {
1080    pub fn new() -> Self {
1081        std::default::Default::default()
1082    }
1083
1084    /// Sets the value of [enabled][crate::model::GitProxyConfig::enabled].
1085    ///
1086    /// # Example
1087    /// ```ignore,no_run
1088    /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1089    /// let x = GitProxyConfig::new().set_enabled(true);
1090    /// ```
1091    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1092        self.enabled = v.into();
1093        self
1094    }
1095
1096    /// Sets the value of [http_proxy_base_uri][crate::model::GitProxyConfig::http_proxy_base_uri].
1097    ///
1098    /// # Example
1099    /// ```ignore,no_run
1100    /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1101    /// let x = GitProxyConfig::new().set_http_proxy_base_uri("example");
1102    /// ```
1103    pub fn set_http_proxy_base_uri<T: std::convert::Into<std::string::String>>(
1104        mut self,
1105        v: T,
1106    ) -> Self {
1107        self.http_proxy_base_uri = v.into();
1108        self
1109    }
1110}
1111
1112impl wkt::message::Message for GitProxyConfig {
1113    fn typename() -> &'static str {
1114        "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
1115    }
1116}
1117
1118/// Describes stage and necessary actions to be taken by the
1119/// user to complete the installation. Used for GitHub and GitHub Enterprise
1120/// based connections.
1121#[derive(Clone, Default, PartialEq)]
1122#[non_exhaustive]
1123pub struct InstallationState {
1124    /// Output only. Current step of the installation process.
1125    pub stage: crate::model::installation_state::Stage,
1126
1127    /// Output only. Message of what the user should do next to continue the
1128    /// installation. Empty string if the installation is already complete.
1129    pub message: std::string::String,
1130
1131    /// Output only. Link to follow for next action. Empty string if the
1132    /// installation is already complete.
1133    pub action_uri: std::string::String,
1134
1135    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1136}
1137
1138impl InstallationState {
1139    pub fn new() -> Self {
1140        std::default::Default::default()
1141    }
1142
1143    /// Sets the value of [stage][crate::model::InstallationState::stage].
1144    ///
1145    /// # Example
1146    /// ```ignore,no_run
1147    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1148    /// use google_cloud_developerconnect_v1::model::installation_state::Stage;
1149    /// let x0 = InstallationState::new().set_stage(Stage::PendingCreateApp);
1150    /// let x1 = InstallationState::new().set_stage(Stage::PendingUserOauth);
1151    /// let x2 = InstallationState::new().set_stage(Stage::PendingInstallApp);
1152    /// ```
1153    pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1154        mut self,
1155        v: T,
1156    ) -> Self {
1157        self.stage = v.into();
1158        self
1159    }
1160
1161    /// Sets the value of [message][crate::model::InstallationState::message].
1162    ///
1163    /// # Example
1164    /// ```ignore,no_run
1165    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1166    /// let x = InstallationState::new().set_message("example");
1167    /// ```
1168    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1169        self.message = v.into();
1170        self
1171    }
1172
1173    /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
1174    ///
1175    /// # Example
1176    /// ```ignore,no_run
1177    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1178    /// let x = InstallationState::new().set_action_uri("example");
1179    /// ```
1180    pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1181        self.action_uri = v.into();
1182        self
1183    }
1184}
1185
1186impl wkt::message::Message for InstallationState {
1187    fn typename() -> &'static str {
1188        "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
1189    }
1190}
1191
1192/// Defines additional types related to [InstallationState].
1193pub mod installation_state {
1194    #[allow(unused_imports)]
1195    use super::*;
1196
1197    /// Stage of the installation process.
1198    ///
1199    /// # Working with unknown values
1200    ///
1201    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1202    /// additional enum variants at any time. Adding new variants is not considered
1203    /// a breaking change. Applications should write their code in anticipation of:
1204    ///
1205    /// - New values appearing in future releases of the client library, **and**
1206    /// - New values received dynamically, without application changes.
1207    ///
1208    /// Please consult the [Working with enums] section in the user guide for some
1209    /// guidelines.
1210    ///
1211    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1212    #[derive(Clone, Debug, PartialEq)]
1213    #[non_exhaustive]
1214    pub enum Stage {
1215        /// No stage specified.
1216        Unspecified,
1217        /// Only for GitHub Enterprise. An App creation has been requested.
1218        /// The user needs to confirm the creation in their GitHub enterprise host.
1219        PendingCreateApp,
1220        /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
1221        PendingUserOauth,
1222        /// User needs to follow the link to install the GitHub (or Enterprise) App.
1223        PendingInstallApp,
1224        /// Installation process has been completed.
1225        Complete,
1226        /// If set, the enum was initialized with an unknown value.
1227        ///
1228        /// Applications can examine the value using [Stage::value] or
1229        /// [Stage::name].
1230        UnknownValue(stage::UnknownValue),
1231    }
1232
1233    #[doc(hidden)]
1234    pub mod stage {
1235        #[allow(unused_imports)]
1236        use super::*;
1237        #[derive(Clone, Debug, PartialEq)]
1238        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1239    }
1240
1241    impl Stage {
1242        /// Gets the enum value.
1243        ///
1244        /// Returns `None` if the enum contains an unknown value deserialized from
1245        /// the string representation of enums.
1246        pub fn value(&self) -> std::option::Option<i32> {
1247            match self {
1248                Self::Unspecified => std::option::Option::Some(0),
1249                Self::PendingCreateApp => std::option::Option::Some(1),
1250                Self::PendingUserOauth => std::option::Option::Some(2),
1251                Self::PendingInstallApp => std::option::Option::Some(3),
1252                Self::Complete => std::option::Option::Some(10),
1253                Self::UnknownValue(u) => u.0.value(),
1254            }
1255        }
1256
1257        /// Gets the enum value as a string.
1258        ///
1259        /// Returns `None` if the enum contains an unknown value deserialized from
1260        /// the integer representation of enums.
1261        pub fn name(&self) -> std::option::Option<&str> {
1262            match self {
1263                Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1264                Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1265                Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1266                Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1267                Self::Complete => std::option::Option::Some("COMPLETE"),
1268                Self::UnknownValue(u) => u.0.name(),
1269            }
1270        }
1271    }
1272
1273    impl std::default::Default for Stage {
1274        fn default() -> Self {
1275            use std::convert::From;
1276            Self::from(0)
1277        }
1278    }
1279
1280    impl std::fmt::Display for Stage {
1281        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1282            wkt::internal::display_enum(f, self.name(), self.value())
1283        }
1284    }
1285
1286    impl std::convert::From<i32> for Stage {
1287        fn from(value: i32) -> Self {
1288            match value {
1289                0 => Self::Unspecified,
1290                1 => Self::PendingCreateApp,
1291                2 => Self::PendingUserOauth,
1292                3 => Self::PendingInstallApp,
1293                10 => Self::Complete,
1294                _ => Self::UnknownValue(stage::UnknownValue(
1295                    wkt::internal::UnknownEnumValue::Integer(value),
1296                )),
1297            }
1298        }
1299    }
1300
1301    impl std::convert::From<&str> for Stage {
1302        fn from(value: &str) -> Self {
1303            use std::string::ToString;
1304            match value {
1305                "STAGE_UNSPECIFIED" => Self::Unspecified,
1306                "PENDING_CREATE_APP" => Self::PendingCreateApp,
1307                "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1308                "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1309                "COMPLETE" => Self::Complete,
1310                _ => Self::UnknownValue(stage::UnknownValue(
1311                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1312                )),
1313            }
1314        }
1315    }
1316
1317    impl serde::ser::Serialize for Stage {
1318        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1319        where
1320            S: serde::Serializer,
1321        {
1322            match self {
1323                Self::Unspecified => serializer.serialize_i32(0),
1324                Self::PendingCreateApp => serializer.serialize_i32(1),
1325                Self::PendingUserOauth => serializer.serialize_i32(2),
1326                Self::PendingInstallApp => serializer.serialize_i32(3),
1327                Self::Complete => serializer.serialize_i32(10),
1328                Self::UnknownValue(u) => u.0.serialize(serializer),
1329            }
1330        }
1331    }
1332
1333    impl<'de> serde::de::Deserialize<'de> for Stage {
1334        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1335        where
1336            D: serde::Deserializer<'de>,
1337        {
1338            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1339                ".google.cloud.developerconnect.v1.InstallationState.Stage",
1340            ))
1341        }
1342    }
1343}
1344
1345/// Defines the configuration for connections to an HTTP service provider.
1346#[derive(Clone, Default, PartialEq)]
1347#[non_exhaustive]
1348pub struct GenericHTTPEndpointConfig {
1349    /// Required. Immutable. The service provider's https endpoint.
1350    pub host_uri: std::string::String,
1351
1352    /// Optional. Configuration for using Service Directory to privately connect to
1353    /// a HTTP service provider. This should only be set if the Http service
1354    /// provider is hosted on-premises and not reachable by public internet. If
1355    /// this field is left empty, calls to the HTTP service provider will be made
1356    /// over the public internet.
1357    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1358
1359    /// Optional. The SSL certificate to use for requests to the HTTP service
1360    /// provider.
1361    pub ssl_ca_certificate: std::string::String,
1362
1363    /// The authentication mechanism to use for requests to the HTTP service
1364    /// provider.
1365    pub authentication:
1366        std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1367
1368    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1369}
1370
1371impl GenericHTTPEndpointConfig {
1372    pub fn new() -> Self {
1373        std::default::Default::default()
1374    }
1375
1376    /// Sets the value of [host_uri][crate::model::GenericHTTPEndpointConfig::host_uri].
1377    ///
1378    /// # Example
1379    /// ```ignore,no_run
1380    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1381    /// let x = GenericHTTPEndpointConfig::new().set_host_uri("example");
1382    /// ```
1383    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1384        self.host_uri = v.into();
1385        self
1386    }
1387
1388    /// Sets the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1389    ///
1390    /// # Example
1391    /// ```ignore,no_run
1392    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1393    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1394    /// let x = GenericHTTPEndpointConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1395    /// ```
1396    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1397    where
1398        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1399    {
1400        self.service_directory_config = std::option::Option::Some(v.into());
1401        self
1402    }
1403
1404    /// Sets or clears the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1405    ///
1406    /// # Example
1407    /// ```ignore,no_run
1408    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1409    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1410    /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1411    /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1412    /// ```
1413    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1414    where
1415        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1416    {
1417        self.service_directory_config = v.map(|x| x.into());
1418        self
1419    }
1420
1421    /// Sets the value of [ssl_ca_certificate][crate::model::GenericHTTPEndpointConfig::ssl_ca_certificate].
1422    ///
1423    /// # Example
1424    /// ```ignore,no_run
1425    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1426    /// let x = GenericHTTPEndpointConfig::new().set_ssl_ca_certificate("example");
1427    /// ```
1428    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1429        mut self,
1430        v: T,
1431    ) -> Self {
1432        self.ssl_ca_certificate = v.into();
1433        self
1434    }
1435
1436    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication].
1437    ///
1438    /// Note that all the setters affecting `authentication` are mutually
1439    /// exclusive.
1440    ///
1441    /// # Example
1442    /// ```ignore,no_run
1443    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1444    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1445    /// let x = GenericHTTPEndpointConfig::new().set_authentication(Some(
1446    ///     google_cloud_developerconnect_v1::model::generic_http_endpoint_config::Authentication::BasicAuthentication(BasicAuthentication::default().into())));
1447    /// ```
1448    pub fn set_authentication<
1449        T: std::convert::Into<
1450                std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1451            >,
1452    >(
1453        mut self,
1454        v: T,
1455    ) -> Self {
1456        self.authentication = v.into();
1457        self
1458    }
1459
1460    /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1461    /// if it holds a `BasicAuthentication`, `None` if the field is not set or
1462    /// holds a different branch.
1463    pub fn basic_authentication(
1464        &self,
1465    ) -> std::option::Option<
1466        &std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1467    > {
1468        #[allow(unreachable_patterns)]
1469        self.authentication.as_ref().and_then(|v| match v {
1470            crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(v) => {
1471                std::option::Option::Some(v)
1472            }
1473            _ => std::option::Option::None,
1474        })
1475    }
1476
1477    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1478    /// to hold a `BasicAuthentication`.
1479    ///
1480    /// Note that all the setters affecting `authentication` are
1481    /// mutually exclusive.
1482    ///
1483    /// # Example
1484    /// ```ignore,no_run
1485    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1486    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1487    /// let x = GenericHTTPEndpointConfig::new().set_basic_authentication(BasicAuthentication::default()/* use setters */);
1488    /// assert!(x.basic_authentication().is_some());
1489    /// assert!(x.bearer_token_authentication().is_none());
1490    /// ```
1491    pub fn set_basic_authentication<
1492        T: std::convert::Into<
1493                std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1494            >,
1495    >(
1496        mut self,
1497        v: T,
1498    ) -> Self {
1499        self.authentication = std::option::Option::Some(
1500            crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(
1501                v.into(),
1502            ),
1503        );
1504        self
1505    }
1506
1507    /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1508    /// if it holds a `BearerTokenAuthentication`, `None` if the field is not set or
1509    /// holds a different branch.
1510    pub fn bearer_token_authentication(
1511        &self,
1512    ) -> std::option::Option<
1513        &std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1514    > {
1515        #[allow(unreachable_patterns)]
1516        self.authentication.as_ref().and_then(|v| match v {
1517            crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(v) => std::option::Option::Some(v),
1518            _ => std::option::Option::None,
1519        })
1520    }
1521
1522    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1523    /// to hold a `BearerTokenAuthentication`.
1524    ///
1525    /// Note that all the setters affecting `authentication` are
1526    /// mutually exclusive.
1527    ///
1528    /// # Example
1529    /// ```ignore,no_run
1530    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1531    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1532    /// let x = GenericHTTPEndpointConfig::new().set_bearer_token_authentication(BearerTokenAuthentication::default()/* use setters */);
1533    /// assert!(x.bearer_token_authentication().is_some());
1534    /// assert!(x.basic_authentication().is_none());
1535    /// ```
1536    pub fn set_bearer_token_authentication<
1537        T: std::convert::Into<
1538                std::boxed::Box<
1539                    crate::model::generic_http_endpoint_config::BearerTokenAuthentication,
1540                >,
1541            >,
1542    >(
1543        mut self,
1544        v: T,
1545    ) -> Self {
1546        self.authentication = std::option::Option::Some(
1547            crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(
1548                v.into(),
1549            ),
1550        );
1551        self
1552    }
1553}
1554
1555impl wkt::message::Message for GenericHTTPEndpointConfig {
1556    fn typename() -> &'static str {
1557        "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig"
1558    }
1559}
1560
1561/// Defines additional types related to [GenericHTTPEndpointConfig].
1562pub mod generic_http_endpoint_config {
1563    #[allow(unused_imports)]
1564    use super::*;
1565
1566    /// Basic authentication with username and password.
1567    #[derive(Clone, Default, PartialEq)]
1568    #[non_exhaustive]
1569    pub struct BasicAuthentication {
1570        /// Required. The username to authenticate as.
1571        pub username: std::string::String,
1572
1573        /// The password to authenticate as.
1574        pub password: std::option::Option<
1575            crate::model::generic_http_endpoint_config::basic_authentication::Password,
1576        >,
1577
1578        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1579    }
1580
1581    impl BasicAuthentication {
1582        pub fn new() -> Self {
1583            std::default::Default::default()
1584        }
1585
1586        /// Sets the value of [username][crate::model::generic_http_endpoint_config::BasicAuthentication::username].
1587        ///
1588        /// # Example
1589        /// ```ignore,no_run
1590        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1591        /// let x = BasicAuthentication::new().set_username("example");
1592        /// ```
1593        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1594            self.username = v.into();
1595            self
1596        }
1597
1598        /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password].
1599        ///
1600        /// Note that all the setters affecting `password` are mutually
1601        /// exclusive.
1602        ///
1603        /// # Example
1604        /// ```ignore,no_run
1605        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1606        /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::basic_authentication::Password;
1607        /// let x = BasicAuthentication::new().set_password(Some(Password::PasswordSecretVersion("example".to_string())));
1608        /// ```
1609        pub fn set_password<
1610            T: std::convert::Into<
1611                    std::option::Option<
1612                        crate::model::generic_http_endpoint_config::basic_authentication::Password,
1613                    >,
1614                >,
1615        >(
1616            mut self,
1617            v: T,
1618        ) -> Self {
1619            self.password = v.into();
1620            self
1621        }
1622
1623        /// The value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1624        /// if it holds a `PasswordSecretVersion`, `None` if the field is not set or
1625        /// holds a different branch.
1626        pub fn password_secret_version(&self) -> std::option::Option<&std::string::String> {
1627            #[allow(unreachable_patterns)]
1628            self.password.as_ref().and_then(|v| match v {
1629                crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(v) => std::option::Option::Some(v),
1630                _ => std::option::Option::None,
1631            })
1632        }
1633
1634        /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1635        /// to hold a `PasswordSecretVersion`.
1636        ///
1637        /// Note that all the setters affecting `password` are
1638        /// mutually exclusive.
1639        ///
1640        /// # Example
1641        /// ```ignore,no_run
1642        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1643        /// let x = BasicAuthentication::new().set_password_secret_version("example");
1644        /// assert!(x.password_secret_version().is_some());
1645        /// ```
1646        pub fn set_password_secret_version<T: std::convert::Into<std::string::String>>(
1647            mut self,
1648            v: T,
1649        ) -> Self {
1650            self.password = std::option::Option::Some(
1651                crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(
1652                    v.into()
1653                )
1654            );
1655            self
1656        }
1657    }
1658
1659    impl wkt::message::Message for BasicAuthentication {
1660        fn typename() -> &'static str {
1661            "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BasicAuthentication"
1662        }
1663    }
1664
1665    /// Defines additional types related to [BasicAuthentication].
1666    pub mod basic_authentication {
1667        #[allow(unused_imports)]
1668        use super::*;
1669
1670        /// The password to authenticate as.
1671        #[derive(Clone, Debug, PartialEq)]
1672        #[non_exhaustive]
1673        pub enum Password {
1674            /// The password SecretManager secret version to authenticate as.
1675            PasswordSecretVersion(std::string::String),
1676        }
1677    }
1678
1679    /// Bearer token authentication with a token.
1680    #[derive(Clone, Default, PartialEq)]
1681    #[non_exhaustive]
1682    pub struct BearerTokenAuthentication {
1683        /// The token to authenticate as.
1684        pub token: std::option::Option<
1685            crate::model::generic_http_endpoint_config::bearer_token_authentication::Token,
1686        >,
1687
1688        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1689    }
1690
1691    impl BearerTokenAuthentication {
1692        pub fn new() -> Self {
1693            std::default::Default::default()
1694        }
1695
1696        /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token].
1697        ///
1698        /// Note that all the setters affecting `token` are mutually
1699        /// exclusive.
1700        ///
1701        /// # Example
1702        /// ```ignore,no_run
1703        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1704        /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::bearer_token_authentication::Token;
1705        /// let x = BearerTokenAuthentication::new().set_token(Some(Token::TokenSecretVersion("example".to_string())));
1706        /// ```
1707        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
1708        {
1709            self.token = v.into();
1710            self
1711        }
1712
1713        /// The value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1714        /// if it holds a `TokenSecretVersion`, `None` if the field is not set or
1715        /// holds a different branch.
1716        pub fn token_secret_version(&self) -> std::option::Option<&std::string::String> {
1717            #[allow(unreachable_patterns)]
1718            self.token.as_ref().and_then(|v| match v {
1719                crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(v) => std::option::Option::Some(v),
1720                _ => std::option::Option::None,
1721            })
1722        }
1723
1724        /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1725        /// to hold a `TokenSecretVersion`.
1726        ///
1727        /// Note that all the setters affecting `token` are
1728        /// mutually exclusive.
1729        ///
1730        /// # Example
1731        /// ```ignore,no_run
1732        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1733        /// let x = BearerTokenAuthentication::new().set_token_secret_version("example");
1734        /// assert!(x.token_secret_version().is_some());
1735        /// ```
1736        pub fn set_token_secret_version<T: std::convert::Into<std::string::String>>(
1737            mut self,
1738            v: T,
1739        ) -> Self {
1740            self.token = std::option::Option::Some(
1741                crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(
1742                    v.into()
1743                )
1744            );
1745            self
1746        }
1747    }
1748
1749    impl wkt::message::Message for BearerTokenAuthentication {
1750        fn typename() -> &'static str {
1751            "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BearerTokenAuthentication"
1752        }
1753    }
1754
1755    /// Defines additional types related to [BearerTokenAuthentication].
1756    pub mod bearer_token_authentication {
1757        #[allow(unused_imports)]
1758        use super::*;
1759
1760        /// The token to authenticate as.
1761        #[derive(Clone, Debug, PartialEq)]
1762        #[non_exhaustive]
1763        pub enum Token {
1764            /// Optional. The token SecretManager secret version to authenticate as.
1765            TokenSecretVersion(std::string::String),
1766        }
1767    }
1768
1769    /// The authentication mechanism to use for requests to the HTTP service
1770    /// provider.
1771    #[derive(Clone, Debug, PartialEq)]
1772    #[non_exhaustive]
1773    pub enum Authentication {
1774        /// Optional. Basic authentication with username and password.
1775        BasicAuthentication(
1776            std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1777        ),
1778        /// Optional. Bearer token authentication with a token.
1779        BearerTokenAuthentication(
1780            std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1781        ),
1782    }
1783}
1784
1785/// Configuration for connections to github.com.
1786#[derive(Clone, Default, PartialEq)]
1787#[non_exhaustive]
1788pub struct GitHubConfig {
1789    /// Required. Immutable. The GitHub Application that was installed to the
1790    /// GitHub user or organization.
1791    pub github_app: crate::model::git_hub_config::GitHubApp,
1792
1793    /// Optional. OAuth credential of the account that authorized the GitHub App.
1794    /// It is recommended to use a robot account instead of a human user account.
1795    /// The OAuth token must be tied to the GitHub App of this config.
1796    pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
1797
1798    /// Optional. GitHub App installation id.
1799    pub app_installation_id: i64,
1800
1801    /// Output only. The URI to navigate to in order to manage the installation
1802    /// associated with this GitHubConfig.
1803    pub installation_uri: std::string::String,
1804
1805    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1806}
1807
1808impl GitHubConfig {
1809    pub fn new() -> Self {
1810        std::default::Default::default()
1811    }
1812
1813    /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
1814    ///
1815    /// # Example
1816    /// ```ignore,no_run
1817    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1818    /// use google_cloud_developerconnect_v1::model::git_hub_config::GitHubApp;
1819    /// let x0 = GitHubConfig::new().set_github_app(GitHubApp::DeveloperConnect);
1820    /// let x1 = GitHubConfig::new().set_github_app(GitHubApp::Firebase);
1821    /// let x2 = GitHubConfig::new().set_github_app(GitHubApp::GeminiCodeAssist);
1822    /// ```
1823    pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
1824        mut self,
1825        v: T,
1826    ) -> Self {
1827        self.github_app = v.into();
1828        self
1829    }
1830
1831    /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1832    ///
1833    /// # Example
1834    /// ```ignore,no_run
1835    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1836    /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1837    /// let x = GitHubConfig::new().set_authorizer_credential(OAuthCredential::default()/* use setters */);
1838    /// ```
1839    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1840    where
1841        T: std::convert::Into<crate::model::OAuthCredential>,
1842    {
1843        self.authorizer_credential = std::option::Option::Some(v.into());
1844        self
1845    }
1846
1847    /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1848    ///
1849    /// # Example
1850    /// ```ignore,no_run
1851    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1852    /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1853    /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(Some(OAuthCredential::default()/* use setters */));
1854    /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(None::<OAuthCredential>);
1855    /// ```
1856    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1857    where
1858        T: std::convert::Into<crate::model::OAuthCredential>,
1859    {
1860        self.authorizer_credential = v.map(|x| x.into());
1861        self
1862    }
1863
1864    /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
1865    ///
1866    /// # Example
1867    /// ```ignore,no_run
1868    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1869    /// let x = GitHubConfig::new().set_app_installation_id(42);
1870    /// ```
1871    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1872        self.app_installation_id = v.into();
1873        self
1874    }
1875
1876    /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
1877    ///
1878    /// # Example
1879    /// ```ignore,no_run
1880    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1881    /// let x = GitHubConfig::new().set_installation_uri("example");
1882    /// ```
1883    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
1884        mut self,
1885        v: T,
1886    ) -> Self {
1887        self.installation_uri = v.into();
1888        self
1889    }
1890}
1891
1892impl wkt::message::Message for GitHubConfig {
1893    fn typename() -> &'static str {
1894        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
1895    }
1896}
1897
1898/// Defines additional types related to [GitHubConfig].
1899pub mod git_hub_config {
1900    #[allow(unused_imports)]
1901    use super::*;
1902
1903    /// Represents the various GitHub Applications that can be installed to a
1904    /// GitHub user or organization and used with Developer Connect.
1905    ///
1906    /// # Working with unknown values
1907    ///
1908    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1909    /// additional enum variants at any time. Adding new variants is not considered
1910    /// a breaking change. Applications should write their code in anticipation of:
1911    ///
1912    /// - New values appearing in future releases of the client library, **and**
1913    /// - New values received dynamically, without application changes.
1914    ///
1915    /// Please consult the [Working with enums] section in the user guide for some
1916    /// guidelines.
1917    ///
1918    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1919    #[derive(Clone, Debug, PartialEq)]
1920    #[non_exhaustive]
1921    pub enum GitHubApp {
1922        /// GitHub App not specified.
1923        Unspecified,
1924        /// The Developer Connect GitHub Application.
1925        DeveloperConnect,
1926        /// The Firebase GitHub Application.
1927        Firebase,
1928        /// The Gemini Code Assist Application.
1929        GeminiCodeAssist,
1930        /// If set, the enum was initialized with an unknown value.
1931        ///
1932        /// Applications can examine the value using [GitHubApp::value] or
1933        /// [GitHubApp::name].
1934        UnknownValue(git_hub_app::UnknownValue),
1935    }
1936
1937    #[doc(hidden)]
1938    pub mod git_hub_app {
1939        #[allow(unused_imports)]
1940        use super::*;
1941        #[derive(Clone, Debug, PartialEq)]
1942        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1943    }
1944
1945    impl GitHubApp {
1946        /// Gets the enum value.
1947        ///
1948        /// Returns `None` if the enum contains an unknown value deserialized from
1949        /// the string representation of enums.
1950        pub fn value(&self) -> std::option::Option<i32> {
1951            match self {
1952                Self::Unspecified => std::option::Option::Some(0),
1953                Self::DeveloperConnect => std::option::Option::Some(1),
1954                Self::Firebase => std::option::Option::Some(2),
1955                Self::GeminiCodeAssist => std::option::Option::Some(3),
1956                Self::UnknownValue(u) => u.0.value(),
1957            }
1958        }
1959
1960        /// Gets the enum value as a string.
1961        ///
1962        /// Returns `None` if the enum contains an unknown value deserialized from
1963        /// the integer representation of enums.
1964        pub fn name(&self) -> std::option::Option<&str> {
1965            match self {
1966                Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
1967                Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
1968                Self::Firebase => std::option::Option::Some("FIREBASE"),
1969                Self::GeminiCodeAssist => std::option::Option::Some("GEMINI_CODE_ASSIST"),
1970                Self::UnknownValue(u) => u.0.name(),
1971            }
1972        }
1973    }
1974
1975    impl std::default::Default for GitHubApp {
1976        fn default() -> Self {
1977            use std::convert::From;
1978            Self::from(0)
1979        }
1980    }
1981
1982    impl std::fmt::Display for GitHubApp {
1983        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1984            wkt::internal::display_enum(f, self.name(), self.value())
1985        }
1986    }
1987
1988    impl std::convert::From<i32> for GitHubApp {
1989        fn from(value: i32) -> Self {
1990            match value {
1991                0 => Self::Unspecified,
1992                1 => Self::DeveloperConnect,
1993                2 => Self::Firebase,
1994                3 => Self::GeminiCodeAssist,
1995                _ => Self::UnknownValue(git_hub_app::UnknownValue(
1996                    wkt::internal::UnknownEnumValue::Integer(value),
1997                )),
1998            }
1999        }
2000    }
2001
2002    impl std::convert::From<&str> for GitHubApp {
2003        fn from(value: &str) -> Self {
2004            use std::string::ToString;
2005            match value {
2006                "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
2007                "DEVELOPER_CONNECT" => Self::DeveloperConnect,
2008                "FIREBASE" => Self::Firebase,
2009                "GEMINI_CODE_ASSIST" => Self::GeminiCodeAssist,
2010                _ => Self::UnknownValue(git_hub_app::UnknownValue(
2011                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2012                )),
2013            }
2014        }
2015    }
2016
2017    impl serde::ser::Serialize for GitHubApp {
2018        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2019        where
2020            S: serde::Serializer,
2021        {
2022            match self {
2023                Self::Unspecified => serializer.serialize_i32(0),
2024                Self::DeveloperConnect => serializer.serialize_i32(1),
2025                Self::Firebase => serializer.serialize_i32(2),
2026                Self::GeminiCodeAssist => serializer.serialize_i32(3),
2027                Self::UnknownValue(u) => u.0.serialize(serializer),
2028            }
2029        }
2030    }
2031
2032    impl<'de> serde::de::Deserialize<'de> for GitHubApp {
2033        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2034        where
2035            D: serde::Deserializer<'de>,
2036        {
2037            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
2038                ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
2039            ))
2040        }
2041    }
2042}
2043
2044/// Configuration for connections to an instance of GitHub Enterprise.
2045#[derive(Clone, Default, PartialEq)]
2046#[non_exhaustive]
2047pub struct GitHubEnterpriseConfig {
2048    /// Required. The URI of the GitHub Enterprise host this connection is for.
2049    pub host_uri: std::string::String,
2050
2051    /// Optional. ID of the GitHub App created from the manifest.
2052    pub app_id: i64,
2053
2054    /// Output only. The URL-friendly name of the GitHub App.
2055    pub app_slug: std::string::String,
2056
2057    /// Optional. SecretManager resource containing the private key of the GitHub
2058    /// App, formatted as `projects/*/secrets/*/versions/*` or
2059    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2060    /// supported in that location).
2061    pub private_key_secret_version: std::string::String,
2062
2063    /// Optional. SecretManager resource containing the webhook secret of the
2064    /// GitHub App, formatted as `projects/*/secrets/*/versions/*` or
2065    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2066    /// supported in that location).
2067    pub webhook_secret_secret_version: std::string::String,
2068
2069    /// Optional. ID of the installation of the GitHub App.
2070    pub app_installation_id: i64,
2071
2072    /// Output only. The URI to navigate to in order to manage the installation
2073    /// associated with this GitHubEnterpriseConfig.
2074    pub installation_uri: std::string::String,
2075
2076    /// Optional. Configuration for using Service Directory to privately connect to
2077    /// a GitHub Enterprise server. This should only be set if the GitHub
2078    /// Enterprise server is hosted on-premises and not reachable by public
2079    /// internet. If this field is left empty, calls to the GitHub Enterprise
2080    /// server will be made over the public internet.
2081    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2082
2083    /// Output only. GitHub Enterprise version installed at the host_uri.
2084    pub server_version: std::string::String,
2085
2086    /// Optional. SSL certificate to use for requests to GitHub Enterprise.
2087    pub ssl_ca_certificate: std::string::String,
2088
2089    /// Optional. Immutable. GitHub Enterprise organization in which the GitHub App
2090    /// is created.
2091    pub organization: std::string::String,
2092
2093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2094}
2095
2096impl GitHubEnterpriseConfig {
2097    pub fn new() -> Self {
2098        std::default::Default::default()
2099    }
2100
2101    /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
2102    ///
2103    /// # Example
2104    /// ```ignore,no_run
2105    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2106    /// let x = GitHubEnterpriseConfig::new().set_host_uri("example");
2107    /// ```
2108    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2109        self.host_uri = v.into();
2110        self
2111    }
2112
2113    /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
2114    ///
2115    /// # Example
2116    /// ```ignore,no_run
2117    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2118    /// let x = GitHubEnterpriseConfig::new().set_app_id(42);
2119    /// ```
2120    pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2121        self.app_id = v.into();
2122        self
2123    }
2124
2125    /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
2126    ///
2127    /// # Example
2128    /// ```ignore,no_run
2129    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2130    /// let x = GitHubEnterpriseConfig::new().set_app_slug("example");
2131    /// ```
2132    pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2133        self.app_slug = v.into();
2134        self
2135    }
2136
2137    /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
2138    ///
2139    /// # Example
2140    /// ```ignore,no_run
2141    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2142    /// let x = GitHubEnterpriseConfig::new().set_private_key_secret_version("example");
2143    /// ```
2144    pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
2145        mut self,
2146        v: T,
2147    ) -> Self {
2148        self.private_key_secret_version = v.into();
2149        self
2150    }
2151
2152    /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
2153    ///
2154    /// # Example
2155    /// ```ignore,no_run
2156    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2157    /// let x = GitHubEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2158    /// ```
2159    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2160        mut self,
2161        v: T,
2162    ) -> Self {
2163        self.webhook_secret_secret_version = v.into();
2164        self
2165    }
2166
2167    /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
2168    ///
2169    /// # Example
2170    /// ```ignore,no_run
2171    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2172    /// let x = GitHubEnterpriseConfig::new().set_app_installation_id(42);
2173    /// ```
2174    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2175        self.app_installation_id = v.into();
2176        self
2177    }
2178
2179    /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
2180    ///
2181    /// # Example
2182    /// ```ignore,no_run
2183    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2184    /// let x = GitHubEnterpriseConfig::new().set_installation_uri("example");
2185    /// ```
2186    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2187        mut self,
2188        v: T,
2189    ) -> Self {
2190        self.installation_uri = v.into();
2191        self
2192    }
2193
2194    /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2195    ///
2196    /// # Example
2197    /// ```ignore,no_run
2198    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2199    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2200    /// let x = GitHubEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2201    /// ```
2202    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2203    where
2204        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2205    {
2206        self.service_directory_config = std::option::Option::Some(v.into());
2207        self
2208    }
2209
2210    /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2211    ///
2212    /// # Example
2213    /// ```ignore,no_run
2214    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2215    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2216    /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2217    /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2218    /// ```
2219    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2220    where
2221        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2222    {
2223        self.service_directory_config = v.map(|x| x.into());
2224        self
2225    }
2226
2227    /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
2228    ///
2229    /// # Example
2230    /// ```ignore,no_run
2231    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2232    /// let x = GitHubEnterpriseConfig::new().set_server_version("example");
2233    /// ```
2234    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2235        self.server_version = v.into();
2236        self
2237    }
2238
2239    /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
2240    ///
2241    /// # Example
2242    /// ```ignore,no_run
2243    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2244    /// let x = GitHubEnterpriseConfig::new().set_ssl_ca_certificate("example");
2245    /// ```
2246    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2247        mut self,
2248        v: T,
2249    ) -> Self {
2250        self.ssl_ca_certificate = v.into();
2251        self
2252    }
2253
2254    /// Sets the value of [organization][crate::model::GitHubEnterpriseConfig::organization].
2255    ///
2256    /// # Example
2257    /// ```ignore,no_run
2258    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2259    /// let x = GitHubEnterpriseConfig::new().set_organization("example");
2260    /// ```
2261    pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2262        self.organization = v.into();
2263        self
2264    }
2265}
2266
2267impl wkt::message::Message for GitHubEnterpriseConfig {
2268    fn typename() -> &'static str {
2269        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
2270    }
2271}
2272
2273/// ServiceDirectoryConfig represents Service Directory configuration for a
2274/// connection.
2275#[derive(Clone, Default, PartialEq)]
2276#[non_exhaustive]
2277pub struct ServiceDirectoryConfig {
2278    /// Required. The Service Directory service name.
2279    /// Format:
2280    /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
2281    pub service: std::string::String,
2282
2283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2284}
2285
2286impl ServiceDirectoryConfig {
2287    pub fn new() -> Self {
2288        std::default::Default::default()
2289    }
2290
2291    /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
2292    ///
2293    /// # Example
2294    /// ```ignore,no_run
2295    /// # use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2296    /// let x = ServiceDirectoryConfig::new().set_service("example");
2297    /// ```
2298    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2299        self.service = v.into();
2300        self
2301    }
2302}
2303
2304impl wkt::message::Message for ServiceDirectoryConfig {
2305    fn typename() -> &'static str {
2306        "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
2307    }
2308}
2309
2310/// Represents an OAuth token of the account that authorized the Connection,
2311/// and associated metadata.
2312#[derive(Clone, Default, PartialEq)]
2313#[non_exhaustive]
2314pub struct OAuthCredential {
2315    /// Required. A SecretManager resource containing the OAuth token that
2316    /// authorizes the connection. Format: `projects/*/secrets/*/versions/*` or
2317    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2318    /// supported in that location).
2319    pub oauth_token_secret_version: std::string::String,
2320
2321    /// Output only. The username associated with this token.
2322    pub username: std::string::String,
2323
2324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2325}
2326
2327impl OAuthCredential {
2328    pub fn new() -> Self {
2329        std::default::Default::default()
2330    }
2331
2332    /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
2333    ///
2334    /// # Example
2335    /// ```ignore,no_run
2336    /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2337    /// let x = OAuthCredential::new().set_oauth_token_secret_version("example");
2338    /// ```
2339    pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
2340        mut self,
2341        v: T,
2342    ) -> Self {
2343        self.oauth_token_secret_version = v.into();
2344        self
2345    }
2346
2347    /// Sets the value of [username][crate::model::OAuthCredential::username].
2348    ///
2349    /// # Example
2350    /// ```ignore,no_run
2351    /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2352    /// let x = OAuthCredential::new().set_username("example");
2353    /// ```
2354    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2355        self.username = v.into();
2356        self
2357    }
2358}
2359
2360impl wkt::message::Message for OAuthCredential {
2361    fn typename() -> &'static str {
2362        "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
2363    }
2364}
2365
2366/// Configuration for connections to gitlab.com.
2367#[derive(Clone, Default, PartialEq)]
2368#[non_exhaustive]
2369pub struct GitLabConfig {
2370    /// Required. Immutable. SecretManager resource containing the webhook secret
2371    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2372    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2373    /// supported in that location). This is used to validate webhooks.
2374    pub webhook_secret_secret_version: std::string::String,
2375
2376    /// Required. A GitLab personal access token with the minimum `read_api` scope
2377    /// access and a minimum role of `reporter`. The GitLab Projects visible to
2378    /// this Personal Access Token will control which Projects Developer Connect
2379    /// has access to.
2380    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2381
2382    /// Required. A GitLab personal access token with the minimum `api` scope
2383    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2384    /// this Personal Access Token will control which Projects Developer Connect
2385    /// has access to.
2386    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2387
2388    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2389}
2390
2391impl GitLabConfig {
2392    pub fn new() -> Self {
2393        std::default::Default::default()
2394    }
2395
2396    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
2397    ///
2398    /// # Example
2399    /// ```ignore,no_run
2400    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2401    /// let x = GitLabConfig::new().set_webhook_secret_secret_version("example");
2402    /// ```
2403    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2404        mut self,
2405        v: T,
2406    ) -> Self {
2407        self.webhook_secret_secret_version = v.into();
2408        self
2409    }
2410
2411    /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2412    ///
2413    /// # Example
2414    /// ```ignore,no_run
2415    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2416    /// use google_cloud_developerconnect_v1::model::UserCredential;
2417    /// let x = GitLabConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2418    /// ```
2419    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2420    where
2421        T: std::convert::Into<crate::model::UserCredential>,
2422    {
2423        self.read_authorizer_credential = std::option::Option::Some(v.into());
2424        self
2425    }
2426
2427    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2428    ///
2429    /// # Example
2430    /// ```ignore,no_run
2431    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2432    /// use google_cloud_developerconnect_v1::model::UserCredential;
2433    /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2434    /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2435    /// ```
2436    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2437    where
2438        T: std::convert::Into<crate::model::UserCredential>,
2439    {
2440        self.read_authorizer_credential = v.map(|x| x.into());
2441        self
2442    }
2443
2444    /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2445    ///
2446    /// # Example
2447    /// ```ignore,no_run
2448    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2449    /// use google_cloud_developerconnect_v1::model::UserCredential;
2450    /// let x = GitLabConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2451    /// ```
2452    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2453    where
2454        T: std::convert::Into<crate::model::UserCredential>,
2455    {
2456        self.authorizer_credential = std::option::Option::Some(v.into());
2457        self
2458    }
2459
2460    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2461    ///
2462    /// # Example
2463    /// ```ignore,no_run
2464    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2465    /// use google_cloud_developerconnect_v1::model::UserCredential;
2466    /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2467    /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2468    /// ```
2469    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2470    where
2471        T: std::convert::Into<crate::model::UserCredential>,
2472    {
2473        self.authorizer_credential = v.map(|x| x.into());
2474        self
2475    }
2476}
2477
2478impl wkt::message::Message for GitLabConfig {
2479    fn typename() -> &'static str {
2480        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
2481    }
2482}
2483
2484/// Represents a personal access token that authorized the Connection,
2485/// and associated metadata.
2486#[derive(Clone, Default, PartialEq)]
2487#[non_exhaustive]
2488pub struct UserCredential {
2489    /// Required. A SecretManager resource containing the user token that
2490    /// authorizes the Developer Connect connection. Format:
2491    /// `projects/*/secrets/*/versions/*` or
2492    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2493    /// supported in that location).
2494    pub user_token_secret_version: std::string::String,
2495
2496    /// Output only. The username associated with this token.
2497    pub username: std::string::String,
2498
2499    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2500}
2501
2502impl UserCredential {
2503    pub fn new() -> Self {
2504        std::default::Default::default()
2505    }
2506
2507    /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
2508    ///
2509    /// # Example
2510    /// ```ignore,no_run
2511    /// # use google_cloud_developerconnect_v1::model::UserCredential;
2512    /// let x = UserCredential::new().set_user_token_secret_version("example");
2513    /// ```
2514    pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
2515        mut self,
2516        v: T,
2517    ) -> Self {
2518        self.user_token_secret_version = v.into();
2519        self
2520    }
2521
2522    /// Sets the value of [username][crate::model::UserCredential::username].
2523    ///
2524    /// # Example
2525    /// ```ignore,no_run
2526    /// # use google_cloud_developerconnect_v1::model::UserCredential;
2527    /// let x = UserCredential::new().set_username("example");
2528    /// ```
2529    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2530        self.username = v.into();
2531        self
2532    }
2533}
2534
2535impl wkt::message::Message for UserCredential {
2536    fn typename() -> &'static str {
2537        "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
2538    }
2539}
2540
2541/// Configuration for connections to an instance of GitLab Enterprise.
2542#[derive(Clone, Default, PartialEq)]
2543#[non_exhaustive]
2544pub struct GitLabEnterpriseConfig {
2545    /// Required. The URI of the GitLab Enterprise host this connection is for.
2546    pub host_uri: std::string::String,
2547
2548    /// Required. Immutable. SecretManager resource containing the webhook secret
2549    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2550    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2551    /// supported in that location). This is used to validate webhooks.
2552    pub webhook_secret_secret_version: std::string::String,
2553
2554    /// Required. A GitLab personal access token with the minimum `read_api` scope
2555    /// access and a minimum role of `reporter`. The GitLab Projects visible to
2556    /// this Personal Access Token will control which Projects Developer Connect
2557    /// has access to.
2558    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2559
2560    /// Required. A GitLab personal access token with the minimum `api` scope
2561    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2562    /// this Personal Access Token will control which Projects Developer Connect
2563    /// has access to.
2564    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2565
2566    /// Optional. Configuration for using Service Directory to privately connect to
2567    /// a GitLab Enterprise instance. This should only be set if the GitLab
2568    /// Enterprise server is hosted on-premises and not reachable by public
2569    /// internet. If this field is left empty, calls to the GitLab Enterprise
2570    /// server will be made over the public internet.
2571    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2572
2573    /// Optional. SSL Certificate Authority certificate to use for requests to
2574    /// GitLab Enterprise instance.
2575    pub ssl_ca_certificate: std::string::String,
2576
2577    /// Output only. Version of the GitLab Enterprise server running on the
2578    /// `host_uri`.
2579    pub server_version: std::string::String,
2580
2581    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2582}
2583
2584impl GitLabEnterpriseConfig {
2585    pub fn new() -> Self {
2586        std::default::Default::default()
2587    }
2588
2589    /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
2590    ///
2591    /// # Example
2592    /// ```ignore,no_run
2593    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2594    /// let x = GitLabEnterpriseConfig::new().set_host_uri("example");
2595    /// ```
2596    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2597        self.host_uri = v.into();
2598        self
2599    }
2600
2601    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
2602    ///
2603    /// # Example
2604    /// ```ignore,no_run
2605    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2606    /// let x = GitLabEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2607    /// ```
2608    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2609        mut self,
2610        v: T,
2611    ) -> Self {
2612        self.webhook_secret_secret_version = v.into();
2613        self
2614    }
2615
2616    /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2617    ///
2618    /// # Example
2619    /// ```ignore,no_run
2620    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2621    /// use google_cloud_developerconnect_v1::model::UserCredential;
2622    /// let x = GitLabEnterpriseConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2623    /// ```
2624    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2625    where
2626        T: std::convert::Into<crate::model::UserCredential>,
2627    {
2628        self.read_authorizer_credential = std::option::Option::Some(v.into());
2629        self
2630    }
2631
2632    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2633    ///
2634    /// # Example
2635    /// ```ignore,no_run
2636    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2637    /// use google_cloud_developerconnect_v1::model::UserCredential;
2638    /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2639    /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2640    /// ```
2641    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2642    where
2643        T: std::convert::Into<crate::model::UserCredential>,
2644    {
2645        self.read_authorizer_credential = v.map(|x| x.into());
2646        self
2647    }
2648
2649    /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2650    ///
2651    /// # Example
2652    /// ```ignore,no_run
2653    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2654    /// use google_cloud_developerconnect_v1::model::UserCredential;
2655    /// let x = GitLabEnterpriseConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2656    /// ```
2657    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2658    where
2659        T: std::convert::Into<crate::model::UserCredential>,
2660    {
2661        self.authorizer_credential = std::option::Option::Some(v.into());
2662        self
2663    }
2664
2665    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2666    ///
2667    /// # Example
2668    /// ```ignore,no_run
2669    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2670    /// use google_cloud_developerconnect_v1::model::UserCredential;
2671    /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2672    /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2673    /// ```
2674    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2675    where
2676        T: std::convert::Into<crate::model::UserCredential>,
2677    {
2678        self.authorizer_credential = v.map(|x| x.into());
2679        self
2680    }
2681
2682    /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2683    ///
2684    /// # Example
2685    /// ```ignore,no_run
2686    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2687    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2688    /// let x = GitLabEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2689    /// ```
2690    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2691    where
2692        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2693    {
2694        self.service_directory_config = std::option::Option::Some(v.into());
2695        self
2696    }
2697
2698    /// Sets or clears the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2699    ///
2700    /// # Example
2701    /// ```ignore,no_run
2702    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2703    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2704    /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2705    /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2706    /// ```
2707    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2708    where
2709        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2710    {
2711        self.service_directory_config = v.map(|x| x.into());
2712        self
2713    }
2714
2715    /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
2716    ///
2717    /// # Example
2718    /// ```ignore,no_run
2719    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2720    /// let x = GitLabEnterpriseConfig::new().set_ssl_ca_certificate("example");
2721    /// ```
2722    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2723        mut self,
2724        v: T,
2725    ) -> Self {
2726        self.ssl_ca_certificate = v.into();
2727        self
2728    }
2729
2730    /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
2731    ///
2732    /// # Example
2733    /// ```ignore,no_run
2734    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2735    /// let x = GitLabEnterpriseConfig::new().set_server_version("example");
2736    /// ```
2737    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2738        self.server_version = v.into();
2739        self
2740    }
2741}
2742
2743impl wkt::message::Message for GitLabEnterpriseConfig {
2744    fn typename() -> &'static str {
2745        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
2746    }
2747}
2748
2749/// Configuration for connections to an instance of Bitbucket Data Center.
2750#[derive(Clone, Default, PartialEq)]
2751#[non_exhaustive]
2752pub struct BitbucketDataCenterConfig {
2753    /// Required. The URI of the Bitbucket Data Center host this connection is for.
2754    pub host_uri: std::string::String,
2755
2756    /// Required. Immutable. SecretManager resource containing the webhook secret
2757    /// used to verify webhook events, formatted as
2758    /// `projects/*/secrets/*/versions/*` or
2759    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2760    /// supported in that location). This is used to validate webhooks.
2761    pub webhook_secret_secret_version: std::string::String,
2762
2763    /// Required. An http access token with the minimum `Repository read` access.
2764    /// It's recommended to use a system account to generate the credentials.
2765    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2766
2767    /// Required. An http access token with the minimum `Repository admin` scope
2768    /// access. This is needed to create webhooks. It's recommended to use a system
2769    /// account to generate these credentials.
2770    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2771
2772    /// Optional. Configuration for using Service Directory to privately connect to
2773    /// a Bitbucket Data Center instance. This should only be set if the Bitbucket
2774    /// Data Center is hosted on-premises and not reachable by public internet. If
2775    /// this field is left empty, calls to the Bitbucket Data Center will be made
2776    /// over the public internet.
2777    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2778
2779    /// Optional. SSL certificate authority to trust when making requests to
2780    /// Bitbucket Data Center.
2781    pub ssl_ca_certificate: std::string::String,
2782
2783    /// Output only. Version of the Bitbucket Data Center server running on the
2784    /// `host_uri`.
2785    pub server_version: std::string::String,
2786
2787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2788}
2789
2790impl BitbucketDataCenterConfig {
2791    pub fn new() -> Self {
2792        std::default::Default::default()
2793    }
2794
2795    /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
2796    ///
2797    /// # Example
2798    /// ```ignore,no_run
2799    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2800    /// let x = BitbucketDataCenterConfig::new().set_host_uri("example");
2801    /// ```
2802    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2803        self.host_uri = v.into();
2804        self
2805    }
2806
2807    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
2808    ///
2809    /// # Example
2810    /// ```ignore,no_run
2811    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2812    /// let x = BitbucketDataCenterConfig::new().set_webhook_secret_secret_version("example");
2813    /// ```
2814    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2815        mut self,
2816        v: T,
2817    ) -> Self {
2818        self.webhook_secret_secret_version = v.into();
2819        self
2820    }
2821
2822    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2823    ///
2824    /// # Example
2825    /// ```ignore,no_run
2826    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2827    /// use google_cloud_developerconnect_v1::model::UserCredential;
2828    /// let x = BitbucketDataCenterConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2829    /// ```
2830    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2831    where
2832        T: std::convert::Into<crate::model::UserCredential>,
2833    {
2834        self.read_authorizer_credential = std::option::Option::Some(v.into());
2835        self
2836    }
2837
2838    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2839    ///
2840    /// # Example
2841    /// ```ignore,no_run
2842    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2843    /// use google_cloud_developerconnect_v1::model::UserCredential;
2844    /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2845    /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2846    /// ```
2847    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2848    where
2849        T: std::convert::Into<crate::model::UserCredential>,
2850    {
2851        self.read_authorizer_credential = v.map(|x| x.into());
2852        self
2853    }
2854
2855    /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2856    ///
2857    /// # Example
2858    /// ```ignore,no_run
2859    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2860    /// use google_cloud_developerconnect_v1::model::UserCredential;
2861    /// let x = BitbucketDataCenterConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2862    /// ```
2863    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2864    where
2865        T: std::convert::Into<crate::model::UserCredential>,
2866    {
2867        self.authorizer_credential = std::option::Option::Some(v.into());
2868        self
2869    }
2870
2871    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2872    ///
2873    /// # Example
2874    /// ```ignore,no_run
2875    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2876    /// use google_cloud_developerconnect_v1::model::UserCredential;
2877    /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2878    /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2879    /// ```
2880    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2881    where
2882        T: std::convert::Into<crate::model::UserCredential>,
2883    {
2884        self.authorizer_credential = v.map(|x| x.into());
2885        self
2886    }
2887
2888    /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2889    ///
2890    /// # Example
2891    /// ```ignore,no_run
2892    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2893    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2894    /// let x = BitbucketDataCenterConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2895    /// ```
2896    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2897    where
2898        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2899    {
2900        self.service_directory_config = std::option::Option::Some(v.into());
2901        self
2902    }
2903
2904    /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2905    ///
2906    /// # Example
2907    /// ```ignore,no_run
2908    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2909    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2910    /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2911    /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2912    /// ```
2913    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2914    where
2915        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2916    {
2917        self.service_directory_config = v.map(|x| x.into());
2918        self
2919    }
2920
2921    /// Sets the value of [ssl_ca_certificate][crate::model::BitbucketDataCenterConfig::ssl_ca_certificate].
2922    ///
2923    /// # Example
2924    /// ```ignore,no_run
2925    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2926    /// let x = BitbucketDataCenterConfig::new().set_ssl_ca_certificate("example");
2927    /// ```
2928    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2929        mut self,
2930        v: T,
2931    ) -> Self {
2932        self.ssl_ca_certificate = v.into();
2933        self
2934    }
2935
2936    /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
2937    ///
2938    /// # Example
2939    /// ```ignore,no_run
2940    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2941    /// let x = BitbucketDataCenterConfig::new().set_server_version("example");
2942    /// ```
2943    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2944        self.server_version = v.into();
2945        self
2946    }
2947}
2948
2949impl wkt::message::Message for BitbucketDataCenterConfig {
2950    fn typename() -> &'static str {
2951        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
2952    }
2953}
2954
2955/// Configuration for connections to an instance of Bitbucket Cloud.
2956#[derive(Clone, Default, PartialEq)]
2957#[non_exhaustive]
2958pub struct BitbucketCloudConfig {
2959    /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
2960    /// Platform.
2961    pub workspace: std::string::String,
2962
2963    /// Required. Immutable. SecretManager resource containing the webhook secret
2964    /// used to verify webhook events, formatted as
2965    /// `projects/*/secrets/*/versions/*` or
2966    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2967    /// supported in that location). This is used to validate and create webhooks.
2968    pub webhook_secret_secret_version: std::string::String,
2969
2970    /// Required. An access token with the minimum `repository` access.
2971    /// It can either be a workspace, project or repository access token.
2972    /// It's recommended to use a system account to generate the credentials.
2973    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2974
2975    /// Required. An access token with the minimum `repository`, `pullrequest` and
2976    /// `webhook` scope access. It can either be a workspace, project or repository
2977    /// access token. This is needed to create webhooks. It's recommended to use a
2978    /// system account to generate these credentials.
2979    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2980
2981    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2982}
2983
2984impl BitbucketCloudConfig {
2985    pub fn new() -> Self {
2986        std::default::Default::default()
2987    }
2988
2989    /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
2990    ///
2991    /// # Example
2992    /// ```ignore,no_run
2993    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
2994    /// let x = BitbucketCloudConfig::new().set_workspace("example");
2995    /// ```
2996    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2997        self.workspace = v.into();
2998        self
2999    }
3000
3001    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
3002    ///
3003    /// # Example
3004    /// ```ignore,no_run
3005    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3006    /// let x = BitbucketCloudConfig::new().set_webhook_secret_secret_version("example");
3007    /// ```
3008    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3009        mut self,
3010        v: T,
3011    ) -> Self {
3012        self.webhook_secret_secret_version = v.into();
3013        self
3014    }
3015
3016    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3017    ///
3018    /// # Example
3019    /// ```ignore,no_run
3020    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3021    /// use google_cloud_developerconnect_v1::model::UserCredential;
3022    /// let x = BitbucketCloudConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
3023    /// ```
3024    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3025    where
3026        T: std::convert::Into<crate::model::UserCredential>,
3027    {
3028        self.read_authorizer_credential = std::option::Option::Some(v.into());
3029        self
3030    }
3031
3032    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3033    ///
3034    /// # Example
3035    /// ```ignore,no_run
3036    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3037    /// use google_cloud_developerconnect_v1::model::UserCredential;
3038    /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
3039    /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
3040    /// ```
3041    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3042    where
3043        T: std::convert::Into<crate::model::UserCredential>,
3044    {
3045        self.read_authorizer_credential = v.map(|x| x.into());
3046        self
3047    }
3048
3049    /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3050    ///
3051    /// # Example
3052    /// ```ignore,no_run
3053    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3054    /// use google_cloud_developerconnect_v1::model::UserCredential;
3055    /// let x = BitbucketCloudConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
3056    /// ```
3057    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3058    where
3059        T: std::convert::Into<crate::model::UserCredential>,
3060    {
3061        self.authorizer_credential = std::option::Option::Some(v.into());
3062        self
3063    }
3064
3065    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3066    ///
3067    /// # Example
3068    /// ```ignore,no_run
3069    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3070    /// use google_cloud_developerconnect_v1::model::UserCredential;
3071    /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
3072    /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
3073    /// ```
3074    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3075    where
3076        T: std::convert::Into<crate::model::UserCredential>,
3077    {
3078        self.authorizer_credential = v.map(|x| x.into());
3079        self
3080    }
3081}
3082
3083impl wkt::message::Message for BitbucketCloudConfig {
3084    fn typename() -> &'static str {
3085        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
3086    }
3087}
3088
3089/// Configuration for connections to Secure Source Manager instance
3090#[derive(Clone, Default, PartialEq)]
3091#[non_exhaustive]
3092pub struct SecureSourceManagerInstanceConfig {
3093    /// Required. Immutable. Secure Source Manager instance resource, formatted as
3094    /// `projects/*/locations/*/instances/*`
3095    pub instance: std::string::String,
3096
3097    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3098}
3099
3100impl SecureSourceManagerInstanceConfig {
3101    pub fn new() -> Self {
3102        std::default::Default::default()
3103    }
3104
3105    /// Sets the value of [instance][crate::model::SecureSourceManagerInstanceConfig::instance].
3106    ///
3107    /// # Example
3108    /// ```ignore,no_run
3109    /// # use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
3110    /// let x = SecureSourceManagerInstanceConfig::new().set_instance("example");
3111    /// ```
3112    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3113        self.instance = v.into();
3114        self
3115    }
3116}
3117
3118impl wkt::message::Message for SecureSourceManagerInstanceConfig {
3119    fn typename() -> &'static str {
3120        "type.googleapis.com/google.cloud.developerconnect.v1.SecureSourceManagerInstanceConfig"
3121    }
3122}
3123
3124/// Message for requesting list of Connections
3125#[derive(Clone, Default, PartialEq)]
3126#[non_exhaustive]
3127pub struct ListConnectionsRequest {
3128    /// Required. Parent value for ListConnectionsRequest
3129    pub parent: std::string::String,
3130
3131    /// Optional. Requested page size. Server may return fewer items than
3132    /// requested. If unspecified, server will pick an appropriate default.
3133    pub page_size: i32,
3134
3135    /// Optional. A token identifying a page of results the server should return.
3136    pub page_token: std::string::String,
3137
3138    /// Optional. Filtering results
3139    pub filter: std::string::String,
3140
3141    /// Optional. Hint for how to order the results
3142    pub order_by: std::string::String,
3143
3144    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3145}
3146
3147impl ListConnectionsRequest {
3148    pub fn new() -> Self {
3149        std::default::Default::default()
3150    }
3151
3152    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
3153    ///
3154    /// # Example
3155    /// ```ignore,no_run
3156    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3157    /// let x = ListConnectionsRequest::new().set_parent("example");
3158    /// ```
3159    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160        self.parent = v.into();
3161        self
3162    }
3163
3164    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
3165    ///
3166    /// # Example
3167    /// ```ignore,no_run
3168    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3169    /// let x = ListConnectionsRequest::new().set_page_size(42);
3170    /// ```
3171    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3172        self.page_size = v.into();
3173        self
3174    }
3175
3176    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
3177    ///
3178    /// # Example
3179    /// ```ignore,no_run
3180    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3181    /// let x = ListConnectionsRequest::new().set_page_token("example");
3182    /// ```
3183    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3184        self.page_token = v.into();
3185        self
3186    }
3187
3188    /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
3189    ///
3190    /// # Example
3191    /// ```ignore,no_run
3192    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3193    /// let x = ListConnectionsRequest::new().set_filter("example");
3194    /// ```
3195    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3196        self.filter = v.into();
3197        self
3198    }
3199
3200    /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
3201    ///
3202    /// # Example
3203    /// ```ignore,no_run
3204    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3205    /// let x = ListConnectionsRequest::new().set_order_by("example");
3206    /// ```
3207    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3208        self.order_by = v.into();
3209        self
3210    }
3211}
3212
3213impl wkt::message::Message for ListConnectionsRequest {
3214    fn typename() -> &'static str {
3215        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
3216    }
3217}
3218
3219/// Message for response to listing Connections
3220#[derive(Clone, Default, PartialEq)]
3221#[non_exhaustive]
3222pub struct ListConnectionsResponse {
3223    /// The list of Connection
3224    pub connections: std::vec::Vec<crate::model::Connection>,
3225
3226    /// A token identifying a page of results the server should return.
3227    pub next_page_token: std::string::String,
3228
3229    /// Locations that could not be reached.
3230    pub unreachable: std::vec::Vec<std::string::String>,
3231
3232    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3233}
3234
3235impl ListConnectionsResponse {
3236    pub fn new() -> Self {
3237        std::default::Default::default()
3238    }
3239
3240    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
3241    ///
3242    /// # Example
3243    /// ```ignore,no_run
3244    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3245    /// use google_cloud_developerconnect_v1::model::Connection;
3246    /// let x = ListConnectionsResponse::new()
3247    ///     .set_connections([
3248    ///         Connection::default()/* use setters */,
3249    ///         Connection::default()/* use (different) setters */,
3250    ///     ]);
3251    /// ```
3252    pub fn set_connections<T, V>(mut self, v: T) -> Self
3253    where
3254        T: std::iter::IntoIterator<Item = V>,
3255        V: std::convert::Into<crate::model::Connection>,
3256    {
3257        use std::iter::Iterator;
3258        self.connections = v.into_iter().map(|i| i.into()).collect();
3259        self
3260    }
3261
3262    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
3263    ///
3264    /// # Example
3265    /// ```ignore,no_run
3266    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3267    /// let x = ListConnectionsResponse::new().set_next_page_token("example");
3268    /// ```
3269    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3270        self.next_page_token = v.into();
3271        self
3272    }
3273
3274    /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
3275    ///
3276    /// # Example
3277    /// ```ignore,no_run
3278    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3279    /// let x = ListConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3280    /// ```
3281    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3282    where
3283        T: std::iter::IntoIterator<Item = V>,
3284        V: std::convert::Into<std::string::String>,
3285    {
3286        use std::iter::Iterator;
3287        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3288        self
3289    }
3290}
3291
3292impl wkt::message::Message for ListConnectionsResponse {
3293    fn typename() -> &'static str {
3294        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
3295    }
3296}
3297
3298#[doc(hidden)]
3299impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
3300    type PageItem = crate::model::Connection;
3301
3302    fn items(self) -> std::vec::Vec<Self::PageItem> {
3303        self.connections
3304    }
3305
3306    fn next_page_token(&self) -> std::string::String {
3307        use std::clone::Clone;
3308        self.next_page_token.clone()
3309    }
3310}
3311
3312/// Message for getting a Connection
3313#[derive(Clone, Default, PartialEq)]
3314#[non_exhaustive]
3315pub struct GetConnectionRequest {
3316    /// Required. Name of the resource
3317    pub name: std::string::String,
3318
3319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3320}
3321
3322impl GetConnectionRequest {
3323    pub fn new() -> Self {
3324        std::default::Default::default()
3325    }
3326
3327    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
3328    ///
3329    /// # Example
3330    /// ```ignore,no_run
3331    /// # use google_cloud_developerconnect_v1::model::GetConnectionRequest;
3332    /// let x = GetConnectionRequest::new().set_name("example");
3333    /// ```
3334    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3335        self.name = v.into();
3336        self
3337    }
3338}
3339
3340impl wkt::message::Message for GetConnectionRequest {
3341    fn typename() -> &'static str {
3342        "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
3343    }
3344}
3345
3346/// Message for creating a Connection
3347#[derive(Clone, Default, PartialEq)]
3348#[non_exhaustive]
3349pub struct CreateConnectionRequest {
3350    /// Required. Value for parent.
3351    pub parent: std::string::String,
3352
3353    /// Required. Id of the requesting object
3354    /// If auto-generating Id server-side, remove this field and
3355    /// connection_id from the method_signature of Create RPC
3356    pub connection_id: std::string::String,
3357
3358    /// Required. The resource being created
3359    pub connection: std::option::Option<crate::model::Connection>,
3360
3361    /// Optional. An optional request ID to identify requests. Specify a unique
3362    /// request ID so that if you must retry your request, the server will know to
3363    /// ignore the request if it has already been completed. The server will
3364    /// guarantee that for at least 60 minutes since the first request.
3365    ///
3366    /// For example, consider a situation where you make an initial request and the
3367    /// request times out. If you make the request again with the same request
3368    /// ID, the server can check if original operation with the same request ID
3369    /// was received, and if so, will ignore the second request. This prevents
3370    /// clients from accidentally creating duplicate commitments.
3371    ///
3372    /// The request ID must be a valid UUID with the exception that zero UUID is
3373    /// not supported (00000000-0000-0000-0000-000000000000).
3374    pub request_id: std::string::String,
3375
3376    /// Optional. If set, validate the request, but do not actually post it.
3377    pub validate_only: bool,
3378
3379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3380}
3381
3382impl CreateConnectionRequest {
3383    pub fn new() -> Self {
3384        std::default::Default::default()
3385    }
3386
3387    /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
3388    ///
3389    /// # Example
3390    /// ```ignore,no_run
3391    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3392    /// let x = CreateConnectionRequest::new().set_parent("example");
3393    /// ```
3394    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3395        self.parent = v.into();
3396        self
3397    }
3398
3399    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
3400    ///
3401    /// # Example
3402    /// ```ignore,no_run
3403    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3404    /// let x = CreateConnectionRequest::new().set_connection_id("example");
3405    /// ```
3406    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3407        self.connection_id = v.into();
3408        self
3409    }
3410
3411    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
3412    ///
3413    /// # Example
3414    /// ```ignore,no_run
3415    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3416    /// use google_cloud_developerconnect_v1::model::Connection;
3417    /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3418    /// ```
3419    pub fn set_connection<T>(mut self, v: T) -> Self
3420    where
3421        T: std::convert::Into<crate::model::Connection>,
3422    {
3423        self.connection = std::option::Option::Some(v.into());
3424        self
3425    }
3426
3427    /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
3428    ///
3429    /// # Example
3430    /// ```ignore,no_run
3431    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3432    /// use google_cloud_developerconnect_v1::model::Connection;
3433    /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3434    /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3435    /// ```
3436    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3437    where
3438        T: std::convert::Into<crate::model::Connection>,
3439    {
3440        self.connection = v.map(|x| x.into());
3441        self
3442    }
3443
3444    /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
3445    ///
3446    /// # Example
3447    /// ```ignore,no_run
3448    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3449    /// let x = CreateConnectionRequest::new().set_request_id("example");
3450    /// ```
3451    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3452        self.request_id = v.into();
3453        self
3454    }
3455
3456    /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
3457    ///
3458    /// # Example
3459    /// ```ignore,no_run
3460    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3461    /// let x = CreateConnectionRequest::new().set_validate_only(true);
3462    /// ```
3463    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3464        self.validate_only = v.into();
3465        self
3466    }
3467}
3468
3469impl wkt::message::Message for CreateConnectionRequest {
3470    fn typename() -> &'static str {
3471        "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
3472    }
3473}
3474
3475/// Message for updating a Connection
3476#[derive(Clone, Default, PartialEq)]
3477#[non_exhaustive]
3478pub struct UpdateConnectionRequest {
3479    /// Required. Field mask is used to specify the fields to be overwritten in the
3480    /// Connection resource by the update.
3481    /// The fields specified in the update_mask are relative to the resource, not
3482    /// the full request. A field will be overwritten if it is in the mask. If the
3483    /// user does not provide a mask then all fields will be overwritten.
3484    pub update_mask: std::option::Option<wkt::FieldMask>,
3485
3486    /// Required. The resource being updated
3487    pub connection: std::option::Option<crate::model::Connection>,
3488
3489    /// Optional. An optional request ID to identify requests. Specify a unique
3490    /// request ID so that if you must retry your request, the server will know to
3491    /// ignore the request if it has already been completed. The server will
3492    /// guarantee that for at least 60 minutes since the first request.
3493    ///
3494    /// For example, consider a situation where you make an initial request and the
3495    /// request times out. If you make the request again with the same request
3496    /// ID, the server can check if original operation with the same request ID
3497    /// was received, and if so, will ignore the second request. This prevents
3498    /// clients from accidentally creating duplicate commitments.
3499    ///
3500    /// The request ID must be a valid UUID with the exception that zero UUID is
3501    /// not supported (00000000-0000-0000-0000-000000000000).
3502    pub request_id: std::string::String,
3503
3504    /// Optional. If set to true, and the connection is not found a new connection
3505    /// will be created. In this situation `update_mask` is ignored.
3506    /// The creation will succeed only if the input connection has all the
3507    /// necessary information (e.g a github_config with both  user_oauth_token and
3508    /// installation_id properties).
3509    pub allow_missing: bool,
3510
3511    /// Optional. If set, validate the request, but do not actually post it.
3512    pub validate_only: bool,
3513
3514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3515}
3516
3517impl UpdateConnectionRequest {
3518    pub fn new() -> Self {
3519        std::default::Default::default()
3520    }
3521
3522    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3523    ///
3524    /// # Example
3525    /// ```ignore,no_run
3526    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3527    /// use wkt::FieldMask;
3528    /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3529    /// ```
3530    pub fn set_update_mask<T>(mut self, v: T) -> Self
3531    where
3532        T: std::convert::Into<wkt::FieldMask>,
3533    {
3534        self.update_mask = std::option::Option::Some(v.into());
3535        self
3536    }
3537
3538    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3539    ///
3540    /// # Example
3541    /// ```ignore,no_run
3542    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3543    /// use wkt::FieldMask;
3544    /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3545    /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3546    /// ```
3547    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3548    where
3549        T: std::convert::Into<wkt::FieldMask>,
3550    {
3551        self.update_mask = v.map(|x| x.into());
3552        self
3553    }
3554
3555    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
3556    ///
3557    /// # Example
3558    /// ```ignore,no_run
3559    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3560    /// use google_cloud_developerconnect_v1::model::Connection;
3561    /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3562    /// ```
3563    pub fn set_connection<T>(mut self, v: T) -> Self
3564    where
3565        T: std::convert::Into<crate::model::Connection>,
3566    {
3567        self.connection = std::option::Option::Some(v.into());
3568        self
3569    }
3570
3571    /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
3572    ///
3573    /// # Example
3574    /// ```ignore,no_run
3575    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3576    /// use google_cloud_developerconnect_v1::model::Connection;
3577    /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3578    /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3579    /// ```
3580    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3581    where
3582        T: std::convert::Into<crate::model::Connection>,
3583    {
3584        self.connection = v.map(|x| x.into());
3585        self
3586    }
3587
3588    /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
3589    ///
3590    /// # Example
3591    /// ```ignore,no_run
3592    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3593    /// let x = UpdateConnectionRequest::new().set_request_id("example");
3594    /// ```
3595    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3596        self.request_id = v.into();
3597        self
3598    }
3599
3600    /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
3601    ///
3602    /// # Example
3603    /// ```ignore,no_run
3604    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3605    /// let x = UpdateConnectionRequest::new().set_allow_missing(true);
3606    /// ```
3607    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3608        self.allow_missing = v.into();
3609        self
3610    }
3611
3612    /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
3613    ///
3614    /// # Example
3615    /// ```ignore,no_run
3616    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3617    /// let x = UpdateConnectionRequest::new().set_validate_only(true);
3618    /// ```
3619    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3620        self.validate_only = v.into();
3621        self
3622    }
3623}
3624
3625impl wkt::message::Message for UpdateConnectionRequest {
3626    fn typename() -> &'static str {
3627        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
3628    }
3629}
3630
3631/// Message for deleting a Connection
3632#[derive(Clone, Default, PartialEq)]
3633#[non_exhaustive]
3634pub struct DeleteConnectionRequest {
3635    /// Required. Name of the resource
3636    pub name: std::string::String,
3637
3638    /// Optional. An optional request ID to identify requests. Specify a unique
3639    /// request ID so that if you must retry your request, the server will know to
3640    /// ignore the request if it has already been completed. The server will
3641    /// guarantee that for at least 60 minutes after the first request.
3642    ///
3643    /// For example, consider a situation where you make an initial request and the
3644    /// request times out. If you make the request again with the same request
3645    /// ID, the server can check if original operation with the same request ID
3646    /// was received, and if so, will ignore the second request. This prevents
3647    /// clients from accidentally creating duplicate commitments.
3648    ///
3649    /// The request ID must be a valid UUID with the exception that zero UUID is
3650    /// not supported (00000000-0000-0000-0000-000000000000).
3651    pub request_id: std::string::String,
3652
3653    /// Optional. If set, validate the request, but do not actually post it.
3654    pub validate_only: bool,
3655
3656    /// Optional. The current etag of the Connection.
3657    /// If an etag is provided and does not match the current etag of the
3658    /// Connection, deletion will be blocked and an ABORTED error will be returned.
3659    pub etag: std::string::String,
3660
3661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3662}
3663
3664impl DeleteConnectionRequest {
3665    pub fn new() -> Self {
3666        std::default::Default::default()
3667    }
3668
3669    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
3670    ///
3671    /// # Example
3672    /// ```ignore,no_run
3673    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3674    /// let x = DeleteConnectionRequest::new().set_name("example");
3675    /// ```
3676    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3677        self.name = v.into();
3678        self
3679    }
3680
3681    /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
3682    ///
3683    /// # Example
3684    /// ```ignore,no_run
3685    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3686    /// let x = DeleteConnectionRequest::new().set_request_id("example");
3687    /// ```
3688    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3689        self.request_id = v.into();
3690        self
3691    }
3692
3693    /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
3694    ///
3695    /// # Example
3696    /// ```ignore,no_run
3697    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3698    /// let x = DeleteConnectionRequest::new().set_validate_only(true);
3699    /// ```
3700    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3701        self.validate_only = v.into();
3702        self
3703    }
3704
3705    /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
3706    ///
3707    /// # Example
3708    /// ```ignore,no_run
3709    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3710    /// let x = DeleteConnectionRequest::new().set_etag("example");
3711    /// ```
3712    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3713        self.etag = v.into();
3714        self
3715    }
3716}
3717
3718impl wkt::message::Message for DeleteConnectionRequest {
3719    fn typename() -> &'static str {
3720        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
3721    }
3722}
3723
3724/// Message for requesting list of AccountConnectors
3725#[derive(Clone, Default, PartialEq)]
3726#[non_exhaustive]
3727pub struct ListAccountConnectorsRequest {
3728    /// Required. Parent value for ListAccountConnectorsRequest
3729    pub parent: std::string::String,
3730
3731    /// Optional. Requested page size. Server may return fewer items than
3732    /// requested. If unspecified, server will pick an appropriate default.
3733    pub page_size: i32,
3734
3735    /// Optional. A token identifying a page of results the server should return.
3736    pub page_token: std::string::String,
3737
3738    /// Optional. Filtering results
3739    pub filter: std::string::String,
3740
3741    /// Optional. Hint for how to order the results
3742    pub order_by: std::string::String,
3743
3744    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3745}
3746
3747impl ListAccountConnectorsRequest {
3748    pub fn new() -> Self {
3749        std::default::Default::default()
3750    }
3751
3752    /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
3753    ///
3754    /// # Example
3755    /// ```ignore,no_run
3756    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3757    /// let x = ListAccountConnectorsRequest::new().set_parent("example");
3758    /// ```
3759    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3760        self.parent = v.into();
3761        self
3762    }
3763
3764    /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
3765    ///
3766    /// # Example
3767    /// ```ignore,no_run
3768    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3769    /// let x = ListAccountConnectorsRequest::new().set_page_size(42);
3770    /// ```
3771    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3772        self.page_size = v.into();
3773        self
3774    }
3775
3776    /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
3777    ///
3778    /// # Example
3779    /// ```ignore,no_run
3780    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3781    /// let x = ListAccountConnectorsRequest::new().set_page_token("example");
3782    /// ```
3783    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3784        self.page_token = v.into();
3785        self
3786    }
3787
3788    /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
3789    ///
3790    /// # Example
3791    /// ```ignore,no_run
3792    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3793    /// let x = ListAccountConnectorsRequest::new().set_filter("example");
3794    /// ```
3795    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3796        self.filter = v.into();
3797        self
3798    }
3799
3800    /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
3801    ///
3802    /// # Example
3803    /// ```ignore,no_run
3804    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3805    /// let x = ListAccountConnectorsRequest::new().set_order_by("example");
3806    /// ```
3807    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3808        self.order_by = v.into();
3809        self
3810    }
3811}
3812
3813impl wkt::message::Message for ListAccountConnectorsRequest {
3814    fn typename() -> &'static str {
3815        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
3816    }
3817}
3818
3819/// Message for response to listing AccountConnectors
3820#[derive(Clone, Default, PartialEq)]
3821#[non_exhaustive]
3822pub struct ListAccountConnectorsResponse {
3823    /// The list of AccountConnectors
3824    pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
3825
3826    /// A token identifying a page of results the server should return.
3827    pub next_page_token: std::string::String,
3828
3829    /// Locations that could not be reached.
3830    pub unreachable: std::vec::Vec<std::string::String>,
3831
3832    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3833}
3834
3835impl ListAccountConnectorsResponse {
3836    pub fn new() -> Self {
3837        std::default::Default::default()
3838    }
3839
3840    /// Sets the value of [account_connectors][crate::model::ListAccountConnectorsResponse::account_connectors].
3841    ///
3842    /// # Example
3843    /// ```ignore,no_run
3844    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3845    /// use google_cloud_developerconnect_v1::model::AccountConnector;
3846    /// let x = ListAccountConnectorsResponse::new()
3847    ///     .set_account_connectors([
3848    ///         AccountConnector::default()/* use setters */,
3849    ///         AccountConnector::default()/* use (different) setters */,
3850    ///     ]);
3851    /// ```
3852    pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
3853    where
3854        T: std::iter::IntoIterator<Item = V>,
3855        V: std::convert::Into<crate::model::AccountConnector>,
3856    {
3857        use std::iter::Iterator;
3858        self.account_connectors = v.into_iter().map(|i| i.into()).collect();
3859        self
3860    }
3861
3862    /// Sets the value of [next_page_token][crate::model::ListAccountConnectorsResponse::next_page_token].
3863    ///
3864    /// # Example
3865    /// ```ignore,no_run
3866    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3867    /// let x = ListAccountConnectorsResponse::new().set_next_page_token("example");
3868    /// ```
3869    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3870        self.next_page_token = v.into();
3871        self
3872    }
3873
3874    /// Sets the value of [unreachable][crate::model::ListAccountConnectorsResponse::unreachable].
3875    ///
3876    /// # Example
3877    /// ```ignore,no_run
3878    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3879    /// let x = ListAccountConnectorsResponse::new().set_unreachable(["a", "b", "c"]);
3880    /// ```
3881    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3882    where
3883        T: std::iter::IntoIterator<Item = V>,
3884        V: std::convert::Into<std::string::String>,
3885    {
3886        use std::iter::Iterator;
3887        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3888        self
3889    }
3890}
3891
3892impl wkt::message::Message for ListAccountConnectorsResponse {
3893    fn typename() -> &'static str {
3894        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
3895    }
3896}
3897
3898#[doc(hidden)]
3899impl google_cloud_gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
3900    type PageItem = crate::model::AccountConnector;
3901
3902    fn items(self) -> std::vec::Vec<Self::PageItem> {
3903        self.account_connectors
3904    }
3905
3906    fn next_page_token(&self) -> std::string::String {
3907        use std::clone::Clone;
3908        self.next_page_token.clone()
3909    }
3910}
3911
3912/// Message for getting a AccountConnector
3913#[derive(Clone, Default, PartialEq)]
3914#[non_exhaustive]
3915pub struct GetAccountConnectorRequest {
3916    /// Required. Name of the resource
3917    pub name: std::string::String,
3918
3919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3920}
3921
3922impl GetAccountConnectorRequest {
3923    pub fn new() -> Self {
3924        std::default::Default::default()
3925    }
3926
3927    /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
3928    ///
3929    /// # Example
3930    /// ```ignore,no_run
3931    /// # use google_cloud_developerconnect_v1::model::GetAccountConnectorRequest;
3932    /// let x = GetAccountConnectorRequest::new().set_name("example");
3933    /// ```
3934    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3935        self.name = v.into();
3936        self
3937    }
3938}
3939
3940impl wkt::message::Message for GetAccountConnectorRequest {
3941    fn typename() -> &'static str {
3942        "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
3943    }
3944}
3945
3946#[derive(Clone, Default, PartialEq)]
3947#[non_exhaustive]
3948pub struct CreateAccountConnectorRequest {
3949    /// Required. Location resource name as the account_connector’s parent.
3950    pub parent: std::string::String,
3951
3952    /// Required. The ID to use for the AccountConnector, which will become the
3953    /// final component of the AccountConnector's resource name. Its format should
3954    /// adhere to <https://google.aip.dev/122#resource-id-segments> Names must be
3955    /// unique per-project per-location.
3956    pub account_connector_id: std::string::String,
3957
3958    /// Required. The AccountConnector to create.
3959    pub account_connector: std::option::Option<crate::model::AccountConnector>,
3960
3961    /// Optional. An optional request ID to identify requests. Specify a unique
3962    /// request ID so that if you must retry your request, the server will know to
3963    /// ignore the request if it has already been completed. The server will
3964    /// guarantee that for at least 60 minutes since the first request.
3965    ///
3966    /// For example, consider a situation where you make an initial request and the
3967    /// request times out. If you make the request again with the same request
3968    /// ID, the server can check if original operation with the same request ID
3969    /// was received, and if so, will ignore the second request. This prevents
3970    /// clients from accidentally creating duplicate commitments.
3971    ///
3972    /// The request ID must be a valid UUID with the exception that zero UUID is
3973    /// not supported (00000000-0000-0000-0000-000000000000).
3974    pub request_id: std::string::String,
3975
3976    /// Optional. If set, validate the request, but do not actually post it.
3977    pub validate_only: bool,
3978
3979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3980}
3981
3982impl CreateAccountConnectorRequest {
3983    pub fn new() -> Self {
3984        std::default::Default::default()
3985    }
3986
3987    /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
3988    ///
3989    /// # Example
3990    /// ```ignore,no_run
3991    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
3992    /// let x = CreateAccountConnectorRequest::new().set_parent("example");
3993    /// ```
3994    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3995        self.parent = v.into();
3996        self
3997    }
3998
3999    /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
4000    ///
4001    /// # Example
4002    /// ```ignore,no_run
4003    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4004    /// let x = CreateAccountConnectorRequest::new().set_account_connector_id("example");
4005    /// ```
4006    pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
4007        mut self,
4008        v: T,
4009    ) -> Self {
4010        self.account_connector_id = v.into();
4011        self
4012    }
4013
4014    /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4015    ///
4016    /// # Example
4017    /// ```ignore,no_run
4018    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4019    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4020    /// let x = CreateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4021    /// ```
4022    pub fn set_account_connector<T>(mut self, v: T) -> Self
4023    where
4024        T: std::convert::Into<crate::model::AccountConnector>,
4025    {
4026        self.account_connector = std::option::Option::Some(v.into());
4027        self
4028    }
4029
4030    /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4031    ///
4032    /// # Example
4033    /// ```ignore,no_run
4034    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4035    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4036    /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4037    /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4038    /// ```
4039    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4040    where
4041        T: std::convert::Into<crate::model::AccountConnector>,
4042    {
4043        self.account_connector = v.map(|x| x.into());
4044        self
4045    }
4046
4047    /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
4048    ///
4049    /// # Example
4050    /// ```ignore,no_run
4051    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4052    /// let x = CreateAccountConnectorRequest::new().set_request_id("example");
4053    /// ```
4054    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4055        self.request_id = v.into();
4056        self
4057    }
4058
4059    /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
4060    ///
4061    /// # Example
4062    /// ```ignore,no_run
4063    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4064    /// let x = CreateAccountConnectorRequest::new().set_validate_only(true);
4065    /// ```
4066    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4067        self.validate_only = v.into();
4068        self
4069    }
4070}
4071
4072impl wkt::message::Message for CreateAccountConnectorRequest {
4073    fn typename() -> &'static str {
4074        "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
4075    }
4076}
4077
4078/// Message for updating a AccountConnector
4079#[derive(Clone, Default, PartialEq)]
4080#[non_exhaustive]
4081pub struct UpdateAccountConnectorRequest {
4082    /// Optional. The list of fields to be updated.
4083    pub update_mask: std::option::Option<wkt::FieldMask>,
4084
4085    /// Required. The AccountConnector to update.
4086    pub account_connector: std::option::Option<crate::model::AccountConnector>,
4087
4088    /// Optional. An optional request ID to identify requests. Specify a unique
4089    /// request ID so that if you must retry your request, the server will know to
4090    /// ignore the request if it has already been completed. The server will
4091    /// guarantee that for at least 60 minutes since the first request.
4092    ///
4093    /// For example, consider a situation where you make an initial request and the
4094    /// request times out. If you make the request again with the same request
4095    /// ID, the server can check if original operation with the same request ID
4096    /// was received, and if so, will ignore the second request. This prevents
4097    /// clients from accidentally creating duplicate commitments.
4098    ///
4099    /// The request ID must be a valid UUID with the exception that zero UUID is
4100    /// not supported (00000000-0000-0000-0000-000000000000).
4101    pub request_id: std::string::String,
4102
4103    /// Optional. If set to true, and the accountConnector is not found a new
4104    /// accountConnector will be created. In this situation `update_mask` is
4105    /// ignored. The creation will succeed only if the input accountConnector has
4106    /// all the necessary
4107    pub allow_missing: bool,
4108
4109    /// Optional. If set, validate the request, but do not actually post it.
4110    pub validate_only: bool,
4111
4112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4113}
4114
4115impl UpdateAccountConnectorRequest {
4116    pub fn new() -> Self {
4117        std::default::Default::default()
4118    }
4119
4120    /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4121    ///
4122    /// # Example
4123    /// ```ignore,no_run
4124    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4125    /// use wkt::FieldMask;
4126    /// let x = UpdateAccountConnectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4127    /// ```
4128    pub fn set_update_mask<T>(mut self, v: T) -> Self
4129    where
4130        T: std::convert::Into<wkt::FieldMask>,
4131    {
4132        self.update_mask = std::option::Option::Some(v.into());
4133        self
4134    }
4135
4136    /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4137    ///
4138    /// # Example
4139    /// ```ignore,no_run
4140    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4141    /// use wkt::FieldMask;
4142    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4143    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4144    /// ```
4145    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4146    where
4147        T: std::convert::Into<wkt::FieldMask>,
4148    {
4149        self.update_mask = v.map(|x| x.into());
4150        self
4151    }
4152
4153    /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4154    ///
4155    /// # Example
4156    /// ```ignore,no_run
4157    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4158    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4159    /// let x = UpdateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4160    /// ```
4161    pub fn set_account_connector<T>(mut self, v: T) -> Self
4162    where
4163        T: std::convert::Into<crate::model::AccountConnector>,
4164    {
4165        self.account_connector = std::option::Option::Some(v.into());
4166        self
4167    }
4168
4169    /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4170    ///
4171    /// # Example
4172    /// ```ignore,no_run
4173    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4174    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4175    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4176    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4177    /// ```
4178    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4179    where
4180        T: std::convert::Into<crate::model::AccountConnector>,
4181    {
4182        self.account_connector = v.map(|x| x.into());
4183        self
4184    }
4185
4186    /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
4187    ///
4188    /// # Example
4189    /// ```ignore,no_run
4190    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4191    /// let x = UpdateAccountConnectorRequest::new().set_request_id("example");
4192    /// ```
4193    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4194        self.request_id = v.into();
4195        self
4196    }
4197
4198    /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
4199    ///
4200    /// # Example
4201    /// ```ignore,no_run
4202    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4203    /// let x = UpdateAccountConnectorRequest::new().set_allow_missing(true);
4204    /// ```
4205    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4206        self.allow_missing = v.into();
4207        self
4208    }
4209
4210    /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
4211    ///
4212    /// # Example
4213    /// ```ignore,no_run
4214    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4215    /// let x = UpdateAccountConnectorRequest::new().set_validate_only(true);
4216    /// ```
4217    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4218        self.validate_only = v.into();
4219        self
4220    }
4221}
4222
4223impl wkt::message::Message for UpdateAccountConnectorRequest {
4224    fn typename() -> &'static str {
4225        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
4226    }
4227}
4228
4229/// Message for deleting a AccountConnector
4230#[derive(Clone, Default, PartialEq)]
4231#[non_exhaustive]
4232pub struct DeleteAccountConnectorRequest {
4233    /// Required. Name of the resource
4234    pub name: std::string::String,
4235
4236    /// Optional. An optional request ID to identify requests. Specify a unique
4237    /// request ID so that if you must retry your request, the server will know to
4238    /// ignore the request if it has already been completed. The server will
4239    /// guarantee that for at least 60 minutes after the first request.
4240    ///
4241    /// For example, consider a situation where you make an initial request and the
4242    /// request times out. If you make the request again with the same request
4243    /// ID, the server can check if original operation with the same request ID
4244    /// was received, and if so, will ignore the second request. This prevents
4245    /// clients from accidentally creating duplicate commitments.
4246    ///
4247    /// The request ID must be a valid UUID with the exception that zero UUID is
4248    /// not supported (00000000-0000-0000-0000-000000000000).
4249    pub request_id: std::string::String,
4250
4251    /// Optional. If set, validate the request, but do not actually post it.
4252    pub validate_only: bool,
4253
4254    /// Optional. The current etag of the AccountConnectorn.
4255    /// If an etag is provided and does not match the current etag of the
4256    /// AccountConnector, deletion will be blocked and an ABORTED error will be
4257    /// returned.
4258    pub etag: std::string::String,
4259
4260    /// Optional. If set to true, any Users from this AccountConnector will also
4261    /// be deleted. (Otherwise, the request will only work if the AccountConnector
4262    /// has no Users.)
4263    pub force: bool,
4264
4265    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4266}
4267
4268impl DeleteAccountConnectorRequest {
4269    pub fn new() -> Self {
4270        std::default::Default::default()
4271    }
4272
4273    /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
4274    ///
4275    /// # Example
4276    /// ```ignore,no_run
4277    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4278    /// let x = DeleteAccountConnectorRequest::new().set_name("example");
4279    /// ```
4280    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4281        self.name = v.into();
4282        self
4283    }
4284
4285    /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
4286    ///
4287    /// # Example
4288    /// ```ignore,no_run
4289    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4290    /// let x = DeleteAccountConnectorRequest::new().set_request_id("example");
4291    /// ```
4292    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4293        self.request_id = v.into();
4294        self
4295    }
4296
4297    /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
4298    ///
4299    /// # Example
4300    /// ```ignore,no_run
4301    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4302    /// let x = DeleteAccountConnectorRequest::new().set_validate_only(true);
4303    /// ```
4304    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4305        self.validate_only = v.into();
4306        self
4307    }
4308
4309    /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
4310    ///
4311    /// # Example
4312    /// ```ignore,no_run
4313    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4314    /// let x = DeleteAccountConnectorRequest::new().set_etag("example");
4315    /// ```
4316    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4317        self.etag = v.into();
4318        self
4319    }
4320
4321    /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
4322    ///
4323    /// # Example
4324    /// ```ignore,no_run
4325    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4326    /// let x = DeleteAccountConnectorRequest::new().set_force(true);
4327    /// ```
4328    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4329        self.force = v.into();
4330        self
4331    }
4332}
4333
4334impl wkt::message::Message for DeleteAccountConnectorRequest {
4335    fn typename() -> &'static str {
4336        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
4337    }
4338}
4339
4340/// Message for deleting a User
4341#[derive(Clone, Default, PartialEq)]
4342#[non_exhaustive]
4343pub struct DeleteUserRequest {
4344    /// Required. Name of the resource
4345    pub name: std::string::String,
4346
4347    /// Optional. An optional request ID to identify requests. Specify a unique
4348    /// request ID so that if you must retry your request, the server will know to
4349    /// ignore the request if it has already been completed. The server will
4350    /// guarantee that for at least 60 minutes after the first request.
4351    ///
4352    /// For example, consider a situation where you make an initial request and the
4353    /// request times out. If you make the request again with the same request
4354    /// ID, the server can check if original operation with the same request ID
4355    /// was received, and if so, will ignore the second request. This prevents
4356    /// clients from accidentally creating duplicate commitments.
4357    ///
4358    /// The request ID must be a valid UUID with the exception that zero UUID is
4359    /// not supported (00000000-0000-0000-0000-000000000000).
4360    pub request_id: std::string::String,
4361
4362    /// Optional. If set, validate the request, but do not actually post it.
4363    pub validate_only: bool,
4364
4365    /// Optional. This checksum is computed by the server based on the value of
4366    /// other fields, and may be sent on update and delete requests to ensure the
4367    /// client has an up-to-date value before proceeding.
4368    pub etag: std::string::String,
4369
4370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4371}
4372
4373impl DeleteUserRequest {
4374    pub fn new() -> Self {
4375        std::default::Default::default()
4376    }
4377
4378    /// Sets the value of [name][crate::model::DeleteUserRequest::name].
4379    ///
4380    /// # Example
4381    /// ```ignore,no_run
4382    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4383    /// let x = DeleteUserRequest::new().set_name("example");
4384    /// ```
4385    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4386        self.name = v.into();
4387        self
4388    }
4389
4390    /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
4391    ///
4392    /// # Example
4393    /// ```ignore,no_run
4394    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4395    /// let x = DeleteUserRequest::new().set_request_id("example");
4396    /// ```
4397    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4398        self.request_id = v.into();
4399        self
4400    }
4401
4402    /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
4403    ///
4404    /// # Example
4405    /// ```ignore,no_run
4406    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4407    /// let x = DeleteUserRequest::new().set_validate_only(true);
4408    /// ```
4409    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4410        self.validate_only = v.into();
4411        self
4412    }
4413
4414    /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
4415    ///
4416    /// # Example
4417    /// ```ignore,no_run
4418    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4419    /// let x = DeleteUserRequest::new().set_etag("example");
4420    /// ```
4421    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4422        self.etag = v.into();
4423        self
4424    }
4425}
4426
4427impl wkt::message::Message for DeleteUserRequest {
4428    fn typename() -> &'static str {
4429        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
4430    }
4431}
4432
4433/// Represents the metadata of the long-running operation.
4434#[derive(Clone, Default, PartialEq)]
4435#[non_exhaustive]
4436pub struct OperationMetadata {
4437    /// Output only. The time the operation was created.
4438    pub create_time: std::option::Option<wkt::Timestamp>,
4439
4440    /// Output only. The time the operation finished running.
4441    pub end_time: std::option::Option<wkt::Timestamp>,
4442
4443    /// Output only. Server-defined resource path for the target of the operation.
4444    pub target: std::string::String,
4445
4446    /// Output only. Name of the verb executed by the operation.
4447    pub verb: std::string::String,
4448
4449    /// Output only. Human-readable status of the operation, if any.
4450    pub status_message: std::string::String,
4451
4452    /// Output only. Identifies whether the user has requested cancellation
4453    /// of the operation. Operations that have been cancelled successfully
4454    /// have
4455    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
4456    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
4457    /// corresponding to `Code.CANCELLED`.
4458    ///
4459    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
4460    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4461    pub requested_cancellation: bool,
4462
4463    /// Output only. API version used to start the operation.
4464    pub api_version: std::string::String,
4465
4466    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4467}
4468
4469impl OperationMetadata {
4470    pub fn new() -> Self {
4471        std::default::Default::default()
4472    }
4473
4474    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4475    ///
4476    /// # Example
4477    /// ```ignore,no_run
4478    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4479    /// use wkt::Timestamp;
4480    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4481    /// ```
4482    pub fn set_create_time<T>(mut self, v: T) -> Self
4483    where
4484        T: std::convert::Into<wkt::Timestamp>,
4485    {
4486        self.create_time = std::option::Option::Some(v.into());
4487        self
4488    }
4489
4490    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4491    ///
4492    /// # Example
4493    /// ```ignore,no_run
4494    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4495    /// use wkt::Timestamp;
4496    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4497    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4498    /// ```
4499    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4500    where
4501        T: std::convert::Into<wkt::Timestamp>,
4502    {
4503        self.create_time = v.map(|x| x.into());
4504        self
4505    }
4506
4507    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4508    ///
4509    /// # Example
4510    /// ```ignore,no_run
4511    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4512    /// use wkt::Timestamp;
4513    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4514    /// ```
4515    pub fn set_end_time<T>(mut self, v: T) -> Self
4516    where
4517        T: std::convert::Into<wkt::Timestamp>,
4518    {
4519        self.end_time = std::option::Option::Some(v.into());
4520        self
4521    }
4522
4523    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4524    ///
4525    /// # Example
4526    /// ```ignore,no_run
4527    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4528    /// use wkt::Timestamp;
4529    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4530    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4531    /// ```
4532    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4533    where
4534        T: std::convert::Into<wkt::Timestamp>,
4535    {
4536        self.end_time = v.map(|x| x.into());
4537        self
4538    }
4539
4540    /// Sets the value of [target][crate::model::OperationMetadata::target].
4541    ///
4542    /// # Example
4543    /// ```ignore,no_run
4544    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4545    /// let x = OperationMetadata::new().set_target("example");
4546    /// ```
4547    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4548        self.target = v.into();
4549        self
4550    }
4551
4552    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4553    ///
4554    /// # Example
4555    /// ```ignore,no_run
4556    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4557    /// let x = OperationMetadata::new().set_verb("example");
4558    /// ```
4559    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4560        self.verb = v.into();
4561        self
4562    }
4563
4564    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4565    ///
4566    /// # Example
4567    /// ```ignore,no_run
4568    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4569    /// let x = OperationMetadata::new().set_status_message("example");
4570    /// ```
4571    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4572        self.status_message = v.into();
4573        self
4574    }
4575
4576    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4577    ///
4578    /// # Example
4579    /// ```ignore,no_run
4580    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4581    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4582    /// ```
4583    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4584        self.requested_cancellation = v.into();
4585        self
4586    }
4587
4588    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4589    ///
4590    /// # Example
4591    /// ```ignore,no_run
4592    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4593    /// let x = OperationMetadata::new().set_api_version("example");
4594    /// ```
4595    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4596        self.api_version = v.into();
4597        self
4598    }
4599}
4600
4601impl wkt::message::Message for OperationMetadata {
4602    fn typename() -> &'static str {
4603        "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
4604    }
4605}
4606
4607/// Message for fetching a User of the user themselves.
4608#[derive(Clone, Default, PartialEq)]
4609#[non_exhaustive]
4610pub struct FetchSelfRequest {
4611    /// Required. Name of the AccountConnector resource
4612    pub name: std::string::String,
4613
4614    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4615}
4616
4617impl FetchSelfRequest {
4618    pub fn new() -> Self {
4619        std::default::Default::default()
4620    }
4621
4622    /// Sets the value of [name][crate::model::FetchSelfRequest::name].
4623    ///
4624    /// # Example
4625    /// ```ignore,no_run
4626    /// # use google_cloud_developerconnect_v1::model::FetchSelfRequest;
4627    /// let x = FetchSelfRequest::new().set_name("example");
4628    /// ```
4629    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4630        self.name = v.into();
4631        self
4632    }
4633}
4634
4635impl wkt::message::Message for FetchSelfRequest {
4636    fn typename() -> &'static str {
4637        "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
4638    }
4639}
4640
4641/// Message for deleting a User of the user themselves.
4642#[derive(Clone, Default, PartialEq)]
4643#[non_exhaustive]
4644pub struct DeleteSelfRequest {
4645    /// Required. Name of the AccountConnector resource
4646    pub name: std::string::String,
4647
4648    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4649}
4650
4651impl DeleteSelfRequest {
4652    pub fn new() -> Self {
4653        std::default::Default::default()
4654    }
4655
4656    /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
4657    ///
4658    /// # Example
4659    /// ```ignore,no_run
4660    /// # use google_cloud_developerconnect_v1::model::DeleteSelfRequest;
4661    /// let x = DeleteSelfRequest::new().set_name("example");
4662    /// ```
4663    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4664        self.name = v.into();
4665        self
4666    }
4667}
4668
4669impl wkt::message::Message for DeleteSelfRequest {
4670    fn typename() -> &'static str {
4671        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
4672    }
4673}
4674
4675/// Message for fetching an OAuth access token.
4676#[derive(Clone, Default, PartialEq)]
4677#[non_exhaustive]
4678pub struct FetchAccessTokenRequest {
4679    /// Required. The resource name of the AccountConnector in the format
4680    /// `projects/*/locations/*/accountConnectors/*`.
4681    pub account_connector: std::string::String,
4682
4683    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4684}
4685
4686impl FetchAccessTokenRequest {
4687    pub fn new() -> Self {
4688        std::default::Default::default()
4689    }
4690
4691    /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
4692    ///
4693    /// # Example
4694    /// ```ignore,no_run
4695    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenRequest;
4696    /// let x = FetchAccessTokenRequest::new().set_account_connector("example");
4697    /// ```
4698    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4699        mut self,
4700        v: T,
4701    ) -> Self {
4702        self.account_connector = v.into();
4703        self
4704    }
4705}
4706
4707impl wkt::message::Message for FetchAccessTokenRequest {
4708    fn typename() -> &'static str {
4709        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
4710    }
4711}
4712
4713/// Message for responding to getting an OAuth access token.
4714#[derive(Clone, Default, PartialEq)]
4715#[non_exhaustive]
4716pub struct FetchAccessTokenResponse {
4717    /// The token content.
4718    pub token: std::string::String,
4719
4720    /// Expiration timestamp. Can be empty if unknown or non-expiring.
4721    pub expiration_time: std::option::Option<wkt::Timestamp>,
4722
4723    /// The scopes of the access token.
4724    pub scopes: std::vec::Vec<std::string::String>,
4725
4726    /// The error resulted from exchanging OAuth tokens from the service provider.
4727    pub exchange_error: std::option::Option<crate::model::ExchangeError>,
4728
4729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4730}
4731
4732impl FetchAccessTokenResponse {
4733    pub fn new() -> Self {
4734        std::default::Default::default()
4735    }
4736
4737    /// Sets the value of [token][crate::model::FetchAccessTokenResponse::token].
4738    ///
4739    /// # Example
4740    /// ```ignore,no_run
4741    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4742    /// let x = FetchAccessTokenResponse::new().set_token("example");
4743    /// ```
4744    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4745        self.token = v.into();
4746        self
4747    }
4748
4749    /// Sets the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4750    ///
4751    /// # Example
4752    /// ```ignore,no_run
4753    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4754    /// use wkt::Timestamp;
4755    /// let x = FetchAccessTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
4756    /// ```
4757    pub fn set_expiration_time<T>(mut self, v: T) -> Self
4758    where
4759        T: std::convert::Into<wkt::Timestamp>,
4760    {
4761        self.expiration_time = std::option::Option::Some(v.into());
4762        self
4763    }
4764
4765    /// Sets or clears the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4766    ///
4767    /// # Example
4768    /// ```ignore,no_run
4769    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4770    /// use wkt::Timestamp;
4771    /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
4772    /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
4773    /// ```
4774    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
4775    where
4776        T: std::convert::Into<wkt::Timestamp>,
4777    {
4778        self.expiration_time = v.map(|x| x.into());
4779        self
4780    }
4781
4782    /// Sets the value of [scopes][crate::model::FetchAccessTokenResponse::scopes].
4783    ///
4784    /// # Example
4785    /// ```ignore,no_run
4786    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4787    /// let x = FetchAccessTokenResponse::new().set_scopes(["a", "b", "c"]);
4788    /// ```
4789    pub fn set_scopes<T, V>(mut self, v: T) -> Self
4790    where
4791        T: std::iter::IntoIterator<Item = V>,
4792        V: std::convert::Into<std::string::String>,
4793    {
4794        use std::iter::Iterator;
4795        self.scopes = v.into_iter().map(|i| i.into()).collect();
4796        self
4797    }
4798
4799    /// Sets the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4800    ///
4801    /// # Example
4802    /// ```ignore,no_run
4803    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4804    /// use google_cloud_developerconnect_v1::model::ExchangeError;
4805    /// let x = FetchAccessTokenResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
4806    /// ```
4807    pub fn set_exchange_error<T>(mut self, v: T) -> Self
4808    where
4809        T: std::convert::Into<crate::model::ExchangeError>,
4810    {
4811        self.exchange_error = std::option::Option::Some(v.into());
4812        self
4813    }
4814
4815    /// Sets or clears the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4816    ///
4817    /// # Example
4818    /// ```ignore,no_run
4819    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4820    /// use google_cloud_developerconnect_v1::model::ExchangeError;
4821    /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
4822    /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
4823    /// ```
4824    pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
4825    where
4826        T: std::convert::Into<crate::model::ExchangeError>,
4827    {
4828        self.exchange_error = v.map(|x| x.into());
4829        self
4830    }
4831}
4832
4833impl wkt::message::Message for FetchAccessTokenResponse {
4834    fn typename() -> &'static str {
4835        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
4836    }
4837}
4838
4839/// Message for starting an OAuth flow.
4840#[derive(Clone, Default, PartialEq)]
4841#[non_exhaustive]
4842pub struct StartOAuthRequest {
4843    /// Required. The resource name of the AccountConnector in the format
4844    /// `projects/*/locations/*/accountConnectors/*`.
4845    pub account_connector: std::string::String,
4846
4847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4848}
4849
4850impl StartOAuthRequest {
4851    pub fn new() -> Self {
4852        std::default::Default::default()
4853    }
4854
4855    /// Sets the value of [account_connector][crate::model::StartOAuthRequest::account_connector].
4856    ///
4857    /// # Example
4858    /// ```ignore,no_run
4859    /// # use google_cloud_developerconnect_v1::model::StartOAuthRequest;
4860    /// let x = StartOAuthRequest::new().set_account_connector("example");
4861    /// ```
4862    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4863        mut self,
4864        v: T,
4865    ) -> Self {
4866        self.account_connector = v.into();
4867        self
4868    }
4869}
4870
4871impl wkt::message::Message for StartOAuthRequest {
4872    fn typename() -> &'static str {
4873        "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthRequest"
4874    }
4875}
4876
4877/// Message for responding to starting an OAuth flow.
4878#[derive(Clone, Default, PartialEq)]
4879#[non_exhaustive]
4880pub struct StartOAuthResponse {
4881    /// The ticket to be used for post processing the callback from the service
4882    /// provider.
4883    pub ticket: std::string::String,
4884
4885    /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.1>
4886    pub code_challenge: std::string::String,
4887
4888    /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.2>
4889    pub code_challenge_method: std::string::String,
4890
4891    /// The client ID to the OAuth App of the service provider.
4892    pub client_id: std::string::String,
4893
4894    /// The list of scopes requested by the application.
4895    pub scopes: std::vec::Vec<std::string::String>,
4896
4897    /// The authorization server URL to the OAuth flow of the service provider.
4898    pub auth_uri: std::string::String,
4899
4900    /// The ID of the service provider.
4901    pub id: std::option::Option<crate::model::start_o_auth_response::Id>,
4902
4903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4904}
4905
4906impl StartOAuthResponse {
4907    pub fn new() -> Self {
4908        std::default::Default::default()
4909    }
4910
4911    /// Sets the value of [ticket][crate::model::StartOAuthResponse::ticket].
4912    ///
4913    /// # Example
4914    /// ```ignore,no_run
4915    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4916    /// let x = StartOAuthResponse::new().set_ticket("example");
4917    /// ```
4918    pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4919        self.ticket = v.into();
4920        self
4921    }
4922
4923    /// Sets the value of [code_challenge][crate::model::StartOAuthResponse::code_challenge].
4924    ///
4925    /// # Example
4926    /// ```ignore,no_run
4927    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4928    /// let x = StartOAuthResponse::new().set_code_challenge("example");
4929    /// ```
4930    pub fn set_code_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4931        self.code_challenge = v.into();
4932        self
4933    }
4934
4935    /// Sets the value of [code_challenge_method][crate::model::StartOAuthResponse::code_challenge_method].
4936    ///
4937    /// # Example
4938    /// ```ignore,no_run
4939    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4940    /// let x = StartOAuthResponse::new().set_code_challenge_method("example");
4941    /// ```
4942    pub fn set_code_challenge_method<T: std::convert::Into<std::string::String>>(
4943        mut self,
4944        v: T,
4945    ) -> Self {
4946        self.code_challenge_method = v.into();
4947        self
4948    }
4949
4950    /// Sets the value of [client_id][crate::model::StartOAuthResponse::client_id].
4951    ///
4952    /// # Example
4953    /// ```ignore,no_run
4954    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4955    /// let x = StartOAuthResponse::new().set_client_id("example");
4956    /// ```
4957    pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4958        self.client_id = v.into();
4959        self
4960    }
4961
4962    /// Sets the value of [scopes][crate::model::StartOAuthResponse::scopes].
4963    ///
4964    /// # Example
4965    /// ```ignore,no_run
4966    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4967    /// let x = StartOAuthResponse::new().set_scopes(["a", "b", "c"]);
4968    /// ```
4969    pub fn set_scopes<T, V>(mut self, v: T) -> Self
4970    where
4971        T: std::iter::IntoIterator<Item = V>,
4972        V: std::convert::Into<std::string::String>,
4973    {
4974        use std::iter::Iterator;
4975        self.scopes = v.into_iter().map(|i| i.into()).collect();
4976        self
4977    }
4978
4979    /// Sets the value of [auth_uri][crate::model::StartOAuthResponse::auth_uri].
4980    ///
4981    /// # Example
4982    /// ```ignore,no_run
4983    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4984    /// let x = StartOAuthResponse::new().set_auth_uri("example");
4985    /// ```
4986    pub fn set_auth_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4987        self.auth_uri = v.into();
4988        self
4989    }
4990
4991    /// Sets the value of [id][crate::model::StartOAuthResponse::id].
4992    ///
4993    /// Note that all the setters affecting `id` are mutually
4994    /// exclusive.
4995    ///
4996    /// # Example
4997    /// ```ignore,no_run
4998    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4999    /// use google_cloud_developerconnect_v1::model::SystemProvider;
5000    /// let x0 = StartOAuthResponse::new().set_id(Some(
5001    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Github)));
5002    /// let x1 = StartOAuthResponse::new().set_id(Some(
5003    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Gitlab)));
5004    /// let x2 = StartOAuthResponse::new().set_id(Some(
5005    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Google)));
5006    /// ```
5007    pub fn set_id<
5008        T: std::convert::Into<std::option::Option<crate::model::start_o_auth_response::Id>>,
5009    >(
5010        mut self,
5011        v: T,
5012    ) -> Self {
5013        self.id = v.into();
5014        self
5015    }
5016
5017    /// The value of [id][crate::model::StartOAuthResponse::id]
5018    /// if it holds a `SystemProviderId`, `None` if the field is not set or
5019    /// holds a different branch.
5020    pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
5021        #[allow(unreachable_patterns)]
5022        self.id.as_ref().and_then(|v| match v {
5023            crate::model::start_o_auth_response::Id::SystemProviderId(v) => {
5024                std::option::Option::Some(v)
5025            }
5026            _ => std::option::Option::None,
5027        })
5028    }
5029
5030    /// Sets the value of [id][crate::model::StartOAuthResponse::id]
5031    /// to hold a `SystemProviderId`.
5032    ///
5033    /// Note that all the setters affecting `id` are
5034    /// mutually exclusive.
5035    ///
5036    /// # Example
5037    /// ```ignore,no_run
5038    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5039    /// use google_cloud_developerconnect_v1::model::SystemProvider;
5040    /// let x0 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Github);
5041    /// let x1 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Gitlab);
5042    /// let x2 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Google);
5043    /// assert!(x0.system_provider_id().is_some());
5044    /// assert!(x1.system_provider_id().is_some());
5045    /// assert!(x2.system_provider_id().is_some());
5046    /// ```
5047    pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
5048        mut self,
5049        v: T,
5050    ) -> Self {
5051        self.id = std::option::Option::Some(
5052            crate::model::start_o_auth_response::Id::SystemProviderId(v.into()),
5053        );
5054        self
5055    }
5056}
5057
5058impl wkt::message::Message for StartOAuthResponse {
5059    fn typename() -> &'static str {
5060        "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthResponse"
5061    }
5062}
5063
5064/// Defines additional types related to [StartOAuthResponse].
5065pub mod start_o_auth_response {
5066    #[allow(unused_imports)]
5067    use super::*;
5068
5069    /// The ID of the service provider.
5070    #[derive(Clone, Debug, PartialEq)]
5071    #[non_exhaustive]
5072    pub enum Id {
5073        /// The ID of the system provider.
5074        SystemProviderId(crate::model::SystemProvider),
5075    }
5076}
5077
5078/// Message for finishing an OAuth flow.
5079#[derive(Clone, Default, PartialEq)]
5080#[non_exhaustive]
5081pub struct FinishOAuthRequest {
5082    /// Required. The resource name of the AccountConnector in the format
5083    /// `projects/*/locations/*/accountConnectors/*`.
5084    pub account_connector: std::string::String,
5085
5086    /// The params returned by OAuth flow redirect.
5087    pub params: std::option::Option<crate::model::finish_o_auth_request::Params>,
5088
5089    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5090}
5091
5092impl FinishOAuthRequest {
5093    pub fn new() -> Self {
5094        std::default::Default::default()
5095    }
5096
5097    /// Sets the value of [account_connector][crate::model::FinishOAuthRequest::account_connector].
5098    ///
5099    /// # Example
5100    /// ```ignore,no_run
5101    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5102    /// let x = FinishOAuthRequest::new().set_account_connector("example");
5103    /// ```
5104    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
5105        mut self,
5106        v: T,
5107    ) -> Self {
5108        self.account_connector = v.into();
5109        self
5110    }
5111
5112    /// Sets the value of [params][crate::model::FinishOAuthRequest::params].
5113    ///
5114    /// Note that all the setters affecting `params` are mutually
5115    /// exclusive.
5116    ///
5117    /// # Example
5118    /// ```ignore,no_run
5119    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5120    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5121    /// let x = FinishOAuthRequest::new().set_params(Some(
5122    ///     google_cloud_developerconnect_v1::model::finish_o_auth_request::Params::OauthParams(OAuthParams::default().into())));
5123    /// ```
5124    pub fn set_params<
5125        T: std::convert::Into<std::option::Option<crate::model::finish_o_auth_request::Params>>,
5126    >(
5127        mut self,
5128        v: T,
5129    ) -> Self {
5130        self.params = v.into();
5131        self
5132    }
5133
5134    /// The value of [params][crate::model::FinishOAuthRequest::params]
5135    /// if it holds a `OauthParams`, `None` if the field is not set or
5136    /// holds a different branch.
5137    pub fn oauth_params(
5138        &self,
5139    ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>
5140    {
5141        #[allow(unreachable_patterns)]
5142        self.params.as_ref().and_then(|v| match v {
5143            crate::model::finish_o_auth_request::Params::OauthParams(v) => {
5144                std::option::Option::Some(v)
5145            }
5146            _ => std::option::Option::None,
5147        })
5148    }
5149
5150    /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5151    /// to hold a `OauthParams`.
5152    ///
5153    /// Note that all the setters affecting `params` are
5154    /// mutually exclusive.
5155    ///
5156    /// # Example
5157    /// ```ignore,no_run
5158    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5159    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5160    /// let x = FinishOAuthRequest::new().set_oauth_params(OAuthParams::default()/* use setters */);
5161    /// assert!(x.oauth_params().is_some());
5162    /// assert!(x.google_oauth_params().is_none());
5163    /// ```
5164    pub fn set_oauth_params<
5165        T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>,
5166    >(
5167        mut self,
5168        v: T,
5169    ) -> Self {
5170        self.params = std::option::Option::Some(
5171            crate::model::finish_o_auth_request::Params::OauthParams(v.into()),
5172        );
5173        self
5174    }
5175
5176    /// The value of [params][crate::model::FinishOAuthRequest::params]
5177    /// if it holds a `GoogleOauthParams`, `None` if the field is not set or
5178    /// holds a different branch.
5179    pub fn google_oauth_params(
5180        &self,
5181    ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>
5182    {
5183        #[allow(unreachable_patterns)]
5184        self.params.as_ref().and_then(|v| match v {
5185            crate::model::finish_o_auth_request::Params::GoogleOauthParams(v) => {
5186                std::option::Option::Some(v)
5187            }
5188            _ => std::option::Option::None,
5189        })
5190    }
5191
5192    /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5193    /// to hold a `GoogleOauthParams`.
5194    ///
5195    /// Note that all the setters affecting `params` are
5196    /// mutually exclusive.
5197    ///
5198    /// # Example
5199    /// ```ignore,no_run
5200    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5201    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5202    /// let x = FinishOAuthRequest::new().set_google_oauth_params(GoogleOAuthParams::default()/* use setters */);
5203    /// assert!(x.google_oauth_params().is_some());
5204    /// assert!(x.oauth_params().is_none());
5205    /// ```
5206    pub fn set_google_oauth_params<
5207        T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>,
5208    >(
5209        mut self,
5210        v: T,
5211    ) -> Self {
5212        self.params = std::option::Option::Some(
5213            crate::model::finish_o_auth_request::Params::GoogleOauthParams(v.into()),
5214        );
5215        self
5216    }
5217}
5218
5219impl wkt::message::Message for FinishOAuthRequest {
5220    fn typename() -> &'static str {
5221        "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest"
5222    }
5223}
5224
5225/// Defines additional types related to [FinishOAuthRequest].
5226pub mod finish_o_auth_request {
5227    #[allow(unused_imports)]
5228    use super::*;
5229
5230    /// The params returned by non-Google OAuth 2.0 flow redirect.
5231    #[derive(Clone, Default, PartialEq)]
5232    #[non_exhaustive]
5233    pub struct OAuthParams {
5234        /// Required. The code to be used for getting the token from SCM provider.
5235        pub code: std::string::String,
5236
5237        /// Required. The ticket to be used for post processing the callback from SCM
5238        /// provider.
5239        pub ticket: std::string::String,
5240
5241        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5242    }
5243
5244    impl OAuthParams {
5245        pub fn new() -> Self {
5246            std::default::Default::default()
5247        }
5248
5249        /// Sets the value of [code][crate::model::finish_o_auth_request::OAuthParams::code].
5250        ///
5251        /// # Example
5252        /// ```ignore,no_run
5253        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5254        /// let x = OAuthParams::new().set_code("example");
5255        /// ```
5256        pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5257            self.code = v.into();
5258            self
5259        }
5260
5261        /// Sets the value of [ticket][crate::model::finish_o_auth_request::OAuthParams::ticket].
5262        ///
5263        /// # Example
5264        /// ```ignore,no_run
5265        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5266        /// let x = OAuthParams::new().set_ticket("example");
5267        /// ```
5268        pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5269            self.ticket = v.into();
5270            self
5271        }
5272    }
5273
5274    impl wkt::message::Message for OAuthParams {
5275        fn typename() -> &'static str {
5276            "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.OAuthParams"
5277        }
5278    }
5279
5280    /// The params returned by Google OAuth flow redirects.
5281    #[derive(Clone, Default, PartialEq)]
5282    #[non_exhaustive]
5283    pub struct GoogleOAuthParams {
5284        /// Required. The scopes returned by Google OAuth flow.
5285        pub scopes: std::vec::Vec<std::string::String>,
5286
5287        /// Optional. The version info returned by Google OAuth flow.
5288        pub version_info: std::string::String,
5289
5290        /// Required. The ticket to be used for post processing the callback from
5291        /// Google OAuth flow.
5292        pub ticket: std::string::String,
5293
5294        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5295    }
5296
5297    impl GoogleOAuthParams {
5298        pub fn new() -> Self {
5299            std::default::Default::default()
5300        }
5301
5302        /// Sets the value of [scopes][crate::model::finish_o_auth_request::GoogleOAuthParams::scopes].
5303        ///
5304        /// # Example
5305        /// ```ignore,no_run
5306        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5307        /// let x = GoogleOAuthParams::new().set_scopes(["a", "b", "c"]);
5308        /// ```
5309        pub fn set_scopes<T, V>(mut self, v: T) -> Self
5310        where
5311            T: std::iter::IntoIterator<Item = V>,
5312            V: std::convert::Into<std::string::String>,
5313        {
5314            use std::iter::Iterator;
5315            self.scopes = v.into_iter().map(|i| i.into()).collect();
5316            self
5317        }
5318
5319        /// Sets the value of [version_info][crate::model::finish_o_auth_request::GoogleOAuthParams::version_info].
5320        ///
5321        /// # Example
5322        /// ```ignore,no_run
5323        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5324        /// let x = GoogleOAuthParams::new().set_version_info("example");
5325        /// ```
5326        pub fn set_version_info<T: std::convert::Into<std::string::String>>(
5327            mut self,
5328            v: T,
5329        ) -> Self {
5330            self.version_info = v.into();
5331            self
5332        }
5333
5334        /// Sets the value of [ticket][crate::model::finish_o_auth_request::GoogleOAuthParams::ticket].
5335        ///
5336        /// # Example
5337        /// ```ignore,no_run
5338        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5339        /// let x = GoogleOAuthParams::new().set_ticket("example");
5340        /// ```
5341        pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5342            self.ticket = v.into();
5343            self
5344        }
5345    }
5346
5347    impl wkt::message::Message for GoogleOAuthParams {
5348        fn typename() -> &'static str {
5349            "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.GoogleOAuthParams"
5350        }
5351    }
5352
5353    /// The params returned by OAuth flow redirect.
5354    #[derive(Clone, Debug, PartialEq)]
5355    #[non_exhaustive]
5356    pub enum Params {
5357        /// The params returned by non-Google OAuth 2.0 flow redirect.
5358        OauthParams(std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>),
5359        /// The params returned by Google OAuth flow redirects.
5360        GoogleOauthParams(std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>),
5361    }
5362}
5363
5364/// Message for responding to finishing an OAuth flow.
5365#[derive(Clone, Default, PartialEq)]
5366#[non_exhaustive]
5367pub struct FinishOAuthResponse {
5368    /// The error resulted from exchanging OAuth tokens from the service provider.
5369    pub exchange_error: std::option::Option<crate::model::ExchangeError>,
5370
5371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5372}
5373
5374impl FinishOAuthResponse {
5375    pub fn new() -> Self {
5376        std::default::Default::default()
5377    }
5378
5379    /// Sets the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5380    ///
5381    /// # Example
5382    /// ```ignore,no_run
5383    /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5384    /// use google_cloud_developerconnect_v1::model::ExchangeError;
5385    /// let x = FinishOAuthResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
5386    /// ```
5387    pub fn set_exchange_error<T>(mut self, v: T) -> Self
5388    where
5389        T: std::convert::Into<crate::model::ExchangeError>,
5390    {
5391        self.exchange_error = std::option::Option::Some(v.into());
5392        self
5393    }
5394
5395    /// Sets or clears the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5396    ///
5397    /// # Example
5398    /// ```ignore,no_run
5399    /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5400    /// use google_cloud_developerconnect_v1::model::ExchangeError;
5401    /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
5402    /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
5403    /// ```
5404    pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
5405    where
5406        T: std::convert::Into<crate::model::ExchangeError>,
5407    {
5408        self.exchange_error = v.map(|x| x.into());
5409        self
5410    }
5411}
5412
5413impl wkt::message::Message for FinishOAuthResponse {
5414    fn typename() -> &'static str {
5415        "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthResponse"
5416    }
5417}
5418
5419/// Message for representing an error from exchanging OAuth tokens.
5420#[derive(Clone, Default, PartialEq)]
5421#[non_exhaustive]
5422pub struct ExchangeError {
5423    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> - error
5424    pub code: std::string::String,
5425
5426    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> -
5427    /// error_description
5428    pub description: std::string::String,
5429
5430    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5431}
5432
5433impl ExchangeError {
5434    pub fn new() -> Self {
5435        std::default::Default::default()
5436    }
5437
5438    /// Sets the value of [code][crate::model::ExchangeError::code].
5439    ///
5440    /// # Example
5441    /// ```ignore,no_run
5442    /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5443    /// let x = ExchangeError::new().set_code("example");
5444    /// ```
5445    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5446        self.code = v.into();
5447        self
5448    }
5449
5450    /// Sets the value of [description][crate::model::ExchangeError::description].
5451    ///
5452    /// # Example
5453    /// ```ignore,no_run
5454    /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5455    /// let x = ExchangeError::new().set_description("example");
5456    /// ```
5457    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5458        self.description = v.into();
5459        self
5460    }
5461}
5462
5463impl wkt::message::Message for ExchangeError {
5464    fn typename() -> &'static str {
5465        "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
5466    }
5467}
5468
5469/// Message describing the GitRepositoryLink object
5470#[derive(Clone, Default, PartialEq)]
5471#[non_exhaustive]
5472pub struct GitRepositoryLink {
5473    /// Identifier. Resource name of the repository, in the format
5474    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
5475    pub name: std::string::String,
5476
5477    /// Required. Git Clone URI.
5478    pub clone_uri: std::string::String,
5479
5480    /// Output only. [Output only] Create timestamp
5481    pub create_time: std::option::Option<wkt::Timestamp>,
5482
5483    /// Output only. [Output only] Update timestamp
5484    pub update_time: std::option::Option<wkt::Timestamp>,
5485
5486    /// Output only. [Output only] Delete timestamp
5487    pub delete_time: std::option::Option<wkt::Timestamp>,
5488
5489    /// Optional. Labels as key value pairs
5490    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5491
5492    /// Optional. This checksum is computed by the server based on the value of
5493    /// other fields, and may be sent on update and delete requests to ensure the
5494    /// client has an up-to-date value before proceeding.
5495    pub etag: std::string::String,
5496
5497    /// Output only. Set to true when the connection is being set up or updated in
5498    /// the background.
5499    pub reconciling: bool,
5500
5501    /// Optional. Allows clients to store small amounts of arbitrary data.
5502    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5503
5504    /// Output only. A system-assigned unique identifier for the GitRepositoryLink.
5505    pub uid: std::string::String,
5506
5507    /// Output only. External ID of the webhook created for the repository.
5508    pub webhook_id: std::string::String,
5509
5510    /// Output only. URI to access the linked repository through the Git Proxy.
5511    /// This field is only populated if the git proxy is enabled for the
5512    /// connection.
5513    pub git_proxy_uri: std::string::String,
5514
5515    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5516}
5517
5518impl GitRepositoryLink {
5519    pub fn new() -> Self {
5520        std::default::Default::default()
5521    }
5522
5523    /// Sets the value of [name][crate::model::GitRepositoryLink::name].
5524    ///
5525    /// # Example
5526    /// ```ignore,no_run
5527    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5528    /// let x = GitRepositoryLink::new().set_name("example");
5529    /// ```
5530    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5531        self.name = v.into();
5532        self
5533    }
5534
5535    /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
5536    ///
5537    /// # Example
5538    /// ```ignore,no_run
5539    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5540    /// let x = GitRepositoryLink::new().set_clone_uri("example");
5541    /// ```
5542    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5543        self.clone_uri = v.into();
5544        self
5545    }
5546
5547    /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
5548    ///
5549    /// # Example
5550    /// ```ignore,no_run
5551    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5552    /// use wkt::Timestamp;
5553    /// let x = GitRepositoryLink::new().set_create_time(Timestamp::default()/* use setters */);
5554    /// ```
5555    pub fn set_create_time<T>(mut self, v: T) -> Self
5556    where
5557        T: std::convert::Into<wkt::Timestamp>,
5558    {
5559        self.create_time = std::option::Option::Some(v.into());
5560        self
5561    }
5562
5563    /// Sets or clears the value of [create_time][crate::model::GitRepositoryLink::create_time].
5564    ///
5565    /// # Example
5566    /// ```ignore,no_run
5567    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5568    /// use wkt::Timestamp;
5569    /// let x = GitRepositoryLink::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5570    /// let x = GitRepositoryLink::new().set_or_clear_create_time(None::<Timestamp>);
5571    /// ```
5572    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5573    where
5574        T: std::convert::Into<wkt::Timestamp>,
5575    {
5576        self.create_time = v.map(|x| x.into());
5577        self
5578    }
5579
5580    /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
5581    ///
5582    /// # Example
5583    /// ```ignore,no_run
5584    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5585    /// use wkt::Timestamp;
5586    /// let x = GitRepositoryLink::new().set_update_time(Timestamp::default()/* use setters */);
5587    /// ```
5588    pub fn set_update_time<T>(mut self, v: T) -> Self
5589    where
5590        T: std::convert::Into<wkt::Timestamp>,
5591    {
5592        self.update_time = std::option::Option::Some(v.into());
5593        self
5594    }
5595
5596    /// Sets or clears the value of [update_time][crate::model::GitRepositoryLink::update_time].
5597    ///
5598    /// # Example
5599    /// ```ignore,no_run
5600    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5601    /// use wkt::Timestamp;
5602    /// let x = GitRepositoryLink::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5603    /// let x = GitRepositoryLink::new().set_or_clear_update_time(None::<Timestamp>);
5604    /// ```
5605    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5606    where
5607        T: std::convert::Into<wkt::Timestamp>,
5608    {
5609        self.update_time = v.map(|x| x.into());
5610        self
5611    }
5612
5613    /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5614    ///
5615    /// # Example
5616    /// ```ignore,no_run
5617    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5618    /// use wkt::Timestamp;
5619    /// let x = GitRepositoryLink::new().set_delete_time(Timestamp::default()/* use setters */);
5620    /// ```
5621    pub fn set_delete_time<T>(mut self, v: T) -> Self
5622    where
5623        T: std::convert::Into<wkt::Timestamp>,
5624    {
5625        self.delete_time = std::option::Option::Some(v.into());
5626        self
5627    }
5628
5629    /// Sets or clears the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5630    ///
5631    /// # Example
5632    /// ```ignore,no_run
5633    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5634    /// use wkt::Timestamp;
5635    /// let x = GitRepositoryLink::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
5636    /// let x = GitRepositoryLink::new().set_or_clear_delete_time(None::<Timestamp>);
5637    /// ```
5638    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
5639    where
5640        T: std::convert::Into<wkt::Timestamp>,
5641    {
5642        self.delete_time = v.map(|x| x.into());
5643        self
5644    }
5645
5646    /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
5647    ///
5648    /// # Example
5649    /// ```ignore,no_run
5650    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5651    /// let x = GitRepositoryLink::new().set_labels([
5652    ///     ("key0", "abc"),
5653    ///     ("key1", "xyz"),
5654    /// ]);
5655    /// ```
5656    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5657    where
5658        T: std::iter::IntoIterator<Item = (K, V)>,
5659        K: std::convert::Into<std::string::String>,
5660        V: std::convert::Into<std::string::String>,
5661    {
5662        use std::iter::Iterator;
5663        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5664        self
5665    }
5666
5667    /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
5668    ///
5669    /// # Example
5670    /// ```ignore,no_run
5671    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5672    /// let x = GitRepositoryLink::new().set_etag("example");
5673    /// ```
5674    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5675        self.etag = v.into();
5676        self
5677    }
5678
5679    /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
5680    ///
5681    /// # Example
5682    /// ```ignore,no_run
5683    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5684    /// let x = GitRepositoryLink::new().set_reconciling(true);
5685    /// ```
5686    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5687        self.reconciling = v.into();
5688        self
5689    }
5690
5691    /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
5692    ///
5693    /// # Example
5694    /// ```ignore,no_run
5695    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5696    /// let x = GitRepositoryLink::new().set_annotations([
5697    ///     ("key0", "abc"),
5698    ///     ("key1", "xyz"),
5699    /// ]);
5700    /// ```
5701    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5702    where
5703        T: std::iter::IntoIterator<Item = (K, V)>,
5704        K: std::convert::Into<std::string::String>,
5705        V: std::convert::Into<std::string::String>,
5706    {
5707        use std::iter::Iterator;
5708        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5709        self
5710    }
5711
5712    /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
5713    ///
5714    /// # Example
5715    /// ```ignore,no_run
5716    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5717    /// let x = GitRepositoryLink::new().set_uid("example");
5718    /// ```
5719    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5720        self.uid = v.into();
5721        self
5722    }
5723
5724    /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
5725    ///
5726    /// # Example
5727    /// ```ignore,no_run
5728    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5729    /// let x = GitRepositoryLink::new().set_webhook_id("example");
5730    /// ```
5731    pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5732        self.webhook_id = v.into();
5733        self
5734    }
5735
5736    /// Sets the value of [git_proxy_uri][crate::model::GitRepositoryLink::git_proxy_uri].
5737    ///
5738    /// # Example
5739    /// ```ignore,no_run
5740    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5741    /// let x = GitRepositoryLink::new().set_git_proxy_uri("example");
5742    /// ```
5743    pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5744        self.git_proxy_uri = v.into();
5745        self
5746    }
5747}
5748
5749impl wkt::message::Message for GitRepositoryLink {
5750    fn typename() -> &'static str {
5751        "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
5752    }
5753}
5754
5755/// Message for creating a GitRepositoryLink
5756#[derive(Clone, Default, PartialEq)]
5757#[non_exhaustive]
5758pub struct CreateGitRepositoryLinkRequest {
5759    /// Required. Value for parent.
5760    pub parent: std::string::String,
5761
5762    /// Required. The resource being created
5763    pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
5764
5765    /// Required. The ID to use for the repository, which will become the final
5766    /// component of the repository's resource name. This ID should be unique in
5767    /// the connection. Allows alphanumeric characters and any of
5768    /// -._~%!$&'()*+,;=@.
5769    pub git_repository_link_id: std::string::String,
5770
5771    /// Optional. An optional request ID to identify requests. Specify a unique
5772    /// request ID so that if you must retry your request, the server will know to
5773    /// ignore the request if it has already been completed. The server will
5774    /// guarantee that for at least 60 minutes since the first request.
5775    ///
5776    /// For example, consider a situation where you make an initial request and the
5777    /// request times out. If you make the request again with the same request
5778    /// ID, the server can check if original operation with the same request ID
5779    /// was received, and if so, will ignore the second request. This prevents
5780    /// clients from accidentally creating duplicate commitments.
5781    ///
5782    /// The request ID must be a valid UUID with the exception that zero UUID is
5783    /// not supported (00000000-0000-0000-0000-000000000000).
5784    pub request_id: std::string::String,
5785
5786    /// Optional. If set, validate the request, but do not actually post it.
5787    pub validate_only: bool,
5788
5789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5790}
5791
5792impl CreateGitRepositoryLinkRequest {
5793    pub fn new() -> Self {
5794        std::default::Default::default()
5795    }
5796
5797    /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
5798    ///
5799    /// # Example
5800    /// ```ignore,no_run
5801    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5802    /// let x = CreateGitRepositoryLinkRequest::new().set_parent("example");
5803    /// ```
5804    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5805        self.parent = v.into();
5806        self
5807    }
5808
5809    /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
5810    ///
5811    /// # Example
5812    /// ```ignore,no_run
5813    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5814    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5815    /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link(GitRepositoryLink::default()/* use setters */);
5816    /// ```
5817    pub fn set_git_repository_link<T>(mut self, v: T) -> Self
5818    where
5819        T: std::convert::Into<crate::model::GitRepositoryLink>,
5820    {
5821        self.git_repository_link = std::option::Option::Some(v.into());
5822        self
5823    }
5824
5825    /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
5826    ///
5827    /// # Example
5828    /// ```ignore,no_run
5829    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5830    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5831    /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(Some(GitRepositoryLink::default()/* use setters */));
5832    /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(None::<GitRepositoryLink>);
5833    /// ```
5834    pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
5835    where
5836        T: std::convert::Into<crate::model::GitRepositoryLink>,
5837    {
5838        self.git_repository_link = v.map(|x| x.into());
5839        self
5840    }
5841
5842    /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
5843    ///
5844    /// # Example
5845    /// ```ignore,no_run
5846    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5847    /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link_id("example");
5848    /// ```
5849    pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
5850        mut self,
5851        v: T,
5852    ) -> Self {
5853        self.git_repository_link_id = v.into();
5854        self
5855    }
5856
5857    /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
5858    ///
5859    /// # Example
5860    /// ```ignore,no_run
5861    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5862    /// let x = CreateGitRepositoryLinkRequest::new().set_request_id("example");
5863    /// ```
5864    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5865        self.request_id = v.into();
5866        self
5867    }
5868
5869    /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
5870    ///
5871    /// # Example
5872    /// ```ignore,no_run
5873    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5874    /// let x = CreateGitRepositoryLinkRequest::new().set_validate_only(true);
5875    /// ```
5876    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5877        self.validate_only = v.into();
5878        self
5879    }
5880}
5881
5882impl wkt::message::Message for CreateGitRepositoryLinkRequest {
5883    fn typename() -> &'static str {
5884        "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
5885    }
5886}
5887
5888/// Message for deleting a GitRepositoryLink
5889#[derive(Clone, Default, PartialEq)]
5890#[non_exhaustive]
5891pub struct DeleteGitRepositoryLinkRequest {
5892    /// Required. Name of the resource
5893    pub name: std::string::String,
5894
5895    /// Optional. An optional request ID to identify requests. Specify a unique
5896    /// request ID so that if you must retry your request, the server will know to
5897    /// ignore the request if it has already been completed. The server will
5898    /// guarantee that for at least 60 minutes after the first request.
5899    ///
5900    /// For example, consider a situation where you make an initial request and the
5901    /// request times out. If you make the request again with the same request
5902    /// ID, the server can check if original operation with the same request ID
5903    /// was received, and if so, will ignore the second request. This prevents
5904    /// clients from accidentally creating duplicate commitments.
5905    ///
5906    /// The request ID must be a valid UUID with the exception that zero UUID is
5907    /// not supported (00000000-0000-0000-0000-000000000000).
5908    pub request_id: std::string::String,
5909
5910    /// Optional. If set, validate the request, but do not actually post it.
5911    pub validate_only: bool,
5912
5913    /// Optional. This checksum is computed by the server based on the value of
5914    /// other fields, and may be sent on update and delete requests to ensure the
5915    /// client has an up-to-date value before proceeding.
5916    pub etag: std::string::String,
5917
5918    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5919}
5920
5921impl DeleteGitRepositoryLinkRequest {
5922    pub fn new() -> Self {
5923        std::default::Default::default()
5924    }
5925
5926    /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
5927    ///
5928    /// # Example
5929    /// ```ignore,no_run
5930    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
5931    /// let x = DeleteGitRepositoryLinkRequest::new().set_name("example");
5932    /// ```
5933    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5934        self.name = v.into();
5935        self
5936    }
5937
5938    /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
5939    ///
5940    /// # Example
5941    /// ```ignore,no_run
5942    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
5943    /// let x = DeleteGitRepositoryLinkRequest::new().set_request_id("example");
5944    /// ```
5945    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5946        self.request_id = v.into();
5947        self
5948    }
5949
5950    /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
5951    ///
5952    /// # Example
5953    /// ```ignore,no_run
5954    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
5955    /// let x = DeleteGitRepositoryLinkRequest::new().set_validate_only(true);
5956    /// ```
5957    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5958        self.validate_only = v.into();
5959        self
5960    }
5961
5962    /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
5963    ///
5964    /// # Example
5965    /// ```ignore,no_run
5966    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
5967    /// let x = DeleteGitRepositoryLinkRequest::new().set_etag("example");
5968    /// ```
5969    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5970        self.etag = v.into();
5971        self
5972    }
5973}
5974
5975impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
5976    fn typename() -> &'static str {
5977        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
5978    }
5979}
5980
5981/// Message for requesting a list of GitRepositoryLinks
5982#[derive(Clone, Default, PartialEq)]
5983#[non_exhaustive]
5984pub struct ListGitRepositoryLinksRequest {
5985    /// Required. Parent value for ListGitRepositoryLinksRequest
5986    pub parent: std::string::String,
5987
5988    /// Optional. Requested page size. Server may return fewer items than
5989    /// requested. If unspecified, server will pick an appropriate default.
5990    pub page_size: i32,
5991
5992    /// Optional. A token identifying a page of results the server should return.
5993    pub page_token: std::string::String,
5994
5995    /// Optional. Filtering results
5996    pub filter: std::string::String,
5997
5998    /// Optional. Hint for how to order the results
5999    pub order_by: std::string::String,
6000
6001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6002}
6003
6004impl ListGitRepositoryLinksRequest {
6005    pub fn new() -> Self {
6006        std::default::Default::default()
6007    }
6008
6009    /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
6010    ///
6011    /// # Example
6012    /// ```ignore,no_run
6013    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6014    /// let x = ListGitRepositoryLinksRequest::new().set_parent("example");
6015    /// ```
6016    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6017        self.parent = v.into();
6018        self
6019    }
6020
6021    /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
6022    ///
6023    /// # Example
6024    /// ```ignore,no_run
6025    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6026    /// let x = ListGitRepositoryLinksRequest::new().set_page_size(42);
6027    /// ```
6028    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6029        self.page_size = v.into();
6030        self
6031    }
6032
6033    /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
6034    ///
6035    /// # Example
6036    /// ```ignore,no_run
6037    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6038    /// let x = ListGitRepositoryLinksRequest::new().set_page_token("example");
6039    /// ```
6040    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6041        self.page_token = v.into();
6042        self
6043    }
6044
6045    /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
6046    ///
6047    /// # Example
6048    /// ```ignore,no_run
6049    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6050    /// let x = ListGitRepositoryLinksRequest::new().set_filter("example");
6051    /// ```
6052    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6053        self.filter = v.into();
6054        self
6055    }
6056
6057    /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
6058    ///
6059    /// # Example
6060    /// ```ignore,no_run
6061    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6062    /// let x = ListGitRepositoryLinksRequest::new().set_order_by("example");
6063    /// ```
6064    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6065        self.order_by = v.into();
6066        self
6067    }
6068}
6069
6070impl wkt::message::Message for ListGitRepositoryLinksRequest {
6071    fn typename() -> &'static str {
6072        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
6073    }
6074}
6075
6076/// Message for response to listing GitRepositoryLinks
6077#[derive(Clone, Default, PartialEq)]
6078#[non_exhaustive]
6079pub struct ListGitRepositoryLinksResponse {
6080    /// The list of GitRepositoryLinks
6081    pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
6082
6083    /// A token identifying a page of results the server should return.
6084    pub next_page_token: std::string::String,
6085
6086    /// Locations that could not be reached.
6087    pub unreachable: std::vec::Vec<std::string::String>,
6088
6089    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6090}
6091
6092impl ListGitRepositoryLinksResponse {
6093    pub fn new() -> Self {
6094        std::default::Default::default()
6095    }
6096
6097    /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
6098    ///
6099    /// # Example
6100    /// ```ignore,no_run
6101    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6102    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6103    /// let x = ListGitRepositoryLinksResponse::new()
6104    ///     .set_git_repository_links([
6105    ///         GitRepositoryLink::default()/* use setters */,
6106    ///         GitRepositoryLink::default()/* use (different) setters */,
6107    ///     ]);
6108    /// ```
6109    pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
6110    where
6111        T: std::iter::IntoIterator<Item = V>,
6112        V: std::convert::Into<crate::model::GitRepositoryLink>,
6113    {
6114        use std::iter::Iterator;
6115        self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
6116        self
6117    }
6118
6119    /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
6120    ///
6121    /// # Example
6122    /// ```ignore,no_run
6123    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6124    /// let x = ListGitRepositoryLinksResponse::new().set_next_page_token("example");
6125    /// ```
6126    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6127        self.next_page_token = v.into();
6128        self
6129    }
6130
6131    /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
6132    ///
6133    /// # Example
6134    /// ```ignore,no_run
6135    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6136    /// let x = ListGitRepositoryLinksResponse::new().set_unreachable(["a", "b", "c"]);
6137    /// ```
6138    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6139    where
6140        T: std::iter::IntoIterator<Item = V>,
6141        V: std::convert::Into<std::string::String>,
6142    {
6143        use std::iter::Iterator;
6144        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6145        self
6146    }
6147}
6148
6149impl wkt::message::Message for ListGitRepositoryLinksResponse {
6150    fn typename() -> &'static str {
6151        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
6152    }
6153}
6154
6155#[doc(hidden)]
6156impl google_cloud_gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
6157    type PageItem = crate::model::GitRepositoryLink;
6158
6159    fn items(self) -> std::vec::Vec<Self::PageItem> {
6160        self.git_repository_links
6161    }
6162
6163    fn next_page_token(&self) -> std::string::String {
6164        use std::clone::Clone;
6165        self.next_page_token.clone()
6166    }
6167}
6168
6169/// Message for getting a GitRepositoryLink
6170#[derive(Clone, Default, PartialEq)]
6171#[non_exhaustive]
6172pub struct GetGitRepositoryLinkRequest {
6173    /// Required. Name of the resource
6174    pub name: std::string::String,
6175
6176    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6177}
6178
6179impl GetGitRepositoryLinkRequest {
6180    pub fn new() -> Self {
6181        std::default::Default::default()
6182    }
6183
6184    /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
6185    ///
6186    /// # Example
6187    /// ```ignore,no_run
6188    /// # use google_cloud_developerconnect_v1::model::GetGitRepositoryLinkRequest;
6189    /// let x = GetGitRepositoryLinkRequest::new().set_name("example");
6190    /// ```
6191    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6192        self.name = v.into();
6193        self
6194    }
6195}
6196
6197impl wkt::message::Message for GetGitRepositoryLinkRequest {
6198    fn typename() -> &'static str {
6199        "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
6200    }
6201}
6202
6203/// Message for fetching SCM read/write token.
6204#[derive(Clone, Default, PartialEq)]
6205#[non_exhaustive]
6206pub struct FetchReadWriteTokenRequest {
6207    /// Required. The resource name of the gitRepositoryLink in the format
6208    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6209    pub git_repository_link: std::string::String,
6210
6211    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6212}
6213
6214impl FetchReadWriteTokenRequest {
6215    pub fn new() -> Self {
6216        std::default::Default::default()
6217    }
6218
6219    /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
6220    ///
6221    /// # Example
6222    /// ```ignore,no_run
6223    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenRequest;
6224    /// let x = FetchReadWriteTokenRequest::new().set_git_repository_link("example");
6225    /// ```
6226    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6227        mut self,
6228        v: T,
6229    ) -> Self {
6230        self.git_repository_link = v.into();
6231        self
6232    }
6233}
6234
6235impl wkt::message::Message for FetchReadWriteTokenRequest {
6236    fn typename() -> &'static str {
6237        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
6238    }
6239}
6240
6241/// Message for fetching SCM read token.
6242#[derive(Clone, Default, PartialEq)]
6243#[non_exhaustive]
6244pub struct FetchReadTokenRequest {
6245    /// Required. The resource name of the gitRepositoryLink in the format
6246    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6247    pub git_repository_link: std::string::String,
6248
6249    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6250}
6251
6252impl FetchReadTokenRequest {
6253    pub fn new() -> Self {
6254        std::default::Default::default()
6255    }
6256
6257    /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
6258    ///
6259    /// # Example
6260    /// ```ignore,no_run
6261    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenRequest;
6262    /// let x = FetchReadTokenRequest::new().set_git_repository_link("example");
6263    /// ```
6264    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6265        mut self,
6266        v: T,
6267    ) -> Self {
6268        self.git_repository_link = v.into();
6269        self
6270    }
6271}
6272
6273impl wkt::message::Message for FetchReadTokenRequest {
6274    fn typename() -> &'static str {
6275        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
6276    }
6277}
6278
6279/// Message for responding to get read token.
6280#[derive(Clone, Default, PartialEq)]
6281#[non_exhaustive]
6282pub struct FetchReadTokenResponse {
6283    /// The token content.
6284    pub token: std::string::String,
6285
6286    /// Expiration timestamp. Can be empty if unknown or non-expiring.
6287    pub expiration_time: std::option::Option<wkt::Timestamp>,
6288
6289    /// The git_username to specify when making a git clone with the
6290    /// token. For example, for GitHub GitRepositoryLinks, this would be
6291    /// "x-access-token"
6292    pub git_username: std::string::String,
6293
6294    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6295}
6296
6297impl FetchReadTokenResponse {
6298    pub fn new() -> Self {
6299        std::default::Default::default()
6300    }
6301
6302    /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
6303    ///
6304    /// # Example
6305    /// ```ignore,no_run
6306    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6307    /// let x = FetchReadTokenResponse::new().set_token("example");
6308    /// ```
6309    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6310        self.token = v.into();
6311        self
6312    }
6313
6314    /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6315    ///
6316    /// # Example
6317    /// ```ignore,no_run
6318    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6319    /// use wkt::Timestamp;
6320    /// let x = FetchReadTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6321    /// ```
6322    pub fn set_expiration_time<T>(mut self, v: T) -> Self
6323    where
6324        T: std::convert::Into<wkt::Timestamp>,
6325    {
6326        self.expiration_time = std::option::Option::Some(v.into());
6327        self
6328    }
6329
6330    /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6331    ///
6332    /// # Example
6333    /// ```ignore,no_run
6334    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6335    /// use wkt::Timestamp;
6336    /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6337    /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6338    /// ```
6339    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6340    where
6341        T: std::convert::Into<wkt::Timestamp>,
6342    {
6343        self.expiration_time = v.map(|x| x.into());
6344        self
6345    }
6346
6347    /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
6348    ///
6349    /// # Example
6350    /// ```ignore,no_run
6351    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6352    /// let x = FetchReadTokenResponse::new().set_git_username("example");
6353    /// ```
6354    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6355        self.git_username = v.into();
6356        self
6357    }
6358}
6359
6360impl wkt::message::Message for FetchReadTokenResponse {
6361    fn typename() -> &'static str {
6362        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
6363    }
6364}
6365
6366/// Message for responding to get read/write token.
6367#[derive(Clone, Default, PartialEq)]
6368#[non_exhaustive]
6369pub struct FetchReadWriteTokenResponse {
6370    /// The token content.
6371    pub token: std::string::String,
6372
6373    /// Expiration timestamp. Can be empty if unknown or non-expiring.
6374    pub expiration_time: std::option::Option<wkt::Timestamp>,
6375
6376    /// The git_username to specify when making a git clone with the
6377    /// token. For example, for GitHub GitRepositoryLinks, this would be
6378    /// "x-access-token"
6379    pub git_username: std::string::String,
6380
6381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6382}
6383
6384impl FetchReadWriteTokenResponse {
6385    pub fn new() -> Self {
6386        std::default::Default::default()
6387    }
6388
6389    /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
6390    ///
6391    /// # Example
6392    /// ```ignore,no_run
6393    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6394    /// let x = FetchReadWriteTokenResponse::new().set_token("example");
6395    /// ```
6396    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6397        self.token = v.into();
6398        self
6399    }
6400
6401    /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6402    ///
6403    /// # Example
6404    /// ```ignore,no_run
6405    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6406    /// use wkt::Timestamp;
6407    /// let x = FetchReadWriteTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6408    /// ```
6409    pub fn set_expiration_time<T>(mut self, v: T) -> Self
6410    where
6411        T: std::convert::Into<wkt::Timestamp>,
6412    {
6413        self.expiration_time = std::option::Option::Some(v.into());
6414        self
6415    }
6416
6417    /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6418    ///
6419    /// # Example
6420    /// ```ignore,no_run
6421    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6422    /// use wkt::Timestamp;
6423    /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6424    /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6425    /// ```
6426    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6427    where
6428        T: std::convert::Into<wkt::Timestamp>,
6429    {
6430        self.expiration_time = v.map(|x| x.into());
6431        self
6432    }
6433
6434    /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
6435    ///
6436    /// # Example
6437    /// ```ignore,no_run
6438    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6439    /// let x = FetchReadWriteTokenResponse::new().set_git_username("example");
6440    /// ```
6441    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6442        self.git_username = v.into();
6443        self
6444    }
6445}
6446
6447impl wkt::message::Message for FetchReadWriteTokenResponse {
6448    fn typename() -> &'static str {
6449        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
6450    }
6451}
6452
6453/// Request message for FetchLinkableGitRepositoriesRequest.
6454#[derive(Clone, Default, PartialEq)]
6455#[non_exhaustive]
6456pub struct FetchLinkableGitRepositoriesRequest {
6457    /// Required. The name of the Connection.
6458    /// Format: `projects/*/locations/*/connections/*`.
6459    pub connection: std::string::String,
6460
6461    /// Optional. Number of results to return in the list. Defaults to 20.
6462    pub page_size: i32,
6463
6464    /// Optional. Page start.
6465    pub page_token: std::string::String,
6466
6467    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6468}
6469
6470impl FetchLinkableGitRepositoriesRequest {
6471    pub fn new() -> Self {
6472        std::default::Default::default()
6473    }
6474
6475    /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
6476    ///
6477    /// # Example
6478    /// ```ignore,no_run
6479    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6480    /// let x = FetchLinkableGitRepositoriesRequest::new().set_connection("example");
6481    /// ```
6482    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6483        self.connection = v.into();
6484        self
6485    }
6486
6487    /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
6488    ///
6489    /// # Example
6490    /// ```ignore,no_run
6491    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6492    /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_size(42);
6493    /// ```
6494    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6495        self.page_size = v.into();
6496        self
6497    }
6498
6499    /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
6500    ///
6501    /// # Example
6502    /// ```ignore,no_run
6503    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6504    /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_token("example");
6505    /// ```
6506    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6507        self.page_token = v.into();
6508        self
6509    }
6510}
6511
6512impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
6513    fn typename() -> &'static str {
6514        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
6515    }
6516}
6517
6518/// Response message for FetchLinkableGitRepositories.
6519#[derive(Clone, Default, PartialEq)]
6520#[non_exhaustive]
6521pub struct FetchLinkableGitRepositoriesResponse {
6522    /// The git repositories that can be linked to the connection.
6523    pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
6524
6525    /// A token identifying a page of results the server should return.
6526    pub next_page_token: std::string::String,
6527
6528    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6529}
6530
6531impl FetchLinkableGitRepositoriesResponse {
6532    pub fn new() -> Self {
6533        std::default::Default::default()
6534    }
6535
6536    /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
6537    ///
6538    /// # Example
6539    /// ```ignore,no_run
6540    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6541    /// use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6542    /// let x = FetchLinkableGitRepositoriesResponse::new()
6543    ///     .set_linkable_git_repositories([
6544    ///         LinkableGitRepository::default()/* use setters */,
6545    ///         LinkableGitRepository::default()/* use (different) setters */,
6546    ///     ]);
6547    /// ```
6548    pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
6549    where
6550        T: std::iter::IntoIterator<Item = V>,
6551        V: std::convert::Into<crate::model::LinkableGitRepository>,
6552    {
6553        use std::iter::Iterator;
6554        self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
6555        self
6556    }
6557
6558    /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
6559    ///
6560    /// # Example
6561    /// ```ignore,no_run
6562    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6563    /// let x = FetchLinkableGitRepositoriesResponse::new().set_next_page_token("example");
6564    /// ```
6565    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6566        self.next_page_token = v.into();
6567        self
6568    }
6569}
6570
6571impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
6572    fn typename() -> &'static str {
6573        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
6574    }
6575}
6576
6577#[doc(hidden)]
6578impl google_cloud_gax::paginator::internal::PageableResponse
6579    for FetchLinkableGitRepositoriesResponse
6580{
6581    type PageItem = crate::model::LinkableGitRepository;
6582
6583    fn items(self) -> std::vec::Vec<Self::PageItem> {
6584        self.linkable_git_repositories
6585    }
6586
6587    fn next_page_token(&self) -> std::string::String {
6588        use std::clone::Clone;
6589        self.next_page_token.clone()
6590    }
6591}
6592
6593/// LinkableGitRepository represents a git repository that can be linked to a
6594/// connection.
6595#[derive(Clone, Default, PartialEq)]
6596#[non_exhaustive]
6597pub struct LinkableGitRepository {
6598    /// The clone uri of the repository.
6599    pub clone_uri: std::string::String,
6600
6601    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6602}
6603
6604impl LinkableGitRepository {
6605    pub fn new() -> Self {
6606        std::default::Default::default()
6607    }
6608
6609    /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
6610    ///
6611    /// # Example
6612    /// ```ignore,no_run
6613    /// # use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6614    /// let x = LinkableGitRepository::new().set_clone_uri("example");
6615    /// ```
6616    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6617        self.clone_uri = v.into();
6618        self
6619    }
6620}
6621
6622impl wkt::message::Message for LinkableGitRepository {
6623    fn typename() -> &'static str {
6624        "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
6625    }
6626}
6627
6628/// Request for fetching github installations.
6629#[derive(Clone, Default, PartialEq)]
6630#[non_exhaustive]
6631pub struct FetchGitHubInstallationsRequest {
6632    /// Required. The resource name of the connection in the format
6633    /// `projects/*/locations/*/connections/*`.
6634    pub connection: std::string::String,
6635
6636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6637}
6638
6639impl FetchGitHubInstallationsRequest {
6640    pub fn new() -> Self {
6641        std::default::Default::default()
6642    }
6643
6644    /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
6645    ///
6646    /// # Example
6647    /// ```ignore,no_run
6648    /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsRequest;
6649    /// let x = FetchGitHubInstallationsRequest::new().set_connection("example");
6650    /// ```
6651    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6652        self.connection = v.into();
6653        self
6654    }
6655}
6656
6657impl wkt::message::Message for FetchGitHubInstallationsRequest {
6658    fn typename() -> &'static str {
6659        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
6660    }
6661}
6662
6663/// Response of fetching github installations.
6664#[derive(Clone, Default, PartialEq)]
6665#[non_exhaustive]
6666pub struct FetchGitHubInstallationsResponse {
6667    /// List of installations available to the OAuth user (for github.com)
6668    /// or all the installations (for GitHub enterprise).
6669    pub installations:
6670        std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
6671
6672    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6673}
6674
6675impl FetchGitHubInstallationsResponse {
6676    pub fn new() -> Self {
6677        std::default::Default::default()
6678    }
6679
6680    /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
6681    ///
6682    /// # Example
6683    /// ```ignore,no_run
6684    /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsResponse;
6685    /// use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6686    /// let x = FetchGitHubInstallationsResponse::new()
6687    ///     .set_installations([
6688    ///         Installation::default()/* use setters */,
6689    ///         Installation::default()/* use (different) setters */,
6690    ///     ]);
6691    /// ```
6692    pub fn set_installations<T, V>(mut self, v: T) -> Self
6693    where
6694        T: std::iter::IntoIterator<Item = V>,
6695        V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
6696    {
6697        use std::iter::Iterator;
6698        self.installations = v.into_iter().map(|i| i.into()).collect();
6699        self
6700    }
6701}
6702
6703impl wkt::message::Message for FetchGitHubInstallationsResponse {
6704    fn typename() -> &'static str {
6705        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
6706    }
6707}
6708
6709/// Defines additional types related to [FetchGitHubInstallationsResponse].
6710pub mod fetch_git_hub_installations_response {
6711    #[allow(unused_imports)]
6712    use super::*;
6713
6714    /// Represents an installation of the GitHub App.
6715    #[derive(Clone, Default, PartialEq)]
6716    #[non_exhaustive]
6717    pub struct Installation {
6718        /// ID of the installation in GitHub.
6719        pub id: i64,
6720
6721        /// Name of the GitHub user or organization that owns this installation.
6722        pub name: std::string::String,
6723
6724        /// Either "user" or "organization".
6725        pub r#type: std::string::String,
6726
6727        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6728    }
6729
6730    impl Installation {
6731        pub fn new() -> Self {
6732            std::default::Default::default()
6733        }
6734
6735        /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
6736        ///
6737        /// # Example
6738        /// ```ignore,no_run
6739        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6740        /// let x = Installation::new().set_id(42);
6741        /// ```
6742        pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6743            self.id = v.into();
6744            self
6745        }
6746
6747        /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
6748        ///
6749        /// # Example
6750        /// ```ignore,no_run
6751        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6752        /// let x = Installation::new().set_name("example");
6753        /// ```
6754        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6755            self.name = v.into();
6756            self
6757        }
6758
6759        /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
6760        ///
6761        /// # Example
6762        /// ```ignore,no_run
6763        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6764        /// let x = Installation::new().set_type("example");
6765        /// ```
6766        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6767            self.r#type = v.into();
6768            self
6769        }
6770    }
6771
6772    impl wkt::message::Message for Installation {
6773        fn typename() -> &'static str {
6774            "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
6775        }
6776    }
6777}
6778
6779/// Request for fetching git refs.
6780#[derive(Clone, Default, PartialEq)]
6781#[non_exhaustive]
6782pub struct FetchGitRefsRequest {
6783    /// Required. The resource name of GitRepositoryLink in the format
6784    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6785    pub git_repository_link: std::string::String,
6786
6787    /// Required. Type of refs to fetch.
6788    pub ref_type: crate::model::fetch_git_refs_request::RefType,
6789
6790    /// Optional. Number of results to return in the list. Default to 20.
6791    pub page_size: i32,
6792
6793    /// Optional. Page start.
6794    pub page_token: std::string::String,
6795
6796    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6797}
6798
6799impl FetchGitRefsRequest {
6800    pub fn new() -> Self {
6801        std::default::Default::default()
6802    }
6803
6804    /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
6805    ///
6806    /// # Example
6807    /// ```ignore,no_run
6808    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6809    /// let x = FetchGitRefsRequest::new().set_git_repository_link("example");
6810    /// ```
6811    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6812        mut self,
6813        v: T,
6814    ) -> Self {
6815        self.git_repository_link = v.into();
6816        self
6817    }
6818
6819    /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
6820    ///
6821    /// # Example
6822    /// ```ignore,no_run
6823    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6824    /// use google_cloud_developerconnect_v1::model::fetch_git_refs_request::RefType;
6825    /// let x0 = FetchGitRefsRequest::new().set_ref_type(RefType::Tag);
6826    /// let x1 = FetchGitRefsRequest::new().set_ref_type(RefType::Branch);
6827    /// ```
6828    pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
6829        mut self,
6830        v: T,
6831    ) -> Self {
6832        self.ref_type = v.into();
6833        self
6834    }
6835
6836    /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
6837    ///
6838    /// # Example
6839    /// ```ignore,no_run
6840    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6841    /// let x = FetchGitRefsRequest::new().set_page_size(42);
6842    /// ```
6843    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6844        self.page_size = v.into();
6845        self
6846    }
6847
6848    /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
6849    ///
6850    /// # Example
6851    /// ```ignore,no_run
6852    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6853    /// let x = FetchGitRefsRequest::new().set_page_token("example");
6854    /// ```
6855    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6856        self.page_token = v.into();
6857        self
6858    }
6859}
6860
6861impl wkt::message::Message for FetchGitRefsRequest {
6862    fn typename() -> &'static str {
6863        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
6864    }
6865}
6866
6867/// Defines additional types related to [FetchGitRefsRequest].
6868pub mod fetch_git_refs_request {
6869    #[allow(unused_imports)]
6870    use super::*;
6871
6872    /// Type of refs.
6873    ///
6874    /// # Working with unknown values
6875    ///
6876    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6877    /// additional enum variants at any time. Adding new variants is not considered
6878    /// a breaking change. Applications should write their code in anticipation of:
6879    ///
6880    /// - New values appearing in future releases of the client library, **and**
6881    /// - New values received dynamically, without application changes.
6882    ///
6883    /// Please consult the [Working with enums] section in the user guide for some
6884    /// guidelines.
6885    ///
6886    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6887    #[derive(Clone, Debug, PartialEq)]
6888    #[non_exhaustive]
6889    pub enum RefType {
6890        /// No type specified.
6891        Unspecified,
6892        /// To fetch tags.
6893        Tag,
6894        /// To fetch branches.
6895        Branch,
6896        /// If set, the enum was initialized with an unknown value.
6897        ///
6898        /// Applications can examine the value using [RefType::value] or
6899        /// [RefType::name].
6900        UnknownValue(ref_type::UnknownValue),
6901    }
6902
6903    #[doc(hidden)]
6904    pub mod ref_type {
6905        #[allow(unused_imports)]
6906        use super::*;
6907        #[derive(Clone, Debug, PartialEq)]
6908        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6909    }
6910
6911    impl RefType {
6912        /// Gets the enum value.
6913        ///
6914        /// Returns `None` if the enum contains an unknown value deserialized from
6915        /// the string representation of enums.
6916        pub fn value(&self) -> std::option::Option<i32> {
6917            match self {
6918                Self::Unspecified => std::option::Option::Some(0),
6919                Self::Tag => std::option::Option::Some(1),
6920                Self::Branch => std::option::Option::Some(2),
6921                Self::UnknownValue(u) => u.0.value(),
6922            }
6923        }
6924
6925        /// Gets the enum value as a string.
6926        ///
6927        /// Returns `None` if the enum contains an unknown value deserialized from
6928        /// the integer representation of enums.
6929        pub fn name(&self) -> std::option::Option<&str> {
6930            match self {
6931                Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
6932                Self::Tag => std::option::Option::Some("TAG"),
6933                Self::Branch => std::option::Option::Some("BRANCH"),
6934                Self::UnknownValue(u) => u.0.name(),
6935            }
6936        }
6937    }
6938
6939    impl std::default::Default for RefType {
6940        fn default() -> Self {
6941            use std::convert::From;
6942            Self::from(0)
6943        }
6944    }
6945
6946    impl std::fmt::Display for RefType {
6947        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6948            wkt::internal::display_enum(f, self.name(), self.value())
6949        }
6950    }
6951
6952    impl std::convert::From<i32> for RefType {
6953        fn from(value: i32) -> Self {
6954            match value {
6955                0 => Self::Unspecified,
6956                1 => Self::Tag,
6957                2 => Self::Branch,
6958                _ => Self::UnknownValue(ref_type::UnknownValue(
6959                    wkt::internal::UnknownEnumValue::Integer(value),
6960                )),
6961            }
6962        }
6963    }
6964
6965    impl std::convert::From<&str> for RefType {
6966        fn from(value: &str) -> Self {
6967            use std::string::ToString;
6968            match value {
6969                "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
6970                "TAG" => Self::Tag,
6971                "BRANCH" => Self::Branch,
6972                _ => Self::UnknownValue(ref_type::UnknownValue(
6973                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6974                )),
6975            }
6976        }
6977    }
6978
6979    impl serde::ser::Serialize for RefType {
6980        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6981        where
6982            S: serde::Serializer,
6983        {
6984            match self {
6985                Self::Unspecified => serializer.serialize_i32(0),
6986                Self::Tag => serializer.serialize_i32(1),
6987                Self::Branch => serializer.serialize_i32(2),
6988                Self::UnknownValue(u) => u.0.serialize(serializer),
6989            }
6990        }
6991    }
6992
6993    impl<'de> serde::de::Deserialize<'de> for RefType {
6994        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6995        where
6996            D: serde::Deserializer<'de>,
6997        {
6998            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
6999                ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
7000            ))
7001        }
7002    }
7003}
7004
7005/// Response for fetching git refs.
7006#[derive(Clone, Default, PartialEq)]
7007#[non_exhaustive]
7008pub struct FetchGitRefsResponse {
7009    /// Name of the refs fetched.
7010    pub ref_names: std::vec::Vec<std::string::String>,
7011
7012    /// A token identifying a page of results the server should return.
7013    pub next_page_token: std::string::String,
7014
7015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7016}
7017
7018impl FetchGitRefsResponse {
7019    pub fn new() -> Self {
7020        std::default::Default::default()
7021    }
7022
7023    /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
7024    ///
7025    /// # Example
7026    /// ```ignore,no_run
7027    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7028    /// let x = FetchGitRefsResponse::new().set_ref_names(["a", "b", "c"]);
7029    /// ```
7030    pub fn set_ref_names<T, V>(mut self, v: T) -> Self
7031    where
7032        T: std::iter::IntoIterator<Item = V>,
7033        V: std::convert::Into<std::string::String>,
7034    {
7035        use std::iter::Iterator;
7036        self.ref_names = v.into_iter().map(|i| i.into()).collect();
7037        self
7038    }
7039
7040    /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
7041    ///
7042    /// # Example
7043    /// ```ignore,no_run
7044    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7045    /// let x = FetchGitRefsResponse::new().set_next_page_token("example");
7046    /// ```
7047    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7048        self.next_page_token = v.into();
7049        self
7050    }
7051}
7052
7053impl wkt::message::Message for FetchGitRefsResponse {
7054    fn typename() -> &'static str {
7055        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
7056    }
7057}
7058
7059/// AccountConnector encapsulates what a platform administrator needs to
7060/// configure for users to connect to the service providers, which includes,
7061/// among other fields, the OAuth client ID, client secret, and authorization and
7062/// token endpoints.
7063#[derive(Clone, Default, PartialEq)]
7064#[non_exhaustive]
7065pub struct AccountConnector {
7066    /// Identifier. The resource name of the accountConnector, in the format
7067    /// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
7068    pub name: std::string::String,
7069
7070    /// Output only. The timestamp when the accountConnector was created.
7071    pub create_time: std::option::Option<wkt::Timestamp>,
7072
7073    /// Output only. The timestamp when the accountConnector was updated.
7074    pub update_time: std::option::Option<wkt::Timestamp>,
7075
7076    /// Optional. Allows users to store small amounts of arbitrary data.
7077    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7078
7079    /// Optional. This checksum is computed by the server based on the value of
7080    /// other fields, and may be sent on update and delete requests to ensure the
7081    /// client has an up-to-date value before proceeding.
7082    pub etag: std::string::String,
7083
7084    /// Optional. Labels as key value pairs
7085    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7086
7087    /// Output only. Start OAuth flow by clicking on this URL.
7088    pub oauth_start_uri: std::string::String,
7089
7090    /// The AccountConnector config.
7091    pub account_connector_config:
7092        std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
7093
7094    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7095}
7096
7097impl AccountConnector {
7098    pub fn new() -> Self {
7099        std::default::Default::default()
7100    }
7101
7102    /// Sets the value of [name][crate::model::AccountConnector::name].
7103    ///
7104    /// # Example
7105    /// ```ignore,no_run
7106    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7107    /// let x = AccountConnector::new().set_name("example");
7108    /// ```
7109    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7110        self.name = v.into();
7111        self
7112    }
7113
7114    /// Sets the value of [create_time][crate::model::AccountConnector::create_time].
7115    ///
7116    /// # Example
7117    /// ```ignore,no_run
7118    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7119    /// use wkt::Timestamp;
7120    /// let x = AccountConnector::new().set_create_time(Timestamp::default()/* use setters */);
7121    /// ```
7122    pub fn set_create_time<T>(mut self, v: T) -> Self
7123    where
7124        T: std::convert::Into<wkt::Timestamp>,
7125    {
7126        self.create_time = std::option::Option::Some(v.into());
7127        self
7128    }
7129
7130    /// Sets or clears the value of [create_time][crate::model::AccountConnector::create_time].
7131    ///
7132    /// # Example
7133    /// ```ignore,no_run
7134    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7135    /// use wkt::Timestamp;
7136    /// let x = AccountConnector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7137    /// let x = AccountConnector::new().set_or_clear_create_time(None::<Timestamp>);
7138    /// ```
7139    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7140    where
7141        T: std::convert::Into<wkt::Timestamp>,
7142    {
7143        self.create_time = v.map(|x| x.into());
7144        self
7145    }
7146
7147    /// Sets the value of [update_time][crate::model::AccountConnector::update_time].
7148    ///
7149    /// # Example
7150    /// ```ignore,no_run
7151    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7152    /// use wkt::Timestamp;
7153    /// let x = AccountConnector::new().set_update_time(Timestamp::default()/* use setters */);
7154    /// ```
7155    pub fn set_update_time<T>(mut self, v: T) -> Self
7156    where
7157        T: std::convert::Into<wkt::Timestamp>,
7158    {
7159        self.update_time = std::option::Option::Some(v.into());
7160        self
7161    }
7162
7163    /// Sets or clears the value of [update_time][crate::model::AccountConnector::update_time].
7164    ///
7165    /// # Example
7166    /// ```ignore,no_run
7167    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7168    /// use wkt::Timestamp;
7169    /// let x = AccountConnector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7170    /// let x = AccountConnector::new().set_or_clear_update_time(None::<Timestamp>);
7171    /// ```
7172    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7173    where
7174        T: std::convert::Into<wkt::Timestamp>,
7175    {
7176        self.update_time = v.map(|x| x.into());
7177        self
7178    }
7179
7180    /// Sets the value of [annotations][crate::model::AccountConnector::annotations].
7181    ///
7182    /// # Example
7183    /// ```ignore,no_run
7184    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7185    /// let x = AccountConnector::new().set_annotations([
7186    ///     ("key0", "abc"),
7187    ///     ("key1", "xyz"),
7188    /// ]);
7189    /// ```
7190    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7191    where
7192        T: std::iter::IntoIterator<Item = (K, V)>,
7193        K: std::convert::Into<std::string::String>,
7194        V: std::convert::Into<std::string::String>,
7195    {
7196        use std::iter::Iterator;
7197        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7198        self
7199    }
7200
7201    /// Sets the value of [etag][crate::model::AccountConnector::etag].
7202    ///
7203    /// # Example
7204    /// ```ignore,no_run
7205    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7206    /// let x = AccountConnector::new().set_etag("example");
7207    /// ```
7208    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7209        self.etag = v.into();
7210        self
7211    }
7212
7213    /// Sets the value of [labels][crate::model::AccountConnector::labels].
7214    ///
7215    /// # Example
7216    /// ```ignore,no_run
7217    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7218    /// let x = AccountConnector::new().set_labels([
7219    ///     ("key0", "abc"),
7220    ///     ("key1", "xyz"),
7221    /// ]);
7222    /// ```
7223    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7224    where
7225        T: std::iter::IntoIterator<Item = (K, V)>,
7226        K: std::convert::Into<std::string::String>,
7227        V: std::convert::Into<std::string::String>,
7228    {
7229        use std::iter::Iterator;
7230        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7231        self
7232    }
7233
7234    /// Sets the value of [oauth_start_uri][crate::model::AccountConnector::oauth_start_uri].
7235    ///
7236    /// # Example
7237    /// ```ignore,no_run
7238    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7239    /// let x = AccountConnector::new().set_oauth_start_uri("example");
7240    /// ```
7241    pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7242        self.oauth_start_uri = v.into();
7243        self
7244    }
7245
7246    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config].
7247    ///
7248    /// Note that all the setters affecting `account_connector_config` are mutually
7249    /// exclusive.
7250    ///
7251    /// # Example
7252    /// ```ignore,no_run
7253    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7254    /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7255    /// let x = AccountConnector::new().set_account_connector_config(Some(
7256    ///     google_cloud_developerconnect_v1::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(ProviderOAuthConfig::default().into())));
7257    /// ```
7258    pub fn set_account_connector_config<
7259        T: std::convert::Into<
7260                std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
7261            >,
7262    >(
7263        mut self,
7264        v: T,
7265    ) -> Self {
7266        self.account_connector_config = v.into();
7267        self
7268    }
7269
7270    /// The value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
7271    /// if it holds a `ProviderOauthConfig`, `None` if the field is not set or
7272    /// holds a different branch.
7273    pub fn provider_oauth_config(
7274        &self,
7275    ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
7276        #[allow(unreachable_patterns)]
7277        self.account_connector_config
7278            .as_ref()
7279            .and_then(|v| match v {
7280                crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
7281                    std::option::Option::Some(v)
7282                }
7283                _ => std::option::Option::None,
7284            })
7285    }
7286
7287    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
7288    /// to hold a `ProviderOauthConfig`.
7289    ///
7290    /// Note that all the setters affecting `account_connector_config` are
7291    /// mutually exclusive.
7292    ///
7293    /// # Example
7294    /// ```ignore,no_run
7295    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7296    /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7297    /// let x = AccountConnector::new().set_provider_oauth_config(ProviderOAuthConfig::default()/* use setters */);
7298    /// assert!(x.provider_oauth_config().is_some());
7299    /// ```
7300    pub fn set_provider_oauth_config<
7301        T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
7302    >(
7303        mut self,
7304        v: T,
7305    ) -> Self {
7306        self.account_connector_config = std::option::Option::Some(
7307            crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
7308        );
7309        self
7310    }
7311}
7312
7313impl wkt::message::Message for AccountConnector {
7314    fn typename() -> &'static str {
7315        "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
7316    }
7317}
7318
7319/// Defines additional types related to [AccountConnector].
7320pub mod account_connector {
7321    #[allow(unused_imports)]
7322    use super::*;
7323
7324    /// The AccountConnector config.
7325    #[derive(Clone, Debug, PartialEq)]
7326    #[non_exhaustive]
7327    pub enum AccountConnectorConfig {
7328        /// Optional. Provider OAuth config.
7329        ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
7330    }
7331}
7332
7333/// User represents a user connected to the service providers through
7334/// a AccountConnector.
7335#[derive(Clone, Default, PartialEq)]
7336#[non_exhaustive]
7337pub struct User {
7338    /// Identifier. Resource name of the user, in the format
7339    /// `projects/*/locations/*/accountConnectors/*/users/*`.
7340    pub name: std::string::String,
7341
7342    /// Output only. Developer Connect automatically converts user identity
7343    /// to some human readable description, e.g., email address.
7344    pub display_name: std::string::String,
7345
7346    /// Output only. The timestamp when the user was created.
7347    pub create_time: std::option::Option<wkt::Timestamp>,
7348
7349    /// Output only. The timestamp when the token was last requested.
7350    pub last_token_request_time: std::option::Option<wkt::Timestamp>,
7351
7352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7353}
7354
7355impl User {
7356    pub fn new() -> Self {
7357        std::default::Default::default()
7358    }
7359
7360    /// Sets the value of [name][crate::model::User::name].
7361    ///
7362    /// # Example
7363    /// ```ignore,no_run
7364    /// # use google_cloud_developerconnect_v1::model::User;
7365    /// let x = User::new().set_name("example");
7366    /// ```
7367    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7368        self.name = v.into();
7369        self
7370    }
7371
7372    /// Sets the value of [display_name][crate::model::User::display_name].
7373    ///
7374    /// # Example
7375    /// ```ignore,no_run
7376    /// # use google_cloud_developerconnect_v1::model::User;
7377    /// let x = User::new().set_display_name("example");
7378    /// ```
7379    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7380        self.display_name = v.into();
7381        self
7382    }
7383
7384    /// Sets the value of [create_time][crate::model::User::create_time].
7385    ///
7386    /// # Example
7387    /// ```ignore,no_run
7388    /// # use google_cloud_developerconnect_v1::model::User;
7389    /// use wkt::Timestamp;
7390    /// let x = User::new().set_create_time(Timestamp::default()/* use setters */);
7391    /// ```
7392    pub fn set_create_time<T>(mut self, v: T) -> Self
7393    where
7394        T: std::convert::Into<wkt::Timestamp>,
7395    {
7396        self.create_time = std::option::Option::Some(v.into());
7397        self
7398    }
7399
7400    /// Sets or clears the value of [create_time][crate::model::User::create_time].
7401    ///
7402    /// # Example
7403    /// ```ignore,no_run
7404    /// # use google_cloud_developerconnect_v1::model::User;
7405    /// use wkt::Timestamp;
7406    /// let x = User::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7407    /// let x = User::new().set_or_clear_create_time(None::<Timestamp>);
7408    /// ```
7409    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7410    where
7411        T: std::convert::Into<wkt::Timestamp>,
7412    {
7413        self.create_time = v.map(|x| x.into());
7414        self
7415    }
7416
7417    /// Sets the value of [last_token_request_time][crate::model::User::last_token_request_time].
7418    ///
7419    /// # Example
7420    /// ```ignore,no_run
7421    /// # use google_cloud_developerconnect_v1::model::User;
7422    /// use wkt::Timestamp;
7423    /// let x = User::new().set_last_token_request_time(Timestamp::default()/* use setters */);
7424    /// ```
7425    pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
7426    where
7427        T: std::convert::Into<wkt::Timestamp>,
7428    {
7429        self.last_token_request_time = std::option::Option::Some(v.into());
7430        self
7431    }
7432
7433    /// Sets or clears the value of [last_token_request_time][crate::model::User::last_token_request_time].
7434    ///
7435    /// # Example
7436    /// ```ignore,no_run
7437    /// # use google_cloud_developerconnect_v1::model::User;
7438    /// use wkt::Timestamp;
7439    /// let x = User::new().set_or_clear_last_token_request_time(Some(Timestamp::default()/* use setters */));
7440    /// let x = User::new().set_or_clear_last_token_request_time(None::<Timestamp>);
7441    /// ```
7442    pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
7443    where
7444        T: std::convert::Into<wkt::Timestamp>,
7445    {
7446        self.last_token_request_time = v.map(|x| x.into());
7447        self
7448    }
7449}
7450
7451impl wkt::message::Message for User {
7452    fn typename() -> &'static str {
7453        "type.googleapis.com/google.cloud.developerconnect.v1.User"
7454    }
7455}
7456
7457/// ProviderOAuthConfig is the OAuth config for a provider.
7458#[derive(Clone, Default, PartialEq)]
7459#[non_exhaustive]
7460pub struct ProviderOAuthConfig {
7461    /// Required. User selected scopes to apply to the Oauth config
7462    /// In the event of changing scopes, user records under AccountConnector will
7463    /// be deleted and users will re-auth again.
7464    pub scopes: std::vec::Vec<std::string::String>,
7465
7466    /// OAuth Provider ID. It could be Developer Connect owned or providers
7467    /// provided.
7468    pub oauth_provider_id:
7469        std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
7470
7471    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7472}
7473
7474impl ProviderOAuthConfig {
7475    pub fn new() -> Self {
7476        std::default::Default::default()
7477    }
7478
7479    /// Sets the value of [scopes][crate::model::ProviderOAuthConfig::scopes].
7480    ///
7481    /// # Example
7482    /// ```ignore,no_run
7483    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7484    /// let x = ProviderOAuthConfig::new().set_scopes(["a", "b", "c"]);
7485    /// ```
7486    pub fn set_scopes<T, V>(mut self, v: T) -> Self
7487    where
7488        T: std::iter::IntoIterator<Item = V>,
7489        V: std::convert::Into<std::string::String>,
7490    {
7491        use std::iter::Iterator;
7492        self.scopes = v.into_iter().map(|i| i.into()).collect();
7493        self
7494    }
7495
7496    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id].
7497    ///
7498    /// Note that all the setters affecting `oauth_provider_id` are mutually
7499    /// exclusive.
7500    ///
7501    /// # Example
7502    /// ```ignore,no_run
7503    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7504    /// use google_cloud_developerconnect_v1::model::SystemProvider;
7505    /// let x0 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7506    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Github)));
7507    /// let x1 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7508    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Gitlab)));
7509    /// let x2 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7510    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Google)));
7511    /// ```
7512    pub fn set_oauth_provider_id<
7513        T: std::convert::Into<
7514                std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
7515            >,
7516    >(
7517        mut self,
7518        v: T,
7519    ) -> Self {
7520        self.oauth_provider_id = v.into();
7521        self
7522    }
7523
7524    /// The value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
7525    /// if it holds a `SystemProviderId`, `None` if the field is not set or
7526    /// holds a different branch.
7527    pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
7528        #[allow(unreachable_patterns)]
7529        self.oauth_provider_id.as_ref().and_then(|v| match v {
7530            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
7531                std::option::Option::Some(v)
7532            }
7533            _ => std::option::Option::None,
7534        })
7535    }
7536
7537    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
7538    /// to hold a `SystemProviderId`.
7539    ///
7540    /// Note that all the setters affecting `oauth_provider_id` are
7541    /// mutually exclusive.
7542    ///
7543    /// # Example
7544    /// ```ignore,no_run
7545    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7546    /// use google_cloud_developerconnect_v1::model::SystemProvider;
7547    /// let x0 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Github);
7548    /// let x1 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Gitlab);
7549    /// let x2 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Google);
7550    /// assert!(x0.system_provider_id().is_some());
7551    /// assert!(x1.system_provider_id().is_some());
7552    /// assert!(x2.system_provider_id().is_some());
7553    /// ```
7554    pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
7555        mut self,
7556        v: T,
7557    ) -> Self {
7558        self.oauth_provider_id = std::option::Option::Some(
7559            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
7560        );
7561        self
7562    }
7563}
7564
7565impl wkt::message::Message for ProviderOAuthConfig {
7566    fn typename() -> &'static str {
7567        "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
7568    }
7569}
7570
7571/// Defines additional types related to [ProviderOAuthConfig].
7572pub mod provider_o_auth_config {
7573    #[allow(unused_imports)]
7574    use super::*;
7575
7576    /// OAuth Provider ID. It could be Developer Connect owned or providers
7577    /// provided.
7578    #[derive(Clone, Debug, PartialEq)]
7579    #[non_exhaustive]
7580    pub enum OauthProviderId {
7581        /// Optional. Immutable. Developer Connect provided OAuth.
7582        SystemProviderId(crate::model::SystemProvider),
7583    }
7584}
7585
7586/// The InsightsConfig resource is the core configuration object to capture
7587/// events from your Software Development Lifecycle. It acts as the central hub
7588/// for managing how Developer Connect understands your application, its runtime
7589/// environments, and the artifacts deployed within them.
7590#[derive(Clone, Default, PartialEq)]
7591#[non_exhaustive]
7592pub struct InsightsConfig {
7593    /// Identifier. The name of the InsightsConfig.
7594    /// Format:
7595    /// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
7596    pub name: std::string::String,
7597
7598    /// Output only. Create timestamp.
7599    pub create_time: std::option::Option<wkt::Timestamp>,
7600
7601    /// Output only. Update timestamp.
7602    pub update_time: std::option::Option<wkt::Timestamp>,
7603
7604    /// Output only. The runtime configurations where the application is deployed.
7605    pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
7606
7607    /// Optional. The artifact configurations of the artifacts that are deployed.
7608    pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
7609
7610    /// Optional. Output only. The state of the InsightsConfig.
7611    pub state: crate::model::insights_config::State,
7612
7613    /// Optional. User specified annotations. See
7614    /// <https://google.aip.dev/148#annotations> for more details such as format and
7615    /// size limitations.
7616    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7617
7618    /// Optional. Set of labels associated with an InsightsConfig.
7619    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7620
7621    /// Output only. Reconciling (<https://google.aip.dev/128#reconciliation>).
7622    /// Set to true if the current state of InsightsConfig does not match the
7623    /// user's intended state, and the service is actively updating the resource to
7624    /// reconcile them. This can happen due to user-triggered updates or
7625    /// system actions like failover or maintenance.
7626    pub reconciling: bool,
7627
7628    /// Output only. Any errors that occurred while setting up the InsightsConfig.
7629    /// Each error will be in the format: `field_name: error_message`, e.g.
7630    /// GetAppHubApplication: Permission denied while getting App Hub
7631    /// application. Please grant permissions to the P4SA.
7632    pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
7633
7634    /// The context of the InsightsConfig.
7635    pub insights_config_context:
7636        std::option::Option<crate::model::insights_config::InsightsConfigContext>,
7637
7638    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7639}
7640
7641impl InsightsConfig {
7642    pub fn new() -> Self {
7643        std::default::Default::default()
7644    }
7645
7646    /// Sets the value of [name][crate::model::InsightsConfig::name].
7647    ///
7648    /// # Example
7649    /// ```ignore,no_run
7650    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7651    /// let x = InsightsConfig::new().set_name("example");
7652    /// ```
7653    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7654        self.name = v.into();
7655        self
7656    }
7657
7658    /// Sets the value of [create_time][crate::model::InsightsConfig::create_time].
7659    ///
7660    /// # Example
7661    /// ```ignore,no_run
7662    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7663    /// use wkt::Timestamp;
7664    /// let x = InsightsConfig::new().set_create_time(Timestamp::default()/* use setters */);
7665    /// ```
7666    pub fn set_create_time<T>(mut self, v: T) -> Self
7667    where
7668        T: std::convert::Into<wkt::Timestamp>,
7669    {
7670        self.create_time = std::option::Option::Some(v.into());
7671        self
7672    }
7673
7674    /// Sets or clears the value of [create_time][crate::model::InsightsConfig::create_time].
7675    ///
7676    /// # Example
7677    /// ```ignore,no_run
7678    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7679    /// use wkt::Timestamp;
7680    /// let x = InsightsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7681    /// let x = InsightsConfig::new().set_or_clear_create_time(None::<Timestamp>);
7682    /// ```
7683    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7684    where
7685        T: std::convert::Into<wkt::Timestamp>,
7686    {
7687        self.create_time = v.map(|x| x.into());
7688        self
7689    }
7690
7691    /// Sets the value of [update_time][crate::model::InsightsConfig::update_time].
7692    ///
7693    /// # Example
7694    /// ```ignore,no_run
7695    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7696    /// use wkt::Timestamp;
7697    /// let x = InsightsConfig::new().set_update_time(Timestamp::default()/* use setters */);
7698    /// ```
7699    pub fn set_update_time<T>(mut self, v: T) -> Self
7700    where
7701        T: std::convert::Into<wkt::Timestamp>,
7702    {
7703        self.update_time = std::option::Option::Some(v.into());
7704        self
7705    }
7706
7707    /// Sets or clears the value of [update_time][crate::model::InsightsConfig::update_time].
7708    ///
7709    /// # Example
7710    /// ```ignore,no_run
7711    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7712    /// use wkt::Timestamp;
7713    /// let x = InsightsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7714    /// let x = InsightsConfig::new().set_or_clear_update_time(None::<Timestamp>);
7715    /// ```
7716    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7717    where
7718        T: std::convert::Into<wkt::Timestamp>,
7719    {
7720        self.update_time = v.map(|x| x.into());
7721        self
7722    }
7723
7724    /// Sets the value of [runtime_configs][crate::model::InsightsConfig::runtime_configs].
7725    ///
7726    /// # Example
7727    /// ```ignore,no_run
7728    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7729    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
7730    /// let x = InsightsConfig::new()
7731    ///     .set_runtime_configs([
7732    ///         RuntimeConfig::default()/* use setters */,
7733    ///         RuntimeConfig::default()/* use (different) setters */,
7734    ///     ]);
7735    /// ```
7736    pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
7737    where
7738        T: std::iter::IntoIterator<Item = V>,
7739        V: std::convert::Into<crate::model::RuntimeConfig>,
7740    {
7741        use std::iter::Iterator;
7742        self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
7743        self
7744    }
7745
7746    /// Sets the value of [artifact_configs][crate::model::InsightsConfig::artifact_configs].
7747    ///
7748    /// # Example
7749    /// ```ignore,no_run
7750    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7751    /// use google_cloud_developerconnect_v1::model::ArtifactConfig;
7752    /// let x = InsightsConfig::new()
7753    ///     .set_artifact_configs([
7754    ///         ArtifactConfig::default()/* use setters */,
7755    ///         ArtifactConfig::default()/* use (different) setters */,
7756    ///     ]);
7757    /// ```
7758    pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
7759    where
7760        T: std::iter::IntoIterator<Item = V>,
7761        V: std::convert::Into<crate::model::ArtifactConfig>,
7762    {
7763        use std::iter::Iterator;
7764        self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
7765        self
7766    }
7767
7768    /// Sets the value of [state][crate::model::InsightsConfig::state].
7769    ///
7770    /// # Example
7771    /// ```ignore,no_run
7772    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7773    /// use google_cloud_developerconnect_v1::model::insights_config::State;
7774    /// let x0 = InsightsConfig::new().set_state(State::Pending);
7775    /// let x1 = InsightsConfig::new().set_state(State::Complete);
7776    /// let x2 = InsightsConfig::new().set_state(State::Error);
7777    /// ```
7778    pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
7779        mut self,
7780        v: T,
7781    ) -> Self {
7782        self.state = v.into();
7783        self
7784    }
7785
7786    /// Sets the value of [annotations][crate::model::InsightsConfig::annotations].
7787    ///
7788    /// # Example
7789    /// ```ignore,no_run
7790    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7791    /// let x = InsightsConfig::new().set_annotations([
7792    ///     ("key0", "abc"),
7793    ///     ("key1", "xyz"),
7794    /// ]);
7795    /// ```
7796    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7797    where
7798        T: std::iter::IntoIterator<Item = (K, V)>,
7799        K: std::convert::Into<std::string::String>,
7800        V: std::convert::Into<std::string::String>,
7801    {
7802        use std::iter::Iterator;
7803        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7804        self
7805    }
7806
7807    /// Sets the value of [labels][crate::model::InsightsConfig::labels].
7808    ///
7809    /// # Example
7810    /// ```ignore,no_run
7811    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7812    /// let x = InsightsConfig::new().set_labels([
7813    ///     ("key0", "abc"),
7814    ///     ("key1", "xyz"),
7815    /// ]);
7816    /// ```
7817    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7818    where
7819        T: std::iter::IntoIterator<Item = (K, V)>,
7820        K: std::convert::Into<std::string::String>,
7821        V: std::convert::Into<std::string::String>,
7822    {
7823        use std::iter::Iterator;
7824        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7825        self
7826    }
7827
7828    /// Sets the value of [reconciling][crate::model::InsightsConfig::reconciling].
7829    ///
7830    /// # Example
7831    /// ```ignore,no_run
7832    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7833    /// let x = InsightsConfig::new().set_reconciling(true);
7834    /// ```
7835    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7836        self.reconciling = v.into();
7837        self
7838    }
7839
7840    /// Sets the value of [errors][crate::model::InsightsConfig::errors].
7841    ///
7842    /// # Example
7843    /// ```ignore,no_run
7844    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7845    /// use google_cloud_rpc::model::Status;
7846    /// let x = InsightsConfig::new()
7847    ///     .set_errors([
7848    ///         Status::default()/* use setters */,
7849    ///         Status::default()/* use (different) setters */,
7850    ///     ]);
7851    /// ```
7852    pub fn set_errors<T, V>(mut self, v: T) -> Self
7853    where
7854        T: std::iter::IntoIterator<Item = V>,
7855        V: std::convert::Into<google_cloud_rpc::model::Status>,
7856    {
7857        use std::iter::Iterator;
7858        self.errors = v.into_iter().map(|i| i.into()).collect();
7859        self
7860    }
7861
7862    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context].
7863    ///
7864    /// Note that all the setters affecting `insights_config_context` are mutually
7865    /// exclusive.
7866    ///
7867    /// # Example
7868    /// ```ignore,no_run
7869    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7870    /// use google_cloud_developerconnect_v1::model::insights_config::InsightsConfigContext;
7871    /// let x = InsightsConfig::new().set_insights_config_context(Some(InsightsConfigContext::AppHubApplication("example".to_string())));
7872    /// ```
7873    pub fn set_insights_config_context<
7874        T: std::convert::Into<
7875                std::option::Option<crate::model::insights_config::InsightsConfigContext>,
7876            >,
7877    >(
7878        mut self,
7879        v: T,
7880    ) -> Self {
7881        self.insights_config_context = v.into();
7882        self
7883    }
7884
7885    /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
7886    /// if it holds a `AppHubApplication`, `None` if the field is not set or
7887    /// holds a different branch.
7888    pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
7889        #[allow(unreachable_patterns)]
7890        self.insights_config_context.as_ref().and_then(|v| match v {
7891            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
7892                std::option::Option::Some(v)
7893            }
7894            _ => std::option::Option::None,
7895        })
7896    }
7897
7898    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
7899    /// to hold a `AppHubApplication`.
7900    ///
7901    /// Note that all the setters affecting `insights_config_context` are
7902    /// mutually exclusive.
7903    ///
7904    /// # Example
7905    /// ```ignore,no_run
7906    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7907    /// let x = InsightsConfig::new().set_app_hub_application("example");
7908    /// assert!(x.app_hub_application().is_some());
7909    /// assert!(x.projects().is_none());
7910    /// ```
7911    pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
7912        mut self,
7913        v: T,
7914    ) -> Self {
7915        self.insights_config_context = std::option::Option::Some(
7916            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
7917        );
7918        self
7919    }
7920
7921    /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
7922    /// if it holds a `Projects`, `None` if the field is not set or
7923    /// holds a different branch.
7924    pub fn projects(&self) -> std::option::Option<&std::boxed::Box<crate::model::Projects>> {
7925        #[allow(unreachable_patterns)]
7926        self.insights_config_context.as_ref().and_then(|v| match v {
7927            crate::model::insights_config::InsightsConfigContext::Projects(v) => {
7928                std::option::Option::Some(v)
7929            }
7930            _ => std::option::Option::None,
7931        })
7932    }
7933
7934    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
7935    /// to hold a `Projects`.
7936    ///
7937    /// Note that all the setters affecting `insights_config_context` are
7938    /// mutually exclusive.
7939    ///
7940    /// # Example
7941    /// ```ignore,no_run
7942    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7943    /// use google_cloud_developerconnect_v1::model::Projects;
7944    /// let x = InsightsConfig::new().set_projects(Projects::default()/* use setters */);
7945    /// assert!(x.projects().is_some());
7946    /// assert!(x.app_hub_application().is_none());
7947    /// ```
7948    pub fn set_projects<T: std::convert::Into<std::boxed::Box<crate::model::Projects>>>(
7949        mut self,
7950        v: T,
7951    ) -> Self {
7952        self.insights_config_context = std::option::Option::Some(
7953            crate::model::insights_config::InsightsConfigContext::Projects(v.into()),
7954        );
7955        self
7956    }
7957}
7958
7959impl wkt::message::Message for InsightsConfig {
7960    fn typename() -> &'static str {
7961        "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
7962    }
7963}
7964
7965/// Defines additional types related to [InsightsConfig].
7966pub mod insights_config {
7967    #[allow(unused_imports)]
7968    use super::*;
7969
7970    /// The state of the InsightsConfig.
7971    ///
7972    /// # Working with unknown values
7973    ///
7974    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7975    /// additional enum variants at any time. Adding new variants is not considered
7976    /// a breaking change. Applications should write their code in anticipation of:
7977    ///
7978    /// - New values appearing in future releases of the client library, **and**
7979    /// - New values received dynamically, without application changes.
7980    ///
7981    /// Please consult the [Working with enums] section in the user guide for some
7982    /// guidelines.
7983    ///
7984    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7985    #[derive(Clone, Debug, PartialEq)]
7986    #[non_exhaustive]
7987    pub enum State {
7988        /// No state specified.
7989        Unspecified,
7990        /// The InsightsConfig is pending application discovery/runtime discovery.
7991        Pending,
7992        /// The initial discovery process is complete.
7993        Complete,
7994        /// The InsightsConfig is in an error state.
7995        Error,
7996        /// If set, the enum was initialized with an unknown value.
7997        ///
7998        /// Applications can examine the value using [State::value] or
7999        /// [State::name].
8000        UnknownValue(state::UnknownValue),
8001    }
8002
8003    #[doc(hidden)]
8004    pub mod state {
8005        #[allow(unused_imports)]
8006        use super::*;
8007        #[derive(Clone, Debug, PartialEq)]
8008        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8009    }
8010
8011    impl State {
8012        /// Gets the enum value.
8013        ///
8014        /// Returns `None` if the enum contains an unknown value deserialized from
8015        /// the string representation of enums.
8016        pub fn value(&self) -> std::option::Option<i32> {
8017            match self {
8018                Self::Unspecified => std::option::Option::Some(0),
8019                Self::Pending => std::option::Option::Some(5),
8020                Self::Complete => std::option::Option::Some(3),
8021                Self::Error => std::option::Option::Some(4),
8022                Self::UnknownValue(u) => u.0.value(),
8023            }
8024        }
8025
8026        /// Gets the enum value as a string.
8027        ///
8028        /// Returns `None` if the enum contains an unknown value deserialized from
8029        /// the integer representation of enums.
8030        pub fn name(&self) -> std::option::Option<&str> {
8031            match self {
8032                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8033                Self::Pending => std::option::Option::Some("PENDING"),
8034                Self::Complete => std::option::Option::Some("COMPLETE"),
8035                Self::Error => std::option::Option::Some("ERROR"),
8036                Self::UnknownValue(u) => u.0.name(),
8037            }
8038        }
8039    }
8040
8041    impl std::default::Default for State {
8042        fn default() -> Self {
8043            use std::convert::From;
8044            Self::from(0)
8045        }
8046    }
8047
8048    impl std::fmt::Display for State {
8049        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8050            wkt::internal::display_enum(f, self.name(), self.value())
8051        }
8052    }
8053
8054    impl std::convert::From<i32> for State {
8055        fn from(value: i32) -> Self {
8056            match value {
8057                0 => Self::Unspecified,
8058                3 => Self::Complete,
8059                4 => Self::Error,
8060                5 => Self::Pending,
8061                _ => Self::UnknownValue(state::UnknownValue(
8062                    wkt::internal::UnknownEnumValue::Integer(value),
8063                )),
8064            }
8065        }
8066    }
8067
8068    impl std::convert::From<&str> for State {
8069        fn from(value: &str) -> Self {
8070            use std::string::ToString;
8071            match value {
8072                "STATE_UNSPECIFIED" => Self::Unspecified,
8073                "PENDING" => Self::Pending,
8074                "COMPLETE" => Self::Complete,
8075                "ERROR" => Self::Error,
8076                _ => Self::UnknownValue(state::UnknownValue(
8077                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8078                )),
8079            }
8080        }
8081    }
8082
8083    impl serde::ser::Serialize for State {
8084        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8085        where
8086            S: serde::Serializer,
8087        {
8088            match self {
8089                Self::Unspecified => serializer.serialize_i32(0),
8090                Self::Pending => serializer.serialize_i32(5),
8091                Self::Complete => serializer.serialize_i32(3),
8092                Self::Error => serializer.serialize_i32(4),
8093                Self::UnknownValue(u) => u.0.serialize(serializer),
8094            }
8095        }
8096    }
8097
8098    impl<'de> serde::de::Deserialize<'de> for State {
8099        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8100        where
8101            D: serde::Deserializer<'de>,
8102        {
8103            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8104                ".google.cloud.developerconnect.v1.InsightsConfig.State",
8105            ))
8106        }
8107    }
8108
8109    /// The context of the InsightsConfig.
8110    #[derive(Clone, Debug, PartialEq)]
8111    #[non_exhaustive]
8112    pub enum InsightsConfigContext {
8113        /// Optional. The name of the App Hub Application.
8114        /// Format:
8115        /// projects/{project}/locations/{location}/applications/{application}
8116        AppHubApplication(std::string::String),
8117        /// Optional. The projects to track with the InsightsConfig.
8118        Projects(std::boxed::Box<crate::model::Projects>),
8119    }
8120}
8121
8122/// Projects represents the projects to track with the InsightsConfig.
8123#[derive(Clone, Default, PartialEq)]
8124#[non_exhaustive]
8125pub struct Projects {
8126    /// Optional. The project IDs.
8127    /// Format: {project}
8128    pub project_ids: std::vec::Vec<std::string::String>,
8129
8130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8131}
8132
8133impl Projects {
8134    pub fn new() -> Self {
8135        std::default::Default::default()
8136    }
8137
8138    /// Sets the value of [project_ids][crate::model::Projects::project_ids].
8139    ///
8140    /// # Example
8141    /// ```ignore,no_run
8142    /// # use google_cloud_developerconnect_v1::model::Projects;
8143    /// let x = Projects::new().set_project_ids(["a", "b", "c"]);
8144    /// ```
8145    pub fn set_project_ids<T, V>(mut self, v: T) -> Self
8146    where
8147        T: std::iter::IntoIterator<Item = V>,
8148        V: std::convert::Into<std::string::String>,
8149    {
8150        use std::iter::Iterator;
8151        self.project_ids = v.into_iter().map(|i| i.into()).collect();
8152        self
8153    }
8154}
8155
8156impl wkt::message::Message for Projects {
8157    fn typename() -> &'static str {
8158        "type.googleapis.com/google.cloud.developerconnect.v1.Projects"
8159    }
8160}
8161
8162/// RuntimeConfig represents the runtimes where the application is
8163/// deployed.
8164#[derive(Clone, Default, PartialEq)]
8165#[non_exhaustive]
8166pub struct RuntimeConfig {
8167    /// Required. Immutable. The URI of the runtime configuration.
8168    /// For GKE, this is the cluster name.
8169    /// For Cloud Run, this is the service name.
8170    pub uri: std::string::String,
8171
8172    /// Output only. The state of the Runtime.
8173    pub state: crate::model::runtime_config::State,
8174
8175    /// The type of the runtime.
8176    pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
8177
8178    /// Where the runtime is derived from.
8179    pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
8180
8181    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8182}
8183
8184impl RuntimeConfig {
8185    pub fn new() -> Self {
8186        std::default::Default::default()
8187    }
8188
8189    /// Sets the value of [uri][crate::model::RuntimeConfig::uri].
8190    ///
8191    /// # Example
8192    /// ```ignore,no_run
8193    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8194    /// let x = RuntimeConfig::new().set_uri("example");
8195    /// ```
8196    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8197        self.uri = v.into();
8198        self
8199    }
8200
8201    /// Sets the value of [state][crate::model::RuntimeConfig::state].
8202    ///
8203    /// # Example
8204    /// ```ignore,no_run
8205    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8206    /// use google_cloud_developerconnect_v1::model::runtime_config::State;
8207    /// let x0 = RuntimeConfig::new().set_state(State::Linked);
8208    /// let x1 = RuntimeConfig::new().set_state(State::Unlinked);
8209    /// ```
8210    pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
8211        mut self,
8212        v: T,
8213    ) -> Self {
8214        self.state = v.into();
8215        self
8216    }
8217
8218    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime].
8219    ///
8220    /// Note that all the setters affecting `runtime` are mutually
8221    /// exclusive.
8222    ///
8223    /// # Example
8224    /// ```ignore,no_run
8225    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8226    /// use google_cloud_developerconnect_v1::model::GKEWorkload;
8227    /// let x = RuntimeConfig::new().set_runtime(Some(
8228    ///     google_cloud_developerconnect_v1::model::runtime_config::Runtime::GkeWorkload(GKEWorkload::default().into())));
8229    /// ```
8230    pub fn set_runtime<
8231        T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
8232    >(
8233        mut self,
8234        v: T,
8235    ) -> Self {
8236        self.runtime = v.into();
8237        self
8238    }
8239
8240    /// The value of [runtime][crate::model::RuntimeConfig::runtime]
8241    /// if it holds a `GkeWorkload`, `None` if the field is not set or
8242    /// holds a different branch.
8243    pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
8244        #[allow(unreachable_patterns)]
8245        self.runtime.as_ref().and_then(|v| match v {
8246            crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
8247            _ => std::option::Option::None,
8248        })
8249    }
8250
8251    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
8252    /// to hold a `GkeWorkload`.
8253    ///
8254    /// Note that all the setters affecting `runtime` are
8255    /// mutually exclusive.
8256    ///
8257    /// # Example
8258    /// ```ignore,no_run
8259    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8260    /// use google_cloud_developerconnect_v1::model::GKEWorkload;
8261    /// let x = RuntimeConfig::new().set_gke_workload(GKEWorkload::default()/* use setters */);
8262    /// assert!(x.gke_workload().is_some());
8263    /// assert!(x.google_cloud_run().is_none());
8264    /// ```
8265    pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
8266        mut self,
8267        v: T,
8268    ) -> Self {
8269        self.runtime =
8270            std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
8271        self
8272    }
8273
8274    /// The value of [runtime][crate::model::RuntimeConfig::runtime]
8275    /// if it holds a `GoogleCloudRun`, `None` if the field is not set or
8276    /// holds a different branch.
8277    pub fn google_cloud_run(
8278        &self,
8279    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleCloudRun>> {
8280        #[allow(unreachable_patterns)]
8281        self.runtime.as_ref().and_then(|v| match v {
8282            crate::model::runtime_config::Runtime::GoogleCloudRun(v) => {
8283                std::option::Option::Some(v)
8284            }
8285            _ => std::option::Option::None,
8286        })
8287    }
8288
8289    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
8290    /// to hold a `GoogleCloudRun`.
8291    ///
8292    /// Note that all the setters affecting `runtime` are
8293    /// mutually exclusive.
8294    ///
8295    /// # Example
8296    /// ```ignore,no_run
8297    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8298    /// use google_cloud_developerconnect_v1::model::GoogleCloudRun;
8299    /// let x = RuntimeConfig::new().set_google_cloud_run(GoogleCloudRun::default()/* use setters */);
8300    /// assert!(x.google_cloud_run().is_some());
8301    /// assert!(x.gke_workload().is_none());
8302    /// ```
8303    pub fn set_google_cloud_run<
8304        T: std::convert::Into<std::boxed::Box<crate::model::GoogleCloudRun>>,
8305    >(
8306        mut self,
8307        v: T,
8308    ) -> Self {
8309        self.runtime = std::option::Option::Some(
8310            crate::model::runtime_config::Runtime::GoogleCloudRun(v.into()),
8311        );
8312        self
8313    }
8314
8315    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from].
8316    ///
8317    /// Note that all the setters affecting `derived_from` are mutually
8318    /// exclusive.
8319    ///
8320    /// # Example
8321    /// ```ignore,no_run
8322    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8323    /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
8324    /// let x = RuntimeConfig::new().set_derived_from(Some(
8325    ///     google_cloud_developerconnect_v1::model::runtime_config::DerivedFrom::AppHubWorkload(AppHubWorkload::default().into())));
8326    /// ```
8327    pub fn set_derived_from<
8328        T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
8329    >(
8330        mut self,
8331        v: T,
8332    ) -> Self {
8333        self.derived_from = v.into();
8334        self
8335    }
8336
8337    /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
8338    /// if it holds a `AppHubWorkload`, `None` if the field is not set or
8339    /// holds a different branch.
8340    pub fn app_hub_workload(
8341        &self,
8342    ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
8343        #[allow(unreachable_patterns)]
8344        self.derived_from.as_ref().and_then(|v| match v {
8345            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
8346                std::option::Option::Some(v)
8347            }
8348            _ => std::option::Option::None,
8349        })
8350    }
8351
8352    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
8353    /// to hold a `AppHubWorkload`.
8354    ///
8355    /// Note that all the setters affecting `derived_from` are
8356    /// mutually exclusive.
8357    ///
8358    /// # Example
8359    /// ```ignore,no_run
8360    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8361    /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
8362    /// let x = RuntimeConfig::new().set_app_hub_workload(AppHubWorkload::default()/* use setters */);
8363    /// assert!(x.app_hub_workload().is_some());
8364    /// assert!(x.app_hub_service().is_none());
8365    /// ```
8366    pub fn set_app_hub_workload<
8367        T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
8368    >(
8369        mut self,
8370        v: T,
8371    ) -> Self {
8372        self.derived_from = std::option::Option::Some(
8373            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
8374        );
8375        self
8376    }
8377
8378    /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
8379    /// if it holds a `AppHubService`, `None` if the field is not set or
8380    /// holds a different branch.
8381    pub fn app_hub_service(
8382        &self,
8383    ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubService>> {
8384        #[allow(unreachable_patterns)]
8385        self.derived_from.as_ref().and_then(|v| match v {
8386            crate::model::runtime_config::DerivedFrom::AppHubService(v) => {
8387                std::option::Option::Some(v)
8388            }
8389            _ => std::option::Option::None,
8390        })
8391    }
8392
8393    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
8394    /// to hold a `AppHubService`.
8395    ///
8396    /// Note that all the setters affecting `derived_from` are
8397    /// mutually exclusive.
8398    ///
8399    /// # Example
8400    /// ```ignore,no_run
8401    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8402    /// use google_cloud_developerconnect_v1::model::AppHubService;
8403    /// let x = RuntimeConfig::new().set_app_hub_service(AppHubService::default()/* use setters */);
8404    /// assert!(x.app_hub_service().is_some());
8405    /// assert!(x.app_hub_workload().is_none());
8406    /// ```
8407    pub fn set_app_hub_service<
8408        T: std::convert::Into<std::boxed::Box<crate::model::AppHubService>>,
8409    >(
8410        mut self,
8411        v: T,
8412    ) -> Self {
8413        self.derived_from = std::option::Option::Some(
8414            crate::model::runtime_config::DerivedFrom::AppHubService(v.into()),
8415        );
8416        self
8417    }
8418}
8419
8420impl wkt::message::Message for RuntimeConfig {
8421    fn typename() -> &'static str {
8422        "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
8423    }
8424}
8425
8426/// Defines additional types related to [RuntimeConfig].
8427pub mod runtime_config {
8428    #[allow(unused_imports)]
8429    use super::*;
8430
8431    /// The state of the runtime in the InsightsConfig.
8432    /// Whether the runtime is linked to the InsightsConfig.
8433    ///
8434    /// # Working with unknown values
8435    ///
8436    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8437    /// additional enum variants at any time. Adding new variants is not considered
8438    /// a breaking change. Applications should write their code in anticipation of:
8439    ///
8440    /// - New values appearing in future releases of the client library, **and**
8441    /// - New values received dynamically, without application changes.
8442    ///
8443    /// Please consult the [Working with enums] section in the user guide for some
8444    /// guidelines.
8445    ///
8446    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8447    #[derive(Clone, Debug, PartialEq)]
8448    #[non_exhaustive]
8449    pub enum State {
8450        /// No state specified.
8451        Unspecified,
8452        /// The runtime configuration has been linked to the InsightsConfig.
8453        Linked,
8454        /// The runtime configuration has been unlinked to the InsightsConfig.
8455        Unlinked,
8456        /// If set, the enum was initialized with an unknown value.
8457        ///
8458        /// Applications can examine the value using [State::value] or
8459        /// [State::name].
8460        UnknownValue(state::UnknownValue),
8461    }
8462
8463    #[doc(hidden)]
8464    pub mod state {
8465        #[allow(unused_imports)]
8466        use super::*;
8467        #[derive(Clone, Debug, PartialEq)]
8468        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8469    }
8470
8471    impl State {
8472        /// Gets the enum value.
8473        ///
8474        /// Returns `None` if the enum contains an unknown value deserialized from
8475        /// the string representation of enums.
8476        pub fn value(&self) -> std::option::Option<i32> {
8477            match self {
8478                Self::Unspecified => std::option::Option::Some(0),
8479                Self::Linked => std::option::Option::Some(1),
8480                Self::Unlinked => std::option::Option::Some(2),
8481                Self::UnknownValue(u) => u.0.value(),
8482            }
8483        }
8484
8485        /// Gets the enum value as a string.
8486        ///
8487        /// Returns `None` if the enum contains an unknown value deserialized from
8488        /// the integer representation of enums.
8489        pub fn name(&self) -> std::option::Option<&str> {
8490            match self {
8491                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8492                Self::Linked => std::option::Option::Some("LINKED"),
8493                Self::Unlinked => std::option::Option::Some("UNLINKED"),
8494                Self::UnknownValue(u) => u.0.name(),
8495            }
8496        }
8497    }
8498
8499    impl std::default::Default for State {
8500        fn default() -> Self {
8501            use std::convert::From;
8502            Self::from(0)
8503        }
8504    }
8505
8506    impl std::fmt::Display for State {
8507        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8508            wkt::internal::display_enum(f, self.name(), self.value())
8509        }
8510    }
8511
8512    impl std::convert::From<i32> for State {
8513        fn from(value: i32) -> Self {
8514            match value {
8515                0 => Self::Unspecified,
8516                1 => Self::Linked,
8517                2 => Self::Unlinked,
8518                _ => Self::UnknownValue(state::UnknownValue(
8519                    wkt::internal::UnknownEnumValue::Integer(value),
8520                )),
8521            }
8522        }
8523    }
8524
8525    impl std::convert::From<&str> for State {
8526        fn from(value: &str) -> Self {
8527            use std::string::ToString;
8528            match value {
8529                "STATE_UNSPECIFIED" => Self::Unspecified,
8530                "LINKED" => Self::Linked,
8531                "UNLINKED" => Self::Unlinked,
8532                _ => Self::UnknownValue(state::UnknownValue(
8533                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8534                )),
8535            }
8536        }
8537    }
8538
8539    impl serde::ser::Serialize for State {
8540        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8541        where
8542            S: serde::Serializer,
8543        {
8544            match self {
8545                Self::Unspecified => serializer.serialize_i32(0),
8546                Self::Linked => serializer.serialize_i32(1),
8547                Self::Unlinked => serializer.serialize_i32(2),
8548                Self::UnknownValue(u) => u.0.serialize(serializer),
8549            }
8550        }
8551    }
8552
8553    impl<'de> serde::de::Deserialize<'de> for State {
8554        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8555        where
8556            D: serde::Deserializer<'de>,
8557        {
8558            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8559                ".google.cloud.developerconnect.v1.RuntimeConfig.State",
8560            ))
8561        }
8562    }
8563
8564    /// The type of the runtime.
8565    #[derive(Clone, Debug, PartialEq)]
8566    #[non_exhaustive]
8567    pub enum Runtime {
8568        /// Output only. Google Kubernetes Engine runtime.
8569        GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
8570        /// Output only. Cloud Run runtime.
8571        GoogleCloudRun(std::boxed::Box<crate::model::GoogleCloudRun>),
8572    }
8573
8574    /// Where the runtime is derived from.
8575    #[derive(Clone, Debug, PartialEq)]
8576    #[non_exhaustive]
8577    pub enum DerivedFrom {
8578        /// Output only. App Hub Workload.
8579        AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
8580        /// Output only. App Hub Service.
8581        AppHubService(std::boxed::Box<crate::model::AppHubService>),
8582    }
8583}
8584
8585/// GKEWorkload represents the Google Kubernetes Engine runtime.
8586#[derive(Clone, Default, PartialEq)]
8587#[non_exhaustive]
8588pub struct GKEWorkload {
8589    /// Required. Immutable. The name of the GKE cluster.
8590    /// Format:
8591    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
8592    pub cluster: std::string::String,
8593
8594    /// Output only. The name of the GKE deployment.
8595    /// Format:
8596    /// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
8597    pub deployment: std::string::String,
8598
8599    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8600}
8601
8602impl GKEWorkload {
8603    pub fn new() -> Self {
8604        std::default::Default::default()
8605    }
8606
8607    /// Sets the value of [cluster][crate::model::GKEWorkload::cluster].
8608    ///
8609    /// # Example
8610    /// ```ignore,no_run
8611    /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
8612    /// let x = GKEWorkload::new().set_cluster("example");
8613    /// ```
8614    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8615        self.cluster = v.into();
8616        self
8617    }
8618
8619    /// Sets the value of [deployment][crate::model::GKEWorkload::deployment].
8620    ///
8621    /// # Example
8622    /// ```ignore,no_run
8623    /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
8624    /// let x = GKEWorkload::new().set_deployment("example");
8625    /// ```
8626    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8627        self.deployment = v.into();
8628        self
8629    }
8630}
8631
8632impl wkt::message::Message for GKEWorkload {
8633    fn typename() -> &'static str {
8634        "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
8635    }
8636}
8637
8638/// GoogleCloudRun represents the Cloud Run runtime.
8639#[derive(Clone, Default, PartialEq)]
8640#[non_exhaustive]
8641pub struct GoogleCloudRun {
8642    /// Required. Immutable. The name of the Cloud Run service.
8643    /// Format:
8644    /// `projects/{project}/locations/{location}/services/{service}`.
8645    pub service_uri: std::string::String,
8646
8647    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8648}
8649
8650impl GoogleCloudRun {
8651    pub fn new() -> Self {
8652        std::default::Default::default()
8653    }
8654
8655    /// Sets the value of [service_uri][crate::model::GoogleCloudRun::service_uri].
8656    ///
8657    /// # Example
8658    /// ```ignore,no_run
8659    /// # use google_cloud_developerconnect_v1::model::GoogleCloudRun;
8660    /// let x = GoogleCloudRun::new().set_service_uri("example");
8661    /// ```
8662    pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8663        self.service_uri = v.into();
8664        self
8665    }
8666}
8667
8668impl wkt::message::Message for GoogleCloudRun {
8669    fn typename() -> &'static str {
8670        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleCloudRun"
8671    }
8672}
8673
8674/// AppHubWorkload represents the App Hub Workload.
8675#[derive(Clone, Default, PartialEq)]
8676#[non_exhaustive]
8677pub struct AppHubWorkload {
8678    /// Required. Output only. Immutable. The name of the App Hub Workload.
8679    /// Format:
8680    /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
8681    pub workload: std::string::String,
8682
8683    /// Output only. The criticality of the App Hub Workload.
8684    pub criticality: std::string::String,
8685
8686    /// Output only. The environment of the App Hub Workload.
8687    pub environment: std::string::String,
8688
8689    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8690}
8691
8692impl AppHubWorkload {
8693    pub fn new() -> Self {
8694        std::default::Default::default()
8695    }
8696
8697    /// Sets the value of [workload][crate::model::AppHubWorkload::workload].
8698    ///
8699    /// # Example
8700    /// ```ignore,no_run
8701    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8702    /// let x = AppHubWorkload::new().set_workload("example");
8703    /// ```
8704    pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8705        self.workload = v.into();
8706        self
8707    }
8708
8709    /// Sets the value of [criticality][crate::model::AppHubWorkload::criticality].
8710    ///
8711    /// # Example
8712    /// ```ignore,no_run
8713    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8714    /// let x = AppHubWorkload::new().set_criticality("example");
8715    /// ```
8716    pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8717        self.criticality = v.into();
8718        self
8719    }
8720
8721    /// Sets the value of [environment][crate::model::AppHubWorkload::environment].
8722    ///
8723    /// # Example
8724    /// ```ignore,no_run
8725    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8726    /// let x = AppHubWorkload::new().set_environment("example");
8727    /// ```
8728    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8729        self.environment = v.into();
8730        self
8731    }
8732}
8733
8734impl wkt::message::Message for AppHubWorkload {
8735    fn typename() -> &'static str {
8736        "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
8737    }
8738}
8739
8740/// AppHubService represents the App Hub Service.
8741#[derive(Clone, Default, PartialEq)]
8742#[non_exhaustive]
8743pub struct AppHubService {
8744    /// Required. Output only. Immutable. The name of the App Hub Service.
8745    /// Format:
8746    /// `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
8747    pub apphub_service: std::string::String,
8748
8749    /// Output only. The criticality of the App Hub Service.
8750    pub criticality: std::string::String,
8751
8752    /// Output only. The environment of the App Hub Service.
8753    pub environment: std::string::String,
8754
8755    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8756}
8757
8758impl AppHubService {
8759    pub fn new() -> Self {
8760        std::default::Default::default()
8761    }
8762
8763    /// Sets the value of [apphub_service][crate::model::AppHubService::apphub_service].
8764    ///
8765    /// # Example
8766    /// ```ignore,no_run
8767    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8768    /// let x = AppHubService::new().set_apphub_service("example");
8769    /// ```
8770    pub fn set_apphub_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8771        self.apphub_service = v.into();
8772        self
8773    }
8774
8775    /// Sets the value of [criticality][crate::model::AppHubService::criticality].
8776    ///
8777    /// # Example
8778    /// ```ignore,no_run
8779    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8780    /// let x = AppHubService::new().set_criticality("example");
8781    /// ```
8782    pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8783        self.criticality = v.into();
8784        self
8785    }
8786
8787    /// Sets the value of [environment][crate::model::AppHubService::environment].
8788    ///
8789    /// # Example
8790    /// ```ignore,no_run
8791    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8792    /// let x = AppHubService::new().set_environment("example");
8793    /// ```
8794    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8795        self.environment = v.into();
8796        self
8797    }
8798}
8799
8800impl wkt::message::Message for AppHubService {
8801    fn typename() -> &'static str {
8802        "type.googleapis.com/google.cloud.developerconnect.v1.AppHubService"
8803    }
8804}
8805
8806/// The artifact config of the artifact that is deployed.
8807#[derive(Clone, Default, PartialEq)]
8808#[non_exhaustive]
8809pub struct ArtifactConfig {
8810    /// Required. Immutable. The URI of the artifact that is deployed.
8811    /// e.g. `us-docker.pkg.dev/my-project/my-repo/image`.
8812    /// The URI does not include the tag / digest because it captures a lineage of
8813    /// artifacts.
8814    pub uri: std::string::String,
8815
8816    /// The storage location of the artifact.
8817    pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
8818
8819    /// The storage location of the artifact metadata.
8820    pub artifact_metadata_storage:
8821        std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
8822
8823    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8824}
8825
8826impl ArtifactConfig {
8827    pub fn new() -> Self {
8828        std::default::Default::default()
8829    }
8830
8831    /// Sets the value of [uri][crate::model::ArtifactConfig::uri].
8832    ///
8833    /// # Example
8834    /// ```ignore,no_run
8835    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8836    /// let x = ArtifactConfig::new().set_uri("example");
8837    /// ```
8838    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8839        self.uri = v.into();
8840        self
8841    }
8842
8843    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage].
8844    ///
8845    /// Note that all the setters affecting `artifact_storage` are mutually
8846    /// exclusive.
8847    ///
8848    /// # Example
8849    /// ```ignore,no_run
8850    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8851    /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
8852    /// let x = ArtifactConfig::new().set_artifact_storage(Some(
8853    ///     google_cloud_developerconnect_v1::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(GoogleArtifactRegistry::default().into())));
8854    /// ```
8855    pub fn set_artifact_storage<
8856        T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
8857    >(
8858        mut self,
8859        v: T,
8860    ) -> Self {
8861        self.artifact_storage = v.into();
8862        self
8863    }
8864
8865    /// The value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
8866    /// if it holds a `GoogleArtifactRegistry`, `None` if the field is not set or
8867    /// holds a different branch.
8868    pub fn google_artifact_registry(
8869        &self,
8870    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
8871        #[allow(unreachable_patterns)]
8872        self.artifact_storage.as_ref().and_then(|v| match v {
8873            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
8874                std::option::Option::Some(v)
8875            }
8876            _ => std::option::Option::None,
8877        })
8878    }
8879
8880    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
8881    /// to hold a `GoogleArtifactRegistry`.
8882    ///
8883    /// Note that all the setters affecting `artifact_storage` are
8884    /// mutually exclusive.
8885    ///
8886    /// # Example
8887    /// ```ignore,no_run
8888    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8889    /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
8890    /// let x = ArtifactConfig::new().set_google_artifact_registry(GoogleArtifactRegistry::default()/* use setters */);
8891    /// assert!(x.google_artifact_registry().is_some());
8892    /// ```
8893    pub fn set_google_artifact_registry<
8894        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
8895    >(
8896        mut self,
8897        v: T,
8898    ) -> Self {
8899        self.artifact_storage = std::option::Option::Some(
8900            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
8901        );
8902        self
8903    }
8904
8905    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage].
8906    ///
8907    /// Note that all the setters affecting `artifact_metadata_storage` are mutually
8908    /// exclusive.
8909    ///
8910    /// # Example
8911    /// ```ignore,no_run
8912    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8913    /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
8914    /// let x = ArtifactConfig::new().set_artifact_metadata_storage(Some(
8915    ///     google_cloud_developerconnect_v1::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(GoogleArtifactAnalysis::default().into())));
8916    /// ```
8917    pub fn set_artifact_metadata_storage<
8918        T: std::convert::Into<
8919                std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
8920            >,
8921    >(
8922        mut self,
8923        v: T,
8924    ) -> Self {
8925        self.artifact_metadata_storage = v.into();
8926        self
8927    }
8928
8929    /// The value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
8930    /// if it holds a `GoogleArtifactAnalysis`, `None` if the field is not set or
8931    /// holds a different branch.
8932    pub fn google_artifact_analysis(
8933        &self,
8934    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
8935        #[allow(unreachable_patterns)]
8936        self.artifact_metadata_storage
8937            .as_ref()
8938            .and_then(|v| match v {
8939                crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
8940                    v,
8941                ) => std::option::Option::Some(v),
8942                _ => std::option::Option::None,
8943            })
8944    }
8945
8946    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
8947    /// to hold a `GoogleArtifactAnalysis`.
8948    ///
8949    /// Note that all the setters affecting `artifact_metadata_storage` are
8950    /// mutually exclusive.
8951    ///
8952    /// # Example
8953    /// ```ignore,no_run
8954    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
8955    /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
8956    /// let x = ArtifactConfig::new().set_google_artifact_analysis(GoogleArtifactAnalysis::default()/* use setters */);
8957    /// assert!(x.google_artifact_analysis().is_some());
8958    /// ```
8959    pub fn set_google_artifact_analysis<
8960        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
8961    >(
8962        mut self,
8963        v: T,
8964    ) -> Self {
8965        self.artifact_metadata_storage = std::option::Option::Some(
8966            crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
8967                v.into(),
8968            ),
8969        );
8970        self
8971    }
8972}
8973
8974impl wkt::message::Message for ArtifactConfig {
8975    fn typename() -> &'static str {
8976        "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
8977    }
8978}
8979
8980/// Defines additional types related to [ArtifactConfig].
8981pub mod artifact_config {
8982    #[allow(unused_imports)]
8983    use super::*;
8984
8985    /// The storage location of the artifact.
8986    #[derive(Clone, Debug, PartialEq)]
8987    #[non_exhaustive]
8988    pub enum ArtifactStorage {
8989        /// Optional. Set if the artifact is stored in Artifact registry.
8990        GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
8991    }
8992
8993    /// The storage location of the artifact metadata.
8994    #[derive(Clone, Debug, PartialEq)]
8995    #[non_exhaustive]
8996    pub enum ArtifactMetadataStorage {
8997        /// Optional. Set if the artifact metadata is stored in Artifact analysis.
8998        GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
8999    }
9000}
9001
9002/// Google Artifact Analysis configurations.
9003#[derive(Clone, Default, PartialEq)]
9004#[non_exhaustive]
9005pub struct GoogleArtifactAnalysis {
9006    /// Required. The project id of the project where the provenance is stored.
9007    pub project_id: std::string::String,
9008
9009    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9010}
9011
9012impl GoogleArtifactAnalysis {
9013    pub fn new() -> Self {
9014        std::default::Default::default()
9015    }
9016
9017    /// Sets the value of [project_id][crate::model::GoogleArtifactAnalysis::project_id].
9018    ///
9019    /// # Example
9020    /// ```ignore,no_run
9021    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
9022    /// let x = GoogleArtifactAnalysis::new().set_project_id("example");
9023    /// ```
9024    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9025        self.project_id = v.into();
9026        self
9027    }
9028}
9029
9030impl wkt::message::Message for GoogleArtifactAnalysis {
9031    fn typename() -> &'static str {
9032        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
9033    }
9034}
9035
9036/// Google Artifact Registry configurations.
9037#[derive(Clone, Default, PartialEq)]
9038#[non_exhaustive]
9039pub struct GoogleArtifactRegistry {
9040    /// Required. The host project of Artifact Registry.
9041    pub project_id: std::string::String,
9042
9043    /// Required. Immutable. The name of the artifact registry package.
9044    pub artifact_registry_package: std::string::String,
9045
9046    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9047}
9048
9049impl GoogleArtifactRegistry {
9050    pub fn new() -> Self {
9051        std::default::Default::default()
9052    }
9053
9054    /// Sets the value of [project_id][crate::model::GoogleArtifactRegistry::project_id].
9055    ///
9056    /// # Example
9057    /// ```ignore,no_run
9058    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9059    /// let x = GoogleArtifactRegistry::new().set_project_id("example");
9060    /// ```
9061    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9062        self.project_id = v.into();
9063        self
9064    }
9065
9066    /// Sets the value of [artifact_registry_package][crate::model::GoogleArtifactRegistry::artifact_registry_package].
9067    ///
9068    /// # Example
9069    /// ```ignore,no_run
9070    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9071    /// let x = GoogleArtifactRegistry::new().set_artifact_registry_package("example");
9072    /// ```
9073    pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
9074        mut self,
9075        v: T,
9076    ) -> Self {
9077        self.artifact_registry_package = v.into();
9078        self
9079    }
9080}
9081
9082impl wkt::message::Message for GoogleArtifactRegistry {
9083    fn typename() -> &'static str {
9084        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
9085    }
9086}
9087
9088/// The DeploymentEvent resource represents the deployment of the artifact within
9089/// the InsightsConfig resource.
9090#[derive(Clone, Default, PartialEq)]
9091#[non_exhaustive]
9092pub struct DeploymentEvent {
9093    /// Identifier. The name of the DeploymentEvent. This name is provided by
9094    /// Developer Connect insights. Format:
9095    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
9096    pub name: std::string::String,
9097
9098    /// Output only. The create time of the DeploymentEvent.
9099    pub create_time: std::option::Option<wkt::Timestamp>,
9100
9101    /// Output only. The update time of the DeploymentEvent.
9102    pub update_time: std::option::Option<wkt::Timestamp>,
9103
9104    /// Output only. The runtime configurations where the DeploymentEvent happened.
9105    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
9106
9107    /// Output only. The runtime assigned URI of the DeploymentEvent.
9108    /// For GKE, this is the fully qualified replica set uri.
9109    /// e.g.
9110    /// container.googleapis.com/projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/apps/replicasets/{replica-set-id}
9111    /// For Cloud Run, this is the revision name.
9112    pub runtime_deployment_uri: std::string::String,
9113
9114    /// Output only. The state of the DeploymentEvent.
9115    pub state: crate::model::deployment_event::State,
9116
9117    /// Output only. The artifact deployments of the DeploymentEvent. Each artifact
9118    /// deployment contains the artifact uri and the runtime configuration uri. For
9119    /// GKE, this would be all the containers images that are deployed in the pod.
9120    pub artifact_deployments: std::vec::Vec<crate::model::ArtifactDeployment>,
9121
9122    /// Output only. The time at which the DeploymentEvent was deployed.
9123    /// This would be the min of all ArtifactDeployment deploy_times.
9124    pub deploy_time: std::option::Option<wkt::Timestamp>,
9125
9126    /// Output only. The time at which the DeploymentEvent was undeployed, all
9127    /// artifacts are considered undeployed once this time is set. This would be
9128    /// the max of all ArtifactDeployment undeploy_times. If any ArtifactDeployment
9129    /// is still active (i.e. does not have an undeploy_time), this field will be
9130    /// empty.
9131    pub undeploy_time: std::option::Option<wkt::Timestamp>,
9132
9133    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9134}
9135
9136impl DeploymentEvent {
9137    pub fn new() -> Self {
9138        std::default::Default::default()
9139    }
9140
9141    /// Sets the value of [name][crate::model::DeploymentEvent::name].
9142    ///
9143    /// # Example
9144    /// ```ignore,no_run
9145    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9146    /// let x = DeploymentEvent::new().set_name("example");
9147    /// ```
9148    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9149        self.name = v.into();
9150        self
9151    }
9152
9153    /// Sets the value of [create_time][crate::model::DeploymentEvent::create_time].
9154    ///
9155    /// # Example
9156    /// ```ignore,no_run
9157    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9158    /// use wkt::Timestamp;
9159    /// let x = DeploymentEvent::new().set_create_time(Timestamp::default()/* use setters */);
9160    /// ```
9161    pub fn set_create_time<T>(mut self, v: T) -> Self
9162    where
9163        T: std::convert::Into<wkt::Timestamp>,
9164    {
9165        self.create_time = std::option::Option::Some(v.into());
9166        self
9167    }
9168
9169    /// Sets or clears the value of [create_time][crate::model::DeploymentEvent::create_time].
9170    ///
9171    /// # Example
9172    /// ```ignore,no_run
9173    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9174    /// use wkt::Timestamp;
9175    /// let x = DeploymentEvent::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9176    /// let x = DeploymentEvent::new().set_or_clear_create_time(None::<Timestamp>);
9177    /// ```
9178    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9179    where
9180        T: std::convert::Into<wkt::Timestamp>,
9181    {
9182        self.create_time = v.map(|x| x.into());
9183        self
9184    }
9185
9186    /// Sets the value of [update_time][crate::model::DeploymentEvent::update_time].
9187    ///
9188    /// # Example
9189    /// ```ignore,no_run
9190    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9191    /// use wkt::Timestamp;
9192    /// let x = DeploymentEvent::new().set_update_time(Timestamp::default()/* use setters */);
9193    /// ```
9194    pub fn set_update_time<T>(mut self, v: T) -> Self
9195    where
9196        T: std::convert::Into<wkt::Timestamp>,
9197    {
9198        self.update_time = std::option::Option::Some(v.into());
9199        self
9200    }
9201
9202    /// Sets or clears the value of [update_time][crate::model::DeploymentEvent::update_time].
9203    ///
9204    /// # Example
9205    /// ```ignore,no_run
9206    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9207    /// use wkt::Timestamp;
9208    /// let x = DeploymentEvent::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9209    /// let x = DeploymentEvent::new().set_or_clear_update_time(None::<Timestamp>);
9210    /// ```
9211    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9212    where
9213        T: std::convert::Into<wkt::Timestamp>,
9214    {
9215        self.update_time = v.map(|x| x.into());
9216        self
9217    }
9218
9219    /// Sets the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
9220    ///
9221    /// # Example
9222    /// ```ignore,no_run
9223    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9224    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
9225    /// let x = DeploymentEvent::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
9226    /// ```
9227    pub fn set_runtime_config<T>(mut self, v: T) -> Self
9228    where
9229        T: std::convert::Into<crate::model::RuntimeConfig>,
9230    {
9231        self.runtime_config = std::option::Option::Some(v.into());
9232        self
9233    }
9234
9235    /// Sets or clears the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
9236    ///
9237    /// # Example
9238    /// ```ignore,no_run
9239    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9240    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
9241    /// let x = DeploymentEvent::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
9242    /// let x = DeploymentEvent::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
9243    /// ```
9244    pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
9245    where
9246        T: std::convert::Into<crate::model::RuntimeConfig>,
9247    {
9248        self.runtime_config = v.map(|x| x.into());
9249        self
9250    }
9251
9252    /// Sets the value of [runtime_deployment_uri][crate::model::DeploymentEvent::runtime_deployment_uri].
9253    ///
9254    /// # Example
9255    /// ```ignore,no_run
9256    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9257    /// let x = DeploymentEvent::new().set_runtime_deployment_uri("example");
9258    /// ```
9259    pub fn set_runtime_deployment_uri<T: std::convert::Into<std::string::String>>(
9260        mut self,
9261        v: T,
9262    ) -> Self {
9263        self.runtime_deployment_uri = v.into();
9264        self
9265    }
9266
9267    /// Sets the value of [state][crate::model::DeploymentEvent::state].
9268    ///
9269    /// # Example
9270    /// ```ignore,no_run
9271    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9272    /// use google_cloud_developerconnect_v1::model::deployment_event::State;
9273    /// let x0 = DeploymentEvent::new().set_state(State::Active);
9274    /// let x1 = DeploymentEvent::new().set_state(State::Inactive);
9275    /// ```
9276    pub fn set_state<T: std::convert::Into<crate::model::deployment_event::State>>(
9277        mut self,
9278        v: T,
9279    ) -> Self {
9280        self.state = v.into();
9281        self
9282    }
9283
9284    /// Sets the value of [artifact_deployments][crate::model::DeploymentEvent::artifact_deployments].
9285    ///
9286    /// # Example
9287    /// ```ignore,no_run
9288    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9289    /// use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9290    /// let x = DeploymentEvent::new()
9291    ///     .set_artifact_deployments([
9292    ///         ArtifactDeployment::default()/* use setters */,
9293    ///         ArtifactDeployment::default()/* use (different) setters */,
9294    ///     ]);
9295    /// ```
9296    pub fn set_artifact_deployments<T, V>(mut self, v: T) -> Self
9297    where
9298        T: std::iter::IntoIterator<Item = V>,
9299        V: std::convert::Into<crate::model::ArtifactDeployment>,
9300    {
9301        use std::iter::Iterator;
9302        self.artifact_deployments = v.into_iter().map(|i| i.into()).collect();
9303        self
9304    }
9305
9306    /// Sets the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
9307    ///
9308    /// # Example
9309    /// ```ignore,no_run
9310    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9311    /// use wkt::Timestamp;
9312    /// let x = DeploymentEvent::new().set_deploy_time(Timestamp::default()/* use setters */);
9313    /// ```
9314    pub fn set_deploy_time<T>(mut self, v: T) -> Self
9315    where
9316        T: std::convert::Into<wkt::Timestamp>,
9317    {
9318        self.deploy_time = std::option::Option::Some(v.into());
9319        self
9320    }
9321
9322    /// Sets or clears the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
9323    ///
9324    /// # Example
9325    /// ```ignore,no_run
9326    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9327    /// use wkt::Timestamp;
9328    /// let x = DeploymentEvent::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
9329    /// let x = DeploymentEvent::new().set_or_clear_deploy_time(None::<Timestamp>);
9330    /// ```
9331    pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9332    where
9333        T: std::convert::Into<wkt::Timestamp>,
9334    {
9335        self.deploy_time = v.map(|x| x.into());
9336        self
9337    }
9338
9339    /// Sets the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
9340    ///
9341    /// # Example
9342    /// ```ignore,no_run
9343    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9344    /// use wkt::Timestamp;
9345    /// let x = DeploymentEvent::new().set_undeploy_time(Timestamp::default()/* use setters */);
9346    /// ```
9347    pub fn set_undeploy_time<T>(mut self, v: T) -> Self
9348    where
9349        T: std::convert::Into<wkt::Timestamp>,
9350    {
9351        self.undeploy_time = std::option::Option::Some(v.into());
9352        self
9353    }
9354
9355    /// Sets or clears the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
9356    ///
9357    /// # Example
9358    /// ```ignore,no_run
9359    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9360    /// use wkt::Timestamp;
9361    /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
9362    /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(None::<Timestamp>);
9363    /// ```
9364    pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9365    where
9366        T: std::convert::Into<wkt::Timestamp>,
9367    {
9368        self.undeploy_time = v.map(|x| x.into());
9369        self
9370    }
9371}
9372
9373impl wkt::message::Message for DeploymentEvent {
9374    fn typename() -> &'static str {
9375        "type.googleapis.com/google.cloud.developerconnect.v1.DeploymentEvent"
9376    }
9377}
9378
9379/// Defines additional types related to [DeploymentEvent].
9380pub mod deployment_event {
9381    #[allow(unused_imports)]
9382    use super::*;
9383
9384    /// The state of the DeploymentEvent.
9385    ///
9386    /// # Working with unknown values
9387    ///
9388    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9389    /// additional enum variants at any time. Adding new variants is not considered
9390    /// a breaking change. Applications should write their code in anticipation of:
9391    ///
9392    /// - New values appearing in future releases of the client library, **and**
9393    /// - New values received dynamically, without application changes.
9394    ///
9395    /// Please consult the [Working with enums] section in the user guide for some
9396    /// guidelines.
9397    ///
9398    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9399    #[derive(Clone, Debug, PartialEq)]
9400    #[non_exhaustive]
9401    pub enum State {
9402        /// No state specified.
9403        Unspecified,
9404        /// The deployment is active in the runtime.
9405        Active,
9406        /// The deployment is not in the runtime.
9407        Inactive,
9408        /// If set, the enum was initialized with an unknown value.
9409        ///
9410        /// Applications can examine the value using [State::value] or
9411        /// [State::name].
9412        UnknownValue(state::UnknownValue),
9413    }
9414
9415    #[doc(hidden)]
9416    pub mod state {
9417        #[allow(unused_imports)]
9418        use super::*;
9419        #[derive(Clone, Debug, PartialEq)]
9420        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9421    }
9422
9423    impl State {
9424        /// Gets the enum value.
9425        ///
9426        /// Returns `None` if the enum contains an unknown value deserialized from
9427        /// the string representation of enums.
9428        pub fn value(&self) -> std::option::Option<i32> {
9429            match self {
9430                Self::Unspecified => std::option::Option::Some(0),
9431                Self::Active => std::option::Option::Some(1),
9432                Self::Inactive => std::option::Option::Some(2),
9433                Self::UnknownValue(u) => u.0.value(),
9434            }
9435        }
9436
9437        /// Gets the enum value as a string.
9438        ///
9439        /// Returns `None` if the enum contains an unknown value deserialized from
9440        /// the integer representation of enums.
9441        pub fn name(&self) -> std::option::Option<&str> {
9442            match self {
9443                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9444                Self::Active => std::option::Option::Some("STATE_ACTIVE"),
9445                Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
9446                Self::UnknownValue(u) => u.0.name(),
9447            }
9448        }
9449    }
9450
9451    impl std::default::Default for State {
9452        fn default() -> Self {
9453            use std::convert::From;
9454            Self::from(0)
9455        }
9456    }
9457
9458    impl std::fmt::Display for State {
9459        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9460            wkt::internal::display_enum(f, self.name(), self.value())
9461        }
9462    }
9463
9464    impl std::convert::From<i32> for State {
9465        fn from(value: i32) -> Self {
9466            match value {
9467                0 => Self::Unspecified,
9468                1 => Self::Active,
9469                2 => Self::Inactive,
9470                _ => Self::UnknownValue(state::UnknownValue(
9471                    wkt::internal::UnknownEnumValue::Integer(value),
9472                )),
9473            }
9474        }
9475    }
9476
9477    impl std::convert::From<&str> for State {
9478        fn from(value: &str) -> Self {
9479            use std::string::ToString;
9480            match value {
9481                "STATE_UNSPECIFIED" => Self::Unspecified,
9482                "STATE_ACTIVE" => Self::Active,
9483                "STATE_INACTIVE" => Self::Inactive,
9484                _ => Self::UnknownValue(state::UnknownValue(
9485                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9486                )),
9487            }
9488        }
9489    }
9490
9491    impl serde::ser::Serialize for State {
9492        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9493        where
9494            S: serde::Serializer,
9495        {
9496            match self {
9497                Self::Unspecified => serializer.serialize_i32(0),
9498                Self::Active => serializer.serialize_i32(1),
9499                Self::Inactive => serializer.serialize_i32(2),
9500                Self::UnknownValue(u) => u.0.serialize(serializer),
9501            }
9502        }
9503    }
9504
9505    impl<'de> serde::de::Deserialize<'de> for State {
9506        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9507        where
9508            D: serde::Deserializer<'de>,
9509        {
9510            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9511                ".google.cloud.developerconnect.v1.DeploymentEvent.State",
9512            ))
9513        }
9514    }
9515}
9516
9517/// Request for getting a DeploymentEvent.
9518#[derive(Clone, Default, PartialEq)]
9519#[non_exhaustive]
9520pub struct GetDeploymentEventRequest {
9521    /// Required. The name of the deployment event to retrieve.
9522    /// Format:
9523    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
9524    pub name: std::string::String,
9525
9526    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9527}
9528
9529impl GetDeploymentEventRequest {
9530    pub fn new() -> Self {
9531        std::default::Default::default()
9532    }
9533
9534    /// Sets the value of [name][crate::model::GetDeploymentEventRequest::name].
9535    ///
9536    /// # Example
9537    /// ```ignore,no_run
9538    /// # use google_cloud_developerconnect_v1::model::GetDeploymentEventRequest;
9539    /// let x = GetDeploymentEventRequest::new().set_name("example");
9540    /// ```
9541    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9542        self.name = v.into();
9543        self
9544    }
9545}
9546
9547impl wkt::message::Message for GetDeploymentEventRequest {
9548    fn typename() -> &'static str {
9549        "type.googleapis.com/google.cloud.developerconnect.v1.GetDeploymentEventRequest"
9550    }
9551}
9552
9553/// Request for requesting list of DeploymentEvents.
9554#[derive(Clone, Default, PartialEq)]
9555#[non_exhaustive]
9556pub struct ListDeploymentEventsRequest {
9557    /// Required. The parent insights config that owns this collection of
9558    /// deployment events. Format:
9559    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}
9560    pub parent: std::string::String,
9561
9562    /// Optional. The maximum number of deployment events to return. The service
9563    /// may return fewer than this value. If unspecified, at most 50 deployment
9564    /// events will be returned. The maximum value is 1000; values above 1000 will
9565    /// be coerced to 1000.
9566    pub page_size: i32,
9567
9568    /// Optional. A page token, received from a previous `ListDeploymentEvents`
9569    /// call. Provide this to retrieve the subsequent page.
9570    ///
9571    /// When paginating, all other parameters provided to `ListDeploymentEvents`
9572    /// must match the call that provided the page token.
9573    pub page_token: std::string::String,
9574
9575    /// Optional. Filter expression that matches a subset of the DeploymentEvents.
9576    /// <https://google.aip.dev/160>.
9577    pub filter: std::string::String,
9578
9579    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9580}
9581
9582impl ListDeploymentEventsRequest {
9583    pub fn new() -> Self {
9584        std::default::Default::default()
9585    }
9586
9587    /// Sets the value of [parent][crate::model::ListDeploymentEventsRequest::parent].
9588    ///
9589    /// # Example
9590    /// ```ignore,no_run
9591    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9592    /// let x = ListDeploymentEventsRequest::new().set_parent("example");
9593    /// ```
9594    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9595        self.parent = v.into();
9596        self
9597    }
9598
9599    /// Sets the value of [page_size][crate::model::ListDeploymentEventsRequest::page_size].
9600    ///
9601    /// # Example
9602    /// ```ignore,no_run
9603    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9604    /// let x = ListDeploymentEventsRequest::new().set_page_size(42);
9605    /// ```
9606    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9607        self.page_size = v.into();
9608        self
9609    }
9610
9611    /// Sets the value of [page_token][crate::model::ListDeploymentEventsRequest::page_token].
9612    ///
9613    /// # Example
9614    /// ```ignore,no_run
9615    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9616    /// let x = ListDeploymentEventsRequest::new().set_page_token("example");
9617    /// ```
9618    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9619        self.page_token = v.into();
9620        self
9621    }
9622
9623    /// Sets the value of [filter][crate::model::ListDeploymentEventsRequest::filter].
9624    ///
9625    /// # Example
9626    /// ```ignore,no_run
9627    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9628    /// let x = ListDeploymentEventsRequest::new().set_filter("example");
9629    /// ```
9630    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9631        self.filter = v.into();
9632        self
9633    }
9634}
9635
9636impl wkt::message::Message for ListDeploymentEventsRequest {
9637    fn typename() -> &'static str {
9638        "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsRequest"
9639    }
9640}
9641
9642/// Response to listing DeploymentEvents.
9643#[derive(Clone, Default, PartialEq)]
9644#[non_exhaustive]
9645pub struct ListDeploymentEventsResponse {
9646    /// The list of DeploymentEvents.
9647    pub deployment_events: std::vec::Vec<crate::model::DeploymentEvent>,
9648
9649    /// A token, which can be sent as `page_token` to retrieve the next page.
9650    /// If this field is omitted, there are no subsequent pages.
9651    pub next_page_token: std::string::String,
9652
9653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9654}
9655
9656impl ListDeploymentEventsResponse {
9657    pub fn new() -> Self {
9658        std::default::Default::default()
9659    }
9660
9661    /// Sets the value of [deployment_events][crate::model::ListDeploymentEventsResponse::deployment_events].
9662    ///
9663    /// # Example
9664    /// ```ignore,no_run
9665    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
9666    /// use google_cloud_developerconnect_v1::model::DeploymentEvent;
9667    /// let x = ListDeploymentEventsResponse::new()
9668    ///     .set_deployment_events([
9669    ///         DeploymentEvent::default()/* use setters */,
9670    ///         DeploymentEvent::default()/* use (different) setters */,
9671    ///     ]);
9672    /// ```
9673    pub fn set_deployment_events<T, V>(mut self, v: T) -> Self
9674    where
9675        T: std::iter::IntoIterator<Item = V>,
9676        V: std::convert::Into<crate::model::DeploymentEvent>,
9677    {
9678        use std::iter::Iterator;
9679        self.deployment_events = v.into_iter().map(|i| i.into()).collect();
9680        self
9681    }
9682
9683    /// Sets the value of [next_page_token][crate::model::ListDeploymentEventsResponse::next_page_token].
9684    ///
9685    /// # Example
9686    /// ```ignore,no_run
9687    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
9688    /// let x = ListDeploymentEventsResponse::new().set_next_page_token("example");
9689    /// ```
9690    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9691        self.next_page_token = v.into();
9692        self
9693    }
9694}
9695
9696impl wkt::message::Message for ListDeploymentEventsResponse {
9697    fn typename() -> &'static str {
9698        "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsResponse"
9699    }
9700}
9701
9702#[doc(hidden)]
9703impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentEventsResponse {
9704    type PageItem = crate::model::DeploymentEvent;
9705
9706    fn items(self) -> std::vec::Vec<Self::PageItem> {
9707        self.deployment_events
9708    }
9709
9710    fn next_page_token(&self) -> std::string::String {
9711        use std::clone::Clone;
9712        self.next_page_token.clone()
9713    }
9714}
9715
9716/// The ArtifactDeployment resource represents the deployment of the artifact
9717/// within the InsightsConfig resource.
9718#[derive(Clone, Default, PartialEq)]
9719#[non_exhaustive]
9720pub struct ArtifactDeployment {
9721    /// Output only. Unique identifier of `ArtifactDeployment`.
9722    pub id: std::string::String,
9723
9724    /// Output only. The artifact that is deployed.
9725    pub artifact_reference: std::string::String,
9726
9727    /// Output only. The artifact alias in the deployment spec, with Tag/SHA.
9728    /// e.g. us-docker.pkg.dev/my-project/my-repo/image:1.0.0
9729    pub artifact_alias: std::string::String,
9730
9731    /// Output only. The source commits at which this artifact was built. Extracted
9732    /// from provenance.
9733    pub source_commit_uris: std::vec::Vec<std::string::String>,
9734
9735    /// Output only. The time at which the deployment was deployed.
9736    pub deploy_time: std::option::Option<wkt::Timestamp>,
9737
9738    /// Output only. The time at which the deployment was undeployed, all artifacts
9739    /// are considered undeployed once this time is set.
9740    pub undeploy_time: std::option::Option<wkt::Timestamp>,
9741
9742    /// Output only. The summary of container status of the artifact deployment.
9743    /// Format as `ContainerStatusState-Reason : restartCount`
9744    /// e.g. "Waiting-ImagePullBackOff : 3"
9745    pub container_status_summary: std::string::String,
9746
9747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9748}
9749
9750impl ArtifactDeployment {
9751    pub fn new() -> Self {
9752        std::default::Default::default()
9753    }
9754
9755    /// Sets the value of [id][crate::model::ArtifactDeployment::id].
9756    ///
9757    /// # Example
9758    /// ```ignore,no_run
9759    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9760    /// let x = ArtifactDeployment::new().set_id("example");
9761    /// ```
9762    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9763        self.id = v.into();
9764        self
9765    }
9766
9767    /// Sets the value of [artifact_reference][crate::model::ArtifactDeployment::artifact_reference].
9768    ///
9769    /// # Example
9770    /// ```ignore,no_run
9771    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9772    /// let x = ArtifactDeployment::new().set_artifact_reference("example");
9773    /// ```
9774    pub fn set_artifact_reference<T: std::convert::Into<std::string::String>>(
9775        mut self,
9776        v: T,
9777    ) -> Self {
9778        self.artifact_reference = v.into();
9779        self
9780    }
9781
9782    /// Sets the value of [artifact_alias][crate::model::ArtifactDeployment::artifact_alias].
9783    ///
9784    /// # Example
9785    /// ```ignore,no_run
9786    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9787    /// let x = ArtifactDeployment::new().set_artifact_alias("example");
9788    /// ```
9789    pub fn set_artifact_alias<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9790        self.artifact_alias = v.into();
9791        self
9792    }
9793
9794    /// Sets the value of [source_commit_uris][crate::model::ArtifactDeployment::source_commit_uris].
9795    ///
9796    /// # Example
9797    /// ```ignore,no_run
9798    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9799    /// let x = ArtifactDeployment::new().set_source_commit_uris(["a", "b", "c"]);
9800    /// ```
9801    pub fn set_source_commit_uris<T, V>(mut self, v: T) -> Self
9802    where
9803        T: std::iter::IntoIterator<Item = V>,
9804        V: std::convert::Into<std::string::String>,
9805    {
9806        use std::iter::Iterator;
9807        self.source_commit_uris = v.into_iter().map(|i| i.into()).collect();
9808        self
9809    }
9810
9811    /// Sets the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
9812    ///
9813    /// # Example
9814    /// ```ignore,no_run
9815    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9816    /// use wkt::Timestamp;
9817    /// let x = ArtifactDeployment::new().set_deploy_time(Timestamp::default()/* use setters */);
9818    /// ```
9819    pub fn set_deploy_time<T>(mut self, v: T) -> Self
9820    where
9821        T: std::convert::Into<wkt::Timestamp>,
9822    {
9823        self.deploy_time = std::option::Option::Some(v.into());
9824        self
9825    }
9826
9827    /// Sets or clears the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
9828    ///
9829    /// # Example
9830    /// ```ignore,no_run
9831    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9832    /// use wkt::Timestamp;
9833    /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
9834    /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(None::<Timestamp>);
9835    /// ```
9836    pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9837    where
9838        T: std::convert::Into<wkt::Timestamp>,
9839    {
9840        self.deploy_time = v.map(|x| x.into());
9841        self
9842    }
9843
9844    /// Sets the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
9845    ///
9846    /// # Example
9847    /// ```ignore,no_run
9848    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9849    /// use wkt::Timestamp;
9850    /// let x = ArtifactDeployment::new().set_undeploy_time(Timestamp::default()/* use setters */);
9851    /// ```
9852    pub fn set_undeploy_time<T>(mut self, v: T) -> Self
9853    where
9854        T: std::convert::Into<wkt::Timestamp>,
9855    {
9856        self.undeploy_time = std::option::Option::Some(v.into());
9857        self
9858    }
9859
9860    /// Sets or clears the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
9861    ///
9862    /// # Example
9863    /// ```ignore,no_run
9864    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9865    /// use wkt::Timestamp;
9866    /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
9867    /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(None::<Timestamp>);
9868    /// ```
9869    pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9870    where
9871        T: std::convert::Into<wkt::Timestamp>,
9872    {
9873        self.undeploy_time = v.map(|x| x.into());
9874        self
9875    }
9876
9877    /// Sets the value of [container_status_summary][crate::model::ArtifactDeployment::container_status_summary].
9878    ///
9879    /// # Example
9880    /// ```ignore,no_run
9881    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9882    /// let x = ArtifactDeployment::new().set_container_status_summary("example");
9883    /// ```
9884    pub fn set_container_status_summary<T: std::convert::Into<std::string::String>>(
9885        mut self,
9886        v: T,
9887    ) -> Self {
9888        self.container_status_summary = v.into();
9889        self
9890    }
9891}
9892
9893impl wkt::message::Message for ArtifactDeployment {
9894    fn typename() -> &'static str {
9895        "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactDeployment"
9896    }
9897}
9898
9899/// Request for creating an InsightsConfig.
9900#[derive(Clone, Default, PartialEq)]
9901#[non_exhaustive]
9902pub struct CreateInsightsConfigRequest {
9903    /// Required. Value for parent.
9904    pub parent: std::string::String,
9905
9906    /// Required. ID of the requesting InsightsConfig.
9907    pub insights_config_id: std::string::String,
9908
9909    /// Required. The resource being created.
9910    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
9911
9912    /// Optional. If set, validate the request, but do not actually post it.
9913    pub validate_only: bool,
9914
9915    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9916}
9917
9918impl CreateInsightsConfigRequest {
9919    pub fn new() -> Self {
9920        std::default::Default::default()
9921    }
9922
9923    /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
9924    ///
9925    /// # Example
9926    /// ```ignore,no_run
9927    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9928    /// let x = CreateInsightsConfigRequest::new().set_parent("example");
9929    /// ```
9930    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9931        self.parent = v.into();
9932        self
9933    }
9934
9935    /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
9936    ///
9937    /// # Example
9938    /// ```ignore,no_run
9939    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9940    /// let x = CreateInsightsConfigRequest::new().set_insights_config_id("example");
9941    /// ```
9942    pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
9943        mut self,
9944        v: T,
9945    ) -> Self {
9946        self.insights_config_id = v.into();
9947        self
9948    }
9949
9950    /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
9951    ///
9952    /// # Example
9953    /// ```ignore,no_run
9954    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9955    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
9956    /// let x = CreateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
9957    /// ```
9958    pub fn set_insights_config<T>(mut self, v: T) -> Self
9959    where
9960        T: std::convert::Into<crate::model::InsightsConfig>,
9961    {
9962        self.insights_config = std::option::Option::Some(v.into());
9963        self
9964    }
9965
9966    /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
9967    ///
9968    /// # Example
9969    /// ```ignore,no_run
9970    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9971    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
9972    /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
9973    /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
9974    /// ```
9975    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
9976    where
9977        T: std::convert::Into<crate::model::InsightsConfig>,
9978    {
9979        self.insights_config = v.map(|x| x.into());
9980        self
9981    }
9982
9983    /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
9984    ///
9985    /// # Example
9986    /// ```ignore,no_run
9987    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
9988    /// let x = CreateInsightsConfigRequest::new().set_validate_only(true);
9989    /// ```
9990    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9991        self.validate_only = v.into();
9992        self
9993    }
9994}
9995
9996impl wkt::message::Message for CreateInsightsConfigRequest {
9997    fn typename() -> &'static str {
9998        "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
9999    }
10000}
10001
10002/// Request for getting an InsightsConfig.
10003#[derive(Clone, Default, PartialEq)]
10004#[non_exhaustive]
10005pub struct GetInsightsConfigRequest {
10006    /// Required. Name of the resource.
10007    pub name: std::string::String,
10008
10009    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10010}
10011
10012impl GetInsightsConfigRequest {
10013    pub fn new() -> Self {
10014        std::default::Default::default()
10015    }
10016
10017    /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
10018    ///
10019    /// # Example
10020    /// ```ignore,no_run
10021    /// # use google_cloud_developerconnect_v1::model::GetInsightsConfigRequest;
10022    /// let x = GetInsightsConfigRequest::new().set_name("example");
10023    /// ```
10024    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10025        self.name = v.into();
10026        self
10027    }
10028}
10029
10030impl wkt::message::Message for GetInsightsConfigRequest {
10031    fn typename() -> &'static str {
10032        "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
10033    }
10034}
10035
10036/// Request for requesting list of InsightsConfigs.
10037#[derive(Clone, Default, PartialEq)]
10038#[non_exhaustive]
10039pub struct ListInsightsConfigsRequest {
10040    /// Required. Parent value for ListInsightsConfigsRequest.
10041    pub parent: std::string::String,
10042
10043    /// Optional. Requested page size. Server may return fewer items than
10044    /// requested. If unspecified, server will pick an appropriate default.
10045    pub page_size: i32,
10046
10047    /// Optional. A token identifying a page of results the server should return.
10048    pub page_token: std::string::String,
10049
10050    /// Optional. Filtering results. See <https://google.aip.dev/160> for more
10051    /// details. Filter string, adhering to the rules in
10052    /// <https://google.aip.dev/160>. List only InsightsConfigs matching the filter.
10053    /// If filter is empty, all InsightsConfigs are listed.
10054    pub filter: std::string::String,
10055
10056    /// Optional. Hint for how to order the results.
10057    pub order_by: std::string::String,
10058
10059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10060}
10061
10062impl ListInsightsConfigsRequest {
10063    pub fn new() -> Self {
10064        std::default::Default::default()
10065    }
10066
10067    /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
10068    ///
10069    /// # Example
10070    /// ```ignore,no_run
10071    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10072    /// let x = ListInsightsConfigsRequest::new().set_parent("example");
10073    /// ```
10074    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10075        self.parent = v.into();
10076        self
10077    }
10078
10079    /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
10080    ///
10081    /// # Example
10082    /// ```ignore,no_run
10083    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10084    /// let x = ListInsightsConfigsRequest::new().set_page_size(42);
10085    /// ```
10086    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10087        self.page_size = v.into();
10088        self
10089    }
10090
10091    /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
10092    ///
10093    /// # Example
10094    /// ```ignore,no_run
10095    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10096    /// let x = ListInsightsConfigsRequest::new().set_page_token("example");
10097    /// ```
10098    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10099        self.page_token = v.into();
10100        self
10101    }
10102
10103    /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
10104    ///
10105    /// # Example
10106    /// ```ignore,no_run
10107    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10108    /// let x = ListInsightsConfigsRequest::new().set_filter("example");
10109    /// ```
10110    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10111        self.filter = v.into();
10112        self
10113    }
10114
10115    /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
10116    ///
10117    /// # Example
10118    /// ```ignore,no_run
10119    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10120    /// let x = ListInsightsConfigsRequest::new().set_order_by("example");
10121    /// ```
10122    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10123        self.order_by = v.into();
10124        self
10125    }
10126}
10127
10128impl wkt::message::Message for ListInsightsConfigsRequest {
10129    fn typename() -> &'static str {
10130        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
10131    }
10132}
10133
10134/// Request for response to listing InsightsConfigs.
10135#[derive(Clone, Default, PartialEq)]
10136#[non_exhaustive]
10137pub struct ListInsightsConfigsResponse {
10138    /// The list of InsightsConfigs.
10139    pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
10140
10141    /// A token identifying a page of results the server should return.
10142    pub next_page_token: std::string::String,
10143
10144    /// Locations that could not be reached.
10145    pub unreachable: std::vec::Vec<std::string::String>,
10146
10147    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10148}
10149
10150impl ListInsightsConfigsResponse {
10151    pub fn new() -> Self {
10152        std::default::Default::default()
10153    }
10154
10155    /// Sets the value of [insights_configs][crate::model::ListInsightsConfigsResponse::insights_configs].
10156    ///
10157    /// # Example
10158    /// ```ignore,no_run
10159    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10160    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10161    /// let x = ListInsightsConfigsResponse::new()
10162    ///     .set_insights_configs([
10163    ///         InsightsConfig::default()/* use setters */,
10164    ///         InsightsConfig::default()/* use (different) setters */,
10165    ///     ]);
10166    /// ```
10167    pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
10168    where
10169        T: std::iter::IntoIterator<Item = V>,
10170        V: std::convert::Into<crate::model::InsightsConfig>,
10171    {
10172        use std::iter::Iterator;
10173        self.insights_configs = v.into_iter().map(|i| i.into()).collect();
10174        self
10175    }
10176
10177    /// Sets the value of [next_page_token][crate::model::ListInsightsConfigsResponse::next_page_token].
10178    ///
10179    /// # Example
10180    /// ```ignore,no_run
10181    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10182    /// let x = ListInsightsConfigsResponse::new().set_next_page_token("example");
10183    /// ```
10184    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10185        self.next_page_token = v.into();
10186        self
10187    }
10188
10189    /// Sets the value of [unreachable][crate::model::ListInsightsConfigsResponse::unreachable].
10190    ///
10191    /// # Example
10192    /// ```ignore,no_run
10193    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10194    /// let x = ListInsightsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
10195    /// ```
10196    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10197    where
10198        T: std::iter::IntoIterator<Item = V>,
10199        V: std::convert::Into<std::string::String>,
10200    {
10201        use std::iter::Iterator;
10202        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10203        self
10204    }
10205}
10206
10207impl wkt::message::Message for ListInsightsConfigsResponse {
10208    fn typename() -> &'static str {
10209        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
10210    }
10211}
10212
10213#[doc(hidden)]
10214impl google_cloud_gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
10215    type PageItem = crate::model::InsightsConfig;
10216
10217    fn items(self) -> std::vec::Vec<Self::PageItem> {
10218        self.insights_configs
10219    }
10220
10221    fn next_page_token(&self) -> std::string::String {
10222        use std::clone::Clone;
10223        self.next_page_token.clone()
10224    }
10225}
10226
10227/// Request for deleting an InsightsConfig.
10228#[derive(Clone, Default, PartialEq)]
10229#[non_exhaustive]
10230pub struct DeleteInsightsConfigRequest {
10231    /// Required. Value for parent.
10232    pub name: std::string::String,
10233
10234    /// Optional. An optional request ID to identify requests. Specify a unique
10235    /// request ID so that if you must retry your request, the server will know to
10236    /// ignore the request if it has already been completed. The server will
10237    /// guarantee that for at least 60 minutes after the first request.
10238    ///
10239    /// For example, consider a situation where you make an initial request and the
10240    /// request times out. If you make the request again with the same request
10241    /// ID, the server can check if original operation with the same request ID
10242    /// was received, and if so, will ignore the second request. This prevents
10243    /// clients from accidentally creating duplicate commitments.
10244    ///
10245    /// The request ID must be a valid UUID with the exception that zero UUID is
10246    /// not supported (00000000-0000-0000-0000-000000000000).
10247    pub request_id: std::string::String,
10248
10249    /// Optional. If set, validate the request, but do not actually post it.
10250    pub validate_only: bool,
10251
10252    /// Optional. This checksum is computed by the server based on the value of
10253    /// other fields, and may be sent on update and delete requests to ensure the
10254    /// client has an up-to-date value before proceeding.
10255    pub etag: std::string::String,
10256
10257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10258}
10259
10260impl DeleteInsightsConfigRequest {
10261    pub fn new() -> Self {
10262        std::default::Default::default()
10263    }
10264
10265    /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
10266    ///
10267    /// # Example
10268    /// ```ignore,no_run
10269    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10270    /// let x = DeleteInsightsConfigRequest::new().set_name("example");
10271    /// ```
10272    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10273        self.name = v.into();
10274        self
10275    }
10276
10277    /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
10278    ///
10279    /// # Example
10280    /// ```ignore,no_run
10281    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10282    /// let x = DeleteInsightsConfigRequest::new().set_request_id("example");
10283    /// ```
10284    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10285        self.request_id = v.into();
10286        self
10287    }
10288
10289    /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
10290    ///
10291    /// # Example
10292    /// ```ignore,no_run
10293    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10294    /// let x = DeleteInsightsConfigRequest::new().set_validate_only(true);
10295    /// ```
10296    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10297        self.validate_only = v.into();
10298        self
10299    }
10300
10301    /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
10302    ///
10303    /// # Example
10304    /// ```ignore,no_run
10305    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10306    /// let x = DeleteInsightsConfigRequest::new().set_etag("example");
10307    /// ```
10308    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10309        self.etag = v.into();
10310        self
10311    }
10312}
10313
10314impl wkt::message::Message for DeleteInsightsConfigRequest {
10315    fn typename() -> &'static str {
10316        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
10317    }
10318}
10319
10320/// Request for updating an InsightsConfig.
10321#[derive(Clone, Default, PartialEq)]
10322#[non_exhaustive]
10323pub struct UpdateInsightsConfigRequest {
10324    /// Required. The resource being updated.
10325    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
10326
10327    /// Optional. An optional request ID to identify requests. Specify a unique
10328    /// request ID so that if you must retry your request, the server will know to
10329    /// ignore the request if it has already been completed. The server will
10330    /// guarantee that for at least 60 minutes after the first request.
10331    ///
10332    /// For example, consider a situation where you make an initial request and the
10333    /// request times out. If you make the request again with the same request
10334    /// ID, the server can check if original operation with the same request ID
10335    /// was received, and if so, will ignore the second request. This prevents
10336    /// clients from accidentally creating duplicate commitments.
10337    ///
10338    /// The request ID must be a valid UUID with the exception that zero UUID is
10339    /// not supported (00000000-0000-0000-0000-000000000000).
10340    pub request_id: std::string::String,
10341
10342    /// Optional. If set to true, and the insightsConfig is not found a new
10343    /// insightsConfig will be created. In this situation `update_mask` is ignored.
10344    /// The creation will succeed only if the input insightsConfig has all the
10345    /// necessary information (e.g a github_config with both  user_oauth_token and
10346    /// installation_id properties).
10347    pub allow_missing: bool,
10348
10349    /// Optional. If set, validate the request, but do not actually post it.
10350    pub validate_only: bool,
10351
10352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10353}
10354
10355impl UpdateInsightsConfigRequest {
10356    pub fn new() -> Self {
10357        std::default::Default::default()
10358    }
10359
10360    /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
10361    ///
10362    /// # Example
10363    /// ```ignore,no_run
10364    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10365    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10366    /// let x = UpdateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
10367    /// ```
10368    pub fn set_insights_config<T>(mut self, v: T) -> Self
10369    where
10370        T: std::convert::Into<crate::model::InsightsConfig>,
10371    {
10372        self.insights_config = std::option::Option::Some(v.into());
10373        self
10374    }
10375
10376    /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
10377    ///
10378    /// # Example
10379    /// ```ignore,no_run
10380    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10381    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10382    /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
10383    /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
10384    /// ```
10385    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
10386    where
10387        T: std::convert::Into<crate::model::InsightsConfig>,
10388    {
10389        self.insights_config = v.map(|x| x.into());
10390        self
10391    }
10392
10393    /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
10394    ///
10395    /// # Example
10396    /// ```ignore,no_run
10397    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10398    /// let x = UpdateInsightsConfigRequest::new().set_request_id("example");
10399    /// ```
10400    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10401        self.request_id = v.into();
10402        self
10403    }
10404
10405    /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
10406    ///
10407    /// # Example
10408    /// ```ignore,no_run
10409    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10410    /// let x = UpdateInsightsConfigRequest::new().set_allow_missing(true);
10411    /// ```
10412    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10413        self.allow_missing = v.into();
10414        self
10415    }
10416
10417    /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
10418    ///
10419    /// # Example
10420    /// ```ignore,no_run
10421    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10422    /// let x = UpdateInsightsConfigRequest::new().set_validate_only(true);
10423    /// ```
10424    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10425        self.validate_only = v.into();
10426        self
10427    }
10428}
10429
10430impl wkt::message::Message for UpdateInsightsConfigRequest {
10431    fn typename() -> &'static str {
10432        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
10433    }
10434}
10435
10436/// SystemProvider is a list of providers that are owned by Developer Connect.
10437///
10438/// # Working with unknown values
10439///
10440/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10441/// additional enum variants at any time. Adding new variants is not considered
10442/// a breaking change. Applications should write their code in anticipation of:
10443///
10444/// - New values appearing in future releases of the client library, **and**
10445/// - New values received dynamically, without application changes.
10446///
10447/// Please consult the [Working with enums] section in the user guide for some
10448/// guidelines.
10449///
10450/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10451#[derive(Clone, Debug, PartialEq)]
10452#[non_exhaustive]
10453pub enum SystemProvider {
10454    /// No system provider specified.
10455    Unspecified,
10456    /// GitHub provider.
10457    /// Scopes can be found at
10458    /// <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes>
10459    Github,
10460    /// GitLab provider.
10461    /// Scopes can be found at
10462    /// <https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes>
10463    Gitlab,
10464    /// Google provider.
10465    /// Recommended scopes:
10466    /// `https://www.googleapis.com/auth/drive.readonly`,
10467    /// `https://www.googleapis.com/auth/documents.readonly`
10468    Google,
10469    /// Sentry provider.
10470    /// Scopes can be found at
10471    /// <https://docs.sentry.io/api/permissions/>
10472    Sentry,
10473    /// Rovo provider.
10474    /// Must select the "rovo" scope.
10475    Rovo,
10476    /// New Relic provider.
10477    /// No scopes are allowed.
10478    NewRelic,
10479    /// Datastax provider.
10480    /// No scopes are allowed.
10481    Datastax,
10482    /// Dynatrace provider.
10483    Dynatrace,
10484    /// If set, the enum was initialized with an unknown value.
10485    ///
10486    /// Applications can examine the value using [SystemProvider::value] or
10487    /// [SystemProvider::name].
10488    UnknownValue(system_provider::UnknownValue),
10489}
10490
10491#[doc(hidden)]
10492pub mod system_provider {
10493    #[allow(unused_imports)]
10494    use super::*;
10495    #[derive(Clone, Debug, PartialEq)]
10496    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10497}
10498
10499impl SystemProvider {
10500    /// Gets the enum value.
10501    ///
10502    /// Returns `None` if the enum contains an unknown value deserialized from
10503    /// the string representation of enums.
10504    pub fn value(&self) -> std::option::Option<i32> {
10505        match self {
10506            Self::Unspecified => std::option::Option::Some(0),
10507            Self::Github => std::option::Option::Some(1),
10508            Self::Gitlab => std::option::Option::Some(2),
10509            Self::Google => std::option::Option::Some(3),
10510            Self::Sentry => std::option::Option::Some(4),
10511            Self::Rovo => std::option::Option::Some(5),
10512            Self::NewRelic => std::option::Option::Some(6),
10513            Self::Datastax => std::option::Option::Some(7),
10514            Self::Dynatrace => std::option::Option::Some(8),
10515            Self::UnknownValue(u) => u.0.value(),
10516        }
10517    }
10518
10519    /// Gets the enum value as a string.
10520    ///
10521    /// Returns `None` if the enum contains an unknown value deserialized from
10522    /// the integer representation of enums.
10523    pub fn name(&self) -> std::option::Option<&str> {
10524        match self {
10525            Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
10526            Self::Github => std::option::Option::Some("GITHUB"),
10527            Self::Gitlab => std::option::Option::Some("GITLAB"),
10528            Self::Google => std::option::Option::Some("GOOGLE"),
10529            Self::Sentry => std::option::Option::Some("SENTRY"),
10530            Self::Rovo => std::option::Option::Some("ROVO"),
10531            Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
10532            Self::Datastax => std::option::Option::Some("DATASTAX"),
10533            Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
10534            Self::UnknownValue(u) => u.0.name(),
10535        }
10536    }
10537}
10538
10539impl std::default::Default for SystemProvider {
10540    fn default() -> Self {
10541        use std::convert::From;
10542        Self::from(0)
10543    }
10544}
10545
10546impl std::fmt::Display for SystemProvider {
10547    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10548        wkt::internal::display_enum(f, self.name(), self.value())
10549    }
10550}
10551
10552impl std::convert::From<i32> for SystemProvider {
10553    fn from(value: i32) -> Self {
10554        match value {
10555            0 => Self::Unspecified,
10556            1 => Self::Github,
10557            2 => Self::Gitlab,
10558            3 => Self::Google,
10559            4 => Self::Sentry,
10560            5 => Self::Rovo,
10561            6 => Self::NewRelic,
10562            7 => Self::Datastax,
10563            8 => Self::Dynatrace,
10564            _ => Self::UnknownValue(system_provider::UnknownValue(
10565                wkt::internal::UnknownEnumValue::Integer(value),
10566            )),
10567        }
10568    }
10569}
10570
10571impl std::convert::From<&str> for SystemProvider {
10572    fn from(value: &str) -> Self {
10573        use std::string::ToString;
10574        match value {
10575            "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
10576            "GITHUB" => Self::Github,
10577            "GITLAB" => Self::Gitlab,
10578            "GOOGLE" => Self::Google,
10579            "SENTRY" => Self::Sentry,
10580            "ROVO" => Self::Rovo,
10581            "NEW_RELIC" => Self::NewRelic,
10582            "DATASTAX" => Self::Datastax,
10583            "DYNATRACE" => Self::Dynatrace,
10584            _ => Self::UnknownValue(system_provider::UnknownValue(
10585                wkt::internal::UnknownEnumValue::String(value.to_string()),
10586            )),
10587        }
10588    }
10589}
10590
10591impl serde::ser::Serialize for SystemProvider {
10592    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10593    where
10594        S: serde::Serializer,
10595    {
10596        match self {
10597            Self::Unspecified => serializer.serialize_i32(0),
10598            Self::Github => serializer.serialize_i32(1),
10599            Self::Gitlab => serializer.serialize_i32(2),
10600            Self::Google => serializer.serialize_i32(3),
10601            Self::Sentry => serializer.serialize_i32(4),
10602            Self::Rovo => serializer.serialize_i32(5),
10603            Self::NewRelic => serializer.serialize_i32(6),
10604            Self::Datastax => serializer.serialize_i32(7),
10605            Self::Dynatrace => serializer.serialize_i32(8),
10606            Self::UnknownValue(u) => u.0.serialize(serializer),
10607        }
10608    }
10609}
10610
10611impl<'de> serde::de::Deserialize<'de> for SystemProvider {
10612    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10613    where
10614        D: serde::Deserializer<'de>,
10615    {
10616        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
10617            ".google.cloud.developerconnect.v1.SystemProvider",
10618        ))
10619    }
10620}