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 serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36/// Message describing Connection object
37#[serde_with::serde_as]
38#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
39#[serde(default, rename_all = "camelCase")]
40#[non_exhaustive]
41pub struct Connection {
42    /// Identifier. The resource name of the connection, in the format
43    /// `projects/{project}/locations/{location}/connections/{connection_id}`.
44    #[serde(skip_serializing_if = "std::string::String::is_empty")]
45    pub name: std::string::String,
46
47    /// Output only. [Output only] Create timestamp
48    #[serde(skip_serializing_if = "std::option::Option::is_none")]
49    pub create_time: std::option::Option<wkt::Timestamp>,
50
51    /// Output only. [Output only] Update timestamp
52    #[serde(skip_serializing_if = "std::option::Option::is_none")]
53    pub update_time: std::option::Option<wkt::Timestamp>,
54
55    /// Output only. [Output only] Delete timestamp
56    #[serde(skip_serializing_if = "std::option::Option::is_none")]
57    pub delete_time: std::option::Option<wkt::Timestamp>,
58
59    /// Optional. Labels as key value pairs
60    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
61    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
62
63    /// Output only. Installation state of the Connection.
64    #[serde(skip_serializing_if = "std::option::Option::is_none")]
65    pub installation_state: std::option::Option<crate::model::InstallationState>,
66
67    /// Optional. If disabled is set to true, functionality is disabled for this
68    /// connection. Repository based API methods and webhooks processing for
69    /// repositories in this connection will be disabled.
70    pub disabled: bool,
71
72    /// Output only. Set to true when the connection is being set up or updated in
73    /// the background.
74    pub reconciling: bool,
75
76    /// Optional. Allows clients to store small amounts of arbitrary data.
77    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
78    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
79
80    /// Optional. This checksum is computed by the server based on the value of
81    /// other fields, and may be sent on update and delete requests to ensure the
82    /// client has an up-to-date value before proceeding.
83    #[serde(skip_serializing_if = "std::string::String::is_empty")]
84    pub etag: std::string::String,
85
86    /// Output only. A system-assigned unique identifier for a the
87    /// GitRepositoryLink.
88    #[serde(skip_serializing_if = "std::string::String::is_empty")]
89    pub uid: std::string::String,
90
91    /// Optional. The crypto key configuration. This field is used by the
92    /// Customer-Managed Encryption Keys (CMEK) feature.
93    #[serde(skip_serializing_if = "std::option::Option::is_none")]
94    pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
95
96    /// Configuration for the connection depending on the type of provider.
97    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
98    pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
99
100    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
101    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
102}
103
104impl Connection {
105    pub fn new() -> Self {
106        std::default::Default::default()
107    }
108
109    /// Sets the value of [name][crate::model::Connection::name].
110    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111        self.name = v.into();
112        self
113    }
114
115    /// Sets the value of [create_time][crate::model::Connection::create_time].
116    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
117        mut self,
118        v: T,
119    ) -> Self {
120        self.create_time = v.into();
121        self
122    }
123
124    /// Sets the value of [update_time][crate::model::Connection::update_time].
125    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
126        mut self,
127        v: T,
128    ) -> Self {
129        self.update_time = v.into();
130        self
131    }
132
133    /// Sets the value of [delete_time][crate::model::Connection::delete_time].
134    pub fn set_delete_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
135        mut self,
136        v: T,
137    ) -> Self {
138        self.delete_time = v.into();
139        self
140    }
141
142    /// Sets the value of [installation_state][crate::model::Connection::installation_state].
143    pub fn set_installation_state<
144        T: std::convert::Into<std::option::Option<crate::model::InstallationState>>,
145    >(
146        mut self,
147        v: T,
148    ) -> Self {
149        self.installation_state = v.into();
150        self
151    }
152
153    /// Sets the value of [disabled][crate::model::Connection::disabled].
154    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
155        self.disabled = v.into();
156        self
157    }
158
159    /// Sets the value of [reconciling][crate::model::Connection::reconciling].
160    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
161        self.reconciling = v.into();
162        self
163    }
164
165    /// Sets the value of [etag][crate::model::Connection::etag].
166    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
167        self.etag = v.into();
168        self
169    }
170
171    /// Sets the value of [uid][crate::model::Connection::uid].
172    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
173        self.uid = v.into();
174        self
175    }
176
177    /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
178    pub fn set_crypto_key_config<
179        T: std::convert::Into<std::option::Option<crate::model::CryptoKeyConfig>>,
180    >(
181        mut self,
182        v: T,
183    ) -> Self {
184        self.crypto_key_config = v.into();
185        self
186    }
187
188    /// Sets the value of [labels][crate::model::Connection::labels].
189    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
190    where
191        T: std::iter::IntoIterator<Item = (K, V)>,
192        K: std::convert::Into<std::string::String>,
193        V: std::convert::Into<std::string::String>,
194    {
195        use std::iter::Iterator;
196        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
197        self
198    }
199
200    /// Sets the value of [annotations][crate::model::Connection::annotations].
201    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
202    where
203        T: std::iter::IntoIterator<Item = (K, V)>,
204        K: std::convert::Into<std::string::String>,
205        V: std::convert::Into<std::string::String>,
206    {
207        use std::iter::Iterator;
208        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
209        self
210    }
211
212    /// Sets the value of [connection_config][crate::model::Connection::connection_config].
213    ///
214    /// Note that all the setters affecting `connection_config` are mutually
215    /// exclusive.
216    pub fn set_connection_config<
217        T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
218    >(
219        mut self,
220        v: T,
221    ) -> Self {
222        self.connection_config = v.into();
223        self
224    }
225
226    /// The value of [connection_config][crate::model::Connection::connection_config]
227    /// if it holds a `GithubConfig`, `None` if the field is not set or
228    /// holds a different branch.
229    pub fn github_config(
230        &self,
231    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
232        #[allow(unreachable_patterns)]
233        self.connection_config.as_ref().and_then(|v| match v {
234            crate::model::connection::ConnectionConfig::GithubConfig(v) => {
235                std::option::Option::Some(v)
236            }
237            _ => std::option::Option::None,
238        })
239    }
240
241    /// The value of [connection_config][crate::model::Connection::connection_config]
242    /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
243    /// holds a different branch.
244    pub fn github_enterprise_config(
245        &self,
246    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
247        #[allow(unreachable_patterns)]
248        self.connection_config.as_ref().and_then(|v| match v {
249            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
250                std::option::Option::Some(v)
251            }
252            _ => std::option::Option::None,
253        })
254    }
255
256    /// The value of [connection_config][crate::model::Connection::connection_config]
257    /// if it holds a `GitlabConfig`, `None` if the field is not set or
258    /// holds a different branch.
259    pub fn gitlab_config(
260        &self,
261    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
262        #[allow(unreachable_patterns)]
263        self.connection_config.as_ref().and_then(|v| match v {
264            crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
265                std::option::Option::Some(v)
266            }
267            _ => std::option::Option::None,
268        })
269    }
270
271    /// The value of [connection_config][crate::model::Connection::connection_config]
272    /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
273    /// holds a different branch.
274    pub fn gitlab_enterprise_config(
275        &self,
276    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
277        #[allow(unreachable_patterns)]
278        self.connection_config.as_ref().and_then(|v| match v {
279            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
280                std::option::Option::Some(v)
281            }
282            _ => std::option::Option::None,
283        })
284    }
285
286    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
287    /// to hold a `GithubConfig`.
288    ///
289    /// Note that all the setters affecting `connection_config` are
290    /// mutually exclusive.
291    pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
292        mut self,
293        v: T,
294    ) -> Self {
295        self.connection_config = std::option::Option::Some(
296            crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
297        );
298        self
299    }
300
301    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
302    /// to hold a `GithubEnterpriseConfig`.
303    ///
304    /// Note that all the setters affecting `connection_config` are
305    /// mutually exclusive.
306    pub fn set_github_enterprise_config<
307        T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
308    >(
309        mut self,
310        v: T,
311    ) -> Self {
312        self.connection_config = std::option::Option::Some(
313            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
314        );
315        self
316    }
317
318    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
319    /// to hold a `GitlabConfig`.
320    ///
321    /// Note that all the setters affecting `connection_config` are
322    /// mutually exclusive.
323    pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
324        mut self,
325        v: T,
326    ) -> Self {
327        self.connection_config = std::option::Option::Some(
328            crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
329        );
330        self
331    }
332
333    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
334    /// to hold a `GitlabEnterpriseConfig`.
335    ///
336    /// Note that all the setters affecting `connection_config` are
337    /// mutually exclusive.
338    pub fn set_gitlab_enterprise_config<
339        T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
340    >(
341        mut self,
342        v: T,
343    ) -> Self {
344        self.connection_config = std::option::Option::Some(
345            crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
346        );
347        self
348    }
349}
350
351impl wkt::message::Message for Connection {
352    fn typename() -> &'static str {
353        "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
354    }
355}
356
357/// Defines additional types related to [Connection].
358pub mod connection {
359    #[allow(unused_imports)]
360    use super::*;
361
362    /// Configuration for the connection depending on the type of provider.
363    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
364    #[serde(rename_all = "camelCase")]
365    #[non_exhaustive]
366    pub enum ConnectionConfig {
367        /// Configuration for connections to github.com.
368        GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
369        /// Configuration for connections to an instance of GitHub Enterprise.
370        GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
371        /// Configuration for connections to gitlab.com.
372        GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
373        /// Configuration for connections to an instance of GitLab Enterprise.
374        GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
375    }
376}
377
378/// The crypto key configuration. This field is used by the Customer-managed
379/// encryption keys (CMEK) feature.
380#[serde_with::serde_as]
381#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
382#[serde(default, rename_all = "camelCase")]
383#[non_exhaustive]
384pub struct CryptoKeyConfig {
385    /// Required. The name of the key which is used to encrypt/decrypt customer
386    /// data. For key in Cloud KMS, the key should be in the format of
387    /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
388    #[serde(skip_serializing_if = "std::string::String::is_empty")]
389    pub key_reference: std::string::String,
390
391    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
392    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
393}
394
395impl CryptoKeyConfig {
396    pub fn new() -> Self {
397        std::default::Default::default()
398    }
399
400    /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
401    pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
402        self.key_reference = v.into();
403        self
404    }
405}
406
407impl wkt::message::Message for CryptoKeyConfig {
408    fn typename() -> &'static str {
409        "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
410    }
411}
412
413/// Describes stage and necessary actions to be taken by the
414/// user to complete the installation. Used for GitHub and GitHub Enterprise
415/// based connections.
416#[serde_with::serde_as]
417#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
418#[serde(default, rename_all = "camelCase")]
419#[non_exhaustive]
420pub struct InstallationState {
421    /// Output only. Current step of the installation process.
422    pub stage: crate::model::installation_state::Stage,
423
424    /// Output only. Message of what the user should do next to continue the
425    /// installation. Empty string if the installation is already complete.
426    #[serde(skip_serializing_if = "std::string::String::is_empty")]
427    pub message: std::string::String,
428
429    /// Output only. Link to follow for next action. Empty string if the
430    /// installation is already complete.
431    #[serde(skip_serializing_if = "std::string::String::is_empty")]
432    pub action_uri: std::string::String,
433
434    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
435    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
436}
437
438impl InstallationState {
439    pub fn new() -> Self {
440        std::default::Default::default()
441    }
442
443    /// Sets the value of [stage][crate::model::InstallationState::stage].
444    pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
445        mut self,
446        v: T,
447    ) -> Self {
448        self.stage = v.into();
449        self
450    }
451
452    /// Sets the value of [message][crate::model::InstallationState::message].
453    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
454        self.message = v.into();
455        self
456    }
457
458    /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
459    pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
460        self.action_uri = v.into();
461        self
462    }
463}
464
465impl wkt::message::Message for InstallationState {
466    fn typename() -> &'static str {
467        "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
468    }
469}
470
471/// Defines additional types related to [InstallationState].
472pub mod installation_state {
473    #[allow(unused_imports)]
474    use super::*;
475
476    /// Stage of the installation process.
477    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
478    pub struct Stage(i32);
479
480    impl Stage {
481        /// No stage specified.
482        pub const STAGE_UNSPECIFIED: Stage = Stage::new(0);
483
484        /// Only for GitHub Enterprise. An App creation has been requested.
485        /// The user needs to confirm the creation in their GitHub enterprise host.
486        pub const PENDING_CREATE_APP: Stage = Stage::new(1);
487
488        /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
489        pub const PENDING_USER_OAUTH: Stage = Stage::new(2);
490
491        /// User needs to follow the link to install the GitHub (or Enterprise) App.
492        pub const PENDING_INSTALL_APP: Stage = Stage::new(3);
493
494        /// Installation process has been completed.
495        pub const COMPLETE: Stage = Stage::new(10);
496
497        /// Creates a new Stage instance.
498        pub(crate) const fn new(value: i32) -> Self {
499            Self(value)
500        }
501
502        /// Gets the enum value.
503        pub fn value(&self) -> i32 {
504            self.0
505        }
506
507        /// Gets the enum value as a string.
508        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
509            match self.0 {
510                0 => std::borrow::Cow::Borrowed("STAGE_UNSPECIFIED"),
511                1 => std::borrow::Cow::Borrowed("PENDING_CREATE_APP"),
512                2 => std::borrow::Cow::Borrowed("PENDING_USER_OAUTH"),
513                3 => std::borrow::Cow::Borrowed("PENDING_INSTALL_APP"),
514                10 => std::borrow::Cow::Borrowed("COMPLETE"),
515                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
516            }
517        }
518
519        /// Creates an enum value from the value name.
520        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
521            match name {
522                "STAGE_UNSPECIFIED" => std::option::Option::Some(Self::STAGE_UNSPECIFIED),
523                "PENDING_CREATE_APP" => std::option::Option::Some(Self::PENDING_CREATE_APP),
524                "PENDING_USER_OAUTH" => std::option::Option::Some(Self::PENDING_USER_OAUTH),
525                "PENDING_INSTALL_APP" => std::option::Option::Some(Self::PENDING_INSTALL_APP),
526                "COMPLETE" => std::option::Option::Some(Self::COMPLETE),
527                _ => std::option::Option::None,
528            }
529        }
530    }
531
532    impl std::convert::From<i32> for Stage {
533        fn from(value: i32) -> Self {
534            Self::new(value)
535        }
536    }
537
538    impl std::default::Default for Stage {
539        fn default() -> Self {
540            Self::new(0)
541        }
542    }
543}
544
545/// Configuration for connections to github.com.
546#[serde_with::serde_as]
547#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
548#[serde(default, rename_all = "camelCase")]
549#[non_exhaustive]
550pub struct GitHubConfig {
551    /// Required. Immutable. The GitHub Application that was installed to the
552    /// GitHub user or organization.
553    pub github_app: crate::model::git_hub_config::GitHubApp,
554
555    /// Optional. OAuth credential of the account that authorized the GitHub App.
556    /// It is recommended to use a robot account instead of a human user account.
557    /// The OAuth token must be tied to the GitHub App of this config.
558    #[serde(skip_serializing_if = "std::option::Option::is_none")]
559    pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
560
561    /// Optional. GitHub App installation id.
562    #[serde_as(as = "serde_with::DisplayFromStr")]
563    pub app_installation_id: i64,
564
565    /// Output only. The URI to navigate to in order to manage the installation
566    /// associated with this GitHubConfig.
567    #[serde(skip_serializing_if = "std::string::String::is_empty")]
568    pub installation_uri: std::string::String,
569
570    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
571    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
572}
573
574impl GitHubConfig {
575    pub fn new() -> Self {
576        std::default::Default::default()
577    }
578
579    /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
580    pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
581        mut self,
582        v: T,
583    ) -> Self {
584        self.github_app = v.into();
585        self
586    }
587
588    /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
589    pub fn set_authorizer_credential<
590        T: std::convert::Into<std::option::Option<crate::model::OAuthCredential>>,
591    >(
592        mut self,
593        v: T,
594    ) -> Self {
595        self.authorizer_credential = v.into();
596        self
597    }
598
599    /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
600    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
601        self.app_installation_id = v.into();
602        self
603    }
604
605    /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
606    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
607        mut self,
608        v: T,
609    ) -> Self {
610        self.installation_uri = v.into();
611        self
612    }
613}
614
615impl wkt::message::Message for GitHubConfig {
616    fn typename() -> &'static str {
617        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
618    }
619}
620
621/// Defines additional types related to [GitHubConfig].
622pub mod git_hub_config {
623    #[allow(unused_imports)]
624    use super::*;
625
626    /// Represents the various GitHub Applications that can be installed to a
627    /// GitHub user or organization and used with Developer Connect.
628    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
629    pub struct GitHubApp(i32);
630
631    impl GitHubApp {
632        /// GitHub App not specified.
633        pub const GIT_HUB_APP_UNSPECIFIED: GitHubApp = GitHubApp::new(0);
634
635        /// The Developer Connect GitHub Application.
636        pub const DEVELOPER_CONNECT: GitHubApp = GitHubApp::new(1);
637
638        /// The Firebase GitHub Application.
639        pub const FIREBASE: GitHubApp = GitHubApp::new(2);
640
641        /// Creates a new GitHubApp instance.
642        pub(crate) const fn new(value: i32) -> Self {
643            Self(value)
644        }
645
646        /// Gets the enum value.
647        pub fn value(&self) -> i32 {
648            self.0
649        }
650
651        /// Gets the enum value as a string.
652        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
653            match self.0 {
654                0 => std::borrow::Cow::Borrowed("GIT_HUB_APP_UNSPECIFIED"),
655                1 => std::borrow::Cow::Borrowed("DEVELOPER_CONNECT"),
656                2 => std::borrow::Cow::Borrowed("FIREBASE"),
657                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
658            }
659        }
660
661        /// Creates an enum value from the value name.
662        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
663            match name {
664                "GIT_HUB_APP_UNSPECIFIED" => {
665                    std::option::Option::Some(Self::GIT_HUB_APP_UNSPECIFIED)
666                }
667                "DEVELOPER_CONNECT" => std::option::Option::Some(Self::DEVELOPER_CONNECT),
668                "FIREBASE" => std::option::Option::Some(Self::FIREBASE),
669                _ => std::option::Option::None,
670            }
671        }
672    }
673
674    impl std::convert::From<i32> for GitHubApp {
675        fn from(value: i32) -> Self {
676            Self::new(value)
677        }
678    }
679
680    impl std::default::Default for GitHubApp {
681        fn default() -> Self {
682            Self::new(0)
683        }
684    }
685}
686
687/// Configuration for connections to an instance of GitHub Enterprise.
688#[serde_with::serde_as]
689#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
690#[serde(default, rename_all = "camelCase")]
691#[non_exhaustive]
692pub struct GitHubEnterpriseConfig {
693    /// Required. The URI of the GitHub Enterprise host this connection is for.
694    #[serde(skip_serializing_if = "std::string::String::is_empty")]
695    pub host_uri: std::string::String,
696
697    /// Optional. ID of the GitHub App created from the manifest.
698    #[serde_as(as = "serde_with::DisplayFromStr")]
699    pub app_id: i64,
700
701    /// Output only. The URL-friendly name of the GitHub App.
702    #[serde(skip_serializing_if = "std::string::String::is_empty")]
703    pub app_slug: std::string::String,
704
705    /// Optional. SecretManager resource containing the private key of the GitHub
706    /// App, formatted as `projects/*/secrets/*/versions/*`.
707    #[serde(skip_serializing_if = "std::string::String::is_empty")]
708    pub private_key_secret_version: std::string::String,
709
710    /// Optional. SecretManager resource containing the webhook secret of the
711    /// GitHub App, formatted as `projects/*/secrets/*/versions/*`.
712    #[serde(skip_serializing_if = "std::string::String::is_empty")]
713    pub webhook_secret_secret_version: std::string::String,
714
715    /// Optional. ID of the installation of the GitHub App.
716    #[serde_as(as = "serde_with::DisplayFromStr")]
717    pub app_installation_id: i64,
718
719    /// Output only. The URI to navigate to in order to manage the installation
720    /// associated with this GitHubEnterpriseConfig.
721    #[serde(skip_serializing_if = "std::string::String::is_empty")]
722    pub installation_uri: std::string::String,
723
724    /// Optional. Configuration for using Service Directory to privately connect to
725    /// a GitHub Enterprise server. This should only be set if the GitHub
726    /// Enterprise server is hosted on-premises and not reachable by public
727    /// internet. If this field is left empty, calls to the GitHub Enterprise
728    /// server will be made over the public internet.
729    #[serde(skip_serializing_if = "std::option::Option::is_none")]
730    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
731
732    /// Output only. GitHub Enterprise version installed at the host_uri.
733    #[serde(skip_serializing_if = "std::string::String::is_empty")]
734    pub server_version: std::string::String,
735
736    /// Optional. SSL certificate to use for requests to GitHub Enterprise.
737    #[serde(skip_serializing_if = "std::string::String::is_empty")]
738    pub ssl_ca_certificate: std::string::String,
739
740    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
741    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
742}
743
744impl GitHubEnterpriseConfig {
745    pub fn new() -> Self {
746        std::default::Default::default()
747    }
748
749    /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
750    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
751        self.host_uri = v.into();
752        self
753    }
754
755    /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
756    pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
757        self.app_id = v.into();
758        self
759    }
760
761    /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
762    pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
763        self.app_slug = v.into();
764        self
765    }
766
767    /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
768    pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
769        mut self,
770        v: T,
771    ) -> Self {
772        self.private_key_secret_version = v.into();
773        self
774    }
775
776    /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
777    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
778        mut self,
779        v: T,
780    ) -> Self {
781        self.webhook_secret_secret_version = v.into();
782        self
783    }
784
785    /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
786    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
787        self.app_installation_id = v.into();
788        self
789    }
790
791    /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
792    pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
793        mut self,
794        v: T,
795    ) -> Self {
796        self.installation_uri = v.into();
797        self
798    }
799
800    /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
801    pub fn set_service_directory_config<
802        T: std::convert::Into<std::option::Option<crate::model::ServiceDirectoryConfig>>,
803    >(
804        mut self,
805        v: T,
806    ) -> Self {
807        self.service_directory_config = v.into();
808        self
809    }
810
811    /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
812    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
813        self.server_version = v.into();
814        self
815    }
816
817    /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
818    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
819        mut self,
820        v: T,
821    ) -> Self {
822        self.ssl_ca_certificate = v.into();
823        self
824    }
825}
826
827impl wkt::message::Message for GitHubEnterpriseConfig {
828    fn typename() -> &'static str {
829        "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
830    }
831}
832
833/// ServiceDirectoryConfig represents Service Directory configuration for a
834/// connection.
835#[serde_with::serde_as]
836#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
837#[serde(default, rename_all = "camelCase")]
838#[non_exhaustive]
839pub struct ServiceDirectoryConfig {
840    /// Required. The Service Directory service name.
841    /// Format:
842    /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
843    #[serde(skip_serializing_if = "std::string::String::is_empty")]
844    pub service: std::string::String,
845
846    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
847    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
848}
849
850impl ServiceDirectoryConfig {
851    pub fn new() -> Self {
852        std::default::Default::default()
853    }
854
855    /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
856    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
857        self.service = v.into();
858        self
859    }
860}
861
862impl wkt::message::Message for ServiceDirectoryConfig {
863    fn typename() -> &'static str {
864        "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
865    }
866}
867
868/// Represents an OAuth token of the account that authorized the Connection,
869/// and associated metadata.
870#[serde_with::serde_as]
871#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
872#[serde(default, rename_all = "camelCase")]
873#[non_exhaustive]
874pub struct OAuthCredential {
875    /// Required. A SecretManager resource containing the OAuth token that
876    /// authorizes the connection. Format: `projects/*/secrets/*/versions/*`.
877    #[serde(skip_serializing_if = "std::string::String::is_empty")]
878    pub oauth_token_secret_version: std::string::String,
879
880    /// Output only. The username associated with this token.
881    #[serde(skip_serializing_if = "std::string::String::is_empty")]
882    pub username: std::string::String,
883
884    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
885    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
886}
887
888impl OAuthCredential {
889    pub fn new() -> Self {
890        std::default::Default::default()
891    }
892
893    /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
894    pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
895        mut self,
896        v: T,
897    ) -> Self {
898        self.oauth_token_secret_version = v.into();
899        self
900    }
901
902    /// Sets the value of [username][crate::model::OAuthCredential::username].
903    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
904        self.username = v.into();
905        self
906    }
907}
908
909impl wkt::message::Message for OAuthCredential {
910    fn typename() -> &'static str {
911        "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
912    }
913}
914
915/// Configuration for connections to gitlab.com.
916#[serde_with::serde_as]
917#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
918#[serde(default, rename_all = "camelCase")]
919#[non_exhaustive]
920pub struct GitLabConfig {
921    /// Required. Immutable. SecretManager resource containing the webhook secret
922    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This
923    /// is used to validate webhooks.
924    #[serde(skip_serializing_if = "std::string::String::is_empty")]
925    pub webhook_secret_secret_version: std::string::String,
926
927    /// Required. A GitLab personal access token with the minimum `read_api` scope
928    /// access and a minimum role of `reporter`. The GitLab Projects visible to
929    /// this Personal Access Token will control which Projects Developer Connect
930    /// has access to.
931    #[serde(skip_serializing_if = "std::option::Option::is_none")]
932    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
933
934    /// Required. A GitLab personal access token with the minimum `api` scope
935    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
936    /// this Personal Access Token will control which Projects Developer Connect
937    /// has access to.
938    #[serde(skip_serializing_if = "std::option::Option::is_none")]
939    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
940
941    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
942    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
943}
944
945impl GitLabConfig {
946    pub fn new() -> Self {
947        std::default::Default::default()
948    }
949
950    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
951    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
952        mut self,
953        v: T,
954    ) -> Self {
955        self.webhook_secret_secret_version = v.into();
956        self
957    }
958
959    /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
960    pub fn set_read_authorizer_credential<
961        T: std::convert::Into<std::option::Option<crate::model::UserCredential>>,
962    >(
963        mut self,
964        v: T,
965    ) -> Self {
966        self.read_authorizer_credential = v.into();
967        self
968    }
969
970    /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
971    pub fn set_authorizer_credential<
972        T: std::convert::Into<std::option::Option<crate::model::UserCredential>>,
973    >(
974        mut self,
975        v: T,
976    ) -> Self {
977        self.authorizer_credential = v.into();
978        self
979    }
980}
981
982impl wkt::message::Message for GitLabConfig {
983    fn typename() -> &'static str {
984        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
985    }
986}
987
988/// Represents a personal access token that authorized the Connection,
989/// and associated metadata.
990#[serde_with::serde_as]
991#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
992#[serde(default, rename_all = "camelCase")]
993#[non_exhaustive]
994pub struct UserCredential {
995    /// Required. A SecretManager resource containing the user token that
996    /// authorizes the Developer Connect connection. Format:
997    /// `projects/*/secrets/*/versions/*`.
998    #[serde(skip_serializing_if = "std::string::String::is_empty")]
999    pub user_token_secret_version: std::string::String,
1000
1001    /// Output only. The username associated with this token.
1002    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1003    pub username: std::string::String,
1004
1005    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1006    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1007}
1008
1009impl UserCredential {
1010    pub fn new() -> Self {
1011        std::default::Default::default()
1012    }
1013
1014    /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
1015    pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
1016        mut self,
1017        v: T,
1018    ) -> Self {
1019        self.user_token_secret_version = v.into();
1020        self
1021    }
1022
1023    /// Sets the value of [username][crate::model::UserCredential::username].
1024    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1025        self.username = v.into();
1026        self
1027    }
1028}
1029
1030impl wkt::message::Message for UserCredential {
1031    fn typename() -> &'static str {
1032        "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
1033    }
1034}
1035
1036/// Configuration for connections to an instance of GitLab Enterprise.
1037#[serde_with::serde_as]
1038#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1039#[serde(default, rename_all = "camelCase")]
1040#[non_exhaustive]
1041pub struct GitLabEnterpriseConfig {
1042    /// Required. The URI of the GitLab Enterprise host this connection is for.
1043    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1044    pub host_uri: std::string::String,
1045
1046    /// Required. Immutable. SecretManager resource containing the webhook secret
1047    /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This
1048    /// is used to validate webhooks.
1049    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1050    pub webhook_secret_secret_version: std::string::String,
1051
1052    /// Required. A GitLab personal access token with the minimum `read_api` scope
1053    /// access and a minimum role of `reporter`. The GitLab Projects visible to
1054    /// this Personal Access Token will control which Projects Developer Connect
1055    /// has access to.
1056    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1057    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1058
1059    /// Required. A GitLab personal access token with the minimum `api` scope
1060    /// access and a minimum role of `maintainer`. The GitLab Projects visible to
1061    /// this Personal Access Token will control which Projects Developer Connect
1062    /// has access to.
1063    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1064    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1065
1066    /// Optional. Configuration for using Service Directory to privately connect to
1067    /// a GitLab Enterprise instance. This should only be set if the GitLab
1068    /// Enterprise server is hosted on-premises and not reachable by public
1069    /// internet. If this field is left empty, calls to the GitLab Enterprise
1070    /// server will be made over the public internet.
1071    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1072    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1073
1074    /// Optional. SSL Certificate Authority certificate to use for requests to
1075    /// GitLab Enterprise instance.
1076    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1077    pub ssl_ca_certificate: std::string::String,
1078
1079    /// Output only. Version of the GitLab Enterprise server running on the
1080    /// `host_uri`.
1081    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1082    pub server_version: std::string::String,
1083
1084    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1085    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1086}
1087
1088impl GitLabEnterpriseConfig {
1089    pub fn new() -> Self {
1090        std::default::Default::default()
1091    }
1092
1093    /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
1094    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1095        self.host_uri = v.into();
1096        self
1097    }
1098
1099    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
1100    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1101        mut self,
1102        v: T,
1103    ) -> Self {
1104        self.webhook_secret_secret_version = v.into();
1105        self
1106    }
1107
1108    /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
1109    pub fn set_read_authorizer_credential<
1110        T: std::convert::Into<std::option::Option<crate::model::UserCredential>>,
1111    >(
1112        mut self,
1113        v: T,
1114    ) -> Self {
1115        self.read_authorizer_credential = v.into();
1116        self
1117    }
1118
1119    /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
1120    pub fn set_authorizer_credential<
1121        T: std::convert::Into<std::option::Option<crate::model::UserCredential>>,
1122    >(
1123        mut self,
1124        v: T,
1125    ) -> Self {
1126        self.authorizer_credential = v.into();
1127        self
1128    }
1129
1130    /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
1131    pub fn set_service_directory_config<
1132        T: std::convert::Into<std::option::Option<crate::model::ServiceDirectoryConfig>>,
1133    >(
1134        mut self,
1135        v: T,
1136    ) -> Self {
1137        self.service_directory_config = v.into();
1138        self
1139    }
1140
1141    /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
1142    pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1143        mut self,
1144        v: T,
1145    ) -> Self {
1146        self.ssl_ca_certificate = v.into();
1147        self
1148    }
1149
1150    /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
1151    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1152        self.server_version = v.into();
1153        self
1154    }
1155}
1156
1157impl wkt::message::Message for GitLabEnterpriseConfig {
1158    fn typename() -> &'static str {
1159        "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
1160    }
1161}
1162
1163/// Message for requesting list of Connections
1164#[serde_with::serde_as]
1165#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1166#[serde(default, rename_all = "camelCase")]
1167#[non_exhaustive]
1168pub struct ListConnectionsRequest {
1169    /// Required. Parent value for ListConnectionsRequest
1170    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1171    pub parent: std::string::String,
1172
1173    /// Optional. Requested page size. Server may return fewer items than
1174    /// requested. If unspecified, server will pick an appropriate default.
1175    pub page_size: i32,
1176
1177    /// Optional. A token identifying a page of results the server should return.
1178    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1179    pub page_token: std::string::String,
1180
1181    /// Optional. Filtering results
1182    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1183    pub filter: std::string::String,
1184
1185    /// Optional. Hint for how to order the results
1186    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1187    pub order_by: std::string::String,
1188
1189    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1190    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1191}
1192
1193impl ListConnectionsRequest {
1194    pub fn new() -> Self {
1195        std::default::Default::default()
1196    }
1197
1198    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
1199    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1200        self.parent = v.into();
1201        self
1202    }
1203
1204    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
1205    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1206        self.page_size = v.into();
1207        self
1208    }
1209
1210    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
1211    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1212        self.page_token = v.into();
1213        self
1214    }
1215
1216    /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
1217    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1218        self.filter = v.into();
1219        self
1220    }
1221
1222    /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
1223    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1224        self.order_by = v.into();
1225        self
1226    }
1227}
1228
1229impl wkt::message::Message for ListConnectionsRequest {
1230    fn typename() -> &'static str {
1231        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
1232    }
1233}
1234
1235/// Message for response to listing Connections
1236#[serde_with::serde_as]
1237#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1238#[serde(default, rename_all = "camelCase")]
1239#[non_exhaustive]
1240pub struct ListConnectionsResponse {
1241    /// The list of Connection
1242    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1243    pub connections: std::vec::Vec<crate::model::Connection>,
1244
1245    /// A token identifying a page of results the server should return.
1246    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1247    pub next_page_token: std::string::String,
1248
1249    /// Locations that could not be reached.
1250    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1251    pub unreachable: std::vec::Vec<std::string::String>,
1252
1253    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1254    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1255}
1256
1257impl ListConnectionsResponse {
1258    pub fn new() -> Self {
1259        std::default::Default::default()
1260    }
1261
1262    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
1263    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1264        self.next_page_token = v.into();
1265        self
1266    }
1267
1268    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
1269    pub fn set_connections<T, V>(mut self, v: T) -> Self
1270    where
1271        T: std::iter::IntoIterator<Item = V>,
1272        V: std::convert::Into<crate::model::Connection>,
1273    {
1274        use std::iter::Iterator;
1275        self.connections = v.into_iter().map(|i| i.into()).collect();
1276        self
1277    }
1278
1279    /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
1280    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1281    where
1282        T: std::iter::IntoIterator<Item = V>,
1283        V: std::convert::Into<std::string::String>,
1284    {
1285        use std::iter::Iterator;
1286        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1287        self
1288    }
1289}
1290
1291impl wkt::message::Message for ListConnectionsResponse {
1292    fn typename() -> &'static str {
1293        "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
1294    }
1295}
1296
1297#[doc(hidden)]
1298impl gax::paginator::internal::PageableResponse for ListConnectionsResponse {
1299    type PageItem = crate::model::Connection;
1300
1301    fn items(self) -> std::vec::Vec<Self::PageItem> {
1302        self.connections
1303    }
1304
1305    fn next_page_token(&self) -> std::string::String {
1306        use std::clone::Clone;
1307        self.next_page_token.clone()
1308    }
1309}
1310
1311/// Message for getting a Connection
1312#[serde_with::serde_as]
1313#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1314#[serde(default, rename_all = "camelCase")]
1315#[non_exhaustive]
1316pub struct GetConnectionRequest {
1317    /// Required. Name of the resource
1318    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1319    pub name: std::string::String,
1320
1321    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1322    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1323}
1324
1325impl GetConnectionRequest {
1326    pub fn new() -> Self {
1327        std::default::Default::default()
1328    }
1329
1330    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
1331    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1332        self.name = v.into();
1333        self
1334    }
1335}
1336
1337impl wkt::message::Message for GetConnectionRequest {
1338    fn typename() -> &'static str {
1339        "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
1340    }
1341}
1342
1343/// Message for creating a Connection
1344#[serde_with::serde_as]
1345#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1346#[serde(default, rename_all = "camelCase")]
1347#[non_exhaustive]
1348pub struct CreateConnectionRequest {
1349    /// Required. Value for parent.
1350    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1351    pub parent: std::string::String,
1352
1353    /// Required. Id of the requesting object
1354    /// If auto-generating Id server-side, remove this field and
1355    /// connection_id from the method_signature of Create RPC
1356    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1357    pub connection_id: std::string::String,
1358
1359    /// Required. The resource being created
1360    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1361    pub connection: std::option::Option<crate::model::Connection>,
1362
1363    /// Optional. An optional request ID to identify requests. Specify a unique
1364    /// request ID so that if you must retry your request, the server will know to
1365    /// ignore the request if it has already been completed. The server will
1366    /// guarantee that for at least 60 minutes since the first request.
1367    ///
1368    /// For example, consider a situation where you make an initial request and the
1369    /// request times out. If you make the request again with the same request
1370    /// ID, the server can check if original operation with the same request ID
1371    /// was received, and if so, will ignore the second request. This prevents
1372    /// clients from accidentally creating duplicate commitments.
1373    ///
1374    /// The request ID must be a valid UUID with the exception that zero UUID is
1375    /// not supported (00000000-0000-0000-0000-000000000000).
1376    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1377    pub request_id: std::string::String,
1378
1379    /// Optional. If set, validate the request, but do not actually post it.
1380    pub validate_only: bool,
1381
1382    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1383    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1384}
1385
1386impl CreateConnectionRequest {
1387    pub fn new() -> Self {
1388        std::default::Default::default()
1389    }
1390
1391    /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
1392    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1393        self.parent = v.into();
1394        self
1395    }
1396
1397    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
1398    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1399        self.connection_id = v.into();
1400        self
1401    }
1402
1403    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
1404    pub fn set_connection<T: std::convert::Into<std::option::Option<crate::model::Connection>>>(
1405        mut self,
1406        v: T,
1407    ) -> Self {
1408        self.connection = v.into();
1409        self
1410    }
1411
1412    /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
1413    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1414        self.request_id = v.into();
1415        self
1416    }
1417
1418    /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
1419    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1420        self.validate_only = v.into();
1421        self
1422    }
1423}
1424
1425impl wkt::message::Message for CreateConnectionRequest {
1426    fn typename() -> &'static str {
1427        "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
1428    }
1429}
1430
1431/// Message for updating a Connection
1432#[serde_with::serde_as]
1433#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1434#[serde(default, rename_all = "camelCase")]
1435#[non_exhaustive]
1436pub struct UpdateConnectionRequest {
1437    /// Required. Field mask is used to specify the fields to be overwritten in the
1438    /// Connection resource by the update.
1439    /// The fields specified in the update_mask are relative to the resource, not
1440    /// the full request. A field will be overwritten if it is in the mask. If the
1441    /// user does not provide a mask then all fields will be overwritten.
1442    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1443    pub update_mask: std::option::Option<wkt::FieldMask>,
1444
1445    /// Required. The resource being updated
1446    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1447    pub connection: std::option::Option<crate::model::Connection>,
1448
1449    /// Optional. An optional request ID to identify requests. Specify a unique
1450    /// request ID so that if you must retry your request, the server will know to
1451    /// ignore the request if it has already been completed. The server will
1452    /// guarantee that for at least 60 minutes since the first request.
1453    ///
1454    /// For example, consider a situation where you make an initial request and the
1455    /// request times out. If you make the request again with the same request
1456    /// ID, the server can check if original operation with the same request ID
1457    /// was received, and if so, will ignore the second request. This prevents
1458    /// clients from accidentally creating duplicate commitments.
1459    ///
1460    /// The request ID must be a valid UUID with the exception that zero UUID is
1461    /// not supported (00000000-0000-0000-0000-000000000000).
1462    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1463    pub request_id: std::string::String,
1464
1465    /// Optional. If set to true, and the connection is not found a new connection
1466    /// will be created. In this situation `update_mask` is ignored.
1467    /// The creation will succeed only if the input connection has all the
1468    /// necessary information (e.g a github_config with both  user_oauth_token and
1469    /// installation_id properties).
1470    pub allow_missing: bool,
1471
1472    /// Optional. If set, validate the request, but do not actually post it.
1473    pub validate_only: bool,
1474
1475    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1476    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1477}
1478
1479impl UpdateConnectionRequest {
1480    pub fn new() -> Self {
1481        std::default::Default::default()
1482    }
1483
1484    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
1485    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1486        mut self,
1487        v: T,
1488    ) -> Self {
1489        self.update_mask = v.into();
1490        self
1491    }
1492
1493    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
1494    pub fn set_connection<T: std::convert::Into<std::option::Option<crate::model::Connection>>>(
1495        mut self,
1496        v: T,
1497    ) -> Self {
1498        self.connection = v.into();
1499        self
1500    }
1501
1502    /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
1503    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1504        self.request_id = v.into();
1505        self
1506    }
1507
1508    /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
1509    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1510        self.allow_missing = v.into();
1511        self
1512    }
1513
1514    /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
1515    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1516        self.validate_only = v.into();
1517        self
1518    }
1519}
1520
1521impl wkt::message::Message for UpdateConnectionRequest {
1522    fn typename() -> &'static str {
1523        "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
1524    }
1525}
1526
1527/// Message for deleting a Connection
1528#[serde_with::serde_as]
1529#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1530#[serde(default, rename_all = "camelCase")]
1531#[non_exhaustive]
1532pub struct DeleteConnectionRequest {
1533    /// Required. Name of the resource
1534    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1535    pub name: std::string::String,
1536
1537    /// Optional. An optional request ID to identify requests. Specify a unique
1538    /// request ID so that if you must retry your request, the server will know to
1539    /// ignore the request if it has already been completed. The server will
1540    /// guarantee that for at least 60 minutes after the first request.
1541    ///
1542    /// For example, consider a situation where you make an initial request and the
1543    /// request times out. If you make the request again with the same request
1544    /// ID, the server can check if original operation with the same request ID
1545    /// was received, and if so, will ignore the second request. This prevents
1546    /// clients from accidentally creating duplicate commitments.
1547    ///
1548    /// The request ID must be a valid UUID with the exception that zero UUID is
1549    /// not supported (00000000-0000-0000-0000-000000000000).
1550    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1551    pub request_id: std::string::String,
1552
1553    /// Optional. If set, validate the request, but do not actually post it.
1554    pub validate_only: bool,
1555
1556    /// Optional. The current etag of the Connection.
1557    /// If an etag is provided and does not match the current etag of the
1558    /// Connection, deletion will be blocked and an ABORTED error will be returned.
1559    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1560    pub etag: std::string::String,
1561
1562    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1563    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1564}
1565
1566impl DeleteConnectionRequest {
1567    pub fn new() -> Self {
1568        std::default::Default::default()
1569    }
1570
1571    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
1572    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1573        self.name = v.into();
1574        self
1575    }
1576
1577    /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
1578    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1579        self.request_id = v.into();
1580        self
1581    }
1582
1583    /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
1584    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1585        self.validate_only = v.into();
1586        self
1587    }
1588
1589    /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
1590    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1591        self.etag = v.into();
1592        self
1593    }
1594}
1595
1596impl wkt::message::Message for DeleteConnectionRequest {
1597    fn typename() -> &'static str {
1598        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
1599    }
1600}
1601
1602/// Represents the metadata of the long-running operation.
1603#[serde_with::serde_as]
1604#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1605#[serde(default, rename_all = "camelCase")]
1606#[non_exhaustive]
1607pub struct OperationMetadata {
1608    /// Output only. The time the operation was created.
1609    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1610    pub create_time: std::option::Option<wkt::Timestamp>,
1611
1612    /// Output only. The time the operation finished running.
1613    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1614    pub end_time: std::option::Option<wkt::Timestamp>,
1615
1616    /// Output only. Server-defined resource path for the target of the operation.
1617    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1618    pub target: std::string::String,
1619
1620    /// Output only. Name of the verb executed by the operation.
1621    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1622    pub verb: std::string::String,
1623
1624    /// Output only. Human-readable status of the operation, if any.
1625    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1626    pub status_message: std::string::String,
1627
1628    /// Output only. Identifies whether the user has requested cancellation
1629    /// of the operation. Operations that have been cancelled successfully
1630    /// have
1631    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
1632    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
1633    /// corresponding to `Code.CANCELLED`.
1634    ///
1635    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
1636    /// [google.rpc.Status.code]: rpc::model::Status::code
1637    pub requested_cancellation: bool,
1638
1639    /// Output only. API version used to start the operation.
1640    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1641    pub api_version: std::string::String,
1642
1643    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1644    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1645}
1646
1647impl OperationMetadata {
1648    pub fn new() -> Self {
1649        std::default::Default::default()
1650    }
1651
1652    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1653    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1654        mut self,
1655        v: T,
1656    ) -> Self {
1657        self.create_time = v.into();
1658        self
1659    }
1660
1661    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1662    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1663        mut self,
1664        v: T,
1665    ) -> Self {
1666        self.end_time = v.into();
1667        self
1668    }
1669
1670    /// Sets the value of [target][crate::model::OperationMetadata::target].
1671    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1672        self.target = v.into();
1673        self
1674    }
1675
1676    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1677    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1678        self.verb = v.into();
1679        self
1680    }
1681
1682    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
1683    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1684        self.status_message = v.into();
1685        self
1686    }
1687
1688    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
1689    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1690        self.requested_cancellation = v.into();
1691        self
1692    }
1693
1694    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1695    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1696        self.api_version = v.into();
1697        self
1698    }
1699}
1700
1701impl wkt::message::Message for OperationMetadata {
1702    fn typename() -> &'static str {
1703        "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
1704    }
1705}
1706
1707/// Message describing the GitRepositoryLink object
1708#[serde_with::serde_as]
1709#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1710#[serde(default, rename_all = "camelCase")]
1711#[non_exhaustive]
1712pub struct GitRepositoryLink {
1713    /// Identifier. Resource name of the repository, in the format
1714    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
1715    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1716    pub name: std::string::String,
1717
1718    /// Required. Git Clone URI.
1719    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1720    pub clone_uri: std::string::String,
1721
1722    /// Output only. [Output only] Create timestamp
1723    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1724    pub create_time: std::option::Option<wkt::Timestamp>,
1725
1726    /// Output only. [Output only] Update timestamp
1727    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1728    pub update_time: std::option::Option<wkt::Timestamp>,
1729
1730    /// Output only. [Output only] Delete timestamp
1731    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1732    pub delete_time: std::option::Option<wkt::Timestamp>,
1733
1734    /// Optional. Labels as key value pairs
1735    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1736    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1737
1738    /// Optional. This checksum is computed by the server based on the value of
1739    /// other fields, and may be sent on update and delete requests to ensure the
1740    /// client has an up-to-date value before proceeding.
1741    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1742    pub etag: std::string::String,
1743
1744    /// Output only. Set to true when the connection is being set up or updated in
1745    /// the background.
1746    pub reconciling: bool,
1747
1748    /// Optional. Allows clients to store small amounts of arbitrary data.
1749    #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1750    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
1751
1752    /// Output only. A system-assigned unique identifier for a the
1753    /// GitRepositoryLink.
1754    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1755    pub uid: std::string::String,
1756
1757    /// Output only. External ID of the webhook created for the repository.
1758    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1759    pub webhook_id: std::string::String,
1760
1761    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1762    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1763}
1764
1765impl GitRepositoryLink {
1766    pub fn new() -> Self {
1767        std::default::Default::default()
1768    }
1769
1770    /// Sets the value of [name][crate::model::GitRepositoryLink::name].
1771    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1772        self.name = v.into();
1773        self
1774    }
1775
1776    /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
1777    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1778        self.clone_uri = v.into();
1779        self
1780    }
1781
1782    /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
1783    pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1784        mut self,
1785        v: T,
1786    ) -> Self {
1787        self.create_time = v.into();
1788        self
1789    }
1790
1791    /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
1792    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1793        mut self,
1794        v: T,
1795    ) -> Self {
1796        self.update_time = v.into();
1797        self
1798    }
1799
1800    /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
1801    pub fn set_delete_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1802        mut self,
1803        v: T,
1804    ) -> Self {
1805        self.delete_time = v.into();
1806        self
1807    }
1808
1809    /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
1810    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1811        self.etag = v.into();
1812        self
1813    }
1814
1815    /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
1816    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1817        self.reconciling = v.into();
1818        self
1819    }
1820
1821    /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
1822    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1823        self.uid = v.into();
1824        self
1825    }
1826
1827    /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
1828    pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1829        self.webhook_id = v.into();
1830        self
1831    }
1832
1833    /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
1834    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1835    where
1836        T: std::iter::IntoIterator<Item = (K, V)>,
1837        K: std::convert::Into<std::string::String>,
1838        V: std::convert::Into<std::string::String>,
1839    {
1840        use std::iter::Iterator;
1841        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1842        self
1843    }
1844
1845    /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
1846    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1847    where
1848        T: std::iter::IntoIterator<Item = (K, V)>,
1849        K: std::convert::Into<std::string::String>,
1850        V: std::convert::Into<std::string::String>,
1851    {
1852        use std::iter::Iterator;
1853        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1854        self
1855    }
1856}
1857
1858impl wkt::message::Message for GitRepositoryLink {
1859    fn typename() -> &'static str {
1860        "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
1861    }
1862}
1863
1864/// Message for creating a GitRepositoryLink
1865#[serde_with::serde_as]
1866#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1867#[serde(default, rename_all = "camelCase")]
1868#[non_exhaustive]
1869pub struct CreateGitRepositoryLinkRequest {
1870    /// Required. Value for parent.
1871    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1872    pub parent: std::string::String,
1873
1874    /// Required. The resource being created
1875    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1876    pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
1877
1878    /// Required. The ID to use for the repository, which will become the final
1879    /// component of the repository's resource name. This ID should be unique in
1880    /// the connection. Allows alphanumeric characters and any of
1881    /// -._~%!$&'()*+,;=@.
1882    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1883    pub git_repository_link_id: std::string::String,
1884
1885    /// Optional. An optional request ID to identify requests. Specify a unique
1886    /// request ID so that if you must retry your request, the server will know to
1887    /// ignore the request if it has already been completed. The server will
1888    /// guarantee that for at least 60 minutes since the first request.
1889    ///
1890    /// For example, consider a situation where you make an initial request and the
1891    /// request times out. If you make the request again with the same request
1892    /// ID, the server can check if original operation with the same request ID
1893    /// was received, and if so, will ignore the second request. This prevents
1894    /// clients from accidentally creating duplicate commitments.
1895    ///
1896    /// The request ID must be a valid UUID with the exception that zero UUID is
1897    /// not supported (00000000-0000-0000-0000-000000000000).
1898    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1899    pub request_id: std::string::String,
1900
1901    /// Optional. If set, validate the request, but do not actually post it.
1902    pub validate_only: bool,
1903
1904    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1905    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1906}
1907
1908impl CreateGitRepositoryLinkRequest {
1909    pub fn new() -> Self {
1910        std::default::Default::default()
1911    }
1912
1913    /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
1914    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1915        self.parent = v.into();
1916        self
1917    }
1918
1919    /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
1920    pub fn set_git_repository_link<
1921        T: std::convert::Into<std::option::Option<crate::model::GitRepositoryLink>>,
1922    >(
1923        mut self,
1924        v: T,
1925    ) -> Self {
1926        self.git_repository_link = v.into();
1927        self
1928    }
1929
1930    /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
1931    pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
1932        mut self,
1933        v: T,
1934    ) -> Self {
1935        self.git_repository_link_id = v.into();
1936        self
1937    }
1938
1939    /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
1940    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1941        self.request_id = v.into();
1942        self
1943    }
1944
1945    /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
1946    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1947        self.validate_only = v.into();
1948        self
1949    }
1950}
1951
1952impl wkt::message::Message for CreateGitRepositoryLinkRequest {
1953    fn typename() -> &'static str {
1954        "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
1955    }
1956}
1957
1958/// Message for deleting a GitRepositoryLink
1959#[serde_with::serde_as]
1960#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1961#[serde(default, rename_all = "camelCase")]
1962#[non_exhaustive]
1963pub struct DeleteGitRepositoryLinkRequest {
1964    /// Required. Name of the resource
1965    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1966    pub name: std::string::String,
1967
1968    /// Optional. An optional request ID to identify requests. Specify a unique
1969    /// request ID so that if you must retry your request, the server will know to
1970    /// ignore the request if it has already been completed. The server will
1971    /// guarantee that for at least 60 minutes after the first request.
1972    ///
1973    /// For example, consider a situation where you make an initial request and the
1974    /// request times out. If you make the request again with the same request
1975    /// ID, the server can check if original operation with the same request ID
1976    /// was received, and if so, will ignore the second request. This prevents
1977    /// clients from accidentally creating duplicate commitments.
1978    ///
1979    /// The request ID must be a valid UUID with the exception that zero UUID is
1980    /// not supported (00000000-0000-0000-0000-000000000000).
1981    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1982    pub request_id: std::string::String,
1983
1984    /// Optional. If set, validate the request, but do not actually post it.
1985    pub validate_only: bool,
1986
1987    /// Optional. This checksum is computed by the server based on the value of
1988    /// other fields, and may be sent on update and delete requests to ensure the
1989    /// client has an up-to-date value before proceeding.
1990    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1991    pub etag: std::string::String,
1992
1993    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1994    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1995}
1996
1997impl DeleteGitRepositoryLinkRequest {
1998    pub fn new() -> Self {
1999        std::default::Default::default()
2000    }
2001
2002    /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
2003    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2004        self.name = v.into();
2005        self
2006    }
2007
2008    /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
2009    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2010        self.request_id = v.into();
2011        self
2012    }
2013
2014    /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
2015    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2016        self.validate_only = v.into();
2017        self
2018    }
2019
2020    /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
2021    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2022        self.etag = v.into();
2023        self
2024    }
2025}
2026
2027impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
2028    fn typename() -> &'static str {
2029        "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
2030    }
2031}
2032
2033/// Message for requesting a list of GitRepositoryLinks
2034#[serde_with::serde_as]
2035#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2036#[serde(default, rename_all = "camelCase")]
2037#[non_exhaustive]
2038pub struct ListGitRepositoryLinksRequest {
2039    /// Required. Parent value for ListGitRepositoryLinksRequest
2040    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2041    pub parent: std::string::String,
2042
2043    /// Optional. Requested page size. Server may return fewer items than
2044    /// requested. If unspecified, server will pick an appropriate default.
2045    pub page_size: i32,
2046
2047    /// Optional. A token identifying a page of results the server should return.
2048    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2049    pub page_token: std::string::String,
2050
2051    /// Optional. Filtering results
2052    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2053    pub filter: std::string::String,
2054
2055    /// Optional. Hint for how to order the results
2056    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2057    pub order_by: std::string::String,
2058
2059    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2060    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2061}
2062
2063impl ListGitRepositoryLinksRequest {
2064    pub fn new() -> Self {
2065        std::default::Default::default()
2066    }
2067
2068    /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
2069    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2070        self.parent = v.into();
2071        self
2072    }
2073
2074    /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
2075    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2076        self.page_size = v.into();
2077        self
2078    }
2079
2080    /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
2081    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2082        self.page_token = v.into();
2083        self
2084    }
2085
2086    /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
2087    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2088        self.filter = v.into();
2089        self
2090    }
2091
2092    /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
2093    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2094        self.order_by = v.into();
2095        self
2096    }
2097}
2098
2099impl wkt::message::Message for ListGitRepositoryLinksRequest {
2100    fn typename() -> &'static str {
2101        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
2102    }
2103}
2104
2105/// Message for response to listing GitRepositoryLinks
2106#[serde_with::serde_as]
2107#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2108#[serde(default, rename_all = "camelCase")]
2109#[non_exhaustive]
2110pub struct ListGitRepositoryLinksResponse {
2111    /// The list of GitRepositoryLinks
2112    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2113    pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
2114
2115    /// A token identifying a page of results the server should return.
2116    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2117    pub next_page_token: std::string::String,
2118
2119    /// Locations that could not be reached.
2120    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2121    pub unreachable: std::vec::Vec<std::string::String>,
2122
2123    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2124    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2125}
2126
2127impl ListGitRepositoryLinksResponse {
2128    pub fn new() -> Self {
2129        std::default::Default::default()
2130    }
2131
2132    /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
2133    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2134        self.next_page_token = v.into();
2135        self
2136    }
2137
2138    /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
2139    pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
2140    where
2141        T: std::iter::IntoIterator<Item = V>,
2142        V: std::convert::Into<crate::model::GitRepositoryLink>,
2143    {
2144        use std::iter::Iterator;
2145        self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
2146        self
2147    }
2148
2149    /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
2150    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2151    where
2152        T: std::iter::IntoIterator<Item = V>,
2153        V: std::convert::Into<std::string::String>,
2154    {
2155        use std::iter::Iterator;
2156        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2157        self
2158    }
2159}
2160
2161impl wkt::message::Message for ListGitRepositoryLinksResponse {
2162    fn typename() -> &'static str {
2163        "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
2164    }
2165}
2166
2167#[doc(hidden)]
2168impl gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
2169    type PageItem = crate::model::GitRepositoryLink;
2170
2171    fn items(self) -> std::vec::Vec<Self::PageItem> {
2172        self.git_repository_links
2173    }
2174
2175    fn next_page_token(&self) -> std::string::String {
2176        use std::clone::Clone;
2177        self.next_page_token.clone()
2178    }
2179}
2180
2181/// Message for getting a GitRepositoryLink
2182#[serde_with::serde_as]
2183#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2184#[serde(default, rename_all = "camelCase")]
2185#[non_exhaustive]
2186pub struct GetGitRepositoryLinkRequest {
2187    /// Required. Name of the resource
2188    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2189    pub name: std::string::String,
2190
2191    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2192    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2193}
2194
2195impl GetGitRepositoryLinkRequest {
2196    pub fn new() -> Self {
2197        std::default::Default::default()
2198    }
2199
2200    /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
2201    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2202        self.name = v.into();
2203        self
2204    }
2205}
2206
2207impl wkt::message::Message for GetGitRepositoryLinkRequest {
2208    fn typename() -> &'static str {
2209        "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
2210    }
2211}
2212
2213/// Message for fetching SCM read/write token.
2214#[serde_with::serde_as]
2215#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2216#[serde(default, rename_all = "camelCase")]
2217#[non_exhaustive]
2218pub struct FetchReadWriteTokenRequest {
2219    /// Required. The resource name of the gitRepositoryLink in the format
2220    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
2221    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2222    pub git_repository_link: std::string::String,
2223
2224    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2225    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2226}
2227
2228impl FetchReadWriteTokenRequest {
2229    pub fn new() -> Self {
2230        std::default::Default::default()
2231    }
2232
2233    /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
2234    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
2235        mut self,
2236        v: T,
2237    ) -> Self {
2238        self.git_repository_link = v.into();
2239        self
2240    }
2241}
2242
2243impl wkt::message::Message for FetchReadWriteTokenRequest {
2244    fn typename() -> &'static str {
2245        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
2246    }
2247}
2248
2249/// Message for fetching SCM read token.
2250#[serde_with::serde_as]
2251#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2252#[serde(default, rename_all = "camelCase")]
2253#[non_exhaustive]
2254pub struct FetchReadTokenRequest {
2255    /// Required. The resource name of the gitRepositoryLink in the format
2256    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
2257    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2258    pub git_repository_link: std::string::String,
2259
2260    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2261    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2262}
2263
2264impl FetchReadTokenRequest {
2265    pub fn new() -> Self {
2266        std::default::Default::default()
2267    }
2268
2269    /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
2270    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
2271        mut self,
2272        v: T,
2273    ) -> Self {
2274        self.git_repository_link = v.into();
2275        self
2276    }
2277}
2278
2279impl wkt::message::Message for FetchReadTokenRequest {
2280    fn typename() -> &'static str {
2281        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
2282    }
2283}
2284
2285/// Message for responding to get read token.
2286#[serde_with::serde_as]
2287#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2288#[serde(default, rename_all = "camelCase")]
2289#[non_exhaustive]
2290pub struct FetchReadTokenResponse {
2291    /// The token content.
2292    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2293    pub token: std::string::String,
2294
2295    /// Expiration timestamp. Can be empty if unknown or non-expiring.
2296    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2297    pub expiration_time: std::option::Option<wkt::Timestamp>,
2298
2299    /// The git_username to specify when making a git clone with the
2300    /// token. For example, for GitHub GitRepositoryLinks, this would be
2301    /// "x-access-token"
2302    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2303    pub git_username: std::string::String,
2304
2305    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2306    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2307}
2308
2309impl FetchReadTokenResponse {
2310    pub fn new() -> Self {
2311        std::default::Default::default()
2312    }
2313
2314    /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
2315    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2316        self.token = v.into();
2317        self
2318    }
2319
2320    /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
2321    pub fn set_expiration_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2322        mut self,
2323        v: T,
2324    ) -> Self {
2325        self.expiration_time = v.into();
2326        self
2327    }
2328
2329    /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
2330    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2331        self.git_username = v.into();
2332        self
2333    }
2334}
2335
2336impl wkt::message::Message for FetchReadTokenResponse {
2337    fn typename() -> &'static str {
2338        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
2339    }
2340}
2341
2342/// Message for responding to get read/write token.
2343#[serde_with::serde_as]
2344#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2345#[serde(default, rename_all = "camelCase")]
2346#[non_exhaustive]
2347pub struct FetchReadWriteTokenResponse {
2348    /// The token content.
2349    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2350    pub token: std::string::String,
2351
2352    /// Expiration timestamp. Can be empty if unknown or non-expiring.
2353    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2354    pub expiration_time: std::option::Option<wkt::Timestamp>,
2355
2356    /// The git_username to specify when making a git clone with the
2357    /// token. For example, for GitHub GitRepositoryLinks, this would be
2358    /// "x-access-token"
2359    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2360    pub git_username: std::string::String,
2361
2362    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2363    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2364}
2365
2366impl FetchReadWriteTokenResponse {
2367    pub fn new() -> Self {
2368        std::default::Default::default()
2369    }
2370
2371    /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
2372    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2373        self.token = v.into();
2374        self
2375    }
2376
2377    /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
2378    pub fn set_expiration_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2379        mut self,
2380        v: T,
2381    ) -> Self {
2382        self.expiration_time = v.into();
2383        self
2384    }
2385
2386    /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
2387    pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2388        self.git_username = v.into();
2389        self
2390    }
2391}
2392
2393impl wkt::message::Message for FetchReadWriteTokenResponse {
2394    fn typename() -> &'static str {
2395        "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
2396    }
2397}
2398
2399/// Request message for FetchLinkableGitRepositoriesRequest.
2400#[serde_with::serde_as]
2401#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2402#[serde(default, rename_all = "camelCase")]
2403#[non_exhaustive]
2404pub struct FetchLinkableGitRepositoriesRequest {
2405    /// Required. The name of the Connection.
2406    /// Format: `projects/*/locations/*/connections/*`.
2407    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2408    pub connection: std::string::String,
2409
2410    /// Optional. Number of results to return in the list. Defaults to 20.
2411    pub page_size: i32,
2412
2413    /// Optional. Page start.
2414    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2415    pub page_token: std::string::String,
2416
2417    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2418    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2419}
2420
2421impl FetchLinkableGitRepositoriesRequest {
2422    pub fn new() -> Self {
2423        std::default::Default::default()
2424    }
2425
2426    /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
2427    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2428        self.connection = v.into();
2429        self
2430    }
2431
2432    /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
2433    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2434        self.page_size = v.into();
2435        self
2436    }
2437
2438    /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
2439    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2440        self.page_token = v.into();
2441        self
2442    }
2443}
2444
2445impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
2446    fn typename() -> &'static str {
2447        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
2448    }
2449}
2450
2451/// Response message for FetchLinkableGitRepositories.
2452#[serde_with::serde_as]
2453#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2454#[serde(default, rename_all = "camelCase")]
2455#[non_exhaustive]
2456pub struct FetchLinkableGitRepositoriesResponse {
2457    /// The git repositories that can be linked to the connection.
2458    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2459    pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
2460
2461    /// A token identifying a page of results the server should return.
2462    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2463    pub next_page_token: std::string::String,
2464
2465    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2466    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2467}
2468
2469impl FetchLinkableGitRepositoriesResponse {
2470    pub fn new() -> Self {
2471        std::default::Default::default()
2472    }
2473
2474    /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
2475    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2476        self.next_page_token = v.into();
2477        self
2478    }
2479
2480    /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
2481    pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
2482    where
2483        T: std::iter::IntoIterator<Item = V>,
2484        V: std::convert::Into<crate::model::LinkableGitRepository>,
2485    {
2486        use std::iter::Iterator;
2487        self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
2488        self
2489    }
2490}
2491
2492impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
2493    fn typename() -> &'static str {
2494        "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
2495    }
2496}
2497
2498#[doc(hidden)]
2499impl gax::paginator::internal::PageableResponse for FetchLinkableGitRepositoriesResponse {
2500    type PageItem = crate::model::LinkableGitRepository;
2501
2502    fn items(self) -> std::vec::Vec<Self::PageItem> {
2503        self.linkable_git_repositories
2504    }
2505
2506    fn next_page_token(&self) -> std::string::String {
2507        use std::clone::Clone;
2508        self.next_page_token.clone()
2509    }
2510}
2511
2512/// LinkableGitRepository represents a git repository that can be linked to a
2513/// connection.
2514#[serde_with::serde_as]
2515#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2516#[serde(default, rename_all = "camelCase")]
2517#[non_exhaustive]
2518pub struct LinkableGitRepository {
2519    /// The clone uri of the repository.
2520    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2521    pub clone_uri: std::string::String,
2522
2523    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2524    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2525}
2526
2527impl LinkableGitRepository {
2528    pub fn new() -> Self {
2529        std::default::Default::default()
2530    }
2531
2532    /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
2533    pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2534        self.clone_uri = v.into();
2535        self
2536    }
2537}
2538
2539impl wkt::message::Message for LinkableGitRepository {
2540    fn typename() -> &'static str {
2541        "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
2542    }
2543}
2544
2545/// Request for fetching github installations.
2546#[serde_with::serde_as]
2547#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2548#[serde(default, rename_all = "camelCase")]
2549#[non_exhaustive]
2550pub struct FetchGitHubInstallationsRequest {
2551    /// Required. The resource name of the connection in the format
2552    /// `projects/*/locations/*/connections/*`.
2553    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2554    pub connection: std::string::String,
2555
2556    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2557    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2558}
2559
2560impl FetchGitHubInstallationsRequest {
2561    pub fn new() -> Self {
2562        std::default::Default::default()
2563    }
2564
2565    /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
2566    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2567        self.connection = v.into();
2568        self
2569    }
2570}
2571
2572impl wkt::message::Message for FetchGitHubInstallationsRequest {
2573    fn typename() -> &'static str {
2574        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
2575    }
2576}
2577
2578/// Response of fetching github installations.
2579#[serde_with::serde_as]
2580#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2581#[serde(default, rename_all = "camelCase")]
2582#[non_exhaustive]
2583pub struct FetchGitHubInstallationsResponse {
2584    /// List of installations available to the OAuth user (for github.com)
2585    /// or all the installations (for GitHub enterprise).
2586    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2587    pub installations:
2588        std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
2589
2590    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2591    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2592}
2593
2594impl FetchGitHubInstallationsResponse {
2595    pub fn new() -> Self {
2596        std::default::Default::default()
2597    }
2598
2599    /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
2600    pub fn set_installations<T, V>(mut self, v: T) -> Self
2601    where
2602        T: std::iter::IntoIterator<Item = V>,
2603        V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
2604    {
2605        use std::iter::Iterator;
2606        self.installations = v.into_iter().map(|i| i.into()).collect();
2607        self
2608    }
2609}
2610
2611impl wkt::message::Message for FetchGitHubInstallationsResponse {
2612    fn typename() -> &'static str {
2613        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
2614    }
2615}
2616
2617/// Defines additional types related to [FetchGitHubInstallationsResponse].
2618pub mod fetch_git_hub_installations_response {
2619    #[allow(unused_imports)]
2620    use super::*;
2621
2622    /// Represents an installation of the GitHub App.
2623    #[serde_with::serde_as]
2624    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2625    #[serde(default, rename_all = "camelCase")]
2626    #[non_exhaustive]
2627    pub struct Installation {
2628        /// ID of the installation in GitHub.
2629        #[serde_as(as = "serde_with::DisplayFromStr")]
2630        pub id: i64,
2631
2632        /// Name of the GitHub user or organization that owns this installation.
2633        #[serde(skip_serializing_if = "std::string::String::is_empty")]
2634        pub name: std::string::String,
2635
2636        /// Either "user" or "organization".
2637        #[serde(rename = "type")]
2638        #[serde(skip_serializing_if = "std::string::String::is_empty")]
2639        pub r#type: std::string::String,
2640
2641        #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2642        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2643    }
2644
2645    impl Installation {
2646        pub fn new() -> Self {
2647            std::default::Default::default()
2648        }
2649
2650        /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
2651        pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2652            self.id = v.into();
2653            self
2654        }
2655
2656        /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
2657        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2658            self.name = v.into();
2659            self
2660        }
2661
2662        /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
2663        pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2664            self.r#type = v.into();
2665            self
2666        }
2667    }
2668
2669    impl wkt::message::Message for Installation {
2670        fn typename() -> &'static str {
2671            "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
2672        }
2673    }
2674}
2675
2676/// Request for fetching git refs.
2677#[serde_with::serde_as]
2678#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2679#[serde(default, rename_all = "camelCase")]
2680#[non_exhaustive]
2681pub struct FetchGitRefsRequest {
2682    /// Required. The resource name of GitRepositoryLink in the format
2683    /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
2684    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2685    pub git_repository_link: std::string::String,
2686
2687    /// Required. Type of refs to fetch.
2688    pub ref_type: crate::model::fetch_git_refs_request::RefType,
2689
2690    /// Optional. Number of results to return in the list. Default to 20.
2691    pub page_size: i32,
2692
2693    /// Optional. Page start.
2694    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2695    pub page_token: std::string::String,
2696
2697    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2698    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2699}
2700
2701impl FetchGitRefsRequest {
2702    pub fn new() -> Self {
2703        std::default::Default::default()
2704    }
2705
2706    /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
2707    pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
2708        mut self,
2709        v: T,
2710    ) -> Self {
2711        self.git_repository_link = v.into();
2712        self
2713    }
2714
2715    /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
2716    pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
2717        mut self,
2718        v: T,
2719    ) -> Self {
2720        self.ref_type = v.into();
2721        self
2722    }
2723
2724    /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
2725    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2726        self.page_size = v.into();
2727        self
2728    }
2729
2730    /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
2731    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2732        self.page_token = v.into();
2733        self
2734    }
2735}
2736
2737impl wkt::message::Message for FetchGitRefsRequest {
2738    fn typename() -> &'static str {
2739        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
2740    }
2741}
2742
2743/// Defines additional types related to [FetchGitRefsRequest].
2744pub mod fetch_git_refs_request {
2745    #[allow(unused_imports)]
2746    use super::*;
2747
2748    /// Type of refs.
2749    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2750    pub struct RefType(i32);
2751
2752    impl RefType {
2753        /// No type specified.
2754        pub const REF_TYPE_UNSPECIFIED: RefType = RefType::new(0);
2755
2756        /// To fetch tags.
2757        pub const TAG: RefType = RefType::new(1);
2758
2759        /// To fetch branches.
2760        pub const BRANCH: RefType = RefType::new(2);
2761
2762        /// Creates a new RefType instance.
2763        pub(crate) const fn new(value: i32) -> Self {
2764            Self(value)
2765        }
2766
2767        /// Gets the enum value.
2768        pub fn value(&self) -> i32 {
2769            self.0
2770        }
2771
2772        /// Gets the enum value as a string.
2773        pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
2774            match self.0 {
2775                0 => std::borrow::Cow::Borrowed("REF_TYPE_UNSPECIFIED"),
2776                1 => std::borrow::Cow::Borrowed("TAG"),
2777                2 => std::borrow::Cow::Borrowed("BRANCH"),
2778                _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
2779            }
2780        }
2781
2782        /// Creates an enum value from the value name.
2783        pub fn from_str_name(name: &str) -> std::option::Option<Self> {
2784            match name {
2785                "REF_TYPE_UNSPECIFIED" => std::option::Option::Some(Self::REF_TYPE_UNSPECIFIED),
2786                "TAG" => std::option::Option::Some(Self::TAG),
2787                "BRANCH" => std::option::Option::Some(Self::BRANCH),
2788                _ => std::option::Option::None,
2789            }
2790        }
2791    }
2792
2793    impl std::convert::From<i32> for RefType {
2794        fn from(value: i32) -> Self {
2795            Self::new(value)
2796        }
2797    }
2798
2799    impl std::default::Default for RefType {
2800        fn default() -> Self {
2801            Self::new(0)
2802        }
2803    }
2804}
2805
2806/// Response for fetching git refs.
2807#[serde_with::serde_as]
2808#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2809#[serde(default, rename_all = "camelCase")]
2810#[non_exhaustive]
2811pub struct FetchGitRefsResponse {
2812    /// Name of the refs fetched.
2813    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2814    pub ref_names: std::vec::Vec<std::string::String>,
2815
2816    /// A token identifying a page of results the server should return.
2817    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2818    pub next_page_token: std::string::String,
2819
2820    #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2821    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2822}
2823
2824impl FetchGitRefsResponse {
2825    pub fn new() -> Self {
2826        std::default::Default::default()
2827    }
2828
2829    /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
2830    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2831        self.next_page_token = v.into();
2832        self
2833    }
2834
2835    /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
2836    pub fn set_ref_names<T, V>(mut self, v: T) -> Self
2837    where
2838        T: std::iter::IntoIterator<Item = V>,
2839        V: std::convert::Into<std::string::String>,
2840    {
2841        use std::iter::Iterator;
2842        self.ref_names = v.into_iter().map(|i| i.into()).collect();
2843        self
2844    }
2845}
2846
2847impl wkt::message::Message for FetchGitRefsResponse {
2848    fn typename() -> &'static str {
2849        "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
2850    }
2851}