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