google_cloud_developerconnect_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Message for requesting a list of Users
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct ListUsersRequest {
45    /// Required. Parent value for ListUsersRequest
46    pub parent: std::string::String,
47
48    /// Optional. Requested page size. Server may return fewer items than
49    /// requested. If unspecified, server will pick an appropriate default.
50    pub page_size: i32,
51
52    /// Optional. A token identifying a page of results the server should return.
53    pub page_token: std::string::String,
54
55    /// Optional. Filtering results
56    pub filter: std::string::String,
57
58    /// Optional. Hint for how to order the results
59    pub order_by: std::string::String,
60
61    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
62}
63
64impl ListUsersRequest {
65    pub fn new() -> Self {
66        std::default::Default::default()
67    }
68
69    /// Sets the value of [parent][crate::model::ListUsersRequest::parent].
70    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
71        self.parent = v.into();
72        self
73    }
74
75    /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
76    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
77        self.page_size = v.into();
78        self
79    }
80
81    /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
82    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
83        self.page_token = v.into();
84        self
85    }
86
87    /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
88    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
89        self.filter = v.into();
90        self
91    }
92
93    /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
94    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
95        self.order_by = v.into();
96        self
97    }
98}
99
100impl wkt::message::Message for ListUsersRequest {
101    fn typename() -> &'static str {
102        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
103    }
104}
105
106/// Message for response to listing Users
107#[derive(Clone, Default, PartialEq)]
108#[non_exhaustive]
109pub struct ListUsersResponse {
110    /// The list of Users
111    pub users: std::vec::Vec<crate::model::User>,
112
113    /// A token identifying a page of results the server should return.
114    pub next_page_token: std::string::String,
115
116    /// Locations that could not be reached.
117    pub unreachable: std::vec::Vec<std::string::String>,
118
119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
120}
121
122impl ListUsersResponse {
123    pub fn new() -> Self {
124        std::default::Default::default()
125    }
126
127    /// Sets the value of [users][crate::model::ListUsersResponse::users].
128    pub fn set_users<T, V>(mut self, v: T) -> Self
129    where
130        T: std::iter::IntoIterator<Item = V>,
131        V: std::convert::Into<crate::model::User>,
132    {
133        use std::iter::Iterator;
134        self.users = v.into_iter().map(|i| i.into()).collect();
135        self
136    }
137
138    /// Sets the value of [next_page_token][crate::model::ListUsersResponse::next_page_token].
139    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
140        self.next_page_token = v.into();
141        self
142    }
143
144    /// Sets the value of [unreachable][crate::model::ListUsersResponse::unreachable].
145    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
146    where
147        T: std::iter::IntoIterator<Item = V>,
148        V: std::convert::Into<std::string::String>,
149    {
150        use std::iter::Iterator;
151        self.unreachable = v.into_iter().map(|i| i.into()).collect();
152        self
153    }
154}
155
156impl wkt::message::Message for ListUsersResponse {
157    fn typename() -> &'static str {
158        "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
159    }
160}
161
162#[doc(hidden)]
163impl gax::paginator::internal::PageableResponse for ListUsersResponse {
164    type PageItem = crate::model::User;
165
166    fn items(self) -> std::vec::Vec<Self::PageItem> {
167        self.users
168    }
169
170    fn next_page_token(&self) -> std::string::String {
171        use std::clone::Clone;
172        self.next_page_token.clone()
173    }
174}
175
176/// Message describing Connection object
177#[derive(Clone, Default, PartialEq)]
178#[non_exhaustive]
179pub struct Connection {
180    /// Identifier. The resource name of the connection, in the format
181    /// `projects/{project}/locations/{location}/connections/{connection_id}`.
182    pub name: std::string::String,
183
184    /// Output only. [Output only] Create timestamp
185    pub create_time: std::option::Option<wkt::Timestamp>,
186
187    /// Output only. [Output only] Update timestamp
188    pub update_time: std::option::Option<wkt::Timestamp>,
189
190    /// Output only. [Output only] Delete timestamp
191    pub delete_time: std::option::Option<wkt::Timestamp>,
192
193    /// Optional. Labels as key value pairs
194    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
195
196    /// Output only. Installation state of the Connection.
197    pub installation_state: std::option::Option<crate::model::InstallationState>,
198
199    /// Optional. If disabled is set to true, functionality is disabled for this
200    /// connection. Repository based API methods and webhooks processing for
201    /// repositories in this connection will be disabled.
202    pub disabled: bool,
203
204    /// Output only. Set to true when the connection is being set up or updated in
205    /// the background.
206    pub reconciling: bool,
207
208    /// Optional. Allows clients to store small amounts of arbitrary data.
209    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
210
211    /// Optional. This checksum is computed by the server based on the value of
212    /// other fields, and may be sent on update and delete requests to ensure the
213    /// client has an up-to-date value before proceeding.
214    pub etag: std::string::String,
215
216    /// Output only. A system-assigned unique identifier for the Connection.
217    pub uid: std::string::String,
218
219    /// Optional. The crypto key configuration. This field is used by the
220    /// Customer-Managed Encryption Keys (CMEK) feature.
221    pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
222
223    /// Optional. Configuration for the git proxy feature. Enabling the git proxy
224    /// allows clients to perform git operations on the repositories linked in the
225    /// connection.
226    pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
227
228    /// Configuration for the connection depending on the type of provider.
229    pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
230
231    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
232}
233
234impl Connection {
235    pub fn new() -> Self {
236        std::default::Default::default()
237    }
238
239    /// Sets the value of [name][crate::model::Connection::name].
240    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
241        self.name = v.into();
242        self
243    }
244
245    /// Sets the value of [create_time][crate::model::Connection::create_time].
246    pub fn set_create_time<T>(mut self, v: T) -> Self
247    where
248        T: std::convert::Into<wkt::Timestamp>,
249    {
250        self.create_time = std::option::Option::Some(v.into());
251        self
252    }
253
254    /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
255    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
256    where
257        T: std::convert::Into<wkt::Timestamp>,
258    {
259        self.create_time = v.map(|x| x.into());
260        self
261    }
262
263    /// Sets the value of [update_time][crate::model::Connection::update_time].
264    pub fn set_update_time<T>(mut self, v: T) -> Self
265    where
266        T: std::convert::Into<wkt::Timestamp>,
267    {
268        self.update_time = std::option::Option::Some(v.into());
269        self
270    }
271
272    /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
273    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
274    where
275        T: std::convert::Into<wkt::Timestamp>,
276    {
277        self.update_time = v.map(|x| x.into());
278        self
279    }
280
281    /// Sets the value of [delete_time][crate::model::Connection::delete_time].
282    pub fn set_delete_time<T>(mut self, v: T) -> Self
283    where
284        T: std::convert::Into<wkt::Timestamp>,
285    {
286        self.delete_time = std::option::Option::Some(v.into());
287        self
288    }
289
290    /// Sets or clears the value of [delete_time][crate::model::Connection::delete_time].
291    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
292    where
293        T: std::convert::Into<wkt::Timestamp>,
294    {
295        self.delete_time = v.map(|x| x.into());
296        self
297    }
298
299    /// Sets the value of [labels][crate::model::Connection::labels].
300    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
301    where
302        T: std::iter::IntoIterator<Item = (K, V)>,
303        K: std::convert::Into<std::string::String>,
304        V: std::convert::Into<std::string::String>,
305    {
306        use std::iter::Iterator;
307        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
308        self
309    }
310
311    /// Sets the value of [installation_state][crate::model::Connection::installation_state].
312    pub fn set_installation_state<T>(mut self, v: T) -> Self
313    where
314        T: std::convert::Into<crate::model::InstallationState>,
315    {
316        self.installation_state = std::option::Option::Some(v.into());
317        self
318    }
319
320    /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
321    pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
322    where
323        T: std::convert::Into<crate::model::InstallationState>,
324    {
325        self.installation_state = v.map(|x| x.into());
326        self
327    }
328
329    /// Sets the value of [disabled][crate::model::Connection::disabled].
330    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
331        self.disabled = v.into();
332        self
333    }
334
335    /// Sets the value of [reconciling][crate::model::Connection::reconciling].
336    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
337        self.reconciling = v.into();
338        self
339    }
340
341    /// Sets the value of [annotations][crate::model::Connection::annotations].
342    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
343    where
344        T: std::iter::IntoIterator<Item = (K, V)>,
345        K: std::convert::Into<std::string::String>,
346        V: std::convert::Into<std::string::String>,
347    {
348        use std::iter::Iterator;
349        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
350        self
351    }
352
353    /// Sets the value of [etag][crate::model::Connection::etag].
354    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
355        self.etag = v.into();
356        self
357    }
358
359    /// Sets the value of [uid][crate::model::Connection::uid].
360    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
361        self.uid = v.into();
362        self
363    }
364
365    /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
366    pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
367    where
368        T: std::convert::Into<crate::model::CryptoKeyConfig>,
369    {
370        self.crypto_key_config = std::option::Option::Some(v.into());
371        self
372    }
373
374    /// Sets or clears the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
375    pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
376    where
377        T: std::convert::Into<crate::model::CryptoKeyConfig>,
378    {
379        self.crypto_key_config = v.map(|x| x.into());
380        self
381    }
382
383    /// Sets the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
384    pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
385    where
386        T: std::convert::Into<crate::model::GitProxyConfig>,
387    {
388        self.git_proxy_config = std::option::Option::Some(v.into());
389        self
390    }
391
392    /// Sets or clears the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
393    pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
394    where
395        T: std::convert::Into<crate::model::GitProxyConfig>,
396    {
397        self.git_proxy_config = v.map(|x| x.into());
398        self
399    }
400
401    /// Sets the value of [connection_config][crate::model::Connection::connection_config].
402    ///
403    /// Note that all the setters affecting `connection_config` are mutually
404    /// exclusive.
405    pub fn set_connection_config<
406        T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
407    >(
408        mut self,
409        v: T,
410    ) -> Self {
411        self.connection_config = v.into();
412        self
413    }
414
415    /// The value of [connection_config][crate::model::Connection::connection_config]
416    /// if it holds a `GithubConfig`, `None` if the field is not set or
417    /// holds a different branch.
418    pub fn github_config(
419        &self,
420    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
421        #[allow(unreachable_patterns)]
422        self.connection_config.as_ref().and_then(|v| match v {
423            crate::model::connection::ConnectionConfig::GithubConfig(v) => {
424                std::option::Option::Some(v)
425            }
426            _ => std::option::Option::None,
427        })
428    }
429
430    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
431    /// to hold a `GithubConfig`.
432    ///
433    /// Note that all the setters affecting `connection_config` are
434    /// mutually exclusive.
435    pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
436        mut self,
437        v: T,
438    ) -> Self {
439        self.connection_config = std::option::Option::Some(
440            crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
441        );
442        self
443    }
444
445    /// The value of [connection_config][crate::model::Connection::connection_config]
446    /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
447    /// holds a different branch.
448    pub fn github_enterprise_config(
449        &self,
450    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
451        #[allow(unreachable_patterns)]
452        self.connection_config.as_ref().and_then(|v| match v {
453            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
454                std::option::Option::Some(v)
455            }
456            _ => std::option::Option::None,
457        })
458    }
459
460    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
461    /// to hold a `GithubEnterpriseConfig`.
462    ///
463    /// Note that all the setters affecting `connection_config` are
464    /// mutually exclusive.
465    pub fn set_github_enterprise_config<
466        T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
467    >(
468        mut self,
469        v: T,
470    ) -> Self {
471        self.connection_config = std::option::Option::Some(
472            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
473        );
474        self
475    }
476
477    /// The value of [connection_config][crate::model::Connection::connection_config]
478    /// if it holds a `GitlabConfig`, `None` if the field is not set or
479    /// holds a different branch.
480    pub fn gitlab_config(
481        &self,
482    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
483        #[allow(unreachable_patterns)]
484        self.connection_config.as_ref().and_then(|v| match v {
485            crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
486                std::option::Option::Some(v)
487            }
488            _ => std::option::Option::None,
489        })
490    }
491
492    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
493    /// to hold a `GitlabConfig`.
494    ///
495    /// Note that all the setters affecting `connection_config` are
496    /// mutually exclusive.
497    pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
498        mut self,
499        v: T,
500    ) -> Self {
501        self.connection_config = std::option::Option::Some(
502            crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
503        );
504        self
505    }
506
507    /// The value of [connection_config][crate::model::Connection::connection_config]
508    /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
509    /// holds a different branch.
510    pub fn gitlab_enterprise_config(
511        &self,
512    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
513        #[allow(unreachable_patterns)]
514        self.connection_config.as_ref().and_then(|v| match v {
515            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
516                std::option::Option::Some(v)
517            }
518            _ => std::option::Option::None,
519        })
520    }
521
522    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
523    /// to hold a `GitlabEnterpriseConfig`.
524    ///
525    /// Note that all the setters affecting `connection_config` are
526    /// mutually exclusive.
527    pub fn set_gitlab_enterprise_config<
528        T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
529    >(
530        mut self,
531        v: T,
532    ) -> Self {
533        self.connection_config = std::option::Option::Some(
534            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
535        );
536        self
537    }
538
539    /// The value of [connection_config][crate::model::Connection::connection_config]
540    /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
541    /// holds a different branch.
542    pub fn bitbucket_data_center_config(
543        &self,
544    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
545        #[allow(unreachable_patterns)]
546        self.connection_config.as_ref().and_then(|v| match v {
547            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
548                std::option::Option::Some(v)
549            }
550            _ => std::option::Option::None,
551        })
552    }
553
554    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
555    /// to hold a `BitbucketDataCenterConfig`.
556    ///
557    /// Note that all the setters affecting `connection_config` are
558    /// mutually exclusive.
559    pub fn set_bitbucket_data_center_config<
560        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
561    >(
562        mut self,
563        v: T,
564    ) -> Self {
565        self.connection_config = std::option::Option::Some(
566            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
567        );
568        self
569    }
570
571    /// The value of [connection_config][crate::model::Connection::connection_config]
572    /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
573    /// holds a different branch.
574    pub fn bitbucket_cloud_config(
575        &self,
576    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
577        #[allow(unreachable_patterns)]
578        self.connection_config.as_ref().and_then(|v| match v {
579            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
580                std::option::Option::Some(v)
581            }
582            _ => std::option::Option::None,
583        })
584    }
585
586    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
587    /// to hold a `BitbucketCloudConfig`.
588    ///
589    /// Note that all the setters affecting `connection_config` are
590    /// mutually exclusive.
591    pub fn set_bitbucket_cloud_config<
592        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
593    >(
594        mut self,
595        v: T,
596    ) -> Self {
597        self.connection_config = std::option::Option::Some(
598            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
599        );
600        self
601    }
602}
603
604impl wkt::message::Message for Connection {
605    fn typename() -> &'static str {
606        "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
607    }
608}
609
610/// Defines additional types related to [Connection].
611pub mod connection {
612    #[allow(unused_imports)]
613    use super::*;
614
615    /// Configuration for the connection depending on the type of provider.
616    #[derive(Clone, Debug, PartialEq)]
617    #[non_exhaustive]
618    pub enum ConnectionConfig {
619        /// Configuration for connections to github.com.
620        GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
621        /// Configuration for connections to an instance of GitHub Enterprise.
622        GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
623        /// Configuration for connections to gitlab.com.
624        GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
625        /// Configuration for connections to an instance of GitLab Enterprise.
626        GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
627        /// Configuration for connections to an instance of Bitbucket Data Center.
628        BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
629        /// Configuration for connections to an instance of Bitbucket Clouds.
630        BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
631    }
632}
633
634/// The crypto key configuration. This field is used by the Customer-managed
635/// encryption keys (CMEK) feature.
636#[derive(Clone, Default, PartialEq)]
637#[non_exhaustive]
638pub struct CryptoKeyConfig {
639    /// Required. The name of the key which is used to encrypt/decrypt customer
640    /// data. For key in Cloud KMS, the key should be in the format of
641    /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
642    pub key_reference: std::string::String,
643
644    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
645}
646
647impl CryptoKeyConfig {
648    pub fn new() -> Self {
649        std::default::Default::default()
650    }
651
652    /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
653    pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
654        self.key_reference = v.into();
655        self
656    }
657}
658
659impl wkt::message::Message for CryptoKeyConfig {
660    fn typename() -> &'static str {
661        "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
662    }
663}
664
665/// The git proxy configuration.
666#[derive(Clone, Default, PartialEq)]
667#[non_exhaustive]
668pub struct GitProxyConfig {
669    /// Optional. Setting this to true allows the git proxy to be used for
670    /// performing git operations on the repositories linked in the connection.
671    pub enabled: bool,
672
673    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
674}
675
676impl GitProxyConfig {
677    pub fn new() -> Self {
678        std::default::Default::default()
679    }
680
681    /// Sets the value of [enabled][crate::model::GitProxyConfig::enabled].
682    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
683        self.enabled = v.into();
684        self
685    }
686}
687
688impl wkt::message::Message for GitProxyConfig {
689    fn typename() -> &'static str {
690        "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
691    }
692}
693
694/// Describes stage and necessary actions to be taken by the
695/// user to complete the installation. Used for GitHub and GitHub Enterprise
696/// based connections.
697#[derive(Clone, Default, PartialEq)]
698#[non_exhaustive]
699pub struct InstallationState {
700    /// Output only. Current step of the installation process.
701    pub stage: crate::model::installation_state::Stage,
702
703    /// Output only. Message of what the user should do next to continue the
704    /// installation. Empty string if the installation is already complete.
705    pub message: std::string::String,
706
707    /// Output only. Link to follow for next action. Empty string if the
708    /// installation is already complete.
709    pub action_uri: std::string::String,
710
711    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
712}
713
714impl InstallationState {
715    pub fn new() -> Self {
716        std::default::Default::default()
717    }
718
719    /// Sets the value of [stage][crate::model::InstallationState::stage].
720    pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
721        mut self,
722        v: T,
723    ) -> Self {
724        self.stage = v.into();
725        self
726    }
727
728    /// Sets the value of [message][crate::model::InstallationState::message].
729    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
730        self.message = v.into();
731        self
732    }
733
734    /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
735    pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
736        self.action_uri = v.into();
737        self
738    }
739}
740
741impl wkt::message::Message for InstallationState {
742    fn typename() -> &'static str {
743        "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
744    }
745}
746
747/// Defines additional types related to [InstallationState].
748pub mod installation_state {
749    #[allow(unused_imports)]
750    use super::*;
751
752    /// Stage of the installation process.
753    ///
754    /// # Working with unknown values
755    ///
756    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
757    /// additional enum variants at any time. Adding new variants is not considered
758    /// a breaking change. Applications should write their code in anticipation of:
759    ///
760    /// - New values appearing in future releases of the client library, **and**
761    /// - New values received dynamically, without application changes.
762    ///
763    /// Please consult the [Working with enums] section in the user guide for some
764    /// guidelines.
765    ///
766    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
767    #[derive(Clone, Debug, PartialEq)]
768    #[non_exhaustive]
769    pub enum Stage {
770        /// No stage specified.
771        Unspecified,
772        /// Only for GitHub Enterprise. An App creation has been requested.
773        /// The user needs to confirm the creation in their GitHub enterprise host.
774        PendingCreateApp,
775        /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
776        PendingUserOauth,
777        /// User needs to follow the link to install the GitHub (or Enterprise) App.
778        PendingInstallApp,
779        /// Installation process has been completed.
780        Complete,
781        /// If set, the enum was initialized with an unknown value.
782        ///
783        /// Applications can examine the value using [Stage::value] or
784        /// [Stage::name].
785        UnknownValue(stage::UnknownValue),
786    }
787
788    #[doc(hidden)]
789    pub mod stage {
790        #[allow(unused_imports)]
791        use super::*;
792        #[derive(Clone, Debug, PartialEq)]
793        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
794    }
795
796    impl Stage {
797        /// Gets the enum value.
798        ///
799        /// Returns `None` if the enum contains an unknown value deserialized from
800        /// the string representation of enums.
801        pub fn value(&self) -> std::option::Option<i32> {
802            match self {
803                Self::Unspecified => std::option::Option::Some(0),
804                Self::PendingCreateApp => std::option::Option::Some(1),
805                Self::PendingUserOauth => std::option::Option::Some(2),
806                Self::PendingInstallApp => std::option::Option::Some(3),
807                Self::Complete => std::option::Option::Some(10),
808                Self::UnknownValue(u) => u.0.value(),
809            }
810        }
811
812        /// Gets the enum value as a string.
813        ///
814        /// Returns `None` if the enum contains an unknown value deserialized from
815        /// the integer representation of enums.
816        pub fn name(&self) -> std::option::Option<&str> {
817            match self {
818                Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
819                Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
820                Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
821                Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
822                Self::Complete => std::option::Option::Some("COMPLETE"),
823                Self::UnknownValue(u) => u.0.name(),
824            }
825        }
826    }
827
828    impl std::default::Default for Stage {
829        fn default() -> Self {
830            use std::convert::From;
831            Self::from(0)
832        }
833    }
834
835    impl std::fmt::Display for Stage {
836        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
837            wkt::internal::display_enum(f, self.name(), self.value())
838        }
839    }
840
841    impl std::convert::From<i32> for Stage {
842        fn from(value: i32) -> Self {
843            match value {
844                0 => Self::Unspecified,
845                1 => Self::PendingCreateApp,
846                2 => Self::PendingUserOauth,
847                3 => Self::PendingInstallApp,
848                10 => Self::Complete,
849                _ => Self::UnknownValue(stage::UnknownValue(
850                    wkt::internal::UnknownEnumValue::Integer(value),
851                )),
852            }
853        }
854    }
855
856    impl std::convert::From<&str> for Stage {
857        fn from(value: &str) -> Self {
858            use std::string::ToString;
859            match value {
860                "STAGE_UNSPECIFIED" => Self::Unspecified,
861                "PENDING_CREATE_APP" => Self::PendingCreateApp,
862                "PENDING_USER_OAUTH" => Self::PendingUserOauth,
863                "PENDING_INSTALL_APP" => Self::PendingInstallApp,
864                "COMPLETE" => Self::Complete,
865                _ => Self::UnknownValue(stage::UnknownValue(
866                    wkt::internal::UnknownEnumValue::String(value.to_string()),
867                )),
868            }
869        }
870    }
871
872    impl serde::ser::Serialize for Stage {
873        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
874        where
875            S: serde::Serializer,
876        {
877            match self {
878                Self::Unspecified => serializer.serialize_i32(0),
879                Self::PendingCreateApp => serializer.serialize_i32(1),
880                Self::PendingUserOauth => serializer.serialize_i32(2),
881                Self::PendingInstallApp => serializer.serialize_i32(3),
882                Self::Complete => serializer.serialize_i32(10),
883                Self::UnknownValue(u) => u.0.serialize(serializer),
884            }
885        }
886    }
887
888    impl<'de> serde::de::Deserialize<'de> for Stage {
889        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
890        where
891            D: serde::Deserializer<'de>,
892        {
893            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
894                ".google.cloud.developerconnect.v1.InstallationState.Stage",
895            ))
896        }
897    }
898}
899
900/// Configuration for connections to github.com.
901#[derive(Clone, Default, PartialEq)]
902#[non_exhaustive]
903pub struct GitHubConfig {
904    /// Required. Immutable. The GitHub Application that was installed to the
905    /// GitHub user or organization.
906    pub github_app: crate::model::git_hub_config::GitHubApp,
907
908    /// Optional. OAuth credential of the account that authorized the GitHub App.
909    /// It is recommended to use a robot account instead of a human user account.
910    /// The OAuth token must be tied to the GitHub App of this config.
911    pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
912
913    /// Optional. GitHub App installation id.
914    pub app_installation_id: i64,
915
916    /// Output only. The URI to navigate to in order to manage the installation
917    /// associated with this GitHubConfig.
918    pub installation_uri: std::string::String,
919
920    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
921}
922
923impl GitHubConfig {
924    pub fn new() -> Self {
925        std::default::Default::default()
926    }
927
928    /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
929    pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
930        mut self,
931        v: T,
932    ) -> Self {
933        self.github_app = v.into();
934        self
935    }
936
937    /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
938    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
939    where
940        T: std::convert::Into<crate::model::OAuthCredential>,
941    {
942        self.authorizer_credential = std::option::Option::Some(v.into());
943        self
944    }
945
946    /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
947    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
948    where
949        T: std::convert::Into<crate::model::OAuthCredential>,
950    {
951        self.authorizer_credential = v.map(|x| x.into());
952        self
953    }
954
955    /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
956    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
957        self.app_installation_id = v.into();
958        self
959    }
960
961    /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
962    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
963        mut self,
964        v: T,
965    ) -> Self {
966        self.installation_uri = v.into();
967        self
968    }
969}
970
971impl wkt::message::Message for GitHubConfig {
972    fn typename() -> &'static str {
973        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
974    }
975}
976
977/// Defines additional types related to [GitHubConfig].
978pub mod git_hub_config {
979    #[allow(unused_imports)]
980    use super::*;
981
982    /// Represents the various GitHub Applications that can be installed to a
983    /// GitHub user or organization and used with Developer Connect.
984    ///
985    /// # Working with unknown values
986    ///
987    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
988    /// additional enum variants at any time. Adding new variants is not considered
989    /// a breaking change. Applications should write their code in anticipation of:
990    ///
991    /// - New values appearing in future releases of the client library, **and**
992    /// - New values received dynamically, without application changes.
993    ///
994    /// Please consult the [Working with enums] section in the user guide for some
995    /// guidelines.
996    ///
997    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
998    #[derive(Clone, Debug, PartialEq)]
999    #[non_exhaustive]
1000    pub enum GitHubApp {
1001        /// GitHub App not specified.
1002        Unspecified,
1003        /// The Developer Connect GitHub Application.
1004        DeveloperConnect,
1005        /// The Firebase GitHub Application.
1006        Firebase,
1007        /// If set, the enum was initialized with an unknown value.
1008        ///
1009        /// Applications can examine the value using [GitHubApp::value] or
1010        /// [GitHubApp::name].
1011        UnknownValue(git_hub_app::UnknownValue),
1012    }
1013
1014    #[doc(hidden)]
1015    pub mod git_hub_app {
1016        #[allow(unused_imports)]
1017        use super::*;
1018        #[derive(Clone, Debug, PartialEq)]
1019        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1020    }
1021
1022    impl GitHubApp {
1023        /// Gets the enum value.
1024        ///
1025        /// Returns `None` if the enum contains an unknown value deserialized from
1026        /// the string representation of enums.
1027        pub fn value(&self) -> std::option::Option<i32> {
1028            match self {
1029                Self::Unspecified => std::option::Option::Some(0),
1030                Self::DeveloperConnect => std::option::Option::Some(1),
1031                Self::Firebase => std::option::Option::Some(2),
1032                Self::UnknownValue(u) => u.0.value(),
1033            }
1034        }
1035
1036        /// Gets the enum value as a string.
1037        ///
1038        /// Returns `None` if the enum contains an unknown value deserialized from
1039        /// the integer representation of enums.
1040        pub fn name(&self) -> std::option::Option<&str> {
1041            match self {
1042                Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
1043                Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
1044                Self::Firebase => std::option::Option::Some("FIREBASE"),
1045                Self::UnknownValue(u) => u.0.name(),
1046            }
1047        }
1048    }
1049
1050    impl std::default::Default for GitHubApp {
1051        fn default() -> Self {
1052            use std::convert::From;
1053            Self::from(0)
1054        }
1055    }
1056
1057    impl std::fmt::Display for GitHubApp {
1058        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1059            wkt::internal::display_enum(f, self.name(), self.value())
1060        }
1061    }
1062
1063    impl std::convert::From<i32> for GitHubApp {
1064        fn from(value: i32) -> Self {
1065            match value {
1066                0 => Self::Unspecified,
1067                1 => Self::DeveloperConnect,
1068                2 => Self::Firebase,
1069                _ => Self::UnknownValue(git_hub_app::UnknownValue(
1070                    wkt::internal::UnknownEnumValue::Integer(value),
1071                )),
1072            }
1073        }
1074    }
1075
1076    impl std::convert::From<&str> for GitHubApp {
1077        fn from(value: &str) -> Self {
1078            use std::string::ToString;
1079            match value {
1080                "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
1081                "DEVELOPER_CONNECT" => Self::DeveloperConnect,
1082                "FIREBASE" => Self::Firebase,
1083                _ => Self::UnknownValue(git_hub_app::UnknownValue(
1084                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1085                )),
1086            }
1087        }
1088    }
1089
1090    impl serde::ser::Serialize for GitHubApp {
1091        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1092        where
1093            S: serde::Serializer,
1094        {
1095            match self {
1096                Self::Unspecified => serializer.serialize_i32(0),
1097                Self::DeveloperConnect => serializer.serialize_i32(1),
1098                Self::Firebase => serializer.serialize_i32(2),
1099                Self::UnknownValue(u) => u.0.serialize(serializer),
1100            }
1101        }
1102    }
1103
1104    impl<'de> serde::de::Deserialize<'de> for GitHubApp {
1105        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1106        where
1107            D: serde::Deserializer<'de>,
1108        {
1109            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
1110                ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
1111            ))
1112        }
1113    }
1114}
1115
1116/// Configuration for connections to an instance of GitHub Enterprise.
1117#[derive(Clone, Default, PartialEq)]
1118#[non_exhaustive]
1119pub struct GitHubEnterpriseConfig {
1120    /// Required. The URI of the GitHub Enterprise host this connection is for.
1121    pub host_uri: std::string::String,
1122
1123    /// Optional. ID of the GitHub App created from the manifest.
1124    pub app_id: i64,
1125
1126    /// Output only. The URL-friendly name of the GitHub App.
1127    pub app_slug: std::string::String,
1128
1129    /// Optional. SecretManager resource containing the private key of the GitHub
1130    /// App, formatted as `projects/*/secrets/*/versions/*`.
1131    pub private_key_secret_version: std::string::String,
1132
1133    /// Optional. SecretManager resource containing the webhook secret of the
1134    /// GitHub App, formatted as `projects/*/secrets/*/versions/*`.
1135    pub webhook_secret_secret_version: std::string::String,
1136
1137    /// Optional. ID of the installation of the GitHub App.
1138    pub app_installation_id: i64,
1139
1140    /// Output only. The URI to navigate to in order to manage the installation
1141    /// associated with this GitHubEnterpriseConfig.
1142    pub installation_uri: std::string::String,
1143
1144    /// Optional. Configuration for using Service Directory to privately connect to
1145    /// a GitHub Enterprise server. This should only be set if the GitHub
1146    /// Enterprise server is hosted on-premises and not reachable by public
1147    /// internet. If this field is left empty, calls to the GitHub Enterprise
1148    /// server will be made over the public internet.
1149    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1150
1151    /// Output only. GitHub Enterprise version installed at the host_uri.
1152    pub server_version: std::string::String,
1153
1154    /// Optional. SSL certificate to use for requests to GitHub Enterprise.
1155    pub ssl_ca_certificate: std::string::String,
1156
1157    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1158}
1159
1160impl GitHubEnterpriseConfig {
1161    pub fn new() -> Self {
1162        std::default::Default::default()
1163    }
1164
1165    /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
1166    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1167        self.host_uri = v.into();
1168        self
1169    }
1170
1171    /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
1172    pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1173        self.app_id = v.into();
1174        self
1175    }
1176
1177    /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
1178    pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1179        self.app_slug = v.into();
1180        self
1181    }
1182
1183    /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
1184    pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
1185        mut self,
1186        v: T,
1187    ) -> Self {
1188        self.private_key_secret_version = v.into();
1189        self
1190    }
1191
1192    /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
1193    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1194        mut self,
1195        v: T,
1196    ) -> Self {
1197        self.webhook_secret_secret_version = v.into();
1198        self
1199    }
1200
1201    /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
1202    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1203        self.app_installation_id = v.into();
1204        self
1205    }
1206
1207    /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
1208    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
1209        mut self,
1210        v: T,
1211    ) -> Self {
1212        self.installation_uri = v.into();
1213        self
1214    }
1215
1216    /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
1217    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1218    where
1219        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1220    {
1221        self.service_directory_config = std::option::Option::Some(v.into());
1222        self
1223    }
1224
1225    /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
1226    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1227    where
1228        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1229    {
1230        self.service_directory_config = v.map(|x| x.into());
1231        self
1232    }
1233
1234    /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
1235    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1236        self.server_version = v.into();
1237        self
1238    }
1239
1240    /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
1241    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1242        mut self,
1243        v: T,
1244    ) -> Self {
1245        self.ssl_ca_certificate = v.into();
1246        self
1247    }
1248}
1249
1250impl wkt::message::Message for GitHubEnterpriseConfig {
1251    fn typename() -> &'static str {
1252        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
1253    }
1254}
1255
1256/// ServiceDirectoryConfig represents Service Directory configuration for a
1257/// connection.
1258#[derive(Clone, Default, PartialEq)]
1259#[non_exhaustive]
1260pub struct ServiceDirectoryConfig {
1261    /// Required. The Service Directory service name.
1262    /// Format:
1263    /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
1264    pub service: std::string::String,
1265
1266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1267}
1268
1269impl ServiceDirectoryConfig {
1270    pub fn new() -> Self {
1271        std::default::Default::default()
1272    }
1273
1274    /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
1275    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276        self.service = v.into();
1277        self
1278    }
1279}
1280
1281impl wkt::message::Message for ServiceDirectoryConfig {
1282    fn typename() -> &'static str {
1283        "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
1284    }
1285}
1286
1287/// Represents an OAuth token of the account that authorized the Connection,
1288/// and associated metadata.
1289#[derive(Clone, Default, PartialEq)]
1290#[non_exhaustive]
1291pub struct OAuthCredential {
1292    /// Required. A SecretManager resource containing the OAuth token that
1293    /// authorizes the connection. Format: `projects/*/secrets/*/versions/*`.
1294    pub oauth_token_secret_version: std::string::String,
1295
1296    /// Output only. The username associated with this token.
1297    pub username: std::string::String,
1298
1299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1300}
1301
1302impl OAuthCredential {
1303    pub fn new() -> Self {
1304        std::default::Default::default()
1305    }
1306
1307    /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
1308    pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
1309        mut self,
1310        v: T,
1311    ) -> Self {
1312        self.oauth_token_secret_version = v.into();
1313        self
1314    }
1315
1316    /// Sets the value of [username][crate::model::OAuthCredential::username].
1317    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1318        self.username = v.into();
1319        self
1320    }
1321}
1322
1323impl wkt::message::Message for OAuthCredential {
1324    fn typename() -> &'static str {
1325        "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
1326    }
1327}
1328
1329/// Configuration for connections to gitlab.com.
1330#[derive(Clone, Default, PartialEq)]
1331#[non_exhaustive]
1332pub struct GitLabConfig {
1333    /// Required. Immutable. SecretManager resource containing the webhook secret
1334    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This
1335    /// is used to validate webhooks.
1336    pub webhook_secret_secret_version: std::string::String,
1337
1338    /// Required. A GitLab personal access token with the minimum `read_api` scope
1339    /// access and a minimum role of `reporter`. The GitLab Projects visible to
1340    /// this Personal Access Token will control which Projects Developer Connect
1341    /// has access to.
1342    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1343
1344    /// Required. A GitLab personal access token with the minimum `api` scope
1345    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
1346    /// this Personal Access Token will control which Projects Developer Connect
1347    /// has access to.
1348    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1349
1350    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1351}
1352
1353impl GitLabConfig {
1354    pub fn new() -> Self {
1355        std::default::Default::default()
1356    }
1357
1358    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
1359    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1360        mut self,
1361        v: T,
1362    ) -> Self {
1363        self.webhook_secret_secret_version = v.into();
1364        self
1365    }
1366
1367    /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
1368    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1369    where
1370        T: std::convert::Into<crate::model::UserCredential>,
1371    {
1372        self.read_authorizer_credential = std::option::Option::Some(v.into());
1373        self
1374    }
1375
1376    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
1377    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1378    where
1379        T: std::convert::Into<crate::model::UserCredential>,
1380    {
1381        self.read_authorizer_credential = v.map(|x| x.into());
1382        self
1383    }
1384
1385    /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
1386    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1387    where
1388        T: std::convert::Into<crate::model::UserCredential>,
1389    {
1390        self.authorizer_credential = std::option::Option::Some(v.into());
1391        self
1392    }
1393
1394    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
1395    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1396    where
1397        T: std::convert::Into<crate::model::UserCredential>,
1398    {
1399        self.authorizer_credential = v.map(|x| x.into());
1400        self
1401    }
1402}
1403
1404impl wkt::message::Message for GitLabConfig {
1405    fn typename() -> &'static str {
1406        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
1407    }
1408}
1409
1410/// Represents a personal access token that authorized the Connection,
1411/// and associated metadata.
1412#[derive(Clone, Default, PartialEq)]
1413#[non_exhaustive]
1414pub struct UserCredential {
1415    /// Required. A SecretManager resource containing the user token that
1416    /// authorizes the Developer Connect connection. Format:
1417    /// `projects/*/secrets/*/versions/*`.
1418    pub user_token_secret_version: std::string::String,
1419
1420    /// Output only. The username associated with this token.
1421    pub username: std::string::String,
1422
1423    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1424}
1425
1426impl UserCredential {
1427    pub fn new() -> Self {
1428        std::default::Default::default()
1429    }
1430
1431    /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
1432    pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
1433        mut self,
1434        v: T,
1435    ) -> Self {
1436        self.user_token_secret_version = v.into();
1437        self
1438    }
1439
1440    /// Sets the value of [username][crate::model::UserCredential::username].
1441    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1442        self.username = v.into();
1443        self
1444    }
1445}
1446
1447impl wkt::message::Message for UserCredential {
1448    fn typename() -> &'static str {
1449        "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
1450    }
1451}
1452
1453/// Configuration for connections to an instance of GitLab Enterprise.
1454#[derive(Clone, Default, PartialEq)]
1455#[non_exhaustive]
1456pub struct GitLabEnterpriseConfig {
1457    /// Required. The URI of the GitLab Enterprise host this connection is for.
1458    pub host_uri: std::string::String,
1459
1460    /// Required. Immutable. SecretManager resource containing the webhook secret
1461    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This
1462    /// is used to validate webhooks.
1463    pub webhook_secret_secret_version: std::string::String,
1464
1465    /// Required. A GitLab personal access token with the minimum `read_api` scope
1466    /// access and a minimum role of `reporter`. The GitLab Projects visible to
1467    /// this Personal Access Token will control which Projects Developer Connect
1468    /// has access to.
1469    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1470
1471    /// Required. A GitLab personal access token with the minimum `api` scope
1472    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
1473    /// this Personal Access Token will control which Projects Developer Connect
1474    /// has access to.
1475    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1476
1477    /// Optional. Configuration for using Service Directory to privately connect to
1478    /// a GitLab Enterprise instance. This should only be set if the GitLab
1479    /// Enterprise server is hosted on-premises and not reachable by public
1480    /// internet. If this field is left empty, calls to the GitLab Enterprise
1481    /// server will be made over the public internet.
1482    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1483
1484    /// Optional. SSL Certificate Authority certificate to use for requests to
1485    /// GitLab Enterprise instance.
1486    pub ssl_ca_certificate: std::string::String,
1487
1488    /// Output only. Version of the GitLab Enterprise server running on the
1489    /// `host_uri`.
1490    pub server_version: std::string::String,
1491
1492    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1493}
1494
1495impl GitLabEnterpriseConfig {
1496    pub fn new() -> Self {
1497        std::default::Default::default()
1498    }
1499
1500    /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
1501    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1502        self.host_uri = v.into();
1503        self
1504    }
1505
1506    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
1507    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1508        mut self,
1509        v: T,
1510    ) -> Self {
1511        self.webhook_secret_secret_version = v.into();
1512        self
1513    }
1514
1515    /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
1516    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1517    where
1518        T: std::convert::Into<crate::model::UserCredential>,
1519    {
1520        self.read_authorizer_credential = std::option::Option::Some(v.into());
1521        self
1522    }
1523
1524    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
1525    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1526    where
1527        T: std::convert::Into<crate::model::UserCredential>,
1528    {
1529        self.read_authorizer_credential = v.map(|x| x.into());
1530        self
1531    }
1532
1533    /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
1534    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1535    where
1536        T: std::convert::Into<crate::model::UserCredential>,
1537    {
1538        self.authorizer_credential = std::option::Option::Some(v.into());
1539        self
1540    }
1541
1542    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
1543    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1544    where
1545        T: std::convert::Into<crate::model::UserCredential>,
1546    {
1547        self.authorizer_credential = v.map(|x| x.into());
1548        self
1549    }
1550
1551    /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
1552    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1553    where
1554        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1555    {
1556        self.service_directory_config = std::option::Option::Some(v.into());
1557        self
1558    }
1559
1560    /// Sets or clears the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
1561    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1562    where
1563        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1564    {
1565        self.service_directory_config = v.map(|x| x.into());
1566        self
1567    }
1568
1569    /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
1570    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1571        mut self,
1572        v: T,
1573    ) -> Self {
1574        self.ssl_ca_certificate = v.into();
1575        self
1576    }
1577
1578    /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
1579    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1580        self.server_version = v.into();
1581        self
1582    }
1583}
1584
1585impl wkt::message::Message for GitLabEnterpriseConfig {
1586    fn typename() -> &'static str {
1587        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
1588    }
1589}
1590
1591/// Configuration for connections to an instance of Bitbucket Data Center.
1592#[derive(Clone, Default, PartialEq)]
1593#[non_exhaustive]
1594pub struct BitbucketDataCenterConfig {
1595    /// Required. The URI of the Bitbucket Data Center host this connection is for.
1596    pub host_uri: std::string::String,
1597
1598    /// Required. Immutable. SecretManager resource containing the webhook secret
1599    /// used to verify webhook events, formatted as
1600    /// `projects/*/secrets/*/versions/*`. This is used to validate webhooks.
1601    pub webhook_secret_secret_version: std::string::String,
1602
1603    /// Required. An http access token with the minimum `Repository read` access.
1604    /// It's recommended to use a system account to generate the credentials.
1605    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1606
1607    /// Required. An http access token with the minimum `Repository admin` scope
1608    /// access. This is needed to create webhooks. It's recommended to use a system
1609    /// account to generate these credentials.
1610    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1611
1612    /// Optional. Configuration for using Service Directory to privately connect to
1613    /// a Bitbucket Data Center instance. This should only be set if the Bitbucket
1614    /// Data Center is hosted on-premises and not reachable by public internet. If
1615    /// this field is left empty, calls to the Bitbucket Data Center will be made
1616    /// over the public internet.
1617    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1618
1619    /// Optional. SSL certificate authority to trust when making requests to
1620    /// Bitbucket Data Center.
1621    pub ssl_ca_certificate: std::string::String,
1622
1623    /// Output only. Version of the Bitbucket Data Center server running on the
1624    /// `host_uri`.
1625    pub server_version: std::string::String,
1626
1627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1628}
1629
1630impl BitbucketDataCenterConfig {
1631    pub fn new() -> Self {
1632        std::default::Default::default()
1633    }
1634
1635    /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
1636    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1637        self.host_uri = v.into();
1638        self
1639    }
1640
1641    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
1642    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1643        mut self,
1644        v: T,
1645    ) -> Self {
1646        self.webhook_secret_secret_version = v.into();
1647        self
1648    }
1649
1650    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
1651    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1652    where
1653        T: std::convert::Into<crate::model::UserCredential>,
1654    {
1655        self.read_authorizer_credential = std::option::Option::Some(v.into());
1656        self
1657    }
1658
1659    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
1660    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1661    where
1662        T: std::convert::Into<crate::model::UserCredential>,
1663    {
1664        self.read_authorizer_credential = v.map(|x| x.into());
1665        self
1666    }
1667
1668    /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
1669    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1670    where
1671        T: std::convert::Into<crate::model::UserCredential>,
1672    {
1673        self.authorizer_credential = std::option::Option::Some(v.into());
1674        self
1675    }
1676
1677    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
1678    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1679    where
1680        T: std::convert::Into<crate::model::UserCredential>,
1681    {
1682        self.authorizer_credential = v.map(|x| x.into());
1683        self
1684    }
1685
1686    /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
1687    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1688    where
1689        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1690    {
1691        self.service_directory_config = std::option::Option::Some(v.into());
1692        self
1693    }
1694
1695    /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
1696    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1697    where
1698        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1699    {
1700        self.service_directory_config = v.map(|x| x.into());
1701        self
1702    }
1703
1704    /// Sets the value of [ssl_ca_certificate][crate::model::BitbucketDataCenterConfig::ssl_ca_certificate].
1705    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1706        mut self,
1707        v: T,
1708    ) -> Self {
1709        self.ssl_ca_certificate = v.into();
1710        self
1711    }
1712
1713    /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
1714    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1715        self.server_version = v.into();
1716        self
1717    }
1718}
1719
1720impl wkt::message::Message for BitbucketDataCenterConfig {
1721    fn typename() -> &'static str {
1722        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
1723    }
1724}
1725
1726/// Configuration for connections to an instance of Bitbucket Cloud.
1727#[derive(Clone, Default, PartialEq)]
1728#[non_exhaustive]
1729pub struct BitbucketCloudConfig {
1730    /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
1731    /// Platform.
1732    pub workspace: std::string::String,
1733
1734    /// Required. Immutable. SecretManager resource containing the webhook secret
1735    /// used to verify webhook events, formatted as
1736    /// `projects/*/secrets/*/versions/*`. This is used to validate and create
1737    /// webhooks.
1738    pub webhook_secret_secret_version: std::string::String,
1739
1740    /// Required. An access token with the minimum `repository` access.
1741    /// It can either be a workspace, project or repository access token.
1742    /// It's recommended to use a system account to generate the credentials.
1743    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1744
1745    /// Required. An access token with the minimum `repository`, `pullrequest` and
1746    /// `webhook` scope access. It can either be a workspace, project or repository
1747    /// access token. This is needed to create webhooks. It's recommended to use a
1748    /// system account to generate these credentials.
1749    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1750
1751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1752}
1753
1754impl BitbucketCloudConfig {
1755    pub fn new() -> Self {
1756        std::default::Default::default()
1757    }
1758
1759    /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
1760    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1761        self.workspace = v.into();
1762        self
1763    }
1764
1765    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
1766    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1767        mut self,
1768        v: T,
1769    ) -> Self {
1770        self.webhook_secret_secret_version = v.into();
1771        self
1772    }
1773
1774    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
1775    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1776    where
1777        T: std::convert::Into<crate::model::UserCredential>,
1778    {
1779        self.read_authorizer_credential = std::option::Option::Some(v.into());
1780        self
1781    }
1782
1783    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
1784    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1785    where
1786        T: std::convert::Into<crate::model::UserCredential>,
1787    {
1788        self.read_authorizer_credential = v.map(|x| x.into());
1789        self
1790    }
1791
1792    /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
1793    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1794    where
1795        T: std::convert::Into<crate::model::UserCredential>,
1796    {
1797        self.authorizer_credential = std::option::Option::Some(v.into());
1798        self
1799    }
1800
1801    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
1802    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1803    where
1804        T: std::convert::Into<crate::model::UserCredential>,
1805    {
1806        self.authorizer_credential = v.map(|x| x.into());
1807        self
1808    }
1809}
1810
1811impl wkt::message::Message for BitbucketCloudConfig {
1812    fn typename() -> &'static str {
1813        "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
1814    }
1815}
1816
1817/// Message for requesting list of Connections
1818#[derive(Clone, Default, PartialEq)]
1819#[non_exhaustive]
1820pub struct ListConnectionsRequest {
1821    /// Required. Parent value for ListConnectionsRequest
1822    pub parent: std::string::String,
1823
1824    /// Optional. Requested page size. Server may return fewer items than
1825    /// requested. If unspecified, server will pick an appropriate default.
1826    pub page_size: i32,
1827
1828    /// Optional. A token identifying a page of results the server should return.
1829    pub page_token: std::string::String,
1830
1831    /// Optional. Filtering results
1832    pub filter: std::string::String,
1833
1834    /// Optional. Hint for how to order the results
1835    pub order_by: std::string::String,
1836
1837    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1838}
1839
1840impl ListConnectionsRequest {
1841    pub fn new() -> Self {
1842        std::default::Default::default()
1843    }
1844
1845    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
1846    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1847        self.parent = v.into();
1848        self
1849    }
1850
1851    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
1852    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1853        self.page_size = v.into();
1854        self
1855    }
1856
1857    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
1858    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1859        self.page_token = v.into();
1860        self
1861    }
1862
1863    /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
1864    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1865        self.filter = v.into();
1866        self
1867    }
1868
1869    /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
1870    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1871        self.order_by = v.into();
1872        self
1873    }
1874}
1875
1876impl wkt::message::Message for ListConnectionsRequest {
1877    fn typename() -> &'static str {
1878        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
1879    }
1880}
1881
1882/// Message for response to listing Connections
1883#[derive(Clone, Default, PartialEq)]
1884#[non_exhaustive]
1885pub struct ListConnectionsResponse {
1886    /// The list of Connection
1887    pub connections: std::vec::Vec<crate::model::Connection>,
1888
1889    /// A token identifying a page of results the server should return.
1890    pub next_page_token: std::string::String,
1891
1892    /// Locations that could not be reached.
1893    pub unreachable: std::vec::Vec<std::string::String>,
1894
1895    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1896}
1897
1898impl ListConnectionsResponse {
1899    pub fn new() -> Self {
1900        std::default::Default::default()
1901    }
1902
1903    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
1904    pub fn set_connections<T, V>(mut self, v: T) -> Self
1905    where
1906        T: std::iter::IntoIterator<Item = V>,
1907        V: std::convert::Into<crate::model::Connection>,
1908    {
1909        use std::iter::Iterator;
1910        self.connections = v.into_iter().map(|i| i.into()).collect();
1911        self
1912    }
1913
1914    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
1915    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1916        self.next_page_token = v.into();
1917        self
1918    }
1919
1920    /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
1921    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1922    where
1923        T: std::iter::IntoIterator<Item = V>,
1924        V: std::convert::Into<std::string::String>,
1925    {
1926        use std::iter::Iterator;
1927        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1928        self
1929    }
1930}
1931
1932impl wkt::message::Message for ListConnectionsResponse {
1933    fn typename() -> &'static str {
1934        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
1935    }
1936}
1937
1938#[doc(hidden)]
1939impl gax::paginator::internal::PageableResponse for ListConnectionsResponse {
1940    type PageItem = crate::model::Connection;
1941
1942    fn items(self) -> std::vec::Vec<Self::PageItem> {
1943        self.connections
1944    }
1945
1946    fn next_page_token(&self) -> std::string::String {
1947        use std::clone::Clone;
1948        self.next_page_token.clone()
1949    }
1950}
1951
1952/// Message for getting a Connection
1953#[derive(Clone, Default, PartialEq)]
1954#[non_exhaustive]
1955pub struct GetConnectionRequest {
1956    /// Required. Name of the resource
1957    pub name: std::string::String,
1958
1959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1960}
1961
1962impl GetConnectionRequest {
1963    pub fn new() -> Self {
1964        std::default::Default::default()
1965    }
1966
1967    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
1968    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1969        self.name = v.into();
1970        self
1971    }
1972}
1973
1974impl wkt::message::Message for GetConnectionRequest {
1975    fn typename() -> &'static str {
1976        "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
1977    }
1978}
1979
1980/// Message for creating a Connection
1981#[derive(Clone, Default, PartialEq)]
1982#[non_exhaustive]
1983pub struct CreateConnectionRequest {
1984    /// Required. Value for parent.
1985    pub parent: std::string::String,
1986
1987    /// Required. Id of the requesting object
1988    /// If auto-generating Id server-side, remove this field and
1989    /// connection_id from the method_signature of Create RPC
1990    pub connection_id: std::string::String,
1991
1992    /// Required. The resource being created
1993    pub connection: std::option::Option<crate::model::Connection>,
1994
1995    /// Optional. An optional request ID to identify requests. Specify a unique
1996    /// request ID so that if you must retry your request, the server will know to
1997    /// ignore the request if it has already been completed. The server will
1998    /// guarantee that for at least 60 minutes since the first request.
1999    ///
2000    /// For example, consider a situation where you make an initial request and the
2001    /// request times out. If you make the request again with the same request
2002    /// ID, the server can check if original operation with the same request ID
2003    /// was received, and if so, will ignore the second request. This prevents
2004    /// clients from accidentally creating duplicate commitments.
2005    ///
2006    /// The request ID must be a valid UUID with the exception that zero UUID is
2007    /// not supported (00000000-0000-0000-0000-000000000000).
2008    pub request_id: std::string::String,
2009
2010    /// Optional. If set, validate the request, but do not actually post it.
2011    pub validate_only: bool,
2012
2013    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2014}
2015
2016impl CreateConnectionRequest {
2017    pub fn new() -> Self {
2018        std::default::Default::default()
2019    }
2020
2021    /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
2022    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2023        self.parent = v.into();
2024        self
2025    }
2026
2027    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
2028    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2029        self.connection_id = v.into();
2030        self
2031    }
2032
2033    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
2034    pub fn set_connection<T>(mut self, v: T) -> Self
2035    where
2036        T: std::convert::Into<crate::model::Connection>,
2037    {
2038        self.connection = std::option::Option::Some(v.into());
2039        self
2040    }
2041
2042    /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
2043    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
2044    where
2045        T: std::convert::Into<crate::model::Connection>,
2046    {
2047        self.connection = v.map(|x| x.into());
2048        self
2049    }
2050
2051    /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
2052    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2053        self.request_id = v.into();
2054        self
2055    }
2056
2057    /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
2058    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2059        self.validate_only = v.into();
2060        self
2061    }
2062}
2063
2064impl wkt::message::Message for CreateConnectionRequest {
2065    fn typename() -> &'static str {
2066        "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
2067    }
2068}
2069
2070/// Message for updating a Connection
2071#[derive(Clone, Default, PartialEq)]
2072#[non_exhaustive]
2073pub struct UpdateConnectionRequest {
2074    /// Required. Field mask is used to specify the fields to be overwritten in the
2075    /// Connection resource by the update.
2076    /// The fields specified in the update_mask are relative to the resource, not
2077    /// the full request. A field will be overwritten if it is in the mask. If the
2078    /// user does not provide a mask then all fields will be overwritten.
2079    pub update_mask: std::option::Option<wkt::FieldMask>,
2080
2081    /// Required. The resource being updated
2082    pub connection: std::option::Option<crate::model::Connection>,
2083
2084    /// Optional. An optional request ID to identify requests. Specify a unique
2085    /// request ID so that if you must retry your request, the server will know to
2086    /// ignore the request if it has already been completed. The server will
2087    /// guarantee that for at least 60 minutes since the first request.
2088    ///
2089    /// For example, consider a situation where you make an initial request and the
2090    /// request times out. If you make the request again with the same request
2091    /// ID, the server can check if original operation with the same request ID
2092    /// was received, and if so, will ignore the second request. This prevents
2093    /// clients from accidentally creating duplicate commitments.
2094    ///
2095    /// The request ID must be a valid UUID with the exception that zero UUID is
2096    /// not supported (00000000-0000-0000-0000-000000000000).
2097    pub request_id: std::string::String,
2098
2099    /// Optional. If set to true, and the connection is not found a new connection
2100    /// will be created. In this situation `update_mask` is ignored.
2101    /// The creation will succeed only if the input connection has all the
2102    /// necessary information (e.g a github_config with both  user_oauth_token and
2103    /// installation_id properties).
2104    pub allow_missing: bool,
2105
2106    /// Optional. If set, validate the request, but do not actually post it.
2107    pub validate_only: bool,
2108
2109    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2110}
2111
2112impl UpdateConnectionRequest {
2113    pub fn new() -> Self {
2114        std::default::Default::default()
2115    }
2116
2117    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
2118    pub fn set_update_mask<T>(mut self, v: T) -> Self
2119    where
2120        T: std::convert::Into<wkt::FieldMask>,
2121    {
2122        self.update_mask = std::option::Option::Some(v.into());
2123        self
2124    }
2125
2126    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
2127    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2128    where
2129        T: std::convert::Into<wkt::FieldMask>,
2130    {
2131        self.update_mask = v.map(|x| x.into());
2132        self
2133    }
2134
2135    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
2136    pub fn set_connection<T>(mut self, v: T) -> Self
2137    where
2138        T: std::convert::Into<crate::model::Connection>,
2139    {
2140        self.connection = std::option::Option::Some(v.into());
2141        self
2142    }
2143
2144    /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
2145    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
2146    where
2147        T: std::convert::Into<crate::model::Connection>,
2148    {
2149        self.connection = v.map(|x| x.into());
2150        self
2151    }
2152
2153    /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
2154    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2155        self.request_id = v.into();
2156        self
2157    }
2158
2159    /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
2160    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2161        self.allow_missing = v.into();
2162        self
2163    }
2164
2165    /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
2166    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2167        self.validate_only = v.into();
2168        self
2169    }
2170}
2171
2172impl wkt::message::Message for UpdateConnectionRequest {
2173    fn typename() -> &'static str {
2174        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
2175    }
2176}
2177
2178/// Message for deleting a Connection
2179#[derive(Clone, Default, PartialEq)]
2180#[non_exhaustive]
2181pub struct DeleteConnectionRequest {
2182    /// Required. Name of the resource
2183    pub name: std::string::String,
2184
2185    /// Optional. An optional request ID to identify requests. Specify a unique
2186    /// request ID so that if you must retry your request, the server will know to
2187    /// ignore the request if it has already been completed. The server will
2188    /// guarantee that for at least 60 minutes after the first request.
2189    ///
2190    /// For example, consider a situation where you make an initial request and the
2191    /// request times out. If you make the request again with the same request
2192    /// ID, the server can check if original operation with the same request ID
2193    /// was received, and if so, will ignore the second request. This prevents
2194    /// clients from accidentally creating duplicate commitments.
2195    ///
2196    /// The request ID must be a valid UUID with the exception that zero UUID is
2197    /// not supported (00000000-0000-0000-0000-000000000000).
2198    pub request_id: std::string::String,
2199
2200    /// Optional. If set, validate the request, but do not actually post it.
2201    pub validate_only: bool,
2202
2203    /// Optional. The current etag of the Connection.
2204    /// If an etag is provided and does not match the current etag of the
2205    /// Connection, deletion will be blocked and an ABORTED error will be returned.
2206    pub etag: std::string::String,
2207
2208    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2209}
2210
2211impl DeleteConnectionRequest {
2212    pub fn new() -> Self {
2213        std::default::Default::default()
2214    }
2215
2216    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
2217    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2218        self.name = v.into();
2219        self
2220    }
2221
2222    /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
2223    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2224        self.request_id = v.into();
2225        self
2226    }
2227
2228    /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
2229    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2230        self.validate_only = v.into();
2231        self
2232    }
2233
2234    /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
2235    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2236        self.etag = v.into();
2237        self
2238    }
2239}
2240
2241impl wkt::message::Message for DeleteConnectionRequest {
2242    fn typename() -> &'static str {
2243        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
2244    }
2245}
2246
2247/// Message for requesting list of AccountConnectors
2248#[derive(Clone, Default, PartialEq)]
2249#[non_exhaustive]
2250pub struct ListAccountConnectorsRequest {
2251    /// Required. Parent value for ListAccountConnectorsRequest
2252    pub parent: std::string::String,
2253
2254    /// Optional. Requested page size. Server may return fewer items than
2255    /// requested. If unspecified, server will pick an appropriate default.
2256    pub page_size: i32,
2257
2258    /// Optional. A token identifying a page of results the server should return.
2259    pub page_token: std::string::String,
2260
2261    /// Optional. Filtering results
2262    pub filter: std::string::String,
2263
2264    /// Optional. Hint for how to order the results
2265    pub order_by: std::string::String,
2266
2267    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2268}
2269
2270impl ListAccountConnectorsRequest {
2271    pub fn new() -> Self {
2272        std::default::Default::default()
2273    }
2274
2275    /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
2276    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2277        self.parent = v.into();
2278        self
2279    }
2280
2281    /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
2282    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2283        self.page_size = v.into();
2284        self
2285    }
2286
2287    /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
2288    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2289        self.page_token = v.into();
2290        self
2291    }
2292
2293    /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
2294    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2295        self.filter = v.into();
2296        self
2297    }
2298
2299    /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
2300    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2301        self.order_by = v.into();
2302        self
2303    }
2304}
2305
2306impl wkt::message::Message for ListAccountConnectorsRequest {
2307    fn typename() -> &'static str {
2308        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
2309    }
2310}
2311
2312/// Message for response to listing AccountConnectors
2313#[derive(Clone, Default, PartialEq)]
2314#[non_exhaustive]
2315pub struct ListAccountConnectorsResponse {
2316    /// The list of AccountConnectors
2317    pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
2318
2319    /// A token identifying a page of results the server should return.
2320    pub next_page_token: std::string::String,
2321
2322    /// Locations that could not be reached.
2323    pub unreachable: std::vec::Vec<std::string::String>,
2324
2325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2326}
2327
2328impl ListAccountConnectorsResponse {
2329    pub fn new() -> Self {
2330        std::default::Default::default()
2331    }
2332
2333    /// Sets the value of [account_connectors][crate::model::ListAccountConnectorsResponse::account_connectors].
2334    pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
2335    where
2336        T: std::iter::IntoIterator<Item = V>,
2337        V: std::convert::Into<crate::model::AccountConnector>,
2338    {
2339        use std::iter::Iterator;
2340        self.account_connectors = v.into_iter().map(|i| i.into()).collect();
2341        self
2342    }
2343
2344    /// Sets the value of [next_page_token][crate::model::ListAccountConnectorsResponse::next_page_token].
2345    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2346        self.next_page_token = v.into();
2347        self
2348    }
2349
2350    /// Sets the value of [unreachable][crate::model::ListAccountConnectorsResponse::unreachable].
2351    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2352    where
2353        T: std::iter::IntoIterator<Item = V>,
2354        V: std::convert::Into<std::string::String>,
2355    {
2356        use std::iter::Iterator;
2357        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2358        self
2359    }
2360}
2361
2362impl wkt::message::Message for ListAccountConnectorsResponse {
2363    fn typename() -> &'static str {
2364        "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
2365    }
2366}
2367
2368#[doc(hidden)]
2369impl gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
2370    type PageItem = crate::model::AccountConnector;
2371
2372    fn items(self) -> std::vec::Vec<Self::PageItem> {
2373        self.account_connectors
2374    }
2375
2376    fn next_page_token(&self) -> std::string::String {
2377        use std::clone::Clone;
2378        self.next_page_token.clone()
2379    }
2380}
2381
2382/// Message for getting a AccountConnector
2383#[derive(Clone, Default, PartialEq)]
2384#[non_exhaustive]
2385pub struct GetAccountConnectorRequest {
2386    /// Required. Name of the resource
2387    pub name: std::string::String,
2388
2389    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2390}
2391
2392impl GetAccountConnectorRequest {
2393    pub fn new() -> Self {
2394        std::default::Default::default()
2395    }
2396
2397    /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
2398    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2399        self.name = v.into();
2400        self
2401    }
2402}
2403
2404impl wkt::message::Message for GetAccountConnectorRequest {
2405    fn typename() -> &'static str {
2406        "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
2407    }
2408}
2409
2410#[derive(Clone, Default, PartialEq)]
2411#[non_exhaustive]
2412pub struct CreateAccountConnectorRequest {
2413    /// Required. Location resource name as the account_connector’s parent.
2414    pub parent: std::string::String,
2415
2416    /// Required. The ID to use for the AccountConnector, which will become the
2417    /// final component of the AccountConnector's resource name. Its format should
2418    /// adhere to <https://google.aip.dev/122#resource-id-segments> Names must be
2419    /// unique per-project per-location.
2420    pub account_connector_id: std::string::String,
2421
2422    /// Required. The AccountConnector to create.
2423    pub account_connector: std::option::Option<crate::model::AccountConnector>,
2424
2425    /// Optional. An optional request ID to identify requests. Specify a unique
2426    /// request ID so that if you must retry your request, the server will know to
2427    /// ignore the request if it has already been completed. The server will
2428    /// guarantee that for at least 60 minutes since the first request.
2429    ///
2430    /// For example, consider a situation where you make an initial request and the
2431    /// request times out. If you make the request again with the same request
2432    /// ID, the server can check if original operation with the same request ID
2433    /// was received, and if so, will ignore the second request. This prevents
2434    /// clients from accidentally creating duplicate commitments.
2435    ///
2436    /// The request ID must be a valid UUID with the exception that zero UUID is
2437    /// not supported (00000000-0000-0000-0000-000000000000).
2438    pub request_id: std::string::String,
2439
2440    /// Optional. If set, validate the request, but do not actually post it.
2441    pub validate_only: bool,
2442
2443    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2444}
2445
2446impl CreateAccountConnectorRequest {
2447    pub fn new() -> Self {
2448        std::default::Default::default()
2449    }
2450
2451    /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
2452    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2453        self.parent = v.into();
2454        self
2455    }
2456
2457    /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
2458    pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
2459        mut self,
2460        v: T,
2461    ) -> Self {
2462        self.account_connector_id = v.into();
2463        self
2464    }
2465
2466    /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
2467    pub fn set_account_connector<T>(mut self, v: T) -> Self
2468    where
2469        T: std::convert::Into<crate::model::AccountConnector>,
2470    {
2471        self.account_connector = std::option::Option::Some(v.into());
2472        self
2473    }
2474
2475    /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
2476    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
2477    where
2478        T: std::convert::Into<crate::model::AccountConnector>,
2479    {
2480        self.account_connector = v.map(|x| x.into());
2481        self
2482    }
2483
2484    /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
2485    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2486        self.request_id = v.into();
2487        self
2488    }
2489
2490    /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
2491    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2492        self.validate_only = v.into();
2493        self
2494    }
2495}
2496
2497impl wkt::message::Message for CreateAccountConnectorRequest {
2498    fn typename() -> &'static str {
2499        "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
2500    }
2501}
2502
2503/// Message for updating a AccountConnector
2504#[derive(Clone, Default, PartialEq)]
2505#[non_exhaustive]
2506pub struct UpdateAccountConnectorRequest {
2507    /// Optional. The list of fields to be updated.
2508    pub update_mask: std::option::Option<wkt::FieldMask>,
2509
2510    /// Required. The AccountConnector to update.
2511    pub account_connector: std::option::Option<crate::model::AccountConnector>,
2512
2513    /// Optional. An optional request ID to identify requests. Specify a unique
2514    /// request ID so that if you must retry your request, the server will know to
2515    /// ignore the request if it has already been completed. The server will
2516    /// guarantee that for at least 60 minutes since the first request.
2517    ///
2518    /// For example, consider a situation where you make an initial request and the
2519    /// request times out. If you make the request again with the same request
2520    /// ID, the server can check if original operation with the same request ID
2521    /// was received, and if so, will ignore the second request. This prevents
2522    /// clients from accidentally creating duplicate commitments.
2523    ///
2524    /// The request ID must be a valid UUID with the exception that zero UUID is
2525    /// not supported (00000000-0000-0000-0000-000000000000).
2526    pub request_id: std::string::String,
2527
2528    /// Optional. If set to true, and the accountConnector is not found a new
2529    /// accountConnector will be created. In this situation `update_mask` is
2530    /// ignored. The creation will succeed only if the input accountConnector has
2531    /// all the necessary
2532    pub allow_missing: bool,
2533
2534    /// Optional. If set, validate the request, but do not actually post it.
2535    pub validate_only: bool,
2536
2537    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2538}
2539
2540impl UpdateAccountConnectorRequest {
2541    pub fn new() -> Self {
2542        std::default::Default::default()
2543    }
2544
2545    /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
2546    pub fn set_update_mask<T>(mut self, v: T) -> Self
2547    where
2548        T: std::convert::Into<wkt::FieldMask>,
2549    {
2550        self.update_mask = std::option::Option::Some(v.into());
2551        self
2552    }
2553
2554    /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
2555    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2556    where
2557        T: std::convert::Into<wkt::FieldMask>,
2558    {
2559        self.update_mask = v.map(|x| x.into());
2560        self
2561    }
2562
2563    /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
2564    pub fn set_account_connector<T>(mut self, v: T) -> Self
2565    where
2566        T: std::convert::Into<crate::model::AccountConnector>,
2567    {
2568        self.account_connector = std::option::Option::Some(v.into());
2569        self
2570    }
2571
2572    /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
2573    pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
2574    where
2575        T: std::convert::Into<crate::model::AccountConnector>,
2576    {
2577        self.account_connector = v.map(|x| x.into());
2578        self
2579    }
2580
2581    /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
2582    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2583        self.request_id = v.into();
2584        self
2585    }
2586
2587    /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
2588    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2589        self.allow_missing = v.into();
2590        self
2591    }
2592
2593    /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
2594    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2595        self.validate_only = v.into();
2596        self
2597    }
2598}
2599
2600impl wkt::message::Message for UpdateAccountConnectorRequest {
2601    fn typename() -> &'static str {
2602        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
2603    }
2604}
2605
2606/// Message for deleting a AccountConnector
2607#[derive(Clone, Default, PartialEq)]
2608#[non_exhaustive]
2609pub struct DeleteAccountConnectorRequest {
2610    /// Required. Name of the resource
2611    pub name: std::string::String,
2612
2613    /// Optional. An optional request ID to identify requests. Specify a unique
2614    /// request ID so that if you must retry your request, the server will know to
2615    /// ignore the request if it has already been completed. The server will
2616    /// guarantee that for at least 60 minutes after the first request.
2617    ///
2618    /// For example, consider a situation where you make an initial request and the
2619    /// request times out. If you make the request again with the same request
2620    /// ID, the server can check if original operation with the same request ID
2621    /// was received, and if so, will ignore the second request. This prevents
2622    /// clients from accidentally creating duplicate commitments.
2623    ///
2624    /// The request ID must be a valid UUID with the exception that zero UUID is
2625    /// not supported (00000000-0000-0000-0000-000000000000).
2626    pub request_id: std::string::String,
2627
2628    /// Optional. If set, validate the request, but do not actually post it.
2629    pub validate_only: bool,
2630
2631    /// Optional. The current etag of the AccountConnectorn.
2632    /// If an etag is provided and does not match the current etag of the
2633    /// AccountConnector, deletion will be blocked and an ABORTED error will be
2634    /// returned.
2635    pub etag: std::string::String,
2636
2637    /// Optional. If set to true, any Users from this AccountConnector will also
2638    /// be deleted. (Otherwise, the request will only work if the AccountConnector
2639    /// has no Users.)
2640    pub force: bool,
2641
2642    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2643}
2644
2645impl DeleteAccountConnectorRequest {
2646    pub fn new() -> Self {
2647        std::default::Default::default()
2648    }
2649
2650    /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
2651    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2652        self.name = v.into();
2653        self
2654    }
2655
2656    /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
2657    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2658        self.request_id = v.into();
2659        self
2660    }
2661
2662    /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
2663    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2664        self.validate_only = v.into();
2665        self
2666    }
2667
2668    /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
2669    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2670        self.etag = v.into();
2671        self
2672    }
2673
2674    /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
2675    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2676        self.force = v.into();
2677        self
2678    }
2679}
2680
2681impl wkt::message::Message for DeleteAccountConnectorRequest {
2682    fn typename() -> &'static str {
2683        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
2684    }
2685}
2686
2687/// Message for deleting a User
2688#[derive(Clone, Default, PartialEq)]
2689#[non_exhaustive]
2690pub struct DeleteUserRequest {
2691    /// Required. Name of the resource
2692    pub name: std::string::String,
2693
2694    /// Optional. An optional request ID to identify requests. Specify a unique
2695    /// request ID so that if you must retry your request, the server will know to
2696    /// ignore the request if it has already been completed. The server will
2697    /// guarantee that for at least 60 minutes after the first request.
2698    ///
2699    /// For example, consider a situation where you make an initial request and the
2700    /// request times out. If you make the request again with the same request
2701    /// ID, the server can check if original operation with the same request ID
2702    /// was received, and if so, will ignore the second request. This prevents
2703    /// clients from accidentally creating duplicate commitments.
2704    ///
2705    /// The request ID must be a valid UUID with the exception that zero UUID is
2706    /// not supported (00000000-0000-0000-0000-000000000000).
2707    pub request_id: std::string::String,
2708
2709    /// Optional. If set, validate the request, but do not actually post it.
2710    pub validate_only: bool,
2711
2712    /// Optional. This checksum is computed by the server based on the value of
2713    /// other fields, and may be sent on update and delete requests to ensure the
2714    /// client has an up-to-date value before proceeding.
2715    pub etag: std::string::String,
2716
2717    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2718}
2719
2720impl DeleteUserRequest {
2721    pub fn new() -> Self {
2722        std::default::Default::default()
2723    }
2724
2725    /// Sets the value of [name][crate::model::DeleteUserRequest::name].
2726    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2727        self.name = v.into();
2728        self
2729    }
2730
2731    /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
2732    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2733        self.request_id = v.into();
2734        self
2735    }
2736
2737    /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
2738    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2739        self.validate_only = v.into();
2740        self
2741    }
2742
2743    /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
2744    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2745        self.etag = v.into();
2746        self
2747    }
2748}
2749
2750impl wkt::message::Message for DeleteUserRequest {
2751    fn typename() -> &'static str {
2752        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
2753    }
2754}
2755
2756/// Represents the metadata of the long-running operation.
2757#[derive(Clone, Default, PartialEq)]
2758#[non_exhaustive]
2759pub struct OperationMetadata {
2760    /// Output only. The time the operation was created.
2761    pub create_time: std::option::Option<wkt::Timestamp>,
2762
2763    /// Output only. The time the operation finished running.
2764    pub end_time: std::option::Option<wkt::Timestamp>,
2765
2766    /// Output only. Server-defined resource path for the target of the operation.
2767    pub target: std::string::String,
2768
2769    /// Output only. Name of the verb executed by the operation.
2770    pub verb: std::string::String,
2771
2772    /// Output only. Human-readable status of the operation, if any.
2773    pub status_message: std::string::String,
2774
2775    /// Output only. Identifies whether the user has requested cancellation
2776    /// of the operation. Operations that have been cancelled successfully
2777    /// have
2778    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2779    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2780    /// corresponding to `Code.CANCELLED`.
2781    ///
2782    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
2783    /// [google.rpc.Status.code]: rpc::model::Status::code
2784    pub requested_cancellation: bool,
2785
2786    /// Output only. API version used to start the operation.
2787    pub api_version: std::string::String,
2788
2789    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2790}
2791
2792impl OperationMetadata {
2793    pub fn new() -> Self {
2794        std::default::Default::default()
2795    }
2796
2797    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2798    pub fn set_create_time<T>(mut self, v: T) -> Self
2799    where
2800        T: std::convert::Into<wkt::Timestamp>,
2801    {
2802        self.create_time = std::option::Option::Some(v.into());
2803        self
2804    }
2805
2806    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2807    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2808    where
2809        T: std::convert::Into<wkt::Timestamp>,
2810    {
2811        self.create_time = v.map(|x| x.into());
2812        self
2813    }
2814
2815    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2816    pub fn set_end_time<T>(mut self, v: T) -> Self
2817    where
2818        T: std::convert::Into<wkt::Timestamp>,
2819    {
2820        self.end_time = std::option::Option::Some(v.into());
2821        self
2822    }
2823
2824    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2825    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2826    where
2827        T: std::convert::Into<wkt::Timestamp>,
2828    {
2829        self.end_time = v.map(|x| x.into());
2830        self
2831    }
2832
2833    /// Sets the value of [target][crate::model::OperationMetadata::target].
2834    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2835        self.target = v.into();
2836        self
2837    }
2838
2839    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2840    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2841        self.verb = v.into();
2842        self
2843    }
2844
2845    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2846    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2847        self.status_message = v.into();
2848        self
2849    }
2850
2851    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2852    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2853        self.requested_cancellation = v.into();
2854        self
2855    }
2856
2857    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2858    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2859        self.api_version = v.into();
2860        self
2861    }
2862}
2863
2864impl wkt::message::Message for OperationMetadata {
2865    fn typename() -> &'static str {
2866        "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
2867    }
2868}
2869
2870/// Message for fetching a User of the user themselves.
2871#[derive(Clone, Default, PartialEq)]
2872#[non_exhaustive]
2873pub struct FetchSelfRequest {
2874    /// Required. Name of the AccountConnector resource
2875    pub name: std::string::String,
2876
2877    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2878}
2879
2880impl FetchSelfRequest {
2881    pub fn new() -> Self {
2882        std::default::Default::default()
2883    }
2884
2885    /// Sets the value of [name][crate::model::FetchSelfRequest::name].
2886    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2887        self.name = v.into();
2888        self
2889    }
2890}
2891
2892impl wkt::message::Message for FetchSelfRequest {
2893    fn typename() -> &'static str {
2894        "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
2895    }
2896}
2897
2898/// Message for deleting a User of the user themselves.
2899#[derive(Clone, Default, PartialEq)]
2900#[non_exhaustive]
2901pub struct DeleteSelfRequest {
2902    /// Required. Name of the AccountConnector resource
2903    pub name: std::string::String,
2904
2905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2906}
2907
2908impl DeleteSelfRequest {
2909    pub fn new() -> Self {
2910        std::default::Default::default()
2911    }
2912
2913    /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
2914    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2915        self.name = v.into();
2916        self
2917    }
2918}
2919
2920impl wkt::message::Message for DeleteSelfRequest {
2921    fn typename() -> &'static str {
2922        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
2923    }
2924}
2925
2926/// Message for fetching an OAuth access token.
2927#[derive(Clone, Default, PartialEq)]
2928#[non_exhaustive]
2929pub struct FetchAccessTokenRequest {
2930    /// Required. The resource name of the AccountConnector in the format
2931    /// `projects/*/locations/*/accountConnectors/*`.
2932    pub account_connector: std::string::String,
2933
2934    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2935}
2936
2937impl FetchAccessTokenRequest {
2938    pub fn new() -> Self {
2939        std::default::Default::default()
2940    }
2941
2942    /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
2943    pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
2944        mut self,
2945        v: T,
2946    ) -> Self {
2947        self.account_connector = v.into();
2948        self
2949    }
2950}
2951
2952impl wkt::message::Message for FetchAccessTokenRequest {
2953    fn typename() -> &'static str {
2954        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
2955    }
2956}
2957
2958/// Message for responding to getting an OAuth access token.
2959#[derive(Clone, Default, PartialEq)]
2960#[non_exhaustive]
2961pub struct FetchAccessTokenResponse {
2962    /// The token content.
2963    pub token: std::string::String,
2964
2965    /// Expiration timestamp. Can be empty if unknown or non-expiring.
2966    pub expiration_time: std::option::Option<wkt::Timestamp>,
2967
2968    /// The scopes of the access token.
2969    pub scopes: std::vec::Vec<std::string::String>,
2970
2971    /// The error resulted from exchanging OAuth tokens from the service provider.
2972    pub exchange_error: std::option::Option<crate::model::ExchangeError>,
2973
2974    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2975}
2976
2977impl FetchAccessTokenResponse {
2978    pub fn new() -> Self {
2979        std::default::Default::default()
2980    }
2981
2982    /// Sets the value of [token][crate::model::FetchAccessTokenResponse::token].
2983    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2984        self.token = v.into();
2985        self
2986    }
2987
2988    /// Sets the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
2989    pub fn set_expiration_time<T>(mut self, v: T) -> Self
2990    where
2991        T: std::convert::Into<wkt::Timestamp>,
2992    {
2993        self.expiration_time = std::option::Option::Some(v.into());
2994        self
2995    }
2996
2997    /// Sets or clears the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
2998    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
2999    where
3000        T: std::convert::Into<wkt::Timestamp>,
3001    {
3002        self.expiration_time = v.map(|x| x.into());
3003        self
3004    }
3005
3006    /// Sets the value of [scopes][crate::model::FetchAccessTokenResponse::scopes].
3007    pub fn set_scopes<T, V>(mut self, v: T) -> Self
3008    where
3009        T: std::iter::IntoIterator<Item = V>,
3010        V: std::convert::Into<std::string::String>,
3011    {
3012        use std::iter::Iterator;
3013        self.scopes = v.into_iter().map(|i| i.into()).collect();
3014        self
3015    }
3016
3017    /// Sets the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
3018    pub fn set_exchange_error<T>(mut self, v: T) -> Self
3019    where
3020        T: std::convert::Into<crate::model::ExchangeError>,
3021    {
3022        self.exchange_error = std::option::Option::Some(v.into());
3023        self
3024    }
3025
3026    /// Sets or clears the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
3027    pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
3028    where
3029        T: std::convert::Into<crate::model::ExchangeError>,
3030    {
3031        self.exchange_error = v.map(|x| x.into());
3032        self
3033    }
3034}
3035
3036impl wkt::message::Message for FetchAccessTokenResponse {
3037    fn typename() -> &'static str {
3038        "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
3039    }
3040}
3041
3042/// Message for representing an error from exchanging OAuth tokens.
3043#[derive(Clone, Default, PartialEq)]
3044#[non_exhaustive]
3045pub struct ExchangeError {
3046    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> - error
3047    pub code: std::string::String,
3048
3049    /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> -
3050    /// error_description
3051    pub description: std::string::String,
3052
3053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3054}
3055
3056impl ExchangeError {
3057    pub fn new() -> Self {
3058        std::default::Default::default()
3059    }
3060
3061    /// Sets the value of [code][crate::model::ExchangeError::code].
3062    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3063        self.code = v.into();
3064        self
3065    }
3066
3067    /// Sets the value of [description][crate::model::ExchangeError::description].
3068    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3069        self.description = v.into();
3070        self
3071    }
3072}
3073
3074impl wkt::message::Message for ExchangeError {
3075    fn typename() -> &'static str {
3076        "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
3077    }
3078}
3079
3080/// Message describing the GitRepositoryLink object
3081#[derive(Clone, Default, PartialEq)]
3082#[non_exhaustive]
3083pub struct GitRepositoryLink {
3084    /// Identifier. Resource name of the repository, in the format
3085    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
3086    pub name: std::string::String,
3087
3088    /// Required. Git Clone URI.
3089    pub clone_uri: std::string::String,
3090
3091    /// Output only. [Output only] Create timestamp
3092    pub create_time: std::option::Option<wkt::Timestamp>,
3093
3094    /// Output only. [Output only] Update timestamp
3095    pub update_time: std::option::Option<wkt::Timestamp>,
3096
3097    /// Output only. [Output only] Delete timestamp
3098    pub delete_time: std::option::Option<wkt::Timestamp>,
3099
3100    /// Optional. Labels as key value pairs
3101    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3102
3103    /// Optional. This checksum is computed by the server based on the value of
3104    /// other fields, and may be sent on update and delete requests to ensure the
3105    /// client has an up-to-date value before proceeding.
3106    pub etag: std::string::String,
3107
3108    /// Output only. Set to true when the connection is being set up or updated in
3109    /// the background.
3110    pub reconciling: bool,
3111
3112    /// Optional. Allows clients to store small amounts of arbitrary data.
3113    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3114
3115    /// Output only. A system-assigned unique identifier for the GitRepositoryLink.
3116    pub uid: std::string::String,
3117
3118    /// Output only. External ID of the webhook created for the repository.
3119    pub webhook_id: std::string::String,
3120
3121    /// Output only. URI to access the linked repository through the Git Proxy.
3122    /// This field is only populated if the git proxy is enabled for the
3123    /// connection.
3124    pub git_proxy_uri: std::string::String,
3125
3126    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3127}
3128
3129impl GitRepositoryLink {
3130    pub fn new() -> Self {
3131        std::default::Default::default()
3132    }
3133
3134    /// Sets the value of [name][crate::model::GitRepositoryLink::name].
3135    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3136        self.name = v.into();
3137        self
3138    }
3139
3140    /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
3141    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3142        self.clone_uri = v.into();
3143        self
3144    }
3145
3146    /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
3147    pub fn set_create_time<T>(mut self, v: T) -> Self
3148    where
3149        T: std::convert::Into<wkt::Timestamp>,
3150    {
3151        self.create_time = std::option::Option::Some(v.into());
3152        self
3153    }
3154
3155    /// Sets or clears the value of [create_time][crate::model::GitRepositoryLink::create_time].
3156    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3157    where
3158        T: std::convert::Into<wkt::Timestamp>,
3159    {
3160        self.create_time = v.map(|x| x.into());
3161        self
3162    }
3163
3164    /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
3165    pub fn set_update_time<T>(mut self, v: T) -> Self
3166    where
3167        T: std::convert::Into<wkt::Timestamp>,
3168    {
3169        self.update_time = std::option::Option::Some(v.into());
3170        self
3171    }
3172
3173    /// Sets or clears the value of [update_time][crate::model::GitRepositoryLink::update_time].
3174    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3175    where
3176        T: std::convert::Into<wkt::Timestamp>,
3177    {
3178        self.update_time = v.map(|x| x.into());
3179        self
3180    }
3181
3182    /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
3183    pub fn set_delete_time<T>(mut self, v: T) -> Self
3184    where
3185        T: std::convert::Into<wkt::Timestamp>,
3186    {
3187        self.delete_time = std::option::Option::Some(v.into());
3188        self
3189    }
3190
3191    /// Sets or clears the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
3192    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
3193    where
3194        T: std::convert::Into<wkt::Timestamp>,
3195    {
3196        self.delete_time = v.map(|x| x.into());
3197        self
3198    }
3199
3200    /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
3201    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3202    where
3203        T: std::iter::IntoIterator<Item = (K, V)>,
3204        K: std::convert::Into<std::string::String>,
3205        V: std::convert::Into<std::string::String>,
3206    {
3207        use std::iter::Iterator;
3208        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3209        self
3210    }
3211
3212    /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
3213    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3214        self.etag = v.into();
3215        self
3216    }
3217
3218    /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
3219    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3220        self.reconciling = v.into();
3221        self
3222    }
3223
3224    /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
3225    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3226    where
3227        T: std::iter::IntoIterator<Item = (K, V)>,
3228        K: std::convert::Into<std::string::String>,
3229        V: std::convert::Into<std::string::String>,
3230    {
3231        use std::iter::Iterator;
3232        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3233        self
3234    }
3235
3236    /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
3237    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3238        self.uid = v.into();
3239        self
3240    }
3241
3242    /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
3243    pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3244        self.webhook_id = v.into();
3245        self
3246    }
3247
3248    /// Sets the value of [git_proxy_uri][crate::model::GitRepositoryLink::git_proxy_uri].
3249    pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3250        self.git_proxy_uri = v.into();
3251        self
3252    }
3253}
3254
3255impl wkt::message::Message for GitRepositoryLink {
3256    fn typename() -> &'static str {
3257        "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
3258    }
3259}
3260
3261/// Message for creating a GitRepositoryLink
3262#[derive(Clone, Default, PartialEq)]
3263#[non_exhaustive]
3264pub struct CreateGitRepositoryLinkRequest {
3265    /// Required. Value for parent.
3266    pub parent: std::string::String,
3267
3268    /// Required. The resource being created
3269    pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
3270
3271    /// Required. The ID to use for the repository, which will become the final
3272    /// component of the repository's resource name. This ID should be unique in
3273    /// the connection. Allows alphanumeric characters and any of
3274    /// -._~%!$&'()*+,;=@.
3275    pub git_repository_link_id: std::string::String,
3276
3277    /// Optional. An optional request ID to identify requests. Specify a unique
3278    /// request ID so that if you must retry your request, the server will know to
3279    /// ignore the request if it has already been completed. The server will
3280    /// guarantee that for at least 60 minutes since the first request.
3281    ///
3282    /// For example, consider a situation where you make an initial request and the
3283    /// request times out. If you make the request again with the same request
3284    /// ID, the server can check if original operation with the same request ID
3285    /// was received, and if so, will ignore the second request. This prevents
3286    /// clients from accidentally creating duplicate commitments.
3287    ///
3288    /// The request ID must be a valid UUID with the exception that zero UUID is
3289    /// not supported (00000000-0000-0000-0000-000000000000).
3290    pub request_id: std::string::String,
3291
3292    /// Optional. If set, validate the request, but do not actually post it.
3293    pub validate_only: bool,
3294
3295    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3296}
3297
3298impl CreateGitRepositoryLinkRequest {
3299    pub fn new() -> Self {
3300        std::default::Default::default()
3301    }
3302
3303    /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
3304    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3305        self.parent = v.into();
3306        self
3307    }
3308
3309    /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
3310    pub fn set_git_repository_link<T>(mut self, v: T) -> Self
3311    where
3312        T: std::convert::Into<crate::model::GitRepositoryLink>,
3313    {
3314        self.git_repository_link = std::option::Option::Some(v.into());
3315        self
3316    }
3317
3318    /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
3319    pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
3320    where
3321        T: std::convert::Into<crate::model::GitRepositoryLink>,
3322    {
3323        self.git_repository_link = v.map(|x| x.into());
3324        self
3325    }
3326
3327    /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
3328    pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
3329        mut self,
3330        v: T,
3331    ) -> Self {
3332        self.git_repository_link_id = v.into();
3333        self
3334    }
3335
3336    /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
3337    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3338        self.request_id = v.into();
3339        self
3340    }
3341
3342    /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
3343    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3344        self.validate_only = v.into();
3345        self
3346    }
3347}
3348
3349impl wkt::message::Message for CreateGitRepositoryLinkRequest {
3350    fn typename() -> &'static str {
3351        "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
3352    }
3353}
3354
3355/// Message for deleting a GitRepositoryLink
3356#[derive(Clone, Default, PartialEq)]
3357#[non_exhaustive]
3358pub struct DeleteGitRepositoryLinkRequest {
3359    /// Required. Name of the resource
3360    pub name: std::string::String,
3361
3362    /// Optional. An optional request ID to identify requests. Specify a unique
3363    /// request ID so that if you must retry your request, the server will know to
3364    /// ignore the request if it has already been completed. The server will
3365    /// guarantee that for at least 60 minutes after the first request.
3366    ///
3367    /// For example, consider a situation where you make an initial request and the
3368    /// request times out. If you make the request again with the same request
3369    /// ID, the server can check if original operation with the same request ID
3370    /// was received, and if so, will ignore the second request. This prevents
3371    /// clients from accidentally creating duplicate commitments.
3372    ///
3373    /// The request ID must be a valid UUID with the exception that zero UUID is
3374    /// not supported (00000000-0000-0000-0000-000000000000).
3375    pub request_id: std::string::String,
3376
3377    /// Optional. If set, validate the request, but do not actually post it.
3378    pub validate_only: bool,
3379
3380    /// Optional. This checksum is computed by the server based on the value of
3381    /// other fields, and may be sent on update and delete requests to ensure the
3382    /// client has an up-to-date value before proceeding.
3383    pub etag: std::string::String,
3384
3385    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3386}
3387
3388impl DeleteGitRepositoryLinkRequest {
3389    pub fn new() -> Self {
3390        std::default::Default::default()
3391    }
3392
3393    /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
3394    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3395        self.name = v.into();
3396        self
3397    }
3398
3399    /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
3400    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3401        self.request_id = v.into();
3402        self
3403    }
3404
3405    /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
3406    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3407        self.validate_only = v.into();
3408        self
3409    }
3410
3411    /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
3412    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3413        self.etag = v.into();
3414        self
3415    }
3416}
3417
3418impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
3419    fn typename() -> &'static str {
3420        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
3421    }
3422}
3423
3424/// Message for requesting a list of GitRepositoryLinks
3425#[derive(Clone, Default, PartialEq)]
3426#[non_exhaustive]
3427pub struct ListGitRepositoryLinksRequest {
3428    /// Required. Parent value for ListGitRepositoryLinksRequest
3429    pub parent: std::string::String,
3430
3431    /// Optional. Requested page size. Server may return fewer items than
3432    /// requested. If unspecified, server will pick an appropriate default.
3433    pub page_size: i32,
3434
3435    /// Optional. A token identifying a page of results the server should return.
3436    pub page_token: std::string::String,
3437
3438    /// Optional. Filtering results
3439    pub filter: std::string::String,
3440
3441    /// Optional. Hint for how to order the results
3442    pub order_by: std::string::String,
3443
3444    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3445}
3446
3447impl ListGitRepositoryLinksRequest {
3448    pub fn new() -> Self {
3449        std::default::Default::default()
3450    }
3451
3452    /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
3453    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3454        self.parent = v.into();
3455        self
3456    }
3457
3458    /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
3459    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3460        self.page_size = v.into();
3461        self
3462    }
3463
3464    /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
3465    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3466        self.page_token = v.into();
3467        self
3468    }
3469
3470    /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
3471    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3472        self.filter = v.into();
3473        self
3474    }
3475
3476    /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
3477    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3478        self.order_by = v.into();
3479        self
3480    }
3481}
3482
3483impl wkt::message::Message for ListGitRepositoryLinksRequest {
3484    fn typename() -> &'static str {
3485        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
3486    }
3487}
3488
3489/// Message for response to listing GitRepositoryLinks
3490#[derive(Clone, Default, PartialEq)]
3491#[non_exhaustive]
3492pub struct ListGitRepositoryLinksResponse {
3493    /// The list of GitRepositoryLinks
3494    pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
3495
3496    /// A token identifying a page of results the server should return.
3497    pub next_page_token: std::string::String,
3498
3499    /// Locations that could not be reached.
3500    pub unreachable: std::vec::Vec<std::string::String>,
3501
3502    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3503}
3504
3505impl ListGitRepositoryLinksResponse {
3506    pub fn new() -> Self {
3507        std::default::Default::default()
3508    }
3509
3510    /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
3511    pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
3512    where
3513        T: std::iter::IntoIterator<Item = V>,
3514        V: std::convert::Into<crate::model::GitRepositoryLink>,
3515    {
3516        use std::iter::Iterator;
3517        self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
3518        self
3519    }
3520
3521    /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
3522    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3523        self.next_page_token = v.into();
3524        self
3525    }
3526
3527    /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
3528    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3529    where
3530        T: std::iter::IntoIterator<Item = V>,
3531        V: std::convert::Into<std::string::String>,
3532    {
3533        use std::iter::Iterator;
3534        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3535        self
3536    }
3537}
3538
3539impl wkt::message::Message for ListGitRepositoryLinksResponse {
3540    fn typename() -> &'static str {
3541        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
3542    }
3543}
3544
3545#[doc(hidden)]
3546impl gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
3547    type PageItem = crate::model::GitRepositoryLink;
3548
3549    fn items(self) -> std::vec::Vec<Self::PageItem> {
3550        self.git_repository_links
3551    }
3552
3553    fn next_page_token(&self) -> std::string::String {
3554        use std::clone::Clone;
3555        self.next_page_token.clone()
3556    }
3557}
3558
3559/// Message for getting a GitRepositoryLink
3560#[derive(Clone, Default, PartialEq)]
3561#[non_exhaustive]
3562pub struct GetGitRepositoryLinkRequest {
3563    /// Required. Name of the resource
3564    pub name: std::string::String,
3565
3566    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3567}
3568
3569impl GetGitRepositoryLinkRequest {
3570    pub fn new() -> Self {
3571        std::default::Default::default()
3572    }
3573
3574    /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
3575    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3576        self.name = v.into();
3577        self
3578    }
3579}
3580
3581impl wkt::message::Message for GetGitRepositoryLinkRequest {
3582    fn typename() -> &'static str {
3583        "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
3584    }
3585}
3586
3587/// Message for fetching SCM read/write token.
3588#[derive(Clone, Default, PartialEq)]
3589#[non_exhaustive]
3590pub struct FetchReadWriteTokenRequest {
3591    /// Required. The resource name of the gitRepositoryLink in the format
3592    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
3593    pub git_repository_link: std::string::String,
3594
3595    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3596}
3597
3598impl FetchReadWriteTokenRequest {
3599    pub fn new() -> Self {
3600        std::default::Default::default()
3601    }
3602
3603    /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
3604    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
3605        mut self,
3606        v: T,
3607    ) -> Self {
3608        self.git_repository_link = v.into();
3609        self
3610    }
3611}
3612
3613impl wkt::message::Message for FetchReadWriteTokenRequest {
3614    fn typename() -> &'static str {
3615        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
3616    }
3617}
3618
3619/// Message for fetching SCM read token.
3620#[derive(Clone, Default, PartialEq)]
3621#[non_exhaustive]
3622pub struct FetchReadTokenRequest {
3623    /// Required. The resource name of the gitRepositoryLink in the format
3624    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
3625    pub git_repository_link: std::string::String,
3626
3627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3628}
3629
3630impl FetchReadTokenRequest {
3631    pub fn new() -> Self {
3632        std::default::Default::default()
3633    }
3634
3635    /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
3636    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
3637        mut self,
3638        v: T,
3639    ) -> Self {
3640        self.git_repository_link = v.into();
3641        self
3642    }
3643}
3644
3645impl wkt::message::Message for FetchReadTokenRequest {
3646    fn typename() -> &'static str {
3647        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
3648    }
3649}
3650
3651/// Message for responding to get read token.
3652#[derive(Clone, Default, PartialEq)]
3653#[non_exhaustive]
3654pub struct FetchReadTokenResponse {
3655    /// The token content.
3656    pub token: std::string::String,
3657
3658    /// Expiration timestamp. Can be empty if unknown or non-expiring.
3659    pub expiration_time: std::option::Option<wkt::Timestamp>,
3660
3661    /// The git_username to specify when making a git clone with the
3662    /// token. For example, for GitHub GitRepositoryLinks, this would be
3663    /// "x-access-token"
3664    pub git_username: std::string::String,
3665
3666    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3667}
3668
3669impl FetchReadTokenResponse {
3670    pub fn new() -> Self {
3671        std::default::Default::default()
3672    }
3673
3674    /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
3675    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3676        self.token = v.into();
3677        self
3678    }
3679
3680    /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
3681    pub fn set_expiration_time<T>(mut self, v: T) -> Self
3682    where
3683        T: std::convert::Into<wkt::Timestamp>,
3684    {
3685        self.expiration_time = std::option::Option::Some(v.into());
3686        self
3687    }
3688
3689    /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
3690    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
3691    where
3692        T: std::convert::Into<wkt::Timestamp>,
3693    {
3694        self.expiration_time = v.map(|x| x.into());
3695        self
3696    }
3697
3698    /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
3699    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3700        self.git_username = v.into();
3701        self
3702    }
3703}
3704
3705impl wkt::message::Message for FetchReadTokenResponse {
3706    fn typename() -> &'static str {
3707        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
3708    }
3709}
3710
3711/// Message for responding to get read/write token.
3712#[derive(Clone, Default, PartialEq)]
3713#[non_exhaustive]
3714pub struct FetchReadWriteTokenResponse {
3715    /// The token content.
3716    pub token: std::string::String,
3717
3718    /// Expiration timestamp. Can be empty if unknown or non-expiring.
3719    pub expiration_time: std::option::Option<wkt::Timestamp>,
3720
3721    /// The git_username to specify when making a git clone with the
3722    /// token. For example, for GitHub GitRepositoryLinks, this would be
3723    /// "x-access-token"
3724    pub git_username: std::string::String,
3725
3726    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3727}
3728
3729impl FetchReadWriteTokenResponse {
3730    pub fn new() -> Self {
3731        std::default::Default::default()
3732    }
3733
3734    /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
3735    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3736        self.token = v.into();
3737        self
3738    }
3739
3740    /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
3741    pub fn set_expiration_time<T>(mut self, v: T) -> Self
3742    where
3743        T: std::convert::Into<wkt::Timestamp>,
3744    {
3745        self.expiration_time = std::option::Option::Some(v.into());
3746        self
3747    }
3748
3749    /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
3750    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
3751    where
3752        T: std::convert::Into<wkt::Timestamp>,
3753    {
3754        self.expiration_time = v.map(|x| x.into());
3755        self
3756    }
3757
3758    /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
3759    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3760        self.git_username = v.into();
3761        self
3762    }
3763}
3764
3765impl wkt::message::Message for FetchReadWriteTokenResponse {
3766    fn typename() -> &'static str {
3767        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
3768    }
3769}
3770
3771/// Request message for FetchLinkableGitRepositoriesRequest.
3772#[derive(Clone, Default, PartialEq)]
3773#[non_exhaustive]
3774pub struct FetchLinkableGitRepositoriesRequest {
3775    /// Required. The name of the Connection.
3776    /// Format: `projects/*/locations/*/connections/*`.
3777    pub connection: std::string::String,
3778
3779    /// Optional. Number of results to return in the list. Defaults to 20.
3780    pub page_size: i32,
3781
3782    /// Optional. Page start.
3783    pub page_token: std::string::String,
3784
3785    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3786}
3787
3788impl FetchLinkableGitRepositoriesRequest {
3789    pub fn new() -> Self {
3790        std::default::Default::default()
3791    }
3792
3793    /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
3794    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3795        self.connection = v.into();
3796        self
3797    }
3798
3799    /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
3800    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3801        self.page_size = v.into();
3802        self
3803    }
3804
3805    /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
3806    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3807        self.page_token = v.into();
3808        self
3809    }
3810}
3811
3812impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
3813    fn typename() -> &'static str {
3814        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
3815    }
3816}
3817
3818/// Response message for FetchLinkableGitRepositories.
3819#[derive(Clone, Default, PartialEq)]
3820#[non_exhaustive]
3821pub struct FetchLinkableGitRepositoriesResponse {
3822    /// The git repositories that can be linked to the connection.
3823    pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
3824
3825    /// A token identifying a page of results the server should return.
3826    pub next_page_token: std::string::String,
3827
3828    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3829}
3830
3831impl FetchLinkableGitRepositoriesResponse {
3832    pub fn new() -> Self {
3833        std::default::Default::default()
3834    }
3835
3836    /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
3837    pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
3838    where
3839        T: std::iter::IntoIterator<Item = V>,
3840        V: std::convert::Into<crate::model::LinkableGitRepository>,
3841    {
3842        use std::iter::Iterator;
3843        self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
3844        self
3845    }
3846
3847    /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
3848    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3849        self.next_page_token = v.into();
3850        self
3851    }
3852}
3853
3854impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
3855    fn typename() -> &'static str {
3856        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
3857    }
3858}
3859
3860#[doc(hidden)]
3861impl gax::paginator::internal::PageableResponse for FetchLinkableGitRepositoriesResponse {
3862    type PageItem = crate::model::LinkableGitRepository;
3863
3864    fn items(self) -> std::vec::Vec<Self::PageItem> {
3865        self.linkable_git_repositories
3866    }
3867
3868    fn next_page_token(&self) -> std::string::String {
3869        use std::clone::Clone;
3870        self.next_page_token.clone()
3871    }
3872}
3873
3874/// LinkableGitRepository represents a git repository that can be linked to a
3875/// connection.
3876#[derive(Clone, Default, PartialEq)]
3877#[non_exhaustive]
3878pub struct LinkableGitRepository {
3879    /// The clone uri of the repository.
3880    pub clone_uri: std::string::String,
3881
3882    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3883}
3884
3885impl LinkableGitRepository {
3886    pub fn new() -> Self {
3887        std::default::Default::default()
3888    }
3889
3890    /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
3891    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3892        self.clone_uri = v.into();
3893        self
3894    }
3895}
3896
3897impl wkt::message::Message for LinkableGitRepository {
3898    fn typename() -> &'static str {
3899        "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
3900    }
3901}
3902
3903/// Request for fetching github installations.
3904#[derive(Clone, Default, PartialEq)]
3905#[non_exhaustive]
3906pub struct FetchGitHubInstallationsRequest {
3907    /// Required. The resource name of the connection in the format
3908    /// `projects/*/locations/*/connections/*`.
3909    pub connection: std::string::String,
3910
3911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3912}
3913
3914impl FetchGitHubInstallationsRequest {
3915    pub fn new() -> Self {
3916        std::default::Default::default()
3917    }
3918
3919    /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
3920    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3921        self.connection = v.into();
3922        self
3923    }
3924}
3925
3926impl wkt::message::Message for FetchGitHubInstallationsRequest {
3927    fn typename() -> &'static str {
3928        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
3929    }
3930}
3931
3932/// Response of fetching github installations.
3933#[derive(Clone, Default, PartialEq)]
3934#[non_exhaustive]
3935pub struct FetchGitHubInstallationsResponse {
3936    /// List of installations available to the OAuth user (for github.com)
3937    /// or all the installations (for GitHub enterprise).
3938    pub installations:
3939        std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
3940
3941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3942}
3943
3944impl FetchGitHubInstallationsResponse {
3945    pub fn new() -> Self {
3946        std::default::Default::default()
3947    }
3948
3949    /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
3950    pub fn set_installations<T, V>(mut self, v: T) -> Self
3951    where
3952        T: std::iter::IntoIterator<Item = V>,
3953        V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
3954    {
3955        use std::iter::Iterator;
3956        self.installations = v.into_iter().map(|i| i.into()).collect();
3957        self
3958    }
3959}
3960
3961impl wkt::message::Message for FetchGitHubInstallationsResponse {
3962    fn typename() -> &'static str {
3963        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
3964    }
3965}
3966
3967/// Defines additional types related to [FetchGitHubInstallationsResponse].
3968pub mod fetch_git_hub_installations_response {
3969    #[allow(unused_imports)]
3970    use super::*;
3971
3972    /// Represents an installation of the GitHub App.
3973    #[derive(Clone, Default, PartialEq)]
3974    #[non_exhaustive]
3975    pub struct Installation {
3976        /// ID of the installation in GitHub.
3977        pub id: i64,
3978
3979        /// Name of the GitHub user or organization that owns this installation.
3980        pub name: std::string::String,
3981
3982        /// Either "user" or "organization".
3983        pub r#type: std::string::String,
3984
3985        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3986    }
3987
3988    impl Installation {
3989        pub fn new() -> Self {
3990            std::default::Default::default()
3991        }
3992
3993        /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
3994        pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3995            self.id = v.into();
3996            self
3997        }
3998
3999        /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
4000        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4001            self.name = v.into();
4002            self
4003        }
4004
4005        /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
4006        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4007            self.r#type = v.into();
4008            self
4009        }
4010    }
4011
4012    impl wkt::message::Message for Installation {
4013        fn typename() -> &'static str {
4014            "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
4015        }
4016    }
4017}
4018
4019/// Request for fetching git refs.
4020#[derive(Clone, Default, PartialEq)]
4021#[non_exhaustive]
4022pub struct FetchGitRefsRequest {
4023    /// Required. The resource name of GitRepositoryLink in the format
4024    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
4025    pub git_repository_link: std::string::String,
4026
4027    /// Required. Type of refs to fetch.
4028    pub ref_type: crate::model::fetch_git_refs_request::RefType,
4029
4030    /// Optional. Number of results to return in the list. Default to 20.
4031    pub page_size: i32,
4032
4033    /// Optional. Page start.
4034    pub page_token: std::string::String,
4035
4036    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4037}
4038
4039impl FetchGitRefsRequest {
4040    pub fn new() -> Self {
4041        std::default::Default::default()
4042    }
4043
4044    /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
4045    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
4046        mut self,
4047        v: T,
4048    ) -> Self {
4049        self.git_repository_link = v.into();
4050        self
4051    }
4052
4053    /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
4054    pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
4055        mut self,
4056        v: T,
4057    ) -> Self {
4058        self.ref_type = v.into();
4059        self
4060    }
4061
4062    /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
4063    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4064        self.page_size = v.into();
4065        self
4066    }
4067
4068    /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
4069    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4070        self.page_token = v.into();
4071        self
4072    }
4073}
4074
4075impl wkt::message::Message for FetchGitRefsRequest {
4076    fn typename() -> &'static str {
4077        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
4078    }
4079}
4080
4081/// Defines additional types related to [FetchGitRefsRequest].
4082pub mod fetch_git_refs_request {
4083    #[allow(unused_imports)]
4084    use super::*;
4085
4086    /// Type of refs.
4087    ///
4088    /// # Working with unknown values
4089    ///
4090    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4091    /// additional enum variants at any time. Adding new variants is not considered
4092    /// a breaking change. Applications should write their code in anticipation of:
4093    ///
4094    /// - New values appearing in future releases of the client library, **and**
4095    /// - New values received dynamically, without application changes.
4096    ///
4097    /// Please consult the [Working with enums] section in the user guide for some
4098    /// guidelines.
4099    ///
4100    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4101    #[derive(Clone, Debug, PartialEq)]
4102    #[non_exhaustive]
4103    pub enum RefType {
4104        /// No type specified.
4105        Unspecified,
4106        /// To fetch tags.
4107        Tag,
4108        /// To fetch branches.
4109        Branch,
4110        /// If set, the enum was initialized with an unknown value.
4111        ///
4112        /// Applications can examine the value using [RefType::value] or
4113        /// [RefType::name].
4114        UnknownValue(ref_type::UnknownValue),
4115    }
4116
4117    #[doc(hidden)]
4118    pub mod ref_type {
4119        #[allow(unused_imports)]
4120        use super::*;
4121        #[derive(Clone, Debug, PartialEq)]
4122        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4123    }
4124
4125    impl RefType {
4126        /// Gets the enum value.
4127        ///
4128        /// Returns `None` if the enum contains an unknown value deserialized from
4129        /// the string representation of enums.
4130        pub fn value(&self) -> std::option::Option<i32> {
4131            match self {
4132                Self::Unspecified => std::option::Option::Some(0),
4133                Self::Tag => std::option::Option::Some(1),
4134                Self::Branch => std::option::Option::Some(2),
4135                Self::UnknownValue(u) => u.0.value(),
4136            }
4137        }
4138
4139        /// Gets the enum value as a string.
4140        ///
4141        /// Returns `None` if the enum contains an unknown value deserialized from
4142        /// the integer representation of enums.
4143        pub fn name(&self) -> std::option::Option<&str> {
4144            match self {
4145                Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
4146                Self::Tag => std::option::Option::Some("TAG"),
4147                Self::Branch => std::option::Option::Some("BRANCH"),
4148                Self::UnknownValue(u) => u.0.name(),
4149            }
4150        }
4151    }
4152
4153    impl std::default::Default for RefType {
4154        fn default() -> Self {
4155            use std::convert::From;
4156            Self::from(0)
4157        }
4158    }
4159
4160    impl std::fmt::Display for RefType {
4161        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4162            wkt::internal::display_enum(f, self.name(), self.value())
4163        }
4164    }
4165
4166    impl std::convert::From<i32> for RefType {
4167        fn from(value: i32) -> Self {
4168            match value {
4169                0 => Self::Unspecified,
4170                1 => Self::Tag,
4171                2 => Self::Branch,
4172                _ => Self::UnknownValue(ref_type::UnknownValue(
4173                    wkt::internal::UnknownEnumValue::Integer(value),
4174                )),
4175            }
4176        }
4177    }
4178
4179    impl std::convert::From<&str> for RefType {
4180        fn from(value: &str) -> Self {
4181            use std::string::ToString;
4182            match value {
4183                "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
4184                "TAG" => Self::Tag,
4185                "BRANCH" => Self::Branch,
4186                _ => Self::UnknownValue(ref_type::UnknownValue(
4187                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4188                )),
4189            }
4190        }
4191    }
4192
4193    impl serde::ser::Serialize for RefType {
4194        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4195        where
4196            S: serde::Serializer,
4197        {
4198            match self {
4199                Self::Unspecified => serializer.serialize_i32(0),
4200                Self::Tag => serializer.serialize_i32(1),
4201                Self::Branch => serializer.serialize_i32(2),
4202                Self::UnknownValue(u) => u.0.serialize(serializer),
4203            }
4204        }
4205    }
4206
4207    impl<'de> serde::de::Deserialize<'de> for RefType {
4208        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4209        where
4210            D: serde::Deserializer<'de>,
4211        {
4212            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
4213                ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
4214            ))
4215        }
4216    }
4217}
4218
4219/// Response for fetching git refs.
4220#[derive(Clone, Default, PartialEq)]
4221#[non_exhaustive]
4222pub struct FetchGitRefsResponse {
4223    /// Name of the refs fetched.
4224    pub ref_names: std::vec::Vec<std::string::String>,
4225
4226    /// A token identifying a page of results the server should return.
4227    pub next_page_token: std::string::String,
4228
4229    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4230}
4231
4232impl FetchGitRefsResponse {
4233    pub fn new() -> Self {
4234        std::default::Default::default()
4235    }
4236
4237    /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
4238    pub fn set_ref_names<T, V>(mut self, v: T) -> Self
4239    where
4240        T: std::iter::IntoIterator<Item = V>,
4241        V: std::convert::Into<std::string::String>,
4242    {
4243        use std::iter::Iterator;
4244        self.ref_names = v.into_iter().map(|i| i.into()).collect();
4245        self
4246    }
4247
4248    /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
4249    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4250        self.next_page_token = v.into();
4251        self
4252    }
4253}
4254
4255impl wkt::message::Message for FetchGitRefsResponse {
4256    fn typename() -> &'static str {
4257        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
4258    }
4259}
4260
4261/// AccountConnector encapsulates what a platform administrator needs to
4262/// configure for users to connect to the service providers, which includes,
4263/// among other fields, the OAuth client ID, client secret, and authorization and
4264/// token endpoints.
4265#[derive(Clone, Default, PartialEq)]
4266#[non_exhaustive]
4267pub struct AccountConnector {
4268    /// Identifier. The resource name of the accountConnector, in the format
4269    /// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
4270    pub name: std::string::String,
4271
4272    /// Output only. The timestamp when the accountConnector was created.
4273    pub create_time: std::option::Option<wkt::Timestamp>,
4274
4275    /// Output only. The timestamp when the accountConnector was updated.
4276    pub update_time: std::option::Option<wkt::Timestamp>,
4277
4278    /// Optional. Allows users to store small amounts of arbitrary data.
4279    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
4280
4281    /// Optional. This checksum is computed by the server based on the value of
4282    /// other fields, and may be sent on update and delete requests to ensure the
4283    /// client has an up-to-date value before proceeding.
4284    pub etag: std::string::String,
4285
4286    /// Optional. Labels as key value pairs
4287    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4288
4289    /// Output only. Start OAuth flow by clicking on this URL.
4290    pub oauth_start_uri: std::string::String,
4291
4292    /// The AccountConnector config.
4293    pub account_connector_config:
4294        std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
4295
4296    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4297}
4298
4299impl AccountConnector {
4300    pub fn new() -> Self {
4301        std::default::Default::default()
4302    }
4303
4304    /// Sets the value of [name][crate::model::AccountConnector::name].
4305    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4306        self.name = v.into();
4307        self
4308    }
4309
4310    /// Sets the value of [create_time][crate::model::AccountConnector::create_time].
4311    pub fn set_create_time<T>(mut self, v: T) -> Self
4312    where
4313        T: std::convert::Into<wkt::Timestamp>,
4314    {
4315        self.create_time = std::option::Option::Some(v.into());
4316        self
4317    }
4318
4319    /// Sets or clears the value of [create_time][crate::model::AccountConnector::create_time].
4320    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4321    where
4322        T: std::convert::Into<wkt::Timestamp>,
4323    {
4324        self.create_time = v.map(|x| x.into());
4325        self
4326    }
4327
4328    /// Sets the value of [update_time][crate::model::AccountConnector::update_time].
4329    pub fn set_update_time<T>(mut self, v: T) -> Self
4330    where
4331        T: std::convert::Into<wkt::Timestamp>,
4332    {
4333        self.update_time = std::option::Option::Some(v.into());
4334        self
4335    }
4336
4337    /// Sets or clears the value of [update_time][crate::model::AccountConnector::update_time].
4338    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4339    where
4340        T: std::convert::Into<wkt::Timestamp>,
4341    {
4342        self.update_time = v.map(|x| x.into());
4343        self
4344    }
4345
4346    /// Sets the value of [annotations][crate::model::AccountConnector::annotations].
4347    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
4348    where
4349        T: std::iter::IntoIterator<Item = (K, V)>,
4350        K: std::convert::Into<std::string::String>,
4351        V: std::convert::Into<std::string::String>,
4352    {
4353        use std::iter::Iterator;
4354        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4355        self
4356    }
4357
4358    /// Sets the value of [etag][crate::model::AccountConnector::etag].
4359    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4360        self.etag = v.into();
4361        self
4362    }
4363
4364    /// Sets the value of [labels][crate::model::AccountConnector::labels].
4365    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4366    where
4367        T: std::iter::IntoIterator<Item = (K, V)>,
4368        K: std::convert::Into<std::string::String>,
4369        V: std::convert::Into<std::string::String>,
4370    {
4371        use std::iter::Iterator;
4372        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4373        self
4374    }
4375
4376    /// Sets the value of [oauth_start_uri][crate::model::AccountConnector::oauth_start_uri].
4377    pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4378        self.oauth_start_uri = v.into();
4379        self
4380    }
4381
4382    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config].
4383    ///
4384    /// Note that all the setters affecting `account_connector_config` are mutually
4385    /// exclusive.
4386    pub fn set_account_connector_config<
4387        T: std::convert::Into<
4388                std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
4389            >,
4390    >(
4391        mut self,
4392        v: T,
4393    ) -> Self {
4394        self.account_connector_config = v.into();
4395        self
4396    }
4397
4398    /// The value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
4399    /// if it holds a `ProviderOauthConfig`, `None` if the field is not set or
4400    /// holds a different branch.
4401    pub fn provider_oauth_config(
4402        &self,
4403    ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
4404        #[allow(unreachable_patterns)]
4405        self.account_connector_config
4406            .as_ref()
4407            .and_then(|v| match v {
4408                crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
4409                    std::option::Option::Some(v)
4410                }
4411                _ => std::option::Option::None,
4412            })
4413    }
4414
4415    /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
4416    /// to hold a `ProviderOauthConfig`.
4417    ///
4418    /// Note that all the setters affecting `account_connector_config` are
4419    /// mutually exclusive.
4420    pub fn set_provider_oauth_config<
4421        T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
4422    >(
4423        mut self,
4424        v: T,
4425    ) -> Self {
4426        self.account_connector_config = std::option::Option::Some(
4427            crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
4428        );
4429        self
4430    }
4431}
4432
4433impl wkt::message::Message for AccountConnector {
4434    fn typename() -> &'static str {
4435        "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
4436    }
4437}
4438
4439/// Defines additional types related to [AccountConnector].
4440pub mod account_connector {
4441    #[allow(unused_imports)]
4442    use super::*;
4443
4444    /// The AccountConnector config.
4445    #[derive(Clone, Debug, PartialEq)]
4446    #[non_exhaustive]
4447    pub enum AccountConnectorConfig {
4448        /// Provider OAuth config.
4449        ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
4450    }
4451}
4452
4453/// User represents a user connected to the service providers through
4454/// a AccountConnector.
4455#[derive(Clone, Default, PartialEq)]
4456#[non_exhaustive]
4457pub struct User {
4458    /// Identifier. Resource name of the user, in the format
4459    /// `projects/*/locations/*/accountConnectors/*/users/*`.
4460    pub name: std::string::String,
4461
4462    /// Output only. Developer Connect automatically converts user identity
4463    /// to some human readable description, e.g., email address.
4464    pub display_name: std::string::String,
4465
4466    /// Output only. The timestamp when the user was created.
4467    pub create_time: std::option::Option<wkt::Timestamp>,
4468
4469    /// Output only. The timestamp when the token was last requested.
4470    pub last_token_request_time: std::option::Option<wkt::Timestamp>,
4471
4472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4473}
4474
4475impl User {
4476    pub fn new() -> Self {
4477        std::default::Default::default()
4478    }
4479
4480    /// Sets the value of [name][crate::model::User::name].
4481    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4482        self.name = v.into();
4483        self
4484    }
4485
4486    /// Sets the value of [display_name][crate::model::User::display_name].
4487    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4488        self.display_name = v.into();
4489        self
4490    }
4491
4492    /// Sets the value of [create_time][crate::model::User::create_time].
4493    pub fn set_create_time<T>(mut self, v: T) -> Self
4494    where
4495        T: std::convert::Into<wkt::Timestamp>,
4496    {
4497        self.create_time = std::option::Option::Some(v.into());
4498        self
4499    }
4500
4501    /// Sets or clears the value of [create_time][crate::model::User::create_time].
4502    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4503    where
4504        T: std::convert::Into<wkt::Timestamp>,
4505    {
4506        self.create_time = v.map(|x| x.into());
4507        self
4508    }
4509
4510    /// Sets the value of [last_token_request_time][crate::model::User::last_token_request_time].
4511    pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
4512    where
4513        T: std::convert::Into<wkt::Timestamp>,
4514    {
4515        self.last_token_request_time = std::option::Option::Some(v.into());
4516        self
4517    }
4518
4519    /// Sets or clears the value of [last_token_request_time][crate::model::User::last_token_request_time].
4520    pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
4521    where
4522        T: std::convert::Into<wkt::Timestamp>,
4523    {
4524        self.last_token_request_time = v.map(|x| x.into());
4525        self
4526    }
4527}
4528
4529impl wkt::message::Message for User {
4530    fn typename() -> &'static str {
4531        "type.googleapis.com/google.cloud.developerconnect.v1.User"
4532    }
4533}
4534
4535/// ProviderOAuthConfig is the OAuth config for a provider.
4536#[derive(Clone, Default, PartialEq)]
4537#[non_exhaustive]
4538pub struct ProviderOAuthConfig {
4539    /// Required. User selected scopes to apply to the Oauth config
4540    /// In the event of changing scopes, user records under AccountConnector will
4541    /// be deleted and users will re-auth again.
4542    pub scopes: std::vec::Vec<std::string::String>,
4543
4544    /// OAuth Provider ID. It could be Developer Connect owned or providers
4545    /// provided.
4546    pub oauth_provider_id:
4547        std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
4548
4549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4550}
4551
4552impl ProviderOAuthConfig {
4553    pub fn new() -> Self {
4554        std::default::Default::default()
4555    }
4556
4557    /// Sets the value of [scopes][crate::model::ProviderOAuthConfig::scopes].
4558    pub fn set_scopes<T, V>(mut self, v: T) -> Self
4559    where
4560        T: std::iter::IntoIterator<Item = V>,
4561        V: std::convert::Into<std::string::String>,
4562    {
4563        use std::iter::Iterator;
4564        self.scopes = v.into_iter().map(|i| i.into()).collect();
4565        self
4566    }
4567
4568    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id].
4569    ///
4570    /// Note that all the setters affecting `oauth_provider_id` are mutually
4571    /// exclusive.
4572    pub fn set_oauth_provider_id<
4573        T: std::convert::Into<
4574                std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
4575            >,
4576    >(
4577        mut self,
4578        v: T,
4579    ) -> Self {
4580        self.oauth_provider_id = v.into();
4581        self
4582    }
4583
4584    /// The value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
4585    /// if it holds a `SystemProviderId`, `None` if the field is not set or
4586    /// holds a different branch.
4587    pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
4588        #[allow(unreachable_patterns)]
4589        self.oauth_provider_id.as_ref().and_then(|v| match v {
4590            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
4591                std::option::Option::Some(v)
4592            }
4593            _ => std::option::Option::None,
4594        })
4595    }
4596
4597    /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
4598    /// to hold a `SystemProviderId`.
4599    ///
4600    /// Note that all the setters affecting `oauth_provider_id` are
4601    /// mutually exclusive.
4602    pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
4603        mut self,
4604        v: T,
4605    ) -> Self {
4606        self.oauth_provider_id = std::option::Option::Some(
4607            crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
4608        );
4609        self
4610    }
4611}
4612
4613impl wkt::message::Message for ProviderOAuthConfig {
4614    fn typename() -> &'static str {
4615        "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
4616    }
4617}
4618
4619/// Defines additional types related to [ProviderOAuthConfig].
4620pub mod provider_o_auth_config {
4621    #[allow(unused_imports)]
4622    use super::*;
4623
4624    /// OAuth Provider ID. It could be Developer Connect owned or providers
4625    /// provided.
4626    #[derive(Clone, Debug, PartialEq)]
4627    #[non_exhaustive]
4628    pub enum OauthProviderId {
4629        /// Immutable. Developer Connect provided OAuth.
4630        SystemProviderId(crate::model::SystemProvider),
4631    }
4632}
4633
4634/// The InsightsConfig resource is the core configuration object to capture
4635/// events from your Software Development Lifecycle. It acts as the central hub
4636/// for managing how Developer connect understands your application, its runtime
4637/// environments, and the artifacts deployed within them.
4638#[derive(Clone, Default, PartialEq)]
4639#[non_exhaustive]
4640pub struct InsightsConfig {
4641    /// Identifier. The name of the InsightsConfig.
4642    /// Format:
4643    /// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
4644    pub name: std::string::String,
4645
4646    /// Output only. [Output only] Create timestamp
4647    pub create_time: std::option::Option<wkt::Timestamp>,
4648
4649    /// Output only. [Output only] Update timestamp
4650    pub update_time: std::option::Option<wkt::Timestamp>,
4651
4652    /// Output only. The runtime configurations where the application is deployed.
4653    pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
4654
4655    /// Optional. The artifact configurations of the artifacts that are deployed.
4656    pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
4657
4658    /// Optional. Output only. The state of the InsightsConfig.
4659    pub state: crate::model::insights_config::State,
4660
4661    /// Optional. User specified annotations. See
4662    /// <https://google.aip.dev/148#annotations> for more details such as format and
4663    /// size limitations.
4664    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
4665
4666    /// Optional. Set of labels associated with an InsightsConfig.
4667    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4668
4669    /// Output only. Reconciling (<https://google.aip.dev/128#reconciliation>).
4670    /// Set to true if the current state of InsightsConfig does not match the
4671    /// user's intended state, and the service is actively updating the resource to
4672    /// reconcile them. This can happen due to user-triggered updates or
4673    /// system actions like failover or maintenance.
4674    pub reconciling: bool,
4675
4676    /// Output only. Any errors that occurred while setting up the InsightsConfig.
4677    /// Each error will be in the format: `field_name: error_message`, e.g.
4678    /// GetAppHubApplication: Permission denied while getting App Hub
4679    /// application. Please grant permissions to the P4SA.
4680    pub errors: std::vec::Vec<rpc::model::Status>,
4681
4682    /// The context of the InsightsConfig.
4683    pub insights_config_context:
4684        std::option::Option<crate::model::insights_config::InsightsConfigContext>,
4685
4686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4687}
4688
4689impl InsightsConfig {
4690    pub fn new() -> Self {
4691        std::default::Default::default()
4692    }
4693
4694    /// Sets the value of [name][crate::model::InsightsConfig::name].
4695    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4696        self.name = v.into();
4697        self
4698    }
4699
4700    /// Sets the value of [create_time][crate::model::InsightsConfig::create_time].
4701    pub fn set_create_time<T>(mut self, v: T) -> Self
4702    where
4703        T: std::convert::Into<wkt::Timestamp>,
4704    {
4705        self.create_time = std::option::Option::Some(v.into());
4706        self
4707    }
4708
4709    /// Sets or clears the value of [create_time][crate::model::InsightsConfig::create_time].
4710    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4711    where
4712        T: std::convert::Into<wkt::Timestamp>,
4713    {
4714        self.create_time = v.map(|x| x.into());
4715        self
4716    }
4717
4718    /// Sets the value of [update_time][crate::model::InsightsConfig::update_time].
4719    pub fn set_update_time<T>(mut self, v: T) -> Self
4720    where
4721        T: std::convert::Into<wkt::Timestamp>,
4722    {
4723        self.update_time = std::option::Option::Some(v.into());
4724        self
4725    }
4726
4727    /// Sets or clears the value of [update_time][crate::model::InsightsConfig::update_time].
4728    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4729    where
4730        T: std::convert::Into<wkt::Timestamp>,
4731    {
4732        self.update_time = v.map(|x| x.into());
4733        self
4734    }
4735
4736    /// Sets the value of [runtime_configs][crate::model::InsightsConfig::runtime_configs].
4737    pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
4738    where
4739        T: std::iter::IntoIterator<Item = V>,
4740        V: std::convert::Into<crate::model::RuntimeConfig>,
4741    {
4742        use std::iter::Iterator;
4743        self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
4744        self
4745    }
4746
4747    /// Sets the value of [artifact_configs][crate::model::InsightsConfig::artifact_configs].
4748    pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
4749    where
4750        T: std::iter::IntoIterator<Item = V>,
4751        V: std::convert::Into<crate::model::ArtifactConfig>,
4752    {
4753        use std::iter::Iterator;
4754        self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
4755        self
4756    }
4757
4758    /// Sets the value of [state][crate::model::InsightsConfig::state].
4759    pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
4760        mut self,
4761        v: T,
4762    ) -> Self {
4763        self.state = v.into();
4764        self
4765    }
4766
4767    /// Sets the value of [annotations][crate::model::InsightsConfig::annotations].
4768    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
4769    where
4770        T: std::iter::IntoIterator<Item = (K, V)>,
4771        K: std::convert::Into<std::string::String>,
4772        V: std::convert::Into<std::string::String>,
4773    {
4774        use std::iter::Iterator;
4775        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4776        self
4777    }
4778
4779    /// Sets the value of [labels][crate::model::InsightsConfig::labels].
4780    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4781    where
4782        T: std::iter::IntoIterator<Item = (K, V)>,
4783        K: std::convert::Into<std::string::String>,
4784        V: std::convert::Into<std::string::String>,
4785    {
4786        use std::iter::Iterator;
4787        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4788        self
4789    }
4790
4791    /// Sets the value of [reconciling][crate::model::InsightsConfig::reconciling].
4792    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4793        self.reconciling = v.into();
4794        self
4795    }
4796
4797    /// Sets the value of [errors][crate::model::InsightsConfig::errors].
4798    pub fn set_errors<T, V>(mut self, v: T) -> Self
4799    where
4800        T: std::iter::IntoIterator<Item = V>,
4801        V: std::convert::Into<rpc::model::Status>,
4802    {
4803        use std::iter::Iterator;
4804        self.errors = v.into_iter().map(|i| i.into()).collect();
4805        self
4806    }
4807
4808    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context].
4809    ///
4810    /// Note that all the setters affecting `insights_config_context` are mutually
4811    /// exclusive.
4812    pub fn set_insights_config_context<
4813        T: std::convert::Into<
4814                std::option::Option<crate::model::insights_config::InsightsConfigContext>,
4815            >,
4816    >(
4817        mut self,
4818        v: T,
4819    ) -> Self {
4820        self.insights_config_context = v.into();
4821        self
4822    }
4823
4824    /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
4825    /// if it holds a `AppHubApplication`, `None` if the field is not set or
4826    /// holds a different branch.
4827    pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
4828        #[allow(unreachable_patterns)]
4829        self.insights_config_context.as_ref().and_then(|v| match v {
4830            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
4831                std::option::Option::Some(v)
4832            }
4833            _ => std::option::Option::None,
4834        })
4835    }
4836
4837    /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
4838    /// to hold a `AppHubApplication`.
4839    ///
4840    /// Note that all the setters affecting `insights_config_context` are
4841    /// mutually exclusive.
4842    pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
4843        mut self,
4844        v: T,
4845    ) -> Self {
4846        self.insights_config_context = std::option::Option::Some(
4847            crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
4848        );
4849        self
4850    }
4851}
4852
4853impl wkt::message::Message for InsightsConfig {
4854    fn typename() -> &'static str {
4855        "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
4856    }
4857}
4858
4859/// Defines additional types related to [InsightsConfig].
4860pub mod insights_config {
4861    #[allow(unused_imports)]
4862    use super::*;
4863
4864    /// The state of the InsightsConfig.
4865    ///
4866    /// # Working with unknown values
4867    ///
4868    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4869    /// additional enum variants at any time. Adding new variants is not considered
4870    /// a breaking change. Applications should write their code in anticipation of:
4871    ///
4872    /// - New values appearing in future releases of the client library, **and**
4873    /// - New values received dynamically, without application changes.
4874    ///
4875    /// Please consult the [Working with enums] section in the user guide for some
4876    /// guidelines.
4877    ///
4878    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4879    #[derive(Clone, Debug, PartialEq)]
4880    #[non_exhaustive]
4881    pub enum State {
4882        /// No state specified.
4883        Unspecified,
4884        /// The InsightsConfig is pending application discovery/runtime discovery.
4885        Pending,
4886        /// The initial discovery process is complete.
4887        Complete,
4888        /// The InsightsConfig is in an error state.
4889        Error,
4890        /// If set, the enum was initialized with an unknown value.
4891        ///
4892        /// Applications can examine the value using [State::value] or
4893        /// [State::name].
4894        UnknownValue(state::UnknownValue),
4895    }
4896
4897    #[doc(hidden)]
4898    pub mod state {
4899        #[allow(unused_imports)]
4900        use super::*;
4901        #[derive(Clone, Debug, PartialEq)]
4902        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4903    }
4904
4905    impl State {
4906        /// Gets the enum value.
4907        ///
4908        /// Returns `None` if the enum contains an unknown value deserialized from
4909        /// the string representation of enums.
4910        pub fn value(&self) -> std::option::Option<i32> {
4911            match self {
4912                Self::Unspecified => std::option::Option::Some(0),
4913                Self::Pending => std::option::Option::Some(5),
4914                Self::Complete => std::option::Option::Some(3),
4915                Self::Error => std::option::Option::Some(4),
4916                Self::UnknownValue(u) => u.0.value(),
4917            }
4918        }
4919
4920        /// Gets the enum value as a string.
4921        ///
4922        /// Returns `None` if the enum contains an unknown value deserialized from
4923        /// the integer representation of enums.
4924        pub fn name(&self) -> std::option::Option<&str> {
4925            match self {
4926                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4927                Self::Pending => std::option::Option::Some("PENDING"),
4928                Self::Complete => std::option::Option::Some("COMPLETE"),
4929                Self::Error => std::option::Option::Some("ERROR"),
4930                Self::UnknownValue(u) => u.0.name(),
4931            }
4932        }
4933    }
4934
4935    impl std::default::Default for State {
4936        fn default() -> Self {
4937            use std::convert::From;
4938            Self::from(0)
4939        }
4940    }
4941
4942    impl std::fmt::Display for State {
4943        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4944            wkt::internal::display_enum(f, self.name(), self.value())
4945        }
4946    }
4947
4948    impl std::convert::From<i32> for State {
4949        fn from(value: i32) -> Self {
4950            match value {
4951                0 => Self::Unspecified,
4952                3 => Self::Complete,
4953                4 => Self::Error,
4954                5 => Self::Pending,
4955                _ => Self::UnknownValue(state::UnknownValue(
4956                    wkt::internal::UnknownEnumValue::Integer(value),
4957                )),
4958            }
4959        }
4960    }
4961
4962    impl std::convert::From<&str> for State {
4963        fn from(value: &str) -> Self {
4964            use std::string::ToString;
4965            match value {
4966                "STATE_UNSPECIFIED" => Self::Unspecified,
4967                "PENDING" => Self::Pending,
4968                "COMPLETE" => Self::Complete,
4969                "ERROR" => Self::Error,
4970                _ => Self::UnknownValue(state::UnknownValue(
4971                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4972                )),
4973            }
4974        }
4975    }
4976
4977    impl serde::ser::Serialize for State {
4978        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4979        where
4980            S: serde::Serializer,
4981        {
4982            match self {
4983                Self::Unspecified => serializer.serialize_i32(0),
4984                Self::Pending => serializer.serialize_i32(5),
4985                Self::Complete => serializer.serialize_i32(3),
4986                Self::Error => serializer.serialize_i32(4),
4987                Self::UnknownValue(u) => u.0.serialize(serializer),
4988            }
4989        }
4990    }
4991
4992    impl<'de> serde::de::Deserialize<'de> for State {
4993        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4994        where
4995            D: serde::Deserializer<'de>,
4996        {
4997            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4998                ".google.cloud.developerconnect.v1.InsightsConfig.State",
4999            ))
5000        }
5001    }
5002
5003    /// The context of the InsightsConfig.
5004    #[derive(Clone, Debug, PartialEq)]
5005    #[non_exhaustive]
5006    pub enum InsightsConfigContext {
5007        /// Optional. The name of the App Hub Application.
5008        /// Format:
5009        /// projects/{project}/locations/{location}/applications/{application}
5010        AppHubApplication(std::string::String),
5011    }
5012}
5013
5014/// RuntimeConfig represents the runtimes where the application is
5015/// deployed.
5016#[derive(Clone, Default, PartialEq)]
5017#[non_exhaustive]
5018pub struct RuntimeConfig {
5019    /// Required. Immutable. The URI of the runtime configuration.
5020    /// For GKE, this is the cluster name.
5021    /// For Cloud Run, this is the service name.
5022    pub uri: std::string::String,
5023
5024    /// Output only. The state of the Runtime.
5025    pub state: crate::model::runtime_config::State,
5026
5027    /// The type of the runtime.
5028    pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
5029
5030    /// Where the runtime is derived from.
5031    pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
5032
5033    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5034}
5035
5036impl RuntimeConfig {
5037    pub fn new() -> Self {
5038        std::default::Default::default()
5039    }
5040
5041    /// Sets the value of [uri][crate::model::RuntimeConfig::uri].
5042    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5043        self.uri = v.into();
5044        self
5045    }
5046
5047    /// Sets the value of [state][crate::model::RuntimeConfig::state].
5048    pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
5049        mut self,
5050        v: T,
5051    ) -> Self {
5052        self.state = v.into();
5053        self
5054    }
5055
5056    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime].
5057    ///
5058    /// Note that all the setters affecting `runtime` are mutually
5059    /// exclusive.
5060    pub fn set_runtime<
5061        T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
5062    >(
5063        mut self,
5064        v: T,
5065    ) -> Self {
5066        self.runtime = v.into();
5067        self
5068    }
5069
5070    /// The value of [runtime][crate::model::RuntimeConfig::runtime]
5071    /// if it holds a `GkeWorkload`, `None` if the field is not set or
5072    /// holds a different branch.
5073    pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
5074        #[allow(unreachable_patterns)]
5075        self.runtime.as_ref().and_then(|v| match v {
5076            crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
5077            _ => std::option::Option::None,
5078        })
5079    }
5080
5081    /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
5082    /// to hold a `GkeWorkload`.
5083    ///
5084    /// Note that all the setters affecting `runtime` are
5085    /// mutually exclusive.
5086    pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
5087        mut self,
5088        v: T,
5089    ) -> Self {
5090        self.runtime =
5091            std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
5092        self
5093    }
5094
5095    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from].
5096    ///
5097    /// Note that all the setters affecting `derived_from` are mutually
5098    /// exclusive.
5099    pub fn set_derived_from<
5100        T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
5101    >(
5102        mut self,
5103        v: T,
5104    ) -> Self {
5105        self.derived_from = v.into();
5106        self
5107    }
5108
5109    /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
5110    /// if it holds a `AppHubWorkload`, `None` if the field is not set or
5111    /// holds a different branch.
5112    pub fn app_hub_workload(
5113        &self,
5114    ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
5115        #[allow(unreachable_patterns)]
5116        self.derived_from.as_ref().and_then(|v| match v {
5117            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
5118                std::option::Option::Some(v)
5119            }
5120            _ => std::option::Option::None,
5121        })
5122    }
5123
5124    /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
5125    /// to hold a `AppHubWorkload`.
5126    ///
5127    /// Note that all the setters affecting `derived_from` are
5128    /// mutually exclusive.
5129    pub fn set_app_hub_workload<
5130        T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
5131    >(
5132        mut self,
5133        v: T,
5134    ) -> Self {
5135        self.derived_from = std::option::Option::Some(
5136            crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
5137        );
5138        self
5139    }
5140}
5141
5142impl wkt::message::Message for RuntimeConfig {
5143    fn typename() -> &'static str {
5144        "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
5145    }
5146}
5147
5148/// Defines additional types related to [RuntimeConfig].
5149pub mod runtime_config {
5150    #[allow(unused_imports)]
5151    use super::*;
5152
5153    /// The state of the runtime in the InsightsConfig.
5154    /// Whether the runtime is linked to the InsightsConfig.
5155    ///
5156    /// # Working with unknown values
5157    ///
5158    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5159    /// additional enum variants at any time. Adding new variants is not considered
5160    /// a breaking change. Applications should write their code in anticipation of:
5161    ///
5162    /// - New values appearing in future releases of the client library, **and**
5163    /// - New values received dynamically, without application changes.
5164    ///
5165    /// Please consult the [Working with enums] section in the user guide for some
5166    /// guidelines.
5167    ///
5168    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5169    #[derive(Clone, Debug, PartialEq)]
5170    #[non_exhaustive]
5171    pub enum State {
5172        /// No state specified.
5173        Unspecified,
5174        /// The runtime configuration has been linked to the InsightsConfig.
5175        Linked,
5176        /// The runtime configuration has been unlinked to the InsightsConfig.
5177        Unlinked,
5178        /// If set, the enum was initialized with an unknown value.
5179        ///
5180        /// Applications can examine the value using [State::value] or
5181        /// [State::name].
5182        UnknownValue(state::UnknownValue),
5183    }
5184
5185    #[doc(hidden)]
5186    pub mod state {
5187        #[allow(unused_imports)]
5188        use super::*;
5189        #[derive(Clone, Debug, PartialEq)]
5190        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5191    }
5192
5193    impl State {
5194        /// Gets the enum value.
5195        ///
5196        /// Returns `None` if the enum contains an unknown value deserialized from
5197        /// the string representation of enums.
5198        pub fn value(&self) -> std::option::Option<i32> {
5199            match self {
5200                Self::Unspecified => std::option::Option::Some(0),
5201                Self::Linked => std::option::Option::Some(1),
5202                Self::Unlinked => std::option::Option::Some(2),
5203                Self::UnknownValue(u) => u.0.value(),
5204            }
5205        }
5206
5207        /// Gets the enum value as a string.
5208        ///
5209        /// Returns `None` if the enum contains an unknown value deserialized from
5210        /// the integer representation of enums.
5211        pub fn name(&self) -> std::option::Option<&str> {
5212            match self {
5213                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5214                Self::Linked => std::option::Option::Some("LINKED"),
5215                Self::Unlinked => std::option::Option::Some("UNLINKED"),
5216                Self::UnknownValue(u) => u.0.name(),
5217            }
5218        }
5219    }
5220
5221    impl std::default::Default for State {
5222        fn default() -> Self {
5223            use std::convert::From;
5224            Self::from(0)
5225        }
5226    }
5227
5228    impl std::fmt::Display for State {
5229        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5230            wkt::internal::display_enum(f, self.name(), self.value())
5231        }
5232    }
5233
5234    impl std::convert::From<i32> for State {
5235        fn from(value: i32) -> Self {
5236            match value {
5237                0 => Self::Unspecified,
5238                1 => Self::Linked,
5239                2 => Self::Unlinked,
5240                _ => Self::UnknownValue(state::UnknownValue(
5241                    wkt::internal::UnknownEnumValue::Integer(value),
5242                )),
5243            }
5244        }
5245    }
5246
5247    impl std::convert::From<&str> for State {
5248        fn from(value: &str) -> Self {
5249            use std::string::ToString;
5250            match value {
5251                "STATE_UNSPECIFIED" => Self::Unspecified,
5252                "LINKED" => Self::Linked,
5253                "UNLINKED" => Self::Unlinked,
5254                _ => Self::UnknownValue(state::UnknownValue(
5255                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5256                )),
5257            }
5258        }
5259    }
5260
5261    impl serde::ser::Serialize for State {
5262        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5263        where
5264            S: serde::Serializer,
5265        {
5266            match self {
5267                Self::Unspecified => serializer.serialize_i32(0),
5268                Self::Linked => serializer.serialize_i32(1),
5269                Self::Unlinked => serializer.serialize_i32(2),
5270                Self::UnknownValue(u) => u.0.serialize(serializer),
5271            }
5272        }
5273    }
5274
5275    impl<'de> serde::de::Deserialize<'de> for State {
5276        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5277        where
5278            D: serde::Deserializer<'de>,
5279        {
5280            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5281                ".google.cloud.developerconnect.v1.RuntimeConfig.State",
5282            ))
5283        }
5284    }
5285
5286    /// The type of the runtime.
5287    #[derive(Clone, Debug, PartialEq)]
5288    #[non_exhaustive]
5289    pub enum Runtime {
5290        /// Output only. Google Kubernetes Engine runtime.
5291        GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
5292    }
5293
5294    /// Where the runtime is derived from.
5295    #[derive(Clone, Debug, PartialEq)]
5296    #[non_exhaustive]
5297    pub enum DerivedFrom {
5298        /// Output only. App Hub Workload.
5299        AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
5300    }
5301}
5302
5303/// GKEWorkload represents the Google Kubernetes Engine runtime.
5304#[derive(Clone, Default, PartialEq)]
5305#[non_exhaustive]
5306pub struct GKEWorkload {
5307    /// Required. Immutable. The name of the GKE cluster.
5308    /// Format:
5309    /// `projects/{project}/locations/{location}/clusters/{cluster}`.
5310    pub cluster: std::string::String,
5311
5312    /// Output only. The name of the GKE deployment.
5313    /// Format:
5314    /// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
5315    pub deployment: std::string::String,
5316
5317    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5318}
5319
5320impl GKEWorkload {
5321    pub fn new() -> Self {
5322        std::default::Default::default()
5323    }
5324
5325    /// Sets the value of [cluster][crate::model::GKEWorkload::cluster].
5326    pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5327        self.cluster = v.into();
5328        self
5329    }
5330
5331    /// Sets the value of [deployment][crate::model::GKEWorkload::deployment].
5332    pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5333        self.deployment = v.into();
5334        self
5335    }
5336}
5337
5338impl wkt::message::Message for GKEWorkload {
5339    fn typename() -> &'static str {
5340        "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
5341    }
5342}
5343
5344/// AppHubWorkload represents the App Hub Workload.
5345#[derive(Clone, Default, PartialEq)]
5346#[non_exhaustive]
5347pub struct AppHubWorkload {
5348    /// Required. Output only. Immutable. The name of the App Hub Workload.
5349    /// Format:
5350    /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
5351    pub workload: std::string::String,
5352
5353    /// Output only. The criticality of the App Hub Workload.
5354    pub criticality: std::string::String,
5355
5356    /// Output only. The environment of the App Hub Workload.
5357    pub environment: std::string::String,
5358
5359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5360}
5361
5362impl AppHubWorkload {
5363    pub fn new() -> Self {
5364        std::default::Default::default()
5365    }
5366
5367    /// Sets the value of [workload][crate::model::AppHubWorkload::workload].
5368    pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5369        self.workload = v.into();
5370        self
5371    }
5372
5373    /// Sets the value of [criticality][crate::model::AppHubWorkload::criticality].
5374    pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5375        self.criticality = v.into();
5376        self
5377    }
5378
5379    /// Sets the value of [environment][crate::model::AppHubWorkload::environment].
5380    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5381        self.environment = v.into();
5382        self
5383    }
5384}
5385
5386impl wkt::message::Message for AppHubWorkload {
5387    fn typename() -> &'static str {
5388        "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
5389    }
5390}
5391
5392/// The artifact config of the artifact that is deployed.
5393#[derive(Clone, Default, PartialEq)]
5394#[non_exhaustive]
5395pub struct ArtifactConfig {
5396    /// Required. Immutable. The URI of the artifact that is deployed.
5397    /// e.g. `us-docker.pkg.dev/my-project/my-repo/image`.
5398    /// The URI does not include the tag / digest because it captures a lineage of
5399    /// artifacts.
5400    pub uri: std::string::String,
5401
5402    /// The storage location of the artifact.
5403    pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
5404
5405    /// The storage location of the artifact metadata.
5406    pub artifact_metadata_storage:
5407        std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
5408
5409    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5410}
5411
5412impl ArtifactConfig {
5413    pub fn new() -> Self {
5414        std::default::Default::default()
5415    }
5416
5417    /// Sets the value of [uri][crate::model::ArtifactConfig::uri].
5418    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5419        self.uri = v.into();
5420        self
5421    }
5422
5423    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage].
5424    ///
5425    /// Note that all the setters affecting `artifact_storage` are mutually
5426    /// exclusive.
5427    pub fn set_artifact_storage<
5428        T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
5429    >(
5430        mut self,
5431        v: T,
5432    ) -> Self {
5433        self.artifact_storage = v.into();
5434        self
5435    }
5436
5437    /// The value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
5438    /// if it holds a `GoogleArtifactRegistry`, `None` if the field is not set or
5439    /// holds a different branch.
5440    pub fn google_artifact_registry(
5441        &self,
5442    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
5443        #[allow(unreachable_patterns)]
5444        self.artifact_storage.as_ref().and_then(|v| match v {
5445            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
5446                std::option::Option::Some(v)
5447            }
5448            _ => std::option::Option::None,
5449        })
5450    }
5451
5452    /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
5453    /// to hold a `GoogleArtifactRegistry`.
5454    ///
5455    /// Note that all the setters affecting `artifact_storage` are
5456    /// mutually exclusive.
5457    pub fn set_google_artifact_registry<
5458        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
5459    >(
5460        mut self,
5461        v: T,
5462    ) -> Self {
5463        self.artifact_storage = std::option::Option::Some(
5464            crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
5465        );
5466        self
5467    }
5468
5469    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage].
5470    ///
5471    /// Note that all the setters affecting `artifact_metadata_storage` are mutually
5472    /// exclusive.
5473    pub fn set_artifact_metadata_storage<
5474        T: std::convert::Into<
5475                std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
5476            >,
5477    >(
5478        mut self,
5479        v: T,
5480    ) -> Self {
5481        self.artifact_metadata_storage = v.into();
5482        self
5483    }
5484
5485    /// The value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
5486    /// if it holds a `GoogleArtifactAnalysis`, `None` if the field is not set or
5487    /// holds a different branch.
5488    pub fn google_artifact_analysis(
5489        &self,
5490    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
5491        #[allow(unreachable_patterns)]
5492        self.artifact_metadata_storage
5493            .as_ref()
5494            .and_then(|v| match v {
5495                crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
5496                    v,
5497                ) => std::option::Option::Some(v),
5498                _ => std::option::Option::None,
5499            })
5500    }
5501
5502    /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
5503    /// to hold a `GoogleArtifactAnalysis`.
5504    ///
5505    /// Note that all the setters affecting `artifact_metadata_storage` are
5506    /// mutually exclusive.
5507    pub fn set_google_artifact_analysis<
5508        T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
5509    >(
5510        mut self,
5511        v: T,
5512    ) -> Self {
5513        self.artifact_metadata_storage = std::option::Option::Some(
5514            crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
5515                v.into(),
5516            ),
5517        );
5518        self
5519    }
5520}
5521
5522impl wkt::message::Message for ArtifactConfig {
5523    fn typename() -> &'static str {
5524        "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
5525    }
5526}
5527
5528/// Defines additional types related to [ArtifactConfig].
5529pub mod artifact_config {
5530    #[allow(unused_imports)]
5531    use super::*;
5532
5533    /// The storage location of the artifact.
5534    #[derive(Clone, Debug, PartialEq)]
5535    #[non_exhaustive]
5536    pub enum ArtifactStorage {
5537        /// Optional. Set if the artifact is stored in Artifact registry.
5538        GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
5539    }
5540
5541    /// The storage location of the artifact metadata.
5542    #[derive(Clone, Debug, PartialEq)]
5543    #[non_exhaustive]
5544    pub enum ArtifactMetadataStorage {
5545        /// Optional. Set if the artifact metadata is stored in Artifact analysis.
5546        GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
5547    }
5548}
5549
5550/// Google Artifact Analysis configurations.
5551#[derive(Clone, Default, PartialEq)]
5552#[non_exhaustive]
5553pub struct GoogleArtifactAnalysis {
5554    /// Required. The project id of the project where the provenance is stored.
5555    pub project_id: std::string::String,
5556
5557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5558}
5559
5560impl GoogleArtifactAnalysis {
5561    pub fn new() -> Self {
5562        std::default::Default::default()
5563    }
5564
5565    /// Sets the value of [project_id][crate::model::GoogleArtifactAnalysis::project_id].
5566    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5567        self.project_id = v.into();
5568        self
5569    }
5570}
5571
5572impl wkt::message::Message for GoogleArtifactAnalysis {
5573    fn typename() -> &'static str {
5574        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
5575    }
5576}
5577
5578/// Google Artifact Registry configurations.
5579#[derive(Clone, Default, PartialEq)]
5580#[non_exhaustive]
5581pub struct GoogleArtifactRegistry {
5582    /// Required. The host project of Artifact Registry.
5583    pub project_id: std::string::String,
5584
5585    /// Required. Immutable. The name of the artifact registry package.
5586    pub artifact_registry_package: std::string::String,
5587
5588    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5589}
5590
5591impl GoogleArtifactRegistry {
5592    pub fn new() -> Self {
5593        std::default::Default::default()
5594    }
5595
5596    /// Sets the value of [project_id][crate::model::GoogleArtifactRegistry::project_id].
5597    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5598        self.project_id = v.into();
5599        self
5600    }
5601
5602    /// Sets the value of [artifact_registry_package][crate::model::GoogleArtifactRegistry::artifact_registry_package].
5603    pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
5604        mut self,
5605        v: T,
5606    ) -> Self {
5607        self.artifact_registry_package = v.into();
5608        self
5609    }
5610}
5611
5612impl wkt::message::Message for GoogleArtifactRegistry {
5613    fn typename() -> &'static str {
5614        "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
5615    }
5616}
5617
5618/// Request for creating an InsightsConfig.
5619#[derive(Clone, Default, PartialEq)]
5620#[non_exhaustive]
5621pub struct CreateInsightsConfigRequest {
5622    /// Required. Value for parent.
5623    pub parent: std::string::String,
5624
5625    /// Required. ID of the requesting InsightsConfig.
5626    pub insights_config_id: std::string::String,
5627
5628    /// Required. The resource being created.
5629    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
5630
5631    /// Optional. If set, validate the request, but do not actually post it.
5632    pub validate_only: bool,
5633
5634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5635}
5636
5637impl CreateInsightsConfigRequest {
5638    pub fn new() -> Self {
5639        std::default::Default::default()
5640    }
5641
5642    /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
5643    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5644        self.parent = v.into();
5645        self
5646    }
5647
5648    /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
5649    pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
5650        mut self,
5651        v: T,
5652    ) -> Self {
5653        self.insights_config_id = v.into();
5654        self
5655    }
5656
5657    /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
5658    pub fn set_insights_config<T>(mut self, v: T) -> Self
5659    where
5660        T: std::convert::Into<crate::model::InsightsConfig>,
5661    {
5662        self.insights_config = std::option::Option::Some(v.into());
5663        self
5664    }
5665
5666    /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
5667    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
5668    where
5669        T: std::convert::Into<crate::model::InsightsConfig>,
5670    {
5671        self.insights_config = v.map(|x| x.into());
5672        self
5673    }
5674
5675    /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
5676    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5677        self.validate_only = v.into();
5678        self
5679    }
5680}
5681
5682impl wkt::message::Message for CreateInsightsConfigRequest {
5683    fn typename() -> &'static str {
5684        "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
5685    }
5686}
5687
5688/// Request for getting an InsightsConfig.
5689#[derive(Clone, Default, PartialEq)]
5690#[non_exhaustive]
5691pub struct GetInsightsConfigRequest {
5692    /// Required. Name of the resource.
5693    pub name: std::string::String,
5694
5695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5696}
5697
5698impl GetInsightsConfigRequest {
5699    pub fn new() -> Self {
5700        std::default::Default::default()
5701    }
5702
5703    /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
5704    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5705        self.name = v.into();
5706        self
5707    }
5708}
5709
5710impl wkt::message::Message for GetInsightsConfigRequest {
5711    fn typename() -> &'static str {
5712        "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
5713    }
5714}
5715
5716/// Request for requesting list of InsightsConfigs.
5717#[derive(Clone, Default, PartialEq)]
5718#[non_exhaustive]
5719pub struct ListInsightsConfigsRequest {
5720    /// Required. Parent value for ListInsightsConfigsRequest.
5721    pub parent: std::string::String,
5722
5723    /// Optional. Requested page size. Server may return fewer items than
5724    /// requested. If unspecified, server will pick an appropriate default.
5725    pub page_size: i32,
5726
5727    /// Optional. A token identifying a page of results the server should return.
5728    pub page_token: std::string::String,
5729
5730    /// Optional. Filtering results. See <https://google.aip.dev/160> for more
5731    /// details. Filter string, adhering to the rules in
5732    /// <https://google.aip.dev/160>. List only InsightsConfigs matching the filter.
5733    /// If filter is empty, all InsightsConfigs are listed.
5734    pub filter: std::string::String,
5735
5736    /// Optional. Hint for how to order the results.
5737    pub order_by: std::string::String,
5738
5739    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5740}
5741
5742impl ListInsightsConfigsRequest {
5743    pub fn new() -> Self {
5744        std::default::Default::default()
5745    }
5746
5747    /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
5748    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5749        self.parent = v.into();
5750        self
5751    }
5752
5753    /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
5754    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5755        self.page_size = v.into();
5756        self
5757    }
5758
5759    /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
5760    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5761        self.page_token = v.into();
5762        self
5763    }
5764
5765    /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
5766    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5767        self.filter = v.into();
5768        self
5769    }
5770
5771    /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
5772    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5773        self.order_by = v.into();
5774        self
5775    }
5776}
5777
5778impl wkt::message::Message for ListInsightsConfigsRequest {
5779    fn typename() -> &'static str {
5780        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
5781    }
5782}
5783
5784/// Request for response to listing InsightsConfigs.
5785#[derive(Clone, Default, PartialEq)]
5786#[non_exhaustive]
5787pub struct ListInsightsConfigsResponse {
5788    /// The list of InsightsConfigs.
5789    pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
5790
5791    /// A token identifying a page of results the server should return.
5792    pub next_page_token: std::string::String,
5793
5794    /// Locations that could not be reached.
5795    pub unreachable: std::vec::Vec<std::string::String>,
5796
5797    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5798}
5799
5800impl ListInsightsConfigsResponse {
5801    pub fn new() -> Self {
5802        std::default::Default::default()
5803    }
5804
5805    /// Sets the value of [insights_configs][crate::model::ListInsightsConfigsResponse::insights_configs].
5806    pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
5807    where
5808        T: std::iter::IntoIterator<Item = V>,
5809        V: std::convert::Into<crate::model::InsightsConfig>,
5810    {
5811        use std::iter::Iterator;
5812        self.insights_configs = v.into_iter().map(|i| i.into()).collect();
5813        self
5814    }
5815
5816    /// Sets the value of [next_page_token][crate::model::ListInsightsConfigsResponse::next_page_token].
5817    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5818        self.next_page_token = v.into();
5819        self
5820    }
5821
5822    /// Sets the value of [unreachable][crate::model::ListInsightsConfigsResponse::unreachable].
5823    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5824    where
5825        T: std::iter::IntoIterator<Item = V>,
5826        V: std::convert::Into<std::string::String>,
5827    {
5828        use std::iter::Iterator;
5829        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5830        self
5831    }
5832}
5833
5834impl wkt::message::Message for ListInsightsConfigsResponse {
5835    fn typename() -> &'static str {
5836        "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
5837    }
5838}
5839
5840#[doc(hidden)]
5841impl gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
5842    type PageItem = crate::model::InsightsConfig;
5843
5844    fn items(self) -> std::vec::Vec<Self::PageItem> {
5845        self.insights_configs
5846    }
5847
5848    fn next_page_token(&self) -> std::string::String {
5849        use std::clone::Clone;
5850        self.next_page_token.clone()
5851    }
5852}
5853
5854/// Request for deleting an InsightsConfig.
5855#[derive(Clone, Default, PartialEq)]
5856#[non_exhaustive]
5857pub struct DeleteInsightsConfigRequest {
5858    /// Required. Value for parent.
5859    pub name: std::string::String,
5860
5861    /// Optional. An optional request ID to identify requests. Specify a unique
5862    /// request ID so that if you must retry your request, the server will know to
5863    /// ignore the request if it has already been completed. The server will
5864    /// guarantee that for at least 60 minutes after the first request.
5865    ///
5866    /// For example, consider a situation where you make an initial request and the
5867    /// request times out. If you make the request again with the same request
5868    /// ID, the server can check if original operation with the same request ID
5869    /// was received, and if so, will ignore the second request. This prevents
5870    /// clients from accidentally creating duplicate commitments.
5871    ///
5872    /// The request ID must be a valid UUID with the exception that zero UUID is
5873    /// not supported (00000000-0000-0000-0000-000000000000).
5874    pub request_id: std::string::String,
5875
5876    /// Optional. If set, validate the request, but do not actually post it.
5877    pub validate_only: bool,
5878
5879    /// Optional. This checksum is computed by the server based on the value of
5880    /// other fields, and may be sent on update and delete requests to ensure the
5881    /// client has an up-to-date value before proceeding.
5882    pub etag: std::string::String,
5883
5884    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5885}
5886
5887impl DeleteInsightsConfigRequest {
5888    pub fn new() -> Self {
5889        std::default::Default::default()
5890    }
5891
5892    /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
5893    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5894        self.name = v.into();
5895        self
5896    }
5897
5898    /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
5899    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5900        self.request_id = v.into();
5901        self
5902    }
5903
5904    /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
5905    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5906        self.validate_only = v.into();
5907        self
5908    }
5909
5910    /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
5911    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5912        self.etag = v.into();
5913        self
5914    }
5915}
5916
5917impl wkt::message::Message for DeleteInsightsConfigRequest {
5918    fn typename() -> &'static str {
5919        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
5920    }
5921}
5922
5923/// Request for updating an InsightsConfig.
5924#[derive(Clone, Default, PartialEq)]
5925#[non_exhaustive]
5926pub struct UpdateInsightsConfigRequest {
5927    /// Required. The resource being updated.
5928    pub insights_config: std::option::Option<crate::model::InsightsConfig>,
5929
5930    /// Optional. An optional request ID to identify requests. Specify a unique
5931    /// request ID so that if you must retry your request, the server will know to
5932    /// ignore the request if it has already been completed. The server will
5933    /// guarantee that for at least 60 minutes after the first request.
5934    ///
5935    /// For example, consider a situation where you make an initial request and the
5936    /// request times out. If you make the request again with the same request
5937    /// ID, the server can check if original operation with the same request ID
5938    /// was received, and if so, will ignore the second request. This prevents
5939    /// clients from accidentally creating duplicate commitments.
5940    ///
5941    /// The request ID must be a valid UUID with the exception that zero UUID is
5942    /// not supported (00000000-0000-0000-0000-000000000000).
5943    pub request_id: std::string::String,
5944
5945    /// Optional. If set to true, and the insightsConfig is not found a new
5946    /// insightsConfig will be created. In this situation `update_mask` is ignored.
5947    /// The creation will succeed only if the input insightsConfig has all the
5948    /// necessary information (e.g a github_config with both  user_oauth_token and
5949    /// installation_id properties).
5950    pub allow_missing: bool,
5951
5952    /// Optional. If set, validate the request, but do not actually post it.
5953    pub validate_only: bool,
5954
5955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5956}
5957
5958impl UpdateInsightsConfigRequest {
5959    pub fn new() -> Self {
5960        std::default::Default::default()
5961    }
5962
5963    /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
5964    pub fn set_insights_config<T>(mut self, v: T) -> Self
5965    where
5966        T: std::convert::Into<crate::model::InsightsConfig>,
5967    {
5968        self.insights_config = std::option::Option::Some(v.into());
5969        self
5970    }
5971
5972    /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
5973    pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
5974    where
5975        T: std::convert::Into<crate::model::InsightsConfig>,
5976    {
5977        self.insights_config = v.map(|x| x.into());
5978        self
5979    }
5980
5981    /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
5982    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5983        self.request_id = v.into();
5984        self
5985    }
5986
5987    /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
5988    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5989        self.allow_missing = v.into();
5990        self
5991    }
5992
5993    /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
5994    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5995        self.validate_only = v.into();
5996        self
5997    }
5998}
5999
6000impl wkt::message::Message for UpdateInsightsConfigRequest {
6001    fn typename() -> &'static str {
6002        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
6003    }
6004}
6005
6006/// SystemProvider is a list of providers that are owned by Developer Connect.
6007///
6008/// # Working with unknown values
6009///
6010/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6011/// additional enum variants at any time. Adding new variants is not considered
6012/// a breaking change. Applications should write their code in anticipation of:
6013///
6014/// - New values appearing in future releases of the client library, **and**
6015/// - New values received dynamically, without application changes.
6016///
6017/// Please consult the [Working with enums] section in the user guide for some
6018/// guidelines.
6019///
6020/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6021#[derive(Clone, Debug, PartialEq)]
6022#[non_exhaustive]
6023pub enum SystemProvider {
6024    /// No system provider specified.
6025    Unspecified,
6026    /// GitHub provider.
6027    /// Scopes can be found at
6028    /// <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes>
6029    Github,
6030    /// GitLab provider.
6031    /// Scopes can be found at
6032    /// <https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes>
6033    Gitlab,
6034    /// Google provider.
6035    /// Recommended scopes:
6036    /// `https://www.googleapis.com/auth/drive.readonly`,
6037    /// `https://www.googleapis.com/auth/documents.readonly`
6038    Google,
6039    /// Sentry provider.
6040    /// Scopes can be found at
6041    /// <https://docs.sentry.io/api/permissions/>
6042    Sentry,
6043    /// Rovo provider.
6044    /// Must select the "rovo" scope.
6045    Rovo,
6046    /// New Relic provider.
6047    /// No scopes are allowed.
6048    NewRelic,
6049    /// Datastax provider.
6050    /// No scopes are allowed.
6051    Datastax,
6052    /// Dynatrace provider.
6053    Dynatrace,
6054    /// If set, the enum was initialized with an unknown value.
6055    ///
6056    /// Applications can examine the value using [SystemProvider::value] or
6057    /// [SystemProvider::name].
6058    UnknownValue(system_provider::UnknownValue),
6059}
6060
6061#[doc(hidden)]
6062pub mod system_provider {
6063    #[allow(unused_imports)]
6064    use super::*;
6065    #[derive(Clone, Debug, PartialEq)]
6066    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6067}
6068
6069impl SystemProvider {
6070    /// Gets the enum value.
6071    ///
6072    /// Returns `None` if the enum contains an unknown value deserialized from
6073    /// the string representation of enums.
6074    pub fn value(&self) -> std::option::Option<i32> {
6075        match self {
6076            Self::Unspecified => std::option::Option::Some(0),
6077            Self::Github => std::option::Option::Some(1),
6078            Self::Gitlab => std::option::Option::Some(2),
6079            Self::Google => std::option::Option::Some(3),
6080            Self::Sentry => std::option::Option::Some(4),
6081            Self::Rovo => std::option::Option::Some(5),
6082            Self::NewRelic => std::option::Option::Some(6),
6083            Self::Datastax => std::option::Option::Some(7),
6084            Self::Dynatrace => std::option::Option::Some(8),
6085            Self::UnknownValue(u) => u.0.value(),
6086        }
6087    }
6088
6089    /// Gets the enum value as a string.
6090    ///
6091    /// Returns `None` if the enum contains an unknown value deserialized from
6092    /// the integer representation of enums.
6093    pub fn name(&self) -> std::option::Option<&str> {
6094        match self {
6095            Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
6096            Self::Github => std::option::Option::Some("GITHUB"),
6097            Self::Gitlab => std::option::Option::Some("GITLAB"),
6098            Self::Google => std::option::Option::Some("GOOGLE"),
6099            Self::Sentry => std::option::Option::Some("SENTRY"),
6100            Self::Rovo => std::option::Option::Some("ROVO"),
6101            Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
6102            Self::Datastax => std::option::Option::Some("DATASTAX"),
6103            Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
6104            Self::UnknownValue(u) => u.0.name(),
6105        }
6106    }
6107}
6108
6109impl std::default::Default for SystemProvider {
6110    fn default() -> Self {
6111        use std::convert::From;
6112        Self::from(0)
6113    }
6114}
6115
6116impl std::fmt::Display for SystemProvider {
6117    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6118        wkt::internal::display_enum(f, self.name(), self.value())
6119    }
6120}
6121
6122impl std::convert::From<i32> for SystemProvider {
6123    fn from(value: i32) -> Self {
6124        match value {
6125            0 => Self::Unspecified,
6126            1 => Self::Github,
6127            2 => Self::Gitlab,
6128            3 => Self::Google,
6129            4 => Self::Sentry,
6130            5 => Self::Rovo,
6131            6 => Self::NewRelic,
6132            7 => Self::Datastax,
6133            8 => Self::Dynatrace,
6134            _ => Self::UnknownValue(system_provider::UnknownValue(
6135                wkt::internal::UnknownEnumValue::Integer(value),
6136            )),
6137        }
6138    }
6139}
6140
6141impl std::convert::From<&str> for SystemProvider {
6142    fn from(value: &str) -> Self {
6143        use std::string::ToString;
6144        match value {
6145            "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
6146            "GITHUB" => Self::Github,
6147            "GITLAB" => Self::Gitlab,
6148            "GOOGLE" => Self::Google,
6149            "SENTRY" => Self::Sentry,
6150            "ROVO" => Self::Rovo,
6151            "NEW_RELIC" => Self::NewRelic,
6152            "DATASTAX" => Self::Datastax,
6153            "DYNATRACE" => Self::Dynatrace,
6154            _ => Self::UnknownValue(system_provider::UnknownValue(
6155                wkt::internal::UnknownEnumValue::String(value.to_string()),
6156            )),
6157        }
6158    }
6159}
6160
6161impl serde::ser::Serialize for SystemProvider {
6162    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6163    where
6164        S: serde::Serializer,
6165    {
6166        match self {
6167            Self::Unspecified => serializer.serialize_i32(0),
6168            Self::Github => serializer.serialize_i32(1),
6169            Self::Gitlab => serializer.serialize_i32(2),
6170            Self::Google => serializer.serialize_i32(3),
6171            Self::Sentry => serializer.serialize_i32(4),
6172            Self::Rovo => serializer.serialize_i32(5),
6173            Self::NewRelic => serializer.serialize_i32(6),
6174            Self::Datastax => serializer.serialize_i32(7),
6175            Self::Dynatrace => serializer.serialize_i32(8),
6176            Self::UnknownValue(u) => u.0.serialize(serializer),
6177        }
6178    }
6179}
6180
6181impl<'de> serde::de::Deserialize<'de> for SystemProvider {
6182    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6183    where
6184        D: serde::Deserializer<'de>,
6185    {
6186        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
6187            ".google.cloud.developerconnect.v1.SystemProvider",
6188        ))
6189    }
6190}