Skip to main content

google_cloud_developerconnect_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Message for requesting a list of Users
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct ListUsersRequest {
43    /// Required. Parent value for ListUsersRequest
44    pub parent: std::string::String,
45
46    /// Optional. Requested page size. Server may return fewer items than
47    /// requested. If unspecified, server will pick an appropriate default.
48    pub page_size: i32,
49
50    /// Optional. A token identifying a page of results the server should return.
51    pub page_token: std::string::String,
52
53    /// Optional. Filtering results
54    pub filter: std::string::String,
55
56    /// Optional. Hint for how to order the results
57    pub order_by: std::string::String,
58
59    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl ListUsersRequest {
63    /// Creates a new default instance.
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 project_id = "project_id";
74    /// # let location_id = "location_id";
75    /// # let account_connector_id = "account_connector_id";
76    /// let x = ListUsersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
77    /// ```
78    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
79        self.parent = v.into();
80        self
81    }
82
83    /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
84    ///
85    /// # Example
86    /// ```ignore,no_run
87    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
88    /// let x = ListUsersRequest::new().set_page_size(42);
89    /// ```
90    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
91        self.page_size = v.into();
92        self
93    }
94
95    /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
96    ///
97    /// # Example
98    /// ```ignore,no_run
99    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
100    /// let x = ListUsersRequest::new().set_page_token("example");
101    /// ```
102    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
103        self.page_token = v.into();
104        self
105    }
106
107    /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
108    ///
109    /// # Example
110    /// ```ignore,no_run
111    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
112    /// let x = ListUsersRequest::new().set_filter("example");
113    /// ```
114    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115        self.filter = v.into();
116        self
117    }
118
119    /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
120    ///
121    /// # Example
122    /// ```ignore,no_run
123    /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
124    /// let x = ListUsersRequest::new().set_order_by("example");
125    /// ```
126    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
127        self.order_by = v.into();
128        self
129    }
130}
131
132impl wkt::message::Message for ListUsersRequest {
133    fn typename() -> &'static str {
134        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
135    }
136}
137
138/// Message for response to listing Users
139#[derive(Clone, Default, PartialEq)]
140#[non_exhaustive]
141pub struct ListUsersResponse {
142    /// The list of Users
143    pub users: std::vec::Vec<crate::model::User>,
144
145    /// A token identifying a page of results the server should return.
146    pub next_page_token: std::string::String,
147
148    /// Locations that could not be reached.
149    pub unreachable: std::vec::Vec<std::string::String>,
150
151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
152}
153
154impl ListUsersResponse {
155    /// Creates a new default instance.
156    pub fn new() -> Self {
157        std::default::Default::default()
158    }
159
160    /// Sets the value of [users][crate::model::ListUsersResponse::users].
161    ///
162    /// # Example
163    /// ```ignore,no_run
164    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
165    /// use google_cloud_developerconnect_v1::model::User;
166    /// let x = ListUsersResponse::new()
167    ///     .set_users([
168    ///         User::default()/* use setters */,
169    ///         User::default()/* use (different) setters */,
170    ///     ]);
171    /// ```
172    pub fn set_users<T, V>(mut self, v: T) -> Self
173    where
174        T: std::iter::IntoIterator<Item = V>,
175        V: std::convert::Into<crate::model::User>,
176    {
177        use std::iter::Iterator;
178        self.users = v.into_iter().map(|i| i.into()).collect();
179        self
180    }
181
182    /// Sets the value of [next_page_token][crate::model::ListUsersResponse::next_page_token].
183    ///
184    /// # Example
185    /// ```ignore,no_run
186    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
187    /// let x = ListUsersResponse::new().set_next_page_token("example");
188    /// ```
189    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
190        self.next_page_token = v.into();
191        self
192    }
193
194    /// Sets the value of [unreachable][crate::model::ListUsersResponse::unreachable].
195    ///
196    /// # Example
197    /// ```ignore,no_run
198    /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
199    /// let x = ListUsersResponse::new().set_unreachable(["a", "b", "c"]);
200    /// ```
201    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
202    where
203        T: std::iter::IntoIterator<Item = V>,
204        V: std::convert::Into<std::string::String>,
205    {
206        use std::iter::Iterator;
207        self.unreachable = v.into_iter().map(|i| i.into()).collect();
208        self
209    }
210}
211
212impl wkt::message::Message for ListUsersResponse {
213    fn typename() -> &'static str {
214        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
215    }
216}
217
218#[doc(hidden)]
219impl google_cloud_gax::paginator::internal::PageableResponse for ListUsersResponse {
220    type PageItem = crate::model::User;
221
222    fn items(self) -> std::vec::Vec<Self::PageItem> {
223        self.users
224    }
225
226    fn next_page_token(&self) -> std::string::String {
227        use std::clone::Clone;
228        self.next_page_token.clone()
229    }
230}
231
232/// Message describing Connection object
233#[derive(Clone, Default, PartialEq)]
234#[non_exhaustive]
235pub struct Connection {
236    /// Identifier. The resource name of the connection, in the format
237    /// `projects/{project}/locations/{location}/connections/{connection_id}`.
238    pub name: std::string::String,
239
240    /// Output only. [Output only] Create timestamp
241    pub create_time: std::option::Option<wkt::Timestamp>,
242
243    /// Output only. [Output only] Update timestamp
244    pub update_time: std::option::Option<wkt::Timestamp>,
245
246    /// Output only. [Output only] Delete timestamp
247    pub delete_time: std::option::Option<wkt::Timestamp>,
248
249    /// Optional. Labels as key value pairs
250    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
251
252    /// Output only. Installation state of the Connection.
253    pub installation_state: std::option::Option<crate::model::InstallationState>,
254
255    /// Optional. If disabled is set to true, functionality is disabled for this
256    /// connection. Repository based API methods and webhooks processing for
257    /// repositories in this connection will be disabled.
258    pub disabled: bool,
259
260    /// Output only. Set to true when the connection is being set up or updated in
261    /// the background.
262    pub reconciling: bool,
263
264    /// Optional. Allows clients to store small amounts of arbitrary data.
265    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
266
267    /// Optional. This checksum is computed by the server based on the value of
268    /// other fields, and may be sent on update and delete requests to ensure the
269    /// client has an up-to-date value before proceeding.
270    pub etag: std::string::String,
271
272    /// Output only. A system-assigned unique identifier for the Connection.
273    pub uid: std::string::String,
274
275    /// Optional. The crypto key configuration. This field is used by the
276    /// Customer-Managed Encryption Keys (CMEK) feature.
277    pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
278
279    /// Optional. Configuration for the git proxy feature. Enabling the git proxy
280    /// allows clients to perform git operations on the repositories linked in the
281    /// connection.
282    pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
283
284    /// Configuration for the connection depending on the type of provider.
285    pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
286
287    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
288}
289
290impl Connection {
291    /// Creates a new default instance.
292    pub fn new() -> Self {
293        std::default::Default::default()
294    }
295
296    /// Sets the value of [name][crate::model::Connection::name].
297    ///
298    /// # Example
299    /// ```ignore,no_run
300    /// # use google_cloud_developerconnect_v1::model::Connection;
301    /// # let project_id = "project_id";
302    /// # let location_id = "location_id";
303    /// # let connection_id = "connection_id";
304    /// let x = Connection::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
305    /// ```
306    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
307        self.name = v.into();
308        self
309    }
310
311    /// Sets the value of [create_time][crate::model::Connection::create_time].
312    ///
313    /// # Example
314    /// ```ignore,no_run
315    /// # use google_cloud_developerconnect_v1::model::Connection;
316    /// use wkt::Timestamp;
317    /// let x = Connection::new().set_create_time(Timestamp::default()/* use setters */);
318    /// ```
319    pub fn set_create_time<T>(mut self, v: T) -> Self
320    where
321        T: std::convert::Into<wkt::Timestamp>,
322    {
323        self.create_time = std::option::Option::Some(v.into());
324        self
325    }
326
327    /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
328    ///
329    /// # Example
330    /// ```ignore,no_run
331    /// # use google_cloud_developerconnect_v1::model::Connection;
332    /// use wkt::Timestamp;
333    /// let x = Connection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
334    /// let x = Connection::new().set_or_clear_create_time(None::<Timestamp>);
335    /// ```
336    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
337    where
338        T: std::convert::Into<wkt::Timestamp>,
339    {
340        self.create_time = v.map(|x| x.into());
341        self
342    }
343
344    /// Sets the value of [update_time][crate::model::Connection::update_time].
345    ///
346    /// # Example
347    /// ```ignore,no_run
348    /// # use google_cloud_developerconnect_v1::model::Connection;
349    /// use wkt::Timestamp;
350    /// let x = Connection::new().set_update_time(Timestamp::default()/* use setters */);
351    /// ```
352    pub fn set_update_time<T>(mut self, v: T) -> Self
353    where
354        T: std::convert::Into<wkt::Timestamp>,
355    {
356        self.update_time = std::option::Option::Some(v.into());
357        self
358    }
359
360    /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
361    ///
362    /// # Example
363    /// ```ignore,no_run
364    /// # use google_cloud_developerconnect_v1::model::Connection;
365    /// use wkt::Timestamp;
366    /// let x = Connection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
367    /// let x = Connection::new().set_or_clear_update_time(None::<Timestamp>);
368    /// ```
369    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
370    where
371        T: std::convert::Into<wkt::Timestamp>,
372    {
373        self.update_time = v.map(|x| x.into());
374        self
375    }
376
377    /// Sets the value of [delete_time][crate::model::Connection::delete_time].
378    ///
379    /// # Example
380    /// ```ignore,no_run
381    /// # use google_cloud_developerconnect_v1::model::Connection;
382    /// use wkt::Timestamp;
383    /// let x = Connection::new().set_delete_time(Timestamp::default()/* use setters */);
384    /// ```
385    pub fn set_delete_time<T>(mut self, v: T) -> Self
386    where
387        T: std::convert::Into<wkt::Timestamp>,
388    {
389        self.delete_time = std::option::Option::Some(v.into());
390        self
391    }
392
393    /// Sets or clears the value of [delete_time][crate::model::Connection::delete_time].
394    ///
395    /// # Example
396    /// ```ignore,no_run
397    /// # use google_cloud_developerconnect_v1::model::Connection;
398    /// use wkt::Timestamp;
399    /// let x = Connection::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
400    /// let x = Connection::new().set_or_clear_delete_time(None::<Timestamp>);
401    /// ```
402    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
403    where
404        T: std::convert::Into<wkt::Timestamp>,
405    {
406        self.delete_time = v.map(|x| x.into());
407        self
408    }
409
410    /// Sets the value of [labels][crate::model::Connection::labels].
411    ///
412    /// # Example
413    /// ```ignore,no_run
414    /// # use google_cloud_developerconnect_v1::model::Connection;
415    /// let x = Connection::new().set_labels([
416    ///     ("key0", "abc"),
417    ///     ("key1", "xyz"),
418    /// ]);
419    /// ```
420    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
421    where
422        T: std::iter::IntoIterator<Item = (K, V)>,
423        K: std::convert::Into<std::string::String>,
424        V: std::convert::Into<std::string::String>,
425    {
426        use std::iter::Iterator;
427        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
428        self
429    }
430
431    /// Sets the value of [installation_state][crate::model::Connection::installation_state].
432    ///
433    /// # Example
434    /// ```ignore,no_run
435    /// # use google_cloud_developerconnect_v1::model::Connection;
436    /// use google_cloud_developerconnect_v1::model::InstallationState;
437    /// let x = Connection::new().set_installation_state(InstallationState::default()/* use setters */);
438    /// ```
439    pub fn set_installation_state<T>(mut self, v: T) -> Self
440    where
441        T: std::convert::Into<crate::model::InstallationState>,
442    {
443        self.installation_state = std::option::Option::Some(v.into());
444        self
445    }
446
447    /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
448    ///
449    /// # Example
450    /// ```ignore,no_run
451    /// # use google_cloud_developerconnect_v1::model::Connection;
452    /// use google_cloud_developerconnect_v1::model::InstallationState;
453    /// let x = Connection::new().set_or_clear_installation_state(Some(InstallationState::default()/* use setters */));
454    /// let x = Connection::new().set_or_clear_installation_state(None::<InstallationState>);
455    /// ```
456    pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
457    where
458        T: std::convert::Into<crate::model::InstallationState>,
459    {
460        self.installation_state = v.map(|x| x.into());
461        self
462    }
463
464    /// Sets the value of [disabled][crate::model::Connection::disabled].
465    ///
466    /// # Example
467    /// ```ignore,no_run
468    /// # use google_cloud_developerconnect_v1::model::Connection;
469    /// let x = Connection::new().set_disabled(true);
470    /// ```
471    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
472        self.disabled = v.into();
473        self
474    }
475
476    /// Sets the value of [reconciling][crate::model::Connection::reconciling].
477    ///
478    /// # Example
479    /// ```ignore,no_run
480    /// # use google_cloud_developerconnect_v1::model::Connection;
481    /// let x = Connection::new().set_reconciling(true);
482    /// ```
483    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
484        self.reconciling = v.into();
485        self
486    }
487
488    /// Sets the value of [annotations][crate::model::Connection::annotations].
489    ///
490    /// # Example
491    /// ```ignore,no_run
492    /// # use google_cloud_developerconnect_v1::model::Connection;
493    /// let x = Connection::new().set_annotations([
494    ///     ("key0", "abc"),
495    ///     ("key1", "xyz"),
496    /// ]);
497    /// ```
498    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
499    where
500        T: std::iter::IntoIterator<Item = (K, V)>,
501        K: std::convert::Into<std::string::String>,
502        V: std::convert::Into<std::string::String>,
503    {
504        use std::iter::Iterator;
505        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
506        self
507    }
508
509    /// Sets the value of [etag][crate::model::Connection::etag].
510    ///
511    /// # Example
512    /// ```ignore,no_run
513    /// # use google_cloud_developerconnect_v1::model::Connection;
514    /// let x = Connection::new().set_etag("example");
515    /// ```
516    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
517        self.etag = v.into();
518        self
519    }
520
521    /// Sets the value of [uid][crate::model::Connection::uid].
522    ///
523    /// # Example
524    /// ```ignore,no_run
525    /// # use google_cloud_developerconnect_v1::model::Connection;
526    /// let x = Connection::new().set_uid("example");
527    /// ```
528    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
529        self.uid = v.into();
530        self
531    }
532
533    /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
534    ///
535    /// # Example
536    /// ```ignore,no_run
537    /// # use google_cloud_developerconnect_v1::model::Connection;
538    /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
539    /// let x = Connection::new().set_crypto_key_config(CryptoKeyConfig::default()/* use setters */);
540    /// ```
541    pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
542    where
543        T: std::convert::Into<crate::model::CryptoKeyConfig>,
544    {
545        self.crypto_key_config = std::option::Option::Some(v.into());
546        self
547    }
548
549    /// Sets or clears the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
550    ///
551    /// # Example
552    /// ```ignore,no_run
553    /// # use google_cloud_developerconnect_v1::model::Connection;
554    /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
555    /// let x = Connection::new().set_or_clear_crypto_key_config(Some(CryptoKeyConfig::default()/* use setters */));
556    /// let x = Connection::new().set_or_clear_crypto_key_config(None::<CryptoKeyConfig>);
557    /// ```
558    pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
559    where
560        T: std::convert::Into<crate::model::CryptoKeyConfig>,
561    {
562        self.crypto_key_config = v.map(|x| x.into());
563        self
564    }
565
566    /// Sets the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
567    ///
568    /// # Example
569    /// ```ignore,no_run
570    /// # use google_cloud_developerconnect_v1::model::Connection;
571    /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
572    /// let x = Connection::new().set_git_proxy_config(GitProxyConfig::default()/* use setters */);
573    /// ```
574    pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
575    where
576        T: std::convert::Into<crate::model::GitProxyConfig>,
577    {
578        self.git_proxy_config = std::option::Option::Some(v.into());
579        self
580    }
581
582    /// Sets or clears the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
583    ///
584    /// # Example
585    /// ```ignore,no_run
586    /// # use google_cloud_developerconnect_v1::model::Connection;
587    /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
588    /// let x = Connection::new().set_or_clear_git_proxy_config(Some(GitProxyConfig::default()/* use setters */));
589    /// let x = Connection::new().set_or_clear_git_proxy_config(None::<GitProxyConfig>);
590    /// ```
591    pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
592    where
593        T: std::convert::Into<crate::model::GitProxyConfig>,
594    {
595        self.git_proxy_config = v.map(|x| x.into());
596        self
597    }
598
599    /// Sets the value of [connection_config][crate::model::Connection::connection_config].
600    ///
601    /// Note that all the setters affecting `connection_config` are mutually
602    /// exclusive.
603    ///
604    /// # Example
605    /// ```ignore,no_run
606    /// # use google_cloud_developerconnect_v1::model::Connection;
607    /// use google_cloud_developerconnect_v1::model::GitHubConfig;
608    /// let x = Connection::new().set_connection_config(Some(
609    ///     google_cloud_developerconnect_v1::model::connection::ConnectionConfig::GithubConfig(GitHubConfig::default().into())));
610    /// ```
611    pub fn set_connection_config<
612        T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
613    >(
614        mut self,
615        v: T,
616    ) -> Self {
617        self.connection_config = v.into();
618        self
619    }
620
621    /// The value of [connection_config][crate::model::Connection::connection_config]
622    /// if it holds a `GithubConfig`, `None` if the field is not set or
623    /// holds a different branch.
624    pub fn github_config(
625        &self,
626    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
627        #[allow(unreachable_patterns)]
628        self.connection_config.as_ref().and_then(|v| match v {
629            crate::model::connection::ConnectionConfig::GithubConfig(v) => {
630                std::option::Option::Some(v)
631            }
632            _ => std::option::Option::None,
633        })
634    }
635
636    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
637    /// to hold a `GithubConfig`.
638    ///
639    /// Note that all the setters affecting `connection_config` are
640    /// mutually exclusive.
641    ///
642    /// # Example
643    /// ```ignore,no_run
644    /// # use google_cloud_developerconnect_v1::model::Connection;
645    /// use google_cloud_developerconnect_v1::model::GitHubConfig;
646    /// let x = Connection::new().set_github_config(GitHubConfig::default()/* use setters */);
647    /// assert!(x.github_config().is_some());
648    /// assert!(x.github_enterprise_config().is_none());
649    /// assert!(x.gitlab_config().is_none());
650    /// assert!(x.gitlab_enterprise_config().is_none());
651    /// assert!(x.bitbucket_data_center_config().is_none());
652    /// assert!(x.bitbucket_cloud_config().is_none());
653    /// assert!(x.secure_source_manager_instance_config().is_none());
654    /// assert!(x.http_config().is_none());
655    /// ```
656    pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
657        mut self,
658        v: T,
659    ) -> Self {
660        self.connection_config = std::option::Option::Some(
661            crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
662        );
663        self
664    }
665
666    /// The value of [connection_config][crate::model::Connection::connection_config]
667    /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
668    /// holds a different branch.
669    pub fn github_enterprise_config(
670        &self,
671    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
672        #[allow(unreachable_patterns)]
673        self.connection_config.as_ref().and_then(|v| match v {
674            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
675                std::option::Option::Some(v)
676            }
677            _ => std::option::Option::None,
678        })
679    }
680
681    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
682    /// to hold a `GithubEnterpriseConfig`.
683    ///
684    /// Note that all the setters affecting `connection_config` are
685    /// mutually exclusive.
686    ///
687    /// # Example
688    /// ```ignore,no_run
689    /// # use google_cloud_developerconnect_v1::model::Connection;
690    /// use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
691    /// let x = Connection::new().set_github_enterprise_config(GitHubEnterpriseConfig::default()/* use setters */);
692    /// assert!(x.github_enterprise_config().is_some());
693    /// assert!(x.github_config().is_none());
694    /// assert!(x.gitlab_config().is_none());
695    /// assert!(x.gitlab_enterprise_config().is_none());
696    /// assert!(x.bitbucket_data_center_config().is_none());
697    /// assert!(x.bitbucket_cloud_config().is_none());
698    /// assert!(x.secure_source_manager_instance_config().is_none());
699    /// assert!(x.http_config().is_none());
700    /// ```
701    pub fn set_github_enterprise_config<
702        T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
703    >(
704        mut self,
705        v: T,
706    ) -> Self {
707        self.connection_config = std::option::Option::Some(
708            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
709        );
710        self
711    }
712
713    /// The value of [connection_config][crate::model::Connection::connection_config]
714    /// if it holds a `GitlabConfig`, `None` if the field is not set or
715    /// holds a different branch.
716    pub fn gitlab_config(
717        &self,
718    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
719        #[allow(unreachable_patterns)]
720        self.connection_config.as_ref().and_then(|v| match v {
721            crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
722                std::option::Option::Some(v)
723            }
724            _ => std::option::Option::None,
725        })
726    }
727
728    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
729    /// to hold a `GitlabConfig`.
730    ///
731    /// Note that all the setters affecting `connection_config` are
732    /// mutually exclusive.
733    ///
734    /// # Example
735    /// ```ignore,no_run
736    /// # use google_cloud_developerconnect_v1::model::Connection;
737    /// use google_cloud_developerconnect_v1::model::GitLabConfig;
738    /// let x = Connection::new().set_gitlab_config(GitLabConfig::default()/* use setters */);
739    /// assert!(x.gitlab_config().is_some());
740    /// assert!(x.github_config().is_none());
741    /// assert!(x.github_enterprise_config().is_none());
742    /// assert!(x.gitlab_enterprise_config().is_none());
743    /// assert!(x.bitbucket_data_center_config().is_none());
744    /// assert!(x.bitbucket_cloud_config().is_none());
745    /// assert!(x.secure_source_manager_instance_config().is_none());
746    /// assert!(x.http_config().is_none());
747    /// ```
748    pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
749        mut self,
750        v: T,
751    ) -> Self {
752        self.connection_config = std::option::Option::Some(
753            crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
754        );
755        self
756    }
757
758    /// The value of [connection_config][crate::model::Connection::connection_config]
759    /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
760    /// holds a different branch.
761    pub fn gitlab_enterprise_config(
762        &self,
763    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
764        #[allow(unreachable_patterns)]
765        self.connection_config.as_ref().and_then(|v| match v {
766            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
767                std::option::Option::Some(v)
768            }
769            _ => std::option::Option::None,
770        })
771    }
772
773    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
774    /// to hold a `GitlabEnterpriseConfig`.
775    ///
776    /// Note that all the setters affecting `connection_config` are
777    /// mutually exclusive.
778    ///
779    /// # Example
780    /// ```ignore,no_run
781    /// # use google_cloud_developerconnect_v1::model::Connection;
782    /// use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
783    /// let x = Connection::new().set_gitlab_enterprise_config(GitLabEnterpriseConfig::default()/* use setters */);
784    /// assert!(x.gitlab_enterprise_config().is_some());
785    /// assert!(x.github_config().is_none());
786    /// assert!(x.github_enterprise_config().is_none());
787    /// assert!(x.gitlab_config().is_none());
788    /// assert!(x.bitbucket_data_center_config().is_none());
789    /// assert!(x.bitbucket_cloud_config().is_none());
790    /// assert!(x.secure_source_manager_instance_config().is_none());
791    /// assert!(x.http_config().is_none());
792    /// ```
793    pub fn set_gitlab_enterprise_config<
794        T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
795    >(
796        mut self,
797        v: T,
798    ) -> Self {
799        self.connection_config = std::option::Option::Some(
800            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
801        );
802        self
803    }
804
805    /// The value of [connection_config][crate::model::Connection::connection_config]
806    /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
807    /// holds a different branch.
808    pub fn bitbucket_data_center_config(
809        &self,
810    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
811        #[allow(unreachable_patterns)]
812        self.connection_config.as_ref().and_then(|v| match v {
813            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
814                std::option::Option::Some(v)
815            }
816            _ => std::option::Option::None,
817        })
818    }
819
820    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
821    /// to hold a `BitbucketDataCenterConfig`.
822    ///
823    /// Note that all the setters affecting `connection_config` are
824    /// mutually exclusive.
825    ///
826    /// # Example
827    /// ```ignore,no_run
828    /// # use google_cloud_developerconnect_v1::model::Connection;
829    /// use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
830    /// let x = Connection::new().set_bitbucket_data_center_config(BitbucketDataCenterConfig::default()/* use setters */);
831    /// assert!(x.bitbucket_data_center_config().is_some());
832    /// assert!(x.github_config().is_none());
833    /// assert!(x.github_enterprise_config().is_none());
834    /// assert!(x.gitlab_config().is_none());
835    /// assert!(x.gitlab_enterprise_config().is_none());
836    /// assert!(x.bitbucket_cloud_config().is_none());
837    /// assert!(x.secure_source_manager_instance_config().is_none());
838    /// assert!(x.http_config().is_none());
839    /// ```
840    pub fn set_bitbucket_data_center_config<
841        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
842    >(
843        mut self,
844        v: T,
845    ) -> Self {
846        self.connection_config = std::option::Option::Some(
847            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
848        );
849        self
850    }
851
852    /// The value of [connection_config][crate::model::Connection::connection_config]
853    /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
854    /// holds a different branch.
855    pub fn bitbucket_cloud_config(
856        &self,
857    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
858        #[allow(unreachable_patterns)]
859        self.connection_config.as_ref().and_then(|v| match v {
860            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
861                std::option::Option::Some(v)
862            }
863            _ => std::option::Option::None,
864        })
865    }
866
867    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
868    /// to hold a `BitbucketCloudConfig`.
869    ///
870    /// Note that all the setters affecting `connection_config` are
871    /// mutually exclusive.
872    ///
873    /// # Example
874    /// ```ignore,no_run
875    /// # use google_cloud_developerconnect_v1::model::Connection;
876    /// use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
877    /// let x = Connection::new().set_bitbucket_cloud_config(BitbucketCloudConfig::default()/* use setters */);
878    /// assert!(x.bitbucket_cloud_config().is_some());
879    /// assert!(x.github_config().is_none());
880    /// assert!(x.github_enterprise_config().is_none());
881    /// assert!(x.gitlab_config().is_none());
882    /// assert!(x.gitlab_enterprise_config().is_none());
883    /// assert!(x.bitbucket_data_center_config().is_none());
884    /// assert!(x.secure_source_manager_instance_config().is_none());
885    /// assert!(x.http_config().is_none());
886    /// ```
887    pub fn set_bitbucket_cloud_config<
888        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
889    >(
890        mut self,
891        v: T,
892    ) -> Self {
893        self.connection_config = std::option::Option::Some(
894            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
895        );
896        self
897    }
898
899    /// The value of [connection_config][crate::model::Connection::connection_config]
900    /// if it holds a `SecureSourceManagerInstanceConfig`, `None` if the field is not set or
901    /// holds a different branch.
902    pub fn secure_source_manager_instance_config(
903        &self,
904    ) -> std::option::Option<&std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>
905    {
906        #[allow(unreachable_patterns)]
907        self.connection_config.as_ref().and_then(|v| match v {
908            crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v) => {
909                std::option::Option::Some(v)
910            }
911            _ => std::option::Option::None,
912        })
913    }
914
915    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
916    /// to hold a `SecureSourceManagerInstanceConfig`.
917    ///
918    /// Note that all the setters affecting `connection_config` are
919    /// mutually exclusive.
920    ///
921    /// # Example
922    /// ```ignore,no_run
923    /// # use google_cloud_developerconnect_v1::model::Connection;
924    /// use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
925    /// let x = Connection::new().set_secure_source_manager_instance_config(SecureSourceManagerInstanceConfig::default()/* use setters */);
926    /// assert!(x.secure_source_manager_instance_config().is_some());
927    /// assert!(x.github_config().is_none());
928    /// assert!(x.github_enterprise_config().is_none());
929    /// assert!(x.gitlab_config().is_none());
930    /// assert!(x.gitlab_enterprise_config().is_none());
931    /// assert!(x.bitbucket_data_center_config().is_none());
932    /// assert!(x.bitbucket_cloud_config().is_none());
933    /// assert!(x.http_config().is_none());
934    /// ```
935    pub fn set_secure_source_manager_instance_config<
936        T: std::convert::Into<std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>,
937    >(
938        mut self,
939        v: T,
940    ) -> Self {
941        self.connection_config = std::option::Option::Some(
942            crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v.into()),
943        );
944        self
945    }
946
947    /// The value of [connection_config][crate::model::Connection::connection_config]
948    /// if it holds a `HttpConfig`, `None` if the field is not set or
949    /// holds a different branch.
950    pub fn http_config(
951        &self,
952    ) -> std::option::Option<&std::boxed::Box<crate::model::GenericHTTPEndpointConfig>> {
953        #[allow(unreachable_patterns)]
954        self.connection_config.as_ref().and_then(|v| match v {
955            crate::model::connection::ConnectionConfig::HttpConfig(v) => {
956                std::option::Option::Some(v)
957            }
958            _ => std::option::Option::None,
959        })
960    }
961
962    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
963    /// to hold a `HttpConfig`.
964    ///
965    /// Note that all the setters affecting `connection_config` are
966    /// mutually exclusive.
967    ///
968    /// # Example
969    /// ```ignore,no_run
970    /// # use google_cloud_developerconnect_v1::model::Connection;
971    /// use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
972    /// let x = Connection::new().set_http_config(GenericHTTPEndpointConfig::default()/* use setters */);
973    /// assert!(x.http_config().is_some());
974    /// assert!(x.github_config().is_none());
975    /// assert!(x.github_enterprise_config().is_none());
976    /// assert!(x.gitlab_config().is_none());
977    /// assert!(x.gitlab_enterprise_config().is_none());
978    /// assert!(x.bitbucket_data_center_config().is_none());
979    /// assert!(x.bitbucket_cloud_config().is_none());
980    /// assert!(x.secure_source_manager_instance_config().is_none());
981    /// ```
982    pub fn set_http_config<
983        T: std::convert::Into<std::boxed::Box<crate::model::GenericHTTPEndpointConfig>>,
984    >(
985        mut self,
986        v: T,
987    ) -> Self {
988        self.connection_config = std::option::Option::Some(
989            crate::model::connection::ConnectionConfig::HttpConfig(v.into()),
990        );
991        self
992    }
993}
994
995impl wkt::message::Message for Connection {
996    fn typename() -> &'static str {
997        "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
998    }
999}
1000
1001/// Defines additional types related to [Connection].
1002pub mod connection {
1003    #[allow(unused_imports)]
1004    use super::*;
1005
1006    /// Configuration for the connection depending on the type of provider.
1007    #[derive(Clone, Debug, PartialEq)]
1008    #[non_exhaustive]
1009    pub enum ConnectionConfig {
1010        /// Configuration for connections to github.com.
1011        GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
1012        /// Configuration for connections to an instance of GitHub Enterprise.
1013        GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
1014        /// Configuration for connections to gitlab.com.
1015        GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
1016        /// Configuration for connections to an instance of GitLab Enterprise.
1017        GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
1018        /// Configuration for connections to an instance of Bitbucket Data Center.
1019        BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
1020        /// Configuration for connections to an instance of Bitbucket Clouds.
1021        BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
1022        /// Configuration for connections to an instance of Secure Source Manager.
1023        SecureSourceManagerInstanceConfig(
1024            std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>,
1025        ),
1026        /// Optional. Configuration for connections to an HTTP service provider.
1027        HttpConfig(std::boxed::Box<crate::model::GenericHTTPEndpointConfig>),
1028    }
1029}
1030
1031/// The crypto key configuration. This field is used by the Customer-managed
1032/// encryption keys (CMEK) feature.
1033#[derive(Clone, Default, PartialEq)]
1034#[non_exhaustive]
1035pub struct CryptoKeyConfig {
1036    /// Required. The name of the key which is used to encrypt/decrypt customer
1037    /// data. For key in Cloud KMS, the key should be in the format of
1038    /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
1039    pub key_reference: std::string::String,
1040
1041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1042}
1043
1044impl CryptoKeyConfig {
1045    /// Creates a new default instance.
1046    pub fn new() -> Self {
1047        std::default::Default::default()
1048    }
1049
1050    /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
1051    ///
1052    /// # Example
1053    /// ```ignore,no_run
1054    /// # use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
1055    /// let x = CryptoKeyConfig::new().set_key_reference("example");
1056    /// ```
1057    pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1058        self.key_reference = v.into();
1059        self
1060    }
1061}
1062
1063impl wkt::message::Message for CryptoKeyConfig {
1064    fn typename() -> &'static str {
1065        "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
1066    }
1067}
1068
1069/// The git proxy configuration.
1070#[derive(Clone, Default, PartialEq)]
1071#[non_exhaustive]
1072pub struct GitProxyConfig {
1073    /// Optional. Setting this to true allows the git proxy to be used for
1074    /// performing git operations on the repositories linked in the connection.
1075    pub enabled: bool,
1076
1077    /// Output only. The base URI for the HTTP proxy endpoint. Has
1078    /// the format
1079    /// `https://{generatedID}-c-h-{shortRegion}.developerconnect.dev`
1080    /// Populated only when enabled is set to true.
1081    /// This endpoint is used by other Google services that integrate with
1082    /// Developer Connect.
1083    pub http_proxy_base_uri: std::string::String,
1084
1085    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1086}
1087
1088impl GitProxyConfig {
1089    /// Creates a new default instance.
1090    pub fn new() -> Self {
1091        std::default::Default::default()
1092    }
1093
1094    /// Sets the value of [enabled][crate::model::GitProxyConfig::enabled].
1095    ///
1096    /// # Example
1097    /// ```ignore,no_run
1098    /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1099    /// let x = GitProxyConfig::new().set_enabled(true);
1100    /// ```
1101    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1102        self.enabled = v.into();
1103        self
1104    }
1105
1106    /// Sets the value of [http_proxy_base_uri][crate::model::GitProxyConfig::http_proxy_base_uri].
1107    ///
1108    /// # Example
1109    /// ```ignore,no_run
1110    /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1111    /// let x = GitProxyConfig::new().set_http_proxy_base_uri("example");
1112    /// ```
1113    pub fn set_http_proxy_base_uri<T: std::convert::Into<std::string::String>>(
1114        mut self,
1115        v: T,
1116    ) -> Self {
1117        self.http_proxy_base_uri = v.into();
1118        self
1119    }
1120}
1121
1122impl wkt::message::Message for GitProxyConfig {
1123    fn typename() -> &'static str {
1124        "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
1125    }
1126}
1127
1128/// Describes stage and necessary actions to be taken by the
1129/// user to complete the installation. Used for GitHub and GitHub Enterprise
1130/// based connections.
1131#[derive(Clone, Default, PartialEq)]
1132#[non_exhaustive]
1133pub struct InstallationState {
1134    /// Output only. Current step of the installation process.
1135    pub stage: crate::model::installation_state::Stage,
1136
1137    /// Output only. Message of what the user should do next to continue the
1138    /// installation. Empty string if the installation is already complete.
1139    pub message: std::string::String,
1140
1141    /// Output only. Link to follow for next action. Empty string if the
1142    /// installation is already complete.
1143    pub action_uri: std::string::String,
1144
1145    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1146}
1147
1148impl InstallationState {
1149    /// Creates a new default instance.
1150    pub fn new() -> Self {
1151        std::default::Default::default()
1152    }
1153
1154    /// Sets the value of [stage][crate::model::InstallationState::stage].
1155    ///
1156    /// # Example
1157    /// ```ignore,no_run
1158    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1159    /// use google_cloud_developerconnect_v1::model::installation_state::Stage;
1160    /// let x0 = InstallationState::new().set_stage(Stage::PendingCreateApp);
1161    /// let x1 = InstallationState::new().set_stage(Stage::PendingUserOauth);
1162    /// let x2 = InstallationState::new().set_stage(Stage::PendingInstallApp);
1163    /// ```
1164    pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1165        mut self,
1166        v: T,
1167    ) -> Self {
1168        self.stage = v.into();
1169        self
1170    }
1171
1172    /// Sets the value of [message][crate::model::InstallationState::message].
1173    ///
1174    /// # Example
1175    /// ```ignore,no_run
1176    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1177    /// let x = InstallationState::new().set_message("example");
1178    /// ```
1179    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1180        self.message = v.into();
1181        self
1182    }
1183
1184    /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
1185    ///
1186    /// # Example
1187    /// ```ignore,no_run
1188    /// # use google_cloud_developerconnect_v1::model::InstallationState;
1189    /// let x = InstallationState::new().set_action_uri("example");
1190    /// ```
1191    pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1192        self.action_uri = v.into();
1193        self
1194    }
1195}
1196
1197impl wkt::message::Message for InstallationState {
1198    fn typename() -> &'static str {
1199        "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
1200    }
1201}
1202
1203/// Defines additional types related to [InstallationState].
1204pub mod installation_state {
1205    #[allow(unused_imports)]
1206    use super::*;
1207
1208    /// Stage of the installation process.
1209    ///
1210    /// # Working with unknown values
1211    ///
1212    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1213    /// additional enum variants at any time. Adding new variants is not considered
1214    /// a breaking change. Applications should write their code in anticipation of:
1215    ///
1216    /// - New values appearing in future releases of the client library, **and**
1217    /// - New values received dynamically, without application changes.
1218    ///
1219    /// Please consult the [Working with enums] section in the user guide for some
1220    /// guidelines.
1221    ///
1222    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1223    #[derive(Clone, Debug, PartialEq)]
1224    #[non_exhaustive]
1225    pub enum Stage {
1226        /// No stage specified.
1227        Unspecified,
1228        /// Only for GitHub Enterprise. An App creation has been requested.
1229        /// The user needs to confirm the creation in their GitHub enterprise host.
1230        PendingCreateApp,
1231        /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
1232        PendingUserOauth,
1233        /// User needs to follow the link to install the GitHub (or Enterprise) App.
1234        PendingInstallApp,
1235        /// Installation process has been completed.
1236        Complete,
1237        /// If set, the enum was initialized with an unknown value.
1238        ///
1239        /// Applications can examine the value using [Stage::value] or
1240        /// [Stage::name].
1241        UnknownValue(stage::UnknownValue),
1242    }
1243
1244    #[doc(hidden)]
1245    pub mod stage {
1246        #[allow(unused_imports)]
1247        use super::*;
1248        #[derive(Clone, Debug, PartialEq)]
1249        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1250    }
1251
1252    impl Stage {
1253        /// Gets the enum value.
1254        ///
1255        /// Returns `None` if the enum contains an unknown value deserialized from
1256        /// the string representation of enums.
1257        pub fn value(&self) -> std::option::Option<i32> {
1258            match self {
1259                Self::Unspecified => std::option::Option::Some(0),
1260                Self::PendingCreateApp => std::option::Option::Some(1),
1261                Self::PendingUserOauth => std::option::Option::Some(2),
1262                Self::PendingInstallApp => std::option::Option::Some(3),
1263                Self::Complete => std::option::Option::Some(10),
1264                Self::UnknownValue(u) => u.0.value(),
1265            }
1266        }
1267
1268        /// Gets the enum value as a string.
1269        ///
1270        /// Returns `None` if the enum contains an unknown value deserialized from
1271        /// the integer representation of enums.
1272        pub fn name(&self) -> std::option::Option<&str> {
1273            match self {
1274                Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1275                Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1276                Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1277                Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1278                Self::Complete => std::option::Option::Some("COMPLETE"),
1279                Self::UnknownValue(u) => u.0.name(),
1280            }
1281        }
1282    }
1283
1284    impl std::default::Default for Stage {
1285        fn default() -> Self {
1286            use std::convert::From;
1287            Self::from(0)
1288        }
1289    }
1290
1291    impl std::fmt::Display for Stage {
1292        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1293            wkt::internal::display_enum(f, self.name(), self.value())
1294        }
1295    }
1296
1297    impl std::convert::From<i32> for Stage {
1298        fn from(value: i32) -> Self {
1299            match value {
1300                0 => Self::Unspecified,
1301                1 => Self::PendingCreateApp,
1302                2 => Self::PendingUserOauth,
1303                3 => Self::PendingInstallApp,
1304                10 => Self::Complete,
1305                _ => Self::UnknownValue(stage::UnknownValue(
1306                    wkt::internal::UnknownEnumValue::Integer(value),
1307                )),
1308            }
1309        }
1310    }
1311
1312    impl std::convert::From<&str> for Stage {
1313        fn from(value: &str) -> Self {
1314            use std::string::ToString;
1315            match value {
1316                "STAGE_UNSPECIFIED" => Self::Unspecified,
1317                "PENDING_CREATE_APP" => Self::PendingCreateApp,
1318                "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1319                "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1320                "COMPLETE" => Self::Complete,
1321                _ => Self::UnknownValue(stage::UnknownValue(
1322                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1323                )),
1324            }
1325        }
1326    }
1327
1328    impl serde::ser::Serialize for Stage {
1329        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1330        where
1331            S: serde::Serializer,
1332        {
1333            match self {
1334                Self::Unspecified => serializer.serialize_i32(0),
1335                Self::PendingCreateApp => serializer.serialize_i32(1),
1336                Self::PendingUserOauth => serializer.serialize_i32(2),
1337                Self::PendingInstallApp => serializer.serialize_i32(3),
1338                Self::Complete => serializer.serialize_i32(10),
1339                Self::UnknownValue(u) => u.0.serialize(serializer),
1340            }
1341        }
1342    }
1343
1344    impl<'de> serde::de::Deserialize<'de> for Stage {
1345        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1346        where
1347            D: serde::Deserializer<'de>,
1348        {
1349            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1350                ".google.cloud.developerconnect.v1.InstallationState.Stage",
1351            ))
1352        }
1353    }
1354}
1355
1356/// Defines the configuration for connections to an HTTP service provider.
1357#[derive(Clone, Default, PartialEq)]
1358#[non_exhaustive]
1359pub struct GenericHTTPEndpointConfig {
1360    /// Required. Immutable. The service provider's https endpoint.
1361    pub host_uri: std::string::String,
1362
1363    /// Optional. Configuration for using Service Directory to privately connect to
1364    /// a HTTP service provider. This should only be set if the Http service
1365    /// provider is hosted on-premises and not reachable by public internet. If
1366    /// this field is left empty, calls to the HTTP service provider will be made
1367    /// over the public internet.
1368    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1369
1370    /// Optional. The SSL certificate to use for requests to the HTTP service
1371    /// provider.
1372    pub ssl_ca_certificate: std::string::String,
1373
1374    /// The authentication mechanism to use for requests to the HTTP service
1375    /// provider.
1376    pub authentication:
1377        std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1378
1379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1380}
1381
1382impl GenericHTTPEndpointConfig {
1383    /// Creates a new default instance.
1384    pub fn new() -> Self {
1385        std::default::Default::default()
1386    }
1387
1388    /// Sets the value of [host_uri][crate::model::GenericHTTPEndpointConfig::host_uri].
1389    ///
1390    /// # Example
1391    /// ```ignore,no_run
1392    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1393    /// let x = GenericHTTPEndpointConfig::new().set_host_uri("example");
1394    /// ```
1395    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1396        self.host_uri = v.into();
1397        self
1398    }
1399
1400    /// Sets the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1401    ///
1402    /// # Example
1403    /// ```ignore,no_run
1404    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1405    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1406    /// let x = GenericHTTPEndpointConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1407    /// ```
1408    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1409    where
1410        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1411    {
1412        self.service_directory_config = std::option::Option::Some(v.into());
1413        self
1414    }
1415
1416    /// Sets or clears the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1417    ///
1418    /// # Example
1419    /// ```ignore,no_run
1420    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1421    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1422    /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1423    /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1424    /// ```
1425    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1426    where
1427        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1428    {
1429        self.service_directory_config = v.map(|x| x.into());
1430        self
1431    }
1432
1433    /// Sets the value of [ssl_ca_certificate][crate::model::GenericHTTPEndpointConfig::ssl_ca_certificate].
1434    ///
1435    /// # Example
1436    /// ```ignore,no_run
1437    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1438    /// let x = GenericHTTPEndpointConfig::new().set_ssl_ca_certificate("example");
1439    /// ```
1440    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1441        mut self,
1442        v: T,
1443    ) -> Self {
1444        self.ssl_ca_certificate = v.into();
1445        self
1446    }
1447
1448    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication].
1449    ///
1450    /// Note that all the setters affecting `authentication` are mutually
1451    /// exclusive.
1452    ///
1453    /// # Example
1454    /// ```ignore,no_run
1455    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1456    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1457    /// let x = GenericHTTPEndpointConfig::new().set_authentication(Some(
1458    ///     google_cloud_developerconnect_v1::model::generic_http_endpoint_config::Authentication::BasicAuthentication(BasicAuthentication::default().into())));
1459    /// ```
1460    pub fn set_authentication<
1461        T: std::convert::Into<
1462                std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1463            >,
1464    >(
1465        mut self,
1466        v: T,
1467    ) -> Self {
1468        self.authentication = v.into();
1469        self
1470    }
1471
1472    /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1473    /// if it holds a `BasicAuthentication`, `None` if the field is not set or
1474    /// holds a different branch.
1475    pub fn basic_authentication(
1476        &self,
1477    ) -> std::option::Option<
1478        &std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1479    > {
1480        #[allow(unreachable_patterns)]
1481        self.authentication.as_ref().and_then(|v| match v {
1482            crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(v) => {
1483                std::option::Option::Some(v)
1484            }
1485            _ => std::option::Option::None,
1486        })
1487    }
1488
1489    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1490    /// to hold a `BasicAuthentication`.
1491    ///
1492    /// Note that all the setters affecting `authentication` are
1493    /// mutually exclusive.
1494    ///
1495    /// # Example
1496    /// ```ignore,no_run
1497    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1498    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1499    /// let x = GenericHTTPEndpointConfig::new().set_basic_authentication(BasicAuthentication::default()/* use setters */);
1500    /// assert!(x.basic_authentication().is_some());
1501    /// assert!(x.bearer_token_authentication().is_none());
1502    /// ```
1503    pub fn set_basic_authentication<
1504        T: std::convert::Into<
1505                std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1506            >,
1507    >(
1508        mut self,
1509        v: T,
1510    ) -> Self {
1511        self.authentication = std::option::Option::Some(
1512            crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(
1513                v.into(),
1514            ),
1515        );
1516        self
1517    }
1518
1519    /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1520    /// if it holds a `BearerTokenAuthentication`, `None` if the field is not set or
1521    /// holds a different branch.
1522    pub fn bearer_token_authentication(
1523        &self,
1524    ) -> std::option::Option<
1525        &std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1526    > {
1527        #[allow(unreachable_patterns)]
1528        self.authentication.as_ref().and_then(|v| match v {
1529            crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(v) => std::option::Option::Some(v),
1530            _ => std::option::Option::None,
1531        })
1532    }
1533
1534    /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1535    /// to hold a `BearerTokenAuthentication`.
1536    ///
1537    /// Note that all the setters affecting `authentication` are
1538    /// mutually exclusive.
1539    ///
1540    /// # Example
1541    /// ```ignore,no_run
1542    /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1543    /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1544    /// let x = GenericHTTPEndpointConfig::new().set_bearer_token_authentication(BearerTokenAuthentication::default()/* use setters */);
1545    /// assert!(x.bearer_token_authentication().is_some());
1546    /// assert!(x.basic_authentication().is_none());
1547    /// ```
1548    pub fn set_bearer_token_authentication<
1549        T: std::convert::Into<
1550                std::boxed::Box<
1551                    crate::model::generic_http_endpoint_config::BearerTokenAuthentication,
1552                >,
1553            >,
1554    >(
1555        mut self,
1556        v: T,
1557    ) -> Self {
1558        self.authentication = std::option::Option::Some(
1559            crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(
1560                v.into(),
1561            ),
1562        );
1563        self
1564    }
1565}
1566
1567impl wkt::message::Message for GenericHTTPEndpointConfig {
1568    fn typename() -> &'static str {
1569        "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig"
1570    }
1571}
1572
1573/// Defines additional types related to [GenericHTTPEndpointConfig].
1574pub mod generic_http_endpoint_config {
1575    #[allow(unused_imports)]
1576    use super::*;
1577
1578    /// Basic authentication with username and password.
1579    #[derive(Clone, Default, PartialEq)]
1580    #[non_exhaustive]
1581    pub struct BasicAuthentication {
1582        /// Required. The username to authenticate as.
1583        pub username: std::string::String,
1584
1585        /// The password to authenticate as.
1586        pub password: std::option::Option<
1587            crate::model::generic_http_endpoint_config::basic_authentication::Password,
1588        >,
1589
1590        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1591    }
1592
1593    impl BasicAuthentication {
1594        /// Creates a new default instance.
1595        pub fn new() -> Self {
1596            std::default::Default::default()
1597        }
1598
1599        /// Sets the value of [username][crate::model::generic_http_endpoint_config::BasicAuthentication::username].
1600        ///
1601        /// # Example
1602        /// ```ignore,no_run
1603        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1604        /// let x = BasicAuthentication::new().set_username("example");
1605        /// ```
1606        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1607            self.username = v.into();
1608            self
1609        }
1610
1611        /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password].
1612        ///
1613        /// Note that all the setters affecting `password` are mutually
1614        /// exclusive.
1615        ///
1616        /// # Example
1617        /// ```ignore,no_run
1618        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1619        /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::basic_authentication::Password;
1620        /// let x = BasicAuthentication::new().set_password(Some(Password::PasswordSecretVersion("example".to_string())));
1621        /// ```
1622        pub fn set_password<
1623            T: std::convert::Into<
1624                    std::option::Option<
1625                        crate::model::generic_http_endpoint_config::basic_authentication::Password,
1626                    >,
1627                >,
1628        >(
1629            mut self,
1630            v: T,
1631        ) -> Self {
1632            self.password = v.into();
1633            self
1634        }
1635
1636        /// The value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1637        /// if it holds a `PasswordSecretVersion`, `None` if the field is not set or
1638        /// holds a different branch.
1639        pub fn password_secret_version(&self) -> std::option::Option<&std::string::String> {
1640            #[allow(unreachable_patterns)]
1641            self.password.as_ref().and_then(|v| match v {
1642                crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(v) => std::option::Option::Some(v),
1643                _ => std::option::Option::None,
1644            })
1645        }
1646
1647        /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1648        /// to hold a `PasswordSecretVersion`.
1649        ///
1650        /// Note that all the setters affecting `password` are
1651        /// mutually exclusive.
1652        ///
1653        /// # Example
1654        /// ```ignore,no_run
1655        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1656        /// let x = BasicAuthentication::new().set_password_secret_version("example");
1657        /// assert!(x.password_secret_version().is_some());
1658        /// ```
1659        pub fn set_password_secret_version<T: std::convert::Into<std::string::String>>(
1660            mut self,
1661            v: T,
1662        ) -> Self {
1663            self.password = std::option::Option::Some(
1664                crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(
1665                    v.into()
1666                )
1667            );
1668            self
1669        }
1670    }
1671
1672    impl wkt::message::Message for BasicAuthentication {
1673        fn typename() -> &'static str {
1674            "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BasicAuthentication"
1675        }
1676    }
1677
1678    /// Defines additional types related to [BasicAuthentication].
1679    pub mod basic_authentication {
1680        #[allow(unused_imports)]
1681        use super::*;
1682
1683        /// The password to authenticate as.
1684        #[derive(Clone, Debug, PartialEq)]
1685        #[non_exhaustive]
1686        pub enum Password {
1687            /// The password SecretManager secret version to authenticate as.
1688            PasswordSecretVersion(std::string::String),
1689        }
1690    }
1691
1692    /// Bearer token authentication with a token.
1693    #[derive(Clone, Default, PartialEq)]
1694    #[non_exhaustive]
1695    pub struct BearerTokenAuthentication {
1696        /// The token to authenticate as.
1697        pub token: std::option::Option<
1698            crate::model::generic_http_endpoint_config::bearer_token_authentication::Token,
1699        >,
1700
1701        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1702    }
1703
1704    impl BearerTokenAuthentication {
1705        /// Creates a new default instance.
1706        pub fn new() -> Self {
1707            std::default::Default::default()
1708        }
1709
1710        /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token].
1711        ///
1712        /// Note that all the setters affecting `token` are mutually
1713        /// exclusive.
1714        ///
1715        /// # Example
1716        /// ```ignore,no_run
1717        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1718        /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::bearer_token_authentication::Token;
1719        /// let x = BearerTokenAuthentication::new().set_token(Some(Token::TokenSecretVersion("example".to_string())));
1720        /// ```
1721        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
1722        {
1723            self.token = v.into();
1724            self
1725        }
1726
1727        /// The value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1728        /// if it holds a `TokenSecretVersion`, `None` if the field is not set or
1729        /// holds a different branch.
1730        pub fn token_secret_version(&self) -> std::option::Option<&std::string::String> {
1731            #[allow(unreachable_patterns)]
1732            self.token.as_ref().and_then(|v| match v {
1733                crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(v) => std::option::Option::Some(v),
1734                _ => std::option::Option::None,
1735            })
1736        }
1737
1738        /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1739        /// to hold a `TokenSecretVersion`.
1740        ///
1741        /// Note that all the setters affecting `token` are
1742        /// mutually exclusive.
1743        ///
1744        /// # Example
1745        /// ```ignore,no_run
1746        /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1747        /// let x = BearerTokenAuthentication::new().set_token_secret_version("example");
1748        /// assert!(x.token_secret_version().is_some());
1749        /// ```
1750        pub fn set_token_secret_version<T: std::convert::Into<std::string::String>>(
1751            mut self,
1752            v: T,
1753        ) -> Self {
1754            self.token = std::option::Option::Some(
1755                crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(
1756                    v.into()
1757                )
1758            );
1759            self
1760        }
1761    }
1762
1763    impl wkt::message::Message for BearerTokenAuthentication {
1764        fn typename() -> &'static str {
1765            "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BearerTokenAuthentication"
1766        }
1767    }
1768
1769    /// Defines additional types related to [BearerTokenAuthentication].
1770    pub mod bearer_token_authentication {
1771        #[allow(unused_imports)]
1772        use super::*;
1773
1774        /// The token to authenticate as.
1775        #[derive(Clone, Debug, PartialEq)]
1776        #[non_exhaustive]
1777        pub enum Token {
1778            /// Optional. The token SecretManager secret version to authenticate as.
1779            TokenSecretVersion(std::string::String),
1780        }
1781    }
1782
1783    /// The authentication mechanism to use for requests to the HTTP service
1784    /// provider.
1785    #[derive(Clone, Debug, PartialEq)]
1786    #[non_exhaustive]
1787    pub enum Authentication {
1788        /// Optional. Basic authentication with username and password.
1789        BasicAuthentication(
1790            std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1791        ),
1792        /// Optional. Bearer token authentication with a token.
1793        BearerTokenAuthentication(
1794            std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1795        ),
1796    }
1797}
1798
1799/// Configuration for connections to github.com.
1800#[derive(Clone, Default, PartialEq)]
1801#[non_exhaustive]
1802pub struct GitHubConfig {
1803    /// Required. Immutable. The GitHub Application that was installed to the
1804    /// GitHub user or organization.
1805    pub github_app: crate::model::git_hub_config::GitHubApp,
1806
1807    /// Optional. OAuth credential of the account that authorized the GitHub App.
1808    /// It is recommended to use a robot account instead of a human user account.
1809    /// The OAuth token must be tied to the GitHub App of this config.
1810    pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
1811
1812    /// Optional. GitHub App installation id.
1813    pub app_installation_id: i64,
1814
1815    /// Output only. The URI to navigate to in order to manage the installation
1816    /// associated with this GitHubConfig.
1817    pub installation_uri: std::string::String,
1818
1819    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1820}
1821
1822impl GitHubConfig {
1823    /// Creates a new default instance.
1824    pub fn new() -> Self {
1825        std::default::Default::default()
1826    }
1827
1828    /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
1829    ///
1830    /// # Example
1831    /// ```ignore,no_run
1832    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1833    /// use google_cloud_developerconnect_v1::model::git_hub_config::GitHubApp;
1834    /// let x0 = GitHubConfig::new().set_github_app(GitHubApp::DeveloperConnect);
1835    /// let x1 = GitHubConfig::new().set_github_app(GitHubApp::Firebase);
1836    /// let x2 = GitHubConfig::new().set_github_app(GitHubApp::GeminiCodeAssist);
1837    /// ```
1838    pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
1839        mut self,
1840        v: T,
1841    ) -> Self {
1842        self.github_app = v.into();
1843        self
1844    }
1845
1846    /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1847    ///
1848    /// # Example
1849    /// ```ignore,no_run
1850    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1851    /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1852    /// let x = GitHubConfig::new().set_authorizer_credential(OAuthCredential::default()/* use setters */);
1853    /// ```
1854    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1855    where
1856        T: std::convert::Into<crate::model::OAuthCredential>,
1857    {
1858        self.authorizer_credential = std::option::Option::Some(v.into());
1859        self
1860    }
1861
1862    /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1863    ///
1864    /// # Example
1865    /// ```ignore,no_run
1866    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1867    /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1868    /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(Some(OAuthCredential::default()/* use setters */));
1869    /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(None::<OAuthCredential>);
1870    /// ```
1871    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1872    where
1873        T: std::convert::Into<crate::model::OAuthCredential>,
1874    {
1875        self.authorizer_credential = v.map(|x| x.into());
1876        self
1877    }
1878
1879    /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
1880    ///
1881    /// # Example
1882    /// ```ignore,no_run
1883    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1884    /// let x = GitHubConfig::new().set_app_installation_id(42);
1885    /// ```
1886    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1887        self.app_installation_id = v.into();
1888        self
1889    }
1890
1891    /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
1892    ///
1893    /// # Example
1894    /// ```ignore,no_run
1895    /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1896    /// let x = GitHubConfig::new().set_installation_uri("example");
1897    /// ```
1898    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
1899        mut self,
1900        v: T,
1901    ) -> Self {
1902        self.installation_uri = v.into();
1903        self
1904    }
1905}
1906
1907impl wkt::message::Message for GitHubConfig {
1908    fn typename() -> &'static str {
1909        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
1910    }
1911}
1912
1913/// Defines additional types related to [GitHubConfig].
1914pub mod git_hub_config {
1915    #[allow(unused_imports)]
1916    use super::*;
1917
1918    /// Represents the various GitHub Applications that can be installed to a
1919    /// GitHub user or organization and used with Developer Connect.
1920    ///
1921    /// # Working with unknown values
1922    ///
1923    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1924    /// additional enum variants at any time. Adding new variants is not considered
1925    /// a breaking change. Applications should write their code in anticipation of:
1926    ///
1927    /// - New values appearing in future releases of the client library, **and**
1928    /// - New values received dynamically, without application changes.
1929    ///
1930    /// Please consult the [Working with enums] section in the user guide for some
1931    /// guidelines.
1932    ///
1933    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1934    #[derive(Clone, Debug, PartialEq)]
1935    #[non_exhaustive]
1936    pub enum GitHubApp {
1937        /// GitHub App not specified.
1938        Unspecified,
1939        /// The Developer Connect GitHub Application.
1940        DeveloperConnect,
1941        /// The Firebase GitHub Application.
1942        Firebase,
1943        /// The Gemini Code Assist Application.
1944        GeminiCodeAssist,
1945        /// If set, the enum was initialized with an unknown value.
1946        ///
1947        /// Applications can examine the value using [GitHubApp::value] or
1948        /// [GitHubApp::name].
1949        UnknownValue(git_hub_app::UnknownValue),
1950    }
1951
1952    #[doc(hidden)]
1953    pub mod git_hub_app {
1954        #[allow(unused_imports)]
1955        use super::*;
1956        #[derive(Clone, Debug, PartialEq)]
1957        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1958    }
1959
1960    impl GitHubApp {
1961        /// Gets the enum value.
1962        ///
1963        /// Returns `None` if the enum contains an unknown value deserialized from
1964        /// the string representation of enums.
1965        pub fn value(&self) -> std::option::Option<i32> {
1966            match self {
1967                Self::Unspecified => std::option::Option::Some(0),
1968                Self::DeveloperConnect => std::option::Option::Some(1),
1969                Self::Firebase => std::option::Option::Some(2),
1970                Self::GeminiCodeAssist => std::option::Option::Some(3),
1971                Self::UnknownValue(u) => u.0.value(),
1972            }
1973        }
1974
1975        /// Gets the enum value as a string.
1976        ///
1977        /// Returns `None` if the enum contains an unknown value deserialized from
1978        /// the integer representation of enums.
1979        pub fn name(&self) -> std::option::Option<&str> {
1980            match self {
1981                Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
1982                Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
1983                Self::Firebase => std::option::Option::Some("FIREBASE"),
1984                Self::GeminiCodeAssist => std::option::Option::Some("GEMINI_CODE_ASSIST"),
1985                Self::UnknownValue(u) => u.0.name(),
1986            }
1987        }
1988    }
1989
1990    impl std::default::Default for GitHubApp {
1991        fn default() -> Self {
1992            use std::convert::From;
1993            Self::from(0)
1994        }
1995    }
1996
1997    impl std::fmt::Display for GitHubApp {
1998        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1999            wkt::internal::display_enum(f, self.name(), self.value())
2000        }
2001    }
2002
2003    impl std::convert::From<i32> for GitHubApp {
2004        fn from(value: i32) -> Self {
2005            match value {
2006                0 => Self::Unspecified,
2007                1 => Self::DeveloperConnect,
2008                2 => Self::Firebase,
2009                3 => Self::GeminiCodeAssist,
2010                _ => Self::UnknownValue(git_hub_app::UnknownValue(
2011                    wkt::internal::UnknownEnumValue::Integer(value),
2012                )),
2013            }
2014        }
2015    }
2016
2017    impl std::convert::From<&str> for GitHubApp {
2018        fn from(value: &str) -> Self {
2019            use std::string::ToString;
2020            match value {
2021                "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
2022                "DEVELOPER_CONNECT" => Self::DeveloperConnect,
2023                "FIREBASE" => Self::Firebase,
2024                "GEMINI_CODE_ASSIST" => Self::GeminiCodeAssist,
2025                _ => Self::UnknownValue(git_hub_app::UnknownValue(
2026                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2027                )),
2028            }
2029        }
2030    }
2031
2032    impl serde::ser::Serialize for GitHubApp {
2033        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2034        where
2035            S: serde::Serializer,
2036        {
2037            match self {
2038                Self::Unspecified => serializer.serialize_i32(0),
2039                Self::DeveloperConnect => serializer.serialize_i32(1),
2040                Self::Firebase => serializer.serialize_i32(2),
2041                Self::GeminiCodeAssist => serializer.serialize_i32(3),
2042                Self::UnknownValue(u) => u.0.serialize(serializer),
2043            }
2044        }
2045    }
2046
2047    impl<'de> serde::de::Deserialize<'de> for GitHubApp {
2048        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2049        where
2050            D: serde::Deserializer<'de>,
2051        {
2052            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
2053                ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
2054            ))
2055        }
2056    }
2057}
2058
2059/// Configuration for connections to an instance of GitHub Enterprise.
2060#[derive(Clone, Default, PartialEq)]
2061#[non_exhaustive]
2062pub struct GitHubEnterpriseConfig {
2063    /// Required. The URI of the GitHub Enterprise host this connection is for.
2064    pub host_uri: std::string::String,
2065
2066    /// Optional. ID of the GitHub App created from the manifest.
2067    pub app_id: i64,
2068
2069    /// Output only. The URL-friendly name of the GitHub App.
2070    pub app_slug: std::string::String,
2071
2072    /// Optional. SecretManager resource containing the private key of the GitHub
2073    /// App, formatted as `projects/*/secrets/*/versions/*` or
2074    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2075    /// supported in that location).
2076    pub private_key_secret_version: std::string::String,
2077
2078    /// Optional. SecretManager resource containing the webhook secret of the
2079    /// GitHub App, formatted as `projects/*/secrets/*/versions/*` or
2080    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2081    /// supported in that location).
2082    pub webhook_secret_secret_version: std::string::String,
2083
2084    /// Optional. ID of the installation of the GitHub App.
2085    pub app_installation_id: i64,
2086
2087    /// Output only. The URI to navigate to in order to manage the installation
2088    /// associated with this GitHubEnterpriseConfig.
2089    pub installation_uri: std::string::String,
2090
2091    /// Optional. Configuration for using Service Directory to privately connect to
2092    /// a GitHub Enterprise server. This should only be set if the GitHub
2093    /// Enterprise server is hosted on-premises and not reachable by public
2094    /// internet. If this field is left empty, calls to the GitHub Enterprise
2095    /// server will be made over the public internet.
2096    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2097
2098    /// Output only. GitHub Enterprise version installed at the host_uri.
2099    pub server_version: std::string::String,
2100
2101    /// Optional. SSL certificate to use for requests to GitHub Enterprise.
2102    pub ssl_ca_certificate: std::string::String,
2103
2104    /// Optional. Immutable. GitHub Enterprise organization in which the GitHub App
2105    /// is created.
2106    pub organization: std::string::String,
2107
2108    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2109}
2110
2111impl GitHubEnterpriseConfig {
2112    /// Creates a new default instance.
2113    pub fn new() -> Self {
2114        std::default::Default::default()
2115    }
2116
2117    /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
2118    ///
2119    /// # Example
2120    /// ```ignore,no_run
2121    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2122    /// let x = GitHubEnterpriseConfig::new().set_host_uri("example");
2123    /// ```
2124    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2125        self.host_uri = v.into();
2126        self
2127    }
2128
2129    /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
2130    ///
2131    /// # Example
2132    /// ```ignore,no_run
2133    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2134    /// let x = GitHubEnterpriseConfig::new().set_app_id(42);
2135    /// ```
2136    pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2137        self.app_id = v.into();
2138        self
2139    }
2140
2141    /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
2142    ///
2143    /// # Example
2144    /// ```ignore,no_run
2145    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2146    /// let x = GitHubEnterpriseConfig::new().set_app_slug("example");
2147    /// ```
2148    pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2149        self.app_slug = v.into();
2150        self
2151    }
2152
2153    /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
2154    ///
2155    /// # Example
2156    /// ```ignore,no_run
2157    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2158    /// let x = GitHubEnterpriseConfig::new().set_private_key_secret_version("example");
2159    /// ```
2160    pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
2161        mut self,
2162        v: T,
2163    ) -> Self {
2164        self.private_key_secret_version = v.into();
2165        self
2166    }
2167
2168    /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
2169    ///
2170    /// # Example
2171    /// ```ignore,no_run
2172    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2173    /// let x = GitHubEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2174    /// ```
2175    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2176        mut self,
2177        v: T,
2178    ) -> Self {
2179        self.webhook_secret_secret_version = v.into();
2180        self
2181    }
2182
2183    /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
2184    ///
2185    /// # Example
2186    /// ```ignore,no_run
2187    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2188    /// let x = GitHubEnterpriseConfig::new().set_app_installation_id(42);
2189    /// ```
2190    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2191        self.app_installation_id = v.into();
2192        self
2193    }
2194
2195    /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
2196    ///
2197    /// # Example
2198    /// ```ignore,no_run
2199    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2200    /// let x = GitHubEnterpriseConfig::new().set_installation_uri("example");
2201    /// ```
2202    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2203        mut self,
2204        v: T,
2205    ) -> Self {
2206        self.installation_uri = v.into();
2207        self
2208    }
2209
2210    /// Sets 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_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2217    /// ```
2218    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2219    where
2220        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2221    {
2222        self.service_directory_config = std::option::Option::Some(v.into());
2223        self
2224    }
2225
2226    /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2227    ///
2228    /// # Example
2229    /// ```ignore,no_run
2230    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2231    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2232    /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2233    /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2234    /// ```
2235    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2236    where
2237        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2238    {
2239        self.service_directory_config = v.map(|x| x.into());
2240        self
2241    }
2242
2243    /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
2244    ///
2245    /// # Example
2246    /// ```ignore,no_run
2247    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2248    /// let x = GitHubEnterpriseConfig::new().set_server_version("example");
2249    /// ```
2250    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2251        self.server_version = v.into();
2252        self
2253    }
2254
2255    /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
2256    ///
2257    /// # Example
2258    /// ```ignore,no_run
2259    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2260    /// let x = GitHubEnterpriseConfig::new().set_ssl_ca_certificate("example");
2261    /// ```
2262    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2263        mut self,
2264        v: T,
2265    ) -> Self {
2266        self.ssl_ca_certificate = v.into();
2267        self
2268    }
2269
2270    /// Sets the value of [organization][crate::model::GitHubEnterpriseConfig::organization].
2271    ///
2272    /// # Example
2273    /// ```ignore,no_run
2274    /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2275    /// let x = GitHubEnterpriseConfig::new().set_organization("example");
2276    /// ```
2277    pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2278        self.organization = v.into();
2279        self
2280    }
2281}
2282
2283impl wkt::message::Message for GitHubEnterpriseConfig {
2284    fn typename() -> &'static str {
2285        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
2286    }
2287}
2288
2289/// ServiceDirectoryConfig represents Service Directory configuration for a
2290/// connection.
2291#[derive(Clone, Default, PartialEq)]
2292#[non_exhaustive]
2293pub struct ServiceDirectoryConfig {
2294    /// Required. The Service Directory service name.
2295    /// Format:
2296    /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
2297    pub service: std::string::String,
2298
2299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2300}
2301
2302impl ServiceDirectoryConfig {
2303    /// Creates a new default instance.
2304    pub fn new() -> Self {
2305        std::default::Default::default()
2306    }
2307
2308    /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
2309    ///
2310    /// # Example
2311    /// ```ignore,no_run
2312    /// # use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2313    /// let x = ServiceDirectoryConfig::new().set_service("example");
2314    /// ```
2315    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2316        self.service = v.into();
2317        self
2318    }
2319}
2320
2321impl wkt::message::Message for ServiceDirectoryConfig {
2322    fn typename() -> &'static str {
2323        "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
2324    }
2325}
2326
2327/// Represents an OAuth token of the account that authorized the Connection,
2328/// and associated metadata.
2329#[derive(Clone, Default, PartialEq)]
2330#[non_exhaustive]
2331pub struct OAuthCredential {
2332    /// Required. A SecretManager resource containing the OAuth token that
2333    /// authorizes the connection. Format: `projects/*/secrets/*/versions/*` or
2334    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2335    /// supported in that location).
2336    pub oauth_token_secret_version: std::string::String,
2337
2338    /// Output only. The username associated with this token.
2339    pub username: std::string::String,
2340
2341    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2342}
2343
2344impl OAuthCredential {
2345    /// Creates a new default instance.
2346    pub fn new() -> Self {
2347        std::default::Default::default()
2348    }
2349
2350    /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
2351    ///
2352    /// # Example
2353    /// ```ignore,no_run
2354    /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2355    /// let x = OAuthCredential::new().set_oauth_token_secret_version("example");
2356    /// ```
2357    pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
2358        mut self,
2359        v: T,
2360    ) -> Self {
2361        self.oauth_token_secret_version = v.into();
2362        self
2363    }
2364
2365    /// Sets the value of [username][crate::model::OAuthCredential::username].
2366    ///
2367    /// # Example
2368    /// ```ignore,no_run
2369    /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2370    /// let x = OAuthCredential::new().set_username("example");
2371    /// ```
2372    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2373        self.username = v.into();
2374        self
2375    }
2376}
2377
2378impl wkt::message::Message for OAuthCredential {
2379    fn typename() -> &'static str {
2380        "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
2381    }
2382}
2383
2384/// Configuration for connections to gitlab.com.
2385#[derive(Clone, Default, PartialEq)]
2386#[non_exhaustive]
2387pub struct GitLabConfig {
2388    /// Required. Immutable. SecretManager resource containing the webhook secret
2389    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2390    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2391    /// supported in that location). This is used to validate webhooks.
2392    pub webhook_secret_secret_version: std::string::String,
2393
2394    /// Required. A GitLab personal access token with the minimum `read_api` scope
2395    /// access and a minimum role of `reporter`. The GitLab Projects visible to
2396    /// this Personal Access Token will control which Projects Developer Connect
2397    /// has access to.
2398    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2399
2400    /// Required. A GitLab personal access token with the minimum `api` scope
2401    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2402    /// this Personal Access Token will control which Projects Developer Connect
2403    /// has access to.
2404    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2405
2406    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2407}
2408
2409impl GitLabConfig {
2410    /// Creates a new default instance.
2411    pub fn new() -> Self {
2412        std::default::Default::default()
2413    }
2414
2415    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
2416    ///
2417    /// # Example
2418    /// ```ignore,no_run
2419    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2420    /// let x = GitLabConfig::new().set_webhook_secret_secret_version("example");
2421    /// ```
2422    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2423        mut self,
2424        v: T,
2425    ) -> Self {
2426        self.webhook_secret_secret_version = v.into();
2427        self
2428    }
2429
2430    /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2431    ///
2432    /// # Example
2433    /// ```ignore,no_run
2434    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2435    /// use google_cloud_developerconnect_v1::model::UserCredential;
2436    /// let x = GitLabConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2437    /// ```
2438    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2439    where
2440        T: std::convert::Into<crate::model::UserCredential>,
2441    {
2442        self.read_authorizer_credential = std::option::Option::Some(v.into());
2443        self
2444    }
2445
2446    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2447    ///
2448    /// # Example
2449    /// ```ignore,no_run
2450    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2451    /// use google_cloud_developerconnect_v1::model::UserCredential;
2452    /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2453    /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2454    /// ```
2455    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2456    where
2457        T: std::convert::Into<crate::model::UserCredential>,
2458    {
2459        self.read_authorizer_credential = v.map(|x| x.into());
2460        self
2461    }
2462
2463    /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2464    ///
2465    /// # Example
2466    /// ```ignore,no_run
2467    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2468    /// use google_cloud_developerconnect_v1::model::UserCredential;
2469    /// let x = GitLabConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2470    /// ```
2471    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2472    where
2473        T: std::convert::Into<crate::model::UserCredential>,
2474    {
2475        self.authorizer_credential = std::option::Option::Some(v.into());
2476        self
2477    }
2478
2479    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2480    ///
2481    /// # Example
2482    /// ```ignore,no_run
2483    /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2484    /// use google_cloud_developerconnect_v1::model::UserCredential;
2485    /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2486    /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2487    /// ```
2488    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2489    where
2490        T: std::convert::Into<crate::model::UserCredential>,
2491    {
2492        self.authorizer_credential = v.map(|x| x.into());
2493        self
2494    }
2495}
2496
2497impl wkt::message::Message for GitLabConfig {
2498    fn typename() -> &'static str {
2499        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
2500    }
2501}
2502
2503/// Represents a personal access token that authorized the Connection,
2504/// and associated metadata.
2505#[derive(Clone, Default, PartialEq)]
2506#[non_exhaustive]
2507pub struct UserCredential {
2508    /// Required. A SecretManager resource containing the user token that
2509    /// authorizes the Developer Connect connection. Format:
2510    /// `projects/*/secrets/*/versions/*` or
2511    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2512    /// supported in that location).
2513    pub user_token_secret_version: std::string::String,
2514
2515    /// Output only. The username associated with this token.
2516    pub username: std::string::String,
2517
2518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2519}
2520
2521impl UserCredential {
2522    /// Creates a new default instance.
2523    pub fn new() -> Self {
2524        std::default::Default::default()
2525    }
2526
2527    /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
2528    ///
2529    /// # Example
2530    /// ```ignore,no_run
2531    /// # use google_cloud_developerconnect_v1::model::UserCredential;
2532    /// let x = UserCredential::new().set_user_token_secret_version("example");
2533    /// ```
2534    pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
2535        mut self,
2536        v: T,
2537    ) -> Self {
2538        self.user_token_secret_version = v.into();
2539        self
2540    }
2541
2542    /// Sets the value of [username][crate::model::UserCredential::username].
2543    ///
2544    /// # Example
2545    /// ```ignore,no_run
2546    /// # use google_cloud_developerconnect_v1::model::UserCredential;
2547    /// let x = UserCredential::new().set_username("example");
2548    /// ```
2549    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2550        self.username = v.into();
2551        self
2552    }
2553}
2554
2555impl wkt::message::Message for UserCredential {
2556    fn typename() -> &'static str {
2557        "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
2558    }
2559}
2560
2561/// Configuration for connections to an instance of GitLab Enterprise.
2562#[derive(Clone, Default, PartialEq)]
2563#[non_exhaustive]
2564pub struct GitLabEnterpriseConfig {
2565    /// Required. The URI of the GitLab Enterprise host this connection is for.
2566    pub host_uri: std::string::String,
2567
2568    /// Required. Immutable. SecretManager resource containing the webhook secret
2569    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2570    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2571    /// supported in that location). This is used to validate webhooks.
2572    pub webhook_secret_secret_version: std::string::String,
2573
2574    /// Required. A GitLab personal access token with the minimum `read_api` scope
2575    /// access and a minimum role of `reporter`. The GitLab Projects visible to
2576    /// this Personal Access Token will control which Projects Developer Connect
2577    /// has access to.
2578    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2579
2580    /// Required. A GitLab personal access token with the minimum `api` scope
2581    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2582    /// this Personal Access Token will control which Projects Developer Connect
2583    /// has access to.
2584    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2585
2586    /// Optional. Configuration for using Service Directory to privately connect to
2587    /// a GitLab Enterprise instance. This should only be set if the GitLab
2588    /// Enterprise server is hosted on-premises and not reachable by public
2589    /// internet. If this field is left empty, calls to the GitLab Enterprise
2590    /// server will be made over the public internet.
2591    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2592
2593    /// Optional. SSL Certificate Authority certificate to use for requests to
2594    /// GitLab Enterprise instance.
2595    pub ssl_ca_certificate: std::string::String,
2596
2597    /// Output only. Version of the GitLab Enterprise server running on the
2598    /// `host_uri`.
2599    pub server_version: std::string::String,
2600
2601    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2602}
2603
2604impl GitLabEnterpriseConfig {
2605    /// Creates a new default instance.
2606    pub fn new() -> Self {
2607        std::default::Default::default()
2608    }
2609
2610    /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
2611    ///
2612    /// # Example
2613    /// ```ignore,no_run
2614    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2615    /// let x = GitLabEnterpriseConfig::new().set_host_uri("example");
2616    /// ```
2617    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2618        self.host_uri = v.into();
2619        self
2620    }
2621
2622    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
2623    ///
2624    /// # Example
2625    /// ```ignore,no_run
2626    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2627    /// let x = GitLabEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2628    /// ```
2629    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2630        mut self,
2631        v: T,
2632    ) -> Self {
2633        self.webhook_secret_secret_version = v.into();
2634        self
2635    }
2636
2637    /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2638    ///
2639    /// # Example
2640    /// ```ignore,no_run
2641    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2642    /// use google_cloud_developerconnect_v1::model::UserCredential;
2643    /// let x = GitLabEnterpriseConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2644    /// ```
2645    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2646    where
2647        T: std::convert::Into<crate::model::UserCredential>,
2648    {
2649        self.read_authorizer_credential = std::option::Option::Some(v.into());
2650        self
2651    }
2652
2653    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2654    ///
2655    /// # Example
2656    /// ```ignore,no_run
2657    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2658    /// use google_cloud_developerconnect_v1::model::UserCredential;
2659    /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2660    /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2661    /// ```
2662    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2663    where
2664        T: std::convert::Into<crate::model::UserCredential>,
2665    {
2666        self.read_authorizer_credential = v.map(|x| x.into());
2667        self
2668    }
2669
2670    /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2671    ///
2672    /// # Example
2673    /// ```ignore,no_run
2674    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2675    /// use google_cloud_developerconnect_v1::model::UserCredential;
2676    /// let x = GitLabEnterpriseConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2677    /// ```
2678    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2679    where
2680        T: std::convert::Into<crate::model::UserCredential>,
2681    {
2682        self.authorizer_credential = std::option::Option::Some(v.into());
2683        self
2684    }
2685
2686    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2687    ///
2688    /// # Example
2689    /// ```ignore,no_run
2690    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2691    /// use google_cloud_developerconnect_v1::model::UserCredential;
2692    /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2693    /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2694    /// ```
2695    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2696    where
2697        T: std::convert::Into<crate::model::UserCredential>,
2698    {
2699        self.authorizer_credential = v.map(|x| x.into());
2700        self
2701    }
2702
2703    /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2704    ///
2705    /// # Example
2706    /// ```ignore,no_run
2707    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2708    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2709    /// let x = GitLabEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2710    /// ```
2711    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2712    where
2713        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2714    {
2715        self.service_directory_config = std::option::Option::Some(v.into());
2716        self
2717    }
2718
2719    /// Sets or clears the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2720    ///
2721    /// # Example
2722    /// ```ignore,no_run
2723    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2724    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2725    /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2726    /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2727    /// ```
2728    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2729    where
2730        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2731    {
2732        self.service_directory_config = v.map(|x| x.into());
2733        self
2734    }
2735
2736    /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
2737    ///
2738    /// # Example
2739    /// ```ignore,no_run
2740    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2741    /// let x = GitLabEnterpriseConfig::new().set_ssl_ca_certificate("example");
2742    /// ```
2743    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2744        mut self,
2745        v: T,
2746    ) -> Self {
2747        self.ssl_ca_certificate = v.into();
2748        self
2749    }
2750
2751    /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
2752    ///
2753    /// # Example
2754    /// ```ignore,no_run
2755    /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2756    /// let x = GitLabEnterpriseConfig::new().set_server_version("example");
2757    /// ```
2758    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2759        self.server_version = v.into();
2760        self
2761    }
2762}
2763
2764impl wkt::message::Message for GitLabEnterpriseConfig {
2765    fn typename() -> &'static str {
2766        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
2767    }
2768}
2769
2770/// Configuration for connections to an instance of Bitbucket Data Center.
2771#[derive(Clone, Default, PartialEq)]
2772#[non_exhaustive]
2773pub struct BitbucketDataCenterConfig {
2774    /// Required. The URI of the Bitbucket Data Center host this connection is for.
2775    pub host_uri: std::string::String,
2776
2777    /// Required. Immutable. SecretManager resource containing the webhook secret
2778    /// used to verify webhook events, formatted as
2779    /// `projects/*/secrets/*/versions/*` or
2780    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2781    /// supported in that location). This is used to validate webhooks.
2782    pub webhook_secret_secret_version: std::string::String,
2783
2784    /// Required. An http access token with the minimum `Repository read` access.
2785    /// It's recommended to use a system account to generate the credentials.
2786    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2787
2788    /// Required. An http access token with the minimum `Repository admin` scope
2789    /// access. This is needed to create webhooks. It's recommended to use a system
2790    /// account to generate these credentials.
2791    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2792
2793    /// Optional. Configuration for using Service Directory to privately connect to
2794    /// a Bitbucket Data Center instance. This should only be set if the Bitbucket
2795    /// Data Center is hosted on-premises and not reachable by public internet. If
2796    /// this field is left empty, calls to the Bitbucket Data Center will be made
2797    /// over the public internet.
2798    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2799
2800    /// Optional. SSL certificate authority to trust when making requests to
2801    /// Bitbucket Data Center.
2802    pub ssl_ca_certificate: std::string::String,
2803
2804    /// Output only. Version of the Bitbucket Data Center server running on the
2805    /// `host_uri`.
2806    pub server_version: std::string::String,
2807
2808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2809}
2810
2811impl BitbucketDataCenterConfig {
2812    /// Creates a new default instance.
2813    pub fn new() -> Self {
2814        std::default::Default::default()
2815    }
2816
2817    /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
2818    ///
2819    /// # Example
2820    /// ```ignore,no_run
2821    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2822    /// let x = BitbucketDataCenterConfig::new().set_host_uri("example");
2823    /// ```
2824    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2825        self.host_uri = v.into();
2826        self
2827    }
2828
2829    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
2830    ///
2831    /// # Example
2832    /// ```ignore,no_run
2833    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2834    /// let x = BitbucketDataCenterConfig::new().set_webhook_secret_secret_version("example");
2835    /// ```
2836    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2837        mut self,
2838        v: T,
2839    ) -> Self {
2840        self.webhook_secret_secret_version = v.into();
2841        self
2842    }
2843
2844    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2845    ///
2846    /// # Example
2847    /// ```ignore,no_run
2848    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2849    /// use google_cloud_developerconnect_v1::model::UserCredential;
2850    /// let x = BitbucketDataCenterConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2851    /// ```
2852    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2853    where
2854        T: std::convert::Into<crate::model::UserCredential>,
2855    {
2856        self.read_authorizer_credential = std::option::Option::Some(v.into());
2857        self
2858    }
2859
2860    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2861    ///
2862    /// # Example
2863    /// ```ignore,no_run
2864    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2865    /// use google_cloud_developerconnect_v1::model::UserCredential;
2866    /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2867    /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2868    /// ```
2869    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2870    where
2871        T: std::convert::Into<crate::model::UserCredential>,
2872    {
2873        self.read_authorizer_credential = v.map(|x| x.into());
2874        self
2875    }
2876
2877    /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2878    ///
2879    /// # Example
2880    /// ```ignore,no_run
2881    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2882    /// use google_cloud_developerconnect_v1::model::UserCredential;
2883    /// let x = BitbucketDataCenterConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2884    /// ```
2885    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2886    where
2887        T: std::convert::Into<crate::model::UserCredential>,
2888    {
2889        self.authorizer_credential = std::option::Option::Some(v.into());
2890        self
2891    }
2892
2893    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2894    ///
2895    /// # Example
2896    /// ```ignore,no_run
2897    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2898    /// use google_cloud_developerconnect_v1::model::UserCredential;
2899    /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2900    /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2901    /// ```
2902    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2903    where
2904        T: std::convert::Into<crate::model::UserCredential>,
2905    {
2906        self.authorizer_credential = v.map(|x| x.into());
2907        self
2908    }
2909
2910    /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2911    ///
2912    /// # Example
2913    /// ```ignore,no_run
2914    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2915    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2916    /// let x = BitbucketDataCenterConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2917    /// ```
2918    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2919    where
2920        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2921    {
2922        self.service_directory_config = std::option::Option::Some(v.into());
2923        self
2924    }
2925
2926    /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2927    ///
2928    /// # Example
2929    /// ```ignore,no_run
2930    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2931    /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2932    /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2933    /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2934    /// ```
2935    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2936    where
2937        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2938    {
2939        self.service_directory_config = v.map(|x| x.into());
2940        self
2941    }
2942
2943    /// Sets the value of [ssl_ca_certificate][crate::model::BitbucketDataCenterConfig::ssl_ca_certificate].
2944    ///
2945    /// # Example
2946    /// ```ignore,no_run
2947    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2948    /// let x = BitbucketDataCenterConfig::new().set_ssl_ca_certificate("example");
2949    /// ```
2950    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2951        mut self,
2952        v: T,
2953    ) -> Self {
2954        self.ssl_ca_certificate = v.into();
2955        self
2956    }
2957
2958    /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
2959    ///
2960    /// # Example
2961    /// ```ignore,no_run
2962    /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2963    /// let x = BitbucketDataCenterConfig::new().set_server_version("example");
2964    /// ```
2965    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2966        self.server_version = v.into();
2967        self
2968    }
2969}
2970
2971impl wkt::message::Message for BitbucketDataCenterConfig {
2972    fn typename() -> &'static str {
2973        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
2974    }
2975}
2976
2977/// Configuration for connections to an instance of Bitbucket Cloud.
2978#[derive(Clone, Default, PartialEq)]
2979#[non_exhaustive]
2980pub struct BitbucketCloudConfig {
2981    /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
2982    /// Platform.
2983    pub workspace: std::string::String,
2984
2985    /// Required. Immutable. SecretManager resource containing the webhook secret
2986    /// used to verify webhook events, formatted as
2987    /// `projects/*/secrets/*/versions/*` or
2988    /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2989    /// supported in that location). This is used to validate and create webhooks.
2990    pub webhook_secret_secret_version: std::string::String,
2991
2992    /// Required. An access token with the minimum `repository` access.
2993    /// It can either be a workspace, project or repository access token.
2994    /// It's recommended to use a system account to generate the credentials.
2995    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2996
2997    /// Required. An access token with the minimum `repository`, `pullrequest` and
2998    /// `webhook` scope access. It can either be a workspace, project or repository
2999    /// access token. This is needed to create webhooks. It's recommended to use a
3000    /// system account to generate these credentials.
3001    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3002
3003    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3004}
3005
3006impl BitbucketCloudConfig {
3007    /// Creates a new default instance.
3008    pub fn new() -> Self {
3009        std::default::Default::default()
3010    }
3011
3012    /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
3013    ///
3014    /// # Example
3015    /// ```ignore,no_run
3016    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3017    /// let x = BitbucketCloudConfig::new().set_workspace("example");
3018    /// ```
3019    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3020        self.workspace = v.into();
3021        self
3022    }
3023
3024    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
3025    ///
3026    /// # Example
3027    /// ```ignore,no_run
3028    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3029    /// let x = BitbucketCloudConfig::new().set_webhook_secret_secret_version("example");
3030    /// ```
3031    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3032        mut self,
3033        v: T,
3034    ) -> Self {
3035        self.webhook_secret_secret_version = v.into();
3036        self
3037    }
3038
3039    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3040    ///
3041    /// # Example
3042    /// ```ignore,no_run
3043    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3044    /// use google_cloud_developerconnect_v1::model::UserCredential;
3045    /// let x = BitbucketCloudConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
3046    /// ```
3047    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3048    where
3049        T: std::convert::Into<crate::model::UserCredential>,
3050    {
3051        self.read_authorizer_credential = std::option::Option::Some(v.into());
3052        self
3053    }
3054
3055    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3056    ///
3057    /// # Example
3058    /// ```ignore,no_run
3059    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3060    /// use google_cloud_developerconnect_v1::model::UserCredential;
3061    /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
3062    /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
3063    /// ```
3064    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3065    where
3066        T: std::convert::Into<crate::model::UserCredential>,
3067    {
3068        self.read_authorizer_credential = v.map(|x| x.into());
3069        self
3070    }
3071
3072    /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3073    ///
3074    /// # Example
3075    /// ```ignore,no_run
3076    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3077    /// use google_cloud_developerconnect_v1::model::UserCredential;
3078    /// let x = BitbucketCloudConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
3079    /// ```
3080    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3081    where
3082        T: std::convert::Into<crate::model::UserCredential>,
3083    {
3084        self.authorizer_credential = std::option::Option::Some(v.into());
3085        self
3086    }
3087
3088    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3089    ///
3090    /// # Example
3091    /// ```ignore,no_run
3092    /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3093    /// use google_cloud_developerconnect_v1::model::UserCredential;
3094    /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
3095    /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
3096    /// ```
3097    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3098    where
3099        T: std::convert::Into<crate::model::UserCredential>,
3100    {
3101        self.authorizer_credential = v.map(|x| x.into());
3102        self
3103    }
3104}
3105
3106impl wkt::message::Message for BitbucketCloudConfig {
3107    fn typename() -> &'static str {
3108        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
3109    }
3110}
3111
3112/// Configuration for connections to Secure Source Manager instance
3113#[derive(Clone, Default, PartialEq)]
3114#[non_exhaustive]
3115pub struct SecureSourceManagerInstanceConfig {
3116    /// Required. Immutable. Secure Source Manager instance resource, formatted as
3117    /// `projects/*/locations/*/instances/*`
3118    pub instance: std::string::String,
3119
3120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3121}
3122
3123impl SecureSourceManagerInstanceConfig {
3124    /// Creates a new default instance.
3125    pub fn new() -> Self {
3126        std::default::Default::default()
3127    }
3128
3129    /// Sets the value of [instance][crate::model::SecureSourceManagerInstanceConfig::instance].
3130    ///
3131    /// # Example
3132    /// ```ignore,no_run
3133    /// # use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
3134    /// let x = SecureSourceManagerInstanceConfig::new().set_instance("example");
3135    /// ```
3136    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3137        self.instance = v.into();
3138        self
3139    }
3140}
3141
3142impl wkt::message::Message for SecureSourceManagerInstanceConfig {
3143    fn typename() -> &'static str {
3144        "type.googleapis.com/google.cloud.developerconnect.v1.SecureSourceManagerInstanceConfig"
3145    }
3146}
3147
3148/// Message for requesting list of Connections
3149#[derive(Clone, Default, PartialEq)]
3150#[non_exhaustive]
3151pub struct ListConnectionsRequest {
3152    /// Required. Parent value for ListConnectionsRequest
3153    pub parent: std::string::String,
3154
3155    /// Optional. Requested page size. Server may return fewer items than
3156    /// requested. If unspecified, server will pick an appropriate default.
3157    pub page_size: i32,
3158
3159    /// Optional. A token identifying a page of results the server should return.
3160    pub page_token: std::string::String,
3161
3162    /// Optional. Filtering results
3163    pub filter: std::string::String,
3164
3165    /// Optional. Hint for how to order the results
3166    pub order_by: std::string::String,
3167
3168    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3169}
3170
3171impl ListConnectionsRequest {
3172    /// Creates a new default instance.
3173    pub fn new() -> Self {
3174        std::default::Default::default()
3175    }
3176
3177    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
3178    ///
3179    /// # Example
3180    /// ```ignore,no_run
3181    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3182    /// # let project_id = "project_id";
3183    /// # let location_id = "location_id";
3184    /// let x = ListConnectionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3185    /// ```
3186    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3187        self.parent = v.into();
3188        self
3189    }
3190
3191    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
3192    ///
3193    /// # Example
3194    /// ```ignore,no_run
3195    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3196    /// let x = ListConnectionsRequest::new().set_page_size(42);
3197    /// ```
3198    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3199        self.page_size = v.into();
3200        self
3201    }
3202
3203    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
3204    ///
3205    /// # Example
3206    /// ```ignore,no_run
3207    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3208    /// let x = ListConnectionsRequest::new().set_page_token("example");
3209    /// ```
3210    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3211        self.page_token = v.into();
3212        self
3213    }
3214
3215    /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
3216    ///
3217    /// # Example
3218    /// ```ignore,no_run
3219    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3220    /// let x = ListConnectionsRequest::new().set_filter("example");
3221    /// ```
3222    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3223        self.filter = v.into();
3224        self
3225    }
3226
3227    /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
3228    ///
3229    /// # Example
3230    /// ```ignore,no_run
3231    /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3232    /// let x = ListConnectionsRequest::new().set_order_by("example");
3233    /// ```
3234    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3235        self.order_by = v.into();
3236        self
3237    }
3238}
3239
3240impl wkt::message::Message for ListConnectionsRequest {
3241    fn typename() -> &'static str {
3242        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
3243    }
3244}
3245
3246/// Message for response to listing Connections
3247#[derive(Clone, Default, PartialEq)]
3248#[non_exhaustive]
3249pub struct ListConnectionsResponse {
3250    /// The list of Connection
3251    pub connections: std::vec::Vec<crate::model::Connection>,
3252
3253    /// A token identifying a page of results the server should return.
3254    pub next_page_token: std::string::String,
3255
3256    /// Locations that could not be reached.
3257    pub unreachable: std::vec::Vec<std::string::String>,
3258
3259    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3260}
3261
3262impl ListConnectionsResponse {
3263    /// Creates a new default instance.
3264    pub fn new() -> Self {
3265        std::default::Default::default()
3266    }
3267
3268    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
3269    ///
3270    /// # Example
3271    /// ```ignore,no_run
3272    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3273    /// use google_cloud_developerconnect_v1::model::Connection;
3274    /// let x = ListConnectionsResponse::new()
3275    ///     .set_connections([
3276    ///         Connection::default()/* use setters */,
3277    ///         Connection::default()/* use (different) setters */,
3278    ///     ]);
3279    /// ```
3280    pub fn set_connections<T, V>(mut self, v: T) -> Self
3281    where
3282        T: std::iter::IntoIterator<Item = V>,
3283        V: std::convert::Into<crate::model::Connection>,
3284    {
3285        use std::iter::Iterator;
3286        self.connections = v.into_iter().map(|i| i.into()).collect();
3287        self
3288    }
3289
3290    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
3291    ///
3292    /// # Example
3293    /// ```ignore,no_run
3294    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3295    /// let x = ListConnectionsResponse::new().set_next_page_token("example");
3296    /// ```
3297    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3298        self.next_page_token = v.into();
3299        self
3300    }
3301
3302    /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
3303    ///
3304    /// # Example
3305    /// ```ignore,no_run
3306    /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3307    /// let x = ListConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3308    /// ```
3309    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3310    where
3311        T: std::iter::IntoIterator<Item = V>,
3312        V: std::convert::Into<std::string::String>,
3313    {
3314        use std::iter::Iterator;
3315        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3316        self
3317    }
3318}
3319
3320impl wkt::message::Message for ListConnectionsResponse {
3321    fn typename() -> &'static str {
3322        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
3323    }
3324}
3325
3326#[doc(hidden)]
3327impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
3328    type PageItem = crate::model::Connection;
3329
3330    fn items(self) -> std::vec::Vec<Self::PageItem> {
3331        self.connections
3332    }
3333
3334    fn next_page_token(&self) -> std::string::String {
3335        use std::clone::Clone;
3336        self.next_page_token.clone()
3337    }
3338}
3339
3340/// Message for getting a Connection
3341#[derive(Clone, Default, PartialEq)]
3342#[non_exhaustive]
3343pub struct GetConnectionRequest {
3344    /// Required. Name of the resource
3345    pub name: std::string::String,
3346
3347    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3348}
3349
3350impl GetConnectionRequest {
3351    /// Creates a new default instance.
3352    pub fn new() -> Self {
3353        std::default::Default::default()
3354    }
3355
3356    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
3357    ///
3358    /// # Example
3359    /// ```ignore,no_run
3360    /// # use google_cloud_developerconnect_v1::model::GetConnectionRequest;
3361    /// # let project_id = "project_id";
3362    /// # let location_id = "location_id";
3363    /// # let connection_id = "connection_id";
3364    /// let x = GetConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
3365    /// ```
3366    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3367        self.name = v.into();
3368        self
3369    }
3370}
3371
3372impl wkt::message::Message for GetConnectionRequest {
3373    fn typename() -> &'static str {
3374        "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
3375    }
3376}
3377
3378/// Message for creating a Connection
3379#[derive(Clone, Default, PartialEq)]
3380#[non_exhaustive]
3381pub struct CreateConnectionRequest {
3382    /// Required. Value for parent.
3383    pub parent: std::string::String,
3384
3385    /// Required. Id of the requesting object
3386    /// If auto-generating Id server-side, remove this field and
3387    /// connection_id from the method_signature of Create RPC
3388    pub connection_id: std::string::String,
3389
3390    /// Required. The resource being created
3391    pub connection: std::option::Option<crate::model::Connection>,
3392
3393    /// Optional. An optional request ID to identify requests. Specify a unique
3394    /// request ID so that if you must retry your request, the server will know to
3395    /// ignore the request if it has already been completed. The server will
3396    /// guarantee that for at least 60 minutes since the first request.
3397    ///
3398    /// For example, consider a situation where you make an initial request and the
3399    /// request times out. If you make the request again with the same request
3400    /// ID, the server can check if original operation with the same request ID
3401    /// was received, and if so, will ignore the second request. This prevents
3402    /// clients from accidentally creating duplicate commitments.
3403    ///
3404    /// The request ID must be a valid UUID with the exception that zero UUID is
3405    /// not supported (00000000-0000-0000-0000-000000000000).
3406    pub request_id: std::string::String,
3407
3408    /// Optional. If set, validate the request, but do not actually post it.
3409    pub validate_only: bool,
3410
3411    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3412}
3413
3414impl CreateConnectionRequest {
3415    /// Creates a new default instance.
3416    pub fn new() -> Self {
3417        std::default::Default::default()
3418    }
3419
3420    /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
3421    ///
3422    /// # Example
3423    /// ```ignore,no_run
3424    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3425    /// # let project_id = "project_id";
3426    /// # let location_id = "location_id";
3427    /// let x = CreateConnectionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3428    /// ```
3429    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3430        self.parent = v.into();
3431        self
3432    }
3433
3434    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
3435    ///
3436    /// # Example
3437    /// ```ignore,no_run
3438    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3439    /// let x = CreateConnectionRequest::new().set_connection_id("example");
3440    /// ```
3441    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3442        self.connection_id = v.into();
3443        self
3444    }
3445
3446    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
3447    ///
3448    /// # Example
3449    /// ```ignore,no_run
3450    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3451    /// use google_cloud_developerconnect_v1::model::Connection;
3452    /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3453    /// ```
3454    pub fn set_connection<T>(mut self, v: T) -> Self
3455    where
3456        T: std::convert::Into<crate::model::Connection>,
3457    {
3458        self.connection = std::option::Option::Some(v.into());
3459        self
3460    }
3461
3462    /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
3463    ///
3464    /// # Example
3465    /// ```ignore,no_run
3466    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3467    /// use google_cloud_developerconnect_v1::model::Connection;
3468    /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3469    /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3470    /// ```
3471    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3472    where
3473        T: std::convert::Into<crate::model::Connection>,
3474    {
3475        self.connection = v.map(|x| x.into());
3476        self
3477    }
3478
3479    /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
3480    ///
3481    /// # Example
3482    /// ```ignore,no_run
3483    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3484    /// let x = CreateConnectionRequest::new().set_request_id("example");
3485    /// ```
3486    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3487        self.request_id = v.into();
3488        self
3489    }
3490
3491    /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
3492    ///
3493    /// # Example
3494    /// ```ignore,no_run
3495    /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3496    /// let x = CreateConnectionRequest::new().set_validate_only(true);
3497    /// ```
3498    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3499        self.validate_only = v.into();
3500        self
3501    }
3502}
3503
3504impl wkt::message::Message for CreateConnectionRequest {
3505    fn typename() -> &'static str {
3506        "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
3507    }
3508}
3509
3510/// Message for updating a Connection
3511#[derive(Clone, Default, PartialEq)]
3512#[non_exhaustive]
3513pub struct UpdateConnectionRequest {
3514    /// Required. Field mask is used to specify the fields to be overwritten in the
3515    /// Connection resource by the update.
3516    /// The fields specified in the update_mask are relative to the resource, not
3517    /// the full request. A field will be overwritten if it is in the mask. If the
3518    /// user does not provide a mask then all fields will be overwritten.
3519    pub update_mask: std::option::Option<wkt::FieldMask>,
3520
3521    /// Required. The resource being updated
3522    pub connection: std::option::Option<crate::model::Connection>,
3523
3524    /// Optional. An optional request ID to identify requests. Specify a unique
3525    /// request ID so that if you must retry your request, the server will know to
3526    /// ignore the request if it has already been completed. The server will
3527    /// guarantee that for at least 60 minutes since the first request.
3528    ///
3529    /// For example, consider a situation where you make an initial request and the
3530    /// request times out. If you make the request again with the same request
3531    /// ID, the server can check if original operation with the same request ID
3532    /// was received, and if so, will ignore the second request. This prevents
3533    /// clients from accidentally creating duplicate commitments.
3534    ///
3535    /// The request ID must be a valid UUID with the exception that zero UUID is
3536    /// not supported (00000000-0000-0000-0000-000000000000).
3537    pub request_id: std::string::String,
3538
3539    /// Optional. If set to true, and the connection is not found a new connection
3540    /// will be created. In this situation `update_mask` is ignored.
3541    /// The creation will succeed only if the input connection has all the
3542    /// necessary information (e.g a github_config with both  user_oauth_token and
3543    /// installation_id properties).
3544    pub allow_missing: bool,
3545
3546    /// Optional. If set, validate the request, but do not actually post it.
3547    pub validate_only: bool,
3548
3549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3550}
3551
3552impl UpdateConnectionRequest {
3553    /// Creates a new default instance.
3554    pub fn new() -> Self {
3555        std::default::Default::default()
3556    }
3557
3558    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3559    ///
3560    /// # Example
3561    /// ```ignore,no_run
3562    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3563    /// use wkt::FieldMask;
3564    /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3565    /// ```
3566    pub fn set_update_mask<T>(mut self, v: T) -> Self
3567    where
3568        T: std::convert::Into<wkt::FieldMask>,
3569    {
3570        self.update_mask = std::option::Option::Some(v.into());
3571        self
3572    }
3573
3574    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3575    ///
3576    /// # Example
3577    /// ```ignore,no_run
3578    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3579    /// use wkt::FieldMask;
3580    /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3581    /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3582    /// ```
3583    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3584    where
3585        T: std::convert::Into<wkt::FieldMask>,
3586    {
3587        self.update_mask = v.map(|x| x.into());
3588        self
3589    }
3590
3591    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
3592    ///
3593    /// # Example
3594    /// ```ignore,no_run
3595    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3596    /// use google_cloud_developerconnect_v1::model::Connection;
3597    /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3598    /// ```
3599    pub fn set_connection<T>(mut self, v: T) -> Self
3600    where
3601        T: std::convert::Into<crate::model::Connection>,
3602    {
3603        self.connection = std::option::Option::Some(v.into());
3604        self
3605    }
3606
3607    /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
3608    ///
3609    /// # Example
3610    /// ```ignore,no_run
3611    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3612    /// use google_cloud_developerconnect_v1::model::Connection;
3613    /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3614    /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3615    /// ```
3616    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3617    where
3618        T: std::convert::Into<crate::model::Connection>,
3619    {
3620        self.connection = v.map(|x| x.into());
3621        self
3622    }
3623
3624    /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
3625    ///
3626    /// # Example
3627    /// ```ignore,no_run
3628    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3629    /// let x = UpdateConnectionRequest::new().set_request_id("example");
3630    /// ```
3631    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3632        self.request_id = v.into();
3633        self
3634    }
3635
3636    /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
3637    ///
3638    /// # Example
3639    /// ```ignore,no_run
3640    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3641    /// let x = UpdateConnectionRequest::new().set_allow_missing(true);
3642    /// ```
3643    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3644        self.allow_missing = v.into();
3645        self
3646    }
3647
3648    /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
3649    ///
3650    /// # Example
3651    /// ```ignore,no_run
3652    /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3653    /// let x = UpdateConnectionRequest::new().set_validate_only(true);
3654    /// ```
3655    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3656        self.validate_only = v.into();
3657        self
3658    }
3659}
3660
3661impl wkt::message::Message for UpdateConnectionRequest {
3662    fn typename() -> &'static str {
3663        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
3664    }
3665}
3666
3667/// Message for deleting a Connection
3668#[derive(Clone, Default, PartialEq)]
3669#[non_exhaustive]
3670pub struct DeleteConnectionRequest {
3671    /// Required. Name of the resource
3672    pub name: std::string::String,
3673
3674    /// Optional. An optional request ID to identify requests. Specify a unique
3675    /// request ID so that if you must retry your request, the server will know to
3676    /// ignore the request if it has already been completed. The server will
3677    /// guarantee that for at least 60 minutes after the first request.
3678    ///
3679    /// For example, consider a situation where you make an initial request and the
3680    /// request times out. If you make the request again with the same request
3681    /// ID, the server can check if original operation with the same request ID
3682    /// was received, and if so, will ignore the second request. This prevents
3683    /// clients from accidentally creating duplicate commitments.
3684    ///
3685    /// The request ID must be a valid UUID with the exception that zero UUID is
3686    /// not supported (00000000-0000-0000-0000-000000000000).
3687    pub request_id: std::string::String,
3688
3689    /// Optional. If set, validate the request, but do not actually post it.
3690    pub validate_only: bool,
3691
3692    /// Optional. The current etag of the Connection.
3693    /// If an etag is provided and does not match the current etag of the
3694    /// Connection, deletion will be blocked and an ABORTED error will be returned.
3695    pub etag: std::string::String,
3696
3697    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3698}
3699
3700impl DeleteConnectionRequest {
3701    /// Creates a new default instance.
3702    pub fn new() -> Self {
3703        std::default::Default::default()
3704    }
3705
3706    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
3707    ///
3708    /// # Example
3709    /// ```ignore,no_run
3710    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3711    /// # let project_id = "project_id";
3712    /// # let location_id = "location_id";
3713    /// # let connection_id = "connection_id";
3714    /// let x = DeleteConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
3715    /// ```
3716    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3717        self.name = v.into();
3718        self
3719    }
3720
3721    /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
3722    ///
3723    /// # Example
3724    /// ```ignore,no_run
3725    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3726    /// let x = DeleteConnectionRequest::new().set_request_id("example");
3727    /// ```
3728    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3729        self.request_id = v.into();
3730        self
3731    }
3732
3733    /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
3734    ///
3735    /// # Example
3736    /// ```ignore,no_run
3737    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3738    /// let x = DeleteConnectionRequest::new().set_validate_only(true);
3739    /// ```
3740    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3741        self.validate_only = v.into();
3742        self
3743    }
3744
3745    /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
3746    ///
3747    /// # Example
3748    /// ```ignore,no_run
3749    /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3750    /// let x = DeleteConnectionRequest::new().set_etag("example");
3751    /// ```
3752    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3753        self.etag = v.into();
3754        self
3755    }
3756}
3757
3758impl wkt::message::Message for DeleteConnectionRequest {
3759    fn typename() -> &'static str {
3760        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
3761    }
3762}
3763
3764/// Message for requesting list of AccountConnectors
3765#[derive(Clone, Default, PartialEq)]
3766#[non_exhaustive]
3767pub struct ListAccountConnectorsRequest {
3768    /// Required. Parent value for ListAccountConnectorsRequest
3769    pub parent: std::string::String,
3770
3771    /// Optional. Requested page size. Server may return fewer items than
3772    /// requested. If unspecified, server will pick an appropriate default.
3773    pub page_size: i32,
3774
3775    /// Optional. A token identifying a page of results the server should return.
3776    pub page_token: std::string::String,
3777
3778    /// Optional. Filtering results
3779    pub filter: std::string::String,
3780
3781    /// Optional. Hint for how to order the results
3782    pub order_by: std::string::String,
3783
3784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3785}
3786
3787impl ListAccountConnectorsRequest {
3788    /// Creates a new default instance.
3789    pub fn new() -> Self {
3790        std::default::Default::default()
3791    }
3792
3793    /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
3794    ///
3795    /// # Example
3796    /// ```ignore,no_run
3797    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3798    /// # let project_id = "project_id";
3799    /// # let location_id = "location_id";
3800    /// let x = ListAccountConnectorsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3801    /// ```
3802    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3803        self.parent = v.into();
3804        self
3805    }
3806
3807    /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
3808    ///
3809    /// # Example
3810    /// ```ignore,no_run
3811    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3812    /// let x = ListAccountConnectorsRequest::new().set_page_size(42);
3813    /// ```
3814    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3815        self.page_size = v.into();
3816        self
3817    }
3818
3819    /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
3820    ///
3821    /// # Example
3822    /// ```ignore,no_run
3823    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3824    /// let x = ListAccountConnectorsRequest::new().set_page_token("example");
3825    /// ```
3826    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3827        self.page_token = v.into();
3828        self
3829    }
3830
3831    /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
3832    ///
3833    /// # Example
3834    /// ```ignore,no_run
3835    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3836    /// let x = ListAccountConnectorsRequest::new().set_filter("example");
3837    /// ```
3838    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3839        self.filter = v.into();
3840        self
3841    }
3842
3843    /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
3844    ///
3845    /// # Example
3846    /// ```ignore,no_run
3847    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3848    /// let x = ListAccountConnectorsRequest::new().set_order_by("example");
3849    /// ```
3850    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3851        self.order_by = v.into();
3852        self
3853    }
3854}
3855
3856impl wkt::message::Message for ListAccountConnectorsRequest {
3857    fn typename() -> &'static str {
3858        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
3859    }
3860}
3861
3862/// Message for response to listing AccountConnectors
3863#[derive(Clone, Default, PartialEq)]
3864#[non_exhaustive]
3865pub struct ListAccountConnectorsResponse {
3866    /// The list of AccountConnectors
3867    pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
3868
3869    /// A token identifying a page of results the server should return.
3870    pub next_page_token: std::string::String,
3871
3872    /// Locations that could not be reached.
3873    pub unreachable: std::vec::Vec<std::string::String>,
3874
3875    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3876}
3877
3878impl ListAccountConnectorsResponse {
3879    /// Creates a new default instance.
3880    pub fn new() -> Self {
3881        std::default::Default::default()
3882    }
3883
3884    /// Sets the value of [account_connectors][crate::model::ListAccountConnectorsResponse::account_connectors].
3885    ///
3886    /// # Example
3887    /// ```ignore,no_run
3888    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3889    /// use google_cloud_developerconnect_v1::model::AccountConnector;
3890    /// let x = ListAccountConnectorsResponse::new()
3891    ///     .set_account_connectors([
3892    ///         AccountConnector::default()/* use setters */,
3893    ///         AccountConnector::default()/* use (different) setters */,
3894    ///     ]);
3895    /// ```
3896    pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
3897    where
3898        T: std::iter::IntoIterator<Item = V>,
3899        V: std::convert::Into<crate::model::AccountConnector>,
3900    {
3901        use std::iter::Iterator;
3902        self.account_connectors = v.into_iter().map(|i| i.into()).collect();
3903        self
3904    }
3905
3906    /// Sets the value of [next_page_token][crate::model::ListAccountConnectorsResponse::next_page_token].
3907    ///
3908    /// # Example
3909    /// ```ignore,no_run
3910    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3911    /// let x = ListAccountConnectorsResponse::new().set_next_page_token("example");
3912    /// ```
3913    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3914        self.next_page_token = v.into();
3915        self
3916    }
3917
3918    /// Sets the value of [unreachable][crate::model::ListAccountConnectorsResponse::unreachable].
3919    ///
3920    /// # Example
3921    /// ```ignore,no_run
3922    /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3923    /// let x = ListAccountConnectorsResponse::new().set_unreachable(["a", "b", "c"]);
3924    /// ```
3925    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3926    where
3927        T: std::iter::IntoIterator<Item = V>,
3928        V: std::convert::Into<std::string::String>,
3929    {
3930        use std::iter::Iterator;
3931        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3932        self
3933    }
3934}
3935
3936impl wkt::message::Message for ListAccountConnectorsResponse {
3937    fn typename() -> &'static str {
3938        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
3939    }
3940}
3941
3942#[doc(hidden)]
3943impl google_cloud_gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
3944    type PageItem = crate::model::AccountConnector;
3945
3946    fn items(self) -> std::vec::Vec<Self::PageItem> {
3947        self.account_connectors
3948    }
3949
3950    fn next_page_token(&self) -> std::string::String {
3951        use std::clone::Clone;
3952        self.next_page_token.clone()
3953    }
3954}
3955
3956/// Message for getting a AccountConnector
3957#[derive(Clone, Default, PartialEq)]
3958#[non_exhaustive]
3959pub struct GetAccountConnectorRequest {
3960    /// Required. Name of the resource
3961    pub name: std::string::String,
3962
3963    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3964}
3965
3966impl GetAccountConnectorRequest {
3967    /// Creates a new default instance.
3968    pub fn new() -> Self {
3969        std::default::Default::default()
3970    }
3971
3972    /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
3973    ///
3974    /// # Example
3975    /// ```ignore,no_run
3976    /// # use google_cloud_developerconnect_v1::model::GetAccountConnectorRequest;
3977    /// # let project_id = "project_id";
3978    /// # let location_id = "location_id";
3979    /// # let account_connector_id = "account_connector_id";
3980    /// let x = GetAccountConnectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
3981    /// ```
3982    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3983        self.name = v.into();
3984        self
3985    }
3986}
3987
3988impl wkt::message::Message for GetAccountConnectorRequest {
3989    fn typename() -> &'static str {
3990        "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
3991    }
3992}
3993
3994#[allow(missing_docs)]
3995#[derive(Clone, Default, PartialEq)]
3996#[non_exhaustive]
3997pub struct CreateAccountConnectorRequest {
3998    /// Required. Location resource name as the account_connector’s parent.
3999    pub parent: std::string::String,
4000
4001    /// Required. The ID to use for the AccountConnector, which will become the
4002    /// final component of the AccountConnector's resource name. Its format should
4003    /// adhere to <https://google.aip.dev/122#resource-id-segments> Names must be
4004    /// unique per-project per-location.
4005    pub account_connector_id: std::string::String,
4006
4007    /// Required. The AccountConnector to create.
4008    pub account_connector: std::option::Option<crate::model::AccountConnector>,
4009
4010    /// Optional. An optional request ID to identify requests. Specify a unique
4011    /// request ID so that if you must retry your request, the server will know to
4012    /// ignore the request if it has already been completed. The server will
4013    /// guarantee that for at least 60 minutes since the first request.
4014    ///
4015    /// For example, consider a situation where you make an initial request and the
4016    /// request times out. If you make the request again with the same request
4017    /// ID, the server can check if original operation with the same request ID
4018    /// was received, and if so, will ignore the second request. This prevents
4019    /// clients from accidentally creating duplicate commitments.
4020    ///
4021    /// The request ID must be a valid UUID with the exception that zero UUID is
4022    /// not supported (00000000-0000-0000-0000-000000000000).
4023    pub request_id: std::string::String,
4024
4025    /// Optional. If set, validate the request, but do not actually post it.
4026    pub validate_only: bool,
4027
4028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4029}
4030
4031impl CreateAccountConnectorRequest {
4032    /// Creates a new default instance.
4033    pub fn new() -> Self {
4034        std::default::Default::default()
4035    }
4036
4037    /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
4038    ///
4039    /// # Example
4040    /// ```ignore,no_run
4041    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4042    /// # let project_id = "project_id";
4043    /// # let location_id = "location_id";
4044    /// let x = CreateAccountConnectorRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4045    /// ```
4046    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4047        self.parent = v.into();
4048        self
4049    }
4050
4051    /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
4052    ///
4053    /// # Example
4054    /// ```ignore,no_run
4055    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4056    /// let x = CreateAccountConnectorRequest::new().set_account_connector_id("example");
4057    /// ```
4058    pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
4059        mut self,
4060        v: T,
4061    ) -> Self {
4062        self.account_connector_id = v.into();
4063        self
4064    }
4065
4066    /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4067    ///
4068    /// # Example
4069    /// ```ignore,no_run
4070    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4071    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4072    /// let x = CreateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4073    /// ```
4074    pub fn set_account_connector<T>(mut self, v: T) -> Self
4075    where
4076        T: std::convert::Into<crate::model::AccountConnector>,
4077    {
4078        self.account_connector = std::option::Option::Some(v.into());
4079        self
4080    }
4081
4082    /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4083    ///
4084    /// # Example
4085    /// ```ignore,no_run
4086    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4087    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4088    /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4089    /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4090    /// ```
4091    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4092    where
4093        T: std::convert::Into<crate::model::AccountConnector>,
4094    {
4095        self.account_connector = v.map(|x| x.into());
4096        self
4097    }
4098
4099    /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
4100    ///
4101    /// # Example
4102    /// ```ignore,no_run
4103    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4104    /// let x = CreateAccountConnectorRequest::new().set_request_id("example");
4105    /// ```
4106    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4107        self.request_id = v.into();
4108        self
4109    }
4110
4111    /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
4112    ///
4113    /// # Example
4114    /// ```ignore,no_run
4115    /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4116    /// let x = CreateAccountConnectorRequest::new().set_validate_only(true);
4117    /// ```
4118    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4119        self.validate_only = v.into();
4120        self
4121    }
4122}
4123
4124impl wkt::message::Message for CreateAccountConnectorRequest {
4125    fn typename() -> &'static str {
4126        "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
4127    }
4128}
4129
4130/// Message for updating a AccountConnector
4131#[derive(Clone, Default, PartialEq)]
4132#[non_exhaustive]
4133pub struct UpdateAccountConnectorRequest {
4134    /// Optional. The list of fields to be updated.
4135    pub update_mask: std::option::Option<wkt::FieldMask>,
4136
4137    /// Required. The AccountConnector to update.
4138    pub account_connector: std::option::Option<crate::model::AccountConnector>,
4139
4140    /// Optional. An optional request ID to identify requests. Specify a unique
4141    /// request ID so that if you must retry your request, the server will know to
4142    /// ignore the request if it has already been completed. The server will
4143    /// guarantee that for at least 60 minutes since the first request.
4144    ///
4145    /// For example, consider a situation where you make an initial request and the
4146    /// request times out. If you make the request again with the same request
4147    /// ID, the server can check if original operation with the same request ID
4148    /// was received, and if so, will ignore the second request. This prevents
4149    /// clients from accidentally creating duplicate commitments.
4150    ///
4151    /// The request ID must be a valid UUID with the exception that zero UUID is
4152    /// not supported (00000000-0000-0000-0000-000000000000).
4153    pub request_id: std::string::String,
4154
4155    /// Optional. If set to true, and the accountConnector is not found a new
4156    /// accountConnector will be created. In this situation `update_mask` is
4157    /// ignored. The creation will succeed only if the input accountConnector has
4158    /// all the necessary
4159    pub allow_missing: bool,
4160
4161    /// Optional. If set, validate the request, but do not actually post it.
4162    pub validate_only: bool,
4163
4164    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4165}
4166
4167impl UpdateAccountConnectorRequest {
4168    /// Creates a new default instance.
4169    pub fn new() -> Self {
4170        std::default::Default::default()
4171    }
4172
4173    /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4174    ///
4175    /// # Example
4176    /// ```ignore,no_run
4177    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4178    /// use wkt::FieldMask;
4179    /// let x = UpdateAccountConnectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4180    /// ```
4181    pub fn set_update_mask<T>(mut self, v: T) -> Self
4182    where
4183        T: std::convert::Into<wkt::FieldMask>,
4184    {
4185        self.update_mask = std::option::Option::Some(v.into());
4186        self
4187    }
4188
4189    /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4190    ///
4191    /// # Example
4192    /// ```ignore,no_run
4193    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4194    /// use wkt::FieldMask;
4195    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4196    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4197    /// ```
4198    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4199    where
4200        T: std::convert::Into<wkt::FieldMask>,
4201    {
4202        self.update_mask = v.map(|x| x.into());
4203        self
4204    }
4205
4206    /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4207    ///
4208    /// # Example
4209    /// ```ignore,no_run
4210    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4211    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4212    /// let x = UpdateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4213    /// ```
4214    pub fn set_account_connector<T>(mut self, v: T) -> Self
4215    where
4216        T: std::convert::Into<crate::model::AccountConnector>,
4217    {
4218        self.account_connector = std::option::Option::Some(v.into());
4219        self
4220    }
4221
4222    /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4223    ///
4224    /// # Example
4225    /// ```ignore,no_run
4226    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4227    /// use google_cloud_developerconnect_v1::model::AccountConnector;
4228    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4229    /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4230    /// ```
4231    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4232    where
4233        T: std::convert::Into<crate::model::AccountConnector>,
4234    {
4235        self.account_connector = v.map(|x| x.into());
4236        self
4237    }
4238
4239    /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
4240    ///
4241    /// # Example
4242    /// ```ignore,no_run
4243    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4244    /// let x = UpdateAccountConnectorRequest::new().set_request_id("example");
4245    /// ```
4246    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4247        self.request_id = v.into();
4248        self
4249    }
4250
4251    /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
4252    ///
4253    /// # Example
4254    /// ```ignore,no_run
4255    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4256    /// let x = UpdateAccountConnectorRequest::new().set_allow_missing(true);
4257    /// ```
4258    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4259        self.allow_missing = v.into();
4260        self
4261    }
4262
4263    /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
4264    ///
4265    /// # Example
4266    /// ```ignore,no_run
4267    /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4268    /// let x = UpdateAccountConnectorRequest::new().set_validate_only(true);
4269    /// ```
4270    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4271        self.validate_only = v.into();
4272        self
4273    }
4274}
4275
4276impl wkt::message::Message for UpdateAccountConnectorRequest {
4277    fn typename() -> &'static str {
4278        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
4279    }
4280}
4281
4282/// Message for deleting a AccountConnector
4283#[derive(Clone, Default, PartialEq)]
4284#[non_exhaustive]
4285pub struct DeleteAccountConnectorRequest {
4286    /// Required. Name of the resource
4287    pub name: std::string::String,
4288
4289    /// Optional. An optional request ID to identify requests. Specify a unique
4290    /// request ID so that if you must retry your request, the server will know to
4291    /// ignore the request if it has already been completed. The server will
4292    /// guarantee that for at least 60 minutes after the first request.
4293    ///
4294    /// For example, consider a situation where you make an initial request and the
4295    /// request times out. If you make the request again with the same request
4296    /// ID, the server can check if original operation with the same request ID
4297    /// was received, and if so, will ignore the second request. This prevents
4298    /// clients from accidentally creating duplicate commitments.
4299    ///
4300    /// The request ID must be a valid UUID with the exception that zero UUID is
4301    /// not supported (00000000-0000-0000-0000-000000000000).
4302    pub request_id: std::string::String,
4303
4304    /// Optional. If set, validate the request, but do not actually post it.
4305    pub validate_only: bool,
4306
4307    /// Optional. The current etag of the AccountConnectorn.
4308    /// If an etag is provided and does not match the current etag of the
4309    /// AccountConnector, deletion will be blocked and an ABORTED error will be
4310    /// returned.
4311    pub etag: std::string::String,
4312
4313    /// Optional. If set to true, any Users from this AccountConnector will also
4314    /// be deleted. (Otherwise, the request will only work if the AccountConnector
4315    /// has no Users.)
4316    pub force: bool,
4317
4318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4319}
4320
4321impl DeleteAccountConnectorRequest {
4322    /// Creates a new default instance.
4323    pub fn new() -> Self {
4324        std::default::Default::default()
4325    }
4326
4327    /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
4328    ///
4329    /// # Example
4330    /// ```ignore,no_run
4331    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4332    /// # let project_id = "project_id";
4333    /// # let location_id = "location_id";
4334    /// # let account_connector_id = "account_connector_id";
4335    /// let x = DeleteAccountConnectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4336    /// ```
4337    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4338        self.name = v.into();
4339        self
4340    }
4341
4342    /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
4343    ///
4344    /// # Example
4345    /// ```ignore,no_run
4346    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4347    /// let x = DeleteAccountConnectorRequest::new().set_request_id("example");
4348    /// ```
4349    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4350        self.request_id = v.into();
4351        self
4352    }
4353
4354    /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
4355    ///
4356    /// # Example
4357    /// ```ignore,no_run
4358    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4359    /// let x = DeleteAccountConnectorRequest::new().set_validate_only(true);
4360    /// ```
4361    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4362        self.validate_only = v.into();
4363        self
4364    }
4365
4366    /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
4367    ///
4368    /// # Example
4369    /// ```ignore,no_run
4370    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4371    /// let x = DeleteAccountConnectorRequest::new().set_etag("example");
4372    /// ```
4373    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4374        self.etag = v.into();
4375        self
4376    }
4377
4378    /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
4379    ///
4380    /// # Example
4381    /// ```ignore,no_run
4382    /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4383    /// let x = DeleteAccountConnectorRequest::new().set_force(true);
4384    /// ```
4385    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4386        self.force = v.into();
4387        self
4388    }
4389}
4390
4391impl wkt::message::Message for DeleteAccountConnectorRequest {
4392    fn typename() -> &'static str {
4393        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
4394    }
4395}
4396
4397/// Message for deleting a User
4398#[derive(Clone, Default, PartialEq)]
4399#[non_exhaustive]
4400pub struct DeleteUserRequest {
4401    /// Required. Name of the resource
4402    pub name: std::string::String,
4403
4404    /// Optional. An optional request ID to identify requests. Specify a unique
4405    /// request ID so that if you must retry your request, the server will know to
4406    /// ignore the request if it has already been completed. The server will
4407    /// guarantee that for at least 60 minutes after the first request.
4408    ///
4409    /// For example, consider a situation where you make an initial request and the
4410    /// request times out. If you make the request again with the same request
4411    /// ID, the server can check if original operation with the same request ID
4412    /// was received, and if so, will ignore the second request. This prevents
4413    /// clients from accidentally creating duplicate commitments.
4414    ///
4415    /// The request ID must be a valid UUID with the exception that zero UUID is
4416    /// not supported (00000000-0000-0000-0000-000000000000).
4417    pub request_id: std::string::String,
4418
4419    /// Optional. If set, validate the request, but do not actually post it.
4420    pub validate_only: bool,
4421
4422    /// Optional. This checksum is computed by the server based on the value of
4423    /// other fields, and may be sent on update and delete requests to ensure the
4424    /// client has an up-to-date value before proceeding.
4425    pub etag: std::string::String,
4426
4427    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4428}
4429
4430impl DeleteUserRequest {
4431    /// Creates a new default instance.
4432    pub fn new() -> Self {
4433        std::default::Default::default()
4434    }
4435
4436    /// Sets the value of [name][crate::model::DeleteUserRequest::name].
4437    ///
4438    /// # Example
4439    /// ```ignore,no_run
4440    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4441    /// # let project_id = "project_id";
4442    /// # let location_id = "location_id";
4443    /// # let account_connector_id = "account_connector_id";
4444    /// # let user_id = "user_id";
4445    /// let x = DeleteUserRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}/users/{user_id}"));
4446    /// ```
4447    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4448        self.name = v.into();
4449        self
4450    }
4451
4452    /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
4453    ///
4454    /// # Example
4455    /// ```ignore,no_run
4456    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4457    /// let x = DeleteUserRequest::new().set_request_id("example");
4458    /// ```
4459    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4460        self.request_id = v.into();
4461        self
4462    }
4463
4464    /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
4465    ///
4466    /// # Example
4467    /// ```ignore,no_run
4468    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4469    /// let x = DeleteUserRequest::new().set_validate_only(true);
4470    /// ```
4471    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4472        self.validate_only = v.into();
4473        self
4474    }
4475
4476    /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
4477    ///
4478    /// # Example
4479    /// ```ignore,no_run
4480    /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4481    /// let x = DeleteUserRequest::new().set_etag("example");
4482    /// ```
4483    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4484        self.etag = v.into();
4485        self
4486    }
4487}
4488
4489impl wkt::message::Message for DeleteUserRequest {
4490    fn typename() -> &'static str {
4491        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
4492    }
4493}
4494
4495/// Represents the metadata of the long-running operation.
4496#[derive(Clone, Default, PartialEq)]
4497#[non_exhaustive]
4498pub struct OperationMetadata {
4499    /// Output only. The time the operation was created.
4500    pub create_time: std::option::Option<wkt::Timestamp>,
4501
4502    /// Output only. The time the operation finished running.
4503    pub end_time: std::option::Option<wkt::Timestamp>,
4504
4505    /// Output only. Server-defined resource path for the target of the operation.
4506    pub target: std::string::String,
4507
4508    /// Output only. Name of the verb executed by the operation.
4509    pub verb: std::string::String,
4510
4511    /// Output only. Human-readable status of the operation, if any.
4512    pub status_message: std::string::String,
4513
4514    /// Output only. Identifies whether the user has requested cancellation
4515    /// of the operation. Operations that have been cancelled successfully
4516    /// have
4517    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
4518    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
4519    /// corresponding to `Code.CANCELLED`.
4520    ///
4521    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
4522    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4523    pub requested_cancellation: bool,
4524
4525    /// Output only. API version used to start the operation.
4526    pub api_version: std::string::String,
4527
4528    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4529}
4530
4531impl OperationMetadata {
4532    /// Creates a new default instance.
4533    pub fn new() -> Self {
4534        std::default::Default::default()
4535    }
4536
4537    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4538    ///
4539    /// # Example
4540    /// ```ignore,no_run
4541    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4542    /// use wkt::Timestamp;
4543    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4544    /// ```
4545    pub fn set_create_time<T>(mut self, v: T) -> Self
4546    where
4547        T: std::convert::Into<wkt::Timestamp>,
4548    {
4549        self.create_time = std::option::Option::Some(v.into());
4550        self
4551    }
4552
4553    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4554    ///
4555    /// # Example
4556    /// ```ignore,no_run
4557    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4558    /// use wkt::Timestamp;
4559    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4560    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4561    /// ```
4562    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4563    where
4564        T: std::convert::Into<wkt::Timestamp>,
4565    {
4566        self.create_time = v.map(|x| x.into());
4567        self
4568    }
4569
4570    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4571    ///
4572    /// # Example
4573    /// ```ignore,no_run
4574    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4575    /// use wkt::Timestamp;
4576    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4577    /// ```
4578    pub fn set_end_time<T>(mut self, v: T) -> Self
4579    where
4580        T: std::convert::Into<wkt::Timestamp>,
4581    {
4582        self.end_time = std::option::Option::Some(v.into());
4583        self
4584    }
4585
4586    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4587    ///
4588    /// # Example
4589    /// ```ignore,no_run
4590    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4591    /// use wkt::Timestamp;
4592    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4593    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4594    /// ```
4595    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4596    where
4597        T: std::convert::Into<wkt::Timestamp>,
4598    {
4599        self.end_time = v.map(|x| x.into());
4600        self
4601    }
4602
4603    /// Sets the value of [target][crate::model::OperationMetadata::target].
4604    ///
4605    /// # Example
4606    /// ```ignore,no_run
4607    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4608    /// let x = OperationMetadata::new().set_target("example");
4609    /// ```
4610    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4611        self.target = v.into();
4612        self
4613    }
4614
4615    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4616    ///
4617    /// # Example
4618    /// ```ignore,no_run
4619    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4620    /// let x = OperationMetadata::new().set_verb("example");
4621    /// ```
4622    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4623        self.verb = v.into();
4624        self
4625    }
4626
4627    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4628    ///
4629    /// # Example
4630    /// ```ignore,no_run
4631    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4632    /// let x = OperationMetadata::new().set_status_message("example");
4633    /// ```
4634    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4635        self.status_message = v.into();
4636        self
4637    }
4638
4639    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4640    ///
4641    /// # Example
4642    /// ```ignore,no_run
4643    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4644    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4645    /// ```
4646    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4647        self.requested_cancellation = v.into();
4648        self
4649    }
4650
4651    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4652    ///
4653    /// # Example
4654    /// ```ignore,no_run
4655    /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4656    /// let x = OperationMetadata::new().set_api_version("example");
4657    /// ```
4658    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4659        self.api_version = v.into();
4660        self
4661    }
4662}
4663
4664impl wkt::message::Message for OperationMetadata {
4665    fn typename() -> &'static str {
4666        "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
4667    }
4668}
4669
4670/// Message for fetching a User of the user themselves.
4671#[derive(Clone, Default, PartialEq)]
4672#[non_exhaustive]
4673pub struct FetchSelfRequest {
4674    /// Required. Name of the AccountConnector resource
4675    pub name: std::string::String,
4676
4677    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4678}
4679
4680impl FetchSelfRequest {
4681    /// Creates a new default instance.
4682    pub fn new() -> Self {
4683        std::default::Default::default()
4684    }
4685
4686    /// Sets the value of [name][crate::model::FetchSelfRequest::name].
4687    ///
4688    /// # Example
4689    /// ```ignore,no_run
4690    /// # use google_cloud_developerconnect_v1::model::FetchSelfRequest;
4691    /// # let project_id = "project_id";
4692    /// # let location_id = "location_id";
4693    /// # let account_connector_id = "account_connector_id";
4694    /// let x = FetchSelfRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4695    /// ```
4696    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4697        self.name = v.into();
4698        self
4699    }
4700}
4701
4702impl wkt::message::Message for FetchSelfRequest {
4703    fn typename() -> &'static str {
4704        "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
4705    }
4706}
4707
4708/// Message for deleting a User of the user themselves.
4709#[derive(Clone, Default, PartialEq)]
4710#[non_exhaustive]
4711pub struct DeleteSelfRequest {
4712    /// Required. Name of the AccountConnector resource
4713    pub name: std::string::String,
4714
4715    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4716}
4717
4718impl DeleteSelfRequest {
4719    /// Creates a new default instance.
4720    pub fn new() -> Self {
4721        std::default::Default::default()
4722    }
4723
4724    /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
4725    ///
4726    /// # Example
4727    /// ```ignore,no_run
4728    /// # use google_cloud_developerconnect_v1::model::DeleteSelfRequest;
4729    /// # let project_id = "project_id";
4730    /// # let location_id = "location_id";
4731    /// # let account_connector_id = "account_connector_id";
4732    /// let x = DeleteSelfRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4733    /// ```
4734    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4735        self.name = v.into();
4736        self
4737    }
4738}
4739
4740impl wkt::message::Message for DeleteSelfRequest {
4741    fn typename() -> &'static str {
4742        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
4743    }
4744}
4745
4746/// Message for fetching an OAuth access token.
4747#[derive(Clone, Default, PartialEq)]
4748#[non_exhaustive]
4749pub struct FetchAccessTokenRequest {
4750    /// Required. The resource name of the AccountConnector in the format
4751    /// `projects/*/locations/*/accountConnectors/*`.
4752    pub account_connector: std::string::String,
4753
4754    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4755}
4756
4757impl FetchAccessTokenRequest {
4758    /// Creates a new default instance.
4759    pub fn new() -> Self {
4760        std::default::Default::default()
4761    }
4762
4763    /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
4764    ///
4765    /// # Example
4766    /// ```ignore,no_run
4767    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenRequest;
4768    /// # let project_id = "project_id";
4769    /// # let location_id = "location_id";
4770    /// # let account_connector_id = "account_connector_id";
4771    /// let x = FetchAccessTokenRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4772    /// ```
4773    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4774        mut self,
4775        v: T,
4776    ) -> Self {
4777        self.account_connector = v.into();
4778        self
4779    }
4780}
4781
4782impl wkt::message::Message for FetchAccessTokenRequest {
4783    fn typename() -> &'static str {
4784        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
4785    }
4786}
4787
4788/// Message for responding to getting an OAuth access token.
4789#[derive(Clone, Default, PartialEq)]
4790#[non_exhaustive]
4791pub struct FetchAccessTokenResponse {
4792    /// The token content.
4793    pub token: std::string::String,
4794
4795    /// Expiration timestamp. Can be empty if unknown or non-expiring.
4796    pub expiration_time: std::option::Option<wkt::Timestamp>,
4797
4798    /// The scopes of the access token.
4799    pub scopes: std::vec::Vec<std::string::String>,
4800
4801    /// The error resulted from exchanging OAuth tokens from the service provider.
4802    pub exchange_error: std::option::Option<crate::model::ExchangeError>,
4803
4804    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4805}
4806
4807impl FetchAccessTokenResponse {
4808    /// Creates a new default instance.
4809    pub fn new() -> Self {
4810        std::default::Default::default()
4811    }
4812
4813    /// Sets the value of [token][crate::model::FetchAccessTokenResponse::token].
4814    ///
4815    /// # Example
4816    /// ```ignore,no_run
4817    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4818    /// let x = FetchAccessTokenResponse::new().set_token("example");
4819    /// ```
4820    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4821        self.token = v.into();
4822        self
4823    }
4824
4825    /// Sets the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4826    ///
4827    /// # Example
4828    /// ```ignore,no_run
4829    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4830    /// use wkt::Timestamp;
4831    /// let x = FetchAccessTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
4832    /// ```
4833    pub fn set_expiration_time<T>(mut self, v: T) -> Self
4834    where
4835        T: std::convert::Into<wkt::Timestamp>,
4836    {
4837        self.expiration_time = std::option::Option::Some(v.into());
4838        self
4839    }
4840
4841    /// Sets or clears the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4842    ///
4843    /// # Example
4844    /// ```ignore,no_run
4845    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4846    /// use wkt::Timestamp;
4847    /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
4848    /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
4849    /// ```
4850    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
4851    where
4852        T: std::convert::Into<wkt::Timestamp>,
4853    {
4854        self.expiration_time = v.map(|x| x.into());
4855        self
4856    }
4857
4858    /// Sets the value of [scopes][crate::model::FetchAccessTokenResponse::scopes].
4859    ///
4860    /// # Example
4861    /// ```ignore,no_run
4862    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4863    /// let x = FetchAccessTokenResponse::new().set_scopes(["a", "b", "c"]);
4864    /// ```
4865    pub fn set_scopes<T, V>(mut self, v: T) -> Self
4866    where
4867        T: std::iter::IntoIterator<Item = V>,
4868        V: std::convert::Into<std::string::String>,
4869    {
4870        use std::iter::Iterator;
4871        self.scopes = v.into_iter().map(|i| i.into()).collect();
4872        self
4873    }
4874
4875    /// Sets the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4876    ///
4877    /// # Example
4878    /// ```ignore,no_run
4879    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4880    /// use google_cloud_developerconnect_v1::model::ExchangeError;
4881    /// let x = FetchAccessTokenResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
4882    /// ```
4883    pub fn set_exchange_error<T>(mut self, v: T) -> Self
4884    where
4885        T: std::convert::Into<crate::model::ExchangeError>,
4886    {
4887        self.exchange_error = std::option::Option::Some(v.into());
4888        self
4889    }
4890
4891    /// Sets or clears the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4892    ///
4893    /// # Example
4894    /// ```ignore,no_run
4895    /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4896    /// use google_cloud_developerconnect_v1::model::ExchangeError;
4897    /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
4898    /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
4899    /// ```
4900    pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
4901    where
4902        T: std::convert::Into<crate::model::ExchangeError>,
4903    {
4904        self.exchange_error = v.map(|x| x.into());
4905        self
4906    }
4907}
4908
4909impl wkt::message::Message for FetchAccessTokenResponse {
4910    fn typename() -> &'static str {
4911        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
4912    }
4913}
4914
4915/// Message for starting an OAuth flow.
4916#[derive(Clone, Default, PartialEq)]
4917#[non_exhaustive]
4918pub struct StartOAuthRequest {
4919    /// Required. The resource name of the AccountConnector in the format
4920    /// `projects/*/locations/*/accountConnectors/*`.
4921    pub account_connector: std::string::String,
4922
4923    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4924}
4925
4926impl StartOAuthRequest {
4927    /// Creates a new default instance.
4928    pub fn new() -> Self {
4929        std::default::Default::default()
4930    }
4931
4932    /// Sets the value of [account_connector][crate::model::StartOAuthRequest::account_connector].
4933    ///
4934    /// # Example
4935    /// ```ignore,no_run
4936    /// # use google_cloud_developerconnect_v1::model::StartOAuthRequest;
4937    /// # let project_id = "project_id";
4938    /// # let location_id = "location_id";
4939    /// # let account_connector_id = "account_connector_id";
4940    /// let x = StartOAuthRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4941    /// ```
4942    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4943        mut self,
4944        v: T,
4945    ) -> Self {
4946        self.account_connector = v.into();
4947        self
4948    }
4949}
4950
4951impl wkt::message::Message for StartOAuthRequest {
4952    fn typename() -> &'static str {
4953        "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthRequest"
4954    }
4955}
4956
4957/// Message for responding to starting an OAuth flow.
4958#[derive(Clone, Default, PartialEq)]
4959#[non_exhaustive]
4960pub struct StartOAuthResponse {
4961    /// The ticket to be used for post processing the callback from the service
4962    /// provider.
4963    pub ticket: std::string::String,
4964
4965    /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.1>
4966    pub code_challenge: std::string::String,
4967
4968    /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.2>
4969    pub code_challenge_method: std::string::String,
4970
4971    /// The client ID to the OAuth App of the service provider.
4972    pub client_id: std::string::String,
4973
4974    /// The list of scopes requested by the application.
4975    pub scopes: std::vec::Vec<std::string::String>,
4976
4977    /// The authorization server URL to the OAuth flow of the service provider.
4978    pub auth_uri: std::string::String,
4979
4980    /// The ID of the service provider.
4981    pub id: std::option::Option<crate::model::start_o_auth_response::Id>,
4982
4983    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4984}
4985
4986impl StartOAuthResponse {
4987    /// Creates a new default instance.
4988    pub fn new() -> Self {
4989        std::default::Default::default()
4990    }
4991
4992    /// Sets the value of [ticket][crate::model::StartOAuthResponse::ticket].
4993    ///
4994    /// # Example
4995    /// ```ignore,no_run
4996    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4997    /// let x = StartOAuthResponse::new().set_ticket("example");
4998    /// ```
4999    pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5000        self.ticket = v.into();
5001        self
5002    }
5003
5004    /// Sets the value of [code_challenge][crate::model::StartOAuthResponse::code_challenge].
5005    ///
5006    /// # Example
5007    /// ```ignore,no_run
5008    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5009    /// let x = StartOAuthResponse::new().set_code_challenge("example");
5010    /// ```
5011    pub fn set_code_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5012        self.code_challenge = v.into();
5013        self
5014    }
5015
5016    /// Sets the value of [code_challenge_method][crate::model::StartOAuthResponse::code_challenge_method].
5017    ///
5018    /// # Example
5019    /// ```ignore,no_run
5020    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5021    /// let x = StartOAuthResponse::new().set_code_challenge_method("example");
5022    /// ```
5023    pub fn set_code_challenge_method<T: std::convert::Into<std::string::String>>(
5024        mut self,
5025        v: T,
5026    ) -> Self {
5027        self.code_challenge_method = v.into();
5028        self
5029    }
5030
5031    /// Sets the value of [client_id][crate::model::StartOAuthResponse::client_id].
5032    ///
5033    /// # Example
5034    /// ```ignore,no_run
5035    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5036    /// let x = StartOAuthResponse::new().set_client_id("example");
5037    /// ```
5038    pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5039        self.client_id = v.into();
5040        self
5041    }
5042
5043    /// Sets the value of [scopes][crate::model::StartOAuthResponse::scopes].
5044    ///
5045    /// # Example
5046    /// ```ignore,no_run
5047    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5048    /// let x = StartOAuthResponse::new().set_scopes(["a", "b", "c"]);
5049    /// ```
5050    pub fn set_scopes<T, V>(mut self, v: T) -> Self
5051    where
5052        T: std::iter::IntoIterator<Item = V>,
5053        V: std::convert::Into<std::string::String>,
5054    {
5055        use std::iter::Iterator;
5056        self.scopes = v.into_iter().map(|i| i.into()).collect();
5057        self
5058    }
5059
5060    /// Sets the value of [auth_uri][crate::model::StartOAuthResponse::auth_uri].
5061    ///
5062    /// # Example
5063    /// ```ignore,no_run
5064    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5065    /// let x = StartOAuthResponse::new().set_auth_uri("example");
5066    /// ```
5067    pub fn set_auth_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5068        self.auth_uri = v.into();
5069        self
5070    }
5071
5072    /// Sets the value of [id][crate::model::StartOAuthResponse::id].
5073    ///
5074    /// Note that all the setters affecting `id` are mutually
5075    /// exclusive.
5076    ///
5077    /// # Example
5078    /// ```ignore,no_run
5079    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5080    /// use google_cloud_developerconnect_v1::model::SystemProvider;
5081    /// let x0 = StartOAuthResponse::new().set_id(Some(
5082    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Github)));
5083    /// let x1 = StartOAuthResponse::new().set_id(Some(
5084    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Gitlab)));
5085    /// let x2 = StartOAuthResponse::new().set_id(Some(
5086    ///     google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Google)));
5087    /// ```
5088    pub fn set_id<
5089        T: std::convert::Into<std::option::Option<crate::model::start_o_auth_response::Id>>,
5090    >(
5091        mut self,
5092        v: T,
5093    ) -> Self {
5094        self.id = v.into();
5095        self
5096    }
5097
5098    /// The value of [id][crate::model::StartOAuthResponse::id]
5099    /// if it holds a `SystemProviderId`, `None` if the field is not set or
5100    /// holds a different branch.
5101    pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
5102        #[allow(unreachable_patterns)]
5103        self.id.as_ref().and_then(|v| match v {
5104            crate::model::start_o_auth_response::Id::SystemProviderId(v) => {
5105                std::option::Option::Some(v)
5106            }
5107            _ => std::option::Option::None,
5108        })
5109    }
5110
5111    /// Sets the value of [id][crate::model::StartOAuthResponse::id]
5112    /// to hold a `SystemProviderId`.
5113    ///
5114    /// Note that all the setters affecting `id` are
5115    /// mutually exclusive.
5116    ///
5117    /// # Example
5118    /// ```ignore,no_run
5119    /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5120    /// use google_cloud_developerconnect_v1::model::SystemProvider;
5121    /// let x0 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Github);
5122    /// let x1 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Gitlab);
5123    /// let x2 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Google);
5124    /// assert!(x0.system_provider_id().is_some());
5125    /// assert!(x1.system_provider_id().is_some());
5126    /// assert!(x2.system_provider_id().is_some());
5127    /// ```
5128    pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
5129        mut self,
5130        v: T,
5131    ) -> Self {
5132        self.id = std::option::Option::Some(
5133            crate::model::start_o_auth_response::Id::SystemProviderId(v.into()),
5134        );
5135        self
5136    }
5137}
5138
5139impl wkt::message::Message for StartOAuthResponse {
5140    fn typename() -> &'static str {
5141        "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthResponse"
5142    }
5143}
5144
5145/// Defines additional types related to [StartOAuthResponse].
5146pub mod start_o_auth_response {
5147    #[allow(unused_imports)]
5148    use super::*;
5149
5150    /// The ID of the service provider.
5151    #[derive(Clone, Debug, PartialEq)]
5152    #[non_exhaustive]
5153    pub enum Id {
5154        /// The ID of the system provider.
5155        SystemProviderId(crate::model::SystemProvider),
5156    }
5157}
5158
5159/// Message for finishing an OAuth flow.
5160#[derive(Clone, Default, PartialEq)]
5161#[non_exhaustive]
5162pub struct FinishOAuthRequest {
5163    /// Required. The resource name of the AccountConnector in the format
5164    /// `projects/*/locations/*/accountConnectors/*`.
5165    pub account_connector: std::string::String,
5166
5167    /// The params returned by OAuth flow redirect.
5168    pub params: std::option::Option<crate::model::finish_o_auth_request::Params>,
5169
5170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5171}
5172
5173impl FinishOAuthRequest {
5174    /// Creates a new default instance.
5175    pub fn new() -> Self {
5176        std::default::Default::default()
5177    }
5178
5179    /// Sets the value of [account_connector][crate::model::FinishOAuthRequest::account_connector].
5180    ///
5181    /// # Example
5182    /// ```ignore,no_run
5183    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5184    /// # let project_id = "project_id";
5185    /// # let location_id = "location_id";
5186    /// # let account_connector_id = "account_connector_id";
5187    /// let x = FinishOAuthRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
5188    /// ```
5189    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
5190        mut self,
5191        v: T,
5192    ) -> Self {
5193        self.account_connector = v.into();
5194        self
5195    }
5196
5197    /// Sets the value of [params][crate::model::FinishOAuthRequest::params].
5198    ///
5199    /// Note that all the setters affecting `params` are mutually
5200    /// exclusive.
5201    ///
5202    /// # Example
5203    /// ```ignore,no_run
5204    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5205    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5206    /// let x = FinishOAuthRequest::new().set_params(Some(
5207    ///     google_cloud_developerconnect_v1::model::finish_o_auth_request::Params::OauthParams(OAuthParams::default().into())));
5208    /// ```
5209    pub fn set_params<
5210        T: std::convert::Into<std::option::Option<crate::model::finish_o_auth_request::Params>>,
5211    >(
5212        mut self,
5213        v: T,
5214    ) -> Self {
5215        self.params = v.into();
5216        self
5217    }
5218
5219    /// The value of [params][crate::model::FinishOAuthRequest::params]
5220    /// if it holds a `OauthParams`, `None` if the field is not set or
5221    /// holds a different branch.
5222    pub fn oauth_params(
5223        &self,
5224    ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>
5225    {
5226        #[allow(unreachable_patterns)]
5227        self.params.as_ref().and_then(|v| match v {
5228            crate::model::finish_o_auth_request::Params::OauthParams(v) => {
5229                std::option::Option::Some(v)
5230            }
5231            _ => std::option::Option::None,
5232        })
5233    }
5234
5235    /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5236    /// to hold a `OauthParams`.
5237    ///
5238    /// Note that all the setters affecting `params` are
5239    /// mutually exclusive.
5240    ///
5241    /// # Example
5242    /// ```ignore,no_run
5243    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5244    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5245    /// let x = FinishOAuthRequest::new().set_oauth_params(OAuthParams::default()/* use setters */);
5246    /// assert!(x.oauth_params().is_some());
5247    /// assert!(x.google_oauth_params().is_none());
5248    /// ```
5249    pub fn set_oauth_params<
5250        T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>,
5251    >(
5252        mut self,
5253        v: T,
5254    ) -> Self {
5255        self.params = std::option::Option::Some(
5256            crate::model::finish_o_auth_request::Params::OauthParams(v.into()),
5257        );
5258        self
5259    }
5260
5261    /// The value of [params][crate::model::FinishOAuthRequest::params]
5262    /// if it holds a `GoogleOauthParams`, `None` if the field is not set or
5263    /// holds a different branch.
5264    pub fn google_oauth_params(
5265        &self,
5266    ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>
5267    {
5268        #[allow(unreachable_patterns)]
5269        self.params.as_ref().and_then(|v| match v {
5270            crate::model::finish_o_auth_request::Params::GoogleOauthParams(v) => {
5271                std::option::Option::Some(v)
5272            }
5273            _ => std::option::Option::None,
5274        })
5275    }
5276
5277    /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5278    /// to hold a `GoogleOauthParams`.
5279    ///
5280    /// Note that all the setters affecting `params` are
5281    /// mutually exclusive.
5282    ///
5283    /// # Example
5284    /// ```ignore,no_run
5285    /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5286    /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5287    /// let x = FinishOAuthRequest::new().set_google_oauth_params(GoogleOAuthParams::default()/* use setters */);
5288    /// assert!(x.google_oauth_params().is_some());
5289    /// assert!(x.oauth_params().is_none());
5290    /// ```
5291    pub fn set_google_oauth_params<
5292        T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>,
5293    >(
5294        mut self,
5295        v: T,
5296    ) -> Self {
5297        self.params = std::option::Option::Some(
5298            crate::model::finish_o_auth_request::Params::GoogleOauthParams(v.into()),
5299        );
5300        self
5301    }
5302}
5303
5304impl wkt::message::Message for FinishOAuthRequest {
5305    fn typename() -> &'static str {
5306        "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest"
5307    }
5308}
5309
5310/// Defines additional types related to [FinishOAuthRequest].
5311pub mod finish_o_auth_request {
5312    #[allow(unused_imports)]
5313    use super::*;
5314
5315    /// The params returned by non-Google OAuth 2.0 flow redirect.
5316    #[derive(Clone, Default, PartialEq)]
5317    #[non_exhaustive]
5318    pub struct OAuthParams {
5319        /// Required. The code to be used for getting the token from SCM provider.
5320        pub code: std::string::String,
5321
5322        /// Required. The ticket to be used for post processing the callback from SCM
5323        /// provider.
5324        pub ticket: std::string::String,
5325
5326        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5327    }
5328
5329    impl OAuthParams {
5330        /// Creates a new default instance.
5331        pub fn new() -> Self {
5332            std::default::Default::default()
5333        }
5334
5335        /// Sets the value of [code][crate::model::finish_o_auth_request::OAuthParams::code].
5336        ///
5337        /// # Example
5338        /// ```ignore,no_run
5339        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5340        /// let x = OAuthParams::new().set_code("example");
5341        /// ```
5342        pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5343            self.code = v.into();
5344            self
5345        }
5346
5347        /// Sets the value of [ticket][crate::model::finish_o_auth_request::OAuthParams::ticket].
5348        ///
5349        /// # Example
5350        /// ```ignore,no_run
5351        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5352        /// let x = OAuthParams::new().set_ticket("example");
5353        /// ```
5354        pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5355            self.ticket = v.into();
5356            self
5357        }
5358    }
5359
5360    impl wkt::message::Message for OAuthParams {
5361        fn typename() -> &'static str {
5362            "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.OAuthParams"
5363        }
5364    }
5365
5366    /// The params returned by Google OAuth flow redirects.
5367    #[derive(Clone, Default, PartialEq)]
5368    #[non_exhaustive]
5369    pub struct GoogleOAuthParams {
5370        /// Required. The scopes returned by Google OAuth flow.
5371        pub scopes: std::vec::Vec<std::string::String>,
5372
5373        /// Optional. The version info returned by Google OAuth flow.
5374        pub version_info: std::string::String,
5375
5376        /// Required. The ticket to be used for post processing the callback from
5377        /// Google OAuth flow.
5378        pub ticket: std::string::String,
5379
5380        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5381    }
5382
5383    impl GoogleOAuthParams {
5384        /// Creates a new default instance.
5385        pub fn new() -> Self {
5386            std::default::Default::default()
5387        }
5388
5389        /// Sets the value of [scopes][crate::model::finish_o_auth_request::GoogleOAuthParams::scopes].
5390        ///
5391        /// # Example
5392        /// ```ignore,no_run
5393        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5394        /// let x = GoogleOAuthParams::new().set_scopes(["a", "b", "c"]);
5395        /// ```
5396        pub fn set_scopes<T, V>(mut self, v: T) -> Self
5397        where
5398            T: std::iter::IntoIterator<Item = V>,
5399            V: std::convert::Into<std::string::String>,
5400        {
5401            use std::iter::Iterator;
5402            self.scopes = v.into_iter().map(|i| i.into()).collect();
5403            self
5404        }
5405
5406        /// Sets the value of [version_info][crate::model::finish_o_auth_request::GoogleOAuthParams::version_info].
5407        ///
5408        /// # Example
5409        /// ```ignore,no_run
5410        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5411        /// let x = GoogleOAuthParams::new().set_version_info("example");
5412        /// ```
5413        pub fn set_version_info<T: std::convert::Into<std::string::String>>(
5414            mut self,
5415            v: T,
5416        ) -> Self {
5417            self.version_info = v.into();
5418            self
5419        }
5420
5421        /// Sets the value of [ticket][crate::model::finish_o_auth_request::GoogleOAuthParams::ticket].
5422        ///
5423        /// # Example
5424        /// ```ignore,no_run
5425        /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5426        /// let x = GoogleOAuthParams::new().set_ticket("example");
5427        /// ```
5428        pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5429            self.ticket = v.into();
5430            self
5431        }
5432    }
5433
5434    impl wkt::message::Message for GoogleOAuthParams {
5435        fn typename() -> &'static str {
5436            "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.GoogleOAuthParams"
5437        }
5438    }
5439
5440    /// The params returned by OAuth flow redirect.
5441    #[derive(Clone, Debug, PartialEq)]
5442    #[non_exhaustive]
5443    pub enum Params {
5444        /// The params returned by non-Google OAuth 2.0 flow redirect.
5445        OauthParams(std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>),
5446        /// The params returned by Google OAuth flow redirects.
5447        GoogleOauthParams(std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>),
5448    }
5449}
5450
5451/// Message for responding to finishing an OAuth flow.
5452#[derive(Clone, Default, PartialEq)]
5453#[non_exhaustive]
5454pub struct FinishOAuthResponse {
5455    /// The error resulted from exchanging OAuth tokens from the service provider.
5456    pub exchange_error: std::option::Option<crate::model::ExchangeError>,
5457
5458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5459}
5460
5461impl FinishOAuthResponse {
5462    /// Creates a new default instance.
5463    pub fn new() -> Self {
5464        std::default::Default::default()
5465    }
5466
5467    /// Sets the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5468    ///
5469    /// # Example
5470    /// ```ignore,no_run
5471    /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5472    /// use google_cloud_developerconnect_v1::model::ExchangeError;
5473    /// let x = FinishOAuthResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
5474    /// ```
5475    pub fn set_exchange_error<T>(mut self, v: T) -> Self
5476    where
5477        T: std::convert::Into<crate::model::ExchangeError>,
5478    {
5479        self.exchange_error = std::option::Option::Some(v.into());
5480        self
5481    }
5482
5483    /// Sets or clears the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5484    ///
5485    /// # Example
5486    /// ```ignore,no_run
5487    /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5488    /// use google_cloud_developerconnect_v1::model::ExchangeError;
5489    /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
5490    /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
5491    /// ```
5492    pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
5493    where
5494        T: std::convert::Into<crate::model::ExchangeError>,
5495    {
5496        self.exchange_error = v.map(|x| x.into());
5497        self
5498    }
5499}
5500
5501impl wkt::message::Message for FinishOAuthResponse {
5502    fn typename() -> &'static str {
5503        "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthResponse"
5504    }
5505}
5506
5507/// Message for representing an error from exchanging OAuth tokens.
5508#[derive(Clone, Default, PartialEq)]
5509#[non_exhaustive]
5510pub struct ExchangeError {
5511    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> - error
5512    pub code: std::string::String,
5513
5514    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> -
5515    /// error_description
5516    pub description: std::string::String,
5517
5518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5519}
5520
5521impl ExchangeError {
5522    /// Creates a new default instance.
5523    pub fn new() -> Self {
5524        std::default::Default::default()
5525    }
5526
5527    /// Sets the value of [code][crate::model::ExchangeError::code].
5528    ///
5529    /// # Example
5530    /// ```ignore,no_run
5531    /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5532    /// let x = ExchangeError::new().set_code("example");
5533    /// ```
5534    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5535        self.code = v.into();
5536        self
5537    }
5538
5539    /// Sets the value of [description][crate::model::ExchangeError::description].
5540    ///
5541    /// # Example
5542    /// ```ignore,no_run
5543    /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5544    /// let x = ExchangeError::new().set_description("example");
5545    /// ```
5546    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5547        self.description = v.into();
5548        self
5549    }
5550}
5551
5552impl wkt::message::Message for ExchangeError {
5553    fn typename() -> &'static str {
5554        "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
5555    }
5556}
5557
5558/// Message describing the GitRepositoryLink object
5559#[derive(Clone, Default, PartialEq)]
5560#[non_exhaustive]
5561pub struct GitRepositoryLink {
5562    /// Identifier. Resource name of the repository, in the format
5563    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
5564    pub name: std::string::String,
5565
5566    /// Required. Git Clone URI.
5567    pub clone_uri: std::string::String,
5568
5569    /// Output only. [Output only] Create timestamp
5570    pub create_time: std::option::Option<wkt::Timestamp>,
5571
5572    /// Output only. [Output only] Update timestamp
5573    pub update_time: std::option::Option<wkt::Timestamp>,
5574
5575    /// Output only. [Output only] Delete timestamp
5576    pub delete_time: std::option::Option<wkt::Timestamp>,
5577
5578    /// Optional. Labels as key value pairs
5579    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5580
5581    /// Optional. This checksum is computed by the server based on the value of
5582    /// other fields, and may be sent on update and delete requests to ensure the
5583    /// client has an up-to-date value before proceeding.
5584    pub etag: std::string::String,
5585
5586    /// Output only. Set to true when the connection is being set up or updated in
5587    /// the background.
5588    pub reconciling: bool,
5589
5590    /// Optional. Allows clients to store small amounts of arbitrary data.
5591    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5592
5593    /// Output only. A system-assigned unique identifier for the GitRepositoryLink.
5594    pub uid: std::string::String,
5595
5596    /// Output only. External ID of the webhook created for the repository.
5597    pub webhook_id: std::string::String,
5598
5599    /// Output only. URI to access the linked repository through the Git Proxy.
5600    /// This field is only populated if the git proxy is enabled for the
5601    /// connection.
5602    pub git_proxy_uri: std::string::String,
5603
5604    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5605}
5606
5607impl GitRepositoryLink {
5608    /// Creates a new default instance.
5609    pub fn new() -> Self {
5610        std::default::Default::default()
5611    }
5612
5613    /// Sets the value of [name][crate::model::GitRepositoryLink::name].
5614    ///
5615    /// # Example
5616    /// ```ignore,no_run
5617    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5618    /// # let project_id = "project_id";
5619    /// # let location_id = "location_id";
5620    /// # let connection_id = "connection_id";
5621    /// # let git_repository_link_id = "git_repository_link_id";
5622    /// let x = GitRepositoryLink::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
5623    /// ```
5624    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5625        self.name = v.into();
5626        self
5627    }
5628
5629    /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
5630    ///
5631    /// # Example
5632    /// ```ignore,no_run
5633    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5634    /// let x = GitRepositoryLink::new().set_clone_uri("example");
5635    /// ```
5636    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5637        self.clone_uri = v.into();
5638        self
5639    }
5640
5641    /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
5642    ///
5643    /// # Example
5644    /// ```ignore,no_run
5645    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5646    /// use wkt::Timestamp;
5647    /// let x = GitRepositoryLink::new().set_create_time(Timestamp::default()/* use setters */);
5648    /// ```
5649    pub fn set_create_time<T>(mut self, v: T) -> Self
5650    where
5651        T: std::convert::Into<wkt::Timestamp>,
5652    {
5653        self.create_time = std::option::Option::Some(v.into());
5654        self
5655    }
5656
5657    /// Sets or clears the value of [create_time][crate::model::GitRepositoryLink::create_time].
5658    ///
5659    /// # Example
5660    /// ```ignore,no_run
5661    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5662    /// use wkt::Timestamp;
5663    /// let x = GitRepositoryLink::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5664    /// let x = GitRepositoryLink::new().set_or_clear_create_time(None::<Timestamp>);
5665    /// ```
5666    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5667    where
5668        T: std::convert::Into<wkt::Timestamp>,
5669    {
5670        self.create_time = v.map(|x| x.into());
5671        self
5672    }
5673
5674    /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
5675    ///
5676    /// # Example
5677    /// ```ignore,no_run
5678    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5679    /// use wkt::Timestamp;
5680    /// let x = GitRepositoryLink::new().set_update_time(Timestamp::default()/* use setters */);
5681    /// ```
5682    pub fn set_update_time<T>(mut self, v: T) -> Self
5683    where
5684        T: std::convert::Into<wkt::Timestamp>,
5685    {
5686        self.update_time = std::option::Option::Some(v.into());
5687        self
5688    }
5689
5690    /// Sets or clears the value of [update_time][crate::model::GitRepositoryLink::update_time].
5691    ///
5692    /// # Example
5693    /// ```ignore,no_run
5694    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5695    /// use wkt::Timestamp;
5696    /// let x = GitRepositoryLink::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5697    /// let x = GitRepositoryLink::new().set_or_clear_update_time(None::<Timestamp>);
5698    /// ```
5699    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5700    where
5701        T: std::convert::Into<wkt::Timestamp>,
5702    {
5703        self.update_time = v.map(|x| x.into());
5704        self
5705    }
5706
5707    /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5708    ///
5709    /// # Example
5710    /// ```ignore,no_run
5711    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5712    /// use wkt::Timestamp;
5713    /// let x = GitRepositoryLink::new().set_delete_time(Timestamp::default()/* use setters */);
5714    /// ```
5715    pub fn set_delete_time<T>(mut self, v: T) -> Self
5716    where
5717        T: std::convert::Into<wkt::Timestamp>,
5718    {
5719        self.delete_time = std::option::Option::Some(v.into());
5720        self
5721    }
5722
5723    /// Sets or clears the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5724    ///
5725    /// # Example
5726    /// ```ignore,no_run
5727    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5728    /// use wkt::Timestamp;
5729    /// let x = GitRepositoryLink::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
5730    /// let x = GitRepositoryLink::new().set_or_clear_delete_time(None::<Timestamp>);
5731    /// ```
5732    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
5733    where
5734        T: std::convert::Into<wkt::Timestamp>,
5735    {
5736        self.delete_time = v.map(|x| x.into());
5737        self
5738    }
5739
5740    /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
5741    ///
5742    /// # Example
5743    /// ```ignore,no_run
5744    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5745    /// let x = GitRepositoryLink::new().set_labels([
5746    ///     ("key0", "abc"),
5747    ///     ("key1", "xyz"),
5748    /// ]);
5749    /// ```
5750    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5751    where
5752        T: std::iter::IntoIterator<Item = (K, V)>,
5753        K: std::convert::Into<std::string::String>,
5754        V: std::convert::Into<std::string::String>,
5755    {
5756        use std::iter::Iterator;
5757        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5758        self
5759    }
5760
5761    /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
5762    ///
5763    /// # Example
5764    /// ```ignore,no_run
5765    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5766    /// let x = GitRepositoryLink::new().set_etag("example");
5767    /// ```
5768    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5769        self.etag = v.into();
5770        self
5771    }
5772
5773    /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
5774    ///
5775    /// # Example
5776    /// ```ignore,no_run
5777    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5778    /// let x = GitRepositoryLink::new().set_reconciling(true);
5779    /// ```
5780    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5781        self.reconciling = v.into();
5782        self
5783    }
5784
5785    /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
5786    ///
5787    /// # Example
5788    /// ```ignore,no_run
5789    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5790    /// let x = GitRepositoryLink::new().set_annotations([
5791    ///     ("key0", "abc"),
5792    ///     ("key1", "xyz"),
5793    /// ]);
5794    /// ```
5795    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5796    where
5797        T: std::iter::IntoIterator<Item = (K, V)>,
5798        K: std::convert::Into<std::string::String>,
5799        V: std::convert::Into<std::string::String>,
5800    {
5801        use std::iter::Iterator;
5802        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5803        self
5804    }
5805
5806    /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
5807    ///
5808    /// # Example
5809    /// ```ignore,no_run
5810    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5811    /// let x = GitRepositoryLink::new().set_uid("example");
5812    /// ```
5813    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5814        self.uid = v.into();
5815        self
5816    }
5817
5818    /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
5819    ///
5820    /// # Example
5821    /// ```ignore,no_run
5822    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5823    /// let x = GitRepositoryLink::new().set_webhook_id("example");
5824    /// ```
5825    pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5826        self.webhook_id = v.into();
5827        self
5828    }
5829
5830    /// Sets the value of [git_proxy_uri][crate::model::GitRepositoryLink::git_proxy_uri].
5831    ///
5832    /// # Example
5833    /// ```ignore,no_run
5834    /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5835    /// let x = GitRepositoryLink::new().set_git_proxy_uri("example");
5836    /// ```
5837    pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5838        self.git_proxy_uri = v.into();
5839        self
5840    }
5841}
5842
5843impl wkt::message::Message for GitRepositoryLink {
5844    fn typename() -> &'static str {
5845        "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
5846    }
5847}
5848
5849/// Message for creating a GitRepositoryLink
5850#[derive(Clone, Default, PartialEq)]
5851#[non_exhaustive]
5852pub struct CreateGitRepositoryLinkRequest {
5853    /// Required. Value for parent.
5854    pub parent: std::string::String,
5855
5856    /// Required. The resource being created
5857    pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
5858
5859    /// Required. The ID to use for the repository, which will become the final
5860    /// component of the repository's resource name. This ID should be unique in
5861    /// the connection. Allows alphanumeric characters and any of
5862    /// -._~%!$&'()*+,;=@.
5863    pub git_repository_link_id: std::string::String,
5864
5865    /// Optional. An optional request ID to identify requests. Specify a unique
5866    /// request ID so that if you must retry your request, the server will know to
5867    /// ignore the request if it has already been completed. The server will
5868    /// guarantee that for at least 60 minutes since the first request.
5869    ///
5870    /// For example, consider a situation where you make an initial request and the
5871    /// request times out. If you make the request again with the same request
5872    /// ID, the server can check if original operation with the same request ID
5873    /// was received, and if so, will ignore the second request. This prevents
5874    /// clients from accidentally creating duplicate commitments.
5875    ///
5876    /// The request ID must be a valid UUID with the exception that zero UUID is
5877    /// not supported (00000000-0000-0000-0000-000000000000).
5878    pub request_id: std::string::String,
5879
5880    /// Optional. If set, validate the request, but do not actually post it.
5881    pub validate_only: bool,
5882
5883    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5884}
5885
5886impl CreateGitRepositoryLinkRequest {
5887    /// Creates a new default instance.
5888    pub fn new() -> Self {
5889        std::default::Default::default()
5890    }
5891
5892    /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
5893    ///
5894    /// # Example
5895    /// ```ignore,no_run
5896    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5897    /// # let project_id = "project_id";
5898    /// # let location_id = "location_id";
5899    /// # let connection_id = "connection_id";
5900    /// let x = CreateGitRepositoryLinkRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
5901    /// ```
5902    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5903        self.parent = v.into();
5904        self
5905    }
5906
5907    /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
5908    ///
5909    /// # Example
5910    /// ```ignore,no_run
5911    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5912    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5913    /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link(GitRepositoryLink::default()/* use setters */);
5914    /// ```
5915    pub fn set_git_repository_link<T>(mut self, v: T) -> Self
5916    where
5917        T: std::convert::Into<crate::model::GitRepositoryLink>,
5918    {
5919        self.git_repository_link = std::option::Option::Some(v.into());
5920        self
5921    }
5922
5923    /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
5924    ///
5925    /// # Example
5926    /// ```ignore,no_run
5927    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5928    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5929    /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(Some(GitRepositoryLink::default()/* use setters */));
5930    /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(None::<GitRepositoryLink>);
5931    /// ```
5932    pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
5933    where
5934        T: std::convert::Into<crate::model::GitRepositoryLink>,
5935    {
5936        self.git_repository_link = v.map(|x| x.into());
5937        self
5938    }
5939
5940    /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
5941    ///
5942    /// # Example
5943    /// ```ignore,no_run
5944    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5945    /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link_id("example");
5946    /// ```
5947    pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
5948        mut self,
5949        v: T,
5950    ) -> Self {
5951        self.git_repository_link_id = v.into();
5952        self
5953    }
5954
5955    /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
5956    ///
5957    /// # Example
5958    /// ```ignore,no_run
5959    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5960    /// let x = CreateGitRepositoryLinkRequest::new().set_request_id("example");
5961    /// ```
5962    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5963        self.request_id = v.into();
5964        self
5965    }
5966
5967    /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
5968    ///
5969    /// # Example
5970    /// ```ignore,no_run
5971    /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5972    /// let x = CreateGitRepositoryLinkRequest::new().set_validate_only(true);
5973    /// ```
5974    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5975        self.validate_only = v.into();
5976        self
5977    }
5978}
5979
5980impl wkt::message::Message for CreateGitRepositoryLinkRequest {
5981    fn typename() -> &'static str {
5982        "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
5983    }
5984}
5985
5986/// Message for deleting a GitRepositoryLink
5987#[derive(Clone, Default, PartialEq)]
5988#[non_exhaustive]
5989pub struct DeleteGitRepositoryLinkRequest {
5990    /// Required. Name of the resource
5991    pub name: std::string::String,
5992
5993    /// Optional. An optional request ID to identify requests. Specify a unique
5994    /// request ID so that if you must retry your request, the server will know to
5995    /// ignore the request if it has already been completed. The server will
5996    /// guarantee that for at least 60 minutes after the first request.
5997    ///
5998    /// For example, consider a situation where you make an initial request and the
5999    /// request times out. If you make the request again with the same request
6000    /// ID, the server can check if original operation with the same request ID
6001    /// was received, and if so, will ignore the second request. This prevents
6002    /// clients from accidentally creating duplicate commitments.
6003    ///
6004    /// The request ID must be a valid UUID with the exception that zero UUID is
6005    /// not supported (00000000-0000-0000-0000-000000000000).
6006    pub request_id: std::string::String,
6007
6008    /// Optional. If set, validate the request, but do not actually post it.
6009    pub validate_only: bool,
6010
6011    /// Optional. This checksum is computed by the server based on the value of
6012    /// other fields, and may be sent on update and delete requests to ensure the
6013    /// client has an up-to-date value before proceeding.
6014    pub etag: std::string::String,
6015
6016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6017}
6018
6019impl DeleteGitRepositoryLinkRequest {
6020    /// Creates a new default instance.
6021    pub fn new() -> Self {
6022        std::default::Default::default()
6023    }
6024
6025    /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
6026    ///
6027    /// # Example
6028    /// ```ignore,no_run
6029    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6030    /// # let project_id = "project_id";
6031    /// # let location_id = "location_id";
6032    /// # let connection_id = "connection_id";
6033    /// # let git_repository_link_id = "git_repository_link_id";
6034    /// let x = DeleteGitRepositoryLinkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6035    /// ```
6036    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6037        self.name = v.into();
6038        self
6039    }
6040
6041    /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
6042    ///
6043    /// # Example
6044    /// ```ignore,no_run
6045    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6046    /// let x = DeleteGitRepositoryLinkRequest::new().set_request_id("example");
6047    /// ```
6048    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6049        self.request_id = v.into();
6050        self
6051    }
6052
6053    /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
6054    ///
6055    /// # Example
6056    /// ```ignore,no_run
6057    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6058    /// let x = DeleteGitRepositoryLinkRequest::new().set_validate_only(true);
6059    /// ```
6060    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6061        self.validate_only = v.into();
6062        self
6063    }
6064
6065    /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
6066    ///
6067    /// # Example
6068    /// ```ignore,no_run
6069    /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6070    /// let x = DeleteGitRepositoryLinkRequest::new().set_etag("example");
6071    /// ```
6072    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6073        self.etag = v.into();
6074        self
6075    }
6076}
6077
6078impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
6079    fn typename() -> &'static str {
6080        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
6081    }
6082}
6083
6084/// Message for requesting a list of GitRepositoryLinks
6085#[derive(Clone, Default, PartialEq)]
6086#[non_exhaustive]
6087pub struct ListGitRepositoryLinksRequest {
6088    /// Required. Parent value for ListGitRepositoryLinksRequest
6089    pub parent: std::string::String,
6090
6091    /// Optional. Requested page size. Server may return fewer items than
6092    /// requested. If unspecified, server will pick an appropriate default.
6093    pub page_size: i32,
6094
6095    /// Optional. A token identifying a page of results the server should return.
6096    pub page_token: std::string::String,
6097
6098    /// Optional. Filtering results
6099    pub filter: std::string::String,
6100
6101    /// Optional. Hint for how to order the results
6102    pub order_by: std::string::String,
6103
6104    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6105}
6106
6107impl ListGitRepositoryLinksRequest {
6108    /// Creates a new default instance.
6109    pub fn new() -> Self {
6110        std::default::Default::default()
6111    }
6112
6113    /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
6114    ///
6115    /// # Example
6116    /// ```ignore,no_run
6117    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6118    /// # let project_id = "project_id";
6119    /// # let location_id = "location_id";
6120    /// # let connection_id = "connection_id";
6121    /// let x = ListGitRepositoryLinksRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6122    /// ```
6123    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6124        self.parent = v.into();
6125        self
6126    }
6127
6128    /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
6129    ///
6130    /// # Example
6131    /// ```ignore,no_run
6132    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6133    /// let x = ListGitRepositoryLinksRequest::new().set_page_size(42);
6134    /// ```
6135    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6136        self.page_size = v.into();
6137        self
6138    }
6139
6140    /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
6141    ///
6142    /// # Example
6143    /// ```ignore,no_run
6144    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6145    /// let x = ListGitRepositoryLinksRequest::new().set_page_token("example");
6146    /// ```
6147    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6148        self.page_token = v.into();
6149        self
6150    }
6151
6152    /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
6153    ///
6154    /// # Example
6155    /// ```ignore,no_run
6156    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6157    /// let x = ListGitRepositoryLinksRequest::new().set_filter("example");
6158    /// ```
6159    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6160        self.filter = v.into();
6161        self
6162    }
6163
6164    /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
6165    ///
6166    /// # Example
6167    /// ```ignore,no_run
6168    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6169    /// let x = ListGitRepositoryLinksRequest::new().set_order_by("example");
6170    /// ```
6171    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6172        self.order_by = v.into();
6173        self
6174    }
6175}
6176
6177impl wkt::message::Message for ListGitRepositoryLinksRequest {
6178    fn typename() -> &'static str {
6179        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
6180    }
6181}
6182
6183/// Message for response to listing GitRepositoryLinks
6184#[derive(Clone, Default, PartialEq)]
6185#[non_exhaustive]
6186pub struct ListGitRepositoryLinksResponse {
6187    /// The list of GitRepositoryLinks
6188    pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
6189
6190    /// A token identifying a page of results the server should return.
6191    pub next_page_token: std::string::String,
6192
6193    /// Locations that could not be reached.
6194    pub unreachable: std::vec::Vec<std::string::String>,
6195
6196    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6197}
6198
6199impl ListGitRepositoryLinksResponse {
6200    /// Creates a new default instance.
6201    pub fn new() -> Self {
6202        std::default::Default::default()
6203    }
6204
6205    /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
6206    ///
6207    /// # Example
6208    /// ```ignore,no_run
6209    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6210    /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6211    /// let x = ListGitRepositoryLinksResponse::new()
6212    ///     .set_git_repository_links([
6213    ///         GitRepositoryLink::default()/* use setters */,
6214    ///         GitRepositoryLink::default()/* use (different) setters */,
6215    ///     ]);
6216    /// ```
6217    pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
6218    where
6219        T: std::iter::IntoIterator<Item = V>,
6220        V: std::convert::Into<crate::model::GitRepositoryLink>,
6221    {
6222        use std::iter::Iterator;
6223        self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
6224        self
6225    }
6226
6227    /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
6228    ///
6229    /// # Example
6230    /// ```ignore,no_run
6231    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6232    /// let x = ListGitRepositoryLinksResponse::new().set_next_page_token("example");
6233    /// ```
6234    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6235        self.next_page_token = v.into();
6236        self
6237    }
6238
6239    /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
6240    ///
6241    /// # Example
6242    /// ```ignore,no_run
6243    /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6244    /// let x = ListGitRepositoryLinksResponse::new().set_unreachable(["a", "b", "c"]);
6245    /// ```
6246    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6247    where
6248        T: std::iter::IntoIterator<Item = V>,
6249        V: std::convert::Into<std::string::String>,
6250    {
6251        use std::iter::Iterator;
6252        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6253        self
6254    }
6255}
6256
6257impl wkt::message::Message for ListGitRepositoryLinksResponse {
6258    fn typename() -> &'static str {
6259        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
6260    }
6261}
6262
6263#[doc(hidden)]
6264impl google_cloud_gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
6265    type PageItem = crate::model::GitRepositoryLink;
6266
6267    fn items(self) -> std::vec::Vec<Self::PageItem> {
6268        self.git_repository_links
6269    }
6270
6271    fn next_page_token(&self) -> std::string::String {
6272        use std::clone::Clone;
6273        self.next_page_token.clone()
6274    }
6275}
6276
6277/// Message for getting a GitRepositoryLink
6278#[derive(Clone, Default, PartialEq)]
6279#[non_exhaustive]
6280pub struct GetGitRepositoryLinkRequest {
6281    /// Required. Name of the resource
6282    pub name: std::string::String,
6283
6284    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6285}
6286
6287impl GetGitRepositoryLinkRequest {
6288    /// Creates a new default instance.
6289    pub fn new() -> Self {
6290        std::default::Default::default()
6291    }
6292
6293    /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
6294    ///
6295    /// # Example
6296    /// ```ignore,no_run
6297    /// # use google_cloud_developerconnect_v1::model::GetGitRepositoryLinkRequest;
6298    /// # let project_id = "project_id";
6299    /// # let location_id = "location_id";
6300    /// # let connection_id = "connection_id";
6301    /// # let git_repository_link_id = "git_repository_link_id";
6302    /// let x = GetGitRepositoryLinkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6303    /// ```
6304    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6305        self.name = v.into();
6306        self
6307    }
6308}
6309
6310impl wkt::message::Message for GetGitRepositoryLinkRequest {
6311    fn typename() -> &'static str {
6312        "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
6313    }
6314}
6315
6316/// Message for fetching SCM read/write token.
6317#[derive(Clone, Default, PartialEq)]
6318#[non_exhaustive]
6319pub struct FetchReadWriteTokenRequest {
6320    /// Required. The resource name of the gitRepositoryLink in the format
6321    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6322    pub git_repository_link: std::string::String,
6323
6324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6325}
6326
6327impl FetchReadWriteTokenRequest {
6328    /// Creates a new default instance.
6329    pub fn new() -> Self {
6330        std::default::Default::default()
6331    }
6332
6333    /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
6334    ///
6335    /// # Example
6336    /// ```ignore,no_run
6337    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenRequest;
6338    /// # let project_id = "project_id";
6339    /// # let location_id = "location_id";
6340    /// # let connection_id = "connection_id";
6341    /// # let git_repository_link_id = "git_repository_link_id";
6342    /// let x = FetchReadWriteTokenRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6343    /// ```
6344    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6345        mut self,
6346        v: T,
6347    ) -> Self {
6348        self.git_repository_link = v.into();
6349        self
6350    }
6351}
6352
6353impl wkt::message::Message for FetchReadWriteTokenRequest {
6354    fn typename() -> &'static str {
6355        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
6356    }
6357}
6358
6359/// Message for fetching SCM read token.
6360#[derive(Clone, Default, PartialEq)]
6361#[non_exhaustive]
6362pub struct FetchReadTokenRequest {
6363    /// Required. The resource name of the gitRepositoryLink in the format
6364    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6365    pub git_repository_link: std::string::String,
6366
6367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6368}
6369
6370impl FetchReadTokenRequest {
6371    /// Creates a new default instance.
6372    pub fn new() -> Self {
6373        std::default::Default::default()
6374    }
6375
6376    /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
6377    ///
6378    /// # Example
6379    /// ```ignore,no_run
6380    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenRequest;
6381    /// # let project_id = "project_id";
6382    /// # let location_id = "location_id";
6383    /// # let connection_id = "connection_id";
6384    /// # let git_repository_link_id = "git_repository_link_id";
6385    /// let x = FetchReadTokenRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6386    /// ```
6387    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6388        mut self,
6389        v: T,
6390    ) -> Self {
6391        self.git_repository_link = v.into();
6392        self
6393    }
6394}
6395
6396impl wkt::message::Message for FetchReadTokenRequest {
6397    fn typename() -> &'static str {
6398        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
6399    }
6400}
6401
6402/// Message for responding to get read token.
6403#[derive(Clone, Default, PartialEq)]
6404#[non_exhaustive]
6405pub struct FetchReadTokenResponse {
6406    /// The token content.
6407    pub token: std::string::String,
6408
6409    /// Expiration timestamp. Can be empty if unknown or non-expiring.
6410    pub expiration_time: std::option::Option<wkt::Timestamp>,
6411
6412    /// The git_username to specify when making a git clone with the
6413    /// token. For example, for GitHub GitRepositoryLinks, this would be
6414    /// "x-access-token"
6415    pub git_username: std::string::String,
6416
6417    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6418}
6419
6420impl FetchReadTokenResponse {
6421    /// Creates a new default instance.
6422    pub fn new() -> Self {
6423        std::default::Default::default()
6424    }
6425
6426    /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
6427    ///
6428    /// # Example
6429    /// ```ignore,no_run
6430    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6431    /// let x = FetchReadTokenResponse::new().set_token("example");
6432    /// ```
6433    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6434        self.token = v.into();
6435        self
6436    }
6437
6438    /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6439    ///
6440    /// # Example
6441    /// ```ignore,no_run
6442    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6443    /// use wkt::Timestamp;
6444    /// let x = FetchReadTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6445    /// ```
6446    pub fn set_expiration_time<T>(mut self, v: T) -> Self
6447    where
6448        T: std::convert::Into<wkt::Timestamp>,
6449    {
6450        self.expiration_time = std::option::Option::Some(v.into());
6451        self
6452    }
6453
6454    /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6455    ///
6456    /// # Example
6457    /// ```ignore,no_run
6458    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6459    /// use wkt::Timestamp;
6460    /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6461    /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6462    /// ```
6463    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6464    where
6465        T: std::convert::Into<wkt::Timestamp>,
6466    {
6467        self.expiration_time = v.map(|x| x.into());
6468        self
6469    }
6470
6471    /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
6472    ///
6473    /// # Example
6474    /// ```ignore,no_run
6475    /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6476    /// let x = FetchReadTokenResponse::new().set_git_username("example");
6477    /// ```
6478    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6479        self.git_username = v.into();
6480        self
6481    }
6482}
6483
6484impl wkt::message::Message for FetchReadTokenResponse {
6485    fn typename() -> &'static str {
6486        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
6487    }
6488}
6489
6490/// Message for responding to get read/write token.
6491#[derive(Clone, Default, PartialEq)]
6492#[non_exhaustive]
6493pub struct FetchReadWriteTokenResponse {
6494    /// The token content.
6495    pub token: std::string::String,
6496
6497    /// Expiration timestamp. Can be empty if unknown or non-expiring.
6498    pub expiration_time: std::option::Option<wkt::Timestamp>,
6499
6500    /// The git_username to specify when making a git clone with the
6501    /// token. For example, for GitHub GitRepositoryLinks, this would be
6502    /// "x-access-token"
6503    pub git_username: std::string::String,
6504
6505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6506}
6507
6508impl FetchReadWriteTokenResponse {
6509    /// Creates a new default instance.
6510    pub fn new() -> Self {
6511        std::default::Default::default()
6512    }
6513
6514    /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
6515    ///
6516    /// # Example
6517    /// ```ignore,no_run
6518    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6519    /// let x = FetchReadWriteTokenResponse::new().set_token("example");
6520    /// ```
6521    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6522        self.token = v.into();
6523        self
6524    }
6525
6526    /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6527    ///
6528    /// # Example
6529    /// ```ignore,no_run
6530    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6531    /// use wkt::Timestamp;
6532    /// let x = FetchReadWriteTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6533    /// ```
6534    pub fn set_expiration_time<T>(mut self, v: T) -> Self
6535    where
6536        T: std::convert::Into<wkt::Timestamp>,
6537    {
6538        self.expiration_time = std::option::Option::Some(v.into());
6539        self
6540    }
6541
6542    /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6543    ///
6544    /// # Example
6545    /// ```ignore,no_run
6546    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6547    /// use wkt::Timestamp;
6548    /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6549    /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6550    /// ```
6551    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6552    where
6553        T: std::convert::Into<wkt::Timestamp>,
6554    {
6555        self.expiration_time = v.map(|x| x.into());
6556        self
6557    }
6558
6559    /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
6560    ///
6561    /// # Example
6562    /// ```ignore,no_run
6563    /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6564    /// let x = FetchReadWriteTokenResponse::new().set_git_username("example");
6565    /// ```
6566    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6567        self.git_username = v.into();
6568        self
6569    }
6570}
6571
6572impl wkt::message::Message for FetchReadWriteTokenResponse {
6573    fn typename() -> &'static str {
6574        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
6575    }
6576}
6577
6578/// Request message for FetchLinkableGitRepositoriesRequest.
6579#[derive(Clone, Default, PartialEq)]
6580#[non_exhaustive]
6581pub struct FetchLinkableGitRepositoriesRequest {
6582    /// Required. The name of the Connection.
6583    /// Format: `projects/*/locations/*/connections/*`.
6584    pub connection: std::string::String,
6585
6586    /// Optional. Number of results to return in the list. Defaults to 20.
6587    pub page_size: i32,
6588
6589    /// Optional. Page start.
6590    pub page_token: std::string::String,
6591
6592    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6593}
6594
6595impl FetchLinkableGitRepositoriesRequest {
6596    /// Creates a new default instance.
6597    pub fn new() -> Self {
6598        std::default::Default::default()
6599    }
6600
6601    /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
6602    ///
6603    /// # Example
6604    /// ```ignore,no_run
6605    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6606    /// # let project_id = "project_id";
6607    /// # let location_id = "location_id";
6608    /// # let connection_id = "connection_id";
6609    /// let x = FetchLinkableGitRepositoriesRequest::new().set_connection(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6610    /// ```
6611    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6612        self.connection = v.into();
6613        self
6614    }
6615
6616    /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
6617    ///
6618    /// # Example
6619    /// ```ignore,no_run
6620    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6621    /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_size(42);
6622    /// ```
6623    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6624        self.page_size = v.into();
6625        self
6626    }
6627
6628    /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
6629    ///
6630    /// # Example
6631    /// ```ignore,no_run
6632    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6633    /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_token("example");
6634    /// ```
6635    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6636        self.page_token = v.into();
6637        self
6638    }
6639}
6640
6641impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
6642    fn typename() -> &'static str {
6643        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
6644    }
6645}
6646
6647/// Response message for FetchLinkableGitRepositories.
6648#[derive(Clone, Default, PartialEq)]
6649#[non_exhaustive]
6650pub struct FetchLinkableGitRepositoriesResponse {
6651    /// The git repositories that can be linked to the connection.
6652    pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
6653
6654    /// A token identifying a page of results the server should return.
6655    pub next_page_token: std::string::String,
6656
6657    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6658}
6659
6660impl FetchLinkableGitRepositoriesResponse {
6661    /// Creates a new default instance.
6662    pub fn new() -> Self {
6663        std::default::Default::default()
6664    }
6665
6666    /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
6667    ///
6668    /// # Example
6669    /// ```ignore,no_run
6670    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6671    /// use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6672    /// let x = FetchLinkableGitRepositoriesResponse::new()
6673    ///     .set_linkable_git_repositories([
6674    ///         LinkableGitRepository::default()/* use setters */,
6675    ///         LinkableGitRepository::default()/* use (different) setters */,
6676    ///     ]);
6677    /// ```
6678    pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
6679    where
6680        T: std::iter::IntoIterator<Item = V>,
6681        V: std::convert::Into<crate::model::LinkableGitRepository>,
6682    {
6683        use std::iter::Iterator;
6684        self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
6685        self
6686    }
6687
6688    /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
6689    ///
6690    /// # Example
6691    /// ```ignore,no_run
6692    /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6693    /// let x = FetchLinkableGitRepositoriesResponse::new().set_next_page_token("example");
6694    /// ```
6695    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6696        self.next_page_token = v.into();
6697        self
6698    }
6699}
6700
6701impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
6702    fn typename() -> &'static str {
6703        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
6704    }
6705}
6706
6707#[doc(hidden)]
6708impl google_cloud_gax::paginator::internal::PageableResponse
6709    for FetchLinkableGitRepositoriesResponse
6710{
6711    type PageItem = crate::model::LinkableGitRepository;
6712
6713    fn items(self) -> std::vec::Vec<Self::PageItem> {
6714        self.linkable_git_repositories
6715    }
6716
6717    fn next_page_token(&self) -> std::string::String {
6718        use std::clone::Clone;
6719        self.next_page_token.clone()
6720    }
6721}
6722
6723/// LinkableGitRepository represents a git repository that can be linked to a
6724/// connection.
6725#[derive(Clone, Default, PartialEq)]
6726#[non_exhaustive]
6727pub struct LinkableGitRepository {
6728    /// The clone uri of the repository.
6729    pub clone_uri: std::string::String,
6730
6731    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6732}
6733
6734impl LinkableGitRepository {
6735    /// Creates a new default instance.
6736    pub fn new() -> Self {
6737        std::default::Default::default()
6738    }
6739
6740    /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
6741    ///
6742    /// # Example
6743    /// ```ignore,no_run
6744    /// # use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6745    /// let x = LinkableGitRepository::new().set_clone_uri("example");
6746    /// ```
6747    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6748        self.clone_uri = v.into();
6749        self
6750    }
6751}
6752
6753impl wkt::message::Message for LinkableGitRepository {
6754    fn typename() -> &'static str {
6755        "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
6756    }
6757}
6758
6759/// Request for fetching github installations.
6760#[derive(Clone, Default, PartialEq)]
6761#[non_exhaustive]
6762pub struct FetchGitHubInstallationsRequest {
6763    /// Required. The resource name of the connection in the format
6764    /// `projects/*/locations/*/connections/*`.
6765    pub connection: std::string::String,
6766
6767    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6768}
6769
6770impl FetchGitHubInstallationsRequest {
6771    /// Creates a new default instance.
6772    pub fn new() -> Self {
6773        std::default::Default::default()
6774    }
6775
6776    /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
6777    ///
6778    /// # Example
6779    /// ```ignore,no_run
6780    /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsRequest;
6781    /// # let project_id = "project_id";
6782    /// # let location_id = "location_id";
6783    /// # let connection_id = "connection_id";
6784    /// let x = FetchGitHubInstallationsRequest::new().set_connection(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6785    /// ```
6786    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6787        self.connection = v.into();
6788        self
6789    }
6790}
6791
6792impl wkt::message::Message for FetchGitHubInstallationsRequest {
6793    fn typename() -> &'static str {
6794        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
6795    }
6796}
6797
6798/// Response of fetching github installations.
6799#[derive(Clone, Default, PartialEq)]
6800#[non_exhaustive]
6801pub struct FetchGitHubInstallationsResponse {
6802    /// List of installations available to the OAuth user (for github.com)
6803    /// or all the installations (for GitHub enterprise).
6804    pub installations:
6805        std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
6806
6807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6808}
6809
6810impl FetchGitHubInstallationsResponse {
6811    /// Creates a new default instance.
6812    pub fn new() -> Self {
6813        std::default::Default::default()
6814    }
6815
6816    /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
6817    ///
6818    /// # Example
6819    /// ```ignore,no_run
6820    /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsResponse;
6821    /// use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6822    /// let x = FetchGitHubInstallationsResponse::new()
6823    ///     .set_installations([
6824    ///         Installation::default()/* use setters */,
6825    ///         Installation::default()/* use (different) setters */,
6826    ///     ]);
6827    /// ```
6828    pub fn set_installations<T, V>(mut self, v: T) -> Self
6829    where
6830        T: std::iter::IntoIterator<Item = V>,
6831        V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
6832    {
6833        use std::iter::Iterator;
6834        self.installations = v.into_iter().map(|i| i.into()).collect();
6835        self
6836    }
6837}
6838
6839impl wkt::message::Message for FetchGitHubInstallationsResponse {
6840    fn typename() -> &'static str {
6841        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
6842    }
6843}
6844
6845/// Defines additional types related to [FetchGitHubInstallationsResponse].
6846pub mod fetch_git_hub_installations_response {
6847    #[allow(unused_imports)]
6848    use super::*;
6849
6850    /// Represents an installation of the GitHub App.
6851    #[derive(Clone, Default, PartialEq)]
6852    #[non_exhaustive]
6853    pub struct Installation {
6854        /// ID of the installation in GitHub.
6855        pub id: i64,
6856
6857        /// Name of the GitHub user or organization that owns this installation.
6858        pub name: std::string::String,
6859
6860        /// Either "user" or "organization".
6861        pub r#type: std::string::String,
6862
6863        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6864    }
6865
6866    impl Installation {
6867        /// Creates a new default instance.
6868        pub fn new() -> Self {
6869            std::default::Default::default()
6870        }
6871
6872        /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
6873        ///
6874        /// # Example
6875        /// ```ignore,no_run
6876        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6877        /// let x = Installation::new().set_id(42);
6878        /// ```
6879        pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6880            self.id = v.into();
6881            self
6882        }
6883
6884        /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
6885        ///
6886        /// # Example
6887        /// ```ignore,no_run
6888        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6889        /// let x = Installation::new().set_name("example");
6890        /// ```
6891        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6892            self.name = v.into();
6893            self
6894        }
6895
6896        /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
6897        ///
6898        /// # Example
6899        /// ```ignore,no_run
6900        /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6901        /// let x = Installation::new().set_type("example");
6902        /// ```
6903        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6904            self.r#type = v.into();
6905            self
6906        }
6907    }
6908
6909    impl wkt::message::Message for Installation {
6910        fn typename() -> &'static str {
6911            "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
6912        }
6913    }
6914}
6915
6916/// Request for fetching git refs.
6917#[derive(Clone, Default, PartialEq)]
6918#[non_exhaustive]
6919pub struct FetchGitRefsRequest {
6920    /// Required. The resource name of GitRepositoryLink in the format
6921    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6922    pub git_repository_link: std::string::String,
6923
6924    /// Required. Type of refs to fetch.
6925    pub ref_type: crate::model::fetch_git_refs_request::RefType,
6926
6927    /// Optional. Number of results to return in the list. Default to 20.
6928    pub page_size: i32,
6929
6930    /// Optional. Page start.
6931    pub page_token: std::string::String,
6932
6933    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6934}
6935
6936impl FetchGitRefsRequest {
6937    /// Creates a new default instance.
6938    pub fn new() -> Self {
6939        std::default::Default::default()
6940    }
6941
6942    /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
6943    ///
6944    /// # Example
6945    /// ```ignore,no_run
6946    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6947    /// # let project_id = "project_id";
6948    /// # let location_id = "location_id";
6949    /// # let connection_id = "connection_id";
6950    /// # let git_repository_link_id = "git_repository_link_id";
6951    /// let x = FetchGitRefsRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6952    /// ```
6953    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6954        mut self,
6955        v: T,
6956    ) -> Self {
6957        self.git_repository_link = v.into();
6958        self
6959    }
6960
6961    /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
6962    ///
6963    /// # Example
6964    /// ```ignore,no_run
6965    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6966    /// use google_cloud_developerconnect_v1::model::fetch_git_refs_request::RefType;
6967    /// let x0 = FetchGitRefsRequest::new().set_ref_type(RefType::Tag);
6968    /// let x1 = FetchGitRefsRequest::new().set_ref_type(RefType::Branch);
6969    /// ```
6970    pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
6971        mut self,
6972        v: T,
6973    ) -> Self {
6974        self.ref_type = v.into();
6975        self
6976    }
6977
6978    /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
6979    ///
6980    /// # Example
6981    /// ```ignore,no_run
6982    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6983    /// let x = FetchGitRefsRequest::new().set_page_size(42);
6984    /// ```
6985    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6986        self.page_size = v.into();
6987        self
6988    }
6989
6990    /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
6991    ///
6992    /// # Example
6993    /// ```ignore,no_run
6994    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6995    /// let x = FetchGitRefsRequest::new().set_page_token("example");
6996    /// ```
6997    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6998        self.page_token = v.into();
6999        self
7000    }
7001}
7002
7003impl wkt::message::Message for FetchGitRefsRequest {
7004    fn typename() -> &'static str {
7005        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
7006    }
7007}
7008
7009/// Defines additional types related to [FetchGitRefsRequest].
7010pub mod fetch_git_refs_request {
7011    #[allow(unused_imports)]
7012    use super::*;
7013
7014    /// Type of refs.
7015    ///
7016    /// # Working with unknown values
7017    ///
7018    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7019    /// additional enum variants at any time. Adding new variants is not considered
7020    /// a breaking change. Applications should write their code in anticipation of:
7021    ///
7022    /// - New values appearing in future releases of the client library, **and**
7023    /// - New values received dynamically, without application changes.
7024    ///
7025    /// Please consult the [Working with enums] section in the user guide for some
7026    /// guidelines.
7027    ///
7028    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7029    #[derive(Clone, Debug, PartialEq)]
7030    #[non_exhaustive]
7031    pub enum RefType {
7032        /// No type specified.
7033        Unspecified,
7034        /// To fetch tags.
7035        Tag,
7036        /// To fetch branches.
7037        Branch,
7038        /// If set, the enum was initialized with an unknown value.
7039        ///
7040        /// Applications can examine the value using [RefType::value] or
7041        /// [RefType::name].
7042        UnknownValue(ref_type::UnknownValue),
7043    }
7044
7045    #[doc(hidden)]
7046    pub mod ref_type {
7047        #[allow(unused_imports)]
7048        use super::*;
7049        #[derive(Clone, Debug, PartialEq)]
7050        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7051    }
7052
7053    impl RefType {
7054        /// Gets the enum value.
7055        ///
7056        /// Returns `None` if the enum contains an unknown value deserialized from
7057        /// the string representation of enums.
7058        pub fn value(&self) -> std::option::Option<i32> {
7059            match self {
7060                Self::Unspecified => std::option::Option::Some(0),
7061                Self::Tag => std::option::Option::Some(1),
7062                Self::Branch => std::option::Option::Some(2),
7063                Self::UnknownValue(u) => u.0.value(),
7064            }
7065        }
7066
7067        /// Gets the enum value as a string.
7068        ///
7069        /// Returns `None` if the enum contains an unknown value deserialized from
7070        /// the integer representation of enums.
7071        pub fn name(&self) -> std::option::Option<&str> {
7072            match self {
7073                Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
7074                Self::Tag => std::option::Option::Some("TAG"),
7075                Self::Branch => std::option::Option::Some("BRANCH"),
7076                Self::UnknownValue(u) => u.0.name(),
7077            }
7078        }
7079    }
7080
7081    impl std::default::Default for RefType {
7082        fn default() -> Self {
7083            use std::convert::From;
7084            Self::from(0)
7085        }
7086    }
7087
7088    impl std::fmt::Display for RefType {
7089        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7090            wkt::internal::display_enum(f, self.name(), self.value())
7091        }
7092    }
7093
7094    impl std::convert::From<i32> for RefType {
7095        fn from(value: i32) -> Self {
7096            match value {
7097                0 => Self::Unspecified,
7098                1 => Self::Tag,
7099                2 => Self::Branch,
7100                _ => Self::UnknownValue(ref_type::UnknownValue(
7101                    wkt::internal::UnknownEnumValue::Integer(value),
7102                )),
7103            }
7104        }
7105    }
7106
7107    impl std::convert::From<&str> for RefType {
7108        fn from(value: &str) -> Self {
7109            use std::string::ToString;
7110            match value {
7111                "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
7112                "TAG" => Self::Tag,
7113                "BRANCH" => Self::Branch,
7114                _ => Self::UnknownValue(ref_type::UnknownValue(
7115                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7116                )),
7117            }
7118        }
7119    }
7120
7121    impl serde::ser::Serialize for RefType {
7122        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7123        where
7124            S: serde::Serializer,
7125        {
7126            match self {
7127                Self::Unspecified => serializer.serialize_i32(0),
7128                Self::Tag => serializer.serialize_i32(1),
7129                Self::Branch => serializer.serialize_i32(2),
7130                Self::UnknownValue(u) => u.0.serialize(serializer),
7131            }
7132        }
7133    }
7134
7135    impl<'de> serde::de::Deserialize<'de> for RefType {
7136        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7137        where
7138            D: serde::Deserializer<'de>,
7139        {
7140            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
7141                ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
7142            ))
7143        }
7144    }
7145}
7146
7147/// Response for fetching git refs.
7148#[derive(Clone, Default, PartialEq)]
7149#[non_exhaustive]
7150pub struct FetchGitRefsResponse {
7151    /// Name of the refs fetched.
7152    pub ref_names: std::vec::Vec<std::string::String>,
7153
7154    /// A token identifying a page of results the server should return.
7155    pub next_page_token: std::string::String,
7156
7157    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7158}
7159
7160impl FetchGitRefsResponse {
7161    /// Creates a new default instance.
7162    pub fn new() -> Self {
7163        std::default::Default::default()
7164    }
7165
7166    /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
7167    ///
7168    /// # Example
7169    /// ```ignore,no_run
7170    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7171    /// let x = FetchGitRefsResponse::new().set_ref_names(["a", "b", "c"]);
7172    /// ```
7173    pub fn set_ref_names<T, V>(mut self, v: T) -> Self
7174    where
7175        T: std::iter::IntoIterator<Item = V>,
7176        V: std::convert::Into<std::string::String>,
7177    {
7178        use std::iter::Iterator;
7179        self.ref_names = v.into_iter().map(|i| i.into()).collect();
7180        self
7181    }
7182
7183    /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
7184    ///
7185    /// # Example
7186    /// ```ignore,no_run
7187    /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7188    /// let x = FetchGitRefsResponse::new().set_next_page_token("example");
7189    /// ```
7190    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7191        self.next_page_token = v.into();
7192        self
7193    }
7194}
7195
7196impl wkt::message::Message for FetchGitRefsResponse {
7197    fn typename() -> &'static str {
7198        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
7199    }
7200}
7201
7202/// AccountConnector encapsulates what a platform administrator needs to
7203/// configure for users to connect to the service providers, which includes,
7204/// among other fields, the OAuth client ID, client secret, and authorization and
7205/// token endpoints.
7206#[derive(Clone, Default, PartialEq)]
7207#[non_exhaustive]
7208pub struct AccountConnector {
7209    /// Identifier. The resource name of the accountConnector, in the format
7210    /// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
7211    pub name: std::string::String,
7212
7213    /// Output only. The timestamp when the accountConnector was created.
7214    pub create_time: std::option::Option<wkt::Timestamp>,
7215
7216    /// Output only. The timestamp when the accountConnector was updated.
7217    pub update_time: std::option::Option<wkt::Timestamp>,
7218
7219    /// Optional. Allows users to store small amounts of arbitrary data.
7220    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7221
7222    /// Optional. This checksum is computed by the server based on the value of
7223    /// other fields, and may be sent on update and delete requests to ensure the
7224    /// client has an up-to-date value before proceeding.
7225    pub etag: std::string::String,
7226
7227    /// Optional. Labels as key value pairs
7228    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7229
7230    /// Output only. Start OAuth flow by clicking on this URL.
7231    pub oauth_start_uri: std::string::String,
7232
7233    /// The AccountConnector config.
7234    pub account_connector_config:
7235        std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
7236
7237    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7238}
7239
7240impl AccountConnector {
7241    /// Creates a new default instance.
7242    pub fn new() -> Self {
7243        std::default::Default::default()
7244    }
7245
7246    /// Sets the value of [name][crate::model::AccountConnector::name].
7247    ///
7248    /// # Example
7249    /// ```ignore,no_run
7250    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7251    /// # let project_id = "project_id";
7252    /// # let location_id = "location_id";
7253    /// # let account_connector_id = "account_connector_id";
7254    /// let x = AccountConnector::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
7255    /// ```
7256    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7257        self.name = v.into();
7258        self
7259    }
7260
7261    /// Sets the value of [create_time][crate::model::AccountConnector::create_time].
7262    ///
7263    /// # Example
7264    /// ```ignore,no_run
7265    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7266    /// use wkt::Timestamp;
7267    /// let x = AccountConnector::new().set_create_time(Timestamp::default()/* use setters */);
7268    /// ```
7269    pub fn set_create_time<T>(mut self, v: T) -> Self
7270    where
7271        T: std::convert::Into<wkt::Timestamp>,
7272    {
7273        self.create_time = std::option::Option::Some(v.into());
7274        self
7275    }
7276
7277    /// Sets or clears the value of [create_time][crate::model::AccountConnector::create_time].
7278    ///
7279    /// # Example
7280    /// ```ignore,no_run
7281    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7282    /// use wkt::Timestamp;
7283    /// let x = AccountConnector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7284    /// let x = AccountConnector::new().set_or_clear_create_time(None::<Timestamp>);
7285    /// ```
7286    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7287    where
7288        T: std::convert::Into<wkt::Timestamp>,
7289    {
7290        self.create_time = v.map(|x| x.into());
7291        self
7292    }
7293
7294    /// Sets the value of [update_time][crate::model::AccountConnector::update_time].
7295    ///
7296    /// # Example
7297    /// ```ignore,no_run
7298    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7299    /// use wkt::Timestamp;
7300    /// let x = AccountConnector::new().set_update_time(Timestamp::default()/* use setters */);
7301    /// ```
7302    pub fn set_update_time<T>(mut self, v: T) -> Self
7303    where
7304        T: std::convert::Into<wkt::Timestamp>,
7305    {
7306        self.update_time = std::option::Option::Some(v.into());
7307        self
7308    }
7309
7310    /// Sets or clears the value of [update_time][crate::model::AccountConnector::update_time].
7311    ///
7312    /// # Example
7313    /// ```ignore,no_run
7314    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7315    /// use wkt::Timestamp;
7316    /// let x = AccountConnector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7317    /// let x = AccountConnector::new().set_or_clear_update_time(None::<Timestamp>);
7318    /// ```
7319    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7320    where
7321        T: std::convert::Into<wkt::Timestamp>,
7322    {
7323        self.update_time = v.map(|x| x.into());
7324        self
7325    }
7326
7327    /// Sets the value of [annotations][crate::model::AccountConnector::annotations].
7328    ///
7329    /// # Example
7330    /// ```ignore,no_run
7331    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7332    /// let x = AccountConnector::new().set_annotations([
7333    ///     ("key0", "abc"),
7334    ///     ("key1", "xyz"),
7335    /// ]);
7336    /// ```
7337    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7338    where
7339        T: std::iter::IntoIterator<Item = (K, V)>,
7340        K: std::convert::Into<std::string::String>,
7341        V: std::convert::Into<std::string::String>,
7342    {
7343        use std::iter::Iterator;
7344        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7345        self
7346    }
7347
7348    /// Sets the value of [etag][crate::model::AccountConnector::etag].
7349    ///
7350    /// # Example
7351    /// ```ignore,no_run
7352    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7353    /// let x = AccountConnector::new().set_etag("example");
7354    /// ```
7355    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7356        self.etag = v.into();
7357        self
7358    }
7359
7360    /// Sets the value of [labels][crate::model::AccountConnector::labels].
7361    ///
7362    /// # Example
7363    /// ```ignore,no_run
7364    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7365    /// let x = AccountConnector::new().set_labels([
7366    ///     ("key0", "abc"),
7367    ///     ("key1", "xyz"),
7368    /// ]);
7369    /// ```
7370    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7371    where
7372        T: std::iter::IntoIterator<Item = (K, V)>,
7373        K: std::convert::Into<std::string::String>,
7374        V: std::convert::Into<std::string::String>,
7375    {
7376        use std::iter::Iterator;
7377        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7378        self
7379    }
7380
7381    /// Sets the value of [oauth_start_uri][crate::model::AccountConnector::oauth_start_uri].
7382    ///
7383    /// # Example
7384    /// ```ignore,no_run
7385    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7386    /// let x = AccountConnector::new().set_oauth_start_uri("example");
7387    /// ```
7388    pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7389        self.oauth_start_uri = v.into();
7390        self
7391    }
7392
7393    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config].
7394    ///
7395    /// Note that all the setters affecting `account_connector_config` are mutually
7396    /// exclusive.
7397    ///
7398    /// # Example
7399    /// ```ignore,no_run
7400    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7401    /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7402    /// let x = AccountConnector::new().set_account_connector_config(Some(
7403    ///     google_cloud_developerconnect_v1::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(ProviderOAuthConfig::default().into())));
7404    /// ```
7405    pub fn set_account_connector_config<
7406        T: std::convert::Into<
7407                std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
7408            >,
7409    >(
7410        mut self,
7411        v: T,
7412    ) -> Self {
7413        self.account_connector_config = v.into();
7414        self
7415    }
7416
7417    /// The value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
7418    /// if it holds a `ProviderOauthConfig`, `None` if the field is not set or
7419    /// holds a different branch.
7420    pub fn provider_oauth_config(
7421        &self,
7422    ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
7423        #[allow(unreachable_patterns)]
7424        self.account_connector_config
7425            .as_ref()
7426            .and_then(|v| match v {
7427                crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
7428                    std::option::Option::Some(v)
7429                }
7430                _ => std::option::Option::None,
7431            })
7432    }
7433
7434    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
7435    /// to hold a `ProviderOauthConfig`.
7436    ///
7437    /// Note that all the setters affecting `account_connector_config` are
7438    /// mutually exclusive.
7439    ///
7440    /// # Example
7441    /// ```ignore,no_run
7442    /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7443    /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7444    /// let x = AccountConnector::new().set_provider_oauth_config(ProviderOAuthConfig::default()/* use setters */);
7445    /// assert!(x.provider_oauth_config().is_some());
7446    /// ```
7447    pub fn set_provider_oauth_config<
7448        T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
7449    >(
7450        mut self,
7451        v: T,
7452    ) -> Self {
7453        self.account_connector_config = std::option::Option::Some(
7454            crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
7455        );
7456        self
7457    }
7458}
7459
7460impl wkt::message::Message for AccountConnector {
7461    fn typename() -> &'static str {
7462        "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
7463    }
7464}
7465
7466/// Defines additional types related to [AccountConnector].
7467pub mod account_connector {
7468    #[allow(unused_imports)]
7469    use super::*;
7470
7471    /// The AccountConnector config.
7472    #[derive(Clone, Debug, PartialEq)]
7473    #[non_exhaustive]
7474    pub enum AccountConnectorConfig {
7475        /// Optional. Provider OAuth config.
7476        ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
7477    }
7478}
7479
7480/// User represents a user connected to the service providers through
7481/// a AccountConnector.
7482#[derive(Clone, Default, PartialEq)]
7483#[non_exhaustive]
7484pub struct User {
7485    /// Identifier. Resource name of the user, in the format
7486    /// `projects/*/locations/*/accountConnectors/*/users/*`.
7487    pub name: std::string::String,
7488
7489    /// Output only. Developer Connect automatically converts user identity
7490    /// to some human readable description, e.g., email address.
7491    pub display_name: std::string::String,
7492
7493    /// Output only. The timestamp when the user was created.
7494    pub create_time: std::option::Option<wkt::Timestamp>,
7495
7496    /// Output only. The timestamp when the token was last requested.
7497    pub last_token_request_time: std::option::Option<wkt::Timestamp>,
7498
7499    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7500}
7501
7502impl User {
7503    /// Creates a new default instance.
7504    pub fn new() -> Self {
7505        std::default::Default::default()
7506    }
7507
7508    /// Sets the value of [name][crate::model::User::name].
7509    ///
7510    /// # Example
7511    /// ```ignore,no_run
7512    /// # use google_cloud_developerconnect_v1::model::User;
7513    /// # let project_id = "project_id";
7514    /// # let location_id = "location_id";
7515    /// # let account_connector_id = "account_connector_id";
7516    /// # let user_id = "user_id";
7517    /// let x = User::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}/users/{user_id}"));
7518    /// ```
7519    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7520        self.name = v.into();
7521        self
7522    }
7523
7524    /// Sets the value of [display_name][crate::model::User::display_name].
7525    ///
7526    /// # Example
7527    /// ```ignore,no_run
7528    /// # use google_cloud_developerconnect_v1::model::User;
7529    /// let x = User::new().set_display_name("example");
7530    /// ```
7531    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7532        self.display_name = v.into();
7533        self
7534    }
7535
7536    /// Sets the value of [create_time][crate::model::User::create_time].
7537    ///
7538    /// # Example
7539    /// ```ignore,no_run
7540    /// # use google_cloud_developerconnect_v1::model::User;
7541    /// use wkt::Timestamp;
7542    /// let x = User::new().set_create_time(Timestamp::default()/* use setters */);
7543    /// ```
7544    pub fn set_create_time<T>(mut self, v: T) -> Self
7545    where
7546        T: std::convert::Into<wkt::Timestamp>,
7547    {
7548        self.create_time = std::option::Option::Some(v.into());
7549        self
7550    }
7551
7552    /// Sets or clears the value of [create_time][crate::model::User::create_time].
7553    ///
7554    /// # Example
7555    /// ```ignore,no_run
7556    /// # use google_cloud_developerconnect_v1::model::User;
7557    /// use wkt::Timestamp;
7558    /// let x = User::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7559    /// let x = User::new().set_or_clear_create_time(None::<Timestamp>);
7560    /// ```
7561    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7562    where
7563        T: std::convert::Into<wkt::Timestamp>,
7564    {
7565        self.create_time = v.map(|x| x.into());
7566        self
7567    }
7568
7569    /// Sets the value of [last_token_request_time][crate::model::User::last_token_request_time].
7570    ///
7571    /// # Example
7572    /// ```ignore,no_run
7573    /// # use google_cloud_developerconnect_v1::model::User;
7574    /// use wkt::Timestamp;
7575    /// let x = User::new().set_last_token_request_time(Timestamp::default()/* use setters */);
7576    /// ```
7577    pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
7578    where
7579        T: std::convert::Into<wkt::Timestamp>,
7580    {
7581        self.last_token_request_time = std::option::Option::Some(v.into());
7582        self
7583    }
7584
7585    /// Sets or clears the value of [last_token_request_time][crate::model::User::last_token_request_time].
7586    ///
7587    /// # Example
7588    /// ```ignore,no_run
7589    /// # use google_cloud_developerconnect_v1::model::User;
7590    /// use wkt::Timestamp;
7591    /// let x = User::new().set_or_clear_last_token_request_time(Some(Timestamp::default()/* use setters */));
7592    /// let x = User::new().set_or_clear_last_token_request_time(None::<Timestamp>);
7593    /// ```
7594    pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
7595    where
7596        T: std::convert::Into<wkt::Timestamp>,
7597    {
7598        self.last_token_request_time = v.map(|x| x.into());
7599        self
7600    }
7601}
7602
7603impl wkt::message::Message for User {
7604    fn typename() -> &'static str {
7605        "type.googleapis.com/google.cloud.developerconnect.v1.User"
7606    }
7607}
7608
7609/// ProviderOAuthConfig is the OAuth config for a provider.
7610#[derive(Clone, Default, PartialEq)]
7611#[non_exhaustive]
7612pub struct ProviderOAuthConfig {
7613    /// Required. User selected scopes to apply to the Oauth config
7614    /// In the event of changing scopes, user records under AccountConnector will
7615    /// be deleted and users will re-auth again.
7616    pub scopes: std::vec::Vec<std::string::String>,
7617
7618    /// OAuth Provider ID. It could be Developer Connect owned or providers
7619    /// provided.
7620    pub oauth_provider_id:
7621        std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
7622
7623    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7624}
7625
7626impl ProviderOAuthConfig {
7627    /// Creates a new default instance.
7628    pub fn new() -> Self {
7629        std::default::Default::default()
7630    }
7631
7632    /// Sets the value of [scopes][crate::model::ProviderOAuthConfig::scopes].
7633    ///
7634    /// # Example
7635    /// ```ignore,no_run
7636    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7637    /// let x = ProviderOAuthConfig::new().set_scopes(["a", "b", "c"]);
7638    /// ```
7639    pub fn set_scopes<T, V>(mut self, v: T) -> Self
7640    where
7641        T: std::iter::IntoIterator<Item = V>,
7642        V: std::convert::Into<std::string::String>,
7643    {
7644        use std::iter::Iterator;
7645        self.scopes = v.into_iter().map(|i| i.into()).collect();
7646        self
7647    }
7648
7649    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id].
7650    ///
7651    /// Note that all the setters affecting `oauth_provider_id` are mutually
7652    /// exclusive.
7653    ///
7654    /// # Example
7655    /// ```ignore,no_run
7656    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7657    /// use google_cloud_developerconnect_v1::model::SystemProvider;
7658    /// let x0 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7659    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Github)));
7660    /// let x1 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7661    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Gitlab)));
7662    /// let x2 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7663    ///     google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Google)));
7664    /// ```
7665    pub fn set_oauth_provider_id<
7666        T: std::convert::Into<
7667                std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
7668            >,
7669    >(
7670        mut self,
7671        v: T,
7672    ) -> Self {
7673        self.oauth_provider_id = v.into();
7674        self
7675    }
7676
7677    /// The value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
7678    /// if it holds a `SystemProviderId`, `None` if the field is not set or
7679    /// holds a different branch.
7680    pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
7681        #[allow(unreachable_patterns)]
7682        self.oauth_provider_id.as_ref().and_then(|v| match v {
7683            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
7684                std::option::Option::Some(v)
7685            }
7686            _ => std::option::Option::None,
7687        })
7688    }
7689
7690    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
7691    /// to hold a `SystemProviderId`.
7692    ///
7693    /// Note that all the setters affecting `oauth_provider_id` are
7694    /// mutually exclusive.
7695    ///
7696    /// # Example
7697    /// ```ignore,no_run
7698    /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7699    /// use google_cloud_developerconnect_v1::model::SystemProvider;
7700    /// let x0 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Github);
7701    /// let x1 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Gitlab);
7702    /// let x2 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Google);
7703    /// assert!(x0.system_provider_id().is_some());
7704    /// assert!(x1.system_provider_id().is_some());
7705    /// assert!(x2.system_provider_id().is_some());
7706    /// ```
7707    pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
7708        mut self,
7709        v: T,
7710    ) -> Self {
7711        self.oauth_provider_id = std::option::Option::Some(
7712            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
7713        );
7714        self
7715    }
7716}
7717
7718impl wkt::message::Message for ProviderOAuthConfig {
7719    fn typename() -> &'static str {
7720        "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
7721    }
7722}
7723
7724/// Defines additional types related to [ProviderOAuthConfig].
7725pub mod provider_o_auth_config {
7726    #[allow(unused_imports)]
7727    use super::*;
7728
7729    /// OAuth Provider ID. It could be Developer Connect owned or providers
7730    /// provided.
7731    #[derive(Clone, Debug, PartialEq)]
7732    #[non_exhaustive]
7733    pub enum OauthProviderId {
7734        /// Optional. Immutable. Developer Connect provided OAuth.
7735        SystemProviderId(crate::model::SystemProvider),
7736    }
7737}
7738
7739/// The InsightsConfig resource is the core configuration object to capture
7740/// events from your Software Development Lifecycle. It acts as the central hub
7741/// for managing how Developer Connect understands your application, its runtime
7742/// environments, and the artifacts deployed within them.
7743#[derive(Clone, Default, PartialEq)]
7744#[non_exhaustive]
7745pub struct InsightsConfig {
7746    /// Identifier. The name of the InsightsConfig.
7747    /// Format:
7748    /// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
7749    pub name: std::string::String,
7750
7751    /// Output only. Create timestamp.
7752    pub create_time: std::option::Option<wkt::Timestamp>,
7753
7754    /// Output only. Update timestamp.
7755    pub update_time: std::option::Option<wkt::Timestamp>,
7756
7757    /// Output only. The runtime configurations where the application is deployed.
7758    pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
7759
7760    /// Optional. The artifact configurations of the artifacts that are deployed.
7761    pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
7762
7763    /// Optional. Output only. The state of the InsightsConfig.
7764    pub state: crate::model::insights_config::State,
7765
7766    /// Optional. User specified annotations. See
7767    /// <https://google.aip.dev/148#annotations> for more details such as format and
7768    /// size limitations.
7769    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7770
7771    /// Optional. Set of labels associated with an InsightsConfig.
7772    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7773
7774    /// Output only. Reconciling (<https://google.aip.dev/128#reconciliation>).
7775    /// Set to true if the current state of InsightsConfig does not match the
7776    /// user's intended state, and the service is actively updating the resource to
7777    /// reconcile them. This can happen due to user-triggered updates or
7778    /// system actions like failover or maintenance.
7779    pub reconciling: bool,
7780
7781    /// Output only. Any errors that occurred while setting up the InsightsConfig.
7782    /// Each error will be in the format: `field_name: error_message`, e.g.
7783    /// GetAppHubApplication: Permission denied while getting App Hub
7784    /// application. Please grant permissions to the P4SA.
7785    pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
7786
7787    /// The context of the InsightsConfig.
7788    pub insights_config_context:
7789        std::option::Option<crate::model::insights_config::InsightsConfigContext>,
7790
7791    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7792}
7793
7794impl InsightsConfig {
7795    /// Creates a new default instance.
7796    pub fn new() -> Self {
7797        std::default::Default::default()
7798    }
7799
7800    /// Sets the value of [name][crate::model::InsightsConfig::name].
7801    ///
7802    /// # Example
7803    /// ```ignore,no_run
7804    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7805    /// # let project_id = "project_id";
7806    /// # let location_id = "location_id";
7807    /// # let insights_config_id = "insights_config_id";
7808    /// let x = InsightsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
7809    /// ```
7810    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7811        self.name = v.into();
7812        self
7813    }
7814
7815    /// Sets the value of [create_time][crate::model::InsightsConfig::create_time].
7816    ///
7817    /// # Example
7818    /// ```ignore,no_run
7819    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7820    /// use wkt::Timestamp;
7821    /// let x = InsightsConfig::new().set_create_time(Timestamp::default()/* use setters */);
7822    /// ```
7823    pub fn set_create_time<T>(mut self, v: T) -> Self
7824    where
7825        T: std::convert::Into<wkt::Timestamp>,
7826    {
7827        self.create_time = std::option::Option::Some(v.into());
7828        self
7829    }
7830
7831    /// Sets or clears the value of [create_time][crate::model::InsightsConfig::create_time].
7832    ///
7833    /// # Example
7834    /// ```ignore,no_run
7835    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7836    /// use wkt::Timestamp;
7837    /// let x = InsightsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7838    /// let x = InsightsConfig::new().set_or_clear_create_time(None::<Timestamp>);
7839    /// ```
7840    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7841    where
7842        T: std::convert::Into<wkt::Timestamp>,
7843    {
7844        self.create_time = v.map(|x| x.into());
7845        self
7846    }
7847
7848    /// Sets the value of [update_time][crate::model::InsightsConfig::update_time].
7849    ///
7850    /// # Example
7851    /// ```ignore,no_run
7852    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7853    /// use wkt::Timestamp;
7854    /// let x = InsightsConfig::new().set_update_time(Timestamp::default()/* use setters */);
7855    /// ```
7856    pub fn set_update_time<T>(mut self, v: T) -> Self
7857    where
7858        T: std::convert::Into<wkt::Timestamp>,
7859    {
7860        self.update_time = std::option::Option::Some(v.into());
7861        self
7862    }
7863
7864    /// Sets or clears the value of [update_time][crate::model::InsightsConfig::update_time].
7865    ///
7866    /// # Example
7867    /// ```ignore,no_run
7868    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7869    /// use wkt::Timestamp;
7870    /// let x = InsightsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7871    /// let x = InsightsConfig::new().set_or_clear_update_time(None::<Timestamp>);
7872    /// ```
7873    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7874    where
7875        T: std::convert::Into<wkt::Timestamp>,
7876    {
7877        self.update_time = v.map(|x| x.into());
7878        self
7879    }
7880
7881    /// Sets the value of [runtime_configs][crate::model::InsightsConfig::runtime_configs].
7882    ///
7883    /// # Example
7884    /// ```ignore,no_run
7885    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7886    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
7887    /// let x = InsightsConfig::new()
7888    ///     .set_runtime_configs([
7889    ///         RuntimeConfig::default()/* use setters */,
7890    ///         RuntimeConfig::default()/* use (different) setters */,
7891    ///     ]);
7892    /// ```
7893    pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
7894    where
7895        T: std::iter::IntoIterator<Item = V>,
7896        V: std::convert::Into<crate::model::RuntimeConfig>,
7897    {
7898        use std::iter::Iterator;
7899        self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
7900        self
7901    }
7902
7903    /// Sets the value of [artifact_configs][crate::model::InsightsConfig::artifact_configs].
7904    ///
7905    /// # Example
7906    /// ```ignore,no_run
7907    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7908    /// use google_cloud_developerconnect_v1::model::ArtifactConfig;
7909    /// let x = InsightsConfig::new()
7910    ///     .set_artifact_configs([
7911    ///         ArtifactConfig::default()/* use setters */,
7912    ///         ArtifactConfig::default()/* use (different) setters */,
7913    ///     ]);
7914    /// ```
7915    pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
7916    where
7917        T: std::iter::IntoIterator<Item = V>,
7918        V: std::convert::Into<crate::model::ArtifactConfig>,
7919    {
7920        use std::iter::Iterator;
7921        self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
7922        self
7923    }
7924
7925    /// Sets the value of [state][crate::model::InsightsConfig::state].
7926    ///
7927    /// # Example
7928    /// ```ignore,no_run
7929    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7930    /// use google_cloud_developerconnect_v1::model::insights_config::State;
7931    /// let x0 = InsightsConfig::new().set_state(State::Pending);
7932    /// let x1 = InsightsConfig::new().set_state(State::Complete);
7933    /// let x2 = InsightsConfig::new().set_state(State::Error);
7934    /// ```
7935    pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
7936        mut self,
7937        v: T,
7938    ) -> Self {
7939        self.state = v.into();
7940        self
7941    }
7942
7943    /// Sets the value of [annotations][crate::model::InsightsConfig::annotations].
7944    ///
7945    /// # Example
7946    /// ```ignore,no_run
7947    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7948    /// let x = InsightsConfig::new().set_annotations([
7949    ///     ("key0", "abc"),
7950    ///     ("key1", "xyz"),
7951    /// ]);
7952    /// ```
7953    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7954    where
7955        T: std::iter::IntoIterator<Item = (K, V)>,
7956        K: std::convert::Into<std::string::String>,
7957        V: std::convert::Into<std::string::String>,
7958    {
7959        use std::iter::Iterator;
7960        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7961        self
7962    }
7963
7964    /// Sets the value of [labels][crate::model::InsightsConfig::labels].
7965    ///
7966    /// # Example
7967    /// ```ignore,no_run
7968    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7969    /// let x = InsightsConfig::new().set_labels([
7970    ///     ("key0", "abc"),
7971    ///     ("key1", "xyz"),
7972    /// ]);
7973    /// ```
7974    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7975    where
7976        T: std::iter::IntoIterator<Item = (K, V)>,
7977        K: std::convert::Into<std::string::String>,
7978        V: std::convert::Into<std::string::String>,
7979    {
7980        use std::iter::Iterator;
7981        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7982        self
7983    }
7984
7985    /// Sets the value of [reconciling][crate::model::InsightsConfig::reconciling].
7986    ///
7987    /// # Example
7988    /// ```ignore,no_run
7989    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7990    /// let x = InsightsConfig::new().set_reconciling(true);
7991    /// ```
7992    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7993        self.reconciling = v.into();
7994        self
7995    }
7996
7997    /// Sets the value of [errors][crate::model::InsightsConfig::errors].
7998    ///
7999    /// # Example
8000    /// ```ignore,no_run
8001    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
8002    /// use google_cloud_rpc::model::Status;
8003    /// let x = InsightsConfig::new()
8004    ///     .set_errors([
8005    ///         Status::default()/* use setters */,
8006    ///         Status::default()/* use (different) setters */,
8007    ///     ]);
8008    /// ```
8009    pub fn set_errors<T, V>(mut self, v: T) -> Self
8010    where
8011        T: std::iter::IntoIterator<Item = V>,
8012        V: std::convert::Into<google_cloud_rpc::model::Status>,
8013    {
8014        use std::iter::Iterator;
8015        self.errors = v.into_iter().map(|i| i.into()).collect();
8016        self
8017    }
8018
8019    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context].
8020    ///
8021    /// Note that all the setters affecting `insights_config_context` are mutually
8022    /// exclusive.
8023    ///
8024    /// # Example
8025    /// ```ignore,no_run
8026    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
8027    /// use google_cloud_developerconnect_v1::model::insights_config::InsightsConfigContext;
8028    /// let x = InsightsConfig::new().set_insights_config_context(Some(InsightsConfigContext::AppHubApplication("example".to_string())));
8029    /// ```
8030    pub fn set_insights_config_context<
8031        T: std::convert::Into<
8032                std::option::Option<crate::model::insights_config::InsightsConfigContext>,
8033            >,
8034    >(
8035        mut self,
8036        v: T,
8037    ) -> Self {
8038        self.insights_config_context = v.into();
8039        self
8040    }
8041
8042    /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
8043    /// if it holds a `AppHubApplication`, `None` if the field is not set or
8044    /// holds a different branch.
8045    pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
8046        #[allow(unreachable_patterns)]
8047        self.insights_config_context.as_ref().and_then(|v| match v {
8048            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
8049                std::option::Option::Some(v)
8050            }
8051            _ => std::option::Option::None,
8052        })
8053    }
8054
8055    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
8056    /// to hold a `AppHubApplication`.
8057    ///
8058    /// Note that all the setters affecting `insights_config_context` are
8059    /// mutually exclusive.
8060    ///
8061    /// # Example
8062    /// ```ignore,no_run
8063    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
8064    /// let x = InsightsConfig::new().set_app_hub_application("example");
8065    /// assert!(x.app_hub_application().is_some());
8066    /// assert!(x.projects().is_none());
8067    /// ```
8068    pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
8069        mut self,
8070        v: T,
8071    ) -> Self {
8072        self.insights_config_context = std::option::Option::Some(
8073            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
8074        );
8075        self
8076    }
8077
8078    /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
8079    /// if it holds a `Projects`, `None` if the field is not set or
8080    /// holds a different branch.
8081    pub fn projects(&self) -> std::option::Option<&std::boxed::Box<crate::model::Projects>> {
8082        #[allow(unreachable_patterns)]
8083        self.insights_config_context.as_ref().and_then(|v| match v {
8084            crate::model::insights_config::InsightsConfigContext::Projects(v) => {
8085                std::option::Option::Some(v)
8086            }
8087            _ => std::option::Option::None,
8088        })
8089    }
8090
8091    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
8092    /// to hold a `Projects`.
8093    ///
8094    /// Note that all the setters affecting `insights_config_context` are
8095    /// mutually exclusive.
8096    ///
8097    /// # Example
8098    /// ```ignore,no_run
8099    /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
8100    /// use google_cloud_developerconnect_v1::model::Projects;
8101    /// let x = InsightsConfig::new().set_projects(Projects::default()/* use setters */);
8102    /// assert!(x.projects().is_some());
8103    /// assert!(x.app_hub_application().is_none());
8104    /// ```
8105    pub fn set_projects<T: std::convert::Into<std::boxed::Box<crate::model::Projects>>>(
8106        mut self,
8107        v: T,
8108    ) -> Self {
8109        self.insights_config_context = std::option::Option::Some(
8110            crate::model::insights_config::InsightsConfigContext::Projects(v.into()),
8111        );
8112        self
8113    }
8114}
8115
8116impl wkt::message::Message for InsightsConfig {
8117    fn typename() -> &'static str {
8118        "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
8119    }
8120}
8121
8122/// Defines additional types related to [InsightsConfig].
8123pub mod insights_config {
8124    #[allow(unused_imports)]
8125    use super::*;
8126
8127    /// The state of the InsightsConfig.
8128    ///
8129    /// # Working with unknown values
8130    ///
8131    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8132    /// additional enum variants at any time. Adding new variants is not considered
8133    /// a breaking change. Applications should write their code in anticipation of:
8134    ///
8135    /// - New values appearing in future releases of the client library, **and**
8136    /// - New values received dynamically, without application changes.
8137    ///
8138    /// Please consult the [Working with enums] section in the user guide for some
8139    /// guidelines.
8140    ///
8141    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8142    #[derive(Clone, Debug, PartialEq)]
8143    #[non_exhaustive]
8144    pub enum State {
8145        /// No state specified.
8146        Unspecified,
8147        /// The InsightsConfig is pending application discovery/runtime discovery.
8148        Pending,
8149        /// The initial discovery process is complete.
8150        Complete,
8151        /// The InsightsConfig is in an error state.
8152        Error,
8153        /// If set, the enum was initialized with an unknown value.
8154        ///
8155        /// Applications can examine the value using [State::value] or
8156        /// [State::name].
8157        UnknownValue(state::UnknownValue),
8158    }
8159
8160    #[doc(hidden)]
8161    pub mod state {
8162        #[allow(unused_imports)]
8163        use super::*;
8164        #[derive(Clone, Debug, PartialEq)]
8165        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8166    }
8167
8168    impl State {
8169        /// Gets the enum value.
8170        ///
8171        /// Returns `None` if the enum contains an unknown value deserialized from
8172        /// the string representation of enums.
8173        pub fn value(&self) -> std::option::Option<i32> {
8174            match self {
8175                Self::Unspecified => std::option::Option::Some(0),
8176                Self::Pending => std::option::Option::Some(5),
8177                Self::Complete => std::option::Option::Some(3),
8178                Self::Error => std::option::Option::Some(4),
8179                Self::UnknownValue(u) => u.0.value(),
8180            }
8181        }
8182
8183        /// Gets the enum value as a string.
8184        ///
8185        /// Returns `None` if the enum contains an unknown value deserialized from
8186        /// the integer representation of enums.
8187        pub fn name(&self) -> std::option::Option<&str> {
8188            match self {
8189                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8190                Self::Pending => std::option::Option::Some("PENDING"),
8191                Self::Complete => std::option::Option::Some("COMPLETE"),
8192                Self::Error => std::option::Option::Some("ERROR"),
8193                Self::UnknownValue(u) => u.0.name(),
8194            }
8195        }
8196    }
8197
8198    impl std::default::Default for State {
8199        fn default() -> Self {
8200            use std::convert::From;
8201            Self::from(0)
8202        }
8203    }
8204
8205    impl std::fmt::Display for State {
8206        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8207            wkt::internal::display_enum(f, self.name(), self.value())
8208        }
8209    }
8210
8211    impl std::convert::From<i32> for State {
8212        fn from(value: i32) -> Self {
8213            match value {
8214                0 => Self::Unspecified,
8215                3 => Self::Complete,
8216                4 => Self::Error,
8217                5 => Self::Pending,
8218                _ => Self::UnknownValue(state::UnknownValue(
8219                    wkt::internal::UnknownEnumValue::Integer(value),
8220                )),
8221            }
8222        }
8223    }
8224
8225    impl std::convert::From<&str> for State {
8226        fn from(value: &str) -> Self {
8227            use std::string::ToString;
8228            match value {
8229                "STATE_UNSPECIFIED" => Self::Unspecified,
8230                "PENDING" => Self::Pending,
8231                "COMPLETE" => Self::Complete,
8232                "ERROR" => Self::Error,
8233                _ => Self::UnknownValue(state::UnknownValue(
8234                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8235                )),
8236            }
8237        }
8238    }
8239
8240    impl serde::ser::Serialize for State {
8241        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8242        where
8243            S: serde::Serializer,
8244        {
8245            match self {
8246                Self::Unspecified => serializer.serialize_i32(0),
8247                Self::Pending => serializer.serialize_i32(5),
8248                Self::Complete => serializer.serialize_i32(3),
8249                Self::Error => serializer.serialize_i32(4),
8250                Self::UnknownValue(u) => u.0.serialize(serializer),
8251            }
8252        }
8253    }
8254
8255    impl<'de> serde::de::Deserialize<'de> for State {
8256        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8257        where
8258            D: serde::Deserializer<'de>,
8259        {
8260            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8261                ".google.cloud.developerconnect.v1.InsightsConfig.State",
8262            ))
8263        }
8264    }
8265
8266    /// The context of the InsightsConfig.
8267    #[derive(Clone, Debug, PartialEq)]
8268    #[non_exhaustive]
8269    pub enum InsightsConfigContext {
8270        /// Optional. The name of the App Hub Application.
8271        /// Format:
8272        /// projects/{project}/locations/{location}/applications/{application}
8273        AppHubApplication(std::string::String),
8274        /// Optional. The projects to track with the InsightsConfig.
8275        Projects(std::boxed::Box<crate::model::Projects>),
8276    }
8277}
8278
8279/// Projects represents the projects to track with the InsightsConfig.
8280#[derive(Clone, Default, PartialEq)]
8281#[non_exhaustive]
8282pub struct Projects {
8283    /// Optional. The project IDs.
8284    /// Format: {project}
8285    pub project_ids: std::vec::Vec<std::string::String>,
8286
8287    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8288}
8289
8290impl Projects {
8291    /// Creates a new default instance.
8292    pub fn new() -> Self {
8293        std::default::Default::default()
8294    }
8295
8296    /// Sets the value of [project_ids][crate::model::Projects::project_ids].
8297    ///
8298    /// # Example
8299    /// ```ignore,no_run
8300    /// # use google_cloud_developerconnect_v1::model::Projects;
8301    /// let x = Projects::new().set_project_ids(["a", "b", "c"]);
8302    /// ```
8303    pub fn set_project_ids<T, V>(mut self, v: T) -> Self
8304    where
8305        T: std::iter::IntoIterator<Item = V>,
8306        V: std::convert::Into<std::string::String>,
8307    {
8308        use std::iter::Iterator;
8309        self.project_ids = v.into_iter().map(|i| i.into()).collect();
8310        self
8311    }
8312}
8313
8314impl wkt::message::Message for Projects {
8315    fn typename() -> &'static str {
8316        "type.googleapis.com/google.cloud.developerconnect.v1.Projects"
8317    }
8318}
8319
8320/// RuntimeConfig represents the runtimes where the application is
8321/// deployed.
8322#[derive(Clone, Default, PartialEq)]
8323#[non_exhaustive]
8324pub struct RuntimeConfig {
8325    /// Required. Immutable. The URI of the runtime configuration.
8326    /// For GKE, this is the cluster name.
8327    /// For Cloud Run, this is the service name.
8328    pub uri: std::string::String,
8329
8330    /// Output only. The state of the Runtime.
8331    pub state: crate::model::runtime_config::State,
8332
8333    /// The type of the runtime.
8334    pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
8335
8336    /// Where the runtime is derived from.
8337    pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
8338
8339    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8340}
8341
8342impl RuntimeConfig {
8343    /// Creates a new default instance.
8344    pub fn new() -> Self {
8345        std::default::Default::default()
8346    }
8347
8348    /// Sets the value of [uri][crate::model::RuntimeConfig::uri].
8349    ///
8350    /// # Example
8351    /// ```ignore,no_run
8352    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8353    /// let x = RuntimeConfig::new().set_uri("example");
8354    /// ```
8355    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8356        self.uri = v.into();
8357        self
8358    }
8359
8360    /// Sets the value of [state][crate::model::RuntimeConfig::state].
8361    ///
8362    /// # Example
8363    /// ```ignore,no_run
8364    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8365    /// use google_cloud_developerconnect_v1::model::runtime_config::State;
8366    /// let x0 = RuntimeConfig::new().set_state(State::Linked);
8367    /// let x1 = RuntimeConfig::new().set_state(State::Unlinked);
8368    /// ```
8369    pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
8370        mut self,
8371        v: T,
8372    ) -> Self {
8373        self.state = v.into();
8374        self
8375    }
8376
8377    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime].
8378    ///
8379    /// Note that all the setters affecting `runtime` are mutually
8380    /// exclusive.
8381    ///
8382    /// # Example
8383    /// ```ignore,no_run
8384    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8385    /// use google_cloud_developerconnect_v1::model::GKEWorkload;
8386    /// let x = RuntimeConfig::new().set_runtime(Some(
8387    ///     google_cloud_developerconnect_v1::model::runtime_config::Runtime::GkeWorkload(GKEWorkload::default().into())));
8388    /// ```
8389    pub fn set_runtime<
8390        T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
8391    >(
8392        mut self,
8393        v: T,
8394    ) -> Self {
8395        self.runtime = v.into();
8396        self
8397    }
8398
8399    /// The value of [runtime][crate::model::RuntimeConfig::runtime]
8400    /// if it holds a `GkeWorkload`, `None` if the field is not set or
8401    /// holds a different branch.
8402    pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
8403        #[allow(unreachable_patterns)]
8404        self.runtime.as_ref().and_then(|v| match v {
8405            crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
8406            _ => std::option::Option::None,
8407        })
8408    }
8409
8410    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
8411    /// to hold a `GkeWorkload`.
8412    ///
8413    /// Note that all the setters affecting `runtime` are
8414    /// mutually exclusive.
8415    ///
8416    /// # Example
8417    /// ```ignore,no_run
8418    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8419    /// use google_cloud_developerconnect_v1::model::GKEWorkload;
8420    /// let x = RuntimeConfig::new().set_gke_workload(GKEWorkload::default()/* use setters */);
8421    /// assert!(x.gke_workload().is_some());
8422    /// assert!(x.google_cloud_run().is_none());
8423    /// ```
8424    pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
8425        mut self,
8426        v: T,
8427    ) -> Self {
8428        self.runtime =
8429            std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
8430        self
8431    }
8432
8433    /// The value of [runtime][crate::model::RuntimeConfig::runtime]
8434    /// if it holds a `GoogleCloudRun`, `None` if the field is not set or
8435    /// holds a different branch.
8436    pub fn google_cloud_run(
8437        &self,
8438    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleCloudRun>> {
8439        #[allow(unreachable_patterns)]
8440        self.runtime.as_ref().and_then(|v| match v {
8441            crate::model::runtime_config::Runtime::GoogleCloudRun(v) => {
8442                std::option::Option::Some(v)
8443            }
8444            _ => std::option::Option::None,
8445        })
8446    }
8447
8448    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
8449    /// to hold a `GoogleCloudRun`.
8450    ///
8451    /// Note that all the setters affecting `runtime` are
8452    /// mutually exclusive.
8453    ///
8454    /// # Example
8455    /// ```ignore,no_run
8456    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8457    /// use google_cloud_developerconnect_v1::model::GoogleCloudRun;
8458    /// let x = RuntimeConfig::new().set_google_cloud_run(GoogleCloudRun::default()/* use setters */);
8459    /// assert!(x.google_cloud_run().is_some());
8460    /// assert!(x.gke_workload().is_none());
8461    /// ```
8462    pub fn set_google_cloud_run<
8463        T: std::convert::Into<std::boxed::Box<crate::model::GoogleCloudRun>>,
8464    >(
8465        mut self,
8466        v: T,
8467    ) -> Self {
8468        self.runtime = std::option::Option::Some(
8469            crate::model::runtime_config::Runtime::GoogleCloudRun(v.into()),
8470        );
8471        self
8472    }
8473
8474    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from].
8475    ///
8476    /// Note that all the setters affecting `derived_from` are mutually
8477    /// exclusive.
8478    ///
8479    /// # Example
8480    /// ```ignore,no_run
8481    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8482    /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
8483    /// let x = RuntimeConfig::new().set_derived_from(Some(
8484    ///     google_cloud_developerconnect_v1::model::runtime_config::DerivedFrom::AppHubWorkload(AppHubWorkload::default().into())));
8485    /// ```
8486    pub fn set_derived_from<
8487        T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
8488    >(
8489        mut self,
8490        v: T,
8491    ) -> Self {
8492        self.derived_from = v.into();
8493        self
8494    }
8495
8496    /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
8497    /// if it holds a `AppHubWorkload`, `None` if the field is not set or
8498    /// holds a different branch.
8499    pub fn app_hub_workload(
8500        &self,
8501    ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
8502        #[allow(unreachable_patterns)]
8503        self.derived_from.as_ref().and_then(|v| match v {
8504            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
8505                std::option::Option::Some(v)
8506            }
8507            _ => std::option::Option::None,
8508        })
8509    }
8510
8511    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
8512    /// to hold a `AppHubWorkload`.
8513    ///
8514    /// Note that all the setters affecting `derived_from` are
8515    /// mutually exclusive.
8516    ///
8517    /// # Example
8518    /// ```ignore,no_run
8519    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8520    /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
8521    /// let x = RuntimeConfig::new().set_app_hub_workload(AppHubWorkload::default()/* use setters */);
8522    /// assert!(x.app_hub_workload().is_some());
8523    /// assert!(x.app_hub_service().is_none());
8524    /// ```
8525    pub fn set_app_hub_workload<
8526        T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
8527    >(
8528        mut self,
8529        v: T,
8530    ) -> Self {
8531        self.derived_from = std::option::Option::Some(
8532            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
8533        );
8534        self
8535    }
8536
8537    /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
8538    /// if it holds a `AppHubService`, `None` if the field is not set or
8539    /// holds a different branch.
8540    pub fn app_hub_service(
8541        &self,
8542    ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubService>> {
8543        #[allow(unreachable_patterns)]
8544        self.derived_from.as_ref().and_then(|v| match v {
8545            crate::model::runtime_config::DerivedFrom::AppHubService(v) => {
8546                std::option::Option::Some(v)
8547            }
8548            _ => std::option::Option::None,
8549        })
8550    }
8551
8552    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
8553    /// to hold a `AppHubService`.
8554    ///
8555    /// Note that all the setters affecting `derived_from` are
8556    /// mutually exclusive.
8557    ///
8558    /// # Example
8559    /// ```ignore,no_run
8560    /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8561    /// use google_cloud_developerconnect_v1::model::AppHubService;
8562    /// let x = RuntimeConfig::new().set_app_hub_service(AppHubService::default()/* use setters */);
8563    /// assert!(x.app_hub_service().is_some());
8564    /// assert!(x.app_hub_workload().is_none());
8565    /// ```
8566    pub fn set_app_hub_service<
8567        T: std::convert::Into<std::boxed::Box<crate::model::AppHubService>>,
8568    >(
8569        mut self,
8570        v: T,
8571    ) -> Self {
8572        self.derived_from = std::option::Option::Some(
8573            crate::model::runtime_config::DerivedFrom::AppHubService(v.into()),
8574        );
8575        self
8576    }
8577}
8578
8579impl wkt::message::Message for RuntimeConfig {
8580    fn typename() -> &'static str {
8581        "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
8582    }
8583}
8584
8585/// Defines additional types related to [RuntimeConfig].
8586pub mod runtime_config {
8587    #[allow(unused_imports)]
8588    use super::*;
8589
8590    /// The state of the runtime in the InsightsConfig.
8591    /// Whether the runtime is linked to the InsightsConfig.
8592    ///
8593    /// # Working with unknown values
8594    ///
8595    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8596    /// additional enum variants at any time. Adding new variants is not considered
8597    /// a breaking change. Applications should write their code in anticipation of:
8598    ///
8599    /// - New values appearing in future releases of the client library, **and**
8600    /// - New values received dynamically, without application changes.
8601    ///
8602    /// Please consult the [Working with enums] section in the user guide for some
8603    /// guidelines.
8604    ///
8605    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8606    #[derive(Clone, Debug, PartialEq)]
8607    #[non_exhaustive]
8608    pub enum State {
8609        /// No state specified.
8610        Unspecified,
8611        /// The runtime configuration has been linked to the InsightsConfig.
8612        Linked,
8613        /// The runtime configuration has been unlinked to the InsightsConfig.
8614        Unlinked,
8615        /// If set, the enum was initialized with an unknown value.
8616        ///
8617        /// Applications can examine the value using [State::value] or
8618        /// [State::name].
8619        UnknownValue(state::UnknownValue),
8620    }
8621
8622    #[doc(hidden)]
8623    pub mod state {
8624        #[allow(unused_imports)]
8625        use super::*;
8626        #[derive(Clone, Debug, PartialEq)]
8627        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8628    }
8629
8630    impl State {
8631        /// Gets the enum value.
8632        ///
8633        /// Returns `None` if the enum contains an unknown value deserialized from
8634        /// the string representation of enums.
8635        pub fn value(&self) -> std::option::Option<i32> {
8636            match self {
8637                Self::Unspecified => std::option::Option::Some(0),
8638                Self::Linked => std::option::Option::Some(1),
8639                Self::Unlinked => std::option::Option::Some(2),
8640                Self::UnknownValue(u) => u.0.value(),
8641            }
8642        }
8643
8644        /// Gets the enum value as a string.
8645        ///
8646        /// Returns `None` if the enum contains an unknown value deserialized from
8647        /// the integer representation of enums.
8648        pub fn name(&self) -> std::option::Option<&str> {
8649            match self {
8650                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8651                Self::Linked => std::option::Option::Some("LINKED"),
8652                Self::Unlinked => std::option::Option::Some("UNLINKED"),
8653                Self::UnknownValue(u) => u.0.name(),
8654            }
8655        }
8656    }
8657
8658    impl std::default::Default for State {
8659        fn default() -> Self {
8660            use std::convert::From;
8661            Self::from(0)
8662        }
8663    }
8664
8665    impl std::fmt::Display for State {
8666        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8667            wkt::internal::display_enum(f, self.name(), self.value())
8668        }
8669    }
8670
8671    impl std::convert::From<i32> for State {
8672        fn from(value: i32) -> Self {
8673            match value {
8674                0 => Self::Unspecified,
8675                1 => Self::Linked,
8676                2 => Self::Unlinked,
8677                _ => Self::UnknownValue(state::UnknownValue(
8678                    wkt::internal::UnknownEnumValue::Integer(value),
8679                )),
8680            }
8681        }
8682    }
8683
8684    impl std::convert::From<&str> for State {
8685        fn from(value: &str) -> Self {
8686            use std::string::ToString;
8687            match value {
8688                "STATE_UNSPECIFIED" => Self::Unspecified,
8689                "LINKED" => Self::Linked,
8690                "UNLINKED" => Self::Unlinked,
8691                _ => Self::UnknownValue(state::UnknownValue(
8692                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8693                )),
8694            }
8695        }
8696    }
8697
8698    impl serde::ser::Serialize for State {
8699        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8700        where
8701            S: serde::Serializer,
8702        {
8703            match self {
8704                Self::Unspecified => serializer.serialize_i32(0),
8705                Self::Linked => serializer.serialize_i32(1),
8706                Self::Unlinked => serializer.serialize_i32(2),
8707                Self::UnknownValue(u) => u.0.serialize(serializer),
8708            }
8709        }
8710    }
8711
8712    impl<'de> serde::de::Deserialize<'de> for State {
8713        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8714        where
8715            D: serde::Deserializer<'de>,
8716        {
8717            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8718                ".google.cloud.developerconnect.v1.RuntimeConfig.State",
8719            ))
8720        }
8721    }
8722
8723    /// The type of the runtime.
8724    #[derive(Clone, Debug, PartialEq)]
8725    #[non_exhaustive]
8726    pub enum Runtime {
8727        /// Output only. Google Kubernetes Engine runtime.
8728        GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
8729        /// Output only. Cloud Run runtime.
8730        GoogleCloudRun(std::boxed::Box<crate::model::GoogleCloudRun>),
8731    }
8732
8733    /// Where the runtime is derived from.
8734    #[derive(Clone, Debug, PartialEq)]
8735    #[non_exhaustive]
8736    pub enum DerivedFrom {
8737        /// Output only. App Hub Workload.
8738        AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
8739        /// Output only. App Hub Service.
8740        AppHubService(std::boxed::Box<crate::model::AppHubService>),
8741    }
8742}
8743
8744/// GKEWorkload represents the Google Kubernetes Engine runtime.
8745#[derive(Clone, Default, PartialEq)]
8746#[non_exhaustive]
8747pub struct GKEWorkload {
8748    /// Required. Immutable. The name of the GKE cluster.
8749    /// Format:
8750    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
8751    pub cluster: std::string::String,
8752
8753    /// Output only. The name of the GKE deployment.
8754    /// Format:
8755    /// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
8756    pub deployment: std::string::String,
8757
8758    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8759}
8760
8761impl GKEWorkload {
8762    /// Creates a new default instance.
8763    pub fn new() -> Self {
8764        std::default::Default::default()
8765    }
8766
8767    /// Sets the value of [cluster][crate::model::GKEWorkload::cluster].
8768    ///
8769    /// # Example
8770    /// ```ignore,no_run
8771    /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
8772    /// let x = GKEWorkload::new().set_cluster("example");
8773    /// ```
8774    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8775        self.cluster = v.into();
8776        self
8777    }
8778
8779    /// Sets the value of [deployment][crate::model::GKEWorkload::deployment].
8780    ///
8781    /// # Example
8782    /// ```ignore,no_run
8783    /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
8784    /// let x = GKEWorkload::new().set_deployment("example");
8785    /// ```
8786    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8787        self.deployment = v.into();
8788        self
8789    }
8790}
8791
8792impl wkt::message::Message for GKEWorkload {
8793    fn typename() -> &'static str {
8794        "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
8795    }
8796}
8797
8798/// GoogleCloudRun represents the Cloud Run runtime.
8799#[derive(Clone, Default, PartialEq)]
8800#[non_exhaustive]
8801pub struct GoogleCloudRun {
8802    /// Required. Immutable. The name of the Cloud Run service.
8803    /// Format:
8804    /// `projects/{project}/locations/{location}/services/{service}`.
8805    pub service_uri: std::string::String,
8806
8807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8808}
8809
8810impl GoogleCloudRun {
8811    /// Creates a new default instance.
8812    pub fn new() -> Self {
8813        std::default::Default::default()
8814    }
8815
8816    /// Sets the value of [service_uri][crate::model::GoogleCloudRun::service_uri].
8817    ///
8818    /// # Example
8819    /// ```ignore,no_run
8820    /// # use google_cloud_developerconnect_v1::model::GoogleCloudRun;
8821    /// let x = GoogleCloudRun::new().set_service_uri("example");
8822    /// ```
8823    pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8824        self.service_uri = v.into();
8825        self
8826    }
8827}
8828
8829impl wkt::message::Message for GoogleCloudRun {
8830    fn typename() -> &'static str {
8831        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleCloudRun"
8832    }
8833}
8834
8835/// AppHubWorkload represents the App Hub Workload.
8836#[derive(Clone, Default, PartialEq)]
8837#[non_exhaustive]
8838pub struct AppHubWorkload {
8839    /// Required. Output only. Immutable. The name of the App Hub Workload.
8840    /// Format:
8841    /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
8842    pub workload: std::string::String,
8843
8844    /// Output only. The criticality of the App Hub Workload.
8845    pub criticality: std::string::String,
8846
8847    /// Output only. The environment of the App Hub Workload.
8848    pub environment: std::string::String,
8849
8850    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8851}
8852
8853impl AppHubWorkload {
8854    /// Creates a new default instance.
8855    pub fn new() -> Self {
8856        std::default::Default::default()
8857    }
8858
8859    /// Sets the value of [workload][crate::model::AppHubWorkload::workload].
8860    ///
8861    /// # Example
8862    /// ```ignore,no_run
8863    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8864    /// let x = AppHubWorkload::new().set_workload("example");
8865    /// ```
8866    pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8867        self.workload = v.into();
8868        self
8869    }
8870
8871    /// Sets the value of [criticality][crate::model::AppHubWorkload::criticality].
8872    ///
8873    /// # Example
8874    /// ```ignore,no_run
8875    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8876    /// let x = AppHubWorkload::new().set_criticality("example");
8877    /// ```
8878    pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8879        self.criticality = v.into();
8880        self
8881    }
8882
8883    /// Sets the value of [environment][crate::model::AppHubWorkload::environment].
8884    ///
8885    /// # Example
8886    /// ```ignore,no_run
8887    /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8888    /// let x = AppHubWorkload::new().set_environment("example");
8889    /// ```
8890    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8891        self.environment = v.into();
8892        self
8893    }
8894}
8895
8896impl wkt::message::Message for AppHubWorkload {
8897    fn typename() -> &'static str {
8898        "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
8899    }
8900}
8901
8902/// AppHubService represents the App Hub Service.
8903#[derive(Clone, Default, PartialEq)]
8904#[non_exhaustive]
8905pub struct AppHubService {
8906    /// Required. Output only. Immutable. The name of the App Hub Service.
8907    /// Format:
8908    /// `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
8909    pub apphub_service: std::string::String,
8910
8911    /// Output only. The criticality of the App Hub Service.
8912    pub criticality: std::string::String,
8913
8914    /// Output only. The environment of the App Hub Service.
8915    pub environment: std::string::String,
8916
8917    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8918}
8919
8920impl AppHubService {
8921    /// Creates a new default instance.
8922    pub fn new() -> Self {
8923        std::default::Default::default()
8924    }
8925
8926    /// Sets the value of [apphub_service][crate::model::AppHubService::apphub_service].
8927    ///
8928    /// # Example
8929    /// ```ignore,no_run
8930    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8931    /// let x = AppHubService::new().set_apphub_service("example");
8932    /// ```
8933    pub fn set_apphub_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8934        self.apphub_service = v.into();
8935        self
8936    }
8937
8938    /// Sets the value of [criticality][crate::model::AppHubService::criticality].
8939    ///
8940    /// # Example
8941    /// ```ignore,no_run
8942    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8943    /// let x = AppHubService::new().set_criticality("example");
8944    /// ```
8945    pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8946        self.criticality = v.into();
8947        self
8948    }
8949
8950    /// Sets the value of [environment][crate::model::AppHubService::environment].
8951    ///
8952    /// # Example
8953    /// ```ignore,no_run
8954    /// # use google_cloud_developerconnect_v1::model::AppHubService;
8955    /// let x = AppHubService::new().set_environment("example");
8956    /// ```
8957    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8958        self.environment = v.into();
8959        self
8960    }
8961}
8962
8963impl wkt::message::Message for AppHubService {
8964    fn typename() -> &'static str {
8965        "type.googleapis.com/google.cloud.developerconnect.v1.AppHubService"
8966    }
8967}
8968
8969/// The artifact config of the artifact that is deployed.
8970#[derive(Clone, Default, PartialEq)]
8971#[non_exhaustive]
8972pub struct ArtifactConfig {
8973    /// Required. Immutable. The URI of the artifact that is deployed.
8974    /// e.g. `us-docker.pkg.dev/my-project/my-repo/image`.
8975    /// The URI does not include the tag / digest because it captures a lineage of
8976    /// artifacts.
8977    pub uri: std::string::String,
8978
8979    /// The storage location of the artifact.
8980    pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
8981
8982    /// The storage location of the artifact metadata.
8983    pub artifact_metadata_storage:
8984        std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
8985
8986    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8987}
8988
8989impl ArtifactConfig {
8990    /// Creates a new default instance.
8991    pub fn new() -> Self {
8992        std::default::Default::default()
8993    }
8994
8995    /// Sets the value of [uri][crate::model::ArtifactConfig::uri].
8996    ///
8997    /// # Example
8998    /// ```ignore,no_run
8999    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9000    /// let x = ArtifactConfig::new().set_uri("example");
9001    /// ```
9002    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9003        self.uri = v.into();
9004        self
9005    }
9006
9007    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage].
9008    ///
9009    /// Note that all the setters affecting `artifact_storage` are mutually
9010    /// exclusive.
9011    ///
9012    /// # Example
9013    /// ```ignore,no_run
9014    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9015    /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9016    /// let x = ArtifactConfig::new().set_artifact_storage(Some(
9017    ///     google_cloud_developerconnect_v1::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(GoogleArtifactRegistry::default().into())));
9018    /// ```
9019    pub fn set_artifact_storage<
9020        T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
9021    >(
9022        mut self,
9023        v: T,
9024    ) -> Self {
9025        self.artifact_storage = v.into();
9026        self
9027    }
9028
9029    /// The value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
9030    /// if it holds a `GoogleArtifactRegistry`, `None` if the field is not set or
9031    /// holds a different branch.
9032    pub fn google_artifact_registry(
9033        &self,
9034    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
9035        #[allow(unreachable_patterns)]
9036        self.artifact_storage.as_ref().and_then(|v| match v {
9037            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
9038                std::option::Option::Some(v)
9039            }
9040            _ => std::option::Option::None,
9041        })
9042    }
9043
9044    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
9045    /// to hold a `GoogleArtifactRegistry`.
9046    ///
9047    /// Note that all the setters affecting `artifact_storage` are
9048    /// mutually exclusive.
9049    ///
9050    /// # Example
9051    /// ```ignore,no_run
9052    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9053    /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9054    /// let x = ArtifactConfig::new().set_google_artifact_registry(GoogleArtifactRegistry::default()/* use setters */);
9055    /// assert!(x.google_artifact_registry().is_some());
9056    /// ```
9057    pub fn set_google_artifact_registry<
9058        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
9059    >(
9060        mut self,
9061        v: T,
9062    ) -> Self {
9063        self.artifact_storage = std::option::Option::Some(
9064            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
9065        );
9066        self
9067    }
9068
9069    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage].
9070    ///
9071    /// Note that all the setters affecting `artifact_metadata_storage` are mutually
9072    /// exclusive.
9073    ///
9074    /// # Example
9075    /// ```ignore,no_run
9076    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9077    /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
9078    /// let x = ArtifactConfig::new().set_artifact_metadata_storage(Some(
9079    ///     google_cloud_developerconnect_v1::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(GoogleArtifactAnalysis::default().into())));
9080    /// ```
9081    pub fn set_artifact_metadata_storage<
9082        T: std::convert::Into<
9083                std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
9084            >,
9085    >(
9086        mut self,
9087        v: T,
9088    ) -> Self {
9089        self.artifact_metadata_storage = v.into();
9090        self
9091    }
9092
9093    /// The value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
9094    /// if it holds a `GoogleArtifactAnalysis`, `None` if the field is not set or
9095    /// holds a different branch.
9096    pub fn google_artifact_analysis(
9097        &self,
9098    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
9099        #[allow(unreachable_patterns)]
9100        self.artifact_metadata_storage
9101            .as_ref()
9102            .and_then(|v| match v {
9103                crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
9104                    v,
9105                ) => std::option::Option::Some(v),
9106                _ => std::option::Option::None,
9107            })
9108    }
9109
9110    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
9111    /// to hold a `GoogleArtifactAnalysis`.
9112    ///
9113    /// Note that all the setters affecting `artifact_metadata_storage` are
9114    /// mutually exclusive.
9115    ///
9116    /// # Example
9117    /// ```ignore,no_run
9118    /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9119    /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
9120    /// let x = ArtifactConfig::new().set_google_artifact_analysis(GoogleArtifactAnalysis::default()/* use setters */);
9121    /// assert!(x.google_artifact_analysis().is_some());
9122    /// ```
9123    pub fn set_google_artifact_analysis<
9124        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
9125    >(
9126        mut self,
9127        v: T,
9128    ) -> Self {
9129        self.artifact_metadata_storage = std::option::Option::Some(
9130            crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
9131                v.into(),
9132            ),
9133        );
9134        self
9135    }
9136}
9137
9138impl wkt::message::Message for ArtifactConfig {
9139    fn typename() -> &'static str {
9140        "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
9141    }
9142}
9143
9144/// Defines additional types related to [ArtifactConfig].
9145pub mod artifact_config {
9146    #[allow(unused_imports)]
9147    use super::*;
9148
9149    /// The storage location of the artifact.
9150    #[derive(Clone, Debug, PartialEq)]
9151    #[non_exhaustive]
9152    pub enum ArtifactStorage {
9153        /// Optional. Set if the artifact is stored in Artifact registry.
9154        GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
9155    }
9156
9157    /// The storage location of the artifact metadata.
9158    #[derive(Clone, Debug, PartialEq)]
9159    #[non_exhaustive]
9160    pub enum ArtifactMetadataStorage {
9161        /// Optional. Set if the artifact metadata is stored in Artifact analysis.
9162        GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
9163    }
9164}
9165
9166/// Google Artifact Analysis configurations.
9167#[derive(Clone, Default, PartialEq)]
9168#[non_exhaustive]
9169pub struct GoogleArtifactAnalysis {
9170    /// Required. The project id of the project where the provenance is stored.
9171    pub project_id: std::string::String,
9172
9173    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9174}
9175
9176impl GoogleArtifactAnalysis {
9177    /// Creates a new default instance.
9178    pub fn new() -> Self {
9179        std::default::Default::default()
9180    }
9181
9182    /// Sets the value of [project_id][crate::model::GoogleArtifactAnalysis::project_id].
9183    ///
9184    /// # Example
9185    /// ```ignore,no_run
9186    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
9187    /// let x = GoogleArtifactAnalysis::new().set_project_id("example");
9188    /// ```
9189    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9190        self.project_id = v.into();
9191        self
9192    }
9193}
9194
9195impl wkt::message::Message for GoogleArtifactAnalysis {
9196    fn typename() -> &'static str {
9197        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
9198    }
9199}
9200
9201/// Google Artifact Registry configurations.
9202#[derive(Clone, Default, PartialEq)]
9203#[non_exhaustive]
9204pub struct GoogleArtifactRegistry {
9205    /// Required. The host project of Artifact Registry.
9206    pub project_id: std::string::String,
9207
9208    /// Required. Immutable. The name of the artifact registry package.
9209    pub artifact_registry_package: std::string::String,
9210
9211    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9212}
9213
9214impl GoogleArtifactRegistry {
9215    /// Creates a new default instance.
9216    pub fn new() -> Self {
9217        std::default::Default::default()
9218    }
9219
9220    /// Sets the value of [project_id][crate::model::GoogleArtifactRegistry::project_id].
9221    ///
9222    /// # Example
9223    /// ```ignore,no_run
9224    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9225    /// let x = GoogleArtifactRegistry::new().set_project_id("example");
9226    /// ```
9227    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9228        self.project_id = v.into();
9229        self
9230    }
9231
9232    /// Sets the value of [artifact_registry_package][crate::model::GoogleArtifactRegistry::artifact_registry_package].
9233    ///
9234    /// # Example
9235    /// ```ignore,no_run
9236    /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9237    /// let x = GoogleArtifactRegistry::new().set_artifact_registry_package("example");
9238    /// ```
9239    pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
9240        mut self,
9241        v: T,
9242    ) -> Self {
9243        self.artifact_registry_package = v.into();
9244        self
9245    }
9246}
9247
9248impl wkt::message::Message for GoogleArtifactRegistry {
9249    fn typename() -> &'static str {
9250        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
9251    }
9252}
9253
9254/// The DeploymentEvent resource represents the deployment of the artifact within
9255/// the InsightsConfig resource.
9256#[derive(Clone, Default, PartialEq)]
9257#[non_exhaustive]
9258pub struct DeploymentEvent {
9259    /// Identifier. The name of the DeploymentEvent. This name is provided by
9260    /// Developer Connect insights. Format:
9261    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
9262    pub name: std::string::String,
9263
9264    /// Output only. The create time of the DeploymentEvent.
9265    pub create_time: std::option::Option<wkt::Timestamp>,
9266
9267    /// Output only. The update time of the DeploymentEvent.
9268    pub update_time: std::option::Option<wkt::Timestamp>,
9269
9270    /// Output only. The runtime configurations where the DeploymentEvent happened.
9271    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
9272
9273    /// Output only. The runtime assigned URI of the DeploymentEvent.
9274    /// For GKE, this is the fully qualified replica set uri.
9275    /// e.g.
9276    /// container.googleapis.com/projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/apps/replicasets/{replica-set-id}
9277    /// For Cloud Run, this is the revision name.
9278    pub runtime_deployment_uri: std::string::String,
9279
9280    /// Output only. The state of the DeploymentEvent.
9281    pub state: crate::model::deployment_event::State,
9282
9283    /// Output only. The artifact deployments of the DeploymentEvent. Each artifact
9284    /// deployment contains the artifact uri and the runtime configuration uri. For
9285    /// GKE, this would be all the containers images that are deployed in the pod.
9286    pub artifact_deployments: std::vec::Vec<crate::model::ArtifactDeployment>,
9287
9288    /// Output only. The time at which the DeploymentEvent was deployed.
9289    /// This would be the min of all ArtifactDeployment deploy_times.
9290    pub deploy_time: std::option::Option<wkt::Timestamp>,
9291
9292    /// Output only. The time at which the DeploymentEvent was undeployed, all
9293    /// artifacts are considered undeployed once this time is set. This would be
9294    /// the max of all ArtifactDeployment undeploy_times. If any ArtifactDeployment
9295    /// is still active (i.e. does not have an undeploy_time), this field will be
9296    /// empty.
9297    pub undeploy_time: std::option::Option<wkt::Timestamp>,
9298
9299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9300}
9301
9302impl DeploymentEvent {
9303    /// Creates a new default instance.
9304    pub fn new() -> Self {
9305        std::default::Default::default()
9306    }
9307
9308    /// Sets the value of [name][crate::model::DeploymentEvent::name].
9309    ///
9310    /// # Example
9311    /// ```ignore,no_run
9312    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9313    /// # let project_id = "project_id";
9314    /// # let location_id = "location_id";
9315    /// # let insights_config_id = "insights_config_id";
9316    /// # let deployment_event_id = "deployment_event_id";
9317    /// let x = DeploymentEvent::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}/deploymentEvents/{deployment_event_id}"));
9318    /// ```
9319    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9320        self.name = v.into();
9321        self
9322    }
9323
9324    /// Sets the value of [create_time][crate::model::DeploymentEvent::create_time].
9325    ///
9326    /// # Example
9327    /// ```ignore,no_run
9328    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9329    /// use wkt::Timestamp;
9330    /// let x = DeploymentEvent::new().set_create_time(Timestamp::default()/* use setters */);
9331    /// ```
9332    pub fn set_create_time<T>(mut self, v: T) -> Self
9333    where
9334        T: std::convert::Into<wkt::Timestamp>,
9335    {
9336        self.create_time = std::option::Option::Some(v.into());
9337        self
9338    }
9339
9340    /// Sets or clears the value of [create_time][crate::model::DeploymentEvent::create_time].
9341    ///
9342    /// # Example
9343    /// ```ignore,no_run
9344    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9345    /// use wkt::Timestamp;
9346    /// let x = DeploymentEvent::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9347    /// let x = DeploymentEvent::new().set_or_clear_create_time(None::<Timestamp>);
9348    /// ```
9349    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9350    where
9351        T: std::convert::Into<wkt::Timestamp>,
9352    {
9353        self.create_time = v.map(|x| x.into());
9354        self
9355    }
9356
9357    /// Sets the value of [update_time][crate::model::DeploymentEvent::update_time].
9358    ///
9359    /// # Example
9360    /// ```ignore,no_run
9361    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9362    /// use wkt::Timestamp;
9363    /// let x = DeploymentEvent::new().set_update_time(Timestamp::default()/* use setters */);
9364    /// ```
9365    pub fn set_update_time<T>(mut self, v: T) -> Self
9366    where
9367        T: std::convert::Into<wkt::Timestamp>,
9368    {
9369        self.update_time = std::option::Option::Some(v.into());
9370        self
9371    }
9372
9373    /// Sets or clears the value of [update_time][crate::model::DeploymentEvent::update_time].
9374    ///
9375    /// # Example
9376    /// ```ignore,no_run
9377    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9378    /// use wkt::Timestamp;
9379    /// let x = DeploymentEvent::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9380    /// let x = DeploymentEvent::new().set_or_clear_update_time(None::<Timestamp>);
9381    /// ```
9382    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9383    where
9384        T: std::convert::Into<wkt::Timestamp>,
9385    {
9386        self.update_time = v.map(|x| x.into());
9387        self
9388    }
9389
9390    /// Sets the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
9391    ///
9392    /// # Example
9393    /// ```ignore,no_run
9394    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9395    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
9396    /// let x = DeploymentEvent::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
9397    /// ```
9398    pub fn set_runtime_config<T>(mut self, v: T) -> Self
9399    where
9400        T: std::convert::Into<crate::model::RuntimeConfig>,
9401    {
9402        self.runtime_config = std::option::Option::Some(v.into());
9403        self
9404    }
9405
9406    /// Sets or clears the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
9407    ///
9408    /// # Example
9409    /// ```ignore,no_run
9410    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9411    /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
9412    /// let x = DeploymentEvent::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
9413    /// let x = DeploymentEvent::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
9414    /// ```
9415    pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
9416    where
9417        T: std::convert::Into<crate::model::RuntimeConfig>,
9418    {
9419        self.runtime_config = v.map(|x| x.into());
9420        self
9421    }
9422
9423    /// Sets the value of [runtime_deployment_uri][crate::model::DeploymentEvent::runtime_deployment_uri].
9424    ///
9425    /// # Example
9426    /// ```ignore,no_run
9427    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9428    /// let x = DeploymentEvent::new().set_runtime_deployment_uri("example");
9429    /// ```
9430    pub fn set_runtime_deployment_uri<T: std::convert::Into<std::string::String>>(
9431        mut self,
9432        v: T,
9433    ) -> Self {
9434        self.runtime_deployment_uri = v.into();
9435        self
9436    }
9437
9438    /// Sets the value of [state][crate::model::DeploymentEvent::state].
9439    ///
9440    /// # Example
9441    /// ```ignore,no_run
9442    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9443    /// use google_cloud_developerconnect_v1::model::deployment_event::State;
9444    /// let x0 = DeploymentEvent::new().set_state(State::Active);
9445    /// let x1 = DeploymentEvent::new().set_state(State::Inactive);
9446    /// ```
9447    pub fn set_state<T: std::convert::Into<crate::model::deployment_event::State>>(
9448        mut self,
9449        v: T,
9450    ) -> Self {
9451        self.state = v.into();
9452        self
9453    }
9454
9455    /// Sets the value of [artifact_deployments][crate::model::DeploymentEvent::artifact_deployments].
9456    ///
9457    /// # Example
9458    /// ```ignore,no_run
9459    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9460    /// use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9461    /// let x = DeploymentEvent::new()
9462    ///     .set_artifact_deployments([
9463    ///         ArtifactDeployment::default()/* use setters */,
9464    ///         ArtifactDeployment::default()/* use (different) setters */,
9465    ///     ]);
9466    /// ```
9467    pub fn set_artifact_deployments<T, V>(mut self, v: T) -> Self
9468    where
9469        T: std::iter::IntoIterator<Item = V>,
9470        V: std::convert::Into<crate::model::ArtifactDeployment>,
9471    {
9472        use std::iter::Iterator;
9473        self.artifact_deployments = v.into_iter().map(|i| i.into()).collect();
9474        self
9475    }
9476
9477    /// Sets the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
9478    ///
9479    /// # Example
9480    /// ```ignore,no_run
9481    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9482    /// use wkt::Timestamp;
9483    /// let x = DeploymentEvent::new().set_deploy_time(Timestamp::default()/* use setters */);
9484    /// ```
9485    pub fn set_deploy_time<T>(mut self, v: T) -> Self
9486    where
9487        T: std::convert::Into<wkt::Timestamp>,
9488    {
9489        self.deploy_time = std::option::Option::Some(v.into());
9490        self
9491    }
9492
9493    /// Sets or clears the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
9494    ///
9495    /// # Example
9496    /// ```ignore,no_run
9497    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9498    /// use wkt::Timestamp;
9499    /// let x = DeploymentEvent::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
9500    /// let x = DeploymentEvent::new().set_or_clear_deploy_time(None::<Timestamp>);
9501    /// ```
9502    pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9503    where
9504        T: std::convert::Into<wkt::Timestamp>,
9505    {
9506        self.deploy_time = v.map(|x| x.into());
9507        self
9508    }
9509
9510    /// Sets the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
9511    ///
9512    /// # Example
9513    /// ```ignore,no_run
9514    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9515    /// use wkt::Timestamp;
9516    /// let x = DeploymentEvent::new().set_undeploy_time(Timestamp::default()/* use setters */);
9517    /// ```
9518    pub fn set_undeploy_time<T>(mut self, v: T) -> Self
9519    where
9520        T: std::convert::Into<wkt::Timestamp>,
9521    {
9522        self.undeploy_time = std::option::Option::Some(v.into());
9523        self
9524    }
9525
9526    /// Sets or clears the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
9527    ///
9528    /// # Example
9529    /// ```ignore,no_run
9530    /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9531    /// use wkt::Timestamp;
9532    /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
9533    /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(None::<Timestamp>);
9534    /// ```
9535    pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9536    where
9537        T: std::convert::Into<wkt::Timestamp>,
9538    {
9539        self.undeploy_time = v.map(|x| x.into());
9540        self
9541    }
9542}
9543
9544impl wkt::message::Message for DeploymentEvent {
9545    fn typename() -> &'static str {
9546        "type.googleapis.com/google.cloud.developerconnect.v1.DeploymentEvent"
9547    }
9548}
9549
9550/// Defines additional types related to [DeploymentEvent].
9551pub mod deployment_event {
9552    #[allow(unused_imports)]
9553    use super::*;
9554
9555    /// The state of the DeploymentEvent.
9556    ///
9557    /// # Working with unknown values
9558    ///
9559    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9560    /// additional enum variants at any time. Adding new variants is not considered
9561    /// a breaking change. Applications should write their code in anticipation of:
9562    ///
9563    /// - New values appearing in future releases of the client library, **and**
9564    /// - New values received dynamically, without application changes.
9565    ///
9566    /// Please consult the [Working with enums] section in the user guide for some
9567    /// guidelines.
9568    ///
9569    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9570    #[derive(Clone, Debug, PartialEq)]
9571    #[non_exhaustive]
9572    pub enum State {
9573        /// No state specified.
9574        Unspecified,
9575        /// The deployment is active in the runtime.
9576        Active,
9577        /// The deployment is not in the runtime.
9578        Inactive,
9579        /// If set, the enum was initialized with an unknown value.
9580        ///
9581        /// Applications can examine the value using [State::value] or
9582        /// [State::name].
9583        UnknownValue(state::UnknownValue),
9584    }
9585
9586    #[doc(hidden)]
9587    pub mod state {
9588        #[allow(unused_imports)]
9589        use super::*;
9590        #[derive(Clone, Debug, PartialEq)]
9591        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9592    }
9593
9594    impl State {
9595        /// Gets the enum value.
9596        ///
9597        /// Returns `None` if the enum contains an unknown value deserialized from
9598        /// the string representation of enums.
9599        pub fn value(&self) -> std::option::Option<i32> {
9600            match self {
9601                Self::Unspecified => std::option::Option::Some(0),
9602                Self::Active => std::option::Option::Some(1),
9603                Self::Inactive => std::option::Option::Some(2),
9604                Self::UnknownValue(u) => u.0.value(),
9605            }
9606        }
9607
9608        /// Gets the enum value as a string.
9609        ///
9610        /// Returns `None` if the enum contains an unknown value deserialized from
9611        /// the integer representation of enums.
9612        pub fn name(&self) -> std::option::Option<&str> {
9613            match self {
9614                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9615                Self::Active => std::option::Option::Some("STATE_ACTIVE"),
9616                Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
9617                Self::UnknownValue(u) => u.0.name(),
9618            }
9619        }
9620    }
9621
9622    impl std::default::Default for State {
9623        fn default() -> Self {
9624            use std::convert::From;
9625            Self::from(0)
9626        }
9627    }
9628
9629    impl std::fmt::Display for State {
9630        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9631            wkt::internal::display_enum(f, self.name(), self.value())
9632        }
9633    }
9634
9635    impl std::convert::From<i32> for State {
9636        fn from(value: i32) -> Self {
9637            match value {
9638                0 => Self::Unspecified,
9639                1 => Self::Active,
9640                2 => Self::Inactive,
9641                _ => Self::UnknownValue(state::UnknownValue(
9642                    wkt::internal::UnknownEnumValue::Integer(value),
9643                )),
9644            }
9645        }
9646    }
9647
9648    impl std::convert::From<&str> for State {
9649        fn from(value: &str) -> Self {
9650            use std::string::ToString;
9651            match value {
9652                "STATE_UNSPECIFIED" => Self::Unspecified,
9653                "STATE_ACTIVE" => Self::Active,
9654                "STATE_INACTIVE" => Self::Inactive,
9655                _ => Self::UnknownValue(state::UnknownValue(
9656                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9657                )),
9658            }
9659        }
9660    }
9661
9662    impl serde::ser::Serialize for State {
9663        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9664        where
9665            S: serde::Serializer,
9666        {
9667            match self {
9668                Self::Unspecified => serializer.serialize_i32(0),
9669                Self::Active => serializer.serialize_i32(1),
9670                Self::Inactive => serializer.serialize_i32(2),
9671                Self::UnknownValue(u) => u.0.serialize(serializer),
9672            }
9673        }
9674    }
9675
9676    impl<'de> serde::de::Deserialize<'de> for State {
9677        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9678        where
9679            D: serde::Deserializer<'de>,
9680        {
9681            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9682                ".google.cloud.developerconnect.v1.DeploymentEvent.State",
9683            ))
9684        }
9685    }
9686}
9687
9688/// Request for getting a DeploymentEvent.
9689#[derive(Clone, Default, PartialEq)]
9690#[non_exhaustive]
9691pub struct GetDeploymentEventRequest {
9692    /// Required. The name of the deployment event to retrieve.
9693    /// Format:
9694    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
9695    pub name: std::string::String,
9696
9697    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9698}
9699
9700impl GetDeploymentEventRequest {
9701    /// Creates a new default instance.
9702    pub fn new() -> Self {
9703        std::default::Default::default()
9704    }
9705
9706    /// Sets the value of [name][crate::model::GetDeploymentEventRequest::name].
9707    ///
9708    /// # Example
9709    /// ```ignore,no_run
9710    /// # use google_cloud_developerconnect_v1::model::GetDeploymentEventRequest;
9711    /// # let project_id = "project_id";
9712    /// # let location_id = "location_id";
9713    /// # let insights_config_id = "insights_config_id";
9714    /// # let deployment_event_id = "deployment_event_id";
9715    /// let x = GetDeploymentEventRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}/deploymentEvents/{deployment_event_id}"));
9716    /// ```
9717    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9718        self.name = v.into();
9719        self
9720    }
9721}
9722
9723impl wkt::message::Message for GetDeploymentEventRequest {
9724    fn typename() -> &'static str {
9725        "type.googleapis.com/google.cloud.developerconnect.v1.GetDeploymentEventRequest"
9726    }
9727}
9728
9729/// Request for requesting list of DeploymentEvents.
9730#[derive(Clone, Default, PartialEq)]
9731#[non_exhaustive]
9732pub struct ListDeploymentEventsRequest {
9733    /// Required. The parent insights config that owns this collection of
9734    /// deployment events. Format:
9735    /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}
9736    pub parent: std::string::String,
9737
9738    /// Optional. The maximum number of deployment events to return. The service
9739    /// may return fewer than this value. If unspecified, at most 50 deployment
9740    /// events will be returned. The maximum value is 1000; values above 1000 will
9741    /// be coerced to 1000.
9742    pub page_size: i32,
9743
9744    /// Optional. A page token, received from a previous `ListDeploymentEvents`
9745    /// call. Provide this to retrieve the subsequent page.
9746    ///
9747    /// When paginating, all other parameters provided to `ListDeploymentEvents`
9748    /// must match the call that provided the page token.
9749    pub page_token: std::string::String,
9750
9751    /// Optional. Filter expression that matches a subset of the DeploymentEvents.
9752    /// <https://google.aip.dev/160>.
9753    pub filter: std::string::String,
9754
9755    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9756}
9757
9758impl ListDeploymentEventsRequest {
9759    /// Creates a new default instance.
9760    pub fn new() -> Self {
9761        std::default::Default::default()
9762    }
9763
9764    /// Sets the value of [parent][crate::model::ListDeploymentEventsRequest::parent].
9765    ///
9766    /// # Example
9767    /// ```ignore,no_run
9768    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9769    /// # let project_id = "project_id";
9770    /// # let location_id = "location_id";
9771    /// # let insights_config_id = "insights_config_id";
9772    /// let x = ListDeploymentEventsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
9773    /// ```
9774    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9775        self.parent = v.into();
9776        self
9777    }
9778
9779    /// Sets the value of [page_size][crate::model::ListDeploymentEventsRequest::page_size].
9780    ///
9781    /// # Example
9782    /// ```ignore,no_run
9783    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9784    /// let x = ListDeploymentEventsRequest::new().set_page_size(42);
9785    /// ```
9786    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9787        self.page_size = v.into();
9788        self
9789    }
9790
9791    /// Sets the value of [page_token][crate::model::ListDeploymentEventsRequest::page_token].
9792    ///
9793    /// # Example
9794    /// ```ignore,no_run
9795    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9796    /// let x = ListDeploymentEventsRequest::new().set_page_token("example");
9797    /// ```
9798    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9799        self.page_token = v.into();
9800        self
9801    }
9802
9803    /// Sets the value of [filter][crate::model::ListDeploymentEventsRequest::filter].
9804    ///
9805    /// # Example
9806    /// ```ignore,no_run
9807    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9808    /// let x = ListDeploymentEventsRequest::new().set_filter("example");
9809    /// ```
9810    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9811        self.filter = v.into();
9812        self
9813    }
9814}
9815
9816impl wkt::message::Message for ListDeploymentEventsRequest {
9817    fn typename() -> &'static str {
9818        "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsRequest"
9819    }
9820}
9821
9822/// Response to listing DeploymentEvents.
9823#[derive(Clone, Default, PartialEq)]
9824#[non_exhaustive]
9825pub struct ListDeploymentEventsResponse {
9826    /// The list of DeploymentEvents.
9827    pub deployment_events: std::vec::Vec<crate::model::DeploymentEvent>,
9828
9829    /// A token, which can be sent as `page_token` to retrieve the next page.
9830    /// If this field is omitted, there are no subsequent pages.
9831    pub next_page_token: std::string::String,
9832
9833    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9834}
9835
9836impl ListDeploymentEventsResponse {
9837    /// Creates a new default instance.
9838    pub fn new() -> Self {
9839        std::default::Default::default()
9840    }
9841
9842    /// Sets the value of [deployment_events][crate::model::ListDeploymentEventsResponse::deployment_events].
9843    ///
9844    /// # Example
9845    /// ```ignore,no_run
9846    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
9847    /// use google_cloud_developerconnect_v1::model::DeploymentEvent;
9848    /// let x = ListDeploymentEventsResponse::new()
9849    ///     .set_deployment_events([
9850    ///         DeploymentEvent::default()/* use setters */,
9851    ///         DeploymentEvent::default()/* use (different) setters */,
9852    ///     ]);
9853    /// ```
9854    pub fn set_deployment_events<T, V>(mut self, v: T) -> Self
9855    where
9856        T: std::iter::IntoIterator<Item = V>,
9857        V: std::convert::Into<crate::model::DeploymentEvent>,
9858    {
9859        use std::iter::Iterator;
9860        self.deployment_events = v.into_iter().map(|i| i.into()).collect();
9861        self
9862    }
9863
9864    /// Sets the value of [next_page_token][crate::model::ListDeploymentEventsResponse::next_page_token].
9865    ///
9866    /// # Example
9867    /// ```ignore,no_run
9868    /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
9869    /// let x = ListDeploymentEventsResponse::new().set_next_page_token("example");
9870    /// ```
9871    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9872        self.next_page_token = v.into();
9873        self
9874    }
9875}
9876
9877impl wkt::message::Message for ListDeploymentEventsResponse {
9878    fn typename() -> &'static str {
9879        "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsResponse"
9880    }
9881}
9882
9883#[doc(hidden)]
9884impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentEventsResponse {
9885    type PageItem = crate::model::DeploymentEvent;
9886
9887    fn items(self) -> std::vec::Vec<Self::PageItem> {
9888        self.deployment_events
9889    }
9890
9891    fn next_page_token(&self) -> std::string::String {
9892        use std::clone::Clone;
9893        self.next_page_token.clone()
9894    }
9895}
9896
9897/// The ArtifactDeployment resource represents the deployment of the artifact
9898/// within the InsightsConfig resource.
9899#[derive(Clone, Default, PartialEq)]
9900#[non_exhaustive]
9901pub struct ArtifactDeployment {
9902    /// Output only. Unique identifier of `ArtifactDeployment`.
9903    pub id: std::string::String,
9904
9905    /// Output only. The artifact that is deployed.
9906    pub artifact_reference: std::string::String,
9907
9908    /// Output only. The artifact alias in the deployment spec, with Tag/SHA.
9909    /// e.g. us-docker.pkg.dev/my-project/my-repo/image:1.0.0
9910    pub artifact_alias: std::string::String,
9911
9912    /// Output only. The source commits at which this artifact was built. Extracted
9913    /// from provenance.
9914    pub source_commit_uris: std::vec::Vec<std::string::String>,
9915
9916    /// Output only. The time at which the deployment was deployed.
9917    pub deploy_time: std::option::Option<wkt::Timestamp>,
9918
9919    /// Output only. The time at which the deployment was undeployed, all artifacts
9920    /// are considered undeployed once this time is set.
9921    pub undeploy_time: std::option::Option<wkt::Timestamp>,
9922
9923    /// Output only. The summary of container status of the artifact deployment.
9924    /// Format as `ContainerStatusState-Reason : restartCount`
9925    /// e.g. "Waiting-ImagePullBackOff : 3"
9926    pub container_status_summary: std::string::String,
9927
9928    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9929}
9930
9931impl ArtifactDeployment {
9932    /// Creates a new default instance.
9933    pub fn new() -> Self {
9934        std::default::Default::default()
9935    }
9936
9937    /// Sets the value of [id][crate::model::ArtifactDeployment::id].
9938    ///
9939    /// # Example
9940    /// ```ignore,no_run
9941    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9942    /// let x = ArtifactDeployment::new().set_id("example");
9943    /// ```
9944    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9945        self.id = v.into();
9946        self
9947    }
9948
9949    /// Sets the value of [artifact_reference][crate::model::ArtifactDeployment::artifact_reference].
9950    ///
9951    /// # Example
9952    /// ```ignore,no_run
9953    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9954    /// let x = ArtifactDeployment::new().set_artifact_reference("example");
9955    /// ```
9956    pub fn set_artifact_reference<T: std::convert::Into<std::string::String>>(
9957        mut self,
9958        v: T,
9959    ) -> Self {
9960        self.artifact_reference = v.into();
9961        self
9962    }
9963
9964    /// Sets the value of [artifact_alias][crate::model::ArtifactDeployment::artifact_alias].
9965    ///
9966    /// # Example
9967    /// ```ignore,no_run
9968    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9969    /// let x = ArtifactDeployment::new().set_artifact_alias("example");
9970    /// ```
9971    pub fn set_artifact_alias<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9972        self.artifact_alias = v.into();
9973        self
9974    }
9975
9976    /// Sets the value of [source_commit_uris][crate::model::ArtifactDeployment::source_commit_uris].
9977    ///
9978    /// # Example
9979    /// ```ignore,no_run
9980    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9981    /// let x = ArtifactDeployment::new().set_source_commit_uris(["a", "b", "c"]);
9982    /// ```
9983    pub fn set_source_commit_uris<T, V>(mut self, v: T) -> Self
9984    where
9985        T: std::iter::IntoIterator<Item = V>,
9986        V: std::convert::Into<std::string::String>,
9987    {
9988        use std::iter::Iterator;
9989        self.source_commit_uris = v.into_iter().map(|i| i.into()).collect();
9990        self
9991    }
9992
9993    /// Sets the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
9994    ///
9995    /// # Example
9996    /// ```ignore,no_run
9997    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9998    /// use wkt::Timestamp;
9999    /// let x = ArtifactDeployment::new().set_deploy_time(Timestamp::default()/* use setters */);
10000    /// ```
10001    pub fn set_deploy_time<T>(mut self, v: T) -> Self
10002    where
10003        T: std::convert::Into<wkt::Timestamp>,
10004    {
10005        self.deploy_time = std::option::Option::Some(v.into());
10006        self
10007    }
10008
10009    /// Sets or clears the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
10010    ///
10011    /// # Example
10012    /// ```ignore,no_run
10013    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10014    /// use wkt::Timestamp;
10015    /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
10016    /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(None::<Timestamp>);
10017    /// ```
10018    pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
10019    where
10020        T: std::convert::Into<wkt::Timestamp>,
10021    {
10022        self.deploy_time = v.map(|x| x.into());
10023        self
10024    }
10025
10026    /// Sets the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
10027    ///
10028    /// # Example
10029    /// ```ignore,no_run
10030    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10031    /// use wkt::Timestamp;
10032    /// let x = ArtifactDeployment::new().set_undeploy_time(Timestamp::default()/* use setters */);
10033    /// ```
10034    pub fn set_undeploy_time<T>(mut self, v: T) -> Self
10035    where
10036        T: std::convert::Into<wkt::Timestamp>,
10037    {
10038        self.undeploy_time = std::option::Option::Some(v.into());
10039        self
10040    }
10041
10042    /// Sets or clears the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
10043    ///
10044    /// # Example
10045    /// ```ignore,no_run
10046    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10047    /// use wkt::Timestamp;
10048    /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
10049    /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(None::<Timestamp>);
10050    /// ```
10051    pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
10052    where
10053        T: std::convert::Into<wkt::Timestamp>,
10054    {
10055        self.undeploy_time = v.map(|x| x.into());
10056        self
10057    }
10058
10059    /// Sets the value of [container_status_summary][crate::model::ArtifactDeployment::container_status_summary].
10060    ///
10061    /// # Example
10062    /// ```ignore,no_run
10063    /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10064    /// let x = ArtifactDeployment::new().set_container_status_summary("example");
10065    /// ```
10066    pub fn set_container_status_summary<T: std::convert::Into<std::string::String>>(
10067        mut self,
10068        v: T,
10069    ) -> Self {
10070        self.container_status_summary = v.into();
10071        self
10072    }
10073}
10074
10075impl wkt::message::Message for ArtifactDeployment {
10076    fn typename() -> &'static str {
10077        "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactDeployment"
10078    }
10079}
10080
10081/// Request for creating an InsightsConfig.
10082#[derive(Clone, Default, PartialEq)]
10083#[non_exhaustive]
10084pub struct CreateInsightsConfigRequest {
10085    /// Required. Value for parent.
10086    pub parent: std::string::String,
10087
10088    /// Required. ID of the requesting InsightsConfig.
10089    pub insights_config_id: std::string::String,
10090
10091    /// Required. The resource being created.
10092    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
10093
10094    /// Optional. If set, validate the request, but do not actually post it.
10095    pub validate_only: bool,
10096
10097    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10098}
10099
10100impl CreateInsightsConfigRequest {
10101    /// Creates a new default instance.
10102    pub fn new() -> Self {
10103        std::default::Default::default()
10104    }
10105
10106    /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
10107    ///
10108    /// # Example
10109    /// ```ignore,no_run
10110    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10111    /// # let project_id = "project_id";
10112    /// # let location_id = "location_id";
10113    /// let x = CreateInsightsConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10114    /// ```
10115    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10116        self.parent = v.into();
10117        self
10118    }
10119
10120    /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
10121    ///
10122    /// # Example
10123    /// ```ignore,no_run
10124    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10125    /// let x = CreateInsightsConfigRequest::new().set_insights_config_id("example");
10126    /// ```
10127    pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
10128        mut self,
10129        v: T,
10130    ) -> Self {
10131        self.insights_config_id = v.into();
10132        self
10133    }
10134
10135    /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
10136    ///
10137    /// # Example
10138    /// ```ignore,no_run
10139    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10140    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10141    /// let x = CreateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
10142    /// ```
10143    pub fn set_insights_config<T>(mut self, v: T) -> Self
10144    where
10145        T: std::convert::Into<crate::model::InsightsConfig>,
10146    {
10147        self.insights_config = std::option::Option::Some(v.into());
10148        self
10149    }
10150
10151    /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
10152    ///
10153    /// # Example
10154    /// ```ignore,no_run
10155    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10156    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10157    /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
10158    /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
10159    /// ```
10160    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
10161    where
10162        T: std::convert::Into<crate::model::InsightsConfig>,
10163    {
10164        self.insights_config = v.map(|x| x.into());
10165        self
10166    }
10167
10168    /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
10169    ///
10170    /// # Example
10171    /// ```ignore,no_run
10172    /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10173    /// let x = CreateInsightsConfigRequest::new().set_validate_only(true);
10174    /// ```
10175    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10176        self.validate_only = v.into();
10177        self
10178    }
10179}
10180
10181impl wkt::message::Message for CreateInsightsConfigRequest {
10182    fn typename() -> &'static str {
10183        "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
10184    }
10185}
10186
10187/// Request for getting an InsightsConfig.
10188#[derive(Clone, Default, PartialEq)]
10189#[non_exhaustive]
10190pub struct GetInsightsConfigRequest {
10191    /// Required. Name of the resource.
10192    pub name: std::string::String,
10193
10194    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10195}
10196
10197impl GetInsightsConfigRequest {
10198    /// Creates a new default instance.
10199    pub fn new() -> Self {
10200        std::default::Default::default()
10201    }
10202
10203    /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
10204    ///
10205    /// # Example
10206    /// ```ignore,no_run
10207    /// # use google_cloud_developerconnect_v1::model::GetInsightsConfigRequest;
10208    /// # let project_id = "project_id";
10209    /// # let location_id = "location_id";
10210    /// # let insights_config_id = "insights_config_id";
10211    /// let x = GetInsightsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
10212    /// ```
10213    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10214        self.name = v.into();
10215        self
10216    }
10217}
10218
10219impl wkt::message::Message for GetInsightsConfigRequest {
10220    fn typename() -> &'static str {
10221        "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
10222    }
10223}
10224
10225/// Request for requesting list of InsightsConfigs.
10226#[derive(Clone, Default, PartialEq)]
10227#[non_exhaustive]
10228pub struct ListInsightsConfigsRequest {
10229    /// Required. Parent value for ListInsightsConfigsRequest.
10230    pub parent: std::string::String,
10231
10232    /// Optional. Requested page size. Server may return fewer items than
10233    /// requested. If unspecified, server will pick an appropriate default.
10234    pub page_size: i32,
10235
10236    /// Optional. A token identifying a page of results the server should return.
10237    pub page_token: std::string::String,
10238
10239    /// Optional. Filtering results. See <https://google.aip.dev/160> for more
10240    /// details. Filter string, adhering to the rules in
10241    /// <https://google.aip.dev/160>. List only InsightsConfigs matching the filter.
10242    /// If filter is empty, all InsightsConfigs are listed.
10243    pub filter: std::string::String,
10244
10245    /// Optional. Hint for how to order the results.
10246    pub order_by: std::string::String,
10247
10248    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10249}
10250
10251impl ListInsightsConfigsRequest {
10252    /// Creates a new default instance.
10253    pub fn new() -> Self {
10254        std::default::Default::default()
10255    }
10256
10257    /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
10258    ///
10259    /// # Example
10260    /// ```ignore,no_run
10261    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10262    /// # let project_id = "project_id";
10263    /// # let location_id = "location_id";
10264    /// let x = ListInsightsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10265    /// ```
10266    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10267        self.parent = v.into();
10268        self
10269    }
10270
10271    /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
10272    ///
10273    /// # Example
10274    /// ```ignore,no_run
10275    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10276    /// let x = ListInsightsConfigsRequest::new().set_page_size(42);
10277    /// ```
10278    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10279        self.page_size = v.into();
10280        self
10281    }
10282
10283    /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
10284    ///
10285    /// # Example
10286    /// ```ignore,no_run
10287    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10288    /// let x = ListInsightsConfigsRequest::new().set_page_token("example");
10289    /// ```
10290    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10291        self.page_token = v.into();
10292        self
10293    }
10294
10295    /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
10296    ///
10297    /// # Example
10298    /// ```ignore,no_run
10299    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10300    /// let x = ListInsightsConfigsRequest::new().set_filter("example");
10301    /// ```
10302    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10303        self.filter = v.into();
10304        self
10305    }
10306
10307    /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
10308    ///
10309    /// # Example
10310    /// ```ignore,no_run
10311    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10312    /// let x = ListInsightsConfigsRequest::new().set_order_by("example");
10313    /// ```
10314    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10315        self.order_by = v.into();
10316        self
10317    }
10318}
10319
10320impl wkt::message::Message for ListInsightsConfigsRequest {
10321    fn typename() -> &'static str {
10322        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
10323    }
10324}
10325
10326/// Request for response to listing InsightsConfigs.
10327#[derive(Clone, Default, PartialEq)]
10328#[non_exhaustive]
10329pub struct ListInsightsConfigsResponse {
10330    /// The list of InsightsConfigs.
10331    pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
10332
10333    /// A token identifying a page of results the server should return.
10334    pub next_page_token: std::string::String,
10335
10336    /// Locations that could not be reached.
10337    pub unreachable: std::vec::Vec<std::string::String>,
10338
10339    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10340}
10341
10342impl ListInsightsConfigsResponse {
10343    /// Creates a new default instance.
10344    pub fn new() -> Self {
10345        std::default::Default::default()
10346    }
10347
10348    /// Sets the value of [insights_configs][crate::model::ListInsightsConfigsResponse::insights_configs].
10349    ///
10350    /// # Example
10351    /// ```ignore,no_run
10352    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10353    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10354    /// let x = ListInsightsConfigsResponse::new()
10355    ///     .set_insights_configs([
10356    ///         InsightsConfig::default()/* use setters */,
10357    ///         InsightsConfig::default()/* use (different) setters */,
10358    ///     ]);
10359    /// ```
10360    pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
10361    where
10362        T: std::iter::IntoIterator<Item = V>,
10363        V: std::convert::Into<crate::model::InsightsConfig>,
10364    {
10365        use std::iter::Iterator;
10366        self.insights_configs = v.into_iter().map(|i| i.into()).collect();
10367        self
10368    }
10369
10370    /// Sets the value of [next_page_token][crate::model::ListInsightsConfigsResponse::next_page_token].
10371    ///
10372    /// # Example
10373    /// ```ignore,no_run
10374    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10375    /// let x = ListInsightsConfigsResponse::new().set_next_page_token("example");
10376    /// ```
10377    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10378        self.next_page_token = v.into();
10379        self
10380    }
10381
10382    /// Sets the value of [unreachable][crate::model::ListInsightsConfigsResponse::unreachable].
10383    ///
10384    /// # Example
10385    /// ```ignore,no_run
10386    /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10387    /// let x = ListInsightsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
10388    /// ```
10389    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10390    where
10391        T: std::iter::IntoIterator<Item = V>,
10392        V: std::convert::Into<std::string::String>,
10393    {
10394        use std::iter::Iterator;
10395        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10396        self
10397    }
10398}
10399
10400impl wkt::message::Message for ListInsightsConfigsResponse {
10401    fn typename() -> &'static str {
10402        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
10403    }
10404}
10405
10406#[doc(hidden)]
10407impl google_cloud_gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
10408    type PageItem = crate::model::InsightsConfig;
10409
10410    fn items(self) -> std::vec::Vec<Self::PageItem> {
10411        self.insights_configs
10412    }
10413
10414    fn next_page_token(&self) -> std::string::String {
10415        use std::clone::Clone;
10416        self.next_page_token.clone()
10417    }
10418}
10419
10420/// Request for deleting an InsightsConfig.
10421#[derive(Clone, Default, PartialEq)]
10422#[non_exhaustive]
10423pub struct DeleteInsightsConfigRequest {
10424    /// Required. Value for parent.
10425    pub name: std::string::String,
10426
10427    /// Optional. An optional request ID to identify requests. Specify a unique
10428    /// request ID so that if you must retry your request, the server will know to
10429    /// ignore the request if it has already been completed. The server will
10430    /// guarantee that for at least 60 minutes after the first request.
10431    ///
10432    /// For example, consider a situation where you make an initial request and the
10433    /// request times out. If you make the request again with the same request
10434    /// ID, the server can check if original operation with the same request ID
10435    /// was received, and if so, will ignore the second request. This prevents
10436    /// clients from accidentally creating duplicate commitments.
10437    ///
10438    /// The request ID must be a valid UUID with the exception that zero UUID is
10439    /// not supported (00000000-0000-0000-0000-000000000000).
10440    pub request_id: std::string::String,
10441
10442    /// Optional. If set, validate the request, but do not actually post it.
10443    pub validate_only: bool,
10444
10445    /// Optional. This checksum is computed by the server based on the value of
10446    /// other fields, and may be sent on update and delete requests to ensure the
10447    /// client has an up-to-date value before proceeding.
10448    pub etag: std::string::String,
10449
10450    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10451}
10452
10453impl DeleteInsightsConfigRequest {
10454    /// Creates a new default instance.
10455    pub fn new() -> Self {
10456        std::default::Default::default()
10457    }
10458
10459    /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
10460    ///
10461    /// # Example
10462    /// ```ignore,no_run
10463    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10464    /// # let project_id = "project_id";
10465    /// # let location_id = "location_id";
10466    /// # let insights_config_id = "insights_config_id";
10467    /// let x = DeleteInsightsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
10468    /// ```
10469    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10470        self.name = v.into();
10471        self
10472    }
10473
10474    /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
10475    ///
10476    /// # Example
10477    /// ```ignore,no_run
10478    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10479    /// let x = DeleteInsightsConfigRequest::new().set_request_id("example");
10480    /// ```
10481    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10482        self.request_id = v.into();
10483        self
10484    }
10485
10486    /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
10487    ///
10488    /// # Example
10489    /// ```ignore,no_run
10490    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10491    /// let x = DeleteInsightsConfigRequest::new().set_validate_only(true);
10492    /// ```
10493    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10494        self.validate_only = v.into();
10495        self
10496    }
10497
10498    /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
10499    ///
10500    /// # Example
10501    /// ```ignore,no_run
10502    /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10503    /// let x = DeleteInsightsConfigRequest::new().set_etag("example");
10504    /// ```
10505    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10506        self.etag = v.into();
10507        self
10508    }
10509}
10510
10511impl wkt::message::Message for DeleteInsightsConfigRequest {
10512    fn typename() -> &'static str {
10513        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
10514    }
10515}
10516
10517/// Request for updating an InsightsConfig.
10518#[derive(Clone, Default, PartialEq)]
10519#[non_exhaustive]
10520pub struct UpdateInsightsConfigRequest {
10521    /// Required. The resource being updated.
10522    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
10523
10524    /// Optional. An optional request ID to identify requests. Specify a unique
10525    /// request ID so that if you must retry your request, the server will know to
10526    /// ignore the request if it has already been completed. The server will
10527    /// guarantee that for at least 60 minutes after the first request.
10528    ///
10529    /// For example, consider a situation where you make an initial request and the
10530    /// request times out. If you make the request again with the same request
10531    /// ID, the server can check if original operation with the same request ID
10532    /// was received, and if so, will ignore the second request. This prevents
10533    /// clients from accidentally creating duplicate commitments.
10534    ///
10535    /// The request ID must be a valid UUID with the exception that zero UUID is
10536    /// not supported (00000000-0000-0000-0000-000000000000).
10537    pub request_id: std::string::String,
10538
10539    /// Optional. If set to true, and the insightsConfig is not found a new
10540    /// insightsConfig will be created. In this situation `update_mask` is ignored.
10541    /// The creation will succeed only if the input insightsConfig has all the
10542    /// necessary information (e.g a github_config with both  user_oauth_token and
10543    /// installation_id properties).
10544    pub allow_missing: bool,
10545
10546    /// Optional. If set, validate the request, but do not actually post it.
10547    pub validate_only: bool,
10548
10549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10550}
10551
10552impl UpdateInsightsConfigRequest {
10553    /// Creates a new default instance.
10554    pub fn new() -> Self {
10555        std::default::Default::default()
10556    }
10557
10558    /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
10559    ///
10560    /// # Example
10561    /// ```ignore,no_run
10562    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10563    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10564    /// let x = UpdateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
10565    /// ```
10566    pub fn set_insights_config<T>(mut self, v: T) -> Self
10567    where
10568        T: std::convert::Into<crate::model::InsightsConfig>,
10569    {
10570        self.insights_config = std::option::Option::Some(v.into());
10571        self
10572    }
10573
10574    /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
10575    ///
10576    /// # Example
10577    /// ```ignore,no_run
10578    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10579    /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10580    /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
10581    /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
10582    /// ```
10583    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
10584    where
10585        T: std::convert::Into<crate::model::InsightsConfig>,
10586    {
10587        self.insights_config = v.map(|x| x.into());
10588        self
10589    }
10590
10591    /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
10592    ///
10593    /// # Example
10594    /// ```ignore,no_run
10595    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10596    /// let x = UpdateInsightsConfigRequest::new().set_request_id("example");
10597    /// ```
10598    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10599        self.request_id = v.into();
10600        self
10601    }
10602
10603    /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
10604    ///
10605    /// # Example
10606    /// ```ignore,no_run
10607    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10608    /// let x = UpdateInsightsConfigRequest::new().set_allow_missing(true);
10609    /// ```
10610    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10611        self.allow_missing = v.into();
10612        self
10613    }
10614
10615    /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
10616    ///
10617    /// # Example
10618    /// ```ignore,no_run
10619    /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10620    /// let x = UpdateInsightsConfigRequest::new().set_validate_only(true);
10621    /// ```
10622    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10623        self.validate_only = v.into();
10624        self
10625    }
10626}
10627
10628impl wkt::message::Message for UpdateInsightsConfigRequest {
10629    fn typename() -> &'static str {
10630        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
10631    }
10632}
10633
10634/// SystemProvider is a list of providers that are owned by Developer Connect.
10635///
10636/// # Working with unknown values
10637///
10638/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10639/// additional enum variants at any time. Adding new variants is not considered
10640/// a breaking change. Applications should write their code in anticipation of:
10641///
10642/// - New values appearing in future releases of the client library, **and**
10643/// - New values received dynamically, without application changes.
10644///
10645/// Please consult the [Working with enums] section in the user guide for some
10646/// guidelines.
10647///
10648/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10649#[derive(Clone, Debug, PartialEq)]
10650#[non_exhaustive]
10651pub enum SystemProvider {
10652    /// No system provider specified.
10653    Unspecified,
10654    /// GitHub provider.
10655    /// Scopes can be found at
10656    /// <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes>
10657    Github,
10658    /// GitLab provider.
10659    /// Scopes can be found at
10660    /// <https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes>
10661    Gitlab,
10662    /// Google provider.
10663    /// Recommended scopes:
10664    /// `https://www.googleapis.com/auth/drive.readonly`,
10665    /// `https://www.googleapis.com/auth/documents.readonly`
10666    Google,
10667    /// Sentry provider.
10668    /// Scopes can be found at
10669    /// <https://docs.sentry.io/api/permissions/>
10670    Sentry,
10671    /// Rovo provider.
10672    /// Must select the "rovo" scope.
10673    Rovo,
10674    /// New Relic provider.
10675    /// No scopes are allowed.
10676    NewRelic,
10677    /// Datastax provider.
10678    /// No scopes are allowed.
10679    Datastax,
10680    /// Dynatrace provider.
10681    Dynatrace,
10682    /// If set, the enum was initialized with an unknown value.
10683    ///
10684    /// Applications can examine the value using [SystemProvider::value] or
10685    /// [SystemProvider::name].
10686    UnknownValue(system_provider::UnknownValue),
10687}
10688
10689#[doc(hidden)]
10690pub mod system_provider {
10691    #[allow(unused_imports)]
10692    use super::*;
10693    #[derive(Clone, Debug, PartialEq)]
10694    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10695}
10696
10697impl SystemProvider {
10698    /// Gets the enum value.
10699    ///
10700    /// Returns `None` if the enum contains an unknown value deserialized from
10701    /// the string representation of enums.
10702    pub fn value(&self) -> std::option::Option<i32> {
10703        match self {
10704            Self::Unspecified => std::option::Option::Some(0),
10705            Self::Github => std::option::Option::Some(1),
10706            Self::Gitlab => std::option::Option::Some(2),
10707            Self::Google => std::option::Option::Some(3),
10708            Self::Sentry => std::option::Option::Some(4),
10709            Self::Rovo => std::option::Option::Some(5),
10710            Self::NewRelic => std::option::Option::Some(6),
10711            Self::Datastax => std::option::Option::Some(7),
10712            Self::Dynatrace => std::option::Option::Some(8),
10713            Self::UnknownValue(u) => u.0.value(),
10714        }
10715    }
10716
10717    /// Gets the enum value as a string.
10718    ///
10719    /// Returns `None` if the enum contains an unknown value deserialized from
10720    /// the integer representation of enums.
10721    pub fn name(&self) -> std::option::Option<&str> {
10722        match self {
10723            Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
10724            Self::Github => std::option::Option::Some("GITHUB"),
10725            Self::Gitlab => std::option::Option::Some("GITLAB"),
10726            Self::Google => std::option::Option::Some("GOOGLE"),
10727            Self::Sentry => std::option::Option::Some("SENTRY"),
10728            Self::Rovo => std::option::Option::Some("ROVO"),
10729            Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
10730            Self::Datastax => std::option::Option::Some("DATASTAX"),
10731            Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
10732            Self::UnknownValue(u) => u.0.name(),
10733        }
10734    }
10735}
10736
10737impl std::default::Default for SystemProvider {
10738    fn default() -> Self {
10739        use std::convert::From;
10740        Self::from(0)
10741    }
10742}
10743
10744impl std::fmt::Display for SystemProvider {
10745    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10746        wkt::internal::display_enum(f, self.name(), self.value())
10747    }
10748}
10749
10750impl std::convert::From<i32> for SystemProvider {
10751    fn from(value: i32) -> Self {
10752        match value {
10753            0 => Self::Unspecified,
10754            1 => Self::Github,
10755            2 => Self::Gitlab,
10756            3 => Self::Google,
10757            4 => Self::Sentry,
10758            5 => Self::Rovo,
10759            6 => Self::NewRelic,
10760            7 => Self::Datastax,
10761            8 => Self::Dynatrace,
10762            _ => Self::UnknownValue(system_provider::UnknownValue(
10763                wkt::internal::UnknownEnumValue::Integer(value),
10764            )),
10765        }
10766    }
10767}
10768
10769impl std::convert::From<&str> for SystemProvider {
10770    fn from(value: &str) -> Self {
10771        use std::string::ToString;
10772        match value {
10773            "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
10774            "GITHUB" => Self::Github,
10775            "GITLAB" => Self::Gitlab,
10776            "GOOGLE" => Self::Google,
10777            "SENTRY" => Self::Sentry,
10778            "ROVO" => Self::Rovo,
10779            "NEW_RELIC" => Self::NewRelic,
10780            "DATASTAX" => Self::Datastax,
10781            "DYNATRACE" => Self::Dynatrace,
10782            _ => Self::UnknownValue(system_provider::UnknownValue(
10783                wkt::internal::UnknownEnumValue::String(value.to_string()),
10784            )),
10785        }
10786    }
10787}
10788
10789impl serde::ser::Serialize for SystemProvider {
10790    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10791    where
10792        S: serde::Serializer,
10793    {
10794        match self {
10795            Self::Unspecified => serializer.serialize_i32(0),
10796            Self::Github => serializer.serialize_i32(1),
10797            Self::Gitlab => serializer.serialize_i32(2),
10798            Self::Google => serializer.serialize_i32(3),
10799            Self::Sentry => serializer.serialize_i32(4),
10800            Self::Rovo => serializer.serialize_i32(5),
10801            Self::NewRelic => serializer.serialize_i32(6),
10802            Self::Datastax => serializer.serialize_i32(7),
10803            Self::Dynatrace => serializer.serialize_i32(8),
10804            Self::UnknownValue(u) => u.0.serialize(serializer),
10805        }
10806    }
10807}
10808
10809impl<'de> serde::de::Deserialize<'de> for SystemProvider {
10810    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10811    where
10812        D: serde::Deserializer<'de>,
10813    {
10814        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
10815            ".google.cloud.developerconnect.v1.SystemProvider",
10816        ))
10817    }
10818}