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